Even more conversion, lots of superfluous macro removal

This commit is contained in:
iikorni
2026-08-29 23:14:23 -05:00
parent 70e5c02355
commit de75b014b3
102 changed files with 7060 additions and 8179 deletions
+8 -8
View File
@@ -50,7 +50,7 @@ void Cvar_List_f() {
if (command::argc() > 1) {
partial = command::argv(1)->c_str();
len = Q_strlen(partial);
len = std::strlen(partial);
} else {
partial = NULL;
len = 0;
@@ -58,7 +58,7 @@ void Cvar_List_f() {
count = 0;
for (const auto &[name, var]: CLIENT_VARIABLES) {
if (partial && Q_strncmp(partial, name.c_str(), len)) {
if (partial && std::strncmp(partial, name.c_str(), len) != 0) {
continue;
}
Con_SafePrintf("%s%s %s \"%s\"\n",
@@ -91,7 +91,7 @@ void Cvar_Inc_f(void) {
convar::set_value(*command::argv(1), convar::variable_value(*command::argv(1)).value_or(0.0) + 1);
break;
case 3:
convar::set_value(*command::argv(1), convar::variable_value(*command::argv(1)).value_or(0.0) + Q_atof(command::argv(2)->c_str()));
convar::set_value(*command::argv(1), convar::variable_value(*command::argv(1)).value_or(0.0) + std::atof(command::argv(2)->c_str()));
break;
}
}
@@ -136,11 +136,11 @@ void Cvar_Cycle_f() {
//zero is assumed to be a string, even though it could actually be zero. The worst case
//is that the first time you call this command, it won't match on zero when it should, but after that,
//it will be comparing strings that all had the same source (the user) so it will work.
if (Q_atof(command::argv(i)->c_str()) == 0) {
if (std::atof(command::argv(i)->c_str()) == 0) {
if (!strcmp(command::argv(i)->c_str(), convar::variable_string(*command::argv(1)).value_or("").c_str()))
break;
} else {
if (Q_atof(command::argv(i)->c_str()) == convar::variable_value(*command::argv(1)).value_or(0.0))
if (std::atof(command::argv(i)->c_str()) == convar::variable_value(*command::argv(1)).value_or(0.0))
break;
}
}
@@ -341,14 +341,14 @@ void convar::set(const std::string &new_value) {
const std::size_t len = new_value.length();
if (len != Q_strlen(this->string)) {
if (len != std::strlen(this->string)) {
Z_Free((void *) this->string);
this->string = (char *) Z_Malloc(len + 1);
}
memcpy((char *) this->string, new_value.c_str(), len + 1);
}
this->value = Q_atof(this->string);
this->value = std::atof(this->string);
//johnfitz -- save initial value for "reset" command
if (!this->default_string)
@@ -507,7 +507,7 @@ Cvar_Command
Handles variable inspection and changing from the console
============
*/
qboolean Cvar_Command() {
bool Cvar_Command() {
// check variables
auto var = convar::find_var(command::argv(0).value_or(""));
if (!var.has_value())