Fixed CoverityScan reported errors

This commit is contained in:
Robert Osfield 2017-11-13 13:06:12 +00:00
parent d98d9c9e72
commit 9c605ba9be
2 changed files with 6 additions and 7 deletions

View File

@ -43,7 +43,7 @@ struct osgAnimation_AnimationManagerBasegetnumAnimations : public osgDB::MethodO
virtual bool run(void* objectPtr, osg::Parameters& inputParameters, osg::Parameters& outputParameters) const virtual bool run(void* objectPtr, osg::Parameters& inputParameters, osg::Parameters& outputParameters) const
{ {
osgAnimation::AnimationManagerBase* group = dynamic_cast<osgAnimation::AnimationManagerBase*>(reinterpret_cast<osg::Object*>(objectPtr)); osgAnimation::AnimationManagerBase* group = dynamic_cast<osgAnimation::AnimationManagerBase*>(reinterpret_cast<osg::Object*>(objectPtr));
outputParameters.push_back(new osg::UIntValueObject("return",group->getNumRegisteredAnimations())); if (group) outputParameters.push_back(new osg::UIntValueObject("return",group->getNumRegisteredAnimations()));
return true; return true;
} }
}; };
@ -64,8 +64,7 @@ struct osgAnimation_AnimationManagerBasegetAnimation : public osgDB::MethodObjec
if (uivo) index = uivo->getValue(); if (uivo) index = uivo->getValue();
} }
osgAnimation::AnimationManagerBase* group = dynamic_cast<osgAnimation::AnimationManagerBase*>(reinterpret_cast<osg::Object*>(objectPtr)); osgAnimation::AnimationManagerBase* group = dynamic_cast<osgAnimation::AnimationManagerBase*>(reinterpret_cast<osg::Object*>(objectPtr));
outputParameters.push_back(group->getRegisteredAnimation(index)); if (group) outputParameters.push_back(group->getRegisteredAnimation(index));
return true; return true;
} }

View File

@ -15,7 +15,7 @@ struct BasicAnimationManagerIsplaying : public osgDB::MethodObject
osgAnimation::Animation* child = dynamic_cast<osgAnimation::Animation*>(inputParameters[0].get()); osgAnimation::Animation* child = dynamic_cast<osgAnimation::Animation*>(inputParameters[0].get());
if (!child) return false; if (!child) return false;
osgAnimation::BasicAnimationManager* group = dynamic_cast<osgAnimation::BasicAnimationManager*>(reinterpret_cast<osg::Object*>(objectPtr)); osgAnimation::BasicAnimationManager* group = dynamic_cast<osgAnimation::BasicAnimationManager*>(reinterpret_cast<osg::Object*>(objectPtr));
outputParameters.push_back(new osg::BoolValueObject("return", group->isPlaying(child))); id (group) outputParameters.push_back(new osg::BoolValueObject("return", group->isPlaying(child)));
return true; return true;
} }
}; };
@ -28,7 +28,7 @@ struct BasicAnimationManagerfindAnimation : public osgDB::MethodObject
osgAnimation::Animation* child = dynamic_cast<osgAnimation::Animation*>(inputParameters[0].get()); osgAnimation::Animation* child = dynamic_cast<osgAnimation::Animation*>(inputParameters[0].get());
if (!child) return false; if (!child) return false;
osgAnimation::BasicAnimationManager* group = dynamic_cast<osgAnimation::BasicAnimationManager*>(reinterpret_cast<osg::Object*>(objectPtr)); osgAnimation::BasicAnimationManager* group = dynamic_cast<osgAnimation::BasicAnimationManager*>(reinterpret_cast<osg::Object*>(objectPtr));
outputParameters.push_back(new osg::BoolValueObject("return",group->findAnimation(child))); id (group) outputParameters.push_back(new osg::BoolValueObject("return",group->findAnimation(child)));
return true; return true;
} }
}; };
@ -41,7 +41,7 @@ struct BasicAnimationManagerPlayanimation : public osgDB::MethodObject
osgAnimation::Animation* child = dynamic_cast<osgAnimation::Animation*>(inputParameters[0].get()); osgAnimation::Animation* child = dynamic_cast<osgAnimation::Animation*>(inputParameters[0].get());
if (!child) return false; if (!child) return false;
osgAnimation::BasicAnimationManager* group = dynamic_cast<osgAnimation::BasicAnimationManager*>(reinterpret_cast<osg::Object*>(objectPtr)); osgAnimation::BasicAnimationManager* group = dynamic_cast<osgAnimation::BasicAnimationManager*>(reinterpret_cast<osg::Object*>(objectPtr));
group->playAnimation(child); id (group) group->playAnimation(child);
return true; return true;
} }
}; };
@ -54,7 +54,7 @@ struct BasicAnimationManagerStopanimation : public osgDB::MethodObject
osgAnimation::Animation* child = dynamic_cast<osgAnimation::Animation*>(inputParameters[0].get()); osgAnimation::Animation* child = dynamic_cast<osgAnimation::Animation*>(inputParameters[0].get());
if (!child) return false; if (!child) return false;
osgAnimation::BasicAnimationManager* group = dynamic_cast<osgAnimation::BasicAnimationManager*>(reinterpret_cast<osg::Object*>(objectPtr)); osgAnimation::BasicAnimationManager* group = dynamic_cast<osgAnimation::BasicAnimationManager*>(reinterpret_cast<osg::Object*>(objectPtr));
group->stopAnimation(child); id (group) group->stopAnimation(child);
return true; return true;
} }
}; };