PVS-StudioWarnings

PVS-Studio warning V537 for Quake3

Nov 11th, 2014
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.60 KB | None | 0 0
  1. void Terrain_AddMovePoint(....) {
  2.   ...
  3.   x = ( v[ 0 ] - p->origin[ 0 ] ) / p->scale_x;
  4.   y = ( v[ 1 ] - p->origin[ 1 ] ) / p->scale_x;
  5.   ...
  6. }
  7.  
  8. This is what should have been written here: y = ( v[ 1 ] - p->origin[ 1 ] ) / p->scale_y;
  9.  
  10. This suspicious code was found in Quake3 project by PVS-Studio static code analyzer.
  11. Warning message is:
  12. V537 Consider reviewing the correctness of 'scale_x' item's usage. Radiant terrain.cpp 1408
  13.  
  14. 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