PVS-StudioWarnings

PVS-Studio warning V669 for CryEngineSDK

Nov 11th, 2014
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.82 KB | None | 0 0
  1. void CTargetTrackThreatModifier::ModifyTargetThreat(
  2.   IAIObject &ownerAI, IAIObject &targetAI,
  3.   const ITargetTrack &track,
  4.   float &outThreatRatio,
  5.   EAITargetThreat &outThreat) const
  6. {
  7.   if (track.GetTargetType() > AITARGET_SOUND &&
  8.       outThreat >= AITHREAT_AGGRESSIVE)
  9.   {
  10.     outThreatRatio = 1.0f;
  11.   }
  12. }
  13.  
  14. This suspicious code was found in CryEngineSDK project by PVS-Studio static code analyzer.
  15. Warning message is:
  16. V669 The 'outThreat' argument is a non-constant reference. The analyzer is unable to determine the position at which this argument is being modified. It is possible that the function contains an error. targettrackthreatmodifier.cpp 48
  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