nareshmlx/opencv-pr huggingface dataset:
**File:** doc/CMakeLists.txt
**Change Type:** modified
**Context:** PR #1330: Plantuml - Documentation here: https://pypi.python.org/pypi/sphinxcontrib-plantuml In order to use plantuml extension, it is needed to modif...

**Code Changes:**
```diff
@@ -67,9 +67,14 @@ if(BUILD_DOCS AND HAVE_SPHINX)
   set(OPENCV_DOC_DEPS conf.py ${OPENCV_FILES_REF} ${OPENCV_FILES_REF_PICT}
            ${OPENCV_FILES_UG} ${OPENCV_FILES_TUT} ${OPENCV_FILES_TUT_PICT})
 
+  set(BUILD_PLANTUML "")
+  if(PLANTUML)
+    set(BUILD_PLANTUML "-tplantuml")
+  endif()
+
   if(PDFLATEX_COMPILER)
```

Review comment:
Ok for find_host_program, but for the cache if I remove unset(PLANTUML CACHE) "cmake ." doesn't detect when a user remove plantuml script and rerun "cmake .". The only thing that works is when cmake doesn't find it, then the user install plantuml script and rerun" cmake .". So what behavior do you suggest?
**File:** doc/CMakeLists.txt
**Change Type:** modified
**Context:** PR #1330: Plantuml - Documentation here: https://pypi.python.org/pypi/sphinxcontrib-plantuml In order to use plantuml extension, it is needed to modif...

**Code Changes:**
```diff
@@ -67,9 +67,14 @@ if(BUILD_DOCS AND HAVE_SPHINX)
   set(OPENCV_DOC_DEPS conf.py ${OPENCV_FILES_REF} ${OPENCV_FILES_REF_PICT}
            ${OPENCV_FILES_UG} ${OPENCV_FILES_TUT} ${OPENCV_FILES_TUT_PICT})
 
+  set(BUILD_PLANTUML "")
+  if(PLANTUML)
+    set(BUILD_PLANTUML "-tplantuml")
+  endif()
+
   if(PDFLATEX_COMPILER)
```

Review comment:
> if I remove unset(PLANTUML CACHE) "cmake ." doesn't detect when a user remove plantuml script and rerun "cmake ." True, but that's hardly a common occurrence (and the user can always uncache it himself, if need be). I think the benefits of caching in this case outweigh the drawbacks, plus it's consistent with all the other finders, so I would still suggest to remove the `unset`.
**File:** modules/core/perf/perf_main.cpp
**Change Type:** modified
**Context:** PR #1316: C4447 warning about main function format suppressed.

**Code Changes:**
```diff
@@ -1,3 +1,8 @@
 #include "perf_precomp.hpp"
+#ifdef _MSC_VER
+# if _MSC_VER >= 1700
+#  pragma warning(disable:4447) // Disable warning 'main' signature found without threading model
+# endif
+#endif
 
 CV_PERF_TEST_MAIN(core)
```

Review comment:
I think this should be `_MSC_VER`. Also, maybe we should just disable this globally?
**File:** modules/contrib/src/inputoutput.cpp
**Change Type:** modified
**Context:** PR #1295: Invalid usage of cv::Ptr for arrays fixed
**Review Line:** 30

**Code Changes:**
```diff
-            Ptr<wchar_t> wpath = new wchar_t[size+1];
-            wpath[size] = 0;
-            mbstowcs(wpath, path_f.c_str(), path_f.size());
+            wchar_t wpath[MAX_PATH];
+            size_t copied = mbstowcs(wpath, path_f.c_str(), MAX_PATH);
+            CV_Assert((copied != MAX_PATH) && (copied != (size_t)-1));
             hFind = FindFirstFileExW(wpath, FindExInfoStandard, &FindFileData, FindExSearchNameMatch, NULL, 0);
         #else
             hFind = FindFirstFileA((LPCSTR)path_f.c_str(), &FindFileData);
@@ -47,12 +46,12 @@ namespace cv
                         FindFileData.dwFileAttributes == FILE_ATTRIBUTE_SYSTEM  ||
```

