shithub: qk1

Download patch

ref: aff29f25c0e72554e533162fc4d2ba69a8009fdb
parent: 4f4a0b78514eabbd3d5c1e86a178bd3628d37435
author: Konstantinn Bonnet <qu7uux@gmail.com>
date: Wed Oct 14 05:39:37 EDT 2015

remove some stupid printing shit, cleanup fixes

don't be overly verbose for no reason, and try to output
warnings/errors on 2.

--- a/README
+++ b/README
@@ -45,7 +45,7 @@
 ---------
 - udp/ip, plan9 style
 - port quakeworld: mkmany, merging common code
-- sound: don't require mixfs and fix soundbuffer write race
+- sound: don't require mixfs (for cdaudio) and fix soundbuffer write race
 - crash in d_sprite.c:D_SpriteDrawSpans after several hours of looping the
   demos
 - (amd64) entities visible through walls right when emerging from/immerging into
@@ -76,13 +76,14 @@
 	-record, -playback: broken and unused
 	-sndbits, -sndspeed, -sndmono
 	-cddev, -nocdaudio
+	-developer
 - no fullscreen; screen resolution is just the window's dimensions; any
   resolution (under the r_shared.h limits) is allowed; resize by dragging window
   edges
 - some stupid kbd/mouse bugs fixed; mouse grabbing actually grabs the mouse
 - added m_windowed cvar (replacing _windowed_mouse), for mouse grabbing
-- ungrabs the mouse when main menu is accessed
-- removed cd [on|off|reset|remap] commands: not quake's problem
+- ungrabs the mouse when main menu or console is accessed
+- removed cd [on|off|reset|remap|eject] commands: not quake's problem
 
 
 Shitty workarounds and other bullshit
--- a/cd.c
+++ b/cd.c
@@ -42,7 +42,7 @@
 
 err:
 	close(fd);
-	fprint(2, "cdinfo: %r");
+	fprint(2, "cdinfo: %r\n");
 	return -1;
 }
 
--- a/cl_main.c
+++ b/cl_main.c
@@ -96,7 +96,7 @@
 		if (cls.demorecording)
 			CL_Stop_f ();
 
-		Con_DPrintf ("Sending clc_disconnect\n");
+		print("CL_Disconnect: sending clc_disconnect...\n");
 		SZ_Clear (&cls.message);
 		MSG_WriteByte (&cls.message, clc_disconnect);
 		NET_SendUnreliableMessage (cls.netcon, &cls.message);
@@ -142,7 +142,7 @@
 	cls.netcon = NET_Connect (host);
 	if (!cls.netcon)
 		Host_Error ("CL_Connect: connect failed\n");
-	Con_DPrintf ("CL_EstablishConnection: connected to %s\n", host);
+	print("CL_EstablishConnection: connected to %s\n", host);
 	
 	cls.demonum = -1;			// not in the demo loop now
 	cls.state = ca_connected;
@@ -160,7 +160,7 @@
 {
 	char 	str[8192];
 
-Con_DPrintf ("CL_SignonReply: %d\n", cls.signon);
+	print("CL_SignonReply: got %d\n", cls.signon);
 
 	switch (cls.signon)
 	{
@@ -658,7 +658,7 @@
 	
 	if (!NET_CanSendMessage (cls.netcon))
 	{
-		Con_DPrintf ("CL_WriteToServer: can't send\n");
+		fprint(2, "CL_WriteToServer: can't send\n");
 		return;
 	}
 
--- a/cl_parse.c
+++ b/cl_parse.c
@@ -192,8 +192,8 @@
 	int		nummodels, numsounds;
 	char	model_precache[MAX_MODELS][MAX_QPATH];
 	char	sound_precache[MAX_SOUNDS][MAX_QPATH];
-	
-	Con_DPrintf ("Serverinfo packet received.\n");
+
+	print("CL_ParseServerInfo: parsing serverinfo pkt...\n");
 //
 // wipe the client_state_t struct
 //
--- a/common.c
+++ b/common.c
@@ -966,31 +966,27 @@
 
 	snprint(path, sizeof path, "%s/%s", com_gamedir, filename);
 	if((fd = create(path, OWRITE, 0666)) < 0)
-		sysfatal("COM_WriteFile:create: %r");
-
-	Sys_Printf("COM_WriteFile: %s\n", path);
+		sysfatal("COM_WriteFile: %r");
 	ewrite(fd, data, len);
 	close(fd);
 }
 
-/*
-============
-COM_CreatePath
-
-Only used for CopyFile
-============
-*/
-void    COM_CreatePath (char *path)
+/* create directories needed to resolve a path */
+static void
+mkdirp(char *path)
 {
-	char    *ofs;
-	
-	for (ofs = path+1 ; *ofs ; ofs++)
-	{
-		if (*ofs == '/')
-		{       // create the directory
-			*ofs = 0;
-			Sys_mkdir (path);
-			*ofs = '/';
+	int fd;
+	char *s;
+
+	for(s = path+1; *s; s++){
+		if(*s == '/'){     
+			*s = 0;
+			if(access(path, AEXIST) < 0){
+				if((fd = create(path, OREAD, DMDIR|0777)) < 0)
+					sysfatal("mkdirp: %r");
+				close(fd);
+			}
+			*s = '/';
 		}
 	}
 }
@@ -1009,9 +1005,9 @@
 		sysfatal("COM_CopyFile:open: %r");
 	remaining = flen(in);
 
-	COM_CreatePath(cachepath);	// create directories up to the cache file
+	mkdirp(cachepath);
 	if((out = create(cachepath, OWRITE, 0666)) < 0)
-		sysfatal("COM_CopyFile:create: %r");
+		sysfatal("COM_CopyFile: %r");
 
 	while(remaining){
 		if(remaining < sizeof buf)
@@ -1069,7 +1065,6 @@
 			for (i=0 ; i<pak->numfiles ; i++)
 				if(strcmp(pak->files[i].name, filename) == 0)
 				{       // found it!
-					Sys_Printf ("PackFile: %s : %s\n",pak->filename, filename);
 					if (handle)
 					{
 						*handle = pak->handle;
@@ -1114,7 +1109,6 @@
 				strcpy (netpath, cachepath);
 			}
 
-			Sys_Printf("FindFile: %s\n", netpath);
 			com_filesize = -1;
 			if((i = open(netpath, OREAD)) < 0)
 				fprint(2, "COM_FindFile:open: %r\n");
@@ -1129,12 +1123,11 @@
 				*file = fopen (netpath, "rb");
 			}
 			return com_filesize;
-		}
-		
+		}	
 	}
-	
-	Sys_Printf ("FindFile: can't find %s\n", filename);
-	
+
+	fprint(2, "FindFile: no such file %s\n", filename);
+
 	if (handle)
 		*handle = -1;
 	else
@@ -1299,7 +1292,7 @@
 	unsigned short          crc;
 
 	if((packhandle = open(packfile, OREAD)) < 0){
-		fprint(2, "open: %r\n");
+		fprint(2, "COM_LoadPackFile: %r\n");
 		return nil;
 	}
 	eread(packhandle, &header, sizeof header);
--- a/console.c
+++ b/console.c
@@ -205,16 +205,11 @@
 	memset(&con_text[(con_current%con_totallines)*con_linewidth], ' ', con_linewidth);
 }
 
-/*
-================
-Con_Print
-
-Handles cursor positioning, line wrapping, etc
-All console printing must go through this in order to be logged to disk
-If no console is visible, the notify window will pop up.
-================
-*/
-void Con_Print (char *txt)
+/* handles cursor positioning, line wrapping, etc. all console printing must go
+ * through this in order to be logged to disk. if no console is visible, the
+ * notify window will pop up. */
+static void
+Con_Print(char *txt)
 {
 	int		y;
 	int		c, l;
@@ -290,30 +285,36 @@
 	}
 }
 
