nareshmlx/opencv-pr huggingface dataset:
**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:
POSIX basename may modify the parameter. So, it is simpler to make "path magic" by myself.
**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:
Android's doesn't. Check the header.
**File:** modules/core/include/opencv2/core/version.hpp
**Change Type:** modified
**Context:** PR #1252: Restricted Win32 API was fixed in Highgui and some 3rd party libs. - On case of libpng update Patch was added.

**Code Changes:**
```diff
@@ -55,6 +55,9 @@
 #define CVAUX_STR_EXP(__A)  #__A
 #define CVAUX_STR(__A)      CVAUX_STR_EXP(__A)
 
+#define CVAUX_STRW_EXP(__A)  L#__A
+#define CVAUX_STRW(__A)      CVAUX_STRW_EXP(__A)
+
 #if CV_VERSION_REVISION
 #  define CV_VERSION        CVAUX_STR(CV_VERSION_EPOCH) "." CVAUX_STR(CV_VERSION_MAJOR) "." CVAUX_STR(CV_VERSION_MINOR) "." CVAUX_STR(CV_VERSION_REVISION)
 #else
```

Review comment:
Shouldn't this be `CVAUX_STRW_EXP`?
**File:** modules/core/src/dxt.cpp
**Change Type:** modified
**Context:** PR #1233: disabled 64f IPP DFT; added IPP Gaussian filter; added IPP GetRectSubPix... - 1. properly detect and link IPP on Mac 2. disable 64f IPP DFT ...
**Review Line:** 1562

**Code Changes:**
```diff
+            IppDFTGetSizeFunc getSizeFunc = 0;
+            IppDFTInitFunc initFunc = 0;
 
             if( real_transform && stage == 0 )
             {
                 if( depth == CV_32F )
                 {
-                    if( spec_r )
-                        IPPI_CALL( ippsDFTFree_R_32f( (IppsDFTSpec_R_32f*)spec_r ));
-                    IPPI_CALL( ippsDFTInitAlloc_R_32f(
-                        (IppsDFTSpec_R_32f**)&spec_r, len, ipp_norm_flag, ippAlgHintNone ));
```

Review comment:
Since you added the same check to the containing `if`, this is now a tautology.
**File:** modules/core/src/dxt.cpp
**Change Type:** modified
**Context:** PR #1233: disabled 64f IPP DFT; added IPP Gaussian filter; added IPP GetRectSubPix... - 1. properly detect and link IPP on Mac 2. disable 64f IPP DFT ...
**Review Line:** 1565

**Code Changes:**
```diff
-                        IPPI_CALL( ippsDFTFree_R_32f( (IppsDFTSpec_R_32f*)spec_r ));
-                    IPPI_CALL( ippsDFTInitAlloc_R_32f(
-                        (IppsDFTSpec_R_32f**)&spec_r, len, ipp_norm_flag, ippAlgHintNone ));
-                    IPPI_CALL( ippsDFTGetBufSize_R_32f( (IppsDFTSpec_R_32f*)spec_r, &ipp_sz ));
+                    getSizeFunc = ippsDFTGetSize_R_32f;
+                    initFunc = (IppDFTInitFunc)ippsDFTInit_R_32f;
                 }
                 else
                 {
-                    if( spec_r )
-                        IPPI_CALL( ippsDFTFree_R_64f( (IppsDFTSpec_R_64f*)spec_r ));
```

Review comment:
The casts here appear to be unneeded and may mask possible errors. Also, why not use braces?
**File:** modules/core/src/dxt.cpp
**Change Type:** modified
**Context:** PR #1233: disabled 64f IPP DFT; added IPP Gaussian filter; added IPP GetRectSubPix... - 1. properly detect and link IPP on Mac 2. disable 64f IPP DFT ...
**Review Line:** 1562

**Code Changes:**
```diff
+            IppDFTGetSizeFunc getSizeFunc = 0;
+            IppDFTInitFunc initFunc = 0;
 
             if( real_transform && stage == 0 )
             {
                 if( depth == CV_32F )
                 {
-                    if( spec_r )
-                        IPPI_CALL( ippsDFTFree_R_32f( (IppsDFTSpec_R_32f*)spec_r ));
-                    IPPI_CALL( ippsDFTInitAlloc_R_32f(
-                        (IppsDFTSpec_R_32f**)&spec_r, len, ipp_norm_flag, ippAlgHintNone ));
```

