Menu

Compilation error in SimdView.hpp

Anonymous
2016-05-19
2016-05-19
  • Anonymous

    Anonymous - 2016-05-19

    First, is that a typo on line 890 of SimdView.hpp, e. g. case :CV_8UC4 return Bgra32; ? (I first saw this in a zip I downloaded, where it was on line 888, but now it's still there in the master branch on github).

    Second, if I "fix" that (by changing to case CV_8UC4: return Bgra32;), Visual Studio 2015 complains about the place five lines below, e. g.
    default: assert(0); return 0;
    error C2440: 'return': cannot convert from 'int' to 'Simd::View<Simd::Allocator>::Format'

    What could be the reason?

    UPD: changing return 0; to return None; makes it work. None is still 0 defined in a enum, maybe it depends on a compiler whether it can or cannot cast automatically.

     

    Last edit: Anonymous 2016-05-19
  • Yermalayeu Ihar

    Yermalayeu Ihar - 2016-05-19

    Thank you for bug report. I have fixed this bug. The fix will be in the next release or you can get current version from GitHub.

     
  • Anonymous

    Anonymous - 2016-05-19

    Me again. It seems that semicolons are missing at the end of the lines 641 and 643, e. g.

    #ifdef SIMD_OPENCV_ENABLE
        template <class A> SIMD_INLINE View<A> & View<A>::operator = (const cv::Mat & mat)
        {
            if (_owner && data)
            {
                Allocator::Free(data);
                assert(0);
            }
            *(size_t*)&width = mat.cols     //HERE
            *(size_t*)&height = mat.rows;
            *(Format*)&format = OcvTo(mat.type()) //AND HERE
            *(ptrdiff_t*)&stride = mat.step[0];
            *(unsigned char**)&data = mat.data;
            _owner = false;
            return *this;
        }
    #endif
    

    I have no idea how Visual Studio didn't care, but GCC gives:

    ./Simd/SimdView.hpp:642:20: error: invalid operands of types ‘const int’ and ‘size_t* {aka unsigned int*}’ to binary ‘operator*’
             *(size_t*)&height = mat.rows;
    
     
  • Yermalayeu Ihar

    Yermalayeu Ihar - 2016-05-19

    Its bad idea to commit code without checking :( .
    I will try to fix these bugs.

     
  • Yermalayeu Ihar

    Yermalayeu Ihar - 2016-05-19

    Yes! I have fixed this bug.
    P.S. This behavior of MSVC compiler is so strange.

     

Anonymous
Anonymous

Add attachments
Cancel





Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.