Skip to content

Commit

Permalink
backport: fixed warnings produced by clang-9.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mshabunin authored and alalek committed Sep 23, 2019
1 parent c4d2e3c commit c8abf2a
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 9 deletions.
7 changes: 7 additions & 0 deletions modules/core/include/opencv2/core/cvdef.h
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,13 @@ Cv64suf;
# endif
#endif

#ifdef CV_CXX_MOVE_SEMANTICS
#define CV_CXX_MOVE(x) std::move(x)
#else
#define CV_CXX_MOVE(x) (x)
#endif


/****************************************************************************************\
* C++11 std::array *
\****************************************************************************************/
Expand Down
2 changes: 1 addition & 1 deletion modules/stitching/src/camera.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ Mat CameraParams::K() const
Mat_<double> k = Mat::eye(3, 3, CV_64F);
k(0,0) = focal; k(0,2) = ppx;
k(1,1) = focal * aspect; k(1,2) = ppy;
return k;
return CV_CXX_MOVE(k);
}

} // namespace detail
Expand Down
16 changes: 8 additions & 8 deletions modules/videostab/src/global_motion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ static Mat normalizePoints(int npoints, Point2f *points)
T(0,0) = T(1,1) = s;
T(0,2) = -cx*s;
T(1,2) = -cy*s;
return T;
return CV_CXX_MOVE(T);
}


Expand All @@ -138,7 +138,7 @@ static Mat estimateGlobMotionLeastSquaresTranslation(
*rmse = std::sqrt(*rmse / npoints);
}

return M;
return CV_CXX_MOVE(M);
}


Expand Down Expand Up @@ -219,7 +219,7 @@ static Mat estimateGlobMotionLeastSquaresRotation(
*rmse = std::sqrt(*rmse / npoints);
}

return M;
return CV_CXX_MOVE(M);
}

static Mat estimateGlobMotionLeastSquaresRigid(
Expand Down Expand Up @@ -273,7 +273,7 @@ static Mat estimateGlobMotionLeastSquaresRigid(
*rmse = std::sqrt(*rmse / npoints);
}

return M;
return CV_CXX_MOVE(M);
}


Expand Down Expand Up @@ -484,7 +484,7 @@ Mat estimateGlobalMotionRansac(
if (ninliers)
*ninliers = ninliersMax;

return bestM;
return CV_CXX_MOVE(bestM);
}


Expand Down Expand Up @@ -527,7 +527,7 @@ Mat MotionEstimatorRansacL2::estimate(InputArray points0, InputArray points1, bo
if (ok) *ok = false;
}

return M;
return CV_CXX_MOVE(M);
}


Expand Down Expand Up @@ -681,7 +681,7 @@ Mat FromFileMotionReader::estimate(const Mat &/*frame0*/, const Mat &/*frame1*/,
>> M(1,0) >> M(1,1) >> M(1,2)
>> M(2,0) >> M(2,1) >> M(2,2) >> ok_;
if (ok) *ok = ok_;
return M;
return CV_CXX_MOVE(M);
}


Expand All @@ -701,7 +701,7 @@ Mat ToFileMotionWriter::estimate(const Mat &frame0, const Mat &frame1, bool *ok)
<< M(1,0) << " " << M(1,1) << " " << M(1,2) << " "
<< M(2,0) << " " << M(2,1) << " " << M(2,2) << " " << ok_ << std::endl;
if (ok) *ok = ok_;
return M;
return CV_CXX_MOVE(M);
}


Expand Down

0 comments on commit c8abf2a

Please sign in to comment.