Review comment:
the outer check for CV_32F has been added deliberately as a temporary bugfix. When IPP's DFT is fixed, the outer check could be eliminated.
**File:** modules/contrib/src/inputoutput.cpp
**Change Type:** modified
**Context:** PR #1205: WinRT API certification fixes. - All restricted WIN32 API replaced with analogues for all modules, except ts and highgui; ENABLE_WINRT_MODE ...

**Code Changes:**
```diff
@@ -1,5 +1,6 @@
 
 #include "opencv2/contrib/contrib.hpp"
+#include <cvconfig.h>
 
 #if defined(WIN32) || defined(_WIN32)
     #include <windows.h>
@@ -16,10 +17,22 @@ namespace cv
         list.clear();
         std::string path_f = path + "/" + exten;
```

Review comment:
I suggest you use either `new` or `cv::fastMalloc()`. Also it may be good to use `cv::Ptr<>` for auto-free.
**File:** modules/contrib/src/inputoutput.cpp
**Change Type:** modified
**Context:** PR #1205: WinRT API certification fixes. - All restricted WIN32 API replaced with analogues for all modules, except ts and highgui; ENABLE_WINRT_MODE ...

**Code Changes:**
```diff
@@ -1,5 +1,6 @@
 
 #include "opencv2/contrib/contrib.hpp"
+#include <cvconfig.h>
 
 #if defined(WIN32) || defined(_WIN32)
     #include <windows.h>
@@ -16,10 +17,22 @@ namespace cv
         list.clear();
         std::string path_f = path + "/" + exten;
```

Review comment:
`new`/`fastMalloc`/`Ptr`
**File:** modules/core/CMakeLists.txt
**Change Type:** modified
**Context:** PR #1205: WinRT API certification fixes. - All restricted WIN32 API replaced with analogues for all modules, except ts and highgui; ENABLE_WINRT_MODE ...

**Code Changes:**
```diff
@@ -2,6 +2,10 @@ set(the_description "The Core Functionality")
 ocv_add_module(core ${ZLIB_LIBRARIES})
 ocv_module_include_directories(${ZLIB_INCLUDE_DIR})
 
+if (HAVE_WINRT)
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /ZW /GS /Gm- /AI\"${WINDOWS_SDK_PATH}/References/CommonConfiguration/Neutral\" /AI\"${VISUAL_STUDIO_PATH}/vcpackages\"")
+endif()
+
 if(HAVE_CUDA)
   ocv_include_directories("${OpenCV_SOURCE_DIR}/modules/gpu/include")
```

Review comment:
Absolute paths is bad idea.
**File:** modules/core/src/glob.cpp
**Change Type:** modified
**Context:** PR #1205: WinRT API certification fixes. - All restricted WIN32 API replaced with analogues for all modules, except ts and highgui; ENABLE_WINRT_MODE ...

**Code Changes:**
```diff
@@ -56,16 +56,39 @@ namespace
 
     struct DIR
     {
+#ifdef HAVE_WINRT
+        WIN32_FIND_DATAW data;
+#else
         WIN32_FIND_DATA data;
+#endif
         HANDLE handle;
```

Review comment:
`new`/`fastMalloc`/`Ptr`
**File:** modules/core/src/system.cpp
**Change Type:** modified
**Context:** PR #1205: WinRT API certification fixes. - All restricted WIN32 API replaced with analogues for all modules, except ts and highgui; ENABLE_WINRT_MODE ...

**Code Changes:**
```diff
@@ -47,6 +47,9 @@
   #define _WIN32_WINNT 0x0400  // http://msdn.microsoft.com/en-us/library/ms686857(VS.85).aspx
 #endif
 #include <windows.h>
+#if (_WIN32_WINNT >= 0x0602)
+  #include <synchapi.h>
+#endif
 #undef small
 #undef min
 #undef max
```

Review comment:
why not a local var? `GUID g; CoCreateGuid(&g);`
**File:** modules/core/src/system.cpp
**Change Type:** modified
**Context:** PR #1205: WinRT API certification fixes. - All restricted WIN32 API replaced with analogues for all modules, except ts and highgui; ENABLE_WINRT_MODE ...

**Code Changes:**
```diff
@@ -47,6 +47,9 @@
   #define _WIN32_WINNT 0x0400  // http://msdn.microsoft.com/en-us/library/ms686857(VS.85).aspx
 #endif
 #include <windows.h>
+#if (_WIN32_WINNT >= 0x0602)
+  #include <synchapi.h>
+#endif
 #undef small
 #undef min
 #undef max
```

