Convert most strcmp/stricmp to fastcmp/fasticmp

This commit is contained in:
NepDisk 2025-12-11 13:00:32 -05:00
parent 2a763d24ba
commit 6d6cb09280
48 changed files with 334 additions and 326 deletions

View file

@ -24,6 +24,8 @@
#include "lauxlib.h"
#include "../doomdef.h"
#define FREELIST_REF 0 /* free list of references */
@ -45,7 +47,7 @@ LUALIB_API int luaL_argerror (lua_State *L, int narg, const char *extramsg) {
if (!lua_getstack(L, 0, &ar)) /* no stack frame? */
return luaL_error(L, "bad argument #%d (%s)", narg, extramsg);
lua_getinfo(L, "n", &ar);
if (strcmp(ar.namewhat, "method") == 0) {
if (fastcmp(ar.namewhat, "method")) {
narg--; /* do not count `self' */
if (narg == 0) /* error is in the self argument itself? */
return luaL_error(L, "calling " LUA_QS " on bad self (%s)",
@ -102,7 +104,7 @@ LUALIB_API int luaL_checkoption (lua_State *L, int narg, const char *def,
luaL_checkstring(L, narg);
int i;
for (i=0; lst[i]; i++)
if (strcmp(lst[i], name) == 0)
if (fastcmp(lst[i], name))
return i;
return luaL_argerror(L, narg,
lua_pushfstring(L, "invalid option " LUA_QS, name));

View file

@ -200,7 +200,7 @@ static int CheckFileName(lua_State* L, const char* filename, boolean extensionch
if (extensioncheck)
{
for (i = 0; i < (sizeof(whitelist) / sizeof(const char*)); i++)
if (!stricmp(&filename[length - strlen(whitelist[i])], whitelist[i]))
if (fasticmp(&filename[length - strlen(whitelist[i])], whitelist[i]))
{
pass = true;
break;
@ -243,7 +243,7 @@ static int io_openlocal (lua_State *L) {
// Prevent access if the file is being downloaded
for (filetransfer = luafiletransfers; filetransfer; filetransfer = filetransfer->next)
if (!stricmp(filetransfer->filename, filename))
if (fasticmp(filetransfer->filename, filename))
I_Error("Access denied to %s\n"
"Files can't be opened while being downloaded\n",
filename);

View file

@ -19,6 +19,8 @@
#include "lauxlib.h"
#include "lualib.h"
#include "../doomdef.h"
static int os_clock (lua_State *L) {
lua_pushnumber(L, ((lua_Number)clock())/(lua_Number)CLOCKS_PER_SEC);
@ -82,7 +84,7 @@ static int os_date (lua_State *L) {
stm = localtime(&t);
if (stm == NULL) /* invalid date? */
lua_pushnil(L);
else if (strcmp(s, "*t") == 0) {
else if (fastcmp(s, "*t")) {
lua_createtable(L, 0, 9); /* 9 = number of fields */
setfield(L, "sec", stm->tm_sec);
setfield(L, "min", stm->tm_min);

View file

@ -524,7 +524,7 @@ void COM_AddCommand(const char *name, com_func_t func)
// fail if the command already exists
for (cmd = com_commands; cmd; cmd = cmd->next)
{
if (!stricmp(name, cmd->name)) //case insensitive now that we have lower and uppercase!
if (fasticmp(name, cmd->name)) //case insensitive now that we have lower and uppercase!
{
// don't I_Error for Lua commands
// Lua commands can replace game commands, and they have priority.
@ -557,13 +557,13 @@ int COM_AddLuaCommand(const char *name)
if (CV_StringValue(name)[0] != '\0')
return -1;
if (!stricmp(name, "respawn"))
if (fasticmp(name, "respawn"))
return -1; // fuck you.
// command already exists
for (cmd = com_commands; cmd; cmd = cmd->next)
{
if (!stricmp(name, cmd->name)) //case insensitive now that we have lower and uppercase!
if (fasticmp(name, cmd->name)) //case insensitive now that we have lower and uppercase!
{
// replace the built in command.
cmd->function = COM_Lua_f;
@ -590,7 +590,7 @@ static boolean COM_Exists(const char *com_name)
xcommand_t *cmd;
for (cmd = com_commands; cmd; cmd = cmd->next)
if (!stricmp(com_name, cmd->name))
if (fasticmp(com_name, cmd->name))
return true;
return false;
@ -668,7 +668,7 @@ static void COM_ExecuteString(char *ptext)
// check functions
for (cmd = com_commands; cmd; cmd = cmd->next)
{
if (!stricmp(com_argv[0], cmd->name)) //case insensitive now that we have lower and uppercase!
if (fasticmp(com_argv[0], cmd->name)) //case insensitive now that we have lower and uppercase!
{
cmd->function();
return;
@ -678,7 +678,7 @@ static void COM_ExecuteString(char *ptext)
// check aliases
for (a = com_alias; a; a = a->next)
{
if (!stricmp(com_argv[0], a->name))
if (fasticmp(com_argv[0], a->name))
{
if (recursion > MAX_ALIAS_RECURSION)
CONS_Alert(CONS_WARNING, M_GetText("Alias recursion cycle detected!\n"));
@ -962,7 +962,7 @@ static void COM_Help_f(void)
{
#define MINVAL 0
#define MAXVAL 1
if (!stricmp(cvar->PossibleValue[MINVAL].strvalue, "MIN"))
if (fasticmp(cvar->PossibleValue[MINVAL].strvalue, "MIN"))
{
if (floatmode)
{
@ -1003,14 +1003,14 @@ static void COM_Help_f(void)
else
CONS_Printf(" Current value: %d\n", cvar->value);
if (cvar->revert.v.string != NULL && strcmp(cvar->revert.v.string, cvar->string) != 0)
if (cvar->revert.v.string != NULL && !fastcmp(cvar->revert.v.string, cvar->string))
CONS_Printf(" Value before netgame: %s\n", cvar->revert.v.string);
}
else
{
for (cmd = com_commands; cmd; cmd = cmd->next)
{
if (strcmp(cmd->name, help))
if (!fastcmp(cmd->name, help))
continue;
CONS_Printf("\x82""Command %s:\n", cmd->name);
@ -1171,7 +1171,7 @@ static void COM_Toggle_f(void)
if (CV_CompleteValue(cvar, &str, &val))
{
if (str ? !stricmp(cvar->string, str)
if (str ? fasticmp(cvar->string, str)
: cvar->value == val)
{
CV_Set(cvar, COM_Argv(i + 1));
@ -1309,7 +1309,7 @@ static void COM_Reset_f(void)
CV_Set(cvar, cvar->defaultvalue);
// Sometimes a cvar cannot be changed, e.g. CV_NETVAR without admin privilege.
if (!stricmp(cvar->string, cvar->defaultvalue))
if (fasticmp(cvar->string, cvar->defaultvalue))
{
CONS_Printf("%s = %s\n", cvar->name, cvar->string);
}
@ -1449,7 +1449,7 @@ consvar_t *CV_FindVar(const char *name)
consvar_t *cvar;
for (cvar = consvar_vars; cvar; cvar = cvar->next)
if (!stricmp(name,cvar->name))
if (fasticmp(name,cvar->name))
return cvar;
return NULL;
@ -1664,7 +1664,7 @@ boolean CV_CompleteValue(consvar_t *var, const char **valstrp, INT32 *intval)
v = INT32_MIN; // Invalid integer trigger
}
if (var->PossibleValue[0].strvalue && !stricmp(var->PossibleValue[0].strvalue, "MIN")) // bounded cvar
if (var->PossibleValue[0].strvalue && fasticmp(var->PossibleValue[0].strvalue, "MIN")) // bounded cvar
{
#define MINVAL 0
#define MAXVAL 1
@ -1675,15 +1675,15 @@ boolean CV_CompleteValue(consvar_t *var, const char **valstrp, INT32 *intval)
// search for other
for (i = MAXVAL+1; var->PossibleValue[i].strvalue; i++)
if (v == var->PossibleValue[i].value || !stricmp(var->PossibleValue[i].strvalue, valstr))
if (v == var->PossibleValue[i].value || fasticmp(var->PossibleValue[i].strvalue, valstr))
goto found;
if ((v != INT32_MIN && v < var->PossibleValue[MINVAL].value) || !stricmp(valstr, "MIN"))
if ((v != INT32_MIN && v < var->PossibleValue[MINVAL].value) || fasticmp(valstr, "MIN"))
{
i = MINVAL;
goto found;
}
else if ((v != INT32_MIN && v > var->PossibleValue[MAXVAL].value) || !stricmp(valstr, "MAX"))
else if ((v != INT32_MIN && v > var->PossibleValue[MAXVAL].value) || fasticmp(valstr, "MAX"))
{
i = MAXVAL;
goto found;
@ -1698,7 +1698,7 @@ boolean CV_CompleteValue(consvar_t *var, const char **valstrp, INT32 *intval)
{
// check first strings
for (i = 0; var->PossibleValue[i].strvalue; i++)
if (!stricmp(var->PossibleValue[i].strvalue, valstr))
if (fasticmp(var->PossibleValue[i].strvalue, valstr))
goto found;
if (v != INT32_MIN)
{
@ -1711,9 +1711,9 @@ boolean CV_CompleteValue(consvar_t *var, const char **valstrp, INT32 *intval)
if (var->PossibleValue == CV_OnOff || var->PossibleValue == CV_YesNo)
{
overrideval = -1;
if (!stricmp(valstr, "on") || !stricmp(valstr, "yes"))
if (fasticmp(valstr, "on") || fasticmp(valstr, "yes"))
overrideval = 1;
else if (!stricmp(valstr, "off") || !stricmp(valstr, "no"))
else if (fasticmp(valstr, "off") || fasticmp(valstr, "no"))
overrideval = 0;
if (overrideval != -1)
@ -1767,11 +1767,11 @@ static void Setvalue(consvar_t *var, const char *valstr, boolean stealth)
if (numwadfiles == 0 && var->PossibleValue == Color_cons_t)
{
override = true;
if (!strcmp(valstr, "Blue"))
if (fastcmp(valstr, "Blue"))
overrideval = SKINCOLOR_BLUE;
else if (!strcmp(valstr, "Orange"))
else if (fastcmp(valstr, "Orange"))
overrideval = SKINCOLOR_ORANGE;
else if (!strcmp(valstr, "Red"))
else if (fastcmp(valstr, "Red"))
overrideval = SKINCOLOR_RED;
else
I_Error("Sorry, you need to add %s to the list of skincolors in Setvalue", valstr);
@ -2053,7 +2053,7 @@ void CV_ResetCheatNetVars(void)
// Returns true if the variable's current value is its default value
boolean CV_IsSetToDefault(consvar_t *v)
{
return (!(strcmp(v->defaultvalue, v->string)));
return (!(!fastcmp(v->defaultvalue, v->string)));
}
// If any cheats CVars are not at their default settings, return true.
@ -2065,7 +2065,7 @@ UINT8 CV_CheatsEnabled(void)
consvar_t *cvar;
for (cvar = consvar_vars; cvar; cvar = cvar->next)
if ((cvar->flags & CV_CHEAT) && strcmp(cvar->defaultvalue, cvar->string))
if ((cvar->flags & CV_CHEAT) && !fastcmp(cvar->defaultvalue, cvar->string))
return 1;
return 0;
}
@ -2086,7 +2086,7 @@ static void CV_SetCVar(consvar_t *var, const char *value, boolean stealth)
if (!var->string)
I_Error("CV_Set: %s no string set!\n", var->name);
#endif
if (!var || !var->string || !value || !stricmp(var->string, value))
if (!var || !var->string || !value || fasticmp(var->string, value))
return; // no changes
if (var->flags & CV_NETVAR)
@ -2116,7 +2116,7 @@ static void CV_SetCVar(consvar_t *var, const char *value, boolean stealth)
if (var == &cv_kartspeed && !M_SecretUnlocked(SECRET_HARDSPEED))
{
if (!stricmp(value, "Hard") || !stricmp(value, "Expert") || atoi(value) >= KARTSPEED_HARD)
if (fasticmp(value, "Hard") || fasticmp(value, "Expert") || atoi(value) >= KARTSPEED_HARD)
{
CONS_Printf(M_GetText("You haven't unlocked this yet!\n"));
return;
@ -2126,7 +2126,7 @@ static void CV_SetCVar(consvar_t *var, const char *value, boolean stealth)
if (var == &cv_forceskin)
{
INT32 skin = R_SkinAvailable(value);
if ((stricmp(value, "None")) && ((skin == -1) || !R_SkinUsable(-1, skin)))
if ((!fasticmp(value, "None")) && ((skin == -1) || !R_SkinUsable(-1, skin)))
{
CONS_Printf("Please provide a valid skin name (\"None\" disables).\n");
return;
@ -2273,7 +2273,7 @@ void CV_AddValue(consvar_t *var, INT32 increment)
{
#define MINVAL 0
#define MAXVAL 1
if (var->PossibleValue[MINVAL].strvalue && !strcmp(var->PossibleValue[MINVAL].strvalue, "MIN"))
if (var->PossibleValue[MINVAL].strvalue && fastcmp(var->PossibleValue[MINVAL].strvalue, "MIN"))
{
#ifdef PARANOIA
if (!var->PossibleValue[MAXVAL].strvalue)
@ -2499,11 +2499,11 @@ void CV_SaveVariables(FILE *f)
if (
cvar->PossibleValue != NULL &&
cvar->PossibleValue[0].strvalue &&
stricmp(cvar->PossibleValue[0].strvalue, "MIN") == 0
fasticmp(cvar->PossibleValue[0].strvalue, "MIN")
){ // bounded cvar
int which = stricmp(string, "MAX") == 0;
int which = fasticmp(string, "MAX");
if (which || stricmp(string, "MIN") == 0)
if (which || fasticmp(string, "MIN"))
{
INT32 value = cvar->PossibleValue[which].value;

View file

@ -1030,7 +1030,7 @@ boolean CON_Responder(event_t *ev)
Lock_state();
// Only add command to history if it differs from previous one
if (strcmp(input.buffer, inputlines[(inputline-1) & 31]))
if (!fastcmp(input.buffer, inputlines[(inputline-1) & 31]))
{
inputline = (inputline+1) & 31;
M_TextInputInit(&input, inputlines[inputline], CON_MAXPROMPTCHARS);

View file

@ -1527,7 +1527,7 @@ static void SL_InsertServer(serverinfo_pak* info, SINT8 node)
if (info->subversion != SUBVERSION)
return; // Close, but no cigar.
if (strcmp(info->application, SRB2APPLICATION))
if (!fastcmp(info->application, SRB2APPLICATION))
return;/* that's a different mod */
i = serverlistcount++;
@ -1555,7 +1555,7 @@ void CL_QueryServerList (msg_server_t *server_list)
// thwart nefarious servers who lie to the MS.
/* lol bruh, that version COMES from the servers */
//if (strcmp(version, server_list[i].version) == 0)
//if (fastcmp(version, server_list[i].version))
{
INT32 node = I_NetMakeNodewPort(server_list[i].ip, server_list[i].port);
if (node == -1)
@ -2594,7 +2594,7 @@ static void Command_connect(void)
connectedtodedicated = false;
/*
if (!stricmp(COM_Argv(1), "self"))
if (fasticmp(COM_Argv(1), "self"))
{
servernode = 0;
server = true;
@ -2605,7 +2605,7 @@ static void Command_connect(void)
*/
{
// used in menu to connect to a server in the list
if (netgame && !stricmp(COM_Argv(1), "node"))
if (netgame && fasticmp(COM_Argv(1), "node"))
{
servernode = (SINT8)atoi(COM_Argv(2));
}
@ -2624,7 +2624,7 @@ static void Command_connect(void)
netgame = true;
multiplayer = true;
if (!stricmp(COM_Argv(1), "any"))
if (fasticmp(COM_Argv(1), "any"))
servernode = BROADCASTADDR;
else if (I_NetMakeNodewPort)
{
@ -2850,7 +2850,7 @@ SINT8 nametonum(const char *name)
{
INT32 playernum, i;
if (!strcmp(name, "0"))
if (fastcmp(name, "0"))
return 0;
playernum = (SINT8)atoi(name);
@ -2867,7 +2867,7 @@ SINT8 nametonum(const char *name)
}
for (i = 0; i < MAXPLAYERS; i++)
if (playeringame[i] && !stricmp(player_names[i], name))
if (playeringame[i] && fasticmp(player_names[i], name))
return (SINT8)i;
CONS_Printf(M_GetText("There is no player named \"%s\"\n"), name);

View file

@ -1343,7 +1343,7 @@ static void IdentifyVersion(void)
}
#if (1) // reduce the amount of findfile by only using full cwd in this func
if (strcmp(tempsrb2path, srb2waddir))
if (!fastcmp(tempsrb2path, srb2waddir))
#endif
{
strlcpy(srb2path, srb2waddir, sizeof (srb2path));
@ -1406,7 +1406,7 @@ D_ConvertVersionNumbers (void)
const char *D_GetFancyBranchName(void)
{
if (!strcmp(compbranch, ""))
if (fastcmp(compbranch, ""))
{
// \x8b = aqua highlight
return "\x8b" "detached HEAD" "\x80";

View file

@ -944,7 +944,7 @@ void Command_Drop(void)
return;
}
if (!(stricmp(COM_Argv(1), "reset") && stricmp(COM_Argv(1), "cancel") && stricmp(COM_Argv(1), "stop")))
if (!(!fasticmp(COM_Argv(1), "reset") && !fasticmp(COM_Argv(1), "cancel") && !fasticmp(COM_Argv(1), "stop")))
{
memset(packetdropquantity, 0, sizeof(packetdropquantity));
return;
@ -964,13 +964,13 @@ void Command_Drop(void)
packetname = COM_Argv(1);
if (!(stricmp(packetname, "all") && stricmp(packetname, "any")))
if (!(!fasticmp(packetname, "all") && !fasticmp(packetname, "any")))
for (i = 0; i < NUMPACKETTYPE; i++)
packetdropquantity[i] = packetquantity;
else
{
for (i = 0; i < NUMPACKETTYPE; i++)
if (!stricmp(packetname, packettypename[i]))
if (fasticmp(packetname, packettypename[i]))
{
packetdropquantity[i] = packetquantity;
return;

View file

@ -1834,12 +1834,12 @@ static void SendNameAndColor(UINT8 n)
voice = &skins[player->skin].voices[0];
}
if (!strcmp(cv_playername[n].string, player_names[playernum])
if (fastcmp(cv_playername[n].string, player_names[playernum])
&& cv_playercolor[n].value == player->skincolor
&& !strcmp(cv_skin[n].string, skins[player->skin].name)
&& fastcmp(cv_skin[n].string, skins[player->skin].name)
&& cv_follower[n].value == player->followerskin
&& cv_followercolor[n].value == player->followercolor
&& !stricmp(cv_voice[n].string, voice->name))
&& fasticmp(cv_voice[n].string, voice->name))
return;
player->availabilities = R_GetSkinAvailabilities();
@ -2992,8 +2992,8 @@ static void Command_Playdemo_f(void)
CONS_Printf(M_GetText("Playing back demo '%s'.\n"), name);
demo.loadfiles = strcmp(COM_Argv(2), "-addfiles") == 0;
demo.ignorefiles = strcmp(COM_Argv(2), "-force") == 0;
demo.loadfiles = fastcmp(COM_Argv(2), "-addfiles");
demo.ignorefiles = fastcmp(COM_Argv(2), "-force");
// Internal if no extension, external if one exists
// If external, convert the file name to a path in SRB2's home directory
@ -5191,7 +5191,7 @@ static void Command_Addfile(void)
for (ii = 0; ii < numfilesadded; ii++)
{
// If this is one of them, don't try to add it.
if (!strcmp(fn, addedfiles[ii]))
if (fastcmp(fn, addedfiles[ii]))
{
fileadded = true;
break;
@ -5459,7 +5459,7 @@ static void Command_ListDoomednums_f(void)
if (argc > 1)
{
nodoubles = (strcmp(COM_Argv(1), "-nodoubles") == 0);
nodoubles = (fastcmp(COM_Argv(1), "-nodoubles"));
if (nodoubles)
{
argc--;
@ -5854,7 +5854,7 @@ void D_GameTypeChanged(INT32 lastgametype)
static void Gravity_OnChange(void)
{
if (!M_SecretUnlocked(SECRET_PANDORA) && !netgame && !cht_debug
&& strcmp(cv_gravity.string, cv_gravity.defaultvalue))
&& !fastcmp(cv_gravity.string, cv_gravity.defaultvalue))
{
CONS_Printf(M_GetText("You haven't earned this yet.\n"));
CV_StealthSet(&cv_gravity, cv_gravity.defaultvalue);
@ -6703,7 +6703,7 @@ static void Command_Cheats_f(void)
for (cvar = consvar_vars; cvar; cvar = cvar->next)
{
if ((cvar->flags & CV_CHEAT) && strcmp(cvar->defaultvalue, cvar->string))
if ((cvar->flags & CV_CHEAT) && !fastcmp(cvar->defaultvalue, cvar->string))
{
CONS_Printf("%s: Default Value: %s Current Value:%s\n", cvar->name, cvar->defaultvalue, cvar->string);
}
@ -7048,9 +7048,9 @@ static void Follower_OnChange(void)
strcpy(str, cv_follower[0].string);
strcpy(cpy, cv_follower[0].string);
strlwr(str);
if (stricmp(cpy,"0") !=0 && !atoi(cpy)) // yep, that's a string alright...
if (!fasticmp(cpy,"0") && !atoi(cpy)) // yep, that's a string alright...
{
if (stricmp(cpy, "None") == 0)
if (fasticmp(cpy, "None"))
{
CV_StealthSet(&cv_follower[0], "-1");
@ -7101,9 +7101,9 @@ static void Follower2_OnChange(void)
strcpy(str, cv_follower[1].string);
strcpy(cpy, cv_follower[1].string);
strlwr(str);
if (stricmp(cpy,"0") !=0 && !atoi(cpy)) // yep, that's a string alright...
if (!fasticmp(cpy,"0") && !atoi(cpy)) // yep, that's a string alright...
{
if (stricmp(cpy, "None") == 0)
if (fasticmp(cpy, "None"))
{
CV_StealthSet(&cv_follower[1], "-1");
@ -7151,9 +7151,9 @@ static void Follower3_OnChange(void)
strcpy(str, cv_follower[2].string);
strcpy(cpy, cv_follower[2].string);
strlwr(str);
if (stricmp(cpy,"0") !=0 && !atoi(cpy)) // yep, that's a string alright...
if (!fasticmp(cpy,"0") && !atoi(cpy)) // yep, that's a string alright...
{
if (stricmp(cpy, "None") == 0)
if (fasticmp(cpy, "None"))
{
CV_StealthSet(&cv_follower[2], "-1");
@ -7201,9 +7201,9 @@ static void Follower4_OnChange(void)
strcpy(str, cv_follower[3].string);
strcpy(cpy, cv_follower[3].string);
strlwr(str);
if (stricmp(cpy,"0") !=0 && !atoi(cpy)) // yep, that's a string alright...
if (!fasticmp(cpy,"0") && !atoi(cpy)) // yep, that's a string alright...
{
if (stricmp(cpy, "None") == 0)
if (fasticmp(cpy, "None"))
{
CV_StealthSet(&cv_follower[3], "-1");
@ -7412,7 +7412,7 @@ static void Command_ListVoices(void)
{
if (sscanf(COM_Argv(1), " %d", &pid) == 0)
{
if (!stricmp(COM_Argv(1), "--help"))
if (fasticmp(COM_Argv(1), "--help"))
{
// Anyone who names their skin "--help" can suck it.
CONS_Printf(

View file

@ -332,7 +332,7 @@ boolean CL_CheckDownloadable(void)
static boolean CL_CanResumeDownload(fileneeded_t *file)
{
return pauseddownload
&& !strcmp(pauseddownload->filename, file->filename) // Same name
&& fastcmp(pauseddownload->filename, file->filename) // Same name
&& pauseddownload->hash == file->hash // Same checksum
&& pauseddownload->fragmentsize == file->fragmentsize; // Same fragment size
}
@ -622,7 +622,7 @@ INT32 CL_CheckFiles(void)
for (; wadfiles[j]; j++)
{
nameonly(strcpy(wadfilename, wadfiles[j]->filename));
if (!stricmp(wadfilename, fileneeded[i].filename) &&
if (fasticmp(wadfilename, fileneeded[i].filename) &&
wadfiles[j]->hash == fileneeded[i].hash)
{
CONS_Debug(DBG_NETPLAY, "already loaded\n");
@ -939,7 +939,7 @@ static boolean AddFileToSendQueue(INT32 node, const char *filename, UINT8 fileid
{
strlcpy(wadfilename, wadfiles[i]->filename, MAX_WADPATH);
nameonly(wadfilename);
if (!stricmp(wadfilename, p->id.filename))
if (fasticmp(wadfilename, p->id.filename))
{
// Copy file name with full path
strlcpy(p->id.filename, wadfiles[i]->filename, MAX_WADPATH);
@ -1450,18 +1450,18 @@ void PT_FileFragment(SINT8 node, INT32 netconsole)
filename = va("%s", file->filename);
nameonly(filename);
if (!strcmp(filename, SRB2NAME)
|| !strcmp(filename, GRAPHICSNAME)
|| !strcmp(filename, TEXTURESNAME)
|| !strcmp(filename, CHARSNAME)
|| !strcmp(filename, MAPSNAME)
|| !strcmp(filename, MAINNAME)
|| !strcmp(filename, MAPPATCHNAME)
|| !strcmp(filename, BONUSCHARSNAME)
|| !strcmp(filename, PATCHNAME)
|| !strcmp(filename, SOUNDSNAME)
|| !strcmp(filename, MUSICNAME)
|| !strcmp(filename, BLANMUSICNAME)
if (fastcmp(filename, SRB2NAME)
|| fastcmp(filename, GRAPHICSNAME)
|| fastcmp(filename, TEXTURESNAME)
|| fastcmp(filename, CHARSNAME)
|| fastcmp(filename, MAPSNAME)
|| fastcmp(filename, MAINNAME)
|| fastcmp(filename, MAPPATCHNAME)
|| fastcmp(filename, BONUSCHARSNAME)
|| fastcmp(filename, PATCHNAME)
|| fastcmp(filename, SOUNDSNAME)
|| fastcmp(filename, MUSICNAME)
|| fastcmp(filename, BLANMUSICNAME)
)
{
I_Error("Tried to download base-game file: \"%s\"", filename);
@ -1798,7 +1798,7 @@ filestatus_t findfile(char *filename, UINT64 wantedhash, boolean completepath)
}
// first, check SRB2's "home" directory
if (strcmp(srb2home, "."))
if (!fastcmp(srb2home, "."))
{
homecheck = filesearch(filename, srb2home, wantedhash, completepath, 10);
@ -1809,7 +1809,7 @@ filestatus_t findfile(char *filename, UINT64 wantedhash, boolean completepath)
// if not found at all, just move on without doing anything
}
if (strcmp(srb2home, "."))
if (!fastcmp(srb2home, "."))
{
// next, check SRB2's "path" directory
homecheck = filesearch(filename, srb2path, wantedhash, completepath, 10);
@ -2069,7 +2069,7 @@ CURLGetLogin (const char *url, HTTP_login ***return_prev_next)
( login = (*prev_next));
prev_next = &login->next
){
if (strcmp(login->url, url) == 0)
if (fastcmp(login->url, url))
{
if (return_prev_next)
(*return_prev_next) = prev_next;

View file

@ -413,7 +413,7 @@ void readskincolor(MYFILE *f, INT32 num, boolean mainfile)
deh_strlcpy(truncword, word2, namesize, va("Skincolor %d: name", num)); // truncate here to check for dupes
dupecheck = R_GetColorByName(truncword);
if (truncword[0] != '\0' && (!stricmp(truncword, skincolors[SKINCOLOR_NONE].name) || (dupecheck && dupecheck != num)))
if (truncword[0] != '\0' && (fasticmp(truncword, skincolors[SKINCOLOR_NONE].name) || (dupecheck && dupecheck != num)))
{
size_t lastchar = strlen(truncword);
char oldword[lastchar+1];

View file

@ -280,7 +280,7 @@ static void DRPC_HandleJoinRequest(const DiscordUser *requestUser)
while (append != NULL)
{
// CHECK FOR DUPES!! Ignore any that already exist from the same user.
if (!strcmp(newRequest->userID, append->userID))
if (fastcmp(newRequest->userID, append->userID))
{
Discord_Respond(newRequest->userID, DISCORD_REPLY_IGNORE);
DRPC_RemoveRequest(newRequest);
@ -445,7 +445,7 @@ static const char *DRPC_GetServerIP(void)
// If you're connected
if (I_GetNodeAddress && (address = I_GetNodeAddress(servernode)) != NULL)
{
if (strcmp(address, "self"))
if (!fastcmp(address, "self"))
{
// We're not the server, so we could successfully get the IP!
// No need to do anything else :)
@ -728,7 +728,7 @@ void DRPC_UpdatePresence(void)
// Map image
while (supportedMaps[checkMap] != NULL)
{
if (!strcmp(mapheaderinfo[gamemap-1]->lumpname, supportedMaps[checkMap]))
if (fastcmp(mapheaderinfo[gamemap-1]->lumpname, supportedMaps[checkMap]))
{
snprintf(mapimg, MAXMAPLUMPNAME+4, "map_%s", mapheaderinfo[gamemap-1]->lumpname);
strlwr(mapimg);

View file

@ -81,6 +81,8 @@
#include <sys/stat.h>
#include <ctype.h>
#include "fastcmp.h"
#ifdef _WIN32
#include <io.h>
#endif

View file

@ -318,7 +318,7 @@ void searchfilemenu(char *tempname)
{
for (i = first; i < sizedirmenu; i++)
{
if (!strcmp(dirmenu[i]+DIR_STRING, tempname))
if (fastcmp(dirmenu[i]+DIR_STRING, tempname))
{
dir_on[menudepthleft] = i;
break;
@ -365,7 +365,7 @@ void searchfilemenu(char *tempname)
{
if (filemenucmp(coredirmenu[i]+DIR_STRING, localmenusearch))
{
if (tempname && !strcmp(coredirmenu[i]+DIR_STRING, tempname))
if (tempname && fastcmp(coredirmenu[i]+DIR_STRING, tempname))
{
dir_on[menudepthleft] = sizedirmenu;
Z_Free(tempname);
@ -566,7 +566,7 @@ boolean preparefilemenu(boolean samedepth, boolean replayhut)
nameonly(filenamebuf[i]);
}
if (strcmp(dent->d_name, filenamebuf[i]))
if (!fastcmp(dent->d_name, filenamebuf[i]))
continue;
if (cv_addons_md5.value && !checkfilehash(menupath, wadfiles[i]->hash))
@ -577,11 +577,11 @@ boolean preparefilemenu(boolean samedepth, boolean replayhut)
}
else if (ext == EXT_TXT)
{
if (!strcmp(dent->d_name, "log.txt") || !strcmp(dent->d_name, "errorlog.txt"))
if (fastcmp(dent->d_name, "log.txt") || fastcmp(dent->d_name, "errorlog.txt"))
ext |= EXT_LOADED;
}
if (!strcmp(dent->d_name, configfile))
if (fastcmp(dent->d_name, configfile))
ext |= EXT_LOADED;
}

View file

@ -1264,7 +1264,7 @@ void G_ReadDemoExtraData(void)
// Skin
SetPlayerSkin(p, extra.skinname);
if (stricmp(skins[player->skin].name, extra.skinname) != 0)
if (!fasticmp(skins[player->skin].name, extra.skinname))
FindClosestSkinForStats(p, extra.kartspeed, extra.kartweight);
// Voice
@ -1294,7 +1294,7 @@ void G_ReadDemoExtraData(void)
{
// Color
for (i = 0; i < numskincolors; i++)
if (!stricmp(skincolors[i].name, extra.colorname)) // SRB2kart
if (fasticmp(skincolors[i].name, extra.colorname)) // SRB2kart
{
player->skincolor = i;
if (player->mo)
@ -1309,7 +1309,7 @@ void G_ReadDemoExtraData(void)
// Follower's color
for (i = 0; i < numskincolors +2; i++) // +2 because of Match and Opposite
if (!stricmp(Followercolor_cons_t[i].strvalue, extra.followercolor))
if (fasticmp(Followercolor_cons_t[i].strvalue, extra.followercolor))
{
player->followercolor = i;
break;
@ -3400,11 +3400,11 @@ void G_LoadDemoInfo(menudemo_t *pdemo)
{
if (header.cvars[i].name == NULL)
continue;
if (!strcmp(header.cvars[i].name, cv_kartspeed.name))
if (fastcmp(header.cvars[i].name, cv_kartspeed.name))
{
UINT8 j;
for (j = 0; kartspeed_cons_t[j].strvalue; j++)
if (!stricmp(kartspeed_cons_t[j].strvalue, header.cvars[i].value))
if (fasticmp(kartspeed_cons_t[j].strvalue, header.cvars[i].value))
pdemo->kartspeed = kartspeed_cons_t[j].value;
}
}
@ -3441,11 +3441,13 @@ void G_LoadDemoInfo(menudemo_t *pdemo)
READSTRINGL(extrainfo_p, temp, 16+1);
pdemo->standings[count].skin = UINT16_MAX;
for (i = 0; i < numskins; i++)
if (stricmp(skins[i].name, temp) == 0)
{
if (fasticmp(skins[i].name, temp))
{
pdemo->standings[count].skin = i;
break;
}
}
// Color
if (header.demoversion <= 0x000C)
@ -3457,7 +3459,7 @@ void G_LoadDemoInfo(menudemo_t *pdemo)
READSTRINGL(extrainfo_p, temp, 16+1);
pdemo->standings[count].color = SKINCOLOR_NONE;
for (i = 0; i < numskincolors; i++)
if (!stricmp(skincolors[i].name,temp)) // SRB2kart
if (fasticmp(skincolors[i].name,temp)) // SRB2kart
{
pdemo->standings[count].color = i;
break;
@ -3846,7 +3848,7 @@ void G_DoPlayDemo(char *defdemoname)
// Color
for (i = 0; i < numskincolors; i++)
if (!stricmp(skincolors[i].name, plr->color)) // SRB2kart
if (fasticmp(skincolors[i].name, plr->color)) // SRB2kart
{
player->skincolor = i;
break;
@ -3874,7 +3876,7 @@ void G_DoPlayDemo(char *defdemoname)
// Follower colour
for (i = 0; i < numskincolors +2; i++) // +2 because of Match and Opposite
if (!stricmp(Followercolor_cons_t[i].strvalue, plr->followercolor))
if (fasticmp(Followercolor_cons_t[i].strvalue, plr->followercolor))
{
player->followercolor = i;
break;
@ -3888,7 +3890,7 @@ void G_DoPlayDemo(char *defdemoname)
// Kart stats (set later)
if (stricmp(skins[player->skin].name, plr->skin) != 0)
if (!fasticmp(skins[player->skin].name, plr->skin))
FindClosestSkinForStats(p, plr->kartspeed, plr->kartweight);
// Followitem
@ -4059,7 +4061,7 @@ void G_AddGhost(char *defdemoname)
}
for (i = 0; i < numskins; i++)
if (!stricmp(skins[i].name, plr->skin))
if (fasticmp(skins[i].name, plr->skin))
{
ghskin = &skins[i];
break;
@ -4126,7 +4128,7 @@ void G_AddGhost(char *defdemoname)
// Set color
gh->mo->color = ((skin_t*)gh->mo->skin)->prefcolor;
for (i = 0; i < numskincolors; i++)
if (!stricmp(skincolors[i].name, plr->color))
if (fasticmp(skincolors[i].name, plr->color))
{
gh->mo->color = (UINT16)i;
break;

View file

@ -488,7 +488,7 @@ INT32 player_name_changes[MAXPLAYERS];
static recordpreset_t *G_GetRecordPreset(const char *name)
{
for (recordpresetnum_e i = 0; i < numrecordpresets; i++)
if (!strcmp(recordpresets[i]->name, name))
if (fastcmp(recordpresets[i]->name, name))
return recordpresets[i];
return NULL;
}
@ -560,9 +560,9 @@ const char *G_CheckPresetCvars(strbuf_t *pv)
const char *value = s;
s += strlen(s)+1;
if (!strcmp(name, cvar->name))
if (fastcmp(name, cvar->name))
{
if (!strcmp(value, cvar->string))
if (fastcmp(value, cvar->string))
goto next;
else
return cvar->name;
@ -570,7 +570,7 @@ const char *G_CheckPresetCvars(strbuf_t *pv)
}
// otherwise, the cvar must be set to its default value
if (strcmp(cvar->string, cvar->defaultvalue))
if (!fastcmp(cvar->string, cvar->defaultvalue))
return cvar->name;
next:;
}
@ -596,7 +596,7 @@ void G_SetPresetCvars(strbuf_t *pv)
maprecord_t *G_GetMapRecord(const char *mapname)
{
for (size_t i = 0; i < nummaprecords; i++)
if (!strcmp(maprecords[i]->name, mapname))
if (fastcmp(maprecords[i]->name, mapname))
return maprecords[i];
return NULL;
}
@ -617,7 +617,7 @@ maprecord_t *G_AllocateMapRecord(const char *mapname)
maprecordpreset_t *G_GetMapRecordPreset(maprecord_t *record, const char *presetname)
{
for (UINT16 k = 0; k < record->numpresets; k++)
if (!strcmp(record->presets[k].prename, presetname))
if (fastcmp(record->presets[k].prename, presetname))
return &record->presets[k];
return NULL;
}
@ -762,7 +762,7 @@ tic_t G_GetBestTime(INT16 map)
for (UINT16 k = 0; k < record->numpresets; k++)
{
if (strcmp(record->presets[k].prename, "kart"))
if (!fastcmp(record->presets[k].prename, "kart"))
continue; // doesn't count
if (record->presets[k].besttime < besttime)
besttime = record->presets[k].besttime;
@ -778,7 +778,7 @@ boolean G_CompareRecordPresetVersions(strbuf_t *pre1, strbuf_t *pre2)
boolean G_EmblemsEnabled(void)
{
return !demo.playback && !strcmp(currentrecordpreset, "kart");
return !demo.playback && fastcmp(currentrecordpreset, "kart");
}
char *G_GetRecordReplayFolder(boolean home, boolean breaker)
@ -3877,7 +3877,7 @@ INT32 G_GetGametypeByName(const char *gametypestr)
INT32 i;
for (i = 0; i < gametypecount; i++)
if (!stricmp(gametypestr, Gametype_Names[i]))
if (fasticmp(gametypestr, Gametype_Names[i]))
return i;
return -1; // unknown gametype
@ -4966,7 +4966,7 @@ static void DataCorrupt(UINT8 *corrupted)
if (*corrupted)
{
const char *gdfolder = "the SRB2Kart folder";
if (strcmp(srb2home,"."))
if (!fastcmp(srb2home,"."))
gdfolder = srb2home;
I_Error(*corrupted == 1
@ -5328,7 +5328,7 @@ void G_SaveGameData(void)
maprecordpreset_t *preset = &record->presets[j];
for (k = 0; k < knownprecount; k++)
if (!strcmp(knownpre[k], preset->prename))
if (fastcmp(knownpre[k], preset->prename))
break;
if (k == knownprecount)
{
@ -5386,7 +5386,7 @@ void G_LoadGame(UINT32 slot, INT16 mapoverride)
memset(vcheck, 0, sizeof (vcheck));
sprintf(vcheck, (marathonmode ? "back-up %d" : "version %d"), VERSION);
if (strcmp((const char *)save.p, (const char *)vcheck))
if (!fastcmp((const char *)save.p, (const char *)vcheck))
{
#ifdef SAVEGAME_OTHERVERSIONS
M_StartMessage(M_GetText("Save game from different version.\nYou can load this savegame, but\nsaving afterwards will be disabled.\n\nDo you want to continue anyway?\n\n(Press 'Y' to confirm)\n"),
@ -5536,7 +5536,7 @@ void G_SaveGameOver(UINT32 slot, boolean modifylives)
// Version check
memset(vcheck, 0, sizeof (vcheck));
sprintf(vcheck, (marathonmode ? "back-up %d" : "version %d"), VERSION);
if (strcmp((const char *)save.p, (const char *)vcheck)) BADSAVE
if (!fastcmp((const char *)save.p, (const char *)vcheck)) BADSAVE
save.p += VERSIONSIZE;
// P_UnArchiveMisc()
@ -5545,7 +5545,7 @@ void G_SaveGameOver(UINT32 slot, boolean modifylives)
(void)READUINT16(save.p); // emeralds
CHECKPOS
READSTRINGN(save.p, temp, sizeof(temp)); // mod it belongs to
if (strcmp(temp, timeattackfolder)) BADSAVE
if (!fastcmp(temp, timeattackfolder)) BADSAVE
// P_UnArchivePlayer()
CHECKPOS
@ -5771,7 +5771,7 @@ char *G_BuildMapTitle(INT32 mapnum)
if (!mapnum || mapnum > nummapheaders || !mapheaderinfo[mapnum-1])
I_Error("G_BuildMapTitle: Internal map ID %d not found (nummapheaders = %d)", mapnum-1, nummapheaders);
if (strcmp(mapheaderinfo[mapnum-1]->lvlttl, ""))
if (!fastcmp(mapheaderinfo[mapnum-1]->lvlttl, ""))
{
size_t len = 1;
const char *zonetext = NULL;

View file

@ -913,7 +913,7 @@ INT32 G_KeyStringtoNum(const char *keystr)
}
for (j = 0; j < NUMKEYNAMES; j++)
if (!stricmp(keynames[j].name, keystr))
if (fasticmp(keynames[j].name, keystr))
return keynames[j].keynum;
return 0;
@ -1056,7 +1056,7 @@ static void setcontrol(UINT8 player)
namectrl = COM_Argv(1);
for (numctrl = 0;
numctrl < num_gamecontrols && gamecontrolname[numctrl] && stricmp(namectrl, gamecontrolname[numctrl]);
numctrl < num_gamecontrols && gamecontrolname[numctrl] && !fasticmp(namectrl, gamecontrolname[numctrl]);
numctrl++)
{ ; }

View file

@ -583,7 +583,7 @@ loadmodelfile:
{
for (i = 0; i < NUMSPRITES; i++)
{
if (stricmp(name, sprnames[i]) == 0)
if (fasticmp(name, sprnames[i]))
{
md2_models[i].scale = scale;
md2_models[i].offset = offset;
@ -598,7 +598,7 @@ addskinmodel:
// add player model
for (s = 0; s < MAXSKINS; s++)
{
if (stricmp(skinname, skins[s].name) == 0)
if (fasticmp(skinname, skins[s].name))
{
boolean iscompatskin = wadfiles[skins[s].wadnum]->compatmode;
md2_playermodels[s].skin = s;
@ -672,7 +672,7 @@ void HWR_AddPlayerModel(int skin) // For skins that were added after startup
if (!strnicmp(name, PLAYERMODELPREFIX, prefixlen) && (len > prefixlen))
skinname += prefixlen;
if (stricmp(skinname, skins[skin].name) == 0)
if (fasticmp(skinname, skins[skin].name))
{
boolean iscompatskin = wadfiles[skins[skin].wadnum]->compatmode;
md2_playermodels[skin].skin = skin;
@ -734,7 +734,7 @@ void HWR_AddSpriteModel(size_t spritenum) // For sprites that were added after s
if (!strnicmp(name, PLAYERMODELPREFIX, strlen(PLAYERMODELPREFIX)))
continue; // that's not a sprite...
if (stricmp(name, sprnames[spritenum]) == 0)
if (fasticmp(name, sprnames[spritenum]))
{
md2_models[spritenum].scale = scale;
md2_models[spritenum].offset = offset;

View file

@ -131,7 +131,7 @@ tag_t *GetTagByName(model_t *model, char *name, int frame)
int i;
for (i = 0; i < model->numTags; i++)
{
if (!stricmp(iterator[i].name, name))
if (fasticmp(iterator[i].name, name))
return &iterator[i];
}
}
@ -168,22 +168,22 @@ model_t *LoadModel(const char *filename, int ztag, modeltype_t modeltype)
return NULL;
}
if (!strcmp(extension, ".md3"))
if (fastcmp(extension, ".md3"))
{
if (!(model = MD3_LoadModel(filename, ztag, false)))
return NULL;
}
else if (!strcmp(extension, ".md3s")) // MD3 that will be converted in memory to use full floats
else if (fastcmp(extension, ".md3s")) // MD3 that will be converted in memory to use full floats
{
if (!(model = MD3_LoadModel(filename, ztag, true)))
return NULL;
}
else if (!strcmp(extension, ".md2"))
else if (fastcmp(extension, ".md2"))
{
if (!(model = MD2_LoadModel(filename, ztag, false)))
return NULL;
}
else if (!strcmp(extension, ".md2s"))
else if (fastcmp(extension, ".md2s"))
{
if (!(model = MD2_LoadModel(filename, ztag, true)))
return NULL;

View file

@ -490,7 +490,7 @@ void HWR_LoadCustomShadersFromFile(UINT16 wadnum, boolean PK3)
goto skip_field;
}
if (!stricmp(stoken, "GLSL"))
if (fasticmp(stoken, "GLSL"))
{
value = strtok(NULL, "\r\n ");
if (!value)
@ -500,9 +500,9 @@ void HWR_LoadCustomShadersFromFile(UINT16 wadnum, boolean PK3)
goto skip_lump;
}
if (!stricmp(value, "VERTEX"))
if (fasticmp(value, "VERTEX"))
shadertype = 1;
else if (!stricmp(value, "FRAGMENT"))
else if (fasticmp(value, "FRAGMENT"))
shadertype = 2;
skip_lump:
@ -528,7 +528,7 @@ skip_lump:
for (i = 0; shaderxlat[i].type; i++)
{
if (!stricmp(shaderxlat[i].type, stoken))
if (fasticmp(shaderxlat[i].type, stoken))
{
size_t shader_string_length;
char *shader_source;

View file

@ -316,7 +316,7 @@ EXPORT INT32 HWRAPI( Startup ) (I_Error_t FatalErrorFunction, snddev_t *snd_dev)
const ALCubyte *ALCdriver = alcGetString(NULL,ALC_DEFAULT_DEVICE_SPECIFIER);
const ALCubyte *DSdriver = "DirectSound";
if (!strcmp((const ALCbyte *)ALCdriver,"DirectSound3D")) //Alam: OpenAL's DS3D is buggy
if (fastcmp((const ALCbyte *)ALCdriver,"DirectSound3D")) //Alam: OpenAL's DS3D is buggy
ALCDevice = alcOpenDevice(DSdriver); //Open DirectSound
else //Alam: The OpenAl device
ALCDevice = alcOpenDevice(ALCdriver); //Open Default

View file

@ -49,7 +49,7 @@ static int inet_aton(const char *cp, struct in_addr *addr)
{
return(0);
}
if (strcmp(cp, "255.255.255.225") == 0)
if (fastcmp(cp, "255.255.255.225"))
{
addr->s_addr = htonl(INADDR_BROADCAST);
return 0;

View file

@ -106,7 +106,7 @@ static boolean K_BRIGHTLumpParser(char *data, size_t size)
{
boolean valid = true;
if (stricmp(tkn, "texture") == 0)
if (fasticmp(tkn, "texture"))
{
Z_Free(tkn);
tkn = M_GetToken(NULL);

View file

@ -30,7 +30,7 @@ INT32 K_FollowerAvailable(const char *name)
for (i = 0; i < numfollowers; i++)
{
if (stricmp(followers[i].skinname, name) == 0)
if (fasticmp(followers[i].skinname, name))
return i;
}
@ -47,7 +47,7 @@ boolean K_SetFollowerByName(INT32 playernum, const char *skinname)
INT32 i;
player_t *player = &players[playernum];
if (stricmp("None", skinname) == 0)
if (fasticmp("None", skinname))
{
K_SetFollowerByNum(playernum, -1); // reminder that -1 is nothing
return true;
@ -56,7 +56,7 @@ boolean K_SetFollowerByName(INT32 playernum, const char *skinname)
for (i = 0; i < numfollowers; i++)
{
// search in the skin list
if (stricmp(followers[i].skinname, skinname) == 0)
if (fasticmp(followers[i].skinname, skinname))
{
K_SetFollowerByNum(playernum, i);
return true;

View file

@ -136,7 +136,7 @@ kartresult_t *K_GetKartResultAlt(const char *name, boolean alternate)
{
for (UINT8 i = 0; i < numkartresults; i++)
{
if (!stricmp(name, kartresults[i].cvar->name) && kartresults[i].isalt == alternate)
if (fasticmp(name, kartresults[i].cvar->name) && kartresults[i].isalt == alternate)
return &kartresults[i];
}
@ -2561,4 +2561,4 @@ void K_DoEggMineStrip(mobj_t *tmo, mobj_t *inflictor, mobj_t *source)
K_SetPlayerItemCooldown(tmo->player, TICRATE, false);
}
}
}
}

View file

@ -1332,11 +1332,11 @@ void K_UpdateTerrainOverlay(mobj_t *mo)
--------------------------------------------------*/
static void K_FlagBoolean(UINT32 *inputFlags, UINT32 newFlag, char *val)
{
if (stricmp(val, "true") == 0)
if (fasticmp(val, "true"))
{
*inputFlags |= newFlag;
}
else if (stricmp(val, "false") == 0)
else if (fasticmp(val, "false"))
{
*inputFlags &= ~newFlag;
}
@ -1404,39 +1404,39 @@ static void K_ParseSplashParameter(size_t i, char *param, char *val)
{
t_splash_t *splash = &splashDefs[i];
if (stricmp(param, "mobjType") == 0)
if (fasticmp(param, "mobjType"))
{
splash->mobjType = get_number(val);
}
else if (stricmp(param, "sfx") == 0)
else if (fasticmp(param, "sfx"))
{
splash->sfx = get_number(val);
}
else if (stricmp(param, "scale") == 0)
else if (fasticmp(param, "scale"))
{
splash->scale = FLOAT_TO_FIXED(atof(val));
}
else if (stricmp(param, "color") == 0)
else if (fasticmp(param, "color"))
{
splash->color = get_number(val);
}
else if (stricmp(param, "pushH") == 0)
else if (fasticmp(param, "pushH"))
{
splash->pushH = FLOAT_TO_FIXED(atof(val));
}
else if (stricmp(param, "pushV") == 0)
else if (fasticmp(param, "pushV"))
{
splash->pushV = FLOAT_TO_FIXED(atof(val));
}
else if (stricmp(param, "spread") == 0)
else if (fasticmp(param, "spread"))
{
splash->spread = FLOAT_TO_FIXED(atof(val));
}
else if (stricmp(param, "cone") == 0)
else if (fasticmp(param, "cone"))
{
splash->cone = FloatToAngle(atof(val));
}
else if (stricmp(param, "numParticles") == 0)
else if (fasticmp(param, "numParticles"))
{
splash->numParticles = (UINT8)atoi(val);
}
@ -1506,47 +1506,47 @@ static void K_ParseFootstepParameter(size_t i, char *param, char *val)
{
t_footstep_t *footstep = &footstepDefs[i];
if (stricmp(param, "mobjType") == 0)
if (fasticmp(param, "mobjType"))
{
footstep->mobjType = get_number(val);
}
else if (stricmp(param, "sfx") == 0)
else if (fasticmp(param, "sfx"))
{
footstep->sfx = get_number(val);
}
else if (stricmp(param, "scale") == 0)
else if (fasticmp(param, "scale"))
{
footstep->scale = FLOAT_TO_FIXED(atof(val));
}
else if (stricmp(param, "color") == 0)
else if (fasticmp(param, "color"))
{
footstep->color = get_number(val);
}
else if (stricmp(param, "pushH") == 0)
else if (fasticmp(param, "pushH"))
{
footstep->pushH = FLOAT_TO_FIXED(atof(val));
}
else if (stricmp(param, "pushV") == 0)
else if (fasticmp(param, "pushV"))
{
footstep->pushV = FLOAT_TO_FIXED(atof(val));
}
else if (stricmp(param, "spread") == 0)
else if (fasticmp(param, "spread"))
{
footstep->spread = FLOAT_TO_FIXED(atof(val));
}
else if (stricmp(param, "cone") == 0)
else if (fasticmp(param, "cone"))
{
footstep->cone = FloatToAngle(atof(val));
}
else if (stricmp(param, "sfxFreq") == 0)
else if (fasticmp(param, "sfxFreq"))
{
footstep->sfxFreq = (tic_t)atoi(val);
}
else if (stricmp(param, "frequency") == 0)
else if (fasticmp(param, "frequency"))
{
footstep->frequency = (tic_t)atoi(val);
}
else if (stricmp(param, "requiredSpeed") == 0)
else if (fasticmp(param, "requiredSpeed"))
{
footstep->requiredSpeed = FLOAT_TO_FIXED(atof(val));
}
@ -1613,23 +1613,23 @@ static void K_ParseOverlayParameter(size_t i, char *param, char *val)
{
t_overlay_t *overlay = &overlayDefs[i];
if (stricmp(param, "stillState") == 0)
if (fasticmp(param, "stillState"))
{
overlay->states[TOV_STILL] = get_number(val);
}
else if (stricmp(param, "movingState") == 0)
else if (fasticmp(param, "movingState"))
{
overlay->states[TOV_MOVING] = get_number(val);
}
else if (stricmp(param, "scale") == 0)
else if (fasticmp(param, "scale"))
{
overlay->scale = FLOAT_TO_FIXED(atof(val));
}
else if (stricmp(param, "color") == 0)
else if (fasticmp(param, "color"))
{
overlay->color = get_number(val);
}
else if (stricmp(param, "speed") == 0)
else if (fasticmp(param, "speed"))
{
overlay->speed = FLOAT_TO_FIXED(atof(val));
}
@ -1726,54 +1726,54 @@ static void K_ParseTerrainParameter(size_t i, char *param, char *val)
{
terrain_t *terrain = &terrainDefs[i];
if (stricmp(param, "splash") == 0)
if (fasticmp(param, "splash"))
{
t_splash_t *splash = K_GetSplashByName(val);
terrain->splashID = K_GetSplashHeapIndex(splash);
}
else if (stricmp(param, "footstep") == 0)
else if (fasticmp(param, "footstep"))
{
t_footstep_t *footstep = K_GetFootstepByName(val);
terrain->footstepID = K_GetFootstepHeapIndex(footstep);
}
else if (stricmp(param, "overlay") == 0)
else if (fasticmp(param, "overlay"))
{
t_overlay_t *overlay = K_GetOverlayByName(val);
terrain->overlayID = K_GetOverlayHeapIndex(overlay);
}
else if (stricmp(param, "friction") == 0)
else if (fasticmp(param, "friction"))
{
terrain->friction = FLOAT_TO_FIXED(atof(val));
}
else if (stricmp(param, "offroad") == 0)
else if (fasticmp(param, "offroad"))
{
terrain->offroad = (UINT8)get_number(val); // offroad strength enum?
}
else if (stricmp(param, "damageType") == 0)
else if (fasticmp(param, "damageType"))
{
terrain->damageType = (INT16)get_number(val);
}
else if (stricmp(param, "pogoSpring") == 0)
else if (fasticmp(param, "pogoSpring"))
{
terrain->pogoSpring = (UINT8)get_number(val);
}
else if (stricmp(param, "pogoMinSpeed") == 0 || stricmp(param, "pogoSpringMinSpeed") == 0)
else if (fasticmp(param, "pogoMinSpeed") || fasticmp(param, "pogoSpringMinSpeed"))
{
terrain->pogoSpringMin = (UINT8)get_number(val);
}
else if (stricmp(param, "pogoMaxSpeed") == 0 || stricmp(param, "pogoSpringMaxSpeed") == 0)
else if (fasticmp(param, "pogoMaxSpeed") || fasticmp(param, "pogoSpringMaxSpeed"))
{
terrain->pogoSpringMax = (UINT8)get_number(val);
}
else if (stricmp(param, "speedPad") == 0)
else if (fasticmp(param, "speedPad"))
{
terrain->speedPad = FLOAT_TO_FIXED(atof(val));
}
else if (stricmp(param, "speedPadAngle") == 0)
else if (fasticmp(param, "speedPadAngle"))
{
terrain->speedPadAngle = FixedAngle(FLOAT_TO_FIXED(atof(val)));
}
else if (stricmp(param, "springStrength") == 0)
else if (fasticmp(param, "springStrength"))
{
const double fval = atof(val);
@ -1790,35 +1790,35 @@ static void K_ParseTerrainParameter(size_t i, char *param, char *val)
FLOAT_TO_FIXED(15.625 * pow(1.6, fval));
}
}
else if (stricmp(param, "outrun") == 0 || stricmp(param, "speedIncrease") == 0)
else if (fasticmp(param, "outrun") || fasticmp(param, "speedIncrease"))
{
terrain->outrun = FLOAT_TO_FIXED(atof(val));
}
else if (stricmp(param, "floorClip") == 0)
else if (fasticmp(param, "floorClip"))
{
terrain->floorClip = FLOAT_TO_FIXED(atof(val));
}
else if (stricmp(param, "liquid") == 0)
else if (fasticmp(param, "liquid"))
{
K_FlagBoolean(&terrain->flags, TRF_LIQUID, val);
}
else if (stricmp(param, "sneakerPanel") == 0)
else if (fasticmp(param, "sneakerPanel"))
{
K_FlagBoolean(&terrain->flags, TRF_SNEAKERPANEL, val);
}
else if (stricmp(param, "waterRunPanel") == 0 || stricmp(param, "waterPanel") == 0)
else if (fasticmp(param, "waterRunPanel") || fasticmp(param, "waterPanel"))
{
K_FlagBoolean(&terrain->flags, TRF_WATERRUNPANEL, val);
}
else if (stricmp(param, "tripwire") == 0)
else if (fasticmp(param, "tripwire"))
{
K_FlagBoolean(&terrain->flags, TRF_TRIPWIRE, val);
}
else if (stricmp(param, "remap") == 0)
else if (fasticmp(param, "remap"))
{
K_FlagBoolean(&terrain->flags, TRF_REMAP, val);
}
else if (stricmp(param, "fricfix") == 0 || stricmp(param, "frictionfix") == 0 || stricmp(param, "boostbypass") == 0)
else if (fasticmp(param, "fricfix") || fasticmp(param, "frictionfix") || fasticmp(param, "boostbypass"))
{
K_FlagBoolean(&terrain->flags, TRF_BYPASSBOOST, val);
}
@ -1920,7 +1920,7 @@ static boolean K_TERRAINLumpParser(char *data, size_t size)
valid = false;
}
// Check for valid fields.
else if (stricmp(tkn, "splash") == 0)
else if (fasticmp(tkn, "splash"))
{
Z_Free(tkn);
tkn = M_GetToken(NULL);
@ -1961,7 +1961,7 @@ static boolean K_TERRAINLumpParser(char *data, size_t size)
valid = false;
}
}
else if (stricmp(tkn, "footstep") == 0)
else if (fasticmp(tkn, "footstep"))
{
Z_Free(tkn);
tkn = M_GetToken(NULL);
@ -2002,7 +2002,7 @@ static boolean K_TERRAINLumpParser(char *data, size_t size)
valid = false;
}
}
else if (stricmp(tkn, "overlay") == 0)
else if (fasticmp(tkn, "overlay"))
{
Z_Free(tkn);
tkn = M_GetToken(NULL);
@ -2043,7 +2043,7 @@ static boolean K_TERRAINLumpParser(char *data, size_t size)
valid = false;
}
}
else if (stricmp(tkn, "terrain") == 0)
else if (fasticmp(tkn, "terrain"))
{
Z_Free(tkn);
tkn = M_GetToken(NULL);
@ -2084,7 +2084,7 @@ static boolean K_TERRAINLumpParser(char *data, size_t size)
valid = false;
}
}
else if (stricmp(tkn, "floor") == 0 || stricmp(tkn, "texture") == 0)
else if (fasticmp(tkn, "floor") || fasticmp(tkn, "texture"))
{
Z_Free(tkn);
tkn = M_GetToken(NULL);
@ -2092,7 +2092,7 @@ static boolean K_TERRAINLumpParser(char *data, size_t size)
if (tkn && pos <= size)
{
if (stricmp(tkn, "optional") == 0)
if (fasticmp(tkn, "optional"))
{
// "optional" is ZDoom syntax
// We don't use it, but we can ignore it.
@ -2175,7 +2175,7 @@ static boolean K_TERRAINLumpParser(char *data, size_t size)
valid = false;
}
}
else if (stricmp(tkn, "defaultTerrain") == 0)
else if (fasticmp(tkn, "defaultTerrain"))
{
Z_Free(tkn);
tkn = M_GetToken(NULL);
@ -2214,7 +2214,7 @@ static boolean K_TERRAINLumpParser(char *data, size_t size)
valid = false;
}
}
else if (stricmp(tkn, "defaultOffroadFootstep") == 0)
else if (fasticmp(tkn, "defaultOffroadFootstep"))
{
Z_Free(tkn);
tkn = M_GetToken(NULL);

View file

@ -342,7 +342,7 @@ static int lib_userdataMetatable(lua_State *L)
// Find internal metatable name
for (i = 0; meta2utype[i].meta; i++)
if (!strcmp(udname, meta2utype[i].utype))
if (fastcmp(udname, meta2utype[i].utype))
{
luaL_getmetatable(L, meta2utype[i].meta);
return 1;

View file

@ -447,12 +447,12 @@ static int lib_cvFindVar(lua_State *L)
{
// cv_numlaps -> numlaps (global, not cvar)
// cv_basenumlaps -> cv_numlaps
if (!strcmp(name, "numlaps"))
if (fastcmp(name, "numlaps"))
{
LUA_PushUserdata(L, &cv_fakenumlaps, META_CVAR);
return 1;
}
else if (!strcmp(name, "basenumlaps"))
else if (fastcmp(name, "basenumlaps"))
name = "numlaps";
}
LUA_PushUserdata(L, CV_FindVar(name), META_CVAR);

View file

@ -90,7 +90,7 @@ static int hook_in_list
for (type = 0; list[type] != NULL; ++type)
{
if (strcmp(name, list[type]) == 0)
if (fastcmp(name, list[type]))
break;
}
@ -235,7 +235,7 @@ static int lib_addHook(lua_State *L)
{
add_hook(&hookIds[type]);
}
else if (strcmp(name, "HUD") == 0)
else if (fastcmp(name, "HUD"))
{
add_hud_hook(L, 3);
}

View file

@ -1683,7 +1683,7 @@ static int lib_setSkinColor(lua_State *L)
if (info->name[0] != '\0') // don't check empty string for dupe
{
UINT16 dupecheck = R_GetColorByName(info->name);
if (!stricmp(info->name, skincolors[SKINCOLOR_NONE].name) || (dupecheck && (dupecheck != info-skincolors)))
if (fasticmp(info->name, skincolors[SKINCOLOR_NONE].name) || (dupecheck && (dupecheck != info-skincolors)))
CONS_Alert(CONS_WARNING, "skincolor_t field 'name' ('%s') is a duplicate of another skincolor's name.\n", info->name);
}
} else if (i == 2 || (str && fastcmp(str,"ramp"))) {
@ -1778,7 +1778,7 @@ static int skincolor_set(lua_State *L)
if (info->name[0] != '\0') // don't check empty string for dupe
{
UINT16 dupecheck = R_GetColorByName(info->name);
if (!stricmp(info->name, skincolors[SKINCOLOR_NONE].name) || (dupecheck && (dupecheck != cnum)))
if (fasticmp(info->name, skincolors[SKINCOLOR_NONE].name) || (dupecheck && (dupecheck != cnum)))
CONS_Alert(CONS_WARNING, "skincolor_t field 'name' ('%s') is a duplicate of another skincolor's name.\n", info->name);
}
} else if (fastcmp(field,"ramp")) {

View file

@ -763,7 +763,7 @@ void Command_Devmode_f(void)
// Try it as a string
for (j = 0; debug_flag_names[j].str; j++)
{
if (stricmp(arg, debug_flag_names[j].str) == 0)
if (fasticmp(arg, debug_flag_names[j].str))
{
break;
}

View file

@ -106,7 +106,7 @@ void M_LoadEmotes(UINT16 wadnum)
trim(field);
trim(value);
if (stricmp(field.c_str(), "frames") == 0)
if (fasticmp(field.c_str(), "frames"))
{
UINT8 numframes = 0;
@ -153,7 +153,7 @@ void M_LoadEmotes(UINT16 wadnum)
emote->numframes = numframes;
}
else if (stricmp(field.c_str(), "timeperframe") == 0)
else if (fasticmp(field.c_str(), "timeperframe"))
{
emote->timeperframe = std::stoi(value);

View file

@ -1051,7 +1051,7 @@ void M_ChangeMenuMusic(void)
}
else
{
if (stricmp(menudefs[target].musname, S_MusicName()))
if (!fasticmp(menudefs[target].musname, S_MusicName()))
{
S_ChangeMusic(menudefs[target].musname, menudefs[target].mustrack, menudefs[target].muslooping);
@ -3148,7 +3148,7 @@ typedef int (qsort_f)(const void *, const void *);
static int Levelsort_Name(const void *a, const void *b)
{
const INT16 m1 = *(const INT16 *)a, m2 = *(const INT16 *)b;
int c = strcmp(mapheaderinfo[m1]->lvlttl, mapheaderinfo[m2]->lvlttl);
int c = !fastcmp(mapheaderinfo[m1]->lvlttl, mapheaderinfo[m2]->lvlttl);
return c != 0 ? c : m1 - m2;
}
@ -6237,7 +6237,7 @@ INT32 MR_HandleLevelStats(INT32 choice)
S_StartSound(NULL, sfx_menu1);
recordpresetnum_e i, j;
for (i = 0; i < numrecordpresets; i++)
if (!strcmp(currentrecordpreset, recordpresets[i]->name))
if (fastcmp(currentrecordpreset, recordpresets[i]->name))
break;
for (j = i; (i = (i + 1) % numrecordpresets) != j;)
if (recordpresets[i]->numversions)
@ -8762,7 +8762,7 @@ INT32 MR_VideoModeMenu(INT32 choice)
// VESA mode, which is always a higher modenum
for (j = 0; j < vidm_nummodes; j++)
{
if (!strcmp(modedescs[j].desc, desc))
if (fastcmp(modedescs[j].desc, desc))
{
// mode(0): 320x200 is always standard VGA, not vesa
if (modedescs[j].modenum)

View file

@ -484,7 +484,7 @@ void Command_SaveConfig_f(void)
FIL_ForceExtension(tmpstr, ".cfg");
M_SaveConfig(tmpstr);
if (stricmp(COM_Argv(2), "-silent"))
if (!fasticmp(COM_Argv(2), "-silent"))
CONS_Printf(M_GetText("config saved as %s\n"), configfile);
}

View file

@ -656,7 +656,7 @@ void M_DrawPerfStats(void)
char* tempstr = tempbuffer;
int len = (int)strlen(str);
char* str_ptr;
if (strcmp(".lua", str + len - 4) == 0)
if (fastcmp(".lua", str + len - 4))
{
str[len-4] = '\0'; // remove .lua at end
len -= 4;
@ -674,7 +674,7 @@ void M_DrawPerfStats(void)
if (str_ptr)
tempstr = str_ptr + 1;
// tempstr should now point to the mod name, (wad/pk3) possibly truncated
if (strcmp(tempstr, last_mod_name) != 0)
if (!fastcmp(tempstr, last_mod_name))
{
strcpy(last_mod_name, tempstr);
len = (int)strlen(tempstr);

View file

@ -1153,7 +1153,7 @@ static boolean P_SectorStringArgsEqual(const sector_t *sc, const sector_t *spawn
if (!sc->stringargs[i])
return !spawnsc->stringargs[i];
if (strcmp(sc->stringargs[i], spawnsc->stringargs[i]))
if (!fastcmp(sc->stringargs[i], spawnsc->stringargs[i]))
return false;
}
@ -1217,7 +1217,7 @@ static boolean P_LineStringArgsEqual(const line_t *li, const line_t *spawnli)
if (!li->stringargs[i])
return !spawnli->stringargs[i];
if (strcmp(li->stringargs[i], spawnli->stringargs[i]))
if (!fastcmp(li->stringargs[i], spawnli->stringargs[i]))
return false;
}
@ -1752,7 +1752,7 @@ static boolean P_ThingStringArgsEqual(const mobj_t *mobj, const mapthing_t *mapt
if (!mobj->stringargs[i])
return !mapthing->stringargs[i];
if (strcmp(mobj->stringargs[i], mapthing->stringargs[i]))
if (!fastcmp(mobj->stringargs[i], mapthing->stringargs[i]))
return false;
}
@ -1774,7 +1774,7 @@ static boolean P_ThingScriptEqual(const mobj_t *mobj, const mapthing_t *mapthing
if (!mobj->script_stringargs[i])
return !mapthing->script_stringargs[i];
if (strcmp(mobj->script_stringargs[i], mapthing->script_stringargs[i]))
if (!fastcmp(mobj->script_stringargs[i], mapthing->script_stringargs[i]))
return false;
}
@ -3829,7 +3829,7 @@ static inline void P_NetSyncSpecials(savebuffer_t *save)
// Sky texture
strcpy(skytex, globallevelskytexture);
P_SyncStringN(save, skytex, 9);
if (strcmp(skytex, globallevelskytexture))
if (!fastcmp(skytex, globallevelskytexture))
P_SetupLevelSky(skytex, true);
// Current global weather type
@ -3920,7 +3920,7 @@ static inline void P_UnArchiveSPGame(savebuffer_t *save, INT16 mapoverride)
READSTRINGN(save->p, testname, sizeof(testname));
if (strcmp(testname, timeattackfolder))
if (!fastcmp(testname, timeattackfolder))
{
if (modifiedgame)
I_Error("Save game not for this modification.");

View file

@ -9329,7 +9329,7 @@ static lumpinfo_t* FindFolder(const char *folName, UINT16 *start, UINT16 *end, l
{
UINT16 numlumps = *pnumlumps;
size_t i = *pi;
if (!stricmp(lumpinfo->fullname, folName))
if (fasticmp(lumpinfo->fullname, folName))
{
lumpinfo++;
*start = ++i;

View file

@ -254,17 +254,17 @@ void P_ParseANIMDEFSLump(INT32 wadNum, UINT16 lumpnum)
animdefsToken = M_GetToken(p);
while (animdefsToken != NULL)
{
if (stricmp(animdefsToken, "TEXTURE") == 0)
if (fasticmp(animdefsToken, "TEXTURE"))
{
Z_Free(animdefsToken);
P_ParseAnimationDefintion(1, compat);
}
else if (stricmp(animdefsToken, "FLAT") == 0)
else if (fasticmp(animdefsToken, "FLAT"))
{
Z_Free(animdefsToken);
P_ParseAnimationDefintion(0, compat);
}
else if (stricmp(animdefsToken, "OSCILLATE") == 0)
else if (fasticmp(animdefsToken, "OSCILLATE"))
{
// This probably came off the tail of an earlier definition. It's technically legal syntax, but we don't support it.
I_Error("Error parsing ANIMDEFS lump: Animation definitions utilizing \"OSCILLATE\" (the animation plays in reverse when it reaches the end) are not supported by SRB2");
@ -296,7 +296,7 @@ void P_ParseAnimationDefintion(SINT8 istexture, boolean compat)
{
I_Error("Error parsing ANIMDEFS lump: Unexpected end of file where start texture/flat name should be");
}
if (stricmp(animdefsToken, "OPTIONAL") == 0)
if (fasticmp(animdefsToken, "OPTIONAL"))
{
// This is meaningful to ZDoom - it tells the program NOT to bomb out
// if the textures can't be found - but it's useless in SRB2, so we'll
@ -308,7 +308,7 @@ void P_ParseAnimationDefintion(SINT8 istexture, boolean compat)
{
I_Error("Error parsing ANIMDEFS lump: Unexpected end of file where start texture/flat name should be");
}
else if (stricmp(animdefsToken, "RANGE") == 0)
else if (fasticmp(animdefsToken, "RANGE"))
{
// Oh. Um. Apparently "OPTIONAL" is a texture name. Naughty.
// I should probably handle this more gracefully, but right now
@ -326,7 +326,7 @@ void P_ParseAnimationDefintion(SINT8 istexture, boolean compat)
// Search for existing animdef
for (i = 0; i < maxanims; i++)
if ((compat || animdefs[i].istexture == istexture) // Check if it's the same type!
&& stricmp(animdefsToken, animdefs[i].startname) == 0)
&& fasticmp(animdefsToken, animdefs[i].startname))
{
//CONS_Alert(CONS_NOTICE, "Duplicate animation: %s\n", animdefsToken);
@ -357,18 +357,18 @@ void P_ParseAnimationDefintion(SINT8 istexture, boolean compat)
{
I_Error("Error parsing ANIMDEFS lump: Unexpected end of file where \"RANGE\" after \"%s\"'s startname should be", animdefs[i].startname);
}
if (stricmp(animdefsToken, "ALLOWDECALS") == 0)
if (fasticmp(animdefsToken, "ALLOWDECALS"))
{
// Another ZDoom keyword, ho-hum. Skip it, move on to the next token.
Z_Free(animdefsToken);
animdefsToken = M_GetToken(NULL);
}
if (stricmp(animdefsToken, "PIC") == 0)
if (fasticmp(animdefsToken, "PIC"))
{
// This is technically legitimate ANIMDEFS syntax, but SRB2 doesn't support it.
I_Error("Error parsing ANIMDEFS lump: Animation definitions utilizing \"PIC\" (specific frames instead of a consecutive range) are not supported by SRB2");
}
if (stricmp(animdefsToken, "RANGE") != 0)
if (!fasticmp(animdefsToken, "RANGE"))
{
I_Error("Error parsing ANIMDEFS lump: Expected \"RANGE\" after \"%s\"'s startname, got \"%s\"", animdefs[i].startname, animdefsToken);
}
@ -394,12 +394,12 @@ void P_ParseAnimationDefintion(SINT8 istexture, boolean compat)
{
I_Error("Error parsing ANIMDEFS lump: Unexpected end of file where \"%s\"'s \"TICS\" should be", animdefs[i].startname);
}
if (stricmp(animdefsToken, "RAND") == 0)
if (fasticmp(animdefsToken, "RAND"))
{
// This is technically legitimate ANIMDEFS syntax, but SRB2 doesn't support it.
I_Error("Error parsing ANIMDEFS lump: Animation definitions utilizing \"RAND\" (random duration per frame) are not supported by SRB2");
}
if (stricmp(animdefsToken, "TICS") != 0)
if (!fasticmp(animdefsToken, "TICS"))
{
I_Error("Error parsing ANIMDEFS lump: Expected \"TICS\" in animation definition for \"%s\", got \"%s\"", animdefs[i].startname, animdefsToken);
}
@ -1570,7 +1570,7 @@ boolean P_RunTriggerLinedef(line_t *triggerline, mobj_t *actor, sector_t *caller
return false;
if (!triggerline->stringargs[0])
return false;
if (!(stricmp(triggerline->stringargs[0], skins[actor->player->skin].name) == 0) ^ !!(triggerline->args[1]))
if (!(fasticmp(triggerline->stringargs[0], skins[actor->player->skin].name)) ^ !!(triggerline->args[1]))
return false;
break;
case 334: // object dye

View file

@ -404,7 +404,7 @@ UINT16 R_GetColorByName(const char *name)
if (color > 0 && color < numskincolors)
return color;
for (color = 1; color < numskincolors; color++)
if (!stricmp(skincolors[color].name, name))
if (fasticmp(skincolors[color].name, name))
return color;
return SKINCOLOR_NONE;
}
@ -415,7 +415,7 @@ UINT16 R_GetSuperColorByName(const char *name)
char *realname = static_cast<char *>(Z_Malloc(MAXCOLORNAME+1, PU_STATIC, NULL));
snprintf(realname, MAXCOLORNAME+1, "Super %s 1", name);
for (i = 1; i < numskincolors; i++)
if (!stricmp(skincolors[i].name, realname)) {
if (fasticmp(skincolors[i].name, realname)) {
color = i;
break;
}

View file

@ -1422,7 +1422,7 @@ static void R_ParseSpriteInfoSkin(struct ParseSpriteInfoState *parser)
I_Error("Error parsing SPRTINFO lump: Unexpected end of file where skin frame should be");
}
if (strcmp(sprinfoToken, "*")==0) // All skins
if (fastcmp(sprinfoToken, "*")) // All skins
{
parser->foundskins = -1;
}
@ -1513,7 +1513,7 @@ static boolean R_ParseSpriteInfoFrame(struct ParseSpriteInfoState *parser, boole
}
else
{
if (strcmp(sprinfoToken,"{")==0)
if (fastcmp(sprinfoToken,"{"))
{
Z_Free(sprinfoToken);
sprinfoToken = M_GetToken(NULL);
@ -1522,32 +1522,32 @@ static boolean R_ParseSpriteInfoFrame(struct ParseSpriteInfoState *parser, boole
CONS_Alert(CONS_WARNING, "Error parsing SPRTINFO lump: Unexpected end of file where sprite info should be\n");
return false;
}
while (strcmp(sprinfoToken,"}")!=0)
while (!fastcmp(sprinfoToken,"}"))
{
if (stricmp(sprinfoToken, "XPIVOT")==0)
if (fasticmp(sprinfoToken, "XPIVOT"))
{
Z_Free(sprinfoToken);
sprinfoToken = M_GetToken(NULL);
frameXPivot = atoi(sprinfoToken);
}
else if (stricmp(sprinfoToken, "YPIVOT")==0)
else if (fasticmp(sprinfoToken, "YPIVOT"))
{
Z_Free(sprinfoToken);
sprinfoToken = M_GetToken(NULL);
frameYPivot = atoi(sprinfoToken);
}
else if (stricmp(sprinfoToken, "ROTAXIS")==0)
else if (fasticmp(sprinfoToken, "ROTAXIS"))
{
Z_Free(sprinfoToken);
sprinfoToken = M_GetToken(NULL);
if ((stricmp(sprinfoToken, "X")==0) || (stricmp(sprinfoToken, "XAXIS")==0) || (stricmp(sprinfoToken, "ROLL")==0))
if ((fasticmp(sprinfoToken, "X")) || (fasticmp(sprinfoToken, "XAXIS")) || (fasticmp(sprinfoToken, "ROLL")))
frameRotAxis = ROTAXIS_X;
else if ((stricmp(sprinfoToken, "Y")==0) || (stricmp(sprinfoToken, "YAXIS")==0) || (stricmp(sprinfoToken, "PITCH")==0))
else if ((fasticmp(sprinfoToken, "Y")) || (fasticmp(sprinfoToken, "YAXIS")) || (fasticmp(sprinfoToken, "PITCH")))
frameRotAxis = ROTAXIS_Y;
else if ((stricmp(sprinfoToken, "Z")==0) || (stricmp(sprinfoToken, "ZAXIS")==0) || (stricmp(sprinfoToken, "YAW")==0))
else if ((fasticmp(sprinfoToken, "Z")) || (fasticmp(sprinfoToken, "ZAXIS")) || (fasticmp(sprinfoToken, "YAW")))
frameRotAxis = ROTAXIS_Z;
}
else if (stricmp(sprinfoToken, "BRIGHTMAP")==0)
else if (fasticmp(sprinfoToken, "BRIGHTMAP"))
{
Z_Free(bright);
bright = M_GetToken(NULL);
@ -1657,7 +1657,7 @@ static boolean R_ParseSpriteInfo(boolean spr2)
return false;
}
if (!strcmp(sprinfoToken, "*")) // All sprites
if (fastcmp(sprinfoToken, "*")) // All sprites
{
parser.any = true;
}
@ -1730,7 +1730,7 @@ static boolean R_ParseSpriteInfo(boolean spr2)
boolean error = false;
if (strcmp(sprinfoToken,"{")==0)
if (fastcmp(sprinfoToken,"{"))
{
Z_Free(sprinfoToken);
sprinfoToken = M_GetToken(NULL);
@ -1740,9 +1740,9 @@ static boolean R_ParseSpriteInfo(boolean spr2)
Z_Free(parser.info);
return false;
}
while (strcmp(sprinfoToken,"}")!=0)
while (!fastcmp(sprinfoToken,"}"))
{
if (stricmp(sprinfoToken, "SKIN")==0)
if (fasticmp(sprinfoToken, "SKIN"))
{
if (!spr2)
{
@ -1754,7 +1754,7 @@ static boolean R_ParseSpriteInfo(boolean spr2)
Z_Free(sprinfoToken);
R_ParseSpriteInfoSkin(&parser);
}
else if (stricmp(sprinfoToken, "FRAME")==0)
else if (fasticmp(sprinfoToken, "FRAME"))
{
Z_Free(sprinfoToken);
if (!R_ParseSpriteInfoFrame(&parser, PARSER_FRAME))
@ -1763,7 +1763,7 @@ static boolean R_ParseSpriteInfo(boolean spr2)
break;
}
}
else if (stricmp(sprinfoToken, "DEFAULT")==0)
else if (fasticmp(sprinfoToken, "DEFAULT"))
{
Z_Free(sprinfoToken);
if (!R_ParseSpriteInfoFrame(&parser, PARSER_DEFAULT))
@ -1833,9 +1833,9 @@ void R_ParseSPRTINFOLump(UINT16 wadNum, UINT16 lumpNum)
{
boolean error = true;
if (!stricmp(sprinfoToken, "SPRITE"))
if (fasticmp(sprinfoToken, "SPRITE"))
error = !R_ParseSpriteInfo(false);
else if (!stricmp(sprinfoToken, "SPRITE2"))
else if (fasticmp(sprinfoToken, "SPRITE2"))
error = !R_ParseSpriteInfo(true);
else
CONS_Alert(CONS_WARNING, "Error parsing SPRTINFO lump: Unknown keyword \"%s\"\n", sprinfoToken);

View file

@ -186,8 +186,8 @@ static INT32 R_GetVoiceArraySoundFlags(const kartvoice_t *voice, const sfxenum_t
static size_t R_ParseVoiceSoundKey(kartvoice_t *voice, const char *name, sfxenum_t **outarray)
{
// woah! comma operator!
#define S(str, ret) if (!stricmp(name, #str)) return *outarray = voice->ret, sizeof(voice->ret)/sizeof(*voice->ret)
#define S1(str, ret) if (!stricmp(name, #str)) return *outarray = &voice->ret, 1
#define S(str, ret) if (fasticmp(name, #str)) return *outarray = voice->ret, sizeof(voice->ret)/sizeof(*voice->ret)
#define S1(str, ret) if (fasticmp(name, #str)) return *outarray = &voice->ret, 1
S1(WIN, win);
S1(LOSE, lose);
S(HURT, pain);
@ -529,7 +529,7 @@ INT32 R_SkinAvailable(const char *name)
for (i = 0; i < numskins; i++)
{
// search in the skin list
if (stricmp(skins[i].name,name)==0)
if (fasticmp(skins[i].name,name))
return i;
}
return -1;
@ -832,7 +832,7 @@ static void R_LoadSkinSprites(UINT16 wadnum, UINT16 *lump, UINT16 *lastlump, ski
*lastlump = newlastlump; // okay, make the normal sprite set loading end there
}*/
boolean sonic = !strcmp(skin->name, "sonic") && wadnum == MAINWAD_MAIN;
boolean sonic = fastcmp(skin->name, "sonic") && wadnum == MAINWAD_MAIN;
if (!wadfiles[wadnum]->compatmode && !sonic)
{
@ -981,7 +981,7 @@ static boolean R_ProcessPatchableFields(skin_t *skin, char *stoken, char *value)
{
boolean compat = wadfiles[skin->wadnum]->compatmode;
if (!stricmp(stoken, "rivals"))
if (fasticmp(stoken, "rivals"))
{
size_t len = strlen(value);
size_t i;
@ -1036,16 +1036,16 @@ static boolean R_ProcessPatchableFields(skin_t *skin, char *stoken, char *value)
}
// custom translation table
else if (!stricmp(stoken, "startcolor"))
else if (fasticmp(stoken, "startcolor"))
skin->starttranscolor = compat ? R_GetPaletteRemap(atoi(value)) : atoi(value);
#define FULLPROCESS(field) else if (!stricmp(stoken, #field)) skin->field = get_number(value);
#define FULLPROCESS(field) else if (fasticmp(stoken, #field)) skin->field = get_number(value);
// character type identification
FULLPROCESS(flags)
FULLPROCESS(followitem)
#undef FULLPROCESS
#define GETSKINCOLOR(field) else if (!stricmp(stoken, #field)) \
#define GETSKINCOLOR(field) else if (fasticmp(stoken, #field)) \
{ \
UINT16 color = R_GetColorByName(value); \
skin->field = (color ? color : SKINCOLOR_GREEN); \
@ -1053,18 +1053,18 @@ static boolean R_ProcessPatchableFields(skin_t *skin, char *stoken, char *value)
GETSKINCOLOR(prefcolor)
GETSKINCOLOR(prefoppositecolor)
#undef GETSKINCOLOR
else if (!stricmp(stoken, "supercolor"))
else if (fasticmp(stoken, "supercolor"))
{
UINT16 color = R_GetSuperColorByName(value);
skin->supercolor = (color ? color : SKINCOLOR_SUPER1);
}
#define GETFLOAT(field) else if (!stricmp(stoken, #field)) skin->field = FLOAT_TO_FIXED(atof(value));
#define GETFLOAT(field) else if (fasticmp(stoken, #field)) skin->field = FLOAT_TO_FIXED(atof(value));
GETFLOAT(highresscale)
#undef GETFLOAT
#define GETKARTSTAT(field) \
else if (!stricmp(stoken, #field)) \
else if (fasticmp(stoken, #field)) \
{ \
skin->field = atoi(value); \
if (skin->field < 1) skin->field = 1; \
@ -1075,7 +1075,7 @@ static boolean R_ProcessPatchableFields(skin_t *skin, char *stoken, char *value)
#undef GETKARTSTAT
#define GETFLAG(field) else if (!stricmp(stoken, #field)) { \
#define GETFLAG(field) else if (fasticmp(stoken, #field)) { \
strupr(value); \
if (atoi(value) || value[0] == 'T' || value[0] == 'Y') \
skin->flags |= (SF_##field); \
@ -1089,18 +1089,18 @@ static boolean R_ProcessPatchableFields(skin_t *skin, char *stoken, char *value)
GETFLAG(OLDDEATH)
#undef GETFLAG
#define GETPATCH(field) else if (compat && !stricmp(stoken, #field)) strncpy(skin->field, value, 8);
#define GETPATCH(field) else if (compat && fasticmp(stoken, #field)) strncpy(skin->field, value, 8);
GETPATCH(facerank)
GETPATCH(facewant)
GETPATCH(facemmap)
#undef GETPATCH
else if (!stricmp(stoken, "voicename"))
else if (fasticmp(stoken, "voicename"))
{
// Change the current voice.
allocvoice = &skin->voices[R_AllocKartVoice(skin, value)];
}
else if (!stricmp(stoken, "voicerealname"))
else if (fasticmp(stoken, "voicerealname"))
{
if (allocvoice == NULL)
I_Error("Skin %s: cannot set voice realname without a voice selected", skin->name);
@ -1158,12 +1158,12 @@ static boolean R_ProcessPatchableFields(skin_t *skin, char *stoken, char *value)
}
else // let's check if it's a legacy skinsound, otherwise error out
{
if (!stricmp(stoken, "DSKTALK"))
if (fasticmp(stoken, "DSKTALK"))
return true; // SILENCE!
sfxenum_t i;
for (i = sfx_kwin; i <= sfx_kgloat; i++)
if (!stricmp(stoken+2, S_sfx[i].name))
if (fasticmp(stoken+2, S_sfx[i].name))
break;
if (i > sfx_kgloat)
return false;
@ -1173,7 +1173,7 @@ static boolean R_ProcessPatchableFields(skin_t *skin, char *stoken, char *value)
allocvoice = &skin->voices[R_AllocKartVoice(skin, "default")];
strcpy(allocvoice->realname, "Default");
}
else if (strcmp(allocvoice->name, "default"))
else if (!fastcmp(allocvoice->name, "default"))
{
// an incentive to read the wiki page
I_Error("Skin %s: cannot use legacy skinsounds to define voices", skin->name);
@ -1276,7 +1276,7 @@ void R_AddSkins(UINT16 wadnum)
// Some of these can't go in R_ProcessPatchableFields because they have side effects for future lines.
// Others can't go in there because we don't want them to be patchable.
if (!stricmp(stoken, "name"))
if (fasticmp(stoken, "name"))
{
INT32 skinnum = R_SkinAvailable(value);
strlwr(value);
@ -1311,7 +1311,7 @@ void R_AddSkins(UINT16 wadnum)
SYMBOLCONVERT(skin->realname);
}
}
else if (!stricmp(stoken, "realname"))
else if (fasticmp(stoken, "realname"))
{ // Display name (eg. "Knuckles")
realname = true;
STRBUFCPY(skin->realname, value);
@ -1419,7 +1419,7 @@ void R_PatchSkins(UINT16 wadnum)
if (!skin) // Get the name!
{
if (!stricmp(stoken, "name"))
if (fasticmp(stoken, "name"))
{
strlwr(value);
skinnum = R_SkinAvailable(value);
@ -1437,13 +1437,13 @@ void R_PatchSkins(UINT16 wadnum)
else // Get the properties!
{
// Some of these can't go in R_ProcessPatchableFields because they have side effects for future lines.
if (!stricmp(stoken, "realname"))
if (fasticmp(stoken, "realname"))
{ // Display name (eg. "Knuckles")
realname = true;
STRBUFCPY(skin->realname, value);
SYMBOLCONVERT(skin->realname)
}
else if (!stricmp(stoken, "rivals"))
else if (fasticmp(stoken, "rivals"))
{
size_t len = strlen(value);
size_t i;

View file

@ -1540,7 +1540,7 @@ static texpatch_t *R_ParsePatch(boolean actuallyLoadPatch)
{
I_Error("Error parsing TEXTURES lump: Unexpected end of file where comma after \"%s\"'s patch name should be",patchName);
}
if (strcmp(texturesToken,",")!=0)
if (!fastcmp(texturesToken,","))
{
I_Error("Error parsing TEXTURES lump: Expected \",\" after %s's patch name, got \"%s\"",patchName,texturesToken);
}
@ -1575,7 +1575,7 @@ static texpatch_t *R_ParsePatch(boolean actuallyLoadPatch)
{
I_Error("Error parsing TEXTURES lump: Unexpected end of file where comma after patch \"%s\"'s x coordinate should be",patchName);
}
if (strcmp(texturesToken,",")!=0)
if (!fastcmp(texturesToken,","))
{
I_Error("Error parsing TEXTURES lump: Expected \",\" after patch \"%s\"'s x coordinate, got \"%s\"",patchName,texturesToken);
}
@ -1613,7 +1613,7 @@ static texpatch_t *R_ParsePatch(boolean actuallyLoadPatch)
; // move on and ignore, R_ParseTextures will deal with this
else
{
if (strcmp(texturesToken,"{")==0)
if (fastcmp(texturesToken,"{"))
{
Z_Free(texturesToken);
texturesToken = M_GetToken(NULL);
@ -1621,32 +1621,32 @@ static texpatch_t *R_ParsePatch(boolean actuallyLoadPatch)
{
I_Error("Error parsing TEXTURES lump: Unexpected end of file where patch \"%s\"'s parameters should be",patchName);
}
while (strcmp(texturesToken,"}")!=0)
while (!fastcmp(texturesToken,"}"))
{
if (stricmp(texturesToken, "ALPHA")==0)
if (fasticmp(texturesToken, "ALPHA"))
{
Z_Free(texturesToken);
texturesToken = M_GetToken(NULL);
alpha = 255*strtof(texturesToken, NULL);
}
else if (stricmp(texturesToken, "STYLE")==0)
else if (fasticmp(texturesToken, "STYLE"))
{
Z_Free(texturesToken);
texturesToken = M_GetToken(NULL);
if (stricmp(texturesToken, "TRANSLUCENT")==0)
if (fasticmp(texturesToken, "TRANSLUCENT"))
style = AST_TRANSLUCENT;
else if (stricmp(texturesToken, "ADD")==0)
else if (fasticmp(texturesToken, "ADD"))
style = AST_ADD;
else if (stricmp(texturesToken, "SUBTRACT")==0)
else if (fasticmp(texturesToken, "SUBTRACT"))
style = AST_SUBTRACT;
else if (stricmp(texturesToken, "REVERSESUBTRACT")==0)
else if (fasticmp(texturesToken, "REVERSESUBTRACT"))
style = AST_REVERSESUBTRACT;
else if (stricmp(texturesToken, "MODULATE")==0)
else if (fasticmp(texturesToken, "MODULATE"))
style = AST_MODULATE;
}
else if (stricmp(texturesToken, "FLIPX")==0)
else if (fasticmp(texturesToken, "FLIPX"))
flip |= 1;
else if (stricmp(texturesToken, "FLIPY")==0)
else if (fasticmp(texturesToken, "FLIPY"))
flip |= 2;
Z_Free(texturesToken);
@ -1728,7 +1728,7 @@ static texture_t *R_ParseTexture(boolean actuallyLoadTexture)
{
I_Error("Error parsing TEXTURES lump: Unexpected end of file where comma after texture \"%s\"'s name should be",newTextureName);
}
else if (strcmp(texturesToken,",")!=0)
else if (!fastcmp(texturesToken,","))
{
I_Error("Error parsing TEXTURES lump: Expected \",\" after texture \"%s\"'s name, got \"%s\"",newTextureName,texturesToken);
}
@ -1762,7 +1762,7 @@ static texture_t *R_ParseTexture(boolean actuallyLoadTexture)
{
I_Error("Error parsing TEXTURES lump: Unexpected end of file where comma after texture \"%s\"'s width should be",newTextureName);
}
if (strcmp(texturesToken,",")!=0)
if (!fastcmp(texturesToken,","))
{
I_Error("Error parsing TEXTURES lump: Expected \",\" after texture \"%s\"'s width, got \"%s\"",newTextureName,texturesToken);
}
@ -1796,7 +1796,7 @@ static texture_t *R_ParseTexture(boolean actuallyLoadTexture)
{
I_Error("Error parsing TEXTURES lump: Unexpected end of file where open curly brace for texture \"%s\" should be",newTextureName);
}
if (strcmp(texturesToken,"{")==0)
if (fastcmp(texturesToken,"{"))
{
if (actuallyLoadTexture)
{
@ -1815,9 +1815,9 @@ static texture_t *R_ParseTexture(boolean actuallyLoadTexture)
{
I_Error("Error parsing TEXTURES lump: Unexpected end of file where patch definition for texture \"%s\" should be",newTextureName);
}
while (strcmp(texturesToken,"}")!=0)
while (!fastcmp(texturesToken,"}"))
{
if (stricmp(texturesToken, "PATCH")==0)
if (fasticmp(texturesToken, "PATCH"))
{
Z_Free(texturesToken);
if (resultTexture)
@ -1893,7 +1893,7 @@ int R_CountTexturesInTEXTURESLump(UINT16 wadNum, UINT16 lumpNum)
texturesToken = M_GetToken(texturesText);
while (texturesToken != NULL)
{
if (stricmp(texturesToken, "WALLTEXTURE") == 0 || stricmp(texturesToken, "TEXTURE") == 0)
if (fasticmp(texturesToken, "WALLTEXTURE") || fasticmp(texturesToken, "TEXTURE"))
{
numTexturesInLump++;
Z_Free(texturesToken);
@ -1942,7 +1942,7 @@ void R_ParseTEXTURESLump(UINT16 wadNum, UINT16 lumpNum, INT32 *texindex)
texturesToken = M_GetToken(texturesText);
while (texturesToken != NULL)
{
if (stricmp(texturesToken, "WALLTEXTURE") == 0 || stricmp(texturesToken, "TEXTURE") == 0)
if (fasticmp(texturesToken, "WALLTEXTURE") || fasticmp(texturesToken, "TEXTURE"))
{
Z_Free(texturesToken);
// Get the new texture

View file

@ -1254,7 +1254,7 @@ void S_StartSoundName(void *mo, const char *soundname)
{
if (!S_sfx[i].name)
continue;
if (!stricmp(S_sfx[i].name, soundname))
if (fasticmp(S_sfx[i].name, soundname))
{
soundnum = i;
break;
@ -1373,7 +1373,7 @@ musicdef_t *S_FindMusicDef(const char *name, UINT8 *i)
if (hash != def->hash[*i])
continue;
if (stricmp(def->name[*i], name))
if (!fasticmp(def->name[*i], name))
continue;
return def;
@ -1420,7 +1420,7 @@ ReadMusicDefFields
char *value;
char *textline;
if (!stricmp(stoken, "lump"))
if (fasticmp(stoken, "lump"))
{
value = strtok(NULL, " ,");
if (!value)
@ -1502,41 +1502,41 @@ ReadMusicDefFields
textline = value;
if (!stricmp(stoken, "title"))
if (fasticmp(stoken, "title"))
{
Z_Free(def->title);
def->title = Z_StrDup(textline);
def->legacy = false;
}
else if (!stricmp(stoken, "author"))
else if (fasticmp(stoken, "author"))
{
Z_Free(def->author);
def->author = Z_StrDup(textline);
def->legacy = false;
}
else if (!stricmp(stoken, "source"))
else if (fasticmp(stoken, "source"))
{
Z_Free(def->source);
def->source = Z_StrDup(textline);
}
else if (!stricmp(stoken, "originalcomposers"))
else if (fasticmp(stoken, "originalcomposers"))
{
Z_Free(def->composers);
def->composers = Z_StrDup(textline);
def->legacy = false;
}
else if (!stricmp(stoken, "volume"))
else if (fasticmp(stoken, "volume"))
{
def->volume = atoi(textline);
def->legacy = false;
}
else if (!stricmp(stoken, "contentidunsafe"))
else if (fasticmp(stoken, "contentidunsafe"))
{
textline[0] = toupper(textline[0]);
def->contentidunsafe = (textline[0] == 'Y' || textline[0] == 'T' || textline[0] == '1');
def->legacy = false;
}
else if (!stricmp(stoken, "usage"))
else if (fasticmp(stoken, "usage"))
{
Z_Free(def->usage);
def->usage = Z_StrDup(textline);
@ -1675,7 +1675,7 @@ void S_InitMusicDefs(void)
for (i = 0; i < numwadfiles; i++)
{
nameonly(tempname = va("%s", wadfiles[i]->filename));
if (wadfiles[i]->filename && !stricmp(tempname, MUSICNAME))
if (wadfiles[i]->filename && fasticmp(tempname, MUSICNAME))
{
// Awful hack but what can you do?
continue;

View file

@ -48,7 +48,7 @@
#endif
#define GETFUNC(func) \
else if (0 == strcmp(#func, funcName)) \
else if (0 == !fastcmp(#func, funcName)) \
funcPointer = FUNCPTRCAST(&func) \
//
//
@ -66,7 +66,7 @@ void *hwSym(const char *funcName,void *handle)
{
void *funcPointer = NULL;
#ifdef HWRENDER
if (0 == strcmp("SetTexturePalette", funcName))
if (0 == !fastcmp("SetTexturePalette", funcName))
funcPointer = FUNCPTRCAST(&OglSdlSetPalette);
GETFUNC(Init);
@ -109,7 +109,7 @@ void *hwSym(const char *funcName,void *handle)
GETFUNC(SetScreenPalette);
#else //HWRENDER
if (0 == strcmp("FinishUpdate", funcName))
if (0 == !fastcmp("FinishUpdate", funcName))
return funcPointer; //&FinishUpdate;
#endif //!HWRENDER
#ifdef STATIC3DS

View file

@ -1313,7 +1313,7 @@ static int joy_open(int playerIndex, int joyIndex)
JoyInfo[playerIndex].hats = 1;
JoyInfo[playerIndex].balls = 0;
//JoyInfo[playerIndex].bGamepadStyle = !stricmp(SDL_JoystickName(JoyInfo[playerIndex].dev), "pad");
//JoyInfo[playerIndex].bGamepadStyle = fasticmp(SDL_JoystickName(JoyInfo[playerIndex].dev), "pad");
return JoyInfo[playerIndex].axises;
}
@ -2336,7 +2336,7 @@ char *I_GetUserName(void)
}
if (strcmp(username, "") != 0)
if (!fastcmp(username, ""))
return username;
return NULL; // dummy for platform independent version
}

View file

@ -1025,7 +1025,7 @@ void I_GetEvent(void)
for (i = 0; i < MAXSPLITSCREENPLAYERS; i++)
{
if (!strcmp(cv_usejoystick[i].string, "0") || !cv_usejoystick[i].value)
if (fastcmp(cv_usejoystick[i].string, "0") || !cv_usejoystick[i].value)
cv_usejoystick[i].value = 0;
else if (atoi(cv_usejoystick[i].string) <= I_NumJoys() // don't mess if we intentionally set higher than NumJoys
&& cv_usejoystick[i].value) // update the cvar ONLY if a device exists
@ -1096,7 +1096,7 @@ void I_GetEvent(void)
for (i = 0; i < MAXSPLITSCREENPLAYERS; i++)
{
if (!strcmp(cv_usejoystick[i].string, "0"))
if (fastcmp(cv_usejoystick[i].string, "0"))
{
cv_usejoystick[i].value = 0;
}
@ -1675,7 +1675,7 @@ void I_StartupGraphics(void)
const char *modeparm = M_GetNextParm();
while (renderer_list[i].strvalue)
{
if (!stricmp(modeparm, renderer_list[i].strvalue))
if (fasticmp(modeparm, renderer_list[i].strvalue))
{
chosenrendermode = static_cast<rendermode_t>(renderer_list[i].value);
break;

View file

@ -116,8 +116,8 @@ boolean OglSdlSurface(INT32 w, INT32 h)
GL_DBG_Printf("GPU: %s\n", gl_renderer);
GL_DBG_Printf("Extensions: %s\n", gl_extensions);
if (strcmp((const char*)gl_renderer, "GDI Generic") == 0 &&
strcmp((const char*)gl_version, "1.1.0") == 0)
if (fastcmp((const char*)gl_renderer, "GDI Generic") &&
fastcmp((const char*)gl_version, "1.1.0"))
{
// Oh no... Windows gave us the GDI Generic rasterizer, so something is wrong...
// The game will crash later on when unsupported OpenGL commands are encountered.

View file

@ -349,7 +349,7 @@ static inline boolean CheckCompatExtension(const char *filename)
{
char *basename = (char *)strrchr(filename, '.');
if (!stricmp(basename+1, "KART"))
if (fasticmp(basename+1, "KART"))
return true;
return false;
@ -473,11 +473,11 @@ UINT32 W_HashLumpName(const char *name, size_t len)
*/
static restype_t ResourceFileDetect (const char* filename)
{
if (!stricmp(&filename[strlen(filename) - 4], ".pk3"))
if (fasticmp(&filename[strlen(filename) - 4], ".pk3"))
return RET_PK3;
if (!stricmp(&filename[strlen(filename) - 4], ".soc"))
if (fasticmp(&filename[strlen(filename) - 4], ".soc"))
return RET_SOC;
if (!stricmp(&filename[strlen(filename) - 4], ".lua"))
if (fasticmp(&filename[strlen(filename) - 4], ".lua"))
return RET_LUA;
return RET_WAD;
@ -2576,13 +2576,13 @@ static int W_VerifyFile(const char *filename, lumpchecklist_t *checklist,
if ((handle = W_OpenWadFile(&filename, false)) == NULL)
return -1;
if (stricmp(&filename[strlen(filename) - 4], ".pk3") == 0)
if (fasticmp(&filename[strlen(filename) - 4], ".pk3"))
goodfile = W_VerifyPK3(handle, checklist, status);
else
{
// detect wad file by the absence of the other supported extensions
if (stricmp(&filename[strlen(filename) - 4], ".soc")
&& stricmp(&filename[strlen(filename) - 4], ".lua"))
if (!fasticmp(&filename[strlen(filename) - 4], ".soc")
&& !fasticmp(&filename[strlen(filename) - 4], ".lua"))
{
goodfile = W_VerifyWAD(handle, checklist, status);
}