From 41ce857c93c7f2351e957e45e4e2dc4bd6fdab90 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Fri, 3 Jun 2016 09:33:47 +0100 Subject: [PATCH] Fixed clang warnings --- include/osg/ValueMap | 18 ++++++++++-------- src/osg/Identifier.cpp | 2 +- src/osgPlugins/ffmpeg/FFmpegClocks.cpp | 3 --- .../serializers/osg/PrimitiveSet.cpp | 2 +- 4 files changed, 12 insertions(+), 13 deletions(-) diff --git a/include/osg/ValueMap b/include/osg/ValueMap index 29687d9f0..9b28e601e 100644 --- a/include/osg/ValueMap +++ b/include/osg/ValueMap @@ -50,16 +50,18 @@ class OSG_EXPORT ValueMap : public osg::Object { typedef TemplateValueObject UserValueObject; KeyValueMap::iterator itr = _keyValueMap.find(key); - if (itr!=_keyValueMap.end() && typeid(*(itr->second))==typeid(UserValueObject)) + if (itr!=_keyValueMap.end()) { - UserValueObject* uvo = static_cast(itr->second.get()); - uvo->setValue(value); - return uvo; - } - else - { - return (_keyValueMap[key] = new UserValueObject(value)).get(); + osg::Object* obj = itr->second.get(); + if (typeid(*(obj))==typeid(UserValueObject)) + { + UserValueObject* uvo = static_cast(itr->second.get()); + uvo->setValue(value); + return uvo; + } } + + return (_keyValueMap[key] = new UserValueObject(value)).get(); } diff --git a/src/osg/Identifier.cpp b/src/osg/Identifier.cpp index 4a3bda50f..e0c8d007e 100644 --- a/src/osg/Identifier.cpp +++ b/src/osg/Identifier.cpp @@ -123,4 +123,4 @@ Identifier* osg::Identifier::get(osg::Referenced* first, osg::Referenced* second return get("", 0, first, second); } -} \ No newline at end of file +} diff --git a/src/osgPlugins/ffmpeg/FFmpegClocks.cpp b/src/osgPlugins/ffmpeg/FFmpegClocks.cpp index d16f092c4..9b656fceb 100644 --- a/src/osgPlugins/ffmpeg/FFmpegClocks.cpp +++ b/src/osgPlugins/ffmpeg/FFmpegClocks.cpp @@ -15,9 +15,6 @@ namespace osgFFmpeg { namespace { - const double AV_SYNC_THRESHOLD = 0.01; - const double AV_NOSYNC_THRESHOLD = 10.0; - inline double clamp(const double value, const double min, const double max) { return (std::min)((std::max)(value, min), max); diff --git a/src/osgWrappers/serializers/osg/PrimitiveSet.cpp b/src/osgWrappers/serializers/osg/PrimitiveSet.cpp index c35bd6685..ad715dd20 100644 --- a/src/osgWrappers/serializers/osg/PrimitiveSet.cpp +++ b/src/osgWrappers/serializers/osg/PrimitiveSet.cpp @@ -163,4 +163,4 @@ REGISTER_OBJECT_WRAPPER( MultiDrawArrays, } } -#endif \ No newline at end of file +#endif