Replaced stricmp() by strcasecmp().
git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@2976 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
Changes towards version 0.7:
|
||||
- Replaced stricmp() by the POSIX compatible strcasecmp() - SvdB
|
||||
- Split STRTAB further into STRTAB and CONVERSATION - Michael
|
||||
- INT32, BOOLEAN, and STRING resource types - Michael
|
||||
- UNKNOWNRES is now safe to load, and "loads" as its resvalue - Michael
|
||||
|
||||
@@ -277,7 +277,7 @@ cdp_GetInterfaceReg (const char* name, cdp_ApiVersion api_ver)
|
||||
cdp_ItfReg* itf;
|
||||
|
||||
for (itf = cdp_itfs; itf->used &&
|
||||
(!itf->name || stricmp(itf->name, name) != 0 ||
|
||||
(!itf->name || strcasecmp(itf->name, name) != 0 ||
|
||||
api_ver < itf->ver_from || api_ver > itf->ver_to);
|
||||
itf++)
|
||||
;
|
||||
@@ -390,7 +390,7 @@ cdp_Host_RegisterItf (const char* name, cdp_ApiVersion ver_from,
|
||||
|
||||
// check if interface already registered
|
||||
for (itfreg = cdp_itfs; itfreg->used &&
|
||||
(!itfreg->name || stricmp(itfreg->name, id_name) != 0 ||
|
||||
(!itfreg->name || strcasecmp(itfreg->name, id_name) != 0 ||
|
||||
ver_from < itfreg->ver_from || ver_to > itfreg->ver_to);
|
||||
++itfreg)
|
||||
{
|
||||
@@ -502,7 +502,7 @@ cdp_GetEventReg (const char* name)
|
||||
cdp_EventReg* evt;
|
||||
|
||||
for (evt = cdp_evts; evt->used &&
|
||||
(!evt->name || stricmp(evt->name, name) != 0);
|
||||
(!evt->name || strcasecmp(evt->name, name) != 0);
|
||||
evt++)
|
||||
;
|
||||
if (!evt->name)
|
||||
@@ -626,7 +626,7 @@ cdp_Host_RegisterEvent (const char* name, cdp_Module* owner)
|
||||
|
||||
// check if event already registered
|
||||
for (evtreg = cdp_evts; evtreg->used &&
|
||||
(!evtreg->name || stricmp(evtreg->name, id_name) != 0);
|
||||
(!evtreg->name || strcasecmp(evtreg->name, id_name) != 0);
|
||||
++evtreg)
|
||||
{
|
||||
// and pick up an empty slot (where available)
|
||||
|
||||
@@ -205,7 +205,7 @@ VControl_name2code (char *name)
|
||||
{
|
||||
char *test = keynames[i].name;
|
||||
int code = keynames[i].code;
|
||||
if (!stricmp(test, name) || !code)
|
||||
if (!strcasecmp(test, name) || !code)
|
||||
{
|
||||
return code;
|
||||
}
|
||||
|
||||
@@ -1086,7 +1086,7 @@ expected_error (parse_state *state, char *expected)
|
||||
static void
|
||||
consume (parse_state *state, char *expected)
|
||||
{
|
||||
if (stricmp (expected, state->token))
|
||||
if (strcasecmp (expected, state->token))
|
||||
{
|
||||
expected_error (state, expected);
|
||||
}
|
||||
@@ -1126,11 +1126,11 @@ static int
|
||||
consume_polarity (parse_state *state)
|
||||
{
|
||||
int result = 0;
|
||||
if (!stricmp (state->token, "positive"))
|
||||
if (!strcasecmp (state->token, "positive"))
|
||||
{
|
||||
result = 1;
|
||||
}
|
||||
else if (!stricmp (state->token, "negative"))
|
||||
else if (!strcasecmp (state->token, "negative"))
|
||||
{
|
||||
result = -1;
|
||||
}
|
||||
@@ -1146,19 +1146,19 @@ static Uint8
|
||||
consume_dir (parse_state *state)
|
||||
{
|
||||
Uint8 result = 0;
|
||||
if (!stricmp (state->token, "left"))
|
||||
if (!strcasecmp (state->token, "left"))
|
||||
{
|
||||
result = SDL_HAT_LEFT;
|
||||
}
|
||||
else if (!stricmp (state->token, "right"))
|
||||
else if (!strcasecmp (state->token, "right"))
|
||||
{
|
||||
result = SDL_HAT_RIGHT;
|
||||
}
|
||||
else if (!stricmp (state->token, "up"))
|
||||
else if (!strcasecmp (state->token, "up"))
|
||||
{
|
||||
result = SDL_HAT_UP;
|
||||
}
|
||||
else if (!stricmp (state->token, "down"))
|
||||
else if (!strcasecmp (state->token, "down"))
|
||||
{
|
||||
result = SDL_HAT_DOWN;
|
||||
}
|
||||
@@ -1178,7 +1178,7 @@ parse_joybinding (parse_state *state, VCONTROL_GESTURE *gesture)
|
||||
sticknum = consume_num (state);
|
||||
if (!state->error)
|
||||
{
|
||||
if (!stricmp (state->token, "axis"))
|
||||
if (!strcasecmp (state->token, "axis"))
|
||||
{
|
||||
int axisnum;
|
||||
consume (state, "axis");
|
||||
@@ -1195,7 +1195,7 @@ parse_joybinding (parse_state *state, VCONTROL_GESTURE *gesture)
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (!stricmp (state->token, "button"))
|
||||
else if (!strcasecmp (state->token, "button"))
|
||||
{
|
||||
int buttonnum;
|
||||
consume (state, "button");
|
||||
@@ -1207,7 +1207,7 @@ parse_joybinding (parse_state *state, VCONTROL_GESTURE *gesture)
|
||||
gesture->gesture.button.index = buttonnum;
|
||||
}
|
||||
}
|
||||
else if (!stricmp (state->token, "hat"))
|
||||
else if (!strcasecmp (state->token, "hat"))
|
||||
{
|
||||
int hatnum;
|
||||
consume (state, "hat");
|
||||
@@ -1235,7 +1235,7 @@ static void
|
||||
parse_gesture (parse_state *state, VCONTROL_GESTURE *gesture)
|
||||
{
|
||||
gesture->type = VCONTROL_NONE; /* Default to error */
|
||||
if (!stricmp (state->token, "key"))
|
||||
if (!strcasecmp (state->token, "key"))
|
||||
{
|
||||
/* Parse key binding */
|
||||
int keysym;
|
||||
@@ -1247,7 +1247,7 @@ parse_gesture (parse_state *state, VCONTROL_GESTURE *gesture)
|
||||
gesture->gesture.key = keysym;
|
||||
}
|
||||
}
|
||||
else if (!stricmp (state->token, "joystick"))
|
||||
else if (!strcasecmp (state->token, "joystick"))
|
||||
{
|
||||
parse_joybinding (state, gesture);
|
||||
}
|
||||
|
||||
@@ -82,9 +82,9 @@ str2int (const char *s) {
|
||||
|
||||
static BOOLEAN
|
||||
str2bool (const char *s) {
|
||||
if (!stricmp (s, "yes") ||
|
||||
!stricmp (s, "true") ||
|
||||
!stricmp (s, "1") )
|
||||
if (!strcasecmp (s, "yes") ||
|
||||
!strcasecmp (s, "true") ||
|
||||
!strcasecmp (s, "1") )
|
||||
return TRUE;
|
||||
return FALSE;
|
||||
}
|
||||
@@ -98,13 +98,13 @@ res_IsBoolean (const char *key)
|
||||
d = res_GetString (key);
|
||||
if (!d) return 0;
|
||||
|
||||
return !stricmp (d, "yes") ||
|
||||
!stricmp (d, "no") ||
|
||||
!stricmp (d, "true") ||
|
||||
!stricmp (d, "false") ||
|
||||
!stricmp (d, "0") ||
|
||||
!stricmp (d, "1") ||
|
||||
!stricmp (d, "");
|
||||
return !strcasecmp (d, "yes") ||
|
||||
!strcasecmp (d, "no") ||
|
||||
!strcasecmp (d, "true") ||
|
||||
!strcasecmp (d, "false") ||
|
||||
!strcasecmp (d, "0") ||
|
||||
!strcasecmp (d, "1") ||
|
||||
!strcasecmp (d, "");
|
||||
}
|
||||
|
||||
BOOLEAN
|
||||
|
||||
@@ -155,7 +155,7 @@ DescriptorToInt (const char *descriptor, RESOURCE_DATA *resdata)
|
||||
void
|
||||
DescriptorToBoolean (const char *descriptor, RESOURCE_DATA *resdata)
|
||||
{
|
||||
if (!stricmp (descriptor, "true"))
|
||||
if (!strcasecmp (descriptor, "true"))
|
||||
{
|
||||
resdata->num = TRUE;
|
||||
}
|
||||
|
||||
@@ -169,7 +169,7 @@ GetFleetIndexByFileName (MELEE_STATE *pMS, const char *fileName)
|
||||
pMS->load.entryIndices[index]);
|
||||
const BYTE *entryName = GetDirEntryAddress (entry);
|
||||
|
||||
if (stricmp ((const char *) entryName, fileName) == 0)
|
||||
if (strcasecmp ((const char *) entryName, fileName) == 0)
|
||||
return pMS->load.preBuiltCount + index;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user