Advertisement
PVS-StudioWarnings

PVS-Studio warning V636 for Coin3D

Nov 21st, 2014
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.68 KB | None | 0 0
  1. void
  2. SbUTMProjection::project(....) const
  3. {
  4.   ....
  5.   //Make sure the longitude is between -180.00 .. 179.9
  6.   double LongTemp =
  7.     (int(LongRad.deg())+180)-
  8.     int((int(LongRad.deg())+180)/360)*360-180;
  9.   ....
  10. }
  11.  
  12. This suspicious code was found in Coin3D project by PVS-Studio static code analyzer.
  13. Warning message is:
  14. V636 The expression was implicitly casted from 'int' type to 'double' type. Consider utilizing an explicit type cast to avoid overflow. An example: double A = (double)(X) * Y;. sbutmprojection.cpp 56
  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