PVS-StudioWarnings

PVS-Studio warning V519 for Newton Game Dynamics

Nov 12th, 2014
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.76 KB | None | 0 0
  1. void dgBody::AddBuoyancyForce (....)
  2. {
  3.   ...
  4.   damp = (m_omega % m_omega) * dgFloat32 (10.0f) *
  5.          fluidAngularViscousity;
  6.   damp = GetMax (GetMin ((m_omega % m_omega) *
  7.                          dgFloat32 (1000.0f) *
  8.                          fluidAngularViscousity,
  9.                          dgFloat32(0.25f)),
  10.                  dgFloat32(2.0f));
  11.   ...
  12. }
  13.  
  14. This suspicious code was found in Newton Game Dynamics project by PVS-Studio static code analyzer.
  15. Warning message is:
  16. V519 The 'damp' object is assigned values twice successively. Perhaps this is a mistake.  physics  dgbody.cpp  404
  17.  
  18. 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