Index: modules/core/include/opencv2/core/types_c.h =================================================================== --- modules/core/include/opencv2/core/types_c.h (revision 5362) +++ modules/core/include/opencv2/core/types_c.h (working copy) @@ -286,6 +286,17 @@ #define CV_CMP(a,b) (((a) > (b)) - ((a) < (b))) #define CV_SIGN(a) CV_CMP((a),0) +CV_INLINE int cvRound( float value ) +{ +#if defined HAVE_LRINT || defined CV_ICC || defined __GNUC__ + return (int)lrint(value); +#else + // while this is not IEEE754-compliant rounding, it's usually a good enough approximation + return (int)(value + (value >= 0 ? 0.5f : -0.5f)); +#endif +} + + CV_INLINE int cvRound( double value ) { #if (defined _MSC_VER && defined _M_X64) || (defined __GNUC__ && defined __x86_64__ && !defined __APPLE__) Index: modules/imgproc/src/color.cpp =================================================================== --- modules/imgproc/src/color.cpp (revision 5362) +++ modules/imgproc/src/color.cpp (working copy) @@ -664,7 +664,7 @@ 79, 488, 3892 }; for( int i = 0; i < 9; i++ ) - coeffs[i] = _coeffs ? cvRound(_coeffs[i]*(1 << xyz_shift)) : coeffs0[i]; + coeffs[i] = _coeffs ? (_coeffs[i]*(1 << xyz_shift)) : coeffs0[i]; if(blueIdx == 0) { std::swap(coeffs[0], coeffs[2]); @@ -746,7 +746,7 @@ 228, -836, 4331 }; for(int i = 0; i < 9; i++) - coeffs[i] = _coeffs ? cvRound(_coeffs[i]*(1 << xyz_shift)) : coeffs0[i]; + coeffs[i] = _coeffs ? (_coeffs[i]*(1 << xyz_shift)) : coeffs0[i]; if(blueIdx == 0) { Index: modules/calib3d/src/stereobm.cpp =================================================================== --- modules/calib3d/src/stereobm.cpp (revision 5362) +++ modules/calib3d/src/stereobm.cpp (working copy) @@ -713,8 +713,8 @@ void operator()( const BlockedRange& range ) const { int cols = left->cols, rows = left->rows; - int _row0 = min(cvRound(range.begin() * rows / nstripes), rows); - int _row1 = min(cvRound(range.end() * rows / nstripes), rows); + int _row0 = min((range.begin() * rows / nstripes), rows); + int _row1 = min((range.end() * rows / nstripes), rows); uchar *ptr = state->slidingSumBuf->data.ptr + range.begin() * stripeBufSize; int FILTERED = (state->minDisparity - 1)*16; Index: modules/legacy/src/face.cpp =================================================================== --- modules/legacy/src/face.cpp (revision 5362) +++ modules/legacy/src/face.cpp (working copy) @@ -151,8 +151,8 @@ // ResizeRect(IdealRect,&UpRect,UP_SCALE,7); // ResizeRect(IdealRect,&DownRect,DOWN_SCALE,7); - long x = Rect.x + cvRound(Rect.width/2); - long y = Rect.y + cvRound(Rect.height/2); + long x = Rect.x + (Rect.width/2); + long y = Rect.y + (Rect.height/2); if ( isPointInRect(cvPoint(x,y),IdealRect) ) return true; Index: modules/legacy/src/blobtrackanalysistrackdist.cpp =================================================================== --- modules/legacy/src/blobtrackanalysistrackdist.cpp (revision 5362) +++ modules/legacy/src/blobtrackanalysistrackdist.cpp (working copy) @@ -511,7 +511,7 @@ p, s, 0, 0, 360, - CV_RGB(c,255-c,0), cvRound(1+(0*c)/255) ); + CV_RGB(c,255-c,0), (1+(0*c)/255) ); for(j=pF->pTrack->GetPointNum(); j>0; j--) {