Clean up some unused or local functions.

This commit is contained in:
Bill Currie 2012-08-13 15:03:40 +09:00
parent ae81b79390
commit 6e1f043719
4 changed files with 13 additions and 71 deletions

View file

@ -80,7 +80,6 @@ struct cbuf_interpreter_s *Cmd_GetProvider(const char *name);
extern struct cbuf_args_s *cmd_args;
extern struct cvar_s *cmd_warncmd;
extern cmd_function_t *cmd_functions; // possible commands to execute
//@}

View file

@ -102,25 +102,15 @@ cvar_t *Cvar_RemoveAlias (const char *name);
void Cvar_Set (cvar_t *var, const char *value);
void Cvar_SetValue (cvar_t *var, float value);
// sets a CVAR_ROM variable from within the engine
void Cvar_SetROM (cvar_t *var, const char *value);
// allows you to change a Cvar's flags without a full Cvar_Get
void Cvar_SetFlags (cvar_t *var, int cvarflags);
// reset a Cvar to its default setting
void Cvar_Reset (cvar_t *var);
// returns 0 if not defined or non numeric
float Cvar_VariableValue (const char *var_name);
// returns an empty string if not defined
const char *Cvar_VariableString (const char *var_name);
// attempts to match a partial variable name for command line completion
// returns NULL if nothing fits
const char *Cvar_CompleteVariable (const char *partial);
// called by Cmd_ExecuteString when Cmd_Argv(0) doesn't match a known
// command. Returns true if the command was a variable reference that
// was handled. (print or change)
@ -130,6 +120,10 @@ qboolean Cvar_Command (void);
// with the archive flag set to true.
void Cvar_WriteVariables (QFile *f);
// attempts to match a partial variable name for command line completion
// returns NULL if nothing fits
const char *Cvar_CompleteVariable (const char *partial);
// Added by EvilTypeGuy - functions for tab completion system
// Thanks to Fett erich@heintz.com
// Thanks to taniwha
@ -142,8 +136,6 @@ cvar_t *Cvar_FindVar (const char *var_name);
void Cvar_Init_Hash (void);
void Cvar_Init (void);
void Cvar_Shutdown (void);
extern cvar_t *cvar_vars;
//@}

View file

@ -78,7 +78,7 @@ VISIBLE cmd_source_t cmd_source;
/* Command parsing functions */
VISIBLE cmd_function_t *cmd_functions; // possible commands to execute
static cmd_function_t *cmd_functions; // possible commands to execute
VISIBLE int
Cmd_Argc (void)

View file

@ -278,31 +278,6 @@ Cvar_Set (cvar_t *var, const char *value)
var->callback (var);
}
/*
Cvar_SetROM
doesn't check for CVAR_ROM flag
*/
void
Cvar_SetROM (cvar_t *var, const char *value)
{
int changed;
if (!var)
return;
changed = !strequal (var->string, value);
free ((char*)var->string); // free the old value string
var->string = strdup (value);
var->value = atof (var->string);
var->int_val = atoi (var->string);
sscanf (var->string, "%f %f %f", &var->vec[0], &var->vec[1], &var->vec[2]);
if (changed && var->callback)
var->callback (var);
}
VISIBLE void
Cvar_SetValue (cvar_t *var, float value)
{
@ -500,6 +475,12 @@ Cvar_Cycle_f (void)
Cvar_Set (var, Cmd_Argv (i + 1)); // matched earlier in list
}
static void
Cvar_Reset (cvar_t *var)
{
Cvar_Set (var, var->default_string);
}
static void
Cvar_Reset_f (void)
{
@ -524,7 +505,8 @@ Cvar_Reset_f (void)
}
}
static void Cvar_ResetAll_f (void)
static void
Cvar_ResetAll_f (void)
{
cvar_t *var;
@ -625,31 +607,6 @@ Cvar_Init (void)
Cmd_AddCommand ("resetall", Cvar_ResetAll_f, "Reset all cvars");
}
void
Cvar_Shutdown (void)
{
cvar_t *var, *next;
cvar_alias_t *alias, *nextalias;
// Free cvars
var = cvar_vars;
while (var) {
next = var->next;
free ((char*)var->string);
free ((char*)var->name);
free (var);
var = next;
}
// Free aliases
alias = calias_vars;
while (alias) {
nextalias = alias->next;
free ((char*)alias->name);
free (alias);
alias = nextalias;
}
}
VISIBLE cvar_t *
Cvar_Get (const char *name, const char *string, int cvarflags,
void (*callback)(cvar_t*), const char *description)
@ -716,9 +673,3 @@ Cvar_SetFlags (cvar_t *var, int cvarflags)
var->flags = cvarflags;
}
VISIBLE void
Cvar_Reset (cvar_t *var)
{
Cvar_Set (var, var->default_string);
}