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
+4 -4
View File
@@ -366,7 +366,7 @@ namespace command {
Sys_Error("Cmd_CheckParm: null input\n");
for (auto i = 1; i < argc(); i++)
if (!q_strcasecmp(parm.c_str(), argv(i)->c_str()))
if (std::is_eq(common::strcasecmp(parm, *argv(i))))
return i;
return 0;
@@ -417,7 +417,7 @@ namespace command {
const auto needle = argv(0).value();
// check functions
for (const auto &[name, ref]: REFS) {
if (!q_strcasecmp(needle.c_str(), name.c_str())) {
if (std::is_eq(common::strcasecmp(needle, name.c_str()))) {
ref.func();
return;
}
@@ -425,7 +425,7 @@ namespace command {
// check alias
for (const auto &[name, alias]: ALIASES) {
if (!q_strcasecmp(argv(0).value().c_str(), name.c_str())) {
if (std::is_eq(common::strcasecmp(argv(0).value().c_str(), name.c_str()))) {
buffer::insert_text(alias.value);
return;
}
@@ -446,7 +446,7 @@ namespace command {
return; // not really connected
cls.message.write_byte(clc_stringcmd);
if (q_strcasecmp(argv(0).value_or("").c_str(), "cmd") != 0) {
if (std::is_eq(common::strcasecmp(argv(0).value_or(""), "cmd"))) {
if (argc() > 1) {
cls.message.write_string(std::format("{} {}", argv(0).value(), args()));
} else {