PVS-StudioWarnings

PVS-Studio warning V624 for ffdshow

Nov 17th, 2014
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.82 KB | None | 0 0
  1. void TrenderedTextSubtitleWord::Transform(CPoint org)
  2. {
  3.   ....
  4.   double caz = cos((3.1415 / 180) * mprops.angleZ);
  5.   double saz = sin((3.1415 / 180) * mprops.angleZ);
  6.   double cax = cos((3.1415 / 180) * mprops.angleX);
  7.   double sax = sin((3.1415 / 180) * mprops.angleX);
  8.   double cay = cos((3.1415 / 180) * mprops.angleY);
  9.   double say = sin((3.1415 / 180) * mprops.angleY);
  10.   ....
  11. }
  12.  
  13. This suspicious code was found in ffdshow project by PVS-Studio static code analyzer.
  14. Warning message is:
  15. V624 The constant 3.1415 is being utilized. The resulting value could be inaccurate. Consider using the M_PI constant from <math.h>. trenderedtextsubtitleword.cpp 290
  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