Review comment:
Actually `[40]` woud be enough :)
**File:** modules/core/src/system.cpp
**Change Type:** modified
**Context:** PR #1205: WinRT API certification fixes. - All restricted WIN32 API replaced with analogues for all modules, except ts and highgui; ENABLE_WINRT_MODE ...

**Code Changes:**
```diff
@@ -47,6 +47,9 @@
   #define _WIN32_WINNT 0x0400  // http://msdn.microsoft.com/en-us/library/ms686857(VS.85).aspx
 #endif
 #include <windows.h>
+#if (_WIN32_WINNT >= 0x0602)
+  #include <synchapi.h>
+#endif
 #undef small
 #undef min
 #undef max
```

Review comment:
I'd suggest `const wchar_t*`
**File:** modules/core/src/system.cpp
**Change Type:** modified
**Context:** PR #1205: WinRT API certification fixes. - All restricted WIN32 API replaced with analogues for all modules, except ts and highgui; ENABLE_WINRT_MODE ...

**Code Changes:**
```diff
@@ -47,6 +47,9 @@
   #define _WIN32_WINNT 0x0400  // http://msdn.microsoft.com/en-us/library/ms686857(VS.85).aspx
 #endif
 #include <windows.h>
+#if (_WIN32_WINNT >= 0x0602)
+  #include <synchapi.h>
+#endif
 #undef small
 #undef min
 #undef max
```

Review comment:
Note, it can be `NULL`!
**File:** modules/core/src/system.cpp
**Change Type:** modified
**Context:** PR #1205: WinRT API certification fixes. - All restricted WIN32 API replaced with analogues for all modules, except ts and highgui; ENABLE_WINRT_MODE ...

**Code Changes:**
```diff
@@ -47,6 +47,9 @@
   #define _WIN32_WINNT 0x0400  // http://msdn.microsoft.com/en-us/library/ms686857(VS.85).aspx
 #endif
 #include <windows.h>
+#if (_WIN32_WINNT >= 0x0602)
+  #include <synchapi.h>
+#endif
 #undef small
 #undef min
 #undef max
```

Review comment:
`new`/`fastMalloc`/`Ptr`
**File:** modules/core/src/glob.cpp
**Change Type:** modified
**Context:** PR #1205: WinRT API certification fixes. - All restricted WIN32 API replaced with analogues for all modules, except ts and highgui; ENABLE_WINRT_MODE ...
**Review Line:** 109

**Code Changes:**
```diff
-            if (::FindNextFile(dir->handle, &dir->data) != TRUE)
+            if (::FindNextFileW(dir->handle, &dir->data) != TRUE)
+                return 0;
+        }
+        size_t asize = wcstombs(NULL, dir->data.cFileName, 0);
+        char* aname = new char[asize+1];
+        aname[asize] = 0;
+        wcstombs(aname, dir->data.cFileName, asize);
+        dir->ent.d_name = aname;
+#else
+        if (dir->ent.d_name != 0)
```

Review comment:
This buffer is used in some other structures in the code bellow, so cv::Ptr is not useful here.
**File:** 3rdparty/tbb/CMakeLists.txt
**Change Type:** modified
**Context:** PR #1169: Warning suppresion for TBB on WinRT added. - Warning appears in TBB headers in case of Debug build.

**Code Changes:**
```diff
@@ -11,7 +11,7 @@ if (WIN32 AND ARM)
   set(tbb_url "http://threadingbuildingblocks.org/sites/default/files/software_releases/source/tbb41_20130613oss_src.tgz")
   set(tbb_md5 "108c8c1e481b0aaea61878289eb28b6a")
   set(tbb_version_file "version_string.ver")
-  ocv_warnings_disable(CMAKE_CXX_FLAGS -Wshadow -Wunused-parameter)
+  ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4702)
 else()
   # 4.1 update 2 - works fine
   set(tbb_ver "tbb41_20130116oss")
```

Review comment:
Why did you remove the previously disabled warnings? And why didn't you use `ocv_warnings_disable` for this one?
**File:** 3rdparty/tbb/CMakeLists.txt
**Change Type:** modified
**Context:** PR #1169: Warning suppresion for TBB on WinRT added. - Warning appears in TBB headers in case of Debug build.

