fix a few clang warnings

This commit is contained in:
Tim Felgentreff 2016-01-07 16:33:08 +01:00
parent 0eed3c8c3b
commit 31ca73242b
5 changed files with 8 additions and 5 deletions

View file

@ -268,7 +268,7 @@ bool HallPlaceFinder::IsAUsableMine(const CUnit &mine) const
}
// Town hall may not be near but we may be using it, check
// for 2 buildings near it and assume it's been used
if (unit.Type->Building && !unit.Type->GivesResource == resource) {
if (unit.Type->Building && !(unit.Type->GivesResource == resource)) {
++buildings;
if (buildings == 2) {
return false;

View file

@ -1301,7 +1301,7 @@ static void EditorCallbackKeyDown(unsigned key, unsigned keychar)
const char *ptr = strchr(UiGroupKeys.c_str(), key);
if (ptr) {
key = '0' + ptr - UiGroupKeys.c_str();
key = ((int)'0') + ptr - UiGroupKeys.c_str();
if (key > '9') {
key = SDLK_BACKQUOTE;
}
@ -2080,4 +2080,4 @@ void StartEditor(const char *filename)
SetDefaultTextColors(nc, rc);
}
//@}
//@}

View file

@ -653,6 +653,7 @@ unsigned CTileset::getWallDirection(int tileIndex, bool human) const
return i;
}
}
return 0;
}
unsigned CTileset::getHumanWallTileIndex(int dirFlag) const
{

View file

@ -568,7 +568,7 @@ static bool CommandKey(int key)
// FIXME: don't handle unicode well. Should work on all latin keyboard.
if (ptr) {
key = '0' + ptr - UiGroupKeys.c_str();
key = ((int)'0') + ptr - UiGroupKeys.c_str();
if (key > '9') {
key = SDLK_BACKQUOTE;
}

View file

@ -448,13 +448,15 @@ extern bool LoadShaderExtensions() {
glFramebufferRenderbuffer = (PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC)(uintptr_t)SDL_GL_GetProcAddress("glFramebufferRenderbuffer");
glDrawBuffers = (PFNGLDRAWBUFFERSPROC)(uintptr_t)SDL_GL_GetProcAddress("glDrawBuffers");
glCheckFramebufferStatus = (PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC)(uintptr_t)SDL_GL_GetProcAddress("glCheckFramebufferStatus");
#endif
if (glCreateShader && glGenFramebuffers && glGetUniformLocation && glActiveTextureProc) {
LoadShaders();
return true;
} else {
return false;
}
#else
return false; // FIXME: Does not currently work on OSX
#endif
}
extern void SetupFramebuffer() {