PVS-StudioWarnings

PVS-Studio warning V501 for QT

Nov 19th, 2014
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.76 KB | None | 0 0
  1. QV4::ReturnedValue
  2. QQuickJSContext2DPrototype::method_getImageData(....)
  3. {
  4.   ....
  5.   qreal x = ctx->callData->args[0].toNumber();
  6.   qreal y = ctx->callData->args[1].toNumber();
  7.   qreal w = ctx->callData->args[2].toNumber();
  8.   qreal h = ctx->callData->args[3].toNumber();
  9.   if (!qIsFinite(x) || !qIsFinite(y) ||
  10.       !qIsFinite(w) || !qIsFinite(w))
  11.   ....
  12. }
  13.  
  14. This suspicious code was found in QT project by PVS-Studio static code analyzer.
  15. Warning message is:
  16. V501 There are identical sub-expressions '!qIsFinite(w)' to the left and to the right of the '||' operator. qquickcontext2d.cpp 3305
  17.  
  18. 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