From 562816cfe5c361b90a489e7454c14ff6ef5e0150 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCnther=20Brammer?= Date: Wed, 28 Sep 2011 01:09:56 +0200 Subject: [PATCH] Clean up some unused variables and obsolete FIXMEs --- CMakeLists.txt | 3 +++ src/game/object/C4Action.cpp | 1 - src/game/object/C4Def.cpp | 1 - src/game/object/C4ObjectScript.cpp | 1 - src/game/script/C4GameScript.cpp | 1 - src/gui/C4KeyboardInput.cpp | 1 - src/lib/StdBuf.cpp | 2 +- src/script/C4ValueMap.cpp | 1 - 8 files changed, 4 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d670868d8..30453cb1a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -141,6 +141,9 @@ if(MSVC_VERSION) list(APPEND OC_CXX_FLAGS "/wd4267") endif() +if(CMAKE_COMPILER_IS_GNUCXX) + list(APPEND OC_CXX_FLAGS "-Wall -Wextra -Wredundant-decls -Wendif-labels -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Winit-self -Wsign-promo -Wno-reorder -Wno-unused-parameter -Wnon-virtual-dtor -Woverloaded-virtual -Wsign-promo") +endif() ############################################################################ # List target source files. Don't directly create a target since we condi- # tionally add more sources depending on configuration options later. diff --git a/src/game/object/C4Action.cpp b/src/game/object/C4Action.cpp index 2ad55c7c5..54ef43109 100644 --- a/src/game/object/C4Action.cpp +++ b/src/game/object/C4Action.cpp @@ -51,7 +51,6 @@ void C4Action::Default() void C4Action::CompileFunc(StdCompiler *pComp) { // Note: Compiled directly into "Object"-categories, so beware of name clashes (see C4Object::CompileFunc) - // FIXME pComp->Value(mkNamingAdapt( toC4CStr(Name), "Action", "" )); pComp->Value(mkNamingAdapt( Dir, "Dir", DIR_None )); pComp->Value(mkNamingAdapt( ComDir, "ComDir", COMD_Stop )); pComp->Value(mkNamingAdapt( Time, "ActionTime", 0 )); diff --git a/src/game/object/C4Def.cpp b/src/game/object/C4Def.cpp index 35f5b7b94..78db7989c 100644 --- a/src/game/object/C4Def.cpp +++ b/src/game/object/C4Def.cpp @@ -199,7 +199,6 @@ void C4Def::CompileFunc(StdCompiler *pComp) pComp->Value(mkNamingAdapt(id, "id", C4ID::None )); pComp->Value(mkNamingAdapt(toC4CArr(rC4XVer), "Version" )); - //FIXME pComp->Value(mkNamingAdapt(toC4CStrBuf(Name), "Name", "Undefined" )); pComp->Value(mkNamingAdapt(mkParAdapt(RequireDef, false), "RequireDef", C4IDList() )); const StdBitfieldEntry Categories[] = diff --git a/src/game/object/C4ObjectScript.cpp b/src/game/object/C4ObjectScript.cpp index 6fcee5666..62e423b3b 100644 --- a/src/game/object/C4ObjectScript.cpp +++ b/src/game/object/C4ObjectScript.cpp @@ -2480,7 +2480,6 @@ void InitObjectFunctionMap(C4AulScriptEngine *pEngine) AddFunc(pEngine, PSF_OnOwnerRemoved, FnOnOwnerRemoved, false); AddFunc(pEngine, "GetUnusedOverlayID", FnGetUnusedOverlayID, false); AddFunc(pEngine, "ExecuteCommand", FnExecuteCommand); - //FIXME new C4AulDefCastFunc(pEngine, "ScoreboardCol", C4V_C4ID, C4V_Int); AddFunc(pEngine, "PlayAnimation", FnPlayAnimation); AddFunc(pEngine, "StopAnimation", FnStopAnimation); diff --git a/src/game/script/C4GameScript.cpp b/src/game/script/C4GameScript.cpp index 1e0605a25..cfdf4e2ad 100644 --- a/src/game/script/C4GameScript.cpp +++ b/src/game/script/C4GameScript.cpp @@ -2569,7 +2569,6 @@ void InitGameFunctionMap(C4AulScriptEngine *pEngine) AddFunc(pEngine, "GetPlayerControlState", FnGetPlayerControlState); AddFunc(pEngine, "SetPlayerControlEnabled", FnSetPlayerControlEnabled); AddFunc(pEngine, "GetPlayerControlEnabled", FnGetPlayerControlEnabled); - //FIXME new C4AulDefCastFunc(pEngine, "ScoreboardCol", C4V_C4ID, C4V_Int); AddFunc(pEngine, "goto", Fn_goto); AddFunc(pEngine, "IncinerateLandscape", FnIncinerateLandscape); diff --git a/src/gui/C4KeyboardInput.cpp b/src/gui/C4KeyboardInput.cpp index 94cbbfb86..4bdd55e6c 100644 --- a/src/gui/C4KeyboardInput.cpp +++ b/src/gui/C4KeyboardInput.cpp @@ -594,7 +594,6 @@ void C4KeyCodeEx::CompileFunc(StdCompiler *pComp, StdStrBuf *pOutBufIfUndefined) // reading from file StdStrBuf sCode; DWORD dwSetShift = 0; - int shift_idx = 0; for (;;) { pComp->Value(mkParAdapt(sCode, StdCompiler::RCT_Idtf)); diff --git a/src/lib/StdBuf.cpp b/src/lib/StdBuf.cpp index 40931710c..eda38d6e0 100644 --- a/src/lib/StdBuf.cpp +++ b/src/lib/StdBuf.cpp @@ -417,7 +417,7 @@ void StdStrBuf::AppendCharacter(uint32_t unicodechar) *getMPtr(getLength() - 2) = (0x80 | ((unicodechar >> 6) & 0x3F)); *getMPtr(getLength() - 1) = (0x80 | (unicodechar & 0x3F)); } - else /* not an unicode code point, ignore */; + else /* not an unicode code point, ignore */ {} } void StdStrBuf::EnsureUnicode() diff --git a/src/script/C4ValueMap.cpp b/src/script/C4ValueMap.cpp index f70e56271..f25ce6eec 100644 --- a/src/script/C4ValueMap.cpp +++ b/src/script/C4ValueMap.cpp @@ -209,7 +209,6 @@ void C4ValueMapData::OnNameListChanged(const char **pOldNames, int32_t iOldSize) int32_t i, j; for (i = 0; i < iOldSize; i++) { - //FIXME: This optimization is ugly. if (i < pNames->iSize && SEqual(pNames->pNames[i], pOldNames[i])) { pData[i] = pOldData[i];