+/* all this because of the color printing hack */
+static void
+print1(char *s, int n)
+{
+	char buf[4096], *p, *d;
 
-#define	MAXPRINTMSG	4096
+	p = s;
+	d = buf;
+	while(*p)
+		*d++ = *p++ & 0x7f;
+	write(1, buf, n);
+}
 
 /* Handles cursor positioning, line wrapping, etc */
 void
 Con_Printf(char *fmt, ...)
 {
+	int n;
 	va_list arg;
-	char c, *p, msg[MAXPRINTMSG];
+	char msg[4096];
 	static qboolean	inupdate;
 
 	/* FIXME: Con_Print() above uses 1<<7 bit for color printing select
 	 * letters, notably in mods. this does not amuse print(2) (dofmt()?). */
 	va_start(arg, fmt);
-	vsnprintf(msg, sizeof msg, fmt, arg);
+	n = vsnprintf(msg, sizeof msg, fmt, arg);
 	va_end(arg);
-	for(p = msg; *p; p++){
-		c = *p & 0x7f;
-		if(c < 32 && c != 10 && c != 13 && c != 9)
-			print("[%02x]", c);
-		else
-			print("%c", c);
-	}
 
+	print1(msg, n);
+
 	if(!con_initialized)
 		return;
 
@@ -322,7 +323,7 @@
 
 // write it to the scrollable buffer
 	Con_Print(msg);
-	
+
 // update the screen if the console is displayed
 	if(cls.signon != SIGNONS && !scr_disabled_for_loading){
 		/* protect against infinite loop if something in
@@ -333,22 +334,6 @@
 			inupdate = false;
 		}
 	}
-}
-
-void
-Con_DPrintf(char *fmt, ...)
-{
-	va_list arg;
-	char s[MAXPRINTMSG];
-
-	if(!developer.value)
-		return;	// don't confuse non-developers with techie stuff...
-
-	va_start(arg, fmt);
-	vsnprint(s, sizeof s, fmt, arg);
-	va_end(arg);
-
-	Con_Printf("%s", s);
 }
 
 /*
--- a/console.h
+++ b/console.h
@@ -13,10 +13,7 @@
 void Con_CheckResize (void);
 void Con_Init (void);
 void Con_DrawConsole (int lines, qboolean drawinput);
-void Con_Print (char *txt);
 void Con_Printf (char *fmt, ...);
-void Con_DPrintf (char *fmt, ...);
-void Con_SafePrintf (char *fmt, ...);
 void Con_Clear_f (void);
 void Con_DrawNotify (void);
 void Con_ClearNotify (void);
--- a/d_surf.c
+++ b/d_surf.c
@@ -190,21 +190,15 @@
 	return new;
 }
 
-
-/*
-=================
-D_SCDump
-=================
-*/
-void D_SCDump (void)
+void
+D_SCDump(void)
 {
-	surfcache_t             *test;
+	surfcache_t *s;
 
-	for (test = sc_base ; test ; test = test->next)
-	{
-		if (test == sc_rover)
-			Sys_Printf ("ROVER:\n");
-		print ("%p : %d bytes     %ud width\n",test, test->size, test->width);
+	for(s = sc_base; s != nil; s = s->next){
+		if(s == sc_rover)
+			print("ROVER:\n");
+		print("%p : %d bytes     %ud width\n", s, s->size, s->width);
 	}
 }
 
--- a/host.c
+++ b/host.c
@@ -50,8 +50,6 @@
 cvar_t	samelevel = {"samelevel","0"};
 cvar_t	noexit = {"noexit","0",false,true};
 
-cvar_t	developer = {"developer","0"};
-
 cvar_t	skill = {"skill","1"};						// 0 - 3
 cvar_t	deathmatch = {"deathmatch","0"};			// 0, 1, or 2
 cvar_t	coop = {"coop","0"};			// 0 or 1
@@ -75,7 +73,7 @@
 	vsnprint(s, sizeof s, fmt, arg);
 	va_end(arg);
 
-	Con_DPrintf("Host_EndGame: %s\n", s);
+	print("Host_EndGame: %s\n", s);
 
 	if(sv.active)
 		Host_ShutdownServer(false);
@@ -197,7 +195,6 @@
 	Cvar_RegisterVariable (&samelevel);
 	Cvar_RegisterVariable (&noexit);
 	Cvar_RegisterVariable (&skill);
-	Cvar_RegisterVariable (&developer);
 	Cvar_RegisterVariable (&deathmatch);
 	Cvar_RegisterVariable (&coop);
 
@@ -339,7 +336,7 @@
 			pr_global_struct->self = saveSelf;
 		}
 
-		Sys_Printf ("Client %s removed\n",host_client->name);
+		print("client %s removed\n", host_client->name);
 	}
 
 // break the net connection
@@ -450,7 +447,7 @@
 */
 void Host_ClearMemory (void)
 {
-	Con_DPrintf ("Clearing memory\n");
+	print("Clearing memory\n");
 	D_FlushCaches ();
 	Mod_ClearAll ();
 	if (host_hunklevel)
@@ -758,9 +755,7 @@
 	Hunk_AllocName (0, "-HOST_HUNKLEVEL-");
 	host_hunklevel = Hunk_LowMark ();
 
-	host_initialized = true;
-	
-	Sys_Printf ("========Quake Initialized=========\n");	
+	host_initialized = true;	
 }
 
 
@@ -797,6 +792,5 @@
 	{
 		VID_Shutdown();
 	}
-	IN_Shutdown();
 }
 
