Change up strcasecmp/strncasecmp to be more C++y

This commit is contained in:
iikorni
2026-08-30 16:40:12 -05:00
parent 7a697986c6
commit da2a9a8fbc
32 changed files with 351 additions and 790 deletions
+7 -7
View File
@@ -101,7 +101,7 @@ static void NET_Ban_f(void) {
break;
case 2:
if (q_strcasecmp(command::argv(1)->c_str(), "off") == 0)
if (std::is_eq(common::strcasecmp(command::argv(1)->c_str(), "off")))
banAddr.s_addr = INADDR_ANY;
else
banAddr.s_addr = inet_addr(command::argv(1)->c_str());
@@ -419,13 +419,13 @@ static void NET_Stats_f(void) {
PrintStats(s);
} else {
for (s = net_activeSockets; s; s = s->next) {
if (q_strcasecmp(command::argv(1)->c_str(), s->address) == 0)
if (std::is_eq(common::strcasecmp(command::argv(1)->c_str(), s->address)))
break;
}
if (s == NULL) {
for (s = net_freeSockets; s; s = s->next) {
if (q_strcasecmp(command::argv(1)->c_str(), s->address) == 0)
if (std::is_eq(common::strcasecmp(command::argv(1)->c_str(), s->address)))
break;
}
}
@@ -538,7 +538,7 @@ static void Test_f(void) {
if (host && hostCacheCount) {
for (n = 0; n < hostCacheCount; n++) {
if (q_strcasecmp(host, hostcache[n].name) == 0) {
if (std::is_eq(common::strcasecmp(host, hostcache[n].name))) {
if (hostcache[n].driver != myDriverLevel)
continue;
net_landriverlevel = hostcache[n].ldriver;
@@ -670,7 +670,7 @@ static void Test2_f(void) {
if (host && hostCacheCount) {
for (n = 0; n < hostCacheCount; n++) {
if (q_strcasecmp(host, hostcache[n].name) == 0) {
if (std::is_eq(common::strcasecmp(host, hostcache[n].name))) {
if (hostcache[n].driver != myDriverLevel)
continue;
net_landriverlevel = hostcache[n].ldriver;
@@ -729,7 +729,7 @@ int Datagram_Init(void) {
command::add("net_stats", NET_Stats_f);
if (safemode || common::check_param("-nolan").has_value())
if (common::safe_mode || common::check_param("-nolan").has_value())
return -1;
num_inited = 0;
@@ -1109,7 +1109,7 @@ static void _Datagram_SearchForHosts(bool xmit) {
for (i = 0; i < hostCacheCount; i++) {
if (i == n)
continue;
if (q_strcasecmp(hostcache[n].name, hostcache[i].name) == 0) {
if (std::is_eq(common::strcasecmp(hostcache[n].name, hostcache[i].name))) {
i = std::strlen(hostcache[n].name);
if (i < 15 && hostcache[n].name[i - 1] > '8') {
hostcache[n].name[i] = '0';