Review comment:
Why did you delete this line?
**File:** modules/contrib/src/inputoutput.cpp
**Change Type:** modified
**Context:** PR #1295: Invalid usage of cv::Ptr for arrays fixed

**Code Changes:**
```diff
@@ -11,7 +11,7 @@
 
 namespace cv
 {
-    std::vector<std::string> Directory::GetListFiles(  const std::string& path, const std::string & exten, bool addPath )
+    std::vector<std::string> Directory::GetListFiles( const std::string& path, const std::string & exten, bool addPath )
     {
         std::vector<std::string> list;
         list.clear();
@@ -25,10 +25,9 @@ namespace cv
```

Review comment:
I think you can just move the declaration of `fname` inside the `#if`. Then you won't need `fname_tmp`.
**File:** modules/contrib/src/inputoutput.cpp
**Change Type:** modified
**Context:** PR #1295: Invalid usage of cv::Ptr for arrays fixed

**Code Changes:**
```diff
@@ -11,7 +11,7 @@
 
 namespace cv
 {
-    std::vector<std::string> Directory::GetListFiles(  const std::string& path, const std::string & exten, bool addPath )
+    std::vector<std::string> Directory::GetListFiles( const std::string& path, const std::string & exten, bool addPath )
     {
         std::vector<std::string> list;
         list.clear();
@@ -25,10 +25,9 @@ namespace cv
```

Review comment:
You might want to put an assert here for the case where the input string is too long.
**File:** modules/contrib/src/inputoutput.cpp
**Change Type:** modified
**Context:** PR #1295: Invalid usage of cv::Ptr for arrays fixed

**Code Changes:**
```diff
@@ -11,7 +11,7 @@
 
 namespace cv
 {
-    std::vector<std::string> Directory::GetListFiles(  const std::string& path, const std::string & exten, bool addPath )
+    std::vector<std::string> Directory::GetListFiles( const std::string& path, const std::string & exten, bool addPath )
     {
         std::vector<std::string> list;
         list.clear();
@@ -25,10 +25,9 @@ namespace cv
```

Review comment:
fname is used in #else branch and common code bellow.
**File:** modules/contrib/src/inputoutput.cpp
**Change Type:** modified
**Context:** PR #1295: Invalid usage of cv::Ptr for arrays fixed

**Code Changes:**
```diff
@@ -11,7 +11,7 @@
 
 namespace cv
 {
-    std::vector<std::string> Directory::GetListFiles(  const std::string& path, const std::string & exten, bool addPath )
+    std::vector<std::string> Directory::GetListFiles( const std::string& path, const std::string & exten, bool addPath )
     {
         std::vector<std::string> list;
         list.clear();
@@ -25,10 +25,9 @@ namespace cv
```

Review comment:
The `#else` branch can declare it too.
**File:** modules/contrib/src/inputoutput.cpp
**Change Type:** modified
**Context:** PR #1295: Invalid usage of cv::Ptr for arrays fixed

**Code Changes:**
```diff
@@ -11,7 +11,7 @@
 
 namespace cv
 {
-    std::vector<std::string> Directory::GetListFiles(  const std::string& path, const std::string & exten, bool addPath )
+    std::vector<std::string> Directory::GetListFiles( const std::string& path, const std::string & exten, bool addPath )
     {
         std::vector<std::string> list;
         list.clear();
@@ -25,10 +25,9 @@ namespace cv
```

Review comment:
This is incorrect. `.size()` is byte length, which may be greater than `MAX_PATH`.
**File:** modules/contrib/src/inputoutput.cpp
**Change Type:** modified
**Context:** PR #1295: Invalid usage of cv::Ptr for arrays fixed

**Code Changes:**
```diff
@@ -11,7 +11,7 @@
 
 namespace cv
 {
-    std::vector<std::string> Directory::GetListFiles(  const std::string& path, const std::string & exten, bool addPath )
+    std::vector<std::string> Directory::GetListFiles( const std::string& path, const std::string & exten, bool addPath )
     {
         std::vector<std::string> list;
         list.clear();
@@ -25,10 +25,9 @@ namespace cv
```

