PVS-StudioWarnings

PVS-Studio warning V519 for QT

Nov 17th, 2014
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.63 KB | None | 0 0
  1. bool qt_testCollision(const Q3CanvasSprite* s1,
  2.                       const Q3CanvasSprite* s2)
  3. {
  4.   ...
  5.   t=x1; x1=x2; x2=t;
  6.   t=y1; x1=y2; y2=t;
  7.   ...
  8. }
  9.  
  10. This is what should have been written here: t=y1; y1=y2; y2=t;
  11.  
  12. This suspicious code was found in QT project by PVS-Studio static code analyzer.
  13. Warning message is:
  14. V519 The 'x1' variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 2218, 2219. Qt3Support q3canvas.cpp 2219
  15.  
  16. 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