]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
some typo fixes, + unalias command
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 16 Jul 2009 19:44:18 +0000 (19:44 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 16 Jul 2009 19:44:18 +0000 (19:44 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9060 d7cf8633-e32d-0410-b094-e92efae38249

cmd.c
libcurl.c
model_shared.c
sbar.c
zone.c

diff --git a/cmd.c b/cmd.c
index 391b0c7b0a4eed5cfd4a169536d6f5e8179b2778..476ec67b549136595865a3954e116f269c1beb53 100644 (file)
--- a/cmd.c
+++ b/cmd.c
@@ -666,6 +666,47 @@ static void Cmd_Alias_f (void)
        memcpy (a->value, cmd, alloclen);
 }
 
+/*
+===============
+Cmd_UnAlias_f
+
+Remove existing aliases.
+===============
+*/
+static void Cmd_UnAlias_f (void)
+{
+       cmdalias_t      *a, *p;
+       int i;
+       const char *s;
+
+       if(Cmd_Argc() == 1)
+       {
+               Con_Print("unalias: Usage: unalias alias1 [alias2 ...]\n");
+               return;
+       }
+
+       for(i = 1; i < Cmd_Argc(); ++i)
+       {
+               s = Cmd_Argv(i);
+               p = NULL;
+               for(a = cmd_alias; a; p = a, a = a->next)
+               {
+                       if(!strcmp(s, a->name))
+                       {
+                               if(a == cmd_alias)
+                                       cmd_alias = a->next;
+                               if(p)
+                                       p->next = a->next;
+                               Z_Free(a->value);
+                               Z_Free(a);
+                               break;
+                       }
+               }
+               if(!a)
+                       Con_Printf("unalias: %s alias not found\n", s);
+       }
+}
+
 /*
 =============================================================================
 
@@ -1141,6 +1182,7 @@ void Cmd_Init_Commands (void)
        Cmd_AddCommand ("exec",Cmd_Exec_f, "execute a script file");
        Cmd_AddCommand ("echo",Cmd_Echo_f, "print a message to the console (useful in scripts)");
        Cmd_AddCommand ("alias",Cmd_Alias_f, "create a script function (parameters are passed in as $X (being X a number), $* for all parameters, $X- for all parameters starting from $X). Without arguments show the list of all alias");
+       Cmd_AddCommand ("unalias",Cmd_UnAlias_f, "remove an alias");
        Cmd_AddCommand ("cmd", Cmd_ForwardToServer, "send a console commandline to the server (used by some mods)");
        Cmd_AddCommand ("wait", Cmd_Wait_f, "make script execution wait for next rendered frame");
        Cmd_AddCommand ("set", Cvar_Set_f, "create or change the value of a console variable");
index f7947b370a09ec2e42169ebe9f21f5dbb2f49978..0d3f6c7c061ae5c62baf58b20632a4a10b2371f5 100644 (file)
--- a/libcurl.c
+++ b/libcurl.c
@@ -795,7 +795,7 @@ static qboolean Curl_Begin(const char *URL, const char *name, qboolean ispak, qb
                // URL scheme (so one can't read local files using file://)
                if(strncmp(URL, "http://", 7) && strncmp(URL, "ftp://", 6) && strncmp(URL, "https://", 8))
                {
-                       Con_Printf("Curl_Begin(\"%s\")): nasty URL scheme rejected\n", URL);
+                       Con_Printf("Curl_Begin(\"%s\"): nasty URL scheme rejected\n", URL);
                        return false;
                }
 
index d76ac1d47c4b55e492d49185bcdf3ec0d1d690d5..91e63ad033f894e2df0f9a472473a3dafe4cd358 100644 (file)
@@ -425,8 +425,10 @@ dp_model_t *Mod_LoadModel(dp_model_t *mod, qboolean crash, qboolean checkdisk)
 
                buf = FS_LoadFile (va("%s.framegroups", mod->name), tempmempool, false, &filesize);
                if(buf)
+               {
                        Mod_FrameGroupify(mod, buf);
-               Mem_Free(buf);
+                       Mem_Free(buf);
+               }
 
                Mod_BuildVBOs();
        }
diff --git a/sbar.c b/sbar.c
index 6dc02b9882047ebcc5e27767ebcabb446ce79ba2..2ef95dfbf944f917ba9bb69f9cf1f9074f8e5d51 100644 (file)
--- a/sbar.c
+++ b/sbar.c
@@ -1138,7 +1138,7 @@ void Sbar_ShowFPS(void)
        if (showdate.integer)
                strlcpy(datestring, Sys_TimeString(showdate_format.string), sizeof(datestring));
        if (showsound.integer)
-               dpsnprintf(soundstring, sizeof(soundstring), "%4i/%4i at %3ims\n", cls.soundstats.mixedsounds, cls.soundstats.totalsounds, cls.soundstats.latency_milliseconds);
+               dpsnprintf(soundstring, sizeof(soundstring), "%4i/4%i at %3ims", cls.soundstats.mixedsounds, cls.soundstats.totalsounds, cls.soundstats.latency_milliseconds);
        if (showspeed.integer || showtopspeed.integer)
        {
                double speed, speedxy, f;
diff --git a/zone.c b/zone.c
index 37e06f5dc9fd99d16f3434a2870537df6d6b0d83..688a958e194934ec24e1d96b8416a4c9ee0e3359 100644 (file)
--- a/zone.c
+++ b/zone.c
@@ -249,7 +249,7 @@ void _Mem_Free(void *data, const char *filename, int fileline)
 {
        if (data == NULL)
        {
-               Con_DPrintf("Mem_Free: data == NULL (called at %s:%i)", filename, fileline);
+               Con_DPrintf("Mem_Free: data == NULL (called at %s:%i)\n", filename, fileline);
                return;
        }