Advertisement
PVS-StudioWarnings

PVS-Studio warning V524 for OpenCV

Nov 24th, 2014
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.94 KB | None | 0 0
  1. void MatOp::augAssignAnd(const MatExpr& expr, Mat& m) const
  2. {
  3.     Mat temp;
  4.     expr.op->assign(expr, temp);
  5.     m &= temp;
  6. }
  7.  
  8. void MatOp::augAssignOr(const MatExpr& expr, Mat& m) const
  9. {
  10.     Mat temp;
  11.     expr.op->assign(expr, temp);
  12.     m |= temp;
  13. }
  14.  
  15. void MatOp::augAssignDivide(const MatExpr& expr, Mat& m) const
  16. {
  17.     Mat temp;
  18.     expr.op->assign(expr, temp);
  19.     m /= temp;
  20. }
  21.  
  22. void MatOp::augAssignXor(const MatExpr& expr, Mat& m) const
  23. {
  24.     Mat temp;
  25.     expr.op->assign(expr, temp);
  26.     m /= temp;
  27. }
  28.  
  29. This suspicious code was found in OpenCV project by PVS-Studio static code analyzer.
  30. Warning message is:
  31. V524 It is odd that the body of 'augAssignXor' function is fully equivalent to the body of 'augAssignDivide' function (matop.cpp, line 294). matop.cpp 318
  32.  
  33. PVS-Studio is a static analyzer for detecting bugs in the source code of applications written in C, C++, C++11, C++/CX. Site: http://www.viva64.com/en/pvs-studio/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement