unsigned int is called uint (Bug #2111)


Added by Patrick Welche over 12 years ago. Updated over 12 years ago.


Status:Done Start date:2012-06-28
Priority:Normal Due date:
Assignee:Andrey Kamaev % Done:

0%

Category:imgproc, video
Target version:2.4.3
Affected version: Operating System:
Difficulty: HW Platform:
Pull request:

Description

uint isn't actually a standard type, so make test_backgrousubtractor_gbh.cpp build with other compilers such as VS2010 with attached trivial patch. (There are quite a lot of uint's around in the code e.g. gpu - presumably those aren't built by default...)


History

Updated by Andrey Pavlenko over 12 years ago

Please be more specific, we can't catch what the problem is.

  • Category deleted (build/install)
  • Assignee deleted (Alexander Shishkov)

Updated by Andrey Kamaev over 12 years ago

  • Target version set to 2.4.3

Updated by Patrick Welche over 12 years ago

I can't build OpenCV with VS2010 because of uint. Changing uint to unsigned int fixes the build failure.

Updated by Patrick Welche over 12 years ago

Just reverted my patch, and grabbed revision 8856

30>------ Build started: Project: opencv_test_video, Configuration: Release x64 ------
30>Build started 29/06/2012 17:57:24.
30>InitializeBuildStatus:
30>  Creating "opencv_test_video.dir\Release\opencv_test_video.unsuccessfulbuild" because "AlwaysCreate" was specified.
30>CustomBuild:
30>  Building Custom Rule C:/src/OpenCV/modules/video/CMakeLists.txt
30>  CMake does not need to re-run because C:\src\OpenCV\build\modules\video\CMakeFiles\generate.stamp is up-to-date.
30>ClCompile:
30>  test_precomp.cpp
...
30>  test_optflowpyrlk.cpp
30>C:\src\OpenCV\modules\video\test\test_backgroundsubtractor_gbh.cpp(59): error C2065: 'uint' : undeclared identifier
30>C:\src\OpenCV\modules\video\test\test_backgroundsubtractor_gbh.cpp(59): error C2146: syntax error : missing ';' before identifier 'maxui'
30>C:\src\OpenCV\modules\video\test\test_backgroundsubtractor_gbh.cpp(59): error C2065: 'maxui' : undeclared identifier
30>C:\src\OpenCV\modules\video\test\test_backgroundsubtractor_gbh.cpp(59): error C2065: 'minui' : undeclared identifier
30>C:\src\OpenCV\modules\video\test\test_backgroundsubtractor_gbh.cpp(83): error C2065: 'uint' : undeclared identifier
30>C:\src\OpenCV\modules\video\test\test_backgroundsubtractor_gbh.cpp(83): error C2146: syntax error : missing ';' before identifier 'half'
...

I thought the patch was so obvious, I didn't go through the whole bug write up thing... s/uint/unsigned int/ !

Updated by Patrick Welche over 12 years ago

Oh - I don't see the patch I attached and uploaded originally - here we are in text:

$ svn diff
Index: modules/video/test/test_backgroundsubtractor_gbh.cpp
===================================================================
--- modules/video/test/test_backgroundsubtractor_gbh.cpp        (revision 8856)
+++ modules/video/test/test_backgroundsubtractor_gbh.cpp        (working copy)
@@ -56,7 +56,7 @@
         */
        uchar maxuc = 0, minuc = 0;
        char maxc = 0, minc = 0;
-       uint maxui = 0, minui = 0;
+       unsigned int maxui = 0, minui = 0;
        int maxi=0, mini = 0;
        long int maxli = 0, minli = 0;
        float maxf = 0, minf = 0;
@@ -80,7 +80,7 @@
        }
        else if (type == CV_16U)
        {
-               uint half = UINT_MAX/2;
+               unsigned int half = UINT_MAX/2;
                maxui = (unsigned int)rng.uniform((int)half+32,UINT_MAX);
                minui = (unsigned int)rng.uniform(0,(int)half-32);
        }
@@ -110,8 +110,8 @@
        }

        Mat simImage = Mat::zeros(height,width,channelsAndType);
-       const uint numLearningFrames = 120;
-       for (uint i = 0; i < numLearningFrames; ++i)
+       const unsigned int numLearningFrames = 120;
+       for (unsigned int i = 0; i < numLearningFrames; ++i)
        {
                /**
                 * Genrate simulated "image" for any type. Values always confined to upper half of range.

Updated by Vadim Pisarevsky over 12 years ago

looks like the bug was fixed a few days ago.

  • Status changed from Open to Done
  • Category set to imgproc, video

Updated by Andrey Kamaev over 12 years ago

Fixed in r8861

  • Assignee set to Andrey Kamaev

Also available in: Atom PDF