--- a/host_cmd.c
+++ b/host_cmd.c
@@ -803,7 +803,7 @@
 	}
 	host_client = save;
 
-	Sys_Printf("%s", &text[1]);
+	print("%s", &text[1]);
 }
 
 
@@ -1061,7 +1061,7 @@
 		PR_ExecuteProgram (pr_global_struct->ClientConnect);
 
 		if ((Sys_FloatTime() - host_client->netconnection->connecttime) <= sv.time)
-			Sys_Printf ("%s entered the game\n", host_client->name);
+			print("%s entered the game\n", host_client->name);
 
 		PR_ExecuteProgram (pr_global_struct->PutClientInServer);	
 	}
--- a/in.c
+++ b/in.c
@@ -68,7 +68,7 @@
 	while((r = nbrecv(kchan, &ev)) > 0)
 		Key_Event(ev.key, ev.down);
 	if(r < 0)
-		fprint(2, "Sys_SendKeyEvents:nbrecv: %r\n");
+		fprint(2, "Sys_SendKeyEvents: %r\n");
 }
 
 void
@@ -196,7 +196,7 @@
 						ev.key = k;
 						ev.down = true;
 						if(nbsend(kchan, &ev) < 0)
-							fprint(2, "kproc:nbsend: %r\n");
+							fprint(2, "kproc: %r\n");
 					}
 				}
 			}
@@ -210,7 +210,7 @@
 						ev.key = k;
 						ev.down = false;
 						if(nbsend(kchan, &ev) < 0)
-							fprint(2, "kproc:nbsend: %r\n");
+							fprint(2, "kproc: %r\n");
 					}
 				}
 			}
@@ -218,7 +218,6 @@
 		}
 		strcpy(kdown, buf);
 	}
-	close(fd);
 }
 
 static void
@@ -236,10 +235,9 @@
 	nerr = 0;
 	for(;;){
 		if((n = read(fd, buf, sizeof buf)) != 1+4*12){
-			fprint(2, "mproc:read: bad count %d not 49: %r\n", n);
-			sleep(1);	/* why */
 			if(n < 0 || ++nerr > 10)
 				break;
+			fprint(2, "mproc: bad count %d not 49: %r\n", n);
 			continue;
 		}
 		nerr = 0;
@@ -267,7 +265,6 @@
 			break;
 		}
 	}
-	close(fd);
 }
 
 static void
--- a/net_dgrm.c
+++ b/net_dgrm.c
@@ -319,9 +319,9 @@
 		if (sfunc.AddrCompare(&readaddr, &sock->addr) != 0)
 		{
 #ifdef DEBUG
-			Con_DPrintf("Forged packet received\n");
-			Con_DPrintf("Expected: %s\n", StrAddr (&sock->addr));
-			Con_DPrintf("Received: %s\n", StrAddr (&readaddr));
+			fprint(2, "Datagram_GetMessage: forged pkt received\n"
+				"%s instead of %s\n",
+				StrAddr(&readaddr), StrAddr(&sock->addr));
 #endif
 			continue;
 		}