**Code Changes:**
```diff
@@ -11,7 +11,7 @@ if (WIN32 AND ARM)
   set(tbb_url "http://threadingbuildingblocks.org/sites/default/files/software_releases/source/tbb41_20130613oss_src.tgz")
   set(tbb_md5 "108c8c1e481b0aaea61878289eb28b6a")
   set(tbb_version_file "version_string.ver")
-  ocv_warnings_disable(CMAKE_CXX_FLAGS -Wshadow -Wunused-parameter)
+  ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4702)
 else()
   # 4.1 update 2 - works fine
   set(tbb_ver "tbb41_20130116oss")
```

Review comment:
ocv_warnings_disable macro just remove key from CMAKE_CXX_FLAGS. -Wunused-parameter is not relevant for cl.exe. We do not set warning level for WinRT, so /wd is the only solution.
**File:** 3rdparty/tbb/CMakeLists.txt
**Change Type:** modified
**Context:** PR #1169: Warning suppresion for TBB on WinRT added. - Warning appears in TBB headers in case of Debug build.

**Code Changes:**
```diff
@@ -11,7 +11,7 @@ if (WIN32 AND ARM)
   set(tbb_url "http://threadingbuildingblocks.org/sites/default/files/software_releases/source/tbb41_20130613oss_src.tgz")
   set(tbb_md5 "108c8c1e481b0aaea61878289eb28b6a")
   set(tbb_version_file "version_string.ver")
-  ocv_warnings_disable(CMAKE_CXX_FLAGS -Wshadow -Wunused-parameter)
+  ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4702)
 else()
   # 4.1 update 2 - works fine
   set(tbb_ver "tbb41_20130116oss")
```

Review comment:
I'm pretty sure `ocv_warnings_disable` will append your flag. I mean, look at the source.
**File:** 3rdparty/tbb/CMakeLists.txt
**Change Type:** modified
**Context:** PR #1040: Windows RT support improvements - Video file reading and writing implemented; TBB support fixed. Works ok with development TBB branch; Media...

**Code Changes:**
```diff
@@ -1,12 +1,30 @@
 #Cross compile TBB from source
 project(tbb)
 
-# 4.1 update 2 - works fine
-set(tbb_ver "tbb41_20130116oss")
-set(tbb_url "http://threadingbuildingblocks.org/sites/default/files/software_releases/source/tbb41_20130116oss_src.tgz")
-set(tbb_md5 "3809790e1001a1b32d59c9fee590ee85")
+if (WIN32 AND NOT ARM)
+  message(FATAL_ERROR "BUILD_TBB option supports Windows on ARM only!\nUse regular official TBB build instead of the BUILD_TBB option!")
```

Review comment:
I would prefer we use 4.1.u4 that has been recently released
**File:** 3rdparty/tbb/CMakeLists.txt
**Change Type:** modified
**Context:** PR #1040: Windows RT support improvements - Video file reading and writing implemented; TBB support fixed. Works ok with development TBB branch; Media...

**Code Changes:**
```diff
@@ -1,12 +1,30 @@
 #Cross compile TBB from source
 project(tbb)
 
-# 4.1 update 2 - works fine
-set(tbb_ver "tbb41_20130116oss")
-set(tbb_url "http://threadingbuildingblocks.org/sites/default/files/software_releases/source/tbb41_20130116oss_src.tgz")
-set(tbb_md5 "3809790e1001a1b32d59c9fee590ee85")
+if (WIN32 AND NOT ARM)
+  message(FATAL_ERROR "BUILD_TBB option supports Windows on ARM only!\nUse regular official TBB build instead of the BUILD_TBB option!")
```

Review comment:
Agreed in general, but could you perhaps work these variables into the sentence somehow? :smile:
**File:** 3rdparty/tbb/CMakeLists.txt
**Change Type:** modified
**Context:** PR #1040: Windows RT support improvements - Video file reading and writing implemented; TBB support fixed. Works ok with development TBB branch; Media...

**Code Changes:**
```diff
@@ -1,12 +1,30 @@
 #Cross compile TBB from source
 project(tbb)
 
-# 4.1 update 2 - works fine
-set(tbb_ver "tbb41_20130116oss")
-set(tbb_url "http://threadingbuildingblocks.org/sites/default/files/software_releases/source/tbb41_20130116oss_src.tgz")
-set(tbb_md5 "3809790e1001a1b32d59c9fee590ee85")
+if (WIN32 AND NOT ARM)
+  message(FATAL_ERROR "BUILD_TBB option supports Windows on ARM only!\nUse regular official TBB build instead of the BUILD_TBB option!")
```

