Advertisement
PVS-StudioWarnings

PVS-Studio warning V501 for Source SDK

Nov 24th, 2014
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.67 KB | None | 0 0
  1. static void DrawPyroVignette(....)
  2. {
  3.   ....
  4.   Vector2D vMaxSize(
  5.    ( float )nScreenWidth / ( float )nScreenWidth /
  6.      NUM_PYRO_SEGMENTS * 2.0f,
  7.    ( float )nScreenHeight / ( float )nScreenHeight /
  8.      NUM_PYRO_SEGMENTS * 2.0f );
  9.   ....
  10. }
  11.  
  12. This suspicious code was found in Source SDK project by PVS-Studio static code analyzer.
  13. Warning message is:
  14. V501 There are identical sub-expressions '(float) nScreenWidth' to the left and to the right of the '/' operator. Client (HL2) viewpostprocess.cpp 1888
  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
Advertisement