PVS-StudioWarnings

PVS-Studio warning V801 for InstantVNC

Nov 20th, 2014
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.75 KB | None | 0 0
  1. typedef struct tagRECT
  2. {
  3.     LONG    left;
  4.     LONG    top;
  5.     LONG    right;
  6.     LONG    bottom;
  7. } RECT, *PRECT, NEAR *NPRECT, FAR *LPRECT;
  8.  
  9. bool
  10. operator <(const RECT _X, const RECT _Y)
  11. {
  12.   return _X.top < _Y.top;
  13. }
  14.  
  15. bool
  16. operator >(const RECT _X, const RECT _Y)
  17. {
  18.   return _X.top > _Y.top;
  19. }
  20.  
  21. This suspicious code was found in InstantVNC project by PVS-Studio static code analyzer.
  22. Warning message is:
  23. V801 Decreased performance. It is better to redefine the first function argument as a reference. Consider replacing 'const .. _X' with 'const .. &_X'. miniWinVNC rectlist.cpp 32
  24.  
  25. 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