From: cloudwalk Date: Fri, 16 Oct 2020 22:45:59 +0000 (+0000) Subject: cvar: Whitespace and comment fixes X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=c418294ad2c0ad3a81a115bdd114d7c2b247e2d4;p=xonotic%2Fdarkplaces.git cvar: Whitespace and comment fixes git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@13011 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/cvar.c b/cvar.c index 171bd5f4..0da59c9f 100644 --- a/cvar.c +++ b/cvar.c @@ -568,7 +568,7 @@ void Cvar_RegisterVariable (cvar_t *variable) if (developer_extra.integer) Con_DPrintf("Cvar_RegisterVariable({\"%s\", \"%s\", %i});\n", variable->name, variable->string, variable->flags); -// first check to see if it has already been defined + // first check to see if it has already been defined cvar = Cvar_FindVar(cvars, variable->name, ~0); if (cvar) { @@ -614,14 +614,14 @@ void Cvar_RegisterVariable (cvar_t *variable) return; } -// check for overlap with a command + // check for overlap with a command if (Cmd_Exists(&cmd_client, variable->name) || Cmd_Exists(&cmd_server, variable->name)) { Con_Printf("Cvar_RegisterVariable: %s is a command\n", variable->name); return; } -// copy the value off, because future sets will Z_Free it + // copy the value off, because future sets will Z_Free it oldstr = (char *)variable->string; alloclen = strlen(variable->string) + 1; variable->string = (char *)Z_Malloc (alloclen); @@ -654,7 +654,7 @@ cvar_t *Cvar_Get(cvar_state_t *cvars, const char *name, const char *value, int f if (developer_extra.integer) Con_DPrintf("Cvar_Get(\"%s\", \"%s\", %i);\n", name, value, flags); -// first check to see if it has already been defined + // first check to see if it has already been defined cvar = Cvar_FindVar(cvars, name, ~0); if (cvar) { @@ -673,23 +673,23 @@ cvar_t *Cvar_Get(cvar_state_t *cvars, const char *name, const char *value, int f return cvar; } -// check for pure evil + // check for pure evil if (!*name) { Con_Printf("Cvar_Get: invalid variable name\n"); return NULL; } -// check for overlap with a command + // check for overlap with a command if (Cmd_Exists(&cmd_client, name) || Cmd_Exists(&cmd_server, name)) { Con_Printf("Cvar_Get: %s is a command\n", name); return NULL; } -// allocate a new cvar, cvar name, and cvar string -// TODO: factorize the following code with the one at the end of Cvar_RegisterVariable() -// FIXME: these never get Z_Free'd + // allocate a new cvar, cvar name, and cvar string + // TODO: factorize the following code with the one at the end of Cvar_RegisterVariable() + // FIXME: these never get Z_Free'd cvar = (cvar_t *)Z_Malloc(sizeof(cvar_t)); cvar->flags = flags | CF_ALLOCATED; cvar->name = (char *)Mem_strdup(zonemempool, name); @@ -739,12 +739,12 @@ qbool Cvar_Command (cmd_state_t *cmd) cvar_state_t *cvars = cmd->cvars; cvar_t *v; -// check variables + // check variables v = Cvar_FindVar(cvars, Cmd_Argv(cmd, 0), (cmd->cvars_flagsmask)); if (!v) return false; -// perform a variable print or set + // perform a variable print or set if (Cmd_Argc(cmd) == 1) { Cvar_PrintHelp(v, Cmd_Argv(cmd, 0), true); @@ -753,17 +753,16 @@ qbool Cvar_Command (cmd_state_t *cmd) if (developer_extra.integer) Con_DPrint("Cvar_Command: "); - + if(Cvar_Readonly(v, NULL)) return true; - + Cvar_SetQuick(v, Cmd_Argv(cmd, 1)); if (developer_extra.integer) Con_DPrint("\n"); return true; } - void Cvar_UnlockDefaults(cmd_state_t *cmd) { cvar_state_t *cvars = cmd->cvars; @@ -773,7 +772,6 @@ void Cvar_UnlockDefaults(cmd_state_t *cmd) var->flags &= ~CF_DEFAULTSET; } - void Cvar_LockDefaults_f(cmd_state_t *cmd) { cvar_state_t *cvars = cmd->cvars; @@ -899,7 +897,6 @@ void Cvar_ResetToDefaults_All_f(cmd_state_t *cmd) } } - void Cvar_ResetToDefaults_NoSaveOnly_f(cmd_state_t *cmd) { cvar_state_t *cvars = cmd->cvars; @@ -925,7 +922,6 @@ void Cvar_ResetToDefaults_SaveOnly_f(cmd_state_t *cmd) } } - /* ============ Cvar_WriteVariables @@ -950,7 +946,6 @@ void Cvar_WriteVariables (cvar_state_t *cvars, qfile_t *f) } } - // Added by EvilTypeGuy eviltypeguy@qeradiant.com // 2000-01-09 CvarList command By Matthias "Maddes" Buecher, http://www.inside3d.com/qip/ /*