]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - common.c
Fix compiler warning in custom stat clearing
[xonotic/darkplaces.git] / common.c
index 9b7dd101926608013114dfe71e685c536b2a9445..090f097088e0a471390597b82cff9befd0bd3b6c 100644 (file)
--- a/common.c
+++ b/common.c
@@ -28,8 +28,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 #include "quakedef.h"
 #include "utf8lib.h"
 
-cvar_t registered = {0, "registered","0", "indicates if this is running registered quake (whether gfx/pop.lmp was found)"};
-cvar_t cmdline = {0, "cmdline","0", "contains commandline the engine was launched with"};
+cvar_t registered = {CVAR_CLIENT | CVAR_SERVER, "registered","0", "indicates if this is running registered quake (whether gfx/pop.lmp was found)"};
+cvar_t cmdline = {CVAR_CLIENT | CVAR_SERVER, "cmdline","0", "contains commandline the engine was launched with"};
 
 char com_token[MAX_INPUTLINE];
 int com_argc;
@@ -1645,7 +1645,7 @@ void COM_Init_Commands (void)
                        break;
        }
        com_cmdline[n] = 0;
-       Cvar_Set ("cmdline", com_cmdline);
+       Cvar_SetQuick(&cmdline, com_cmdline);
 }
 
 /*
@@ -1879,7 +1879,7 @@ COM_StringLengthNoColors(const char *s, size_t size_s, qboolean *valid)
                {
                        case 0:
                                if(valid)
-                                       *valid = TRUE;
+                                       *valid = true;
                                return len;
                        case STRING_COLOR_TAG:
                                ++s;
@@ -1899,7 +1899,7 @@ COM_StringLengthNoColors(const char *s, size_t size_s, qboolean *valid)
                                        case 0: // ends with unfinished color code!
                                                ++len;
                                                if(valid)
-                                                       *valid = FALSE;
+                                                       *valid = false;
                                                return len;
                                        case STRING_COLOR_TAG: // escaped ^
                                                ++len;
@@ -1945,17 +1945,17 @@ all characters until the zero terminator.
 qboolean
 COM_StringDecolorize(const char *in, size_t size_in, char *out, size_t size_out, qboolean escape_carets)
 {
-#define APPEND(ch) do { if(--size_out) { *out++ = (ch); } else { *out++ = 0; return FALSE; } } while(0)
+#define APPEND(ch) do { if(--size_out) { *out++ = (ch); } else { *out++ = 0; return false; } } while(0)
        const char *end = size_in ? (in + size_in) : NULL;
        if(size_out < 1)
-               return FALSE;
+               return false;
        for(;;)
        {
                switch((in == end) ? 0 : *in)
                {
                        case 0:
                                *out++ = 0;
-                               return TRUE;
+                               return true;
                        case STRING_COLOR_TAG:
                                ++in;
                                switch((in == end) ? 0 : *in)
@@ -1979,7 +1979,7 @@ COM_StringDecolorize(const char *in, size_t size_in, char *out, size_t size_out,
                                                if(escape_carets)
                                                        APPEND(STRING_COLOR_TAG);
                                                *out++ = 0;
-                                               return TRUE;
+                                               return true;
                                        case STRING_COLOR_TAG: // escaped ^
                                                APPEND(STRING_COLOR_TAG);
                                                // append a ^ twice when escaping