diff --git a/include/OpenThreads/Exports b/include/OpenThreads/Exports index 8a935ec73..9331f0ebe 100644 --- a/include/OpenThreads/Exports +++ b/include/OpenThreads/Exports @@ -39,10 +39,6 @@ #endif #endif -#ifndef OT_UNUSED - #define OT_UNUSED(var) (void) var -#endif - #endif diff --git a/include/osg/Export b/include/osg/Export index 86ff71c25..7fd42bfbd 100644 --- a/include/osg/Export +++ b/include/osg/Export @@ -60,12 +60,6 @@ #endif #endif -#ifndef OSG_UNUSED - #define OSG_UNUSED(var) (void) var -#endif - - - /** \namespace osg diff --git a/src/OpenThreads/pthreads/PThread.cpp b/src/OpenThreads/pthreads/PThread.cpp index 9821a18a0..60d1dde51 100644 --- a/src/OpenThreads/pthreads/PThread.cpp +++ b/src/OpenThreads/pthreads/PThread.cpp @@ -1,13 +1,13 @@ /* -*-c++-*- OpenThreads library, Copyright (C) 2002 - 2007 The Open Thread Group * - * This library is open source and may be redistributed and/or modified under - * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or + * This library is open source and may be redistributed and/or modified under + * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or * (at your option) any later version. The full license is in LICENSE file * included with this distribution, and on the openscenegraph.org website. - * + * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * OpenSceneGraph Public License for more details. */ @@ -238,8 +238,7 @@ private: } fflush(stdout); -#else // ] ALLOW_PRIORITY_SCHEDULING - OT_UNUSED(thread); + #endif // ] ALLOW_PRIORITY_SCHEDULING } @@ -347,8 +346,6 @@ private: } -#else // ] ALLOW_PRIORITY_SCHEDULING - OT_UNUSED(thread); #endif // ] ALLOW_PRIORITY_SCHEDULING return status; @@ -369,7 +366,6 @@ int Thread::SetConcurrency(int concurrencyLevel) #if defined (HAVE_PTHREAD_SETCONCURRENCY) return pthread_setconcurrency(concurrencyLevel); #else - OT_UNUSED(concurrencyLevel); return -1; #endif @@ -440,7 +436,7 @@ Thread::~Thread() } delete pd; - + _prvData = 0; } @@ -554,7 +550,7 @@ int Thread::setProcessorAffinity(unsigned int cpunum) PThreadPrivateData *pd = static_cast (_prvData); pd->cpunum = cpunum; if (pd->cpunum<0) return -1; - + #ifdef __sgi int status; @@ -696,7 +692,7 @@ int Thread::start() { // int Thread::startThread() { - if (_prvData) return start(); + if (_prvData) return start(); else return 0; } @@ -843,7 +839,6 @@ int Thread::setSchedulePriority(ThreadPriority priority) { return 0; #else - OT_UNUSED(priority); return -1; #endif @@ -883,7 +878,6 @@ int Thread::setSchedulePolicy(ThreadPolicy policy) else return 0; #else - OT_UNUSED(policy); return -1; #endif @@ -1015,7 +1009,7 @@ int OpenThreads::GetNumberOfProcessors() uint64_t num_cpus = 0; size_t num_cpus_length = sizeof(num_cpus); #if defined(__FreeBSD__) - sysctlbyname("hw.ncpu", &num_cpus, &num_cpus_length, NULL, 0); + sysctlbyname("hw.ncpu", &num_cpus, &num_cpus_length, NULL, 0); #else sysctlbyname("hw.activecpu", &num_cpus, &num_cpus_length, NULL, 0); #endif @@ -1030,7 +1024,7 @@ int OpenThreads::SetProcessorAffinityOfCurrentThread(unsigned int cpunum) Thread::Init(); Thread* thread = Thread::CurrentThread(); - if (thread) + if (thread) { return thread->setProcessorAffinity(cpunum); } @@ -1052,6 +1046,6 @@ int OpenThreads::SetProcessorAffinityOfCurrentThread(unsigned int cpunum) #endif #endif } - + return -1; } diff --git a/src/osg/PrimitiveSet.cpp b/src/osg/PrimitiveSet.cpp index 44f048f76..834d39d11 100644 --- a/src/osg/PrimitiveSet.cpp +++ b/src/osg/PrimitiveSet.cpp @@ -110,8 +110,6 @@ void DrawArrayLengths::draw(State& state, bool) const } if (mode==GL_POLYGON) mode = GL_TRIANGLE_FAN; if (mode==GL_QUAD_STRIP) mode = GL_TRIANGLE_STRIP; - #else - OSG_UNUSED(state); #endif GLint first = _first; diff --git a/src/osg/Referenced.cpp b/src/osg/Referenced.cpp index 042a80ca3..5c358b86e 100644 --- a/src/osg/Referenced.cpp +++ b/src/osg/Referenced.cpp @@ -110,8 +110,6 @@ void Referenced::setThreadSafeReferenceCounting(bool enableThreadSafeReferenceCo { #if !defined(_OSG_REFERENCED_USE_ATOMIC_OPERATIONS) s_useThreadSafeReferenceCounting = enableThreadSafeReferenceCounting; -#else - OSG_UNUSED(enableThreadSafeReferenceCounting); #endif } @@ -184,12 +182,8 @@ Referenced::Referenced(bool threadSafeRefUnref): #if !defined(_OSG_REFERENCED_USE_ATOMIC_OPERATIONS) #ifndef ENFORCE_THREADSAFE if (threadSafeRefUnref) -#else - OSG_UNUSED(threadSafeRefUnref); #endif _refMutex = new OpenThreads::Mutex; -#else - OSG_UNUSED(threadSafeRefUnref); #endif #ifdef DEBUG_OBJECT_ALLOCATION_DESTRUCTION @@ -353,8 +347,6 @@ void Referenced::setThreadSafeRefUnref(bool threadSafe) delete tmpMutexPtr; } } -#else - OSG_UNUSED(threadSafe); #endif } diff --git a/src/osgDB/ConvertUTF.cpp b/src/osgDB/ConvertUTF.cpp index 682d067bf..1b5013a89 100644 --- a/src/osgDB/ConvertUTF.cpp +++ b/src/osgDB/ConvertUTF.cpp @@ -65,8 +65,6 @@ std::string convertUTF16toUTF8(const wchar_t* source, unsigned sourceLength) #else //TODO: Implement for other platforms OSG_WARN << "ConvertUTF16toUTF8 not implemented." << std::endl; - OSG_UNUSED(source); - OSG_UNUSED(sourceLength); return std::string(); #endif } @@ -99,8 +97,6 @@ std::wstring convertUTF8toUTF16(const char* source, unsigned sourceLength) #else //TODO: Implement for other platforms OSG_WARN << "ConvertUTF8toUTF16 not implemented." << std::endl; - OSG_UNUSED(source); - OSG_UNUSED(sourceLength); return std::wstring(); #endif } @@ -130,7 +126,6 @@ std::string convertStringFromCurrentCodePageToUTF8(const char* source, unsigned return convertUTF16toUTF8(sUTF16); #else - OSG_UNUSED(sourceLength); return source; #endif } @@ -163,7 +158,6 @@ std::string convertStringFromUTF8toCurrentCodePage(const char* source, unsigned return sDest; #else - OSG_UNUSED(sourceLength); return source; #endif } diff --git a/src/osgShadow/ConvexPolyhedron.cpp b/src/osgShadow/ConvexPolyhedron.cpp index 3ce398bac..f00dbd6ba 100644 --- a/src/osgShadow/ConvexPolyhedron.cpp +++ b/src/osgShadow/ConvexPolyhedron.cpp @@ -1162,9 +1162,7 @@ bool ConvexPolyhedron::checkCoherency dumpGeometry( ); #endif -#else - OSG_UNUSED(checkForNonConvexPolys); - OSG_UNUSED(errorPrefix); + #endif // CONVEX_POLYHEDRON_CHECK_COHERENCY return result && convex; } diff --git a/src/osgShadow/DebugShadowMap.cpp b/src/osgShadow/DebugShadowMap.cpp index 989636294..5bc2afad3 100644 --- a/src/osgShadow/DebugShadowMap.cpp +++ b/src/osgShadow/DebugShadowMap.cpp @@ -154,9 +154,6 @@ bool DebugShadowMap::ViewData::DebugBoundingBox << std::endl; bb_prev = bb; -#else - OSG_UNUSED(bb); - OSG_UNUSED(name); #endif return result; } @@ -195,9 +192,6 @@ bool DebugShadowMap::ViewData::DebugPolytope } p_prev = p; -#else - OSG_UNUSED(p); - OSG_UNUSED(name); #endif return result; } @@ -221,9 +215,6 @@ bool DebugShadowMap::ViewData::DebugMatrix <<"[ " << m(3,0) << " " << m(3,1) << " " << m(3,2) << " " << m(3,3) << " ] " << std::endl; m_prev = m; -#else - OSG_UNUSED(m); - OSG_UNUSED(name); #endif return result; } diff --git a/src/osgWidget/Input.cpp b/src/osgWidget/Input.cpp index 8a6534cd8..7b5658830 100644 --- a/src/osgWidget/Input.cpp +++ b/src/osgWidget/Input.cpp @@ -94,8 +94,6 @@ void Input::_calculateSize(const XYCoord& size) { if(width > getWidth()) setWidth(osg::round(width)); if(height > getHeight()) setHeight(osg::round(height)); -#else - OSG_UNUSED(size); #endif } @@ -283,11 +281,11 @@ void Input::positioned() } } -bool Input::keyUp(int /*key*/, int /*mask*/, const WindowManager*) { +bool Input::keyUp(int key, int mask, const WindowManager*) { return false; } -bool Input::mouseDrag (double x, double /*y*/, const WindowManager*) +bool Input::mouseDrag (double x, double y, const WindowManager*) { _mouseClickX += x; x = _mouseClickX; @@ -308,7 +306,7 @@ bool Input::mouseDrag (double x, double /*y*/, const WindowManager*) return true; } -bool Input::mousePush (double x, double /*y*/, const WindowManager* /*wm*/) +bool Input::mousePush (double x, double y, const WindowManager* wm) { double offset = getOrigin().x(); Window* window = getParent(); diff --git a/src/osgWidget/Lua.cpp b/src/osgWidget/Lua.cpp index f84b3d7bd..9def84f2a 100644 --- a/src/osgWidget/Lua.cpp +++ b/src/osgWidget/Lua.cpp @@ -142,7 +142,6 @@ bool LuaEngine::eval(const std::string& code) { return true; #else - OSG_UNUSED(code); return noLuaFail("Can't evaluate code in LuaEngine"); #endif } @@ -164,7 +163,6 @@ bool LuaEngine::runFile(const std::string& filePath) { return true; #else - OSG_UNUSED(filePath); return noLuaFail("Can't run file in LuaEngine"); #endif } diff --git a/src/osgWidget/Python.cpp b/src/osgWidget/Python.cpp index 21bc757d9..979d631d3 100644 --- a/src/osgWidget/Python.cpp +++ b/src/osgWidget/Python.cpp @@ -156,7 +156,6 @@ bool PythonEngine::eval(const std::string& code) { return true; #else - OSG_UNUSED(code); return noPythonFail("Can't evaluate code in PythonEngine"); #endif } @@ -208,7 +207,6 @@ bool PythonEngine::runFile(const std::string& filePath) { return true; #else - OSG_UNUSED(filePath); return noPythonFail("Can't evaluate code in PythonEngine"); #endif }