PVS-StudioWarnings

PVS-Studio warning V519 for OGRE

Nov 17th, 2014
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.82 KB | None | 0 0
  1. void TerrainMaterialGeneratorA::SM2Profile::addTechnique(....)
  2. {
  3.   ...
  4.   TextureUnitState* tu;
  5.   ...
  6.   for (uint i = 0; i < numLayers; ++i)
  7.   {
  8.     // diffuse / specular
  9.     tu = pass->createTextureUnitState(
  10.                  terrain->getLayerTextureName(i, 0));
  11.     // normal / height
  12.     tu = pass->createTextureUnitState(
  13.                  terrain->getLayerTextureName(i, 1));
  14.   }
  15.   ...
  16. }
  17.  
  18. This suspicious code was found in OGRE project by PVS-Studio static code analyzer.
  19. Warning message is:
  20. V519 The 'tu' variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 370, 372. OgreTerrain ogreterrainmaterialgeneratora.cpp 372
  21.  
  22. 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