diff --git a/source/graphics/ObjectBase.cpp b/source/graphics/ObjectBase.cpp index 2eb6b289d2..48ddd9ac03 100644 --- a/source/graphics/ObjectBase.cpp +++ b/source/graphics/ObjectBase.cpp @@ -180,8 +180,6 @@ bool CObjectBase::Load(const char* filename) float pos = CStr(ae.Value).ToFloat(); anim.m_ActionPos2 = clamp(pos, 0.f, 1.f); } - else - ; // unrecognised element } currentVariant->m_Anims.push_back(anim); } @@ -200,14 +198,10 @@ bool CObjectBase::Load(const char* filename) prop.m_PropPointName = pe.Value; else if (pe.Name == at_actor) prop.m_ModelName = pe.Value; - else - ; // unrecognised element } currentVariant->m_Props.push_back(prop); } } - else - ; // unrecognised element } ++currentVariant; @@ -232,10 +226,6 @@ bool CObjectBase::Load(const char* filename) { m_Material = "art/materials/" + CStr(child.GetText()); } - else - ; // unrecognised element - - // TODO: castshadow, etc } return true; diff --git a/source/graphics/Terrain.cpp b/source/graphics/Terrain.cpp index 48de688d7d..661b3bf4ee 100644 --- a/source/graphics/Terrain.cpp +++ b/source/graphics/Terrain.cpp @@ -365,7 +365,7 @@ void CTerrain::Resize(ssize_t size) for (ssize_t n=0;n() { } diff --git a/source/gui/GUIRenderer.h b/source/gui/GUIRenderer.h index a80381d8ef..8a94fd2148 100644 --- a/source/gui/GUIRenderer.h +++ b/source/gui/GUIRenderer.h @@ -58,9 +58,10 @@ namespace GUIRenderer public: void clear(); DrawCalls(); + ~DrawCalls(); + // Copy/assignment results in an empty list, not an actual copy DrawCalls(const DrawCalls&); const DrawCalls& operator=(const DrawCalls&); - ~DrawCalls(); }; } diff --git a/source/network/NetClient.cpp b/source/network/NetClient.cpp index d384c46d7b..2060f19ed1 100644 --- a/source/network/NetClient.cpp +++ b/source/network/NetClient.cpp @@ -250,7 +250,7 @@ bool CNetClient::OnError( void* pContext, CFsmEvent* pEvent ) if ( !pEvent || !pContext ) return false; // Error event? - if ( pEvent->GetType() != NMT_ERROR ) return true; + if ( pEvent->GetType() != (uint)NMT_ERROR ) return true; CNetClient* pClient = ( CNetClient* )( ( FsmActionCtx* )pContext )->pHost; assert( pClient ); @@ -364,7 +364,7 @@ bool CNetClient::OnAuthenticate( void* pContext, CFsmEvent* pEvent ) assert( pClient ); assert( pSession ); - if ( pEvent->GetType() == NMT_ERROR ) + if ( pEvent->GetType() == (uint)NMT_ERROR ) { // return CNetClient::OnError( pContext, pEvent ); } diff --git a/source/network/NetServer.cpp b/source/network/NetServer.cpp index 5c6f7a53e6..75e1cdacab 100644 --- a/source/network/NetServer.cpp +++ b/source/network/NetServer.cpp @@ -392,7 +392,7 @@ bool CNetServer::OnError( void* pContext, CFsmEvent* pEvent ) if ( !pContext || !pEvent ) return false; // Error event? - if ( pEvent->GetType() != NMT_ERROR ) return true; + if ( pEvent->GetType() != (uint)NMT_ERROR ) return true; CNetServer* pServer = ( CNetServer* )( ( FsmActionCtx* )pContext )->pHost; UNUSED2(pServer); diff --git a/source/ps/CLogger.cpp b/source/ps/CLogger.cpp index ba9ddd2e6d..27b4bb776a 100644 --- a/source/ps/CLogger.cpp +++ b/source/ps/CLogger.cpp @@ -168,7 +168,7 @@ void CLogger::LogUsingMethod(ELogMethod method, const char* message) } // -- This function has not been removed because the build would break. -void CLogger::Log(ELogMethod method, const char* category, const char *fmt, ...) +void CLogger::Log(ELogMethod method, const char* UNUSED(category), const char *fmt, ...) { va_list argp; char buffer[512]; @@ -185,7 +185,7 @@ void CLogger::Log(ELogMethod method, const char* category, const char *fmt, ...) } // -- This function has not been removed because the build would break. -void CLogger::LogOnce(ELogMethod method, const char* category, const char *fmt, ...) +void CLogger::LogOnce(ELogMethod method, const char* UNUSED(category), const char *fmt, ...) { va_list argp; char buffer[512]; diff --git a/source/ps/Parser.cpp b/source/ps/Parser.cpp index e7590c916f..7faaee2e82 100644 --- a/source/ps/Parser.cpp +++ b/source/ps/Parser.cpp @@ -554,7 +554,7 @@ bool CParserLine::ParseString(const CParser& Parser, const std::string &strLine) // --- New node is set! // Make sure they are large enough - if ((int)LastValidProgress.size() < Lane+1) + if (LastValidProgress.size() < Lane+1) { LastValidProgress.resize(Lane+1); LastValidMatch.resize(Lane+1); @@ -602,7 +602,7 @@ bool CParserLine::ParseString(const CParser& Parser, const std::string &strLine) ++Progress; // Check length - if (Progress >= (int)Segments.size()) + if (Progress >= Segments.size()) { break; } @@ -654,7 +654,7 @@ bool CParserLine::ParseString(const CParser& Parser, const std::string &strLine) // that invalidates the match // String end? - if (Progress >= (int)Segments.size()) + if (Progress >= Segments.size()) { Match = false; } @@ -790,7 +790,7 @@ bool CParserLine::ParseString(const CParser& Parser, const std::string &strLine) // if _minus is found as argument, remove it and add "-" to the one after that // note, it's easier if std::iterator isn't used here - for (i=1; i<(int)GetArgCount(); ++i) + for (i=1; i::iterator ind, first; - for( ind = c.begin(); ind!=c.end() && !((*ind)->equals(*node)); ind++ ); + for( ind = c.begin(); ind!=c.end() && !((*ind)->equals(*node)); ind++ ) { } if (ind == c.end()) { push(node); diff --git a/source/simulation/EntityManager.h b/source/simulation/EntityManager.h index 4e4b8d9770..bf000fb5bc 100644 --- a/source/simulation/EntityManager.h +++ b/source/simulation/EntityManager.h @@ -64,7 +64,7 @@ friend class CHandle; std::bitset m_refd; std::vector m_reaper; std::vector* m_collisionPatches; - int m_nextalloc; + size_t m_nextalloc; static bool m_extant; bool m_death; int m_collisionPatchesPerSide; diff --git a/source/tools/atlas/AtlasScript/ScriptInterface.cpp b/source/tools/atlas/AtlasScript/ScriptInterface.cpp index 49ad543839..391a7b9672 100644 --- a/source/tools/atlas/AtlasScript/ScriptInterface.cpp +++ b/source/tools/atlas/AtlasScript/ScriptInterface.cpp @@ -496,7 +496,9 @@ namespace JSClass global_class = { "global", 0, JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, - JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, JS_FinalizeStub + JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, JS_FinalizeStub, + NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL }; void ErrorReporter(JSContext* WXUNUSED(cx), const char* message, JSErrorReport* report) diff --git a/source/tools/atlas/AtlasUI/CustomControls/DraggableListCtrl/DraggableListCtrlCommands.cpp b/source/tools/atlas/AtlasUI/CustomControls/DraggableListCtrl/DraggableListCtrlCommands.cpp index ecedd76ef4..08f8984e4a 100644 --- a/source/tools/atlas/AtlasUI/CustomControls/DraggableListCtrl/DraggableListCtrlCommands.cpp +++ b/source/tools/atlas/AtlasUI/CustomControls/DraggableListCtrl/DraggableListCtrlCommands.cpp @@ -47,17 +47,23 @@ bool DragCommand::Do() AtObj srcData = m_Ctrl->m_ListData.at(m_Src); if (m_Tgt > m_Src) + { std::copy( m_Ctrl->m_ListData.begin()+(m_Src+1), m_Ctrl->m_ListData.begin()+(m_Tgt+1), m_Ctrl->m_ListData.begin()+ m_Src); + } else if (m_Tgt < m_Src) + { std::copy_backward( m_Ctrl->m_ListData.begin()+ m_Tgt, m_Ctrl->m_ListData.begin()+ m_Src, m_Ctrl->m_ListData.begin()+(m_Src+1)); + } else // m_Tgt == m_Src - ; // do nothing - this item was just dragged onto itself + { + // do nothing - this item was just dragged onto itself + } m_Ctrl->m_ListData.at(m_Tgt) = srcData; diff --git a/source/tools/atlas/AtlasUI/Misc/DLLInterface.cpp b/source/tools/atlas/AtlasUI/Misc/DLLInterface.cpp index 8ffeea9a14..a83af144e9 100644 --- a/source/tools/atlas/AtlasUI/Misc/DLLInterface.cpp +++ b/source/tools/atlas/AtlasUI/Misc/DLLInterface.cpp @@ -39,6 +39,9 @@ #include "wx/debugrpt.h" #include "wx/file.h" +// wx and libxml both want to define ATTRIBUTE_PRINTF (with similar +// meanings), so undef it to avoid a warning +#undef ATTRIBUTE_PRINTF #include #ifndef LIBXML_THREAD_ENABLED diff --git a/source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Trigger/Trigger.cpp b/source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Trigger/Trigger.cpp index 5e53ece2d0..9518f148ff 100644 --- a/source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Trigger/Trigger.cpp +++ b/source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Trigger/Trigger.cpp @@ -1046,7 +1046,7 @@ void TriggerSpecText::onTextEnter(wxCommandEvent& WXUNUSED(evt)) wxBell(); } -TriggerSpecChoice::TriggerSpecChoice(TriggerBottomBar* parent, std::wstring label, const wxPoint& pos, +TriggerSpecChoice::TriggerSpecChoice(TriggerBottomBar* parent, std::wstring WXUNUSED(label), const wxPoint& pos, const wxSize& size, const wxArrayString& strings, int parameter, callback func, void* data) : wxChoice(parent, wxID_ANY, pos, size, strings), m_Callback(func), m_Data(data), m_Parent(parent), m_Parameter(parameter)