mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2024-11-10 15:21:44 +00:00
Minor rewriting.
This commit is contained in:
parent
e49693bec4
commit
317355f7ca
2 changed files with 7 additions and 11 deletions
|
@ -700,13 +700,11 @@ Cmd_AddCommand(char *cmd_name, xcommand_t function)
|
|||
cmd->name = cmd_name;
|
||||
cmd->function = function;
|
||||
|
||||
/* link the command in */
|
||||
for (pos = &cmd_functions; *pos; pos = &(*pos)->next)
|
||||
/* link the command in */
|
||||
pos = &cmd_functions;
|
||||
while (*pos && strcmp((*pos)->name, cmd->name) < 0)
|
||||
{
|
||||
if (strcmp(cmd->name, (*pos)->name) < 0)
|
||||
{
|
||||
break;
|
||||
}
|
||||
pos = &(*pos)->next;
|
||||
}
|
||||
cmd->next = *pos;
|
||||
*pos = cmd;
|
||||
|
|
|
@ -177,12 +177,10 @@ Cvar_Get(char *var_name, char *var_value, int flags)
|
|||
var->value = strtod(var->string, (char **)NULL);
|
||||
|
||||
/* link the variable in */
|
||||
for (pos = &cvar_vars; *pos; pos = &(*pos)->next)
|
||||
pos = &cvar_vars;
|
||||
while (*pos && strcmp((*pos)->name, var->name) < 0)
|
||||
{
|
||||
if (strcmp(var->name, (*pos)->name) < 0)
|
||||
{
|
||||
break;
|
||||
}
|
||||
pos = &(*pos)->next;
|
||||
}
|
||||
var->next = *pos;
|
||||
*pos = var;
|
||||
|
|
Loading…
Reference in a new issue