Fixed warnings generated by clang,
src/osgAnimation/Skeleton.cpp:25:87: warning: addition of default argument on redeclaration makes this constructor a copy constructor [-Wdefault-arg-special-member]
Skeleton::UpdateSkeleton::UpdateSkeleton(const UpdateSkeleton& us, const osg::CopyOp& copyop= osg::CopyOp::SHALLOW_COPY) : osg::Object(us, copyop), osg::NodeCallback(us, copyop)
/src/OpenThreads/pthreads/PThread.cpp:1024:15: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare]
if (cpunum<0) return -1;
src/osgDB/ExternalFileWriter.cpp:221:122: warning: expression result unused [-Wunused-value]
_objects.insert(ObjectsSet::value_type(&obj, ObjectData(absoluteDestinationPath, relativeDestinationPath, written))).first;
src/osgManipulator/Dragger.cpp:175:18: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
if (*itr = constraint) return;
src/osgManipulator/Dragger.cpp:187:18: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
if (*itr = constraint)
This commit is contained in:
@@ -31,7 +31,7 @@ namespace osgAnimation
|
||||
public:
|
||||
META_Object(osgAnimation, UpdateSkeleton);
|
||||
UpdateSkeleton();
|
||||
UpdateSkeleton(const UpdateSkeleton&, const osg::CopyOp&);
|
||||
UpdateSkeleton(const UpdateSkeleton&, const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY);
|
||||
virtual void operator()(osg::Node* node, osg::NodeVisitor* nv);
|
||||
bool needToValidate() const;
|
||||
protected:
|
||||
|
||||
@@ -1021,8 +1021,6 @@ int OpenThreads::GetNumberOfProcessors()
|
||||
|
||||
int OpenThreads::SetProcessorAffinityOfCurrentThread(unsigned int cpunum)
|
||||
{
|
||||
if (cpunum<0) return -1;
|
||||
|
||||
Thread::Init();
|
||||
|
||||
Thread* thread = Thread::CurrentThread();
|
||||
@@ -1036,13 +1034,15 @@ int OpenThreads::SetProcessorAffinityOfCurrentThread(unsigned int cpunum)
|
||||
cpu_set_t cpumask;
|
||||
CPU_ZERO( &cpumask );
|
||||
CPU_SET( cpunum, &cpumask );
|
||||
|
||||
#if defined(HAVE_PTHREAD_SETAFFINITY_NP)
|
||||
pthread_setaffinity_np( pthread_self(), sizeof(cpumask), &cpumask);
|
||||
return 0;
|
||||
#elif defined(HAVE_THREE_PARAM_SCHED_SETAFFINITY)
|
||||
sched_setaffinity( 0, sizeof(cpumask), &cpumask );
|
||||
return 0;
|
||||
#elif defined(HAVE_TWO_PARAM_SCHED_SETAFFINITY)
|
||||
sched_setaffinity( 0, &cpumask );
|
||||
return 0;
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -19,13 +19,18 @@
|
||||
using namespace osgAnimation;
|
||||
|
||||
Skeleton::Skeleton() {}
|
||||
|
||||
Skeleton::Skeleton(const Skeleton& b, const osg::CopyOp& copyop) : osg::MatrixTransform(b,copyop) {}
|
||||
|
||||
Skeleton::UpdateSkeleton::UpdateSkeleton() : _needValidate(true) {}
|
||||
Skeleton::UpdateSkeleton::UpdateSkeleton(const UpdateSkeleton& us, const osg::CopyOp& copyop= osg::CopyOp::SHALLOW_COPY) : osg::Object(us, copyop), osg::NodeCallback(us, copyop)
|
||||
|
||||
Skeleton::UpdateSkeleton::UpdateSkeleton(const UpdateSkeleton& us, const osg::CopyOp& copyop) :
|
||||
osg::Object(us, copyop),
|
||||
osg::NodeCallback(us, copyop)
|
||||
{
|
||||
_needValidate = true;
|
||||
}
|
||||
|
||||
bool Skeleton::UpdateSkeleton::needToValidate() const
|
||||
{
|
||||
return _needValidate;
|
||||
|
||||
@@ -218,7 +218,7 @@ bool ExternalFileWriter::write(const osg::Object & obj, const Options * options,
|
||||
else written = true;
|
||||
|
||||
// Add entry
|
||||
_objects.insert(ObjectsSet::value_type(&obj, ObjectData(absoluteDestinationPath, relativeDestinationPath, written))).first;
|
||||
_objects.insert(ObjectsSet::value_type(&obj, ObjectData(absoluteDestinationPath, relativeDestinationPath, written)));
|
||||
_searchMap.insert(SearchMap::value_type(pathHash(absoluteDestinationPath), &obj));
|
||||
|
||||
// Fill output strings
|
||||
|
||||
@@ -172,7 +172,7 @@ void Dragger::addConstraint(Constraint* constraint)
|
||||
itr != _constraints.end();
|
||||
++itr)
|
||||
{
|
||||
if (*itr = constraint) return;
|
||||
if (*itr == constraint) return;
|
||||
}
|
||||
|
||||
_constraints.push_back(constraint);
|
||||
@@ -184,9 +184,9 @@ void Dragger::removeConstraint(Constraint* constraint)
|
||||
itr != _constraints.end();
|
||||
)
|
||||
{
|
||||
if (*itr = constraint)
|
||||
if (*itr == constraint)
|
||||
{
|
||||
itr = _constraints.erase(itr);
|
||||
_constraints.erase(itr);
|
||||
return;
|
||||
} else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user