Advertisement
PVS-StudioWarnings

PVS-Studio warning V547 for ReactOS

Nov 25th, 2014
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.84 KB | None | 0 0
  1. typedef enum _ARCTYPE
  2. {
  3.     GdiTypeArc,
  4.     GdiTypeArcTo,
  5.     GdiTypeChord,
  6.     GdiTypePie,
  7. } ARCTYPE, *PARCTYPE;
  8.  
  9. BOOL IntArc(....)
  10. {
  11.   ...
  12.   if ((Left == Right) ||
  13.       (Top == Bottom) ||
  14.       (((arctype != GdiTypeArc) ||
  15.         (arctype != GdiTypeArcTo)) &&
  16.        ((Right - Left == 1) ||
  17.        (Bottom - Top == 1))
  18.       )
  19.      )
  20.       return TRUE;
  21.   ...
  22. }
  23.  
  24. Most likely this is what should be written here: (arctype != GdiTypeArc) && (arctype != GdiTypeArcTo)
  25.  
  26. This suspicious code was found in ReactOS project by PVS-Studio static code analyzer.
  27. Warning message is:
  28. V547 Expression is always true. Probably the '&&' operator should be used here. win32k arc.c 67
  29.  
  30. 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