Skip to content

Commit 2141e1e

Browse files
committed
more C23 fixes
1 parent 4e648aa commit 2141e1e

9 files changed

Lines changed: 18 additions & 18 deletions

File tree

engine/client/cl_main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1719,7 +1719,7 @@ static void CL_BeginServerConnect(char *chain, int port, qboolean noproxy, enum
17191719
char *e = strchr(arglist, '&');
17201720
if (e)
17211721
*e=0;
1722-
if (!strncasecmp(arglist, "fp=", 3))
1722+
if (!Q_strncasecmp(arglist, "fp=", 3))
17231723
{
17241724
size_t l = 8*Base64_DecodeBlock(arglist+3, arglist+strlen(arglist), connectinfo.peercred.digest, sizeof(connectinfo.peercred.digest));
17251725
if (l <= 160)

engine/client/in_generic.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1170,17 +1170,17 @@ qboolean IN_SetHandPosition(const char *devname, vec3_t org, vec3_t ang, vec3_t
11701170
int dtype;
11711171
int seat;
11721172
struct vrdevinfo_s *dev;
1173-
if (!strncasecmp(devname, "left", 4))
1173+
if (!Q_strncasecmp(devname, "left", 4))
11741174
{
11751175
seat = atoi(devname+4);
11761176
dtype = VRDEV_LEFT;
11771177
}
1178-
else if (!strncasecmp(devname, "right", 5))
1178+
else if (!Q_strncasecmp(devname, "right", 5))
11791179
{
11801180
seat = atoi(devname+5);
11811181
dtype = VRDEV_RIGHT;
11821182
}
1183-
else if (!strncasecmp(devname, "head", 4))
1183+
else if (!Q_strncasecmp(devname, "head", 4))
11841184
{
11851185
seat = atoi(devname+4);
11861186
dtype = VRDEV_HEAD;

engine/client/m_multi.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,7 @@ qboolean MultiBeginGame (union menuoption_s *option,struct emenu_s *menu, int ke
617617
continue;
618618
break;
619619
}
620-
if (*shn || !*hostname || !strcasecmp(hostname, "player") || !strcasecmp(hostname, "unnamed")) //not simple enough...
620+
if (*shn || !*hostname || !Q_strcasecmp(hostname, "player") || !Q_strcasecmp(hostname, "unnamed")) //not simple enough...
621621
Cbuf_AddText(va("sv_public \"/\"\n"), RESTRICT_LOCAL);
622622
else
623623
Cbuf_AddText(va("sv_public \"/%s\"\n", info->hostnameedit->text), RESTRICT_LOCAL);
@@ -802,7 +802,7 @@ void M_Menu_GameOptions_f (void)
802802
info->numplayers = MC_AddCombo (menu, 64, 160, y, localtext("Max players"), (const char **)numplayeroptions, players);y+=8;
803803

804804
info->deathmatch = MC_AddCombo (menu, 64, 160, y, localtext("Deathmatch"), (const char **)deathmatchoptions, deathmatch.value);y+=8;
805-
info->teamplay = MC_AddCombo (menu, 64, 160, y, localtext("Teamplay"), (!strcasecmp(FS_GetGamedir(true), "rogue")?(const char **)teamplayoptions_rogue:(const char **)teamplayoptions), teamplay.value);y+=8;
805+
info->teamplay = MC_AddCombo (menu, 64, 160, y, localtext("Teamplay"), (!Q_strcasecmp(FS_GetGamedir(true), "rogue")?(const char **)teamplayoptions_rogue:(const char **)teamplayoptions), teamplay.value);y+=8;
806806
info->skill = MC_AddCombo (menu, 64, 160, y, localtext("Skill"), (const char **)skilloptions, skill.value);y+=8;
807807
info->rundedicated = MC_AddCheckBox(menu, 64, 160, y, localtext("dedicated"), NULL, 0);y+=8;
808808
y+=8;

engine/common/bothdefs.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -861,8 +861,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
861861
#define strnicmp _strnicmp
862862
#else
863863
//Posix
864-
#define stricmp strcasecmp
865-
#define strnicmp strncasecmp
864+
#define stricmp Q_strcasecmp
865+
#define strnicmp Q_strncasecmp
866866
#endif
867867
#endif
868868

engine/common/cvar.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ void *AHash_GetInsensitive(ahashtable_t *table, const char *name)
5252
if (b)
5353
for (i = 0; i < b->numentries; i++)
5454
{
55-
if (!strcasecmp(b->entry[i].string, name))
55+
if (!Q_strcasecmp(b->entry[i].string, name))
5656
return b->entry[i].data;
5757
}
5858
return NULL;
@@ -64,7 +64,7 @@ void AHash_RemoveDataInsensitive(ahashtable_t *table, const char *name, void *da
6464
size_t i;
6565
for (i = 0; i < b->numentries; i++)
6666
{
67-
if (b->entry[i].data == data && !strcasecmp(b->entry[i].string, name))
67+
if (b->entry[i].data == data && !Q_strcasecmp(b->entry[i].string, name))
6868
{
6969
//strip it.
7070
b->numentries--;

engine/common/fs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3923,7 +3923,7 @@ static int QDECL FS_SortWildDataFiles(const void *va, const void *vb)
39233923
return a->mtime > b->mtime;
39243924

39253925
//then fall back and sort by name
3926-
return strcasecmp(na, nb);
3926+
return Q_strcasecmp(na, nb);
39273927
}
39283928
static void FS_LoadWildDataFiles (filelist_t *list, wildpaks_t *wp)
39293929
{
@@ -7741,7 +7741,7 @@ static int QDECL Mods_AddGamedir(const char *fname, qofs_t fsize, time_t mtime,
77417741
desc = NULL;
77427742
for (u = 0; u < Cmd_Argc(); u+=2)
77437743
{
7744-
if (!strcasecmp(Cmd_Argv(u), "game"))
7744+
if (!Q_strcasecmp(Cmd_Argv(u), "game"))
77457745
desc = Cmd_Argv(u+1);
77467746
}
77477747
if (desc)

engine/common/json.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -489,11 +489,11 @@ json_t *JSON_ParseNode(json_t *t, const char *namestart, const char *nameend, st
489489
{
490490
if (JSON_ParseString(ctx, &childstart, &childend))
491491
{
492-
if (childend-childstart == 4 && !strncasecmp(childstart, "true", 4))
492+
if (childend-childstart == 4 && !Q_strncasecmp(childstart, "true", 4))
493493
return JSON_CreateNode(t, namestart, nameend, childstart, childend, json_type_true);
494-
else if (childend-childstart == 5 && !strncasecmp(childstart, "false", 5))
494+
else if (childend-childstart == 5 && !Q_strncasecmp(childstart, "false", 5))
495495
return JSON_CreateNode(t, namestart, nameend, childstart, childend, json_type_false);
496-
else if (childend-childstart == 4 && !strncasecmp(childstart, "null", 4))
496+
else if (childend-childstart == 4 && !Q_strncasecmp(childstart, "null", 4))
497497
return JSON_CreateNode(t, namestart, nameend, childstart, childend, json_type_null);
498498
else
499499
return JSON_CreateNode(t, namestart, nameend, childstart, childend, json_type_number);

plugins/plugin.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@
4343
# define Q_snprintf snprintf
4444
# endif
4545
#else
46-
# define stricmp strcasecmp
47-
# define strnicmp strncasecmp
46+
# define stricmp Q_strcasecmp
47+
# define strnicmp Q_strncasecmp
4848
#endif
4949

5050
#include <string.h>

plugins/quake3/clq3_ui.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1335,7 +1335,7 @@ static qintptr_t UI_SystemCalls(void *offset, quintptr_t mask, qintptr_t fn, con
13351335
serverinfo_t *s1 = masterfuncs->InfoForNum(VM_LONG(arg[3]));
13361336
serverinfo_t *s2 = masterfuncs->InfoForNum(VM_LONG(arg[4]));
13371337
if (keyisstring[key])
1338-
ret = strcasecmp(masterfuncs->ReadKeyString(s2, q3tofte[key]), masterfuncs->ReadKeyString(s1, q3tofte[key]));
1338+
ret = Q_strcasecmp(masterfuncs->ReadKeyString(s2, q3tofte[key]), masterfuncs->ReadKeyString(s1, q3tofte[key]));
13391339
else
13401340
{
13411341
ret = masterfuncs->ReadKeyFloat(s2, q3tofte[key]) - masterfuncs->ReadKeyFloat(s1, q3tofte[key]);

0 commit comments

Comments
 (0)