Skip to content

Commit

Permalink
Fix V734 warnings from PVS-Studio Static Analyzer (#558)
Browse files Browse the repository at this point in the history
An excessive check.
  • Loading branch information
SerVerXPlanet authored and paroj committed Oct 28, 2017
1 parent 8a2c723 commit 8b7088d
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions OgreMain/src/OgreScriptTranslator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -510,31 +510,31 @@ namespace Ogre{

*op = (GpuConstantType)(GCT_DOUBLE1 + count - 1);
}
else if (val.find("int") != String::npos)
else if (val.find("uint") != String::npos)
{
int count = 1;
if (val.size() == 4)
count = StringConverter::parseInt(val.substr(3));
else if (val.size() > 4)
if (val.size() == 5)
count = StringConverter::parseInt(val.substr(4));
else if (val.size() > 5)
return false;

if (count > 4 || count == 0)
return false;

*op = (GpuConstantType)(GCT_INT1 + count - 1);
*op = (GpuConstantType)(GCT_UINT1 + count - 1);
}
else if (val.find("uint") != String::npos)
else if (val.find("int") != String::npos)
{
int count = 1;
if (val.size() == 5)
count = StringConverter::parseInt(val.substr(4));
else if (val.size() > 5)
if (val.size() == 4)
count = StringConverter::parseInt(val.substr(3));
else if (val.size() > 4)
return false;

if (count > 4 || count == 0)
return false;

*op = (GpuConstantType)(GCT_UINT1 + count - 1);
*op = (GpuConstantType)(GCT_INT1 + count - 1);
}
else if (val.find("bool") != String::npos)
{
Expand Down

0 comments on commit 8b7088d

Please sign in to comment.