@@ -346,7 +346,7 @@
 		{
 			if (sequence < sock->unreliableReceiveSequence)
 			{
-				Con_DPrintf("Got a stale datagram\n");
+				fprint(2, "Got a stale datagram\n");
 				ret = 0;
 				break;
 			}
@@ -354,7 +354,7 @@
 			{
 				count = sequence - sock->unreliableReceiveSequence;
 				droppedDatagrams += count;
-				Con_DPrintf("Dropped %ud datagram(s)\n", count);
+				fprint(2, "Dropped %ud datagram(s)\n", count);
 			}
 			sock->unreliableReceiveSequence = sequence + 1;
 
@@ -371,7 +371,7 @@
 		{
 			if (sequence != (sock->sendSequence - 1))
 			{
-				Con_DPrintf("Stale ACK received\n");
+				fprint(2, "Stale ACK received\n");
 				continue;
 			}
 			if (sequence == sock->ackSequence)
@@ -378,11 +378,11 @@
 			{
 				sock->ackSequence++;
 				if (sock->ackSequence != sock->sendSequence)
-					Con_DPrintf("ack sequencing error\n");
+					fprint(2, "ack sequencing error\n");
 			}
 			else
 			{
-				Con_DPrintf("Duplicate ACK received\n");
+				fprint(2, "Duplicate ACK received\n");
 				continue;
 			}
 			sock->sendMessageLength -= MAX_DATAGRAM;
--- a/net_main.c
+++ b/net_main.c
@@ -754,9 +754,9 @@
 		}
 
 	if (*my_ipx_address)
-		Con_DPrintf("IPX address %s\n", my_ipx_address);
+		print("IPX address %s\n", my_ipx_address);
 	if (*my_tcpip_address)
-		Con_DPrintf("TCP/IP address %s\n", my_tcpip_address);
+		print("TCP/IP address %s\n", my_tcpip_address);
 }
 
 /*
--- a/pr_cmds.c
+++ b/pr_cmds.c
@@ -862,15 +862,11 @@
 	RETURN_EDICT(chain);
 }
 
-
-/*
-=========
-PF_dprint
-=========
-*/
-void PF_dprint (void)
+void
+PF_dprint(void)
 {
-	Con_DPrintf ("%s",PF_VarString(0));
+	/* just always print it, but not on the console */
+	fprint(2, "%s", PF_VarString(0));
 }
 
 char	pr_string_temp[128];
--- a/pr_edict.c
+++ b/pr_edict.c
@@ -965,7 +965,7 @@
 		PR_ExecuteProgram (func - pr_functions);
 	}	
 
-	Con_DPrintf ("%d entities inhibited\n", inhibit);
+	print("%d entities inhibited\n", inhibit);
 }
 
 
@@ -987,7 +987,7 @@
 	progs = (dprograms_t *)COM_LoadHunkFile ("progs.dat");
 	if (!progs)
 		Sys_Error ("PR_LoadProgs: couldn't load progs.dat");
-	Con_DPrintf ("Programs occupy %lldK.\n", com_filesize/1024);
+	print("Programs occupy %lldK.\n", com_filesize/1024);
 
 	for (i=0 ; i<com_filesize ; i++)
 		CRC_ProcessByte (&pr_crc, ((byte *)progs)[i]);
--- a/quakedef.h
+++ b/quakedef.h
@@ -223,7 +223,6 @@
 extern	quakeparms_t host_parms;
 
 extern	cvar_t		sys_ticrate;
-extern	cvar_t		developer;
 
 extern	qboolean	host_initialized;		// true if into command execution
 extern	double		host_frametime;
--- a/r_alias.c
+++ b/r_alias.c
@@ -93,8 +93,7 @@
 // TODO: don't repeat this check when drawing?
 	if ((frame >= pmdl->numframes) || (frame < 0))
 	{
-		Con_DPrintf ("No such frame %d %s\n", frame,
-				pmodel->name);
+		fprint(2, "No such frame %d %s\n", frame, pmodel->name);
 		frame = 0;
 	}
 
@@ -546,7 +545,7 @@
 	skinnum = currententity->skinnum;
 	if ((skinnum >= pmdl->numskins) || (skinnum < 0))
 	{
-		Con_DPrintf ("R_AliasSetupSkin: no such skin # %d\n", skinnum);
+		fprint(2, "R_AliasSetupSkin: no such skin # %d\n", skinnum);
 		skinnum = 0;
 	}
 
@@ -636,7 +635,7 @@
 	frame = currententity->frame;
 	if ((frame >= pmdl->numframes) || (frame < 0))
 	{
-		Con_DPrintf ("R_AliasSetupFrame: no such frame %d\n", frame);
+		fprint(2, "R_AliasSetupFrame: no such frame %d\n", frame);
 		frame = 0;
 	}
 
--- a/sv_main.c
+++ b/sv_main.c
@@ -176,7 +176,7 @@
 	char			message[2048];
 
 	MSG_WriteByte (&client->message, svc_print);
-	sprint (message, "%c\nVERSION %4.2f SERVER (%ud CRC)", 2, VERSION, pr_crc);
+	sprint(message, "%c\nVERSION %4.2f SERVER (%ud CRC)\n", 2, VERSION, pr_crc);
 	MSG_WriteString (&client->message,message);
 
 	MSG_WriteByte (&client->message, svc_serverinfo);
@@ -234,7 +234,7 @@
 
 	client = svs.clients + clientnum;
 
-	Con_DPrintf("Client %s connected\n", client->netconnection->address);
+	print("client %s connected\n", client->netconnection->address);
 
 	edictnum = clientnum+1;
 
@@ -1018,7 +1018,7 @@
 		Cvar_Set ("hostname", "UNNAMED");
 	scr_centertime_off = 0;
 
-	Con_DPrintf ("SpawnServer: %s\n",server);
+	print("SV_SpawnServer: %s\n", server);
 	svs.changelevel_issued = false;		// now safe to issue another
 
 //
@@ -1152,6 +1152,6 @@
 			SV_SendServerinfo (host_client);
 
 	IN_Grabm(1);
-	Con_DPrintf ("Server spawned.\n");
+	print("server spawned\n");
 }
 
--- a/sv_phys.c
+++ b/sv_phys.c
@@ -594,7 +594,7 @@
 	VectorCopy (ent->v.oldorigin, ent->v.origin);
 	if (!SV_TestEntityPosition(ent))
 	{
-		Con_DPrintf ("Unstuck.\n");
+		fprint(2, "player unstuck\n");
 		SV_LinkEdict (ent, true);
 		return;
 	}
@@ -608,7 +608,7 @@
 				ent->v.origin[2] = org[2] + z;
 				if (!SV_TestEntityPosition(ent))
 				{
-					Con_DPrintf ("Unstuck.\n");
+					fprint(2, "player unstuck\n");
 					SV_LinkEdict (ent, true);
 					return;
 				}
@@ -615,7 +615,7 @@
 			}
 			
 	VectorCopy (org, ent->v.origin);
-	Con_DPrintf ("player is stuck.\n");
+	fprint(2, "player is stuck\n");
 }
 
 
--- a/sv_user.c
+++ b/sv_user.c
@@ -470,7 +470,7 @@
 		ret = NET_GetMessage (host_client->netconnection);
 		if (ret == -1)
 		{
-			Sys_Printf ("SV_ReadClientMessage: NET_GetMessage failed\n");
+			fprint(2, "SV_ReadClientMessage: NET_GetMessage failed\n");
 			return false;
 		}
 		if (!ret)
@@ -485,7 +485,7 @@
 
 			if (msg_badread)
 			{
-				Sys_Printf ("SV_ReadClientMessage: badread\n");
+				fprint(2, "SV_ReadClientMessage: badread\n");
 				return false;
 			}	
 	
@@ -497,11 +497,10 @@
 				goto nextmsg;		// end of message
 				
 			default:
-				Sys_Printf ("SV_ReadClientMessage: unknown command char\n");
+				fprint(2, "SV_ReadClientMessage: unknown command char\n");
 				return false;
 							
 			case clc_nop:
-//				Sys_Printf ("clc_nop\n");
 				break;
 				
 			case clc_stringcmd:	
@@ -553,11 +552,10 @@
 				else if (ret == 1)
 					Cmd_ExecuteString (s, src_client);
 				else
-					Con_DPrintf("%s tried to %s\n", host_client->name, s);
+					fprint(2, "%s tried to %s\n", host_client->name, s);
 				break;
 				
 			case clc_disconnect:
-//				Sys_Printf ("SV_ReadClientMessage: client disconnected\n");
 				return false;
 			
 			case clc_move:
--- a/sys.c
+++ b/sys.c
@@ -56,25 +56,6 @@
 
 
 void
-Sys_Printf(char *fmt, ...)
-{
-	char buf[1024], *p;
-	va_list arg;
-
-	va_start(arg, fmt);
-	vsnprint(buf, sizeof buf, fmt, arg);
-	va_end(arg);
-
-	for(p = buf; *p; p++){
-		*p &= 0x7f;
-		if(*p < 32 && *p != 10 && *p != 13 && *p != 9)
-			print("[%02x]", *p);
-		else
-			print("%c", *p);
-	}
-}
-
-void
 Sys_Quit(void)
 {
 	Host_Shutdown();
@@ -107,27 +88,11 @@
 	ulong t;
 	Dir *d;
 
-	if((d = dirstat(path)) == nil){
-		fprint(2, "dirstat: %r");
+	if((d = dirstat(path)) == nil)
 		return -1;
-	}
 	t = d->mtime;
 	free(d);
 	return t;
-}
-
-void
-Sys_mkdir(char *path)
-{
-	int d;
-
-	/* don't care if it isn't a directory, caller doesn't check */
-	if(access(path, AEXIST) == 0)
-		return;
-	if((d = create(path, OREAD, DMDIR|0777)) < 0)
-		fprint(2, "Sys_mkdir:create: %r\n");
-	else
-		close(d);
 }
 
 vlong
--- a/sys.h
+++ b/sys.h
@@ -6,13 +6,11 @@
 };
 
 void	Sys_Error(char *, ...);
-void	Sys_Printf(char *, ...);
 void	Sys_Quit(void);
 void	Sys_LowFPPrecision(void);
 void	Sys_HighFPPrecision(void);
 void*	emalloc(ulong);
 ulong	Sys_FileTime(char *);
-void	Sys_mkdir(char *);
 vlong	flen(int);
 void	eread(int, void *, long);
 void	ewrite(int, void *, long);
--- a/world.c
+++ b/world.c
@@ -646,7 +646,7 @@
 		{
 			trace->fraction = midf;
 			VectorCopy (mid, trace->endpos);
-			Con_DPrintf ("backup past 0\n");
+			fprint(2, "backup past 0\n");
 			return false;
 		}
 		midf = p1f + (p2f - p1f)*frac;
--- a/zone.c
+++ b/zone.c
@@ -738,42 +738,12 @@
 		Cache_Free ( cache_head.next->user );	// reclaim the space
 }
 
-
-/*
-============
-Cache_Print
-
-============
-*/
-void Cache_Print (void)
+void
+Cache_Report(void)
 {
-	cache_system_t	*cd;
-
-	for (cd = cache_head.next ; cd != &cache_head ; cd = cd->next)
-	{
-		Con_Printf ("%8d : %s\n", cd->size, cd->name);
-	}
-}
-
-/*
-============
-Cache_Report
-
-============
-*/
-void Cache_Report (void)
-{
-	Con_DPrintf ("%4.1f megabyte data cache\n", (hunk_size - hunk_high_used - hunk_low_used) / (float)(1024*1024) );
-}
-
-/*
-============
-Cache_Compact
-
-============
-*/
-void Cache_Compact (void)
-{
+	print("%4.1f megabyte data cache\n",
+		(hunk_size - hunk_high_used - hunk_low_used)
+		/ (float)(1024*1024));
 }
 
 /*