From 7d17cb28e65734e2473edead8d015d4324478efc Mon Sep 17 00:00:00 2001 From: Armin Burgmeier Date: Tue, 16 Mar 2010 12:39:58 +0100 Subject: [PATCH] Fix a few compiler warnings --- src/gui/C4Gui.cpp | 2 +- src/platform/StdMeshLoaderBinary.cpp | 3 ++- src/platform/StdSurface2.cpp | 5 +++-- src/platform/StdSurface2.h | 4 ++-- src/platform/StdXWindow.cpp | 2 +- src/script/C4AulDebug.cpp | 4 ++-- src/script/C4AulParse.cpp | 1 + 7 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/gui/C4Gui.cpp b/src/gui/C4Gui.cpp index 6a533ad29..0d81750c5 100644 --- a/src/gui/C4Gui.cpp +++ b/src/gui/C4Gui.cpp @@ -686,7 +686,7 @@ Dialog *Screen::GetDialog(CStdWindow * pWindow) // get dialog with matching window Dialog *pDlg; for (Element *pEl = pLast; pEl; pEl = pEl->GetPrev()) - if (pDlg = pEl->GetDlg()) + if ( (pDlg = pEl->GetDlg()) != NULL) if (pDlg->pWindow == pWindow) return pDlg; return NULL; diff --git a/src/platform/StdMeshLoaderBinary.cpp b/src/platform/StdMeshLoaderBinary.cpp index ff03dacd3..3a9402ed3 100644 --- a/src/platform/StdMeshLoaderBinary.cpp +++ b/src/platform/StdMeshLoaderBinary.cpp @@ -49,6 +49,7 @@ namespace // Only one set of each of these elements allowed if (semanticSeen[element.semantic]) return false; + break; } semanticSeen[element.semantic] = true; } @@ -366,5 +367,5 @@ void StdMeshLoader::LoadSkeletonBinary(StdMesh *mesh, const char *src, size_t si } } - DebugLogF("Loaded skeleton with %d bones, %d animations", mesh->GetNumBones(), animations.size()); + DebugLogF("Loaded skeleton with %u bones, %u animations", mesh->GetNumBones(), static_cast(animations.size())); } diff --git a/src/platform/StdSurface2.cpp b/src/platform/StdSurface2.cpp index 666a8ccbe..07db01f66 100644 --- a/src/platform/StdSurface2.cpp +++ b/src/platform/StdSurface2.cpp @@ -485,12 +485,13 @@ bool CSurface::PageFlip(RECT *pSrcRt, RECT *pDstRt) if (!lpDDraw->pApp || !lpDDraw->pApp->AssertMainThread()) return false; #ifdef USE_GL if(pGL) - pCtx->PageFlip(); + return pCtx->PageFlip(); #endif #ifdef USE_DIRECTX if (pD3D) - pD3D->PageFlip(pSrcRt, pDstRt); + return pD3D->PageFlip(pSrcRt, pDstRt); #endif + return true; } #ifdef USE_DIRECTX diff --git a/src/platform/StdSurface2.h b/src/platform/StdSurface2.h index a9eb43536..e50c8813d 100644 --- a/src/platform/StdSurface2.h +++ b/src/platform/StdSurface2.h @@ -76,9 +76,9 @@ class CDDrawCfg bool Shader; // whether to use pixelshaders CDDrawCfg(): + ClipManuallyE (true), NoOffscreenBlits (true), // not yet working properly... - Shader (false), - ClipManuallyE (true) + Shader (false) { } }; diff --git a/src/platform/StdXWindow.cpp b/src/platform/StdXWindow.cpp index 33ee238e7..54fd235f3 100644 --- a/src/platform/StdXWindow.cpp +++ b/src/platform/StdXWindow.cpp @@ -50,7 +50,7 @@ /* CStdWindow */ CStdWindow::CStdWindow (): - Active(false), wnd(0), renderwnd(0), dpy(0), Hints(0), HasFocus(false), Info(0), pSurface(0) + Active(false), pSurface(0), wnd(0), renderwnd(0), dpy(0), Hints(0), HasFocus(false), Info(0) { } CStdWindow::~CStdWindow () { diff --git a/src/script/C4AulDebug.cpp b/src/script/C4AulDebug.cpp index fdff04a89..11ce4cca1 100644 --- a/src/script/C4AulDebug.cpp +++ b/src/script/C4AulDebug.cpp @@ -294,7 +294,7 @@ bool C4AulDebug::SendLine(const char *szType, const char *szData) void C4AulDebug::DebugStep(C4AulBCC *pCPos) { // Get top context - C4AulScriptContext *pCtx = pExec->GetContext(pExec->GetContextDepth() - 1); + //C4AulScriptContext *pCtx = pExec->GetContext(pExec->GetContextDepth() - 1); // Already stopped? Ignore. // This means we are doing some calculation with suspended script engine. @@ -455,4 +455,4 @@ StdStrBuf C4AulDebug::FormatCodePos(C4AulScriptContext *pCtx, C4AulBCC *pCPos) return FormatString("%s:%d", RelativePath(pCtx->Func->pOrgScript->ScriptName), iLine); } -#endif \ No newline at end of file +#endif diff --git a/src/script/C4AulParse.cpp b/src/script/C4AulParse.cpp index 961050d0c..e534bcfd3 100644 --- a/src/script/C4AulParse.cpp +++ b/src/script/C4AulParse.cpp @@ -1962,6 +1962,7 @@ int C4AulParseState::Parse_Params(int iMaxCnt, const char * sWarn, C4AulFunc * p } case AB_ARRAYA_R: case AB_PAR_R: case AB_PARN_R: case AB_VARN_R: case AB_LOCALN_R: case AB_GLOBALN_R: from = C4V_pC4Value; break; + default: break; // avoid compiler warning about unhandled enumerators } if (C4Value::WarnAboutConversion(from, to)) {