diff --git a/code/botlib/be_aas_bspq3.c b/code/botlib/be_aas_bspq3.c index c149b05f..a6b6edb0 100644 --- a/code/botlib/be_aas_bspq3.c +++ b/code/botlib/be_aas_bspq3.c @@ -392,7 +392,7 @@ void AAS_ParseBSPEntities(void) { if (strcmp(token.string, "{")) { - ScriptError(script, "invalid %s\n", token.string); + ScriptError(script, "invalid %s", token.string); AAS_FreeBSPEntities(); FreeScript(script); return; @@ -413,7 +413,7 @@ void AAS_ParseBSPEntities(void) ent->epairs = epair; if (token.type != TT_STRING) { - ScriptError(script, "invalid %s\n", token.string); + ScriptError(script, "invalid %s", token.string); AAS_FreeBSPEntities(); FreeScript(script); return; @@ -433,7 +433,7 @@ void AAS_ParseBSPEntities(void) } //end while if (strcmp(token.string, "}")) { - ScriptError(script, "missing }\n"); + ScriptError(script, "missing }"); AAS_FreeBSPEntities(); FreeScript(script); return; diff --git a/code/botlib/be_aas_cluster.c b/code/botlib/be_aas_cluster.c index 6c029eeb..013e8066 100644 --- a/code/botlib/be_aas_cluster.c +++ b/code/botlib/be_aas_cluster.c @@ -130,7 +130,7 @@ int AAS_UpdatePortal(int areanum, int clusternum) // if (portalnum == aasworld.numportals) { - AAS_Error("no portal of area %d", areanum); + AAS_Error("no portal of area %d\n", areanum); return qtrue; } //end if // @@ -157,7 +157,7 @@ int AAS_UpdatePortal(int areanum, int clusternum) } //end else if (aasworld.portalindexsize >= AAS_MAX_PORTALINDEXSIZE) { - AAS_Error("AAS_MAX_PORTALINDEXSIZE"); + AAS_Error("AAS_MAX_PORTALINDEXSIZE\n"); return qtrue; } //end if //set the area cluster number to the negative portal number @@ -184,7 +184,7 @@ int AAS_FloodClusterAreas_r(int areanum, int clusternum) // if (areanum <= 0 || areanum >= aasworld.numareas) { - AAS_Error("AAS_FloodClusterAreas_r: areanum out of range"); + AAS_Error("AAS_FloodClusterAreas_r: areanum out of range\n"); return qfalse; } //end if //if the area is already part of a cluster @@ -194,7 +194,7 @@ int AAS_FloodClusterAreas_r(int areanum, int clusternum) // //there's a reachability going from one cluster to another only in one direction // - AAS_Error("cluster %d touched cluster %d at area %d\r\n", + AAS_Error("cluster %d touched cluster %d at area %d\n", clusternum, aasworld.areasettings[areanum].cluster, areanum); return qfalse; } //end if @@ -410,7 +410,7 @@ int AAS_FindClusters(void) continue; if (aasworld.numclusters >= AAS_MAX_CLUSTERS) { - AAS_Error("AAS_MAX_CLUSTERS"); + AAS_Error("AAS_MAX_CLUSTERS\n"); return qfalse; } //end if cluster = &aasworld.clusters[aasworld.numclusters]; @@ -449,7 +449,7 @@ void AAS_CreatePortals(void) { if (aasworld.numportals >= AAS_MAX_PORTALS) { - AAS_Error("AAS_MAX_PORTALS"); + AAS_Error("AAS_MAX_PORTALS\n"); return; } //end if portal = &aasworld.portals[aasworld.numportals]; @@ -776,7 +776,7 @@ int AAS_GetAdjacentAreasWithLessPresenceTypes_r(int *areanums, int numareas, int { if (numareas >= MAX_PORTALAREAS) { - AAS_Error("MAX_PORTALAREAS"); + AAS_Error("MAX_PORTALAREAS\n"); return numareas; } //end if numareas = AAS_GetAdjacentAreasWithLessPresenceTypes_r(areanums, numareas, otherareanum); diff --git a/code/botlib/be_aas_reach.c b/code/botlib/be_aas_reach.c index dc6a58e9..3a4564ca 100644 --- a/code/botlib/be_aas_reach.c +++ b/code/botlib/be_aas_reach.c @@ -490,7 +490,7 @@ aas_lreachability_t *AAS_AllocReachability(void) if (!nextreachability) return NULL; //make sure the error message only shows up once - if (!nextreachability->next) AAS_Error("AAS_MAX_REACHABILITYSIZE"); + if (!nextreachability->next) AAS_Error("AAS_MAX_REACHABILITYSIZE\n"); // r = nextreachability; nextreachability = nextreachability->next; @@ -523,7 +523,7 @@ int AAS_AreaReachability(int areanum) { if (areanum < 0 || areanum >= aasworld.numareas) { - AAS_Error("AAS_AreaReachability: areanum %d out of range", areanum); + AAS_Error("AAS_AreaReachability: areanum %d out of range\n", areanum); return 0; } //end if return aasworld.areasettings[areanum].numreachableareas; diff --git a/code/botlib/be_aas_route.c b/code/botlib/be_aas_route.c index 1d57b530..225b291e 100644 --- a/code/botlib/be_aas_route.c +++ b/code/botlib/be_aas_route.c @@ -1074,7 +1074,7 @@ int AAS_ReadRouteCache(void) } //end if if (routecacheheader.version != RCVERSION) { - AAS_Error("route cache dump has wrong version %d, should be %d", routecacheheader.version, RCVERSION); + AAS_Error("route cache dump has wrong version %d, should be %d\n", routecacheheader.version, RCVERSION); return qfalse; } //end if if (routecacheheader.numareas != aasworld.numareas) diff --git a/code/botlib/be_ai_char.c b/code/botlib/be_ai_char.c index 83648c59..b94c4e9a 100644 --- a/code/botlib/be_ai_char.c +++ b/code/botlib/be_ai_char.c @@ -256,7 +256,7 @@ bot_character_t *BotLoadCharacterFromFile(char *charfile, int skill) if (!strcmp(token.string, "}")) break; if (token.type != TT_NUMBER || !(token.subtype & TT_INTEGER)) { - SourceError(source, "expected integer index, found %s\n", token.string); + SourceError(source, "expected integer index, found %s", token.string); FreeSource(source); BotFreeCharacterStrings(ch); FreeMemory(ch); @@ -265,7 +265,7 @@ bot_character_t *BotLoadCharacterFromFile(char *charfile, int skill) index = token.intvalue; if (index < 0 || index > MAX_CHARACTERISTICS) { - SourceError(source, "characteristic index out of range [0, %d]\n", MAX_CHARACTERISTICS); + SourceError(source, "characteristic index out of range [0, %d]", MAX_CHARACTERISTICS); FreeSource(source); BotFreeCharacterStrings(ch); FreeMemory(ch); @@ -273,7 +273,7 @@ bot_character_t *BotLoadCharacterFromFile(char *charfile, int skill) } //end if if (ch->c[index].type) { - SourceError(source, "characteristic %d already initialized\n", index); + SourceError(source, "characteristic %d already initialized", index); FreeSource(source); BotFreeCharacterStrings(ch); FreeMemory(ch); @@ -308,7 +308,7 @@ bot_character_t *BotLoadCharacterFromFile(char *charfile, int skill) } //end else if else { - SourceError(source, "expected integer, float or string, found %s\n", token.string); + SourceError(source, "expected integer, float or string, found %s", token.string); FreeSource(source); BotFreeCharacterStrings(ch); FreeMemory(ch); @@ -336,7 +336,7 @@ bot_character_t *BotLoadCharacterFromFile(char *charfile, int skill) } //end if else { - SourceError(source, "unknown definition %s\n", token.string); + SourceError(source, "unknown definition %s", token.string); FreeSource(source); BotFreeCharacterStrings(ch); FreeMemory(ch); diff --git a/code/botlib/be_ai_chat.c b/code/botlib/be_ai_chat.c index c227ddde..867e4391 100644 --- a/code/botlib/be_ai_chat.c +++ b/code/botlib/be_ai_chat.c @@ -739,7 +739,7 @@ bot_synonymlist_t *BotLoadSynonyms(char *filename) } //end while if (numsynonyms < 2) { - SourceError(source, "synonym must have at least two entries\n"); + SourceError(source, "synonym must have at least two entries"); FreeSource(source); return NULL; } //end if @@ -891,7 +891,7 @@ int BotLoadChatMessage(source_t *source, char *chatmessagestring) StripDoubleQuotes(token.string); if (strlen(ptr) + strlen(token.string) + 1 > MAX_MESSAGE_SIZE) { - SourceError(source, "chat message too long\n"); + SourceError(source, "chat message too long"); return qfalse; } //end if strcat(ptr, token.string); @@ -901,7 +901,7 @@ int BotLoadChatMessage(source_t *source, char *chatmessagestring) { if (strlen(ptr) + 7 > MAX_MESSAGE_SIZE) { - SourceError(source, "chat message too long\n"); + SourceError(source, "chat message too long"); return qfalse; } //end if sprintf(&ptr[strlen(ptr)], "%cv%ld%c", ESCAPE_CHAR, token.intvalue, ESCAPE_CHAR); @@ -911,14 +911,14 @@ int BotLoadChatMessage(source_t *source, char *chatmessagestring) { if (strlen(ptr) + 7 > MAX_MESSAGE_SIZE) { - SourceError(source, "chat message too long\n"); + SourceError(source, "chat message too long"); return qfalse; } //end if sprintf(&ptr[strlen(ptr)], "%cr%s%c", ESCAPE_CHAR, token.string, ESCAPE_CHAR); } //end else if else { - SourceError(source, "unknown message component %s\n", token.string); + SourceError(source, "unknown message component %s", token.string); return qfalse; } //end else if (PC_CheckTokenString(source, ";")) break; @@ -1175,14 +1175,14 @@ bot_matchpiece_t *BotLoadMatchPieces(source_t *source, char *endtoken) { if (token.intvalue >= MAX_MATCHVARIABLES) { - SourceError(source, "can't have more than %d match variables\n", MAX_MATCHVARIABLES); + SourceError(source, "can't have more than %d match variables", MAX_MATCHVARIABLES); FreeSource(source); BotFreeMatchPieces(firstpiece); return NULL; } //end if if (lastwasvariable) { - SourceError(source, "not allowed to have adjacent variables\n"); + SourceError(source, "not allowed to have adjacent variables"); FreeSource(source); BotFreeMatchPieces(firstpiece); return NULL; @@ -1238,7 +1238,7 @@ bot_matchpiece_t *BotLoadMatchPieces(source_t *source, char *endtoken) } //end if else { - SourceError(source, "invalid token %s\n", token.string); + SourceError(source, "invalid token %s", token.string); FreeSource(source); BotFreeMatchPieces(firstpiece); return NULL; @@ -1298,7 +1298,7 @@ bot_matchtemplate_t *BotLoadMatchTemplates(char *matchfile) { if (token.type != TT_NUMBER || !(token.subtype & TT_INTEGER)) { - SourceError(source, "expected integer, found %s\n", token.string); + SourceError(source, "expected integer, found %s", token.string); BotFreeMatchTemplates(matches); FreeSource(source); return NULL; @@ -2101,7 +2101,7 @@ bot_chat_t *BotLoadInitialChat(char *chatfile, char *chatname) if (!strcmp(token.string, "}")) break; if (strcmp(token.string, "type")) { - SourceError(source, "expected type found %s\n", token.string); + SourceError(source, "expected type found %s", token.string); FreeSource(source); return NULL; } //end if @@ -2172,7 +2172,7 @@ bot_chat_t *BotLoadInitialChat(char *chatfile, char *chatname) } //end if else { - SourceError(source, "unknown definition %s\n", token.string); + SourceError(source, "unknown definition %s", token.string); FreeSource(source); return NULL; } //end else diff --git a/code/botlib/be_ai_goal.c b/code/botlib/be_ai_goal.c index e7ee598e..9feeeab5 100644 --- a/code/botlib/be_ai_goal.c +++ b/code/botlib/be_ai_goal.c @@ -300,7 +300,7 @@ itemconfig_t *LoadItemConfig(char *filename) { if (ic->numiteminfo >= max_iteminfo) { - SourceError(source, "more than %d item info defined\n", max_iteminfo); + SourceError(source, "more than %d item info defined", max_iteminfo); FreeMemory(ic); FreeSource(source); return NULL; @@ -326,7 +326,7 @@ itemconfig_t *LoadItemConfig(char *filename) } //end if else { - SourceError(source, "unknown definition %s\n", token.string); + SourceError(source, "unknown definition %s", token.string); FreeMemory(ic); FreeSource(source); return NULL; diff --git a/code/botlib/be_ai_weight.c b/code/botlib/be_ai_weight.c index 17216aba..9f3d0f74 100644 --- a/code/botlib/be_ai_weight.c +++ b/code/botlib/be_ai_weight.c @@ -63,18 +63,18 @@ int ReadValue(source_t *source, float *value) if (!PC_ExpectAnyToken(source, &token)) return qfalse; if (!strcmp(token.string, "-")) { - SourceWarning(source, "negative value set to zero\n"); + SourceWarning(source, "negative value set to zero"); if(!PC_ExpectAnyToken(source, &token)) { - SourceError(source, "Missing return value\n"); + SourceError(source, "Missing return value"); return qfalse; } } if (token.type != TT_NUMBER) { - SourceError(source, "invalid return value %s\n", token.string); + SourceError(source, "invalid return value %s", token.string); return qfalse; } @@ -186,7 +186,7 @@ fuzzyseperator_t *ReadFuzzySeperators_r(source_t *source) { if (founddefault) { - SourceError(source, "switch already has a default\n"); + SourceError(source, "switch already has a default"); FreeFuzzySeperators_r(firstfs); return NULL; } //end if @@ -236,7 +236,7 @@ fuzzyseperator_t *ReadFuzzySeperators_r(source_t *source) } //end else if else { - SourceError(source, "invalid name %s\n", token.string); + SourceError(source, "invalid name %s", token.string); return NULL; } //end else if (newindent) @@ -251,7 +251,7 @@ fuzzyseperator_t *ReadFuzzySeperators_r(source_t *source) else { FreeFuzzySeperators_r(firstfs); - SourceError(source, "invalid name %s\n", token.string); + SourceError(source, "invalid name %s", token.string); return NULL; } //end else if (!PC_ExpectAnyToken(source, &token)) @@ -263,7 +263,7 @@ fuzzyseperator_t *ReadFuzzySeperators_r(source_t *source) // if (!founddefault) { - SourceWarning(source, "switch without default\n"); + SourceWarning(source, "switch without default"); fs = (fuzzyseperator_t *) GetClearedMemory(sizeof(fuzzyseperator_t)); fs->index = index; fs->value = MAX_INVENTORYVALUE; @@ -342,7 +342,7 @@ weightconfig_t *ReadWeightConfig(char *filename) { if (config->numweights >= MAX_WEIGHTS) { - SourceWarning(source, "too many fuzzy weights\n"); + SourceWarning(source, "too many fuzzy weights"); break; } //end if if (!PC_ExpectTokenType(source, TT_STRING, 0, &token)) @@ -400,7 +400,7 @@ weightconfig_t *ReadWeightConfig(char *filename) } //end else if else { - SourceError(source, "invalid name %s\n", token.string); + SourceError(source, "invalid name %s", token.string); FreeWeightConfig(config); FreeSource(source); return NULL; @@ -418,7 +418,7 @@ weightconfig_t *ReadWeightConfig(char *filename) } //end if else { - SourceError(source, "invalid name %s\n", token.string); + SourceError(source, "invalid name %s", token.string); FreeWeightConfig(config); FreeSource(source); return NULL; diff --git a/code/botlib/l_precomp.c b/code/botlib/l_precomp.c index af9e068d..e427d8a2 100644 --- a/code/botlib/l_precomp.c +++ b/code/botlib/l_precomp.c @@ -269,7 +269,7 @@ token_t *PC_CopyToken(token_t *token) if (!t) { #ifdef BSPC - Error("out of token space\n"); + Error("out of token space"); #else Com_Error(ERR_FATAL, "out of token space"); #endif @@ -1666,7 +1666,7 @@ int PC_OperatorPriority(int op) #define MAX_OPERATORS 64 #define AllocValue(val) \ if (numvalues >= MAX_VALUES) { \ - SourceError(source, "out of value space\n"); \ + SourceError(source, "out of value space"); \ error = 1; \ break; \ } \ @@ -1676,7 +1676,7 @@ int PC_OperatorPriority(int op) // #define AllocOperator(op) \ if (numoperators >= MAX_OPERATORS) { \ - SourceError(source, "out of operator space\n"); \ + SourceError(source, "out of operator space"); \ error = 1; \ break; \ } \ @@ -1838,7 +1838,7 @@ int PC_EvaluateTokens(source_t *source, token_t *tokens, signed long int *intval t->subtype == P_BIN_AND || t->subtype == P_BIN_OR || t->subtype == P_BIN_XOR) { - SourceError(source, "illigal operator %s on floating point operands\n", t->string); + SourceError(source, "illigal operator %s on floating point operands", t->string); error = 1; break; } //end if @@ -2005,7 +2005,7 @@ int PC_EvaluateTokens(source_t *source, token_t *tokens, signed long int *intval v1->floatvalue *= v2->floatvalue; break; case P_DIV: if (!v2->intvalue || !v2->floatvalue) { - SourceError(source, "divide by zero in #if/#elif\n"); + SourceError(source, "divide by zero in #if/#elif"); error = 1; break; } @@ -2013,7 +2013,7 @@ int PC_EvaluateTokens(source_t *source, token_t *tokens, signed long int *intval v1->floatvalue /= v2->floatvalue; break; case P_MOD: if (!v2->intvalue) { - SourceError(source, "divide by zero in #if/#elif\n"); + SourceError(source, "divide by zero in #if/#elif"); error = 1; break; } @@ -2750,7 +2750,7 @@ int PC_ReadToken(source_t *source, token_t *token) token->string[strlen(token->string)-1] = '\0'; if (strlen(token->string) + strlen(newtoken.string+1) + 1 >= MAX_TOKEN) { - SourceError(source, "string longer than MAX_TOKEN %d\n", MAX_TOKEN); + SourceError(source, "string longer than MAX_TOKEN %d", MAX_TOKEN); return qfalse; } strcat(token->string, newtoken.string+1); diff --git a/code/botlib/l_script.c b/code/botlib/l_script.c index 09b110f1..cc74404a 100644 --- a/code/botlib/l_script.c +++ b/code/botlib/l_script.c @@ -1158,7 +1158,7 @@ float ReadSignedFloat(script_t *script) { if(!PS_ExpectAnyToken(script, &token)) { - ScriptError(script, "Missing float value\n"); + ScriptError(script, "Missing float value"); return 0; } @@ -1167,7 +1167,7 @@ float ReadSignedFloat(script_t *script) if (token.type != TT_NUMBER) { - ScriptError(script, "expected float value, found %s\n", token.string); + ScriptError(script, "expected float value, found %s", token.string); return 0; } @@ -1189,7 +1189,7 @@ signed long int ReadSignedInt(script_t *script) { if(!PS_ExpectAnyToken(script, &token)) { - ScriptError(script, "Missing integer value\n"); + ScriptError(script, "Missing integer value"); return 0; } @@ -1198,7 +1198,7 @@ signed long int ReadSignedInt(script_t *script) if (token.type != TT_NUMBER || token.subtype == TT_FLOAT) { - ScriptError(script, "expected integer value, found %s\n", token.string); + ScriptError(script, "expected integer value, found %s", token.string); return 0; } diff --git a/code/tools/asm/q3asm.c b/code/tools/asm/q3asm.c index 36e23018..331ba098 100644 --- a/code/tools/asm/q3asm.c +++ b/code/tools/asm/q3asm.c @@ -1622,7 +1622,7 @@ Motivation: not wanting to scrollback for pages to find asm error. } // In some case it Segfault without this check if ( numAsmFiles == 0 ) { - Error( "No file to assemble\n" ); + Error( "No file to assemble" ); } InitTables(); diff --git a/code/ui/ui_shared.c b/code/ui/ui_shared.c index 887a9872..2ae36a31 100644 --- a/code/ui/ui_shared.c +++ b/code/ui/ui_shared.c @@ -345,7 +345,7 @@ qboolean PC_Float_Parse(int handle, float *f) { negative = qtrue; } if (token.type != TT_NUMBER) { - PC_SourceError(handle, "expected float but found %s\n", token.string); + PC_SourceError(handle, "expected float but found %s", token.string); return qfalse; } if (negative) @@ -425,7 +425,7 @@ qboolean PC_Int_Parse(int handle, int *i) { negative = qtrue; } if (token.type != TT_NUMBER) { - PC_SourceError(handle, "expected integer but found %s\n", token.string); + PC_SourceError(handle, "expected integer but found %s", token.string); return qfalse; } *i = token.intvalue; @@ -4911,7 +4911,7 @@ qboolean ItemParse_cvarStrList( itemDef_t *item, int handle ) { pass = 0; while ( 1 ) { if (!trap_PC_ReadToken(handle, &token)) { - PC_SourceError(handle, "end of file inside menu item\n"); + PC_SourceError(handle, "end of file inside menu item"); return qfalse; } @@ -4958,7 +4958,7 @@ qboolean ItemParse_cvarFloatList( itemDef_t *item, int handle ) { while ( 1 ) { if (!trap_PC_ReadToken(handle, &token)) { - PC_SourceError(handle, "end of file inside menu item\n"); + PC_SourceError(handle, "end of file inside menu item"); return qfalse; } @@ -5142,7 +5142,7 @@ qboolean Item_Parse(int handle, itemDef_t *item) { } while ( 1 ) { if (!trap_PC_ReadToken(handle, &token)) { - PC_SourceError(handle, "end of file inside menu item\n"); + PC_SourceError(handle, "end of file inside menu item"); return qfalse; } @@ -5552,7 +5552,7 @@ qboolean Menu_Parse(int handle, menuDef_t *menu) { memset(&token, 0, sizeof(pc_token_t)); if (!trap_PC_ReadToken(handle, &token)) { - PC_SourceError(handle, "end of file inside menu\n"); + PC_SourceError(handle, "end of file inside menu"); return qfalse; }