Review comment:
This means the compiled code will only support Windows 8 and up. Surely we don't want that? Also, why did you change all the dashes into slashes here? Also, you missed one of them.
**File:** 3rdparty/tbb/CMakeLists.txt
**Change Type:** modified
**Context:** PR #1040: Windows RT support improvements - Video file reading and writing implemented; TBB support fixed. Works ok with development TBB branch; Media...

**Code Changes:**
```diff
@@ -1,12 +1,30 @@
 #Cross compile TBB from source
 project(tbb)
 
-# 4.1 update 2 - works fine
-set(tbb_ver "tbb41_20130116oss")
-set(tbb_url "http://threadingbuildingblocks.org/sites/default/files/software_releases/source/tbb41_20130116oss_src.tgz")
-set(tbb_md5 "3809790e1001a1b32d59c9fee590ee85")
+if (WIN32 AND NOT ARM)
+  message(FATAL_ERROR "BUILD_TBB option supports Windows on ARM only!\nUse regular official TBB build instead of the BUILD_TBB option!")
```

Review comment:
You generate tbb.def when on ARM Win32, yet you use it when on any Win32. This seems suspicious...
**File:** modules/contrib/src/inputoutput.cpp
**Change Type:** modified
**Context:** PR #1040: Windows RT support improvements - Video file reading and writing implemented; TBB support fixed. Works ok with development TBB branch; Media...
**Review Line:** 4

**Code Changes:**
```diff
@@ -1,7 +1,7 @@
 
 #include "opencv2/contrib/contrib.hpp"
 
-#ifdef WIN32
+#if defined(WIN32) || defined(_WIN32)
     #include <windows.h>
     #include <tchar.h>
 #else
```

Review comment:
Why even check for `WIN32`? `_WIN32` is the standard macro: http://msdn.microsoft.com/en-us/library/b0084kay%28v=vs.110%29.aspx
**File:** modules/highgui/include/opencv2/highgui/highgui_c.h
**Change Type:** modified
**Context:** PR #1040: Windows RT support improvements - Video file reading and writing implemented; TBB support fixed. Works ok with development TBB branch; Media...

**Code Changes:**
```diff
@@ -558,9 +558,11 @@ CVAPI(int)    cvGetCaptureDomain( CvCapture* capture);
 /* "black box" video file writer structure */
 typedef struct CvVideoWriter CvVideoWriter;
 
+#define CV_FOURCC_MACRO(c1, c2, c3, c4) (((c1) & 255) + (((c2) & 255) << 8) + (((c3) & 255) << 16) + (((c4) & 255) << 24))
+
 CV_INLINE int CV_FOURCC(char c1, char c2, char c3, char c4)
 {
-    return (c1 & 255) + ((c2 & 255) << 8) + ((c3 & 255) << 16) + ((c4 & 255) << 24);
+    return CV_FOURCC_MACRO(c1, c2, c3, c4);
```

Review comment:
You need parentheses around each of `c1`, `c2`, `c3`, `c4`.
**File:** modules/highgui/src/cap_msmf.cpp
**Change Type:** modified
**Context:** PR #1040: Windows RT support improvements - Video file reading and writing implemented; TBB support fixed. Works ok with development TBB branch; Media...
**Review Line:** 75

**Code Changes:**
```diff
 #pragma comment(lib, "Strmiids")
+#pragma comment(lib, "Mfreadwrite")
 #pragma comment(lib, "MinCore_Downlevel")
+
+// for ComPtr usage
+#include <wrl/client.h>
+using namespace Microsoft::WRL;
+
 struct IMFMediaType;
 struct IMFActivate;
 struct IMFMediaSource;
```

Review comment:
Is this going to work on, say, Visual Studio 2005?
**File:** modules/highgui/src/cap_msmf.cpp
**Change Type:** modified
**Context:** PR #1040: Windows RT support improvements - Video file reading and writing implemented; TBB support fixed. Works ok with development TBB branch; Media...
**Review Line:** 95

**Code Changes:**
```diff
         *ppT = NULL;
     }
 }
- /// Class for printing info into consol
+
+/// Class for printing info into consol
 class DebugPrintOut
 {
 public:
@@ -93,6 +104,7 @@ class DebugPrintOut
 private:
```

Review comment:
There is an extra slash and a missing e. Nitpicking, I know...
**File:** modules/highgui/src/cap_msmf.cpp
**Change Type:** modified
**Context:** PR #1040: Windows RT support improvements - Video file reading and writing implemented; TBB support fixed. Works ok with development TBB branch; Media...

**Code Changes:**
```diff
@@ -53,26 +53,36 @@
 #include <Mfapi.h>
 #include <mfplay.h>
 #include <mfobjects.h>
-#include "Strsafe.h"
+#include <strsafe.h>
+#include <Mfreadwrite.h>
 #include <new>
 #include <map>
 #include <vector>
```

Review comment:
You collapsed this method's definition, but not the previous one's.
**File:** modules/highgui/src/cap_msmf.cpp
**Change Type:** modified
**Context:** PR #1040: Windows RT support improvements - Video file reading and writing implemented; TBB support fixed. Works ok with development TBB branch; Media...
**Review Line:** 478

**Code Changes:**
```diff
         return &(out.MF_MT_YUV_MATRIX);
     if(guid == MF_MT_VIDEO_LIGHTING)
         return &(out.MF_MT_VIDEO_LIGHTING);
     if(guid == MF_MT_DEFAULT_STRIDE)
-        return &(out.MF_MT_DEFAULT_STRIDE);
+        return (unsigned int*)&(out.MF_MT_DEFAULT_STRIDE);
     if(guid == MF_MT_VIDEO_CHROMA_SITING)
         return &(out.MF_MT_VIDEO_CHROMA_SITING);
     if(guid == MF_MT_VIDEO_NOMINAL_RANGE)
@@ -462,6 +492,7 @@ unsigned int *GetParametr(GUID guid, MediaType &out)
         return &(out.MF_MT_INTERLACE_MODE);
```

Review comment:
This is fishy. If this is, in fact, a signed parameter, why is it treated as unsigned here?
**File:** modules/contrib/src/inputoutput.cpp
**Change Type:** modified
**Context:** PR #1040: Windows RT support improvements - Video file reading and writing implemented; TBB support fixed. Works ok with development TBB branch; Media...
**Review Line:** 4

**Code Changes:**
```diff
@@ -1,7 +1,7 @@
 
 #include "opencv2/contrib/contrib.hpp"
 
-#ifdef WIN32
+#if defined(WIN32) || defined(_WIN32)
     #include <windows.h>
     #include <tchar.h>
 #else
```

Review comment:
You are right. Most compilers targeting Microsoft Windows implicitly define _WIN32. A few compilers define WIN32 instead. I do not know which of them exactly, but WIN32 and _WIN32 macros check are mostly used in OpenCV in pare.
**File:** modules/highgui/src/cap_msmf.cpp
**Change Type:** modified
**Context:** PR #1040: Windows RT support improvements - Video file reading and writing implemented; TBB support fixed. Works ok with development TBB branch; Media...
**Review Line:** 75

**Code Changes:**
```diff
 #pragma comment(lib, "Strmiids")
+#pragma comment(lib, "Mfreadwrite")
 #pragma comment(lib, "MinCore_Downlevel")
+
+// for ComPtr usage
+#include <wrl/client.h>
+using namespace Microsoft::WRL;
+
 struct IMFMediaType;
 struct IMFActivate;
 struct IMFMediaSource;
```

Review comment:
No, it is designed for Windows Runtime and Visual Studio 2012. OpenCV uses Direct Show and Video for Windows for WIN32 platform.
**File:** modules/highgui/src/cap_msmf.cpp
**Change Type:** modified
**Context:** PR #1040: Windows RT support improvements - Video file reading and writing implemented; TBB support fixed. Works ok with development TBB branch; Media...
**Review Line:** 95

**Code Changes:**
```diff
         *ppT = NULL;
     }
 }
- /// Class for printing info into consol
+
+/// Class for printing info into consol
 class DebugPrintOut
 {
 public:
@@ -93,6 +104,7 @@ class DebugPrintOut
 private:
```

Review comment:
There are a lot of strange grammar solutions in the code. It is part of VideoInput library by Evgeny Pereguda: http://www.codeproject.com/Articles/559437/Capturing-of-video-from-web-camera-on-Windows-7-an. I made only functionality changes, no refactoring.