Review comment:
path_f is ANSI string with path, so number of chars == number of symbols. What's whrong here?
**File:** modules/contrib/src/inputoutput.cpp
**Change Type:** modified
**Context:** PR #1295: Invalid usage of cv::Ptr for arrays fixed

**Code Changes:**
```diff
@@ -11,7 +11,7 @@
 
 namespace cv
 {
-    std::vector<std::string> Directory::GetListFiles(  const std::string& path, const std::string & exten, bool addPath )
+    std::vector<std::string> Directory::GetListFiles( const std::string& path, const std::string & exten, bool addPath )
     {
         std::vector<std::string> list;
         list.clear();
@@ -25,10 +25,9 @@ namespace cv
```

Review comment:
Well, how should I put it... the part after the comma. :wink: EDIT: Actually, I suppose the length of the path as an ANSI string must not be longer than `MAX_PATH` either, so this should be fine. At worst, we're breaking edge cases. EDIT EDIT: Although you're allowing one more character than necessary. The terminating NUL is included in `MAX_PATH`.
**File:** modules/contrib/src/inputoutput.cpp
**Change Type:** modified
**Context:** PR #1295: Invalid usage of cv::Ptr for arrays fixed

**Code Changes:**
```diff
@@ -11,7 +11,7 @@
 
 namespace cv
 {
-    std::vector<std::string> Directory::GetListFiles(  const std::string& path, const std::string & exten, bool addPath )
+    std::vector<std::string> Directory::GetListFiles( const std::string& path, const std::string & exten, bool addPath )
     {
         std::vector<std::string> list;
         list.clear();
@@ -25,10 +25,9 @@ namespace cv
```

Review comment:
If `copied` is `MAX_PATH`, this is an out-of-bounds access. And you should probably handle a failed conversion, too. Also, shouldn't there be similar asserts everywhere else?
**File:** cmake/OpenCVCRTLinkage.cmake
**Change Type:** modified
**Context:** PR #1280: WindowsRT availability check reorganized. Build script updated.

**Code Changes:**
```diff
@@ -4,37 +4,39 @@ endif()
 
 #INCLUDE (CheckIncludeFiles)
 
-if (ENABLE_WINRT_MODE)
-  set(HAVE_WINRT True)
+set(HAVE_WINRT FALSE)
 
-  # search Windows Platform SDK
-  message(STATUS "Checking for Windows Platfrom SDK")
```

Review comment:
It's not really a bug, but I'd use uppercase for the boolean constants. It's the canonical form, as seen in the documentation for the `if` command.
**File:** cmake/OpenCVCRTLinkage.cmake
**Change Type:** modified
**Context:** PR #1280: WindowsRT availability check reorganized. Build script updated.

**Code Changes:**
```diff
@@ -4,37 +4,39 @@ endif()
 
 #INCLUDE (CheckIncludeFiles)
 
-if (ENABLE_WINRT_MODE)
-  set(HAVE_WINRT True)
+set(HAVE_WINRT FALSE)
 
-  # search Windows Platform SDK
-  message(STATUS "Checking for Windows Platfrom SDK")
```

Review comment:
Typo in "Platform".
**File:** cmake/OpenCVCRTLinkage.cmake
**Change Type:** modified
**Context:** PR #1280: WindowsRT availability check reorganized. Build script updated.

**Code Changes:**
```diff
@@ -4,37 +4,39 @@ endif()
 
 #INCLUDE (CheckIncludeFiles)
 
-if (ENABLE_WINRT_MODE)
-  set(HAVE_WINRT True)
+set(HAVE_WINRT FALSE)
 
-  # search Windows Platform SDK
-  message(STATUS "Checking for Windows Platfrom SDK")
```

Review comment:
Wouldn't it make more sense to initialize it to false, and set to true if it's found?
**File:** cmake/OpenCVCRTLinkage.cmake
**Change Type:** modified
**Context:** PR #1280: WindowsRT availability check reorganized. Build script updated.

**Code Changes:**
```diff
@@ -4,37 +4,39 @@ endif()
 
 #INCLUDE (CheckIncludeFiles)
 
-if (ENABLE_WINRT_MODE)
-  set(HAVE_WINRT True)
+set(HAVE_WINRT FALSE)
 
-  # search Windows Platform SDK
-  message(STATUS "Checking for Windows Platfrom SDK")
```

