diff --git a/src/actor.h b/src/actor.h index 137804052..5dd44c914 100644 --- a/src/actor.h +++ b/src/actor.h @@ -749,7 +749,7 @@ public: bool UpdateWaterLevel (fixed_t oldz); FState *FindState (FName label) const; - FState *FindState (int numnames, int first, ...) const; + FState *FindState (int numnames, ...) const; FState *FindState (int numnames, va_list arglist) const; bool HasSpecialDeathStates () const; diff --git a/src/dobjtype.cpp b/src/dobjtype.cpp index b9b7d579c..180766d19 100644 --- a/src/dobjtype.cpp +++ b/src/dobjtype.cpp @@ -380,4 +380,4 @@ PSymbol *PSymbolTable::AddSymbol (PSymbol *sym) // Good. The symbol is not in the table yet. Symbols.Insert (MAX(min, max), sym); return sym; -} \ No newline at end of file +} diff --git a/src/info.cpp b/src/info.cpp index f616127ec..12e27f1ad 100644 --- a/src/info.cpp +++ b/src/info.cpp @@ -509,8 +509,7 @@ bool AActor::HasSpecialDeathStates () const // //=========================================================================== -FState *AActor::FindState (int numnames, int first, ...) const // The 'first' parameter is only here to - // disambiguate from the single parameter version +FState *AActor::FindState (int numnames, ...) const { va_list arglist; va_start (arglist, numnames); diff --git a/src/m_png.cpp b/src/m_png.cpp index 3ac401069..dd7d35ebc 100644 --- a/src/m_png.cpp +++ b/src/m_png.cpp @@ -574,6 +574,12 @@ bool M_ReadIDAT (FileReader *file, BYTE *buffer, int width, int height, int pitc initpass = true; pass = interlace ? 0 : 7; + // Silence GCC warnings. Due to initpass being true, these will be set + // before they're used, but it doesn't know that. + curr = prev = 0; + passwidth = passpitch = bytesPerRowIn = 0; + passbuff = 0; + while (err != Z_STREAM_END && pass < 8 - interlace) { if (initpass) diff --git a/src/p_mobj.cpp b/src/p_mobj.cpp index 46aa7a65b..663907fc4 100644 --- a/src/p_mobj.cpp +++ b/src/p_mobj.cpp @@ -4753,7 +4753,7 @@ void AActor::Crash() if (DamageType != NAME_None) { - crashstate = GetClass()->ActorInfo->FindStateExact(2, NAME_Crash, DamageType); + crashstate = GetClass()->ActorInfo->FindStateExact(2, NAME_Crash, int(DamageType)); } if (crashstate == NULL) { diff --git a/src/p_terrain.cpp b/src/p_terrain.cpp index f23c1757d..e91c28b83 100644 --- a/src/p_terrain.cpp +++ b/src/p_terrain.cpp @@ -376,6 +376,27 @@ static void ParseOuter () } } +//========================================================================== +// +// SetSplashDefaults +// +//========================================================================== + +static void SetSplashDefaults (FSplashDef *splashdef) +{ + splashdef->SmallSplashSound = + splashdef->NormalSplashSound = 0; + splashdef->SmallSplash = + splashdef->SplashBase = + splashdef->SplashChunk = NULL; + splashdef->ChunkXVelShift = + splashdef->ChunkYVelShift = + splashdef->ChunkZVelShift = 8; + splashdef->ChunkBaseZVel = FRACUNIT; + splashdef->SmallSplashClip = 12*FRACUNIT; + splashdef->NoAlert = false; +} + //========================================================================== // // ParseSplash @@ -395,6 +416,7 @@ void ParseSplash () if (splashnum < 0) { FSplashDef def; + SetSplashDefaults (&def); def.Name = name; splashnum = (int)Splashes.Push (def); isnew = true; @@ -402,19 +424,16 @@ void ParseSplash () splashdef = &Splashes[splashnum]; SC_MustGetString (); - if (!SC_Compare ("modify") || (SC_MustGetString(), isnew)) + if (!SC_Compare ("modify")) { // Set defaults - splashdef->SmallSplashSound = - splashdef->NormalSplashSound = 0; - splashdef->SmallSplash = - splashdef->SplashBase = - splashdef->SplashChunk = NULL; - splashdef->ChunkXVelShift = - splashdef->ChunkYVelShift = - splashdef->ChunkZVelShift = 8; - splashdef->ChunkBaseZVel = FRACUNIT; - splashdef->SmallSplashClip = 12*FRACUNIT; - splashdef->NoAlert = false; + if (!isnew) + { // New ones already have their defaults set before they're pushed. + SetSplashDefaults (splashdef); + } + } + else + { + SC_MustGetString(); } if (!SC_Compare ("{")) { diff --git a/src/r_polymost.cpp b/src/r_polymost.cpp index ec41003d8..e4954bc7f 100644 --- a/src/r_polymost.cpp +++ b/src/r_polymost.cpp @@ -1197,7 +1197,7 @@ void RP_AddLine (seg_t *line) } else { // The seg is only part of the wall. - if (line->linedef->sidenum[0] != line->sidedef - sides) + if (line->linedef->sidenum[0] != DWORD(line->sidedef - sides)) { swap (v1, v2); } diff --git a/src/sc_man.cpp b/src/sc_man.cpp index cf3ef26af..8e8bfa0a3 100644 --- a/src/sc_man.cpp +++ b/src/sc_man.cpp @@ -440,8 +440,9 @@ void SC_MustGetToken (int token) SC_MustGetAnyToken (); if (sc_TokenType != token) { - SC_ScriptError ("Expected %s but got %s instead.", - SC_TokenName(token), SC_TokenName(sc_TokenType, sc_String)); + FString tok1 = SC_TokenName(token); + FString tok2 = SC_TokenName(sc_TokenType, sc_String); + SC_ScriptError ("Expected %s but got %s instead.", tok1.GetChars(), tok2.GetChars()); } } diff --git a/src/thingdef.cpp b/src/thingdef.cpp index 7f1296f23..4b8314e83 100644 --- a/src/thingdef.cpp +++ b/src/thingdef.cpp @@ -1649,7 +1649,7 @@ do_stop: stype = PClass::FindClass (scopename); if (stype == NULL) { - SC_ScriptError ("%s is an unknown class.", scopename); + SC_ScriptError ("%s is an unknown class.", scopename.GetChars()); } if (!stype->IsDescendantOf (RUNTIME_CLASS(AActor))) { @@ -4327,7 +4327,8 @@ void ParseClass() } else { - SC_ScriptError ("Expected 'action' or 'const' but got %s", SC_TokenName(sc_TokenType, sc_String)); + FString tokname = SC_TokenName(sc_TokenType, sc_String); + SC_ScriptError ("Expected 'action' or 'const' but got %s", tokname.GetChars()); } SC_MustGetAnyToken(); } diff --git a/src/thingdef_codeptr.cpp b/src/thingdef_codeptr.cpp index 1d5e198b3..cbd6bc1a0 100644 --- a/src/thingdef_codeptr.cpp +++ b/src/thingdef_codeptr.cpp @@ -404,7 +404,7 @@ static void DoJump(AActor * self, FState * CallingState, int offset) if (classname != NAME_None) Printf("%s::", ((FName)(ENamedName)classname).GetChars()); for (int i=0;iGetClass()->TypeName.GetChars()); return; diff --git a/src/thingdef_exp.cpp b/src/thingdef_exp.cpp index eb3e1e15f..b472d809b 100644 --- a/src/thingdef_exp.cpp +++ b/src/thingdef_exp.cpp @@ -885,7 +885,8 @@ static ExpData *ParseExpressionA (const PClass *cls) } else { - SC_ScriptError ("Unexpected token %s", SC_TokenName(sc_TokenType, sc_String)); + FString tokname = SC_TokenName(sc_TokenType, sc_String); + SC_ScriptError ("Unexpected token %s", tokname.GetChars()); return NULL; } } @@ -946,6 +947,8 @@ static ExpVal EvalExpression (ExpData *data, AActor *self, const PClass *cls) { ExpVal val; + val.Type = VAL_Int; // Placate GCC + switch (data->Type) { case EX_NOP: diff --git a/tools/updaterevision/updaterevision.vcproj b/tools/updaterevision/updaterevision.vcproj index f39914dca..202c9d042 100644 --- a/tools/updaterevision/updaterevision.vcproj +++ b/tools/updaterevision/updaterevision.vcproj @@ -1,7 +1,7 @@ + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - -