<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">[PATCH] Various cosmetic changes

Mostly just removing redundant comments and trying to keep the NQ/QW diffs to
a minimum. Also removed a couple of mostly useless Con_DPrintfs and properly
exported Con_ShowTree in console.h.

diff -urN b/NQ/common.c head/NQ/common.c
--- b/NQ/common.c	2006-02-18 10:55:26.000000000 +1030
+++ head/NQ/common.c	2006-02-18 09:52:03.000000000 +1030
@@ -670,11 +670,10 @@
 
     len = strlen(data) + 1;
 
-// byte * cast to keep VC++ happy
     if (buf-&gt;data[buf-&gt;cursize - 1])
-	memcpy((byte *)SZ_GetSpace(buf, len), data, len);	// no trailing 0
+	memcpy(SZ_GetSpace(buf, len), data, len);	// no trailing 0
     else
-	memcpy((byte *)SZ_GetSpace(buf, len - 1) - 1, data, len);	// write over trailing 0
+	memcpy(SZ_GetSpace(buf, len - 1) - 1, data, len);	// write over trailing 0
 }
 
 
@@ -777,13 +776,11 @@
 // (extension should include the .)
 //
     src = path + strlen(path) - 1;
-
     while (*src != '/' &amp;&amp; src != path) {
 	if (*src == '.')
 	    return;		// it has an extension
 	src--;
     }
-
     strcat(path, extension);
 }
 
@@ -1107,7 +1104,7 @@
     int dirlen;
 } dpackheader_t;
 
-#define MAX_FILES_IN_PACK       2048
+#define MAX_FILES_IN_PACK 2048
 
 char com_cachedir[MAX_OSPATH];
 char com_gamedir[MAX_OSPATH];
@@ -1473,7 +1470,7 @@
 
 Filename are reletive to the quake directory.
 Optionally return length; set null if you don't want it.
-Allways appends a 0 byte.
+Always appends a 0 byte to the loaded data.
 ============
 */
 cache_user_t *loadcache;
diff -urN b/QW/common/cmd.c head/QW/common/cmd.c
--- b/QW/common/cmd.c	2006-02-18 10:55:26.000000000 +1030
+++ head/QW/common/cmd.c	2006-02-18 09:36:13.000000000 +1030
@@ -162,7 +162,7 @@
     int quotes;
 
     while (cmd_text.cursize) {
-// find a \n or ; line break
+	/* find a \n or ; line break */
 	text = (char *)cmd_text.data;
 
 	quotes = 0;
@@ -170,16 +170,18 @@
 	    if (text[i] == '"')
 		quotes++;
 	    if (!(quotes &amp; 1) &amp;&amp; text[i] == ';')
-		break;		// don't break if inside a quoted string
+		break;		/* don't break if inside a quoted string */
 	    if (text[i] == '\n')
 		break;
 	}
 	memcpy(line, text, i);
 	line[i] = 0;
 
-// delete the text from the command buffer and move remaining commands down
-// this is necessary because commands (exec, alias) can insert data at the
-// beginning of the text buffer
+	/*
+	 * delete the text from the command buffer and move remaining commands
+	 * down this is necessary because commands (exec, alias) can insert
+	 * data at the beginning of the text buffer
+	 */
 
 	if (i == cmd_text.cursize)
 	    cmd_text.cursize = 0;
@@ -189,11 +191,14 @@
 	    memcpy(text, text + i, cmd_text.cursize);
 	}
 
-// execute the command line
+	/* execute the command line */
 	Cmd_ExecuteString(line);
 
-	if (cmd_wait) {		// skip out while text still remains in buffer, leaving it
-	    // for next frame
+	if (cmd_wait) {
+	    /*
+	     * skip out while text still remains in buffer, leaving it for
+	     * next frame
+	     */
 	    cmd_wait = false;
 	    break;
 	}
@@ -203,7 +208,7 @@
 /*
 ==============================================================================
 
-						SCRIPT COMMANDS
+				SCRIPT COMMANDS
 
 ==============================================================================
 */
diff -urN b/QW/common/common.c head/QW/common/common.c
--- b/QW/common/common.c	2006-02-18 10:55:26.000000000 +1030
+++ head/QW/common/common.c	2006-02-18 09:53:44.000000000 +1030
@@ -77,22 +77,22 @@
 /* FIXME - remove this and checks like it; no need to be registered... */
 // this graphic needs to be in the pak file to use registered features
 static unsigned short pop[] = {
-    0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
-    0x0000, 0x6600, 0x0000, 0x0000, 0x0000, 0x6600, 0x0000, 0x0000,
-    0x0066, 0x0000, 0x0000, 0x0000, 0x0000, 0x0067, 0x0000, 0x0000,
-    0x6665, 0x0000, 0x0000, 0x0000, 0x0000, 0x0065, 0x6600, 0x0063,
-    0x6561, 0x0000, 0x0000, 0x0000, 0x0000, 0x0061, 0x6563, 0x0064,
-    0x6561, 0x0000, 0x0000, 0x0000, 0x0000, 0x0061, 0x6564, 0x0064,
-    0x6564, 0x0000, 0x6469, 0x6969, 0x6400, 0x0064, 0x6564, 0x0063,
-    0x6568, 0x6200, 0x0064, 0x6864, 0x0000, 0x6268, 0x6563, 0x0000,
-    0x6567, 0x6963, 0x0064, 0x6764, 0x0063, 0x6967, 0x6500, 0x0000,
-    0x6266, 0x6769, 0x6a68, 0x6768, 0x6a69, 0x6766, 0x6200, 0x0000,
-    0x0062, 0x6566, 0x6666, 0x6666, 0x6666, 0x6562, 0x0000, 0x0000,
-    0x0000, 0x0062, 0x6364, 0x6664, 0x6362, 0x0000, 0x0000, 0x0000,
-    0x0000, 0x0000, 0x0062, 0x6662, 0x0000, 0x0000, 0x0000, 0x0000,
-    0x0000, 0x0000, 0x0061, 0x6661, 0x0000, 0x0000, 0x0000, 0x0000,
-    0x0000, 0x0000, 0x0000, 0x6500, 0x0000, 0x0000, 0x0000, 0x0000,
-    0x0000, 0x0000, 0x0000, 0x6400, 0x0000, 0x0000, 0x0000
+    0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+    0x0000, 0x0000, 0x6600, 0x0000, 0x0000, 0x0000, 0x6600, 0x0000,
+    0x0000, 0x0066, 0x0000, 0x0000, 0x0000, 0x0000, 0x0067, 0x0000,
+    0x0000, 0x6665, 0x0000, 0x0000, 0x0000, 0x0000, 0x0065, 0x6600,
+    0x0063, 0x6561, 0x0000, 0x0000, 0x0000, 0x0000, 0x0061, 0x6563,
+    0x0064, 0x6561, 0x0000, 0x0000, 0x0000, 0x0000, 0x0061, 0x6564,
+    0x0064, 0x6564, 0x0000, 0x6469, 0x6969, 0x6400, 0x0064, 0x6564,
+    0x0063, 0x6568, 0x6200, 0x0064, 0x6864, 0x0000, 0x6268, 0x6563,
+    0x0000, 0x6567, 0x6963, 0x0064, 0x6764, 0x0063, 0x6967, 0x6500,
+    0x0000, 0x6266, 0x6769, 0x6a68, 0x6768, 0x6a69, 0x6766, 0x6200,
+    0x0000, 0x0062, 0x6566, 0x6666, 0x6666, 0x6666, 0x6562, 0x0000,
+    0x0000, 0x0000, 0x0062, 0x6364, 0x6664, 0x6362, 0x0000, 0x0000,
+    0x0000, 0x0000, 0x0000, 0x0062, 0x6662, 0x0000, 0x0000, 0x0000,
+    0x0000, 0x0000, 0x0000, 0x0061, 0x6661, 0x0000, 0x0000, 0x0000,
+    0x0000, 0x0000, 0x0000, 0x0000, 0x6500, 0x0000, 0x0000, 0x0000,
+    0x0000, 0x0000, 0x0000, 0x0000, 0x6400, 0x0000, 0x0000, 0x0000
 };
 
 /*
@@ -345,7 +345,6 @@
 	byte b[4];
     } dat1, dat2;
 
-
     dat1.f = f;
     dat2.b[0] = dat1.b[3];
     dat2.b[1] = dat1.b[2];
@@ -436,7 +435,6 @@
 	int l;
     } dat;
 
-
     dat.f = f;
     dat.l = LittleLong(dat.l);
 
@@ -780,9 +778,9 @@
     len = strlen(data) + 1;
 
     if (!buf-&gt;cursize || buf-&gt;data[buf-&gt;cursize - 1])
-	memcpy((byte *)SZ_GetSpace(buf, len), data, len);	// no trailing 0
+	memcpy(SZ_GetSpace(buf, len), data, len);	// no trailing 0
     else
-	memcpy((byte *)SZ_GetSpace(buf, len - 1) - 1, data, len);	// write over trailing 0
+	memcpy(SZ_GetSpace(buf, len - 1) - 1, data, len);	// write over trailing 0
 }
 
 
@@ -1041,7 +1039,6 @@
 }
 
 
-
 /*
 ================
 COM_InitArgv
@@ -1190,7 +1187,7 @@
     int dirlen;
 } dpackheader_t;
 
-#define	MAX_FILES_IN_PACK	2048
+#define MAX_FILES_IN_PACK 2048
 
 char com_gamedir[MAX_OSPATH];
 char com_basedir[MAX_OSPATH];
@@ -1514,7 +1511,7 @@
 COM_LoadFile
 
 Filename are reletive to the quake directory.
-Allways appends a 0 byte to the loaded data.
+Always appends a 0 byte to the loaded data.
 ============
 */
 cache_user_t *loadcache;
diff -urN b/common/console.c head/common/console.c
--- b/common/console.c	2006-02-08 18:19:39.000000000 +1030
+++ head/common/console.c	2006-02-15 11:46:05.000000000 +1030
@@ -725,7 +725,8 @@
     }
 }
 
-void Con_ShowTree(struct rb_string_root *root)
+void
+Con_ShowTree(struct rb_string_root *root)
 {
     /* FIXME - cheating with malloc */
     showtree_list = malloc(root-&gt;entries * sizeof(char *));
diff -urN b/common/gl_vidlinuxglx.c head/common/gl_vidlinuxglx.c
--- b/common/gl_vidlinuxglx.c	2006-02-14 17:23:00.000000000 +1030
+++ head/common/gl_vidlinuxglx.c	2006-01-17 20:22:11.000000000 +1030
@@ -1,3 +1,4 @@
+
 /*
 Copyright (C) 1996-1997 Id Software, Inc.
 
@@ -468,6 +469,10 @@
     signal(SIGTERM, signal_handler);
 }
 
+/*
+ * VID_ShiftPalette
+ * - Updates hardware gamma
+ */
 void
 VID_ShiftPalette(unsigned char *p)
 {
@@ -497,15 +502,11 @@
 	b = pal[2];
 	pal += 3;
 
-	// FIXME - endian issuse? (Carmack/Zoid left this here...)
-	//v = (255&lt;&lt;24) + (r&lt;&lt;16) + (g&lt;&lt;8) + (b&lt;&lt;0);
-	//v = (255&lt;&lt;0) + (r&lt;&lt;8) + (g&lt;&lt;16) + (b&lt;&lt;24);
 	v = (255 &lt;&lt; 24) + (r &lt;&lt; 0) + (g &lt;&lt; 8) + (b &lt;&lt; 16);
 	*table++ = v;
     }
     d_8to24table[255] &amp;= 0xffffff;	// 255 is transparent
 
-    // FIXME - cache to disk like old QW client?
     for (i = 0; i &lt; (1 &lt;&lt; 15); i++) {
 	/*
 	 * Maps
@@ -535,7 +536,7 @@
 void
 CheckMultiTextureExtensions(void)
 {
-    // FIXME - space at end of string? Check properly...
+    // FIXME - no space at end of string? Check properly...
     gl_mtexable = false;
     if (!COM_CheckParm("-nomtex")
 	&amp;&amp; strstr(gl_extensions, "GL_ARB_multitexture ")) {
@@ -606,11 +607,8 @@
     gl_extensions = glGetString(GL_EXTENSIONS);
     Con_Printf("GL_EXTENSIONS: %s\n", gl_extensions);
 
-//      Con_Printf ("%s %s\n", gl_renderer, gl_version);
-
     CheckMultiTextureExtensions();
 
-    //glClearColor (1, 0, 0, 0);
     glClearColor(0.5, 0.5, 0.5, 0);
     glCullFace(GL_FRONT);
     glEnable(GL_TEXTURE_2D);
@@ -643,10 +641,6 @@
     *x = *y = 0;
     *width = scr_width;
     *height = scr_height;
-
-    // FIXME?
-    //    if (!wglMakeCurrent( maindc, baseRC ))
-    //        Sys_Error ("wglMakeCurrent failed");
 }
 
 
@@ -714,7 +708,8 @@
     }
 }
 
-/* FIXME - re-enable?
+#if 0
+/* FIXME - re-enable? */
 static void
 Check_Gamma (unsigned char *pal)
 {
@@ -746,7 +741,7 @@
 
     memcpy(pal, palette, sizeof(palette));
 }
-*/
+#endif
 
 static void
 VID_InitCvars(void)
diff -urN b/common/keys.c head/common/keys.c
--- b/common/keys.c	2006-02-14 17:23:00.000000000 +1030
+++ head/common/keys.c	2006-02-15 14:44:59.000000000 +1030
@@ -164,7 +164,8 @@
 
 /*
  * Given a command buffer, return a pointer to the start of the current
- * command string (i.e. search backwards for a command delimiter)
+ * command string. Only simple for now (i.e. search backwards for a command
+ * delimiter), but proper parsing of quotation, etc needed later...
  */
 static char *
 GetCommandPos(char *buf)
@@ -192,7 +193,6 @@
     char *s;
     int i;
 
-    Con_DPrintf("CheckForCommand: --%s--\n", key_lines[edit_line]);
     s = key_lines[edit_line] + 1;	// skip the ]
 
     for (i = 0; i &lt; 127; i++)
diff -urN b/common/shell.c head/common/shell.c
--- b/common/shell.c	2006-02-14 17:23:00.000000000 +1030
+++ head/common/shell.c	2006-02-15 14:47:30.000000000 +1030
@@ -87,7 +87,6 @@
 	 * Cache_FreeHigh, so maybe only do it if wasting more than that
 	 * (32/64/?).
 	 */
-	Con_DPrintf("%s: %i bytes wasted\n", __func__, st_string_space);
 	st_string_next = Hunk_TempAllocExtend(ST_STRING_CHUNK);
 	st_string_space = st_string_next ? ST_STRING_CHUNK : 0;
     }
diff -urN b/include/console.h head/include/console.h
--- b/include/console.h	2006-01-21 22:00:29.000000000 +1030
+++ head/include/console.h	2006-02-15 12:52:23.000000000 +1030
@@ -22,6 +22,7 @@
 #define CONSOLE_H
 
 #include "qtypes.h"
+#include "shell.h"
 
 //
 // console
@@ -55,6 +56,7 @@
 void Con_ClearNotify(void);
 void Con_ToggleConsole_f(void);
 void Con_ShowList(const char **list, int cnt, int maxlen);
+void Con_ShowTree(struct rb_string_root *root);
 
 // during startup for sound / cd warnings
 void Con_NotifyBox(char *text);
</pre></body></html>