Change up strcasecmp/strncasecmp to be more C++y
This commit is contained in:
+7
-7
@@ -72,7 +72,7 @@ static void FileList_Add(const char *name, filelist_item_t **list) {
|
||||
|
||||
// insert each entry in alphabetical order
|
||||
if (*list == NULL ||
|
||||
q_strcasecmp(item->name, (*list)->name) < 0) //insert at front
|
||||
is_lt(common::strcasecmp(item->name, (*list)->name))) //insert at front
|
||||
{
|
||||
item->next = *list;
|
||||
*list = item;
|
||||
@@ -80,7 +80,7 @@ static void FileList_Add(const char *name, filelist_item_t **list) {
|
||||
{
|
||||
prev = *list;
|
||||
cursor = (*list)->next;
|
||||
while (cursor && (q_strcasecmp(item->name, cursor->name) > 0)) {
|
||||
while (cursor && (is_gt(common::strcasecmp(item->name, cursor->name)))) {
|
||||
prev = cursor;
|
||||
cursor = cursor->next;
|
||||
}
|
||||
@@ -143,7 +143,7 @@ void ExtraMaps_Init(void) {
|
||||
if (dir_p == NULL)
|
||||
continue;
|
||||
while ((dir_t = readdir(dir_p)) != NULL) {
|
||||
if (q_strcasecmp(COM_FileGetExtension(dir_t->d_name), "bsp") != 0)
|
||||
if (std::is_neq(common::strcasecmp(COM_FileGetExtension(dir_t->d_name), "bsp")))
|
||||
continue;
|
||||
COM_StripExtension(dir_t->d_name, mapname, sizeof(mapname));
|
||||
ExtraMaps_Add(mapname);
|
||||
@@ -244,7 +244,7 @@ void Modlist_Init(void) {
|
||||
while ((dir_t = readdir(dir_p)) != NULL) {
|
||||
if (!strcmp(dir_t->d_name, ".") || !strcmp(dir_t->d_name, ".."))
|
||||
continue;
|
||||
if (!q_strcasecmp(COM_FileGetExtension(dir_t->d_name), "app")) // skip .app bundles on macOS
|
||||
if (std::is_eq(common::strcasecmp(COM_FileGetExtension(dir_t->d_name), "app"))) // skip .app bundles on macOS
|
||||
continue;
|
||||
q_snprintf(mod_string, sizeof(mod_string), "%s%s/", dir_string, dir_t->d_name);
|
||||
mod_dir_p = opendir(mod_string);
|
||||
@@ -313,7 +313,7 @@ void DemoList_Init(void) {
|
||||
if (dir_p == NULL)
|
||||
continue;
|
||||
while ((dir_t = readdir(dir_p)) != NULL) {
|
||||
if (q_strcasecmp(COM_FileGetExtension(dir_t->d_name), "dem") != 0)
|
||||
if (std::is_neq(common::strcasecmp(COM_FileGetExtension(dir_t->d_name), "dem")))
|
||||
continue;
|
||||
COM_StripExtension(dir_t->d_name, demname, sizeof(demname));
|
||||
FileList_Add(demname, &demolist);
|
||||
@@ -1332,7 +1332,7 @@ static void Host_Tell_f(void) {
|
||||
for (j = 0, client = svs.clients; j < svs.maxclients; j++, client++) {
|
||||
if (!client->active || !client->spawned)
|
||||
continue;
|
||||
if (q_strcasecmp(client->name, command::argv(1)->c_str()))
|
||||
if (std::is_neq(common::strcasecmp(client->name, command::argv(1)->c_str())))
|
||||
continue;
|
||||
host_client = client;
|
||||
SV_ClientPrintf("%s", text);
|
||||
@@ -1632,7 +1632,7 @@ static void Host_Kick_f(void) {
|
||||
for (i = 0, host_client = svs.clients; i < svs.maxclients; i++, host_client++) {
|
||||
if (!host_client->active)
|
||||
continue;
|
||||
if (q_strcasecmp(host_client->name, command::argv(1).value_or("").c_str()) == 0)
|
||||
if (std::is_eq(common::strcasecmp(host_client->name, command::argv(1).value_or("").c_str())))
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user