[PATCH] Misc constification

Sprinkling a few const modifiers about the place. Removes some inconsitencies
between similar QW/NQ function prototypes (probably introduced by me at some
point...)

diff -urN a/NQ/cmd.c head/NQ/cmd.c
--- a/NQ/cmd.c	2006-02-14 17:22:59.000000000 +1030
+++ head/NQ/cmd.c	2006-02-16 16:14:10.000000000 +1030
@@ -91,7 +91,7 @@
 ============
 */
 void
-Cbuf_AddText(char *text)
+Cbuf_AddText(const char *text)
 {
     int l = strlen(text);
 
@@ -394,7 +394,7 @@
 
 typedef struct cmd_function_s {
     struct cmd_function_s *next;
-    char *name;
+    const char *name;
     xcommand_t function;
 } cmd_function_t;
 
@@ -527,7 +527,7 @@
 ============
 */
 void
-Cmd_AddCommand(char *cmd_name, xcommand_t function)
+Cmd_AddCommand(const char *cmd_name, xcommand_t function)
 {
     cmd_function_t *cmd;
 
diff -urN a/NQ/cmd.h head/NQ/cmd.h
--- a/NQ/cmd.h	2006-02-14 17:22:59.000000000 +1030
+++ head/NQ/cmd.h	2006-02-15 11:59:55.000000000 +1030
@@ -44,7 +44,7 @@
 
 // allocates an initial text buffer that will grow as needed
 
-void Cbuf_AddText(char *text);
+void Cbuf_AddText(const char *text);
 
 // as new commands are generated from the console or keybindings,
 // the text is added to the end of the command buffer.
@@ -77,7 +77,8 @@
 
 */
 
-typedef void (*xcommand_t) (void);
+/* Command function */
+typedef void (*xcommand_t)(void);
 
 typedef enum {
     src_client,			// came in over a net connection as a clc_stringcmd
@@ -89,7 +90,7 @@
 
 void Cmd_Init(void);
 
-void Cmd_AddCommand(char *cmd_name, xcommand_t function);
+void Cmd_AddCommand(const char *cmd_name, xcommand_t function);
 
 // called by the init functions of other parts of the program to
 // register commands and functions to call for them.
diff -urN a/NQ/common.c head/NQ/common.c
--- a/NQ/common.c	2006-02-14 17:22:59.000000000 +1030
+++ head/NQ/common.c	2006-02-18 09:52:03.000000000 +1030
@@ -658,13 +658,13 @@
 }
 
 void
-SZ_Write(sizebuf_t *buf, void *data, int length)
+SZ_Write(sizebuf_t *buf, const void *data, int length)
 {
     memcpy(SZ_GetSpace(buf, length), data, length);
 }
 
 void
-SZ_Print(sizebuf_t *buf, char *data)
+SZ_Print(sizebuf_t *buf, const char *data)
 {
     int len;
 
@@ -686,10 +686,10 @@
 COM_SkipPath
 ============
 */
-char *
-COM_SkipPath(char *pathname)
+const char *
+COM_SkipPath(const char *pathname)
 {
-    char *last;
+    const char *last;
 
     last = pathname;
     while (*pathname) {
@@ -706,7 +706,7 @@
 ============
 */
 void
-COM_StripExtension(char *in, char *out)
+COM_StripExtension(const char *in, char *out)
 {
     while (*in && *in != '.')
 	*out++ = *in++;
@@ -768,9 +768,9 @@
 ==================
 */
 void
-COM_DefaultExtension(char *path, char *extension)
+COM_DefaultExtension(char *path, const char *extension)
 {
-    char *src;
+    const char *src;
 
 //
 // if path doesn't have a .EXT, append extension
diff -urN a/NQ/common.h head/NQ/common.h
--- a/NQ/common.h	2006-02-14 17:22:59.000000000 +1030
+++ head/NQ/common.h	2006-02-12 07:24:44.000000000 +1030
@@ -46,8 +46,8 @@
 void SZ_Free(sizebuf_t *buf);
 void SZ_Clear(sizebuf_t *buf);
 void *SZ_GetSpace(sizebuf_t *buf, int length);
-void SZ_Write(sizebuf_t *buf, void *data, int length);
-void SZ_Print(sizebuf_t *buf, char *data);	// strcats onto the sizebuf
+void SZ_Write(sizebuf_t *buf, const void *data, int length);
+void SZ_Print(sizebuf_t *buf, const char *data); // strcats onto the sizebuf
 
 //============================================================================
 
@@ -139,10 +139,10 @@
 void COM_Init(char *path);
 void COM_InitArgv(int argc, char **argv);
 
-char *COM_SkipPath(char *pathname);
-void COM_StripExtension(char *in, char *out);
+const char *COM_SkipPath(const char *pathname);
+void COM_StripExtension(const char *in, char *out);
 void COM_FileBase(const char *in, char *out);
-void COM_DefaultExtension(char *path, char *extension);
+void COM_DefaultExtension(char *path, const char *extension);
 int COM_CheckExtension(const char *path, const char *extn);
 
 char *va(char *format, ...);
diff -urN a/QW/client/cmd.h head/QW/client/cmd.h
--- a/QW/client/cmd.h	2006-02-14 17:22:59.000000000 +1030
+++ head/QW/client/cmd.h	2006-02-16 17:39:20.000000000 +1030
@@ -44,7 +44,7 @@
 
 // allocates an initial text buffer that will grow as needed
 
-void Cbuf_AddText(char *text);
+void Cbuf_AddText(const char *text);
 
 // as new commands are generated from the console or keybindings,
 // the text is added to the end of the command buffer.
@@ -71,11 +71,12 @@
 
 */
 
-typedef void (*xcommand_t) (void);
+/* Command function */
+typedef void (*xcommand_t)(void);
 
 void Cmd_Init(void);
 
-void Cmd_AddCommand(char *cmd_name, xcommand_t function);
+void Cmd_AddCommand(const char *cmd_name, xcommand_t function);
 
 // called by the init functions of other parts of the program to
 // register commands and functions to call for them.
diff -urN a/QW/client/common.h head/QW/client/common.h
--- a/QW/client/common.h	2006-02-14 17:22:59.000000000 +1030
+++ head/QW/client/common.h	2006-02-18 10:02:17.000000000 +1030
@@ -51,8 +51,8 @@
 
 void SZ_Clear(sizebuf_t *buf);
 void *SZ_GetSpace(sizebuf_t *buf, int length);
-void SZ_Write(sizebuf_t *buf, void *data, int length);
-void SZ_Print(sizebuf_t *buf, char *data);	// strcats onto the sizebuf
+void SZ_Write(sizebuf_t *buf, const void *data, int length);
+void SZ_Print(sizebuf_t *buf, const char *data); // strcats onto the sizebuf
 
 //============================================================================
 
@@ -135,8 +135,8 @@
 
 //============================================================================
 
-int Q_atoi(char *str);
-float Q_atof(char *str);
+int Q_atoi(const char *str);
+float Q_atof(const char *str);
 
 //============================================================================
 
diff -urN a/QW/common/cmd.c head/QW/common/cmd.c
--- a/QW/common/cmd.c	2006-02-14 17:22:59.000000000 +1030
+++ head/QW/common/cmd.c	2006-02-18 09:36:13.000000000 +1030
@@ -99,7 +99,7 @@
 ============
 */
 void
-Cbuf_AddText(char *text)
+Cbuf_AddText(const char *text)
 {
     int l;
 
@@ -402,7 +402,7 @@
 
 typedef struct cmd_function_s {
     struct cmd_function_s *next;
-    char *name;
+    const char *name;
     xcommand_t function;
 } cmd_function_t;
 
@@ -535,7 +535,7 @@
 ============
 */
 void
-Cmd_AddCommand(char *cmd_name, xcommand_t function)
+Cmd_AddCommand(const char *cmd_name, xcommand_t function)
 {
     cmd_function_t *cmd;
 
diff -urN a/QW/common/common.c head/QW/common/common.c
--- a/QW/common/common.c	2006-02-14 17:23:00.000000000 +1030
+++ head/QW/common/common.c	2006-02-18 09:53:44.000000000 +1030
@@ -167,7 +167,7 @@
 */
 
 int
-Q_atoi(char *str)
+Q_atoi(const char *str)
 {
     int val;
     int sign;
@@ -219,7 +219,7 @@
 
 
 float
-Q_atof(char *str)
+Q_atof(const char *str)
 {
     double val;
     int sign;
@@ -767,13 +767,13 @@
 }
 
 void
-SZ_Write(sizebuf_t *buf, void *data, int length)
+SZ_Write(sizebuf_t *buf, const void *data, int length)
 {
     memcpy(SZ_GetSpace(buf, length), data, length);
 }
 
 void
-SZ_Print(sizebuf_t *buf, char *data)
+SZ_Print(sizebuf_t *buf, const char *data)
 {
     int len;
 
diff -urN a/common/cvar.c head/common/cvar.c
--- a/common/cvar.c	2006-02-14 17:23:00.000000000 +1030
+++ head/common/cvar.c	2006-02-09 20:08:52.000000000 +1030
@@ -52,7 +52,7 @@
 ============
 */
 cvar_t *
-Cvar_FindVar(char *var_name)
+Cvar_FindVar(const char *var_name)
 {
     cvar_t *var;
 
@@ -86,7 +86,7 @@
 ============
 */
 char *
-Cvar_VariableString(char *var_name)
+Cvar_VariableString(const char *var_name)
 {
     cvar_t *var;
 
diff -urN a/include/cvar.h head/include/cvar.h
--- a/include/cvar.h	2006-02-14 17:23:00.000000000 +1030
+++ head/include/cvar.h	2006-02-09 20:08:45.000000000 +1030
@@ -119,7 +119,7 @@
 float Cvar_VariableValue(char *var_name);
 
 /* returns an empty string if not defined */
-char *Cvar_VariableString(char *var_name);
+char *Cvar_VariableString(const char *var_name);
 
 /*
  * attempts to match a partial variable name for command line completion
@@ -142,7 +142,7 @@
 void Cvar_WriteVariables(FILE *f);
 
 /* */
-cvar_t *Cvar_FindVar(char *var_name);
+cvar_t *Cvar_FindVar(const char *var_name);
 
 extern cvar_t *cvar_vars;
 