Review comment:
I don't think you ever use this variable.
**File:** cmake/OpenCVCRTLinkage.cmake
**Change Type:** modified
**Context:** PR #1280: WindowsRT availability check reorganized. Build script updated.

**Code Changes:**
```diff
@@ -4,37 +4,39 @@ endif()
 
 #INCLUDE (CheckIncludeFiles)
 
-if (ENABLE_WINRT_MODE)
-  set(HAVE_WINRT True)
+set(HAVE_WINRT FALSE)
 
-  # search Windows Platform SDK
-  message(STATUS "Checking for Windows Platfrom SDK")
```

Review comment:
Does this even work? The documentation seems to suggest this should be something like `"-DLINK_LIBRARIES=..."`.
**File:** cmake/OpenCVCRTLinkage.cmake
**Change Type:** modified
**Context:** PR #1280: WindowsRT availability check reorganized. Build script updated.

**Code Changes:**
```diff
@@ -4,37 +4,39 @@ endif()
 
 #INCLUDE (CheckIncludeFiles)
 
-if (ENABLE_WINRT_MODE)
-  set(HAVE_WINRT True)
+set(HAVE_WINRT FALSE)
 
-  # search Windows Platform SDK
-  message(STATUS "Checking for Windows Platfrom SDK")
```

Review comment:
Even if we have both that and that, this CMake invocation may well be using a different compiler. Also, you'll have to adjust this when Visual Studio 2012+N comes out. So is this check really necessary?
**File:** cmake/OpenCVCRTLinkage.cmake
**Change Type:** modified
**Context:** PR #1280: WindowsRT availability check reorganized. Build script updated.

**Code Changes:**
```diff
@@ -4,37 +4,39 @@ endif()
 
 #INCLUDE (CheckIncludeFiles)
 
-if (ENABLE_WINRT_MODE)
-  set(HAVE_WINRT True)
+set(HAVE_WINRT FALSE)
 
-  # search Windows Platform SDK
-  message(STATUS "Checking for Windows Platfrom SDK")
```

Review comment:
It's not a problem with _this_ pull request, but I just want to note that IMHO, `WINRT_MODE` (or similar) would be a more appropriate name.
**File:** cmake/OpenCVCRTLinkage.cmake
**Change Type:** modified
**Context:** PR #1280: WindowsRT availability check reorganized. Build script updated.

**Code Changes:**
```diff
@@ -4,37 +4,39 @@ endif()
 
 #INCLUDE (CheckIncludeFiles)
 
-if (ENABLE_WINRT_MODE)
-  set(HAVE_WINRT True)
+set(HAVE_WINRT FALSE)
 
-  # search Windows Platform SDK
-  message(STATUS "Checking for Windows Platfrom SDK")
```

Review comment:
All winrt related stuff can be build with cl.exe from MSVC 2012 only. Yes, but I think we will have some cmake stuff to remove this workaround.
**File:** cmake/OpenCVCRTLinkage.cmake
**Change Type:** modified
**Context:** PR #1280: WindowsRT availability check reorganized. Build script updated.

**Code Changes:**
```diff
@@ -4,37 +4,39 @@ endif()
 
 #INCLUDE (CheckIncludeFiles)
 
-if (ENABLE_WINRT_MODE)
-  set(HAVE_WINRT True)
+set(HAVE_WINRT FALSE)
 
-  # search Windows Platform SDK
-  message(STATUS "Checking for Windows Platfrom SDK")
```

Review comment:
> All winrt related stuff can be build with cl.exe from MSVC 2012 only. Sure, but so what? If we're going to try to compile a test program anyway, we don't need those preliminary checks.
**File:** modules/highgui/src/cap_dshow.cpp
**Change Type:** modified
**Context:** PR #1235: CvCaptureCAM_DShow::open with an out of bound index inconsistant with V4L (Bug #3201) - DShow wrapper now returns false if we try to open an...

**Code Changes:**
```diff
@@ -3164,18 +3164,18 @@ void CvCaptureCAM_DShow::close()
 // Initialize camera input
 bool CvCaptureCAM_DShow::open( int _index )
 {
-    int try_index = _index;
     int devices = 0;
 
     close();
     devices = VI.listDevices(true);
     if (devices == 0)
```

Review comment:
Fix formatting for if statement.
**File:** modules/highgui/src/cap_dshow.cpp
**Change Type:** modified
**Context:** PR #1235: CvCaptureCAM_DShow::open with an out of bound index inconsistant with V4L (Bug #3201) - DShow wrapper now returns false if we try to open an...

**Code Changes:**
```diff
@@ -3164,18 +3164,18 @@ void CvCaptureCAM_DShow::close()
 // Initialize camera input
 bool CvCaptureCAM_DShow::open( int _index )
 {
-    int try_index = _index;
     int devices = 0;
 
     close();
     devices = VI.listDevices(true);
     if (devices == 0)
```

Review comment:
Shouldn't both of these be `_index`?
**File:** 3rdparty/tbb/CMakeLists.txt
**Change Type:** modified
**Context:** PR #1238: Bump required CMake version - This bumps the required CMake version to 2.8.6. This allows us to remove some checks/workarounds for old CMake...

**Code Changes:**
```diff
@@ -82,24 +82,8 @@ endif()
 set(tbb_tarball "${CMAKE_CURRENT_SOURCE_DIR}/${tbb_ver}_src.tgz")
 set(tbb_src_dir "${CMAKE_CURRENT_BINARY_DIR}/${tbb_ver}")
 
-macro(getMD5 filename varname)
-  if(CMAKE_VERSION VERSION_GREATER 2.8.6)
-    file(MD5 "${filename}" ${varname})
-  else()
-    execute_process(COMMAND ${CMAKE_COMMAND} -E md5sum "${filename}"
-              RESULT_VARIABLE getMD5_RESULT
```

Review comment:
Maybe remove the macro at all?
**File:** 3rdparty/tbb/CMakeLists.txt
**Change Type:** modified
**Context:** PR #1238: Bump required CMake version - This bumps the required CMake version to 2.8.6. This allows us to remove some checks/workarounds for old CMake...

**Code Changes:**
```diff
@@ -82,24 +82,8 @@ endif()
 set(tbb_tarball "${CMAKE_CURRENT_SOURCE_DIR}/${tbb_ver}_src.tgz")
 set(tbb_src_dir "${CMAKE_CURRENT_BINARY_DIR}/${tbb_ver}")
 
-macro(getMD5 filename varname)
-  if(CMAKE_VERSION VERSION_GREATER 2.8.6)
-    file(MD5 "${filename}" ${varname})
-  else()
-    execute_process(COMMAND ${CMAKE_COMMAND} -E md5sum "${filename}"
-              RESULT_VARIABLE getMD5_RESULT
```

Review comment:
Yeah, I'll do that.
**File:** modules/androidcamera/camera_wrapper/camera_wrapper.cpp
**Change Type:** modified
**Context:** PR #1242: Native camera libraries updated. - Android 4.3 support added; ANY camera index support fixed; applyProperties now uses camera->reconnect() i...

**Code Changes:**
```diff
@@ -1,5 +1,8 @@
-#if !defined(ANDROID_r2_2_0) && !defined(ANDROID_r2_3_3) && !defined(ANDROID_r3_0_1) && !defined(ANDROID_r4_0_0) && !defined(ANDROID_r4_0_3) && !defined(ANDROID_r4_1_1) && !defined(ANDROID_r4_2_0)
-# error Building camera wrapper for your version of Android is not supported by OpenCV. You need to modify OpenCV sources in order to compile camera wrapper for your version of Android.
+#if !defined(ANDROID_r2_2_0) && !defined(ANDROID_r2_3_3) && !defined(ANDROID_r3_0_1) && \
+ !defined(ANDROID_r4_0_0) && !defined(ANDROID_r4_0_3) && !defined(ANDROID_r4_1_1) && \
+ !defined(ANDROID_r4_2_0) && !defined(ANDROID_r4_3_0)
+# error Building camera wrapper for your version of Android is not supported by OpenCV.\
+ You need to modify OpenCV sources in order to compile camera wrapper for your version of Android.
 #endif
 
```

Review comment:
Why not use `find_first_not_of`/`find_last_not_of` here?
**File:** modules/androidcamera/camera_wrapper/camera_wrapper.cpp
**Change Type:** modified
**Context:** PR #1242: Native camera libraries updated. - Android 4.3 support added; ANY camera index support fixed; applyProperties now uses camera->reconnect() i...
**Review Line:** 84

**Code Changes:**
```diff
+std::string getProcessName()
+{
+    std::string result;
+    std::ifstream f;
+
+    f.open("/proc/self/cmdline");
+    if (f.is_open())
+    {
+        std::string fullPath;
+        std::getline(f, fullPath, '\0');
+        if (!fullPath.empty())
```

Review comment:
Or you could just use `readlink` on /proc/self/exe. EDIT: Well, I guess you might have wanted to get `argv[0]` and not the real path, in which case carry on.
**File:** modules/androidcamera/camera_wrapper/camera_wrapper.cpp
**Change Type:** modified
**Context:** PR #1242: Native camera libraries updated. - Android 4.3 support added; ANY camera index support fixed; applyProperties now uses camera->reconnect() i...

**Code Changes:**
```diff
@@ -1,5 +1,8 @@
-#if !defined(ANDROID_r2_2_0) && !defined(ANDROID_r2_3_3) && !defined(ANDROID_r3_0_1) && !defined(ANDROID_r4_0_0) && !defined(ANDROID_r4_0_3) && !defined(ANDROID_r4_1_1) && !defined(ANDROID_r4_2_0)
-# error Building camera wrapper for your version of Android is not supported by OpenCV. You need to modify OpenCV sources in order to compile camera wrapper for your version of Android.
+#if !defined(ANDROID_r2_2_0) && !defined(ANDROID_r2_3_3) && !defined(ANDROID_r3_0_1) && \
+ !defined(ANDROID_r4_0_0) && !defined(ANDROID_r4_0_3) && !defined(ANDROID_r4_1_1) && \
+ !defined(ANDROID_r4_2_0) && !defined(ANDROID_r4_3_0)
+# error Building camera wrapper for your version of Android is not supported by OpenCV.\
+ You need to modify OpenCV sources in order to compile camera wrapper for your version of Android.
 #endif
 
```

Review comment:
`basename`?
**File:** modules/androidcamera/camera_wrapper/camera_wrapper.cpp
**Change Type:** modified
**Context:** PR #1242: Native camera libraries updated. - Android 4.3 support added; ANY camera index support fixed; applyProperties now uses camera->reconnect() i...

**Code Changes:**
```diff
@@ -1,5 +1,8 @@
-#if !defined(ANDROID_r2_2_0) && !defined(ANDROID_r2_3_3) && !defined(ANDROID_r3_0_1) && !defined(ANDROID_r4_0_0) && !defined(ANDROID_r4_0_3) && !defined(ANDROID_r4_1_1) && !defined(ANDROID_r4_2_0)
-# error Building camera wrapper for your version of Android is not supported by OpenCV. You need to modify OpenCV sources in order to compile camera wrapper for your version of Android.
+#if !defined(ANDROID_r2_2_0) && !defined(ANDROID_r2_3_3) && !defined(ANDROID_r3_0_1) && \
+ !defined(ANDROID_r4_0_0) && !defined(ANDROID_r4_0_3) && !defined(ANDROID_r4_1_1) && \
+ !defined(ANDROID_r4_2_0) && !defined(ANDROID_r4_3_0)
+# error Building camera wrapper for your version of Android is not supported by OpenCV.\
+ You need to modify OpenCV sources in order to compile camera wrapper for your version of Android.
 #endif
 
```

Review comment:
Typo in "might".
**File:** modules/androidcamera/src/camera_activity.cpp
**Change Type:** modified
**Context:** PR #1242: Native camera libraries updated. - Android 4.3 support added; ANY camera index support fixed; applyProperties now uses camera->reconnect() i...

**Code Changes:**
```diff
@@ -431,14 +431,14 @@ void CameraActivity::applyProperties()
 int CameraActivity::getFrameWidth()
 {
     if (frameWidth <= 0)
-    frameWidth = getProperty(ANDROID_CAMERA_PROPERTY_FRAMEWIDTH);
+        frameWidth = getProperty(ANDROID_CAMERA_PROPERTY_FRAMEWIDTH);
     return frameWidth;
 }
 
 int CameraActivity::getFrameHeight()
```

Review comment:
I don't think you use this anywhere.
**File:** modules/androidcamera/camera_wrapper/camera_wrapper.cpp
**Change Type:** modified
**Context:** PR #1242: Native camera libraries updated. - Android 4.3 support added; ANY camera index support fixed; applyProperties now uses camera->reconnect() i...

**Code Changes:**
```diff
@@ -1,5 +1,8 @@
-#if !defined(ANDROID_r2_2_0) && !defined(ANDROID_r2_3_3) && !defined(ANDROID_r3_0_1) && !defined(ANDROID_r4_0_0) && !defined(ANDROID_r4_0_3) && !defined(ANDROID_r4_1_1) && !defined(ANDROID_r4_2_0)
-# error Building camera wrapper for your version of Android is not supported by OpenCV. You need to modify OpenCV sources in order to compile camera wrapper for your version of Android.
+#if !defined(ANDROID_r2_2_0) && !defined(ANDROID_r2_3_3) && !defined(ANDROID_r3_0_1) && \
+ !defined(ANDROID_r4_0_0) && !defined(ANDROID_r4_0_3) && !defined(ANDROID_r4_1_1) && \
+ !defined(ANDROID_r4_2_0) && !defined(ANDROID_r4_3_0)
+# error Building camera wrapper for your version of Android is not supported by OpenCV.\
+ You need to modify OpenCV sources in order to compile camera wrapper for your version of Android.
 #endif
 
```

Review comment:
Might want to use `'\0'` for the third argument.
**File:** modules/androidcamera/camera_wrapper/camera_wrapper.cpp
**Change Type:** modified
**Context:** PR #1242: Native camera libraries updated. - Android 4.3 support added; ANY camera index support fixed; applyProperties now uses camera->reconnect() i...
**Review Line:** 84

**Code Changes:**
```diff
+std::string getProcessName()
+{
+    std::string result;
+    std::ifstream f;
+
+    f.open("/proc/self/cmdline");
+    if (f.is_open())
+    {
+        std::string fullPath;
+        std::getline(f, fullPath, '\0');
+        if (!fullPath.empty())
```

Review comment:
/proc/<pid>/exe always linked with /system/bin/app_process for Java apps lrwxrwxrwx u0_a4 u0_a4 2000-01-02 03:18 exe -> /system/bin/app_process
**File:** modules/androidcamera/camera_wrapper/camera_wrapper.cpp
**Change Type:** modified
**Context:** PR #1242: Native camera libraries updated. - Android 4.3 support added; ANY camera index support fixed; applyProperties now uses camera->reconnect() i...

**Code Changes:**
```diff
@@ -1,5 +1,8 @@
-#if !defined(ANDROID_r2_2_0) && !defined(ANDROID_r2_3_3) && !defined(ANDROID_r3_0_1) && !defined(ANDROID_r4_0_0) && !defined(ANDROID_r4_0_3) && !defined(ANDROID_r4_1_1) && !defined(ANDROID_r4_2_0)
-# error Building camera wrapper for your version of Android is not supported by OpenCV. You need to modify OpenCV sources in order to compile camera wrapper for your version of Android.
+#if !defined(ANDROID_r2_2_0) && !defined(ANDROID_r2_3_3) && !defined(ANDROID_r3_0_1) && \
+ !defined(ANDROID_r4_0_0) && !defined(ANDROID_r4_0_3) && !defined(ANDROID_r4_1_1) && \
+ !defined(ANDROID_r4_2_0) && !defined(ANDROID_r4_3_0)
+# error Building camera wrapper for your version of Android is not supported by OpenCV.\
+ You need to modify OpenCV sources in order to compile camera wrapper for your version of Android.
 #endif
 
```

Review comment:
Actually, `basename` isn't thread-safe, so it's probably not the best idea, but Android has `basename_r`, you could use that.