fix platform / sconscript flag specific warnings, --no-warnings no longer defaults to true

This commit is contained in:
jacob1 2015-01-16 23:39:42 -05:00
parent ace9e36cc6
commit b1a3c404b6
7 changed files with 17 additions and 15 deletions

View File

@ -68,7 +68,7 @@ AddSconsOption('opengl-renderer', False, False, "Build with OpenGL renderer supp
AddSconsOption('renderer', False, False, "Build the save renderer.")
AddSconsOption('wall', False, False, "Error on all warnings.")
AddSconsOption('no-warnings', True, False, "Disable all compiler warnings (default).")
AddSconsOption('no-warnings', False, False, "Disable all compiler warnings.")
AddSconsOption('nolua', False, False, "Disable Lua.")
AddSconsOption('nofft', False, False, "Disable FFT.")
AddSconsOption("output", False, True, "Executable output name.")

View File

@ -948,8 +948,8 @@ int main(int argc, char * argv[])
{
std::string saveIdPart = "";
int saveId;
unsigned int hashPos = ptsaveArg.find('#');
if(hashPos != std::string::npos)
size_t hashPos = ptsaveArg.find('#');
if (hashPos != std::string::npos)
{
saveIdPart = ptsaveArg.substr(7, hashPos-7);
}
@ -957,7 +957,7 @@ int main(int argc, char * argv[])
{
saveIdPart = ptsaveArg.substr(7);
}
if(saveIdPart.length())
if (saveIdPart.length())
{
#ifdef DEBUG
std::cout << "Got Ptsave: id: " << saveIdPart << std::endl;
@ -967,7 +967,7 @@ int main(int argc, char * argv[])
throw std::runtime_error("Invalid Save ID");
SaveInfo * newSave = Client::Ref().GetSave(saveId, 0);
if(!newSave)
if (!newSave)
throw std::runtime_error("Could not load save");
GameSave * newGameSave = new GameSave(Client::Ref().GetSaveData(saveId, 0));
newSave->SetGameSave(newGameSave);

View File

@ -395,6 +395,7 @@ void writeUserPreferences(const char * prefData)
[prefDataNSString release];
}
//doesn't work on OS X 10.5 or below
char * readClipboard()
{
NSPasteboard *clipboard = [NSPasteboard generalPasteboard];
@ -416,6 +417,7 @@ char * readClipboard()
return clipboardDataCopy;
}
//doesn't work on OS X 10.5 or below
void writeClipboard(const char * clipboardData)
{
NSPasteboard *clipboard = [NSPasteboard generalPasteboard];

View File

@ -772,7 +772,7 @@ void GameSave::readOPS(char * data, int dataLength)
fanVelY[blockY+y][blockX+x] = (fanData[j++]-127.0f)/64.0f;
}
if (blockMap[y][x] < 0 || blockMap[y][x] >= UI_WALLCOUNT)
if (blockMap[y][x] >= UI_WALLCOUNT)
blockMap[y][x] = 0;
}
}
@ -825,8 +825,6 @@ void GameSave::readOPS(char * data, int dataLength)
fprintf(stderr, "Out of range [%d]: %d %d, [%d, %d], [%d, %d]\n", i, x, y, (unsigned)partsData[i+1], (unsigned)partsData[i+2], (unsigned)partsData[i+3], (unsigned)partsData[i+4]);
goto fail;
}
if (partsData[i] >= PT_NUM)
partsData[i] = PT_DMND; //Replace all invalid elements with diamond
if (newIndex < 0 || newIndex >= NPART)
goto fail;
@ -1295,7 +1293,7 @@ void GameSave::readPSv(char * data, int dataLength)
blockMap[y][x]=WL_ALLOWENERGY;
}
if (blockMap[y][x] < 0 || blockMap[y][x] >= UI_WALLCOUNT)
if (blockMap[y][x] >= UI_WALLCOUNT)
blockMap[y][x] = 0;
}

View File

@ -201,7 +201,7 @@ void Renderer::clearScreen(float alpha)
#endif
}
#ifdef OGLR
void Renderer::checkShader(GLuint shader, char * shname)
void Renderer::checkShader(GLuint shader, const char * shname)
{
GLint status;
glGetShaderiv(shader, GL_COMPILE_STATUS, &status);
@ -214,7 +214,7 @@ void Renderer::checkShader(GLuint shader, char * shname)
exit(1);
}
}
void Renderer::checkProgram(GLuint program, char * progname)
void Renderer::checkProgram(GLuint program, const char * progname)
{
GLint status;
glGetProgramiv(program, GL_LINK_STATUS, &status);
@ -706,7 +706,7 @@ void Renderer::DrawWalls()
if (bmap[y][x])
{
wt = bmap[y][x];
if (wt<0 || wt>=UI_WALLCOUNT)
if (wt >= UI_WALLCOUNT)
continue;
pc = wtypes[wt].colour;
gc = wtypes[wt].eglow;

View File

@ -99,8 +99,8 @@ public:
void SetSample(int x, int y);
#ifdef OGLR
void checkShader(GLuint shader, char * shname);
void checkProgram(GLuint program, char * progname);
void checkShader(GLuint shader, const char * shname);
void checkProgram(GLuint program, const char * progname);
void loadShaders();
GLuint vidBuf,textTexture;
GLint prevFbo;

View File

@ -81,8 +81,10 @@ int Simulation::Load(int fullX, int fullY, GameSave * save)
x = int(tempPart.x + 0.5f);
y = int(tempPart.y + 0.5f);
if(tempPart.type >= 0 && tempPart.type < PT_NUM)
if (tempPart.type >= 0 && tempPart.type < PT_NUM)
tempPart.type = partMap[tempPart.type];
else
continue;
if ((player.spwn == 1 && tempPart.type==PT_STKM) || (player2.spwn == 1 && tempPart.type==PT_STKM2))
continue;