Advertisement
PVS-StudioWarnings

PVS-Studio warning V674 for Source SDK

Nov 25th, 2014
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.65 KB | None | 0 0
  1. #define  ON_EPSILON    0.1
  2.  
  3. void CPrediction::SetIdealPitch (....)
  4. {
  5.   int    step;
  6.   ....
  7.   step = floor_height[j] - floor_height[j-1];
  8.   if (step > -ON_EPSILON && step < ON_EPSILON)
  9.     continue;
  10.   ....
  11. }
  12.  
  13. This suspicious code was found in Source SDK project by PVS-Studio static code analyzer.
  14. Warning message is:
  15. V674 The '-0.1' literal of the 'double' type is compared to a value of the 'int' type. Consider inspecting the 'step > - 0.1' expression. Client (HL2) prediction.cpp 977
  16.  
  17. 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