shithub: qk1

Download patch

ref: e65eec36dd5aa7223691f9557e8236ee78fbd1a9
parent: 6665b45dd8a485123b34f12cdb6963d2c2c63a9e
author: qwx <qwx@sciops.net>
date: Fri Jul 19 03:39:28 EDT 2024

fix qw build

--- a/qw/cl_cam.c
+++ b/qw/cl_cam.c
@@ -17,7 +17,7 @@
 #define MAX_ANGLE_TURN 10
 
 static vec3_t desired_position; // where the camera wants to be
-static qboolean locked = false;
+static bool locked = false;
 static int oldbuttons;
 
 // track high fragger
@@ -28,7 +28,7 @@
 //cvar_t cl_camera_maxpitch = {"cl_camera_maxpitch", "10" };
 //cvar_t cl_camera_maxyaw = {"cl_camera_maxyaw", "30" };
 
-qboolean cam_forceview;
+bool cam_forceview;
 vec3_t cam_viewangles;
 double cam_lastviewtime;
 
@@ -71,7 +71,7 @@
 }
 
 // returns true if weapon model should be drawn in camera mode
-qboolean Cam_DrawViewModel(void)
+bool Cam_DrawViewModel(void)
 {
 	if (!cl.spectator)
 		return true;
@@ -82,7 +82,7 @@
 }
 
 // returns true if we should draw this player, we don't if we are chase camming
-qboolean Cam_DrawPlayer(int playernum)
+bool Cam_DrawPlayer(int playernum)
 {
 	if (cl.spectator && autocam && locked && cl_chasecam.value && 
 		spec_track == playernum)
@@ -129,7 +129,7 @@
 }
 	
 // Returns distance or 9999 if invalid for some reason
-static float Cam_TryFlyby(player_state_t *self, player_state_t *player, vec3_t vec, qboolean checkvis)
+static float Cam_TryFlyby(player_state_t *self, player_state_t *player, vec3_t vec, bool checkvis)
 {
 	vec3_t v;
 	pmtrace_t trace;
@@ -162,7 +162,7 @@
 }
 
 // Is player visible?
-static qboolean Cam_IsVisible(player_state_t *player, vec3_t vec)
+static bool Cam_IsVisible(player_state_t *player, vec3_t vec)
 {
 	pmtrace_t trace;
 	vec3_t v;
@@ -179,7 +179,7 @@
 	return true;
 }
 
-static qboolean InitFlyby(player_state_t *self, player_state_t *player, int checkvis) 
+static bool InitFlyby(player_state_t *self, player_state_t *player, int checkvis) 
 {
     float f, max;
     vec3_t vec, vec2;
--- a/qw/cl_demo.c
+++ b/qw/cl_demo.c
@@ -123,7 +123,7 @@
   FIXME...
 ====================
 */
-qboolean CL_GetDemoMessage (void)
+bool CL_GetDemoMessage (void)
 {
 	int		r, i, j;
 	float	f;
@@ -239,7 +239,7 @@
 Handles recording and playback of demos, on top of NET_ code
 ====================
 */
-qboolean CL_GetMessage (void)
+bool CL_GetMessage (void)
 {
 	if	(cls.demoplayback)
 		return CL_GetDemoMessage ();
--- a/qw/cl_ents.c
+++ b/qw/cl_ents.c
@@ -11,7 +11,7 @@
 
 static struct predicted_player {
 	int flags;
-	qboolean active;
+	bool active;
 	vec3_t origin;	// predicted origin
 } predicted_players[MAX_CLIENTS];
 
@@ -246,13 +246,13 @@
 rest of the data stream.
 ==================
 */
-void CL_ParsePacketEntities (qboolean delta)
+void CL_ParsePacketEntities (bool delta)
 {
 	int			oldpacket, newpacket;
 	packet_entities_t	*oldp, *newp, dummy;
 	int			oldindex, newindex;
 	int			word, newnum, oldnum;
-	qboolean	full;
+	bool	full;
 	byte		from;
 
 	newpacket = cls.netchan.incoming_sequence&UPDATE_MASK;
@@ -922,7 +922,7 @@
 This sets up the first phase.
 ===
 */
-void CL_SetUpPlayerPrediction(qboolean dopred)
+void CL_SetUpPlayerPrediction(bool dopred)
 {
 	int				j;
 	player_state_t	*state;
--- a/qw/cl_input.c
+++ b/qw/cl_input.c
@@ -154,7 +154,7 @@
 float CL_KeyState (kbutton_t *key)
 {
 	float		val;
-	qboolean	impulsedown, impulseup, down;
+	bool	impulsedown, impulseup, down;
 	
 	impulsedown = key->state & 2;
 	impulseup = key->state & 4;
--- a/qw/cl_main.c
+++ b/qw/cl_main.c
@@ -13,7 +13,7 @@
 // we need to declare some mouse variables here, because the menu system
 // references them even when on a unix system.
 
-qboolean	noclip_anglehack;		// remnant from old quake
+bool	noclip_anglehack;		// remnant from old quake
 
 
 cvar_t	rcon_password = {"rcon_password", "", false};
@@ -44,7 +44,7 @@
 
 cvar_t  localid = {"localid", ""};
 
-static qboolean allowremotecmd = true;
+static bool allowremotecmd = true;
 
 //
 // info mirrors
@@ -83,8 +83,8 @@
 
 quakeparms_t host_parms;
 
-qboolean	host_initialized;		// true if into command execution
-qboolean	nomaster;
+bool	host_initialized;		// true if into command execution
+bool	nomaster;
 
 double		host_frametime;
 double		realtime;				// without any filtering or bounding
@@ -1137,7 +1137,7 @@
 {
 	va_list		argptr;
 	char		string[1024];
-	static	qboolean inerror = false;
+	static	bool inerror = false;
 	
 	if (inerror)
 		Sys_Error ("Host_Error: recursively entered");
@@ -1391,7 +1391,7 @@
 */
 void Host_Shutdown(void)
 {
-	static qboolean isdown = false;
+	static bool isdown = false;
 	
 	if (isdown)
 	{
--- a/qw/cl_parse.c
+++ b/qw/cl_parse.c
@@ -136,7 +136,7 @@
 to start a download from the server.
 ===============
 */
-qboolean	CL_CheckOrDownloadFile (char *filename)
+bool	CL_CheckOrDownloadFile (char *filename)
 {
 	FILE	*f;
 
@@ -490,7 +490,7 @@
 	CL_NextUpload();
 } 
 
-qboolean CL_IsUploading(void)
+bool CL_IsUploading(void)
 {
 	if (upload_data)
 		return true;
@@ -522,7 +522,7 @@
 	char	*str;
 	FILE	*f;
 	char	fn[MAX_OSPATH];
-	qboolean	cflag = false;
+	bool	cflag = false;
 	extern	char	gamedirfile[MAX_OSPATH];
 	int protover;
 	
--- a/qw/cl_pred.c
+++ b/qw/cl_pred.c
@@ -44,7 +44,7 @@
 CL_PredictUsercmd
 ==============
 */
-void CL_PredictUsercmd (player_state_t *from, player_state_t *to, usercmd_t *u, qboolean spectator)
+void CL_PredictUsercmd (player_state_t *from, player_state_t *to, usercmd_t *u, bool spectator)
 {
 	// split up very long moves
 	if (u->msec > 50)
--- a/qw/client.h
+++ b/qw/client.h
@@ -1,7 +1,7 @@
 typedef struct
 {
 	char		name[16];
-	qboolean	failedload;		// the name isn't a valid skin
+	bool	failedload;		// the name isn't a valid skin
 	cache_user_t	cache;
 } skin_t;
 
@@ -71,7 +71,7 @@
 	player_state_t	playerstate[MAX_CLIENTS];	// message received that reflects performing
 							// the usercmd
 	packet_entities_t	packet_entities;
-	qboolean	invalid;		// true if the packet_entities delta was invalid
+	bool	invalid;		// true if the packet_entities delta was invalid
 } frame_t;
 
 
@@ -165,9 +165,9 @@
 
 // demo recording info must be here, because record is started before
 // entering a map (and clearing client_state_t)
-	qboolean	demorecording;
-	qboolean	demoplayback;
-	qboolean	timedemo;
+	bool	demorecording;
+	bool	demoplayback;
+	bool	timedemo;
 	FILE		*demofile;
 	float		td_lastframe;		// to meter out one message a frame
 	int			td_startframe;		// host_framecount at start
@@ -229,7 +229,7 @@
 
 // pitch drifting vars
 	float		pitchvel;
-	qboolean	nodrift;
+	bool	nodrift;
 	float		driftmove;
 	double		laststop;
 
@@ -236,7 +236,7 @@
 
 	float		crouch;			// local amount for smoothing stepups
 
-	qboolean	paused;			// send over by server
+	bool	paused;			// send over by server
 
 	float		punchangle;		// temporar yview kick from weapon firing
 	
@@ -315,7 +315,7 @@
 extern	lightstyle_t	cl_lightstyle[MAX_LIGHTSTYLES];
 extern	dlight_t		cl_dlights[MAX_DLIGHTS];
 
-extern	qboolean	nomaster;
+extern	bool	nomaster;
 extern float	server_version;	// version of server we connected to
 
 //=============================================================================
@@ -335,7 +335,7 @@
 void CL_Disconnect (void);
 void CL_Disconnect_f (void);
 void CL_NextDemo (void);
-qboolean CL_DemoBehind(void);
+bool CL_DemoBehind(void);
 
 void CL_BeginServerConnect(void);
 
@@ -382,7 +382,7 @@
 // cl_demo.c
 //
 void CL_StopPlayback (void);
-qboolean CL_GetMessage (void);
+bool CL_GetMessage (void);
 void CL_WriteDemoCmd (usercmd_t *pcmd);
 
 void CL_Stop_f (void);
@@ -400,8 +400,8 @@
 int CL_CalcNet (void);
 void CL_ParseServerMessage (void);
 void CL_NewTranslation (int slot);
-qboolean	CL_CheckOrDownloadFile (char *filename);
-qboolean CL_IsUploading(void);
+bool	CL_CheckOrDownloadFile (char *filename);
+bool CL_IsUploading(void);
 void CL_NextUpload(void);
 void CL_StartUpload (byte *data, int size);
 void CL_StopUpload(void);
@@ -430,11 +430,11 @@
 // cl_ents.c
 //
 void CL_SetSolidPlayers (int playernum);
-void CL_SetUpPlayerPrediction(qboolean dopred);
+void CL_SetUpPlayerPrediction(bool dopred);
 void CL_EmitEntities (void);
 void CL_ClearProjectiles (void);
 void CL_ParseProjectiles (void);
-void CL_ParsePacketEntities (qboolean delta);
+void CL_ParsePacketEntities (bool delta);
 void CL_SetSolidEntities (void);
 void CL_ParsePlayerinfo (void);
 
@@ -443,7 +443,7 @@
 //
 void CL_InitPrediction (void);
 void CL_PredictMove (void);
-void CL_PredictUsercmd (player_state_t *from, player_state_t *to, usercmd_t *u, qboolean spectator);
+void CL_PredictUsercmd (player_state_t *from, player_state_t *to, usercmd_t *u, bool spectator);
 
 //
 // cl_cam.c
@@ -454,8 +454,8 @@
 extern	int		autocam;
 extern int spec_track; // player# of who we are tracking
 
-qboolean Cam_DrawViewModel(void);
-qboolean Cam_DrawPlayer(int playernum);
+bool Cam_DrawViewModel(void);
+bool Cam_DrawPlayer(int playernum);
 void Cam_Track(usercmd_t *cmd);
 void Cam_FinishMove(usercmd_t *cmd);
 void Cam_Reset(void);
--- a/qw/cmd.c
+++ b/qw/cmd.c
@@ -18,7 +18,7 @@
 
 cmdalias_t	*cmd_alias;
 
-qboolean	cmd_wait;
+bool	cmd_wait;
 
 cvar_t cl_warncmd = {"cl_warncmd", "0"};
 
@@ -526,7 +526,7 @@
 Cmd_Exists
 ============
 */
-qboolean	Cmd_Exists (char *cmd_name)
+bool	Cmd_Exists (char *cmd_name)
 {
 	cmd_function_t	*cmd;
 
--- a/qw/cmd.h
+++ b/qw/cmd.h
@@ -53,7 +53,7 @@
 // if function is NULL, the command will be forwarded to the server
 // as a clc_stringcmd instead of executed locally
 
-qboolean Cmd_Exists (char *cmd_name);
+bool Cmd_Exists (char *cmd_name);
 // used by the cvar code to check for cvar / command name overlap
 
 char 	*Cmd_CompleteCommand (char *partial);
--- a/qw/common.c
+++ b/qw/common.c
@@ -19,11 +19,11 @@
 
 cvar_t	registered = {"registered","0"};
 
-qboolean	com_modified;	// set true if using non-id files
+bool	com_modified;	// set true if using non-id files
 
 int		static_registered = 1;	// only for startup check, then set
 
-qboolean		msg_suppress_1 = 0;
+bool		msg_suppress_1 = 0;
 
 void COM_InitFilesystem (void);
 void COM_Path_f (void);
@@ -33,7 +33,7 @@
 #define	PAK0_COUNT		339
 #define	PAK0_CRC		52883
 
-qboolean		standard_quake = true, rogue, hipnotic;
+bool		standard_quake = true, rogue, hipnotic;
 
 char	gamedirfile[MAX_OSPATH];
 
@@ -252,7 +252,7 @@
 ============================================================================
 */
 
-qboolean	bigendien;
+bool	bigendien;
 
 short	(*BigShort) (short l);
 short	(*LittleShort) (short l);
@@ -470,7 +470,7 @@
 // reading functions
 //
 int			msg_readcount;
-qboolean	msg_badread;
+bool	msg_badread;
 
 void MSG_BeginReading (void)
 {
@@ -968,7 +968,7 @@
 */
 void COM_InitArgv (int argc, char **argv)
 {
-	qboolean	safe;
+	bool	safe;
 	int			i;
 
 	safe = false;
--- a/qw/common.h
+++ b/qw/common.h
@@ -3,7 +3,7 @@
 typedef unsigned char 		byte;
 #define _DEF_BYTE_
 
-typedef enum {false, true}	qboolean;
+typedef enum {false, true}	bool;
 
 #define	MAX_INFO_STRING	196
 #define	MAX_SERVERINFO_STRING	512
@@ -13,8 +13,8 @@
 
 typedef struct sizebuf_s
 {
-	qboolean	allowoverflow;	// if false, do a Sys_Error
-	qboolean	overflowed;		// set to true if the buffer size failed
+	bool	allowoverflow;	// if false, do a Sys_Error
+	bool	overflowed;		// set to true if the buffer size failed
 	byte	*data;
 	int		maxsize;
 	int		cursize;
@@ -63,7 +63,7 @@
 
 //============================================================================
 
-extern	qboolean		bigendien;
+extern	bool		bigendien;
 
 extern	short	(*BigShort) (short l);
 extern	short	(*LittleShort) (short l);
@@ -90,7 +90,7 @@
 void MSG_WriteDeltaUsercmd (sizebuf_t *sb, struct usercmd_s *from, struct usercmd_s *cmd);
 
 extern	int			msg_readcount;
-extern	qboolean	msg_badread;		// set if a read goes beyond end of message
+extern	bool	msg_badread;		// set if a read goes beyond end of message
 
 void MSG_BeginReading (void);
 int MSG_GetReadCount(void);
@@ -115,7 +115,7 @@
 //============================================================================
 
 extern	char		com_token[1024];
-extern	qboolean	com_eof;
+extern	bool	com_eof;
 
 char *COM_Parse (char *data);
 
@@ -157,7 +157,7 @@
 void COM_Gamedir (char *dir);
 
 extern	struct cvar_s	registered;
-extern qboolean		standard_quake, rogue, hipnotic;
+extern bool		standard_quake, rogue, hipnotic;
 
 char *Info_ValueForKey (char *s, char *key);
 void Info_RemoveKey (char *s, char *key);
--- a/qw/console.c
+++ b/qw/console.c
@@ -29,7 +29,7 @@
 extern	int		key_linepos;
 		
 
-qboolean	con_initialized;
+bool	con_initialized;
 
 
 void Key_ClearTyping (void)
@@ -336,7 +336,7 @@
 {
 	va_list		argptr;
 	char		msg[MAXPRINTMSG];
-	static qboolean	inupdate;
+	static bool	inupdate;
 	
 	va_start (argptr,fmt);
 	vsprintf (msg,fmt,argptr);
--- a/qw/console.h
+++ b/qw/console.h
@@ -14,7 +14,7 @@
 extern	int			con_ormask;
 
 extern int con_totallines;
-extern qboolean con_initialized;
+extern bool con_initialized;
 extern byte *con_chars;
 extern	int	con_notifylines;		// scan lines to clear for notify lines
 
--- a/qw/cvar.c
+++ b/qw/cvar.c
@@ -180,7 +180,7 @@
 Handles variable inspection and changing from the console
 ============
 */
-qboolean	Cvar_Command (void)
+bool	Cvar_Command (void)
 {
 	cvar_t			*v;
 
--- a/qw/cvar.h
+++ b/qw/cvar.h
@@ -36,8 +36,8 @@
 {
 	char	*name;
 	char	*string;
-	qboolean archive;		// set to true to cause it to be saved to vars.rc
-	qboolean info;			// added to serverinfo or userinfo when changed
+	bool archive;		// set to true to cause it to be saved to vars.rc
+	bool info;			// added to serverinfo or userinfo when changed
 	float	value;
 	struct cvar_s *next;
 } cvar_t;
@@ -62,7 +62,7 @@
 // attempts to match a partial variable name for command line completion
 // returns NULL if nothing fits
 
-qboolean Cvar_Command (void);
+bool Cvar_Command (void);
 // called by Cmd_ExecuteString when Cmd_Argv(0) doesn't match a known
 // command.  Returns true if the command was a variable reference that
 // was handled. (print or change)
--- a/qw/d_iface.h
+++ b/qw/d_iface.h
@@ -91,14 +91,14 @@
 extern int		d_spanpixcount;
 extern int		r_framecount;		// sequence # of current frame since Quake
 									//  started
-extern qboolean	r_drawpolys;		// 1 if driver wants clipped polygons
+extern bool	r_drawpolys;		// 1 if driver wants clipped polygons
 									//  rather than a span list
-extern qboolean	r_drawculledpolys;	// 1 if driver wants clipped polygons that
+extern bool	r_drawculledpolys;	// 1 if driver wants clipped polygons that
 									//  have been culled by the edge list
-extern qboolean	r_worldpolysbacktofront;	// 1 if driver wants polygons
+extern bool	r_worldpolysbacktofront;	// 1 if driver wants polygons
 											//  delivered back to front rather
 											//  than front to back
-extern qboolean	r_recursiveaffinetriangles;	// true if a driver wants to use
+extern bool	r_recursiveaffinetriangles;	// true if a driver wants to use
 											//  recursive triangular subdivison
 											//  and vertex drawing via
 											//  D_PolysetDrawFinalVerts() past
@@ -108,7 +108,7 @@
 extern float	r_aliasuvscale;		// scale-up factor for screen u and v
 									//  on Alias vertices passed to driver
 extern int		r_pixbytes;
-extern qboolean	r_dowarp;
+extern bool	r_dowarp;
 
 extern affinetridesc_t	r_affinetridesc;
 extern spritedesc_t		r_spritedesc;
--- a/qw/d_init.c
+++ b/qw/d_init.c
@@ -11,7 +11,7 @@
 cvar_t	d_mipscale = {"d_mipscale", "1"};
 
 surfcache_t		*d_initial_rover;
-qboolean		d_roverwrapped;
+bool		d_roverwrapped;
 int				d_minmip;
 float			d_scalemip[NUM_MIPS-1];
 
--- a/qw/d_local.h
+++ b/qw/d_local.h
@@ -37,7 +37,7 @@
 
 extern float	scale_for_mip;
 
-extern qboolean		d_roverwrapped;
+extern bool		d_roverwrapped;
 extern surfcache_t	*sc_rover;
 extern surfcache_t	*d_initial_rover;
 
--- a/qw/d_surf.c
+++ b/qw/d_surf.c
@@ -6,7 +6,7 @@
 #include "quakedef.h"
 
 float           surfscale;
-qboolean        r_cache_thrash;         // set if surface cache is thrashing
+bool        r_cache_thrash;         // set if surface cache is thrashing
 
 int                                     sc_size;
 surfcache_t                     *sc_rover, *sc_base;
@@ -111,7 +111,7 @@
 surfcache_t     *D_SCAlloc (int width, int size)
 {
 	surfcache_t             *new;
-	qboolean                wrapped_this_time;
+	bool                wrapped_this_time;
 
 	if ((width < 0) || (width > 256))
 		Sys_Error ("D_SCAlloc: bad cache width %d\n", width);
--- a/qw/keys.c
+++ b/qw/keys.c
@@ -20,11 +20,11 @@
 int		key_count;			// incremented every key event
 
 char	*keybindings[256];
-qboolean	consolekeys[256];	// if true, can't be rebound while in console
-qboolean	menubound[256];	// if true, can't be rebound while in menu
+bool	consolekeys[256];	// if true, can't be rebound while in console
+bool	menubound[256];	// if true, can't be rebound while in menu
 int		keyshift[256];		// key to map to if shift held down in console
 int		key_repeats[256];	// if > 1, it is autorepeating
-qboolean	keydown[256];
+bool	keydown[256];
 
 typedef struct
 {
@@ -128,7 +128,7 @@
 ==============================================================================
 */
 
-qboolean CheckForCommand (void)
+bool CheckForCommand (void)
 {
 	char	command[128];
 	char	*cmd, *s;
@@ -296,7 +296,7 @@
 
 //============================================================================
 
-qboolean	chat_team;
+bool	chat_team;
 char		chat_buffer[MAXCMDLINE];
 int			chat_bufferlen = 0;
 
@@ -617,7 +617,7 @@
 Should NOT be called during an interrupt!
 ===================
 */
-void Key_Event (int key, qboolean down)
+void Key_Event (int key, bool down)
 {
 	char	*kb;
 	char	cmd[1024];
--- a/qw/keys.h
+++ b/qw/keys.h
@@ -107,9 +107,9 @@
 
 extern char chat_buffer[];
 extern	int chat_bufferlen;
-extern	qboolean	chat_team;
+extern	bool	chat_team;
 
-void Key_Event (int key, qboolean down);
+void Key_Event (int key, bool down);
 void Key_Init (void);
 void Key_WriteBindings (FILE *f);
 void Key_SetBinding (int keynum, char *binding);
--- a/qw/menu.c
+++ b/qw/menu.c
@@ -62,12 +62,12 @@
 void M_Search_Key (int key);
 void M_ServerList_Key (int key);
 
-qboolean	m_entersound;		// play after drawing a frame, so caching
+bool	m_entersound;		// play after drawing a frame, so caching
 								// won't disrupt the sound
-qboolean	m_recursiveDraw;
+bool	m_recursiveDraw;
 
 int			m_return_state;
-qboolean	m_return_onerror;
+bool	m_return_onerror;
 char		m_return_reason [32];
 
 #define StartingGame	(m_multiplayer_cursor == 1)
@@ -830,7 +830,7 @@
 
 int		msgNumber;
 int		m_quit_prevstate;
-qboolean	wasInMenus;
+bool	wasInMenus;
 
 char *quitMessage [] = 
 {
--- a/qw/mkfile
+++ b/qw/mkfile
@@ -5,6 +5,8 @@
 	qwcl\
 	qwsv\
 
+CFLAGS=$CFLAGS -D__plan9__ -D__${objtype}__ -I/sys/include -I.
+
 CLOBJ=\
 	cd.$O\
 	cl_cam.$O\
@@ -35,6 +37,7 @@
 	draw.$O\
 	in.$O\
 	keys.$O\
+	../dotproduct`{test -f dotproduct_$objtype.s && echo -n _$objtype}.$O\
 	mathlib.$O\
 	md4.$O\
 	menu.$O\
@@ -75,6 +78,8 @@
 	common.$O\
 	crc.$O\
 	cvar.$O\
+	../isnanf.$O\
+	../dotproduct`{test -f dotproduct_$objtype.s && echo -n _$objtype}.$O\
 	mathlib.$O\
 	md4.$O\
 	nanosec.$O\
@@ -143,6 +148,9 @@
 	zone.h\
 
 </sys/src/cmd/mkmany
+
+%.$O: %.c
+	$CC $CFLAGS -o $target $stem.c
 
 $O.qwcl: $CLOBJ
 	$LD -o $target $prereq
--- a/qw/model.c
+++ b/qw/model.c
@@ -14,7 +14,7 @@
 void Mod_LoadSpriteModel (model_t *mod, void *buffer);
 void Mod_LoadBrushModel (model_t *mod, void *buffer);
 void Mod_LoadAliasModel (model_t *mod, void *buffer);
-model_t *Mod_LoadModel (model_t *mod, qboolean crash);
+model_t *Mod_LoadModel (model_t *mod, bool crash);
 
 byte	mod_novis[MAX_MAP_LEAFS/8];
 
@@ -212,7 +212,7 @@
 Loads a model into the cache
 ==================
 */
-model_t *Mod_LoadModel (model_t *mod, qboolean crash)
+model_t *Mod_LoadModel (model_t *mod, bool crash)
 {
 	void	*d;
 	unsigned *buf;
@@ -288,7 +288,7 @@
 Loads in a model for the given name
 ==================
 */
-model_t *Mod_ForName (char *name, qboolean crash)
+model_t *Mod_ForName (char *name, bool crash)
 {
 	model_t	*mod;
 	
--- a/qw/model.h
+++ b/qw/model.h
@@ -283,7 +283,7 @@
 typedef struct model_s
 {
 	char		name[MAX_QPATH];
-	qboolean	needload;		// bmodels and sprites don't cache normally
+	bool	needload;		// bmodels and sprites don't cache normally
 
 	modtype_t	type;
 	int			numframes;
@@ -300,7 +300,7 @@
 //
 // solid volume for clipping (sent from server)
 //
-	qboolean	clipbox;
+	bool	clipbox;
 	vec3_t		clipmins, clipmaxs;
 
 //
@@ -364,7 +364,7 @@
 
 void	Mod_Init (void);
 void	Mod_ClearAll (void);
-model_t *Mod_ForName (char *name, qboolean crash);
+model_t *Mod_ForName (char *name, bool crash);
 void	*Mod_Extradata (model_t *mod);	// handles caching
 void	Mod_TouchModel (char *name);
 
--- a/qw/net.h
+++ b/qw/net.h
@@ -19,13 +19,13 @@
 
 void		NET_Init (int port);
 void		NET_Shutdown (void);
-qboolean	NET_GetPacket (void);
+bool	NET_GetPacket (void);
 void		NET_SendPacket (int length, void *data, netadr_t *to);
 void	NET_Close(netadr_t*);
 
-qboolean	NET_CompareAdr (netadr_t *a, netadr_t *b);
-qboolean	NET_CompareBaseAdr (netadr_t *a, netadr_t *b);
-qboolean	NET_StringToAdr(char*, netadr_t*, char*);
+bool	NET_CompareAdr (netadr_t *a, netadr_t *b);
+bool	NET_CompareBaseAdr (netadr_t *a, netadr_t *b);
+bool	NET_StringToAdr(char*, netadr_t*, char*);
 
 //============================================================================
 
@@ -35,7 +35,7 @@
 
 typedef struct
 {
-	qboolean	fatal_error;
+	bool	fatal_error;
 
 	float		last_received;		// for timeouts
 
@@ -83,9 +83,9 @@
 void Netchan_Transmit (netchan_t *chan, int length, byte *data);
 void Netchan_OutOfBand (netadr_t *adr, int length, byte *data);
 void Netchan_OutOfBandPrint (netadr_t *adr, char *format, ...);
-qboolean Netchan_Process (netchan_t *chan);
+bool Netchan_Process (netchan_t *chan);
 void Netchan_Setup (netchan_t *chan, netadr_t *adr, int qport);
 
-qboolean Netchan_CanPacket (netchan_t *chan);
-qboolean Netchan_CanReliable (netchan_t *chan);
+bool Netchan_CanPacket (netchan_t *chan);
+bool Netchan_CanReliable (netchan_t *chan);
 
--- a/qw/net_chan.c
+++ b/qw/net_chan.c
@@ -158,7 +158,7 @@
 ================
 */
 #define	MAX_BACKUP	200
-qboolean Netchan_CanPacket (netchan_t *chan)
+bool Netchan_CanPacket (netchan_t *chan)
 {
 	if (chan->cleartime < realtime + MAX_BACKUP*chan->rate)
 		return true;
@@ -173,7 +173,7 @@
 Returns true if the bandwidth choke isn't 
 ================
 */
-qboolean Netchan_CanReliable (netchan_t *chan)
+bool Netchan_CanReliable (netchan_t *chan)
 {
 	if (chan->reliable_length)
 		return false;			// waiting for ack
@@ -194,7 +194,7 @@
 {
 	sizebuf_t	send;
 	byte		send_buf[MAX_MSGLEN + PACKET_HEADER];
-	qboolean	send_reliable;
+	bool	send_reliable;
 	unsigned	w1, w2;
 	int			i;
 
@@ -286,7 +286,7 @@
 modifies net_message so that it points to the packet payload
 =================
 */
-qboolean Netchan_Process (netchan_t *chan)
+bool Netchan_Process (netchan_t *chan)
 {
 	unsigned		sequence, sequence_ack;
 	unsigned		reliable_ack, reliable_message;
--- a/qw/net_udp.c
+++ b/qw/net_udp.c
@@ -13,19 +13,19 @@
 static uchar netbuf[8192];
 static int afd = -1, lpid;
 
-qboolean
+bool
 NET_CompareBaseAdr(netadr_t *a, netadr_t *b)
 {
 	return strcmp(a->addr, b->addr) == 0;
 }
 
-qboolean
+bool
 NET_CompareAdr(netadr_t *a, netadr_t *b)
 {
 	return strcmp(a->sys, b->sys) == 0;
 }
 
-qboolean
+bool
 NET_StringToAdr(char *s, netadr_t *a, char *port)
 {
 	int fd, n;
@@ -78,7 +78,7 @@
 	free(nc);
 }
 
-qboolean
+bool
 NET_GetPacket(void)
 {
 	int n, fd;
--- a/qw/pmove.h
+++ b/qw/pmove.h
@@ -6,9 +6,9 @@
 
 typedef struct
 {
-	qboolean	allsolid;	// if true, plane is not valid
-	qboolean	startsolid;	// if true, the initial point was in a solid area
-	qboolean	inopen, inwater;
+	bool	allsolid;	// if true, plane is not valid
+	bool	startsolid;	// if true, the initial point was in a solid area
+	bool	inopen, inwater;
 	float		fraction;		// time completed, 1.0 = didn't hit anything
 	vec3_t		endpos;			// final position
 	pmplane_t		plane;			// surface normal at impact
@@ -36,7 +36,7 @@
 	vec3_t	velocity;
 	int		oldbuttons;
 	float		waterjumptime;
-	qboolean	dead;
+	bool	dead;
 	int		spectator;
 
 	// world state
@@ -77,5 +77,5 @@
 int PM_HullPointContents (hull_t *hull, int num, vec3_t p);
 
 int PM_PointContents (vec3_t point);
-qboolean PM_TestPlayerPosition (vec3_t point);
+bool PM_TestPlayerPosition (vec3_t point);
 pmtrace_t PM_PlayerMove (vec3_t start, vec3_t stop);
--- a/qw/pmovetst.c
+++ b/qw/pmovetst.c
@@ -157,7 +157,7 @@
 
 ==================
 */
-qboolean PM_RecursiveHullCheck (hull_t *hull, int num, float p1f, float p2f, vec3_t p1, vec3_t p2, pmtrace_t *trace)
+bool PM_RecursiveHullCheck (hull_t *hull, int num, float p1f, float p2f, vec3_t p1, vec3_t p2, pmtrace_t *trace)
 {
 	dclipnode_t	*node;
 	mplane_t	*plane;
@@ -295,7 +295,7 @@
 Returns false if the given player position is not valid (in solid)
 ================
 */
-qboolean PM_TestPlayerPosition (vec3_t pos)
+bool PM_TestPlayerPosition (vec3_t pos)
 {
 	int			i;
 	physent_t	*pe;
--- a/qw/pr_edict.c
+++ b/qw/pr_edict.c
@@ -18,7 +18,7 @@
 int		type_size[8] = {1,sizeof(void *)/4,1,3,1,1,sizeof(void *)/4,sizeof(void *)/4};
 
 ddef_t *ED_FieldAtOfs (int ofs);
-qboolean	ED_ParseEpair (void *base, ddef_t *key, char *s);
+bool	ED_ParseEpair (void *base, ddef_t *key, char *s);
 
 #define	MAX_FIELD_LEN	64
 #define GEFV_CACHESIZE	2
@@ -701,7 +701,7 @@
 returns false if error
 =============
 */
-qboolean	ED_ParseEpair (void *base, ddef_t *key, char *s)
+bool	ED_ParseEpair (void *base, ddef_t *key, char *s)
 {
 	int		i;
 	char	string[128];
@@ -778,8 +778,8 @@
 char *ED_ParseEdict (char *data, edict_t *ent)
 {
 	ddef_t		*key;
-	qboolean	anglehack;
-	qboolean	init;
+	bool	anglehack;
+	bool	init;
 	char		keyname[256];
 
 	init = false;
--- a/qw/pr_exec.c
+++ b/qw/pr_exec.c
@@ -18,7 +18,7 @@
 int			localstack_used;
 
 
-qboolean	pr_trace;
+bool	pr_trace;
 dfunction_t	*pr_xfunction;
 int			pr_xstatement;
 
--- a/qw/progs.h
+++ b/qw/progs.h
@@ -11,7 +11,7 @@
 #define	MAX_ENT_LEAFS	16
 typedef struct edict_s
 {
-	qboolean	free;
+	bool	free;
 	link_t		area;				// linked to a division node or leaf
 	
 	int			num_leafs;
@@ -96,7 +96,7 @@
 
 extern int		pr_argc;
 
-extern	qboolean	pr_trace;
+extern	bool	pr_trace;
 extern	dfunction_t	*pr_xfunction;
 extern	int			pr_xstatement;
 
--- a/qw/quakedef.h
+++ b/qw/quakedef.h
@@ -172,7 +172,7 @@
 #define MAX_NUM_ARGVS	50
 
 
-extern qboolean noclip_anglehack;
+extern bool noclip_anglehack;
 
 
 //
@@ -186,7 +186,7 @@
 
 extern	cvar_t	password;
 
-extern	qboolean	host_initialized;		// true if into command execution
+extern	bool	host_initialized;		// true if into command execution
 extern	double		host_frametime;
 extern	byte		*host_basepal;
 extern	byte		*host_colormap;
@@ -200,13 +200,13 @@
 void Host_Shutdown(void);
 void Host_Error (char *error, ...);
 void Host_EndGame (char *message, ...);
-qboolean Host_SimulationTime(float time);
+bool Host_SimulationTime(float time);
 void Host_Frame (float time);
 void Host_Quit_f (void);
 void Host_ClientCommands (char *fmt, ...);
-void Host_ShutdownServer (qboolean crash);
+void Host_ShutdownServer (bool crash);
 
-extern qboolean		msg_suppress_1;		// suppresses resolution and cache size console output
+extern bool		msg_suppress_1;		// suppresses resolution and cache size console output
 										//  an fullscreen DIB focus gain/loss
 
 void SV_Error (char *error, ...);
--- a/qw/qwcl.c
+++ b/qw/qwcl.c
@@ -8,7 +8,7 @@
 
 /* FIXME: stupid-ass linking kludges */
 server_static_t	svs;
-qboolean ServerPaused(void)
+bool ServerPaused(void)
 {
 	return 0;
 }
--- a/qw/r_alias.c
+++ b/qw/r_alias.c
@@ -67,7 +67,7 @@
 R_AliasCheckBBox
 ================
 */
-qboolean R_AliasCheckBBox (void)
+bool R_AliasCheckBBox (void)
 {
 	int					i, flags, frame, numv;
 	aliashdr_t			*pahdr;
@@ -75,7 +75,7 @@
 	finalvert_t			*pv0, *pv1, viewpts[16];
 	auxvert_t			*pa0, *pa1, viewaux[16];
 	maliasframedesc_t	*pframedesc;
-	qboolean			zclipped, zfullyclipped;
+	bool			zclipped, zfullyclipped;
 	unsigned			anyclip, allclip;
 	int					minz;
 	
@@ -399,11 +399,11 @@
 	int		temp;
 	float	lightcos, *plightnormal;
 
-	av->fv[0] = DotProduct(pverts->v, aliastransform[0]) +
+	av->fv[0] = DotProduct_(pverts->v, aliastransform[0]) +
 			aliastransform[0][3];
-	av->fv[1] = DotProduct(pverts->v, aliastransform[1]) +
+	av->fv[1] = DotProduct_(pverts->v, aliastransform[1]) +
 			aliastransform[1][3];
-	av->fv[2] = DotProduct(pverts->v, aliastransform[2]) +
+	av->fv[2] = DotProduct_(pverts->v, aliastransform[2]) +
 			aliastransform[2][3];
 
 	fv->v[2] = pstverts->s;
@@ -446,7 +446,7 @@
 	for (i=0 ; i<r_anumverts ; i++, fv++, pverts++, pstverts++)
 	{
 	// transform and project
-		zi = 1.0 / (DotProduct(pverts->v, aliastransform[2]) +
+		zi = 1.0 / (DotProduct_(pverts->v, aliastransform[2]) +
 				aliastransform[2][3]);
 
 	// x, y, and z are scaled down by 1/2**31 in the transform, so 1/z is
@@ -454,9 +454,9 @@
 	// projection
 		fv->v[5] = zi;
 
-		fv->v[0] = ((DotProduct(pverts->v, aliastransform[0]) +
+		fv->v[0] = ((DotProduct_(pverts->v, aliastransform[0]) +
 				aliastransform[0][3]) * zi) + aliasxcenter;
-		fv->v[1] = ((DotProduct(pverts->v, aliastransform[1]) +
+		fv->v[1] = ((DotProduct_(pverts->v, aliastransform[1]) +
 				aliastransform[1][3]) * zi) + aliasycenter;
 
 		fv->v[2] = pstverts->s;
--- a/qw/r_bsp.c
+++ b/qw/r_bsp.c
@@ -6,7 +6,7 @@
 //
 // current entity info
 //
-qboolean		insubmodel;
+bool		insubmodel;
 entity_t		*currententity;
 vec3_t			modelorg, base_modelorg;
 								// modelorg is the viewpoint reletive to
@@ -31,7 +31,7 @@
 
 static mvertex_t	*pfrontenter, *pfrontexit;
 
-static qboolean		makeclippededge;
+static bool		makeclippededge;
 
 
 //===========================================================================
--- a/qw/r_draw.c
+++ b/qw/r_draw.c
@@ -25,9 +25,9 @@
 
 medge_t			*r_pedge;
 
-qboolean		r_leftclipped, r_rightclipped;
-static qboolean	makeleftedge, makerightedge;
-qboolean		r_nearzionly;
+bool		r_leftclipped, r_rightclipped;
+static bool	makeleftedge, makerightedge;
+bool		r_nearzionly;
 
 int		sintable[MAXWIDTH+CYCLE];
 int		intsintable[nelem(sintable)];
@@ -46,7 +46,7 @@
 float			r_u1, r_v1, r_lzi1;
 int				r_ceilv1;
 
-qboolean	r_lastvertvalid;
+bool	r_lastvertvalid;
 
 
 /*
@@ -683,7 +683,7 @@
 	mvertex_t	verts[2][100];	//FIXME: do real number
 	polyvert_t	pverts[100];	//FIXME: do real number, safely
 	int			vertpage, newverts, newpage, lastvert;
-	qboolean	visible;
+	bool	visible;
 
 // FIXME: clean this up and make it faster
 // FIXME: guard against running out of vertices
--- a/qw/r_local.h
+++ b/qw/r_local.h
@@ -103,7 +103,7 @@
 //
 // current entity info
 //
-extern	qboolean		insubmodel;
+extern	bool		insubmodel;
 extern	vec3_t			r_worldmodelorg;
 
 
@@ -204,7 +204,7 @@
 extern finalvert_t		*pfinalverts;
 extern auxvert_t		*pauxverts;
 
-qboolean R_AliasCheckBBox (void);
+bool R_AliasCheckBBox (void);
 
 //=========================================================
 // turbulence stuff
@@ -255,9 +255,9 @@
 extern float	se_time1, se_time2, de_time1, de_time2, dv_time1, dv_time2;
 extern int		r_frustum_indexes[4*6];
 extern int		r_maxsurfsseen, r_maxedgesseen, r_cnumsurfs;
-extern qboolean	r_surfsonstack;
+extern bool	r_surfsonstack;
 extern cshift_t	cshift_water;
-extern qboolean	r_dowarpold, r_viewchanged;
+extern bool	r_dowarpold, r_viewchanged;
 
 extern mleaf_t	*r_viewleaf, *r_oldviewleaf;
 
--- a/qw/r_main.c
+++ b/qw/r_main.c
@@ -10,16 +10,16 @@
 alight_t	r_viewlighting = {128, 192, viewlightvec};
 float		r_time1;
 int			r_numallocatededges;
-qboolean	r_drawpolys;
-qboolean	r_drawculledpolys;
-qboolean	r_worldpolysbacktofront;
-qboolean	r_recursiveaffinetriangles = true;
+bool	r_drawpolys;
+bool	r_drawculledpolys;
+bool	r_worldpolysbacktofront;
+bool	r_recursiveaffinetriangles = true;
 int			r_pixbytes = 1;
 float		r_aliasuvscale = 1.0;
 int			r_outofsurfaces;
 int			r_outofedges;
 
-qboolean	r_dowarp, r_dowarpold, r_viewchanged;
+bool	r_dowarp, r_dowarpold, r_viewchanged;
 
 int			numbtofpolys;
 btofpoly_t	*pbtofpolys;
@@ -27,7 +27,7 @@
 
 int			c_surf;
 int			r_maxsurfsseen, r_maxedgesseen, r_cnumsurfs;
-qboolean	r_surfsonstack;
+bool	r_surfsonstack;
 int			r_clipflags;
 
 byte		*r_warpbuffer;
@@ -289,7 +289,7 @@
 {
 	int		h;
 	float	size;
-	qboolean full = false;
+	bool full = false;
 
 	if (scr_viewsize.value >= 100.0) {
 		size = 100.0;
--- a/qw/r_shared.h
+++ b/qw/r_shared.h
@@ -65,7 +65,7 @@
 	void		*data;				// associated data like msurface_t
 	entity_t	*entity;
 	float		nearzi;				// nearest 1/z on surface, for mipmapping
-	qboolean	insubmodel;
+	bool	insubmodel;
 	float		d_ziorigin, d_zistepu, d_zistepv;
 
 	int			pad[2];				// to 64 bytes
--- a/qw/render.h
+++ b/qw/render.h
@@ -123,7 +123,7 @@
 // surface cache related
 //
 extern	int		reinit_surfcache;	// if 1, surface cache is currently empty and
-extern qboolean	r_cache_thrash;	// set if thrashing the surface cache
+extern bool	r_cache_thrash;	// set if thrashing the surface cache
 
 int	D_SurfaceCacheForRes (int width, int height);
 void D_FlushCaches (void);
--- a/qw/sbar.c
+++ b/qw/sbar.c
@@ -27,8 +27,8 @@
 qpic_t	*sb_face_invuln;
 qpic_t	*sb_face_invis_invuln;
 
-qboolean	sb_showscores;
-qboolean	sb_showteamscores;
+bool	sb_showscores;
+bool	sb_showteamscores;
 
 int			sb_lines;			// scan lines to draw
 
@@ -36,7 +36,7 @@
 void Sbar_TeamOverlay (void);
 void Sbar_MiniDeathmatchOverlay (void);
 
-static qboolean largegame = false;
+static bool largegame = false;
 
 /*
 ===============
@@ -350,7 +350,7 @@
 Sbar_SortFrags
 ===============
 */
-void Sbar_SortFrags (qboolean includespec)
+void Sbar_SortFrags (bool includespec)
 {
 	int		i, j, k;
 		
@@ -486,8 +486,8 @@
 	char	num[6];
 	float	time;
 	int		flashon;
-	qboolean	headsup;
-	qboolean    hudswap;
+	bool	headsup;
+	bool    hudswap;
 
 	headsup = !(cl_sbar.value || scr_viewsize.value<100);
 	hudswap = cl_hudswap.value; // Get that nasty float out :)
@@ -750,7 +750,7 @@
 */
 void Sbar_Draw (void)
 {
-	qboolean headsup;
+	bool headsup;
 	char st[512];
 
 	headsup = !(cl_sbar.value || scr_viewsize.value<100);
--- a/qw/screen.c
+++ b/qw/screen.c
@@ -72,7 +72,7 @@
 cvar_t		scr_printspeed = {"scr_printspeed","8"};
 cvar_t		scr_allowsnap = {"scr_allowsnap", "1"};
 
-qboolean	scr_initialized;		// ready to draw
+bool	scr_initialized;		// ready to draw
 
 qpic_t		*scr_ram;
 qpic_t		*scr_net;
@@ -90,11 +90,11 @@
 vrect_t		*pconupdate;
 vrect_t		scr_vrect;
 
-qboolean	scr_disabled_for_loading;
+bool	scr_disabled_for_loading;
 
-qboolean	scr_skipupdate;
+bool	scr_skipupdate;
 
-qboolean	block_drawing;
+bool	block_drawing;
 
 void SCR_ScreenShot_f (void);
 void SCR_RSShot_f (void);
@@ -569,7 +569,7 @@
 ============== 
 */ 
 void WritePCXfile (char *filename, byte *data, int width, int height,
-	int rowbytes, byte *palette, qboolean upload) 
+	int rowbytes, byte *palette, bool upload) 
 {
 	int		i, j, length;
 	pcx_t	*pcx;
@@ -816,7 +816,7 @@
 //=============================================================================
 
 char	*scr_notifystring;
-qboolean	scr_drawdialog;
+bool	scr_drawdialog;
 
 void SCR_DrawNotifyString (void)
 {
--- a/qw/screen.h
+++ b/qw/screen.h
@@ -17,7 +17,7 @@
 extern	int			sb_lines;
 
 extern	int			clearnotify;	// set to 0 whenever notify text is drawn
-extern	qboolean	scr_disabled_for_loading;
+extern	bool	scr_disabled_for_loading;
 
 extern	cvar_t		scr_viewsize;
 
@@ -27,6 +27,6 @@
 extern	int			scr_copytop;
 extern	int			scr_copyeverything;
 
-qboolean	scr_skipupdate;
+bool	scr_skipupdate;
 
-qboolean	block_drawing;
+bool	block_drawing;
--- a/qw/server.h
+++ b/qw/server.h
@@ -14,7 +14,7 @@
 
 typedef struct
 {
-	qboolean	active;				// false when server is going down
+	bool	active;				// false when server is going down
 	server_state_t	state;			// precache commands are only valid during load
 
 	double		time;
@@ -22,7 +22,7 @@
 	int			lastcheck;			// used by PF_checkclient
 	double		lastchecktime;		// for monster ai 
 
-	qboolean	paused;				// are we paused?
+	bool	paused;				// are we paused?
 
 	//check player/eyes models for hacks
 	unsigned	model_player_checksum;
@@ -98,12 +98,12 @@
 
 	int				spectator;			// non-interactive
 
-	qboolean		sendinfo;			// at end of frame, send info to all
+	bool		sendinfo;			// at end of frame, send info to all
 										// this prevents malicious multiple broadcasts
 	float			lastnametime;		// time of last name change
 	int				lastnamecount;		// time of last name change
 	unsigned		checksum;			// checksum for calcs
-	qboolean		drop;				// lose this guy next opportunity
+	bool		drop;				// lose this guy next opportunity
 	int				lossage;			// loss percentage
 
 	int				userid;							// identifying number
@@ -133,7 +133,7 @@
 	byte		backbuf_data[MAX_BACK_BUFFERS][MAX_MSGLEN];
 
 	double			connection_started;	// or time of disconnect for zombies
-	qboolean		send_message;		// set on frames a datagram arived on
+	bool		send_message;		// set on frames a datagram arived on
 
 // spawn parms are carried from level to level
 	float			spawn_parms[NUM_SPAWN_PARMS];
@@ -156,12 +156,12 @@
  	int			whensaidhead;       // Head value for floodprots
  	double			lockedtill;
 
-	qboolean		upgradewarn;		// did we warn him?
+	bool		upgradewarn;		// did we warn him?
 
 	FILE			*upload;
 	char			uploadfn[MAX_QPATH];
 	netadr_t		snap_from;
-	qboolean		remote_snap;
+	bool		remote_snap;
  
 //===== NETWORK ============
 	int				chokecount;
@@ -329,8 +329,8 @@
 
 int SV_ModelIndex (char *name);
 
-qboolean SV_CheckBottom (edict_t *ent);
-qboolean SV_movestep (edict_t *ent, vec3_t move, qboolean relink);
+bool SV_CheckBottom (edict_t *ent);
+bool SV_movestep (edict_t *ent, vec3_t move, bool relink);
 
 void SV_WriteClientdataToMessage (client_t *client, sizebuf_t *msg);
 
@@ -363,7 +363,7 @@
 void SV_Physics (void);
 void SV_CheckVelocity (edict_t *ent);
 void SV_AddGravity (edict_t *ent, float scale);
-qboolean SV_RunThink (edict_t *ent);
+bool SV_RunThink (edict_t *ent);
 void SV_Physics_Toss (edict_t *ent);
 void SV_RunNewmis (void);
 void SV_Impact (edict_t *e1, edict_t *e2);
@@ -426,5 +426,5 @@
 void ClientReliableWrite_String(client_t *cl, char *s);
 void ClientReliableWrite_SZ(client_t *cl, void *data, int len);
 
-qboolean	ServerPaused(void);
+bool	ServerPaused(void);
 void	SV_SendServerInfoChange(char *key, char *value);
--- a/qw/sound.h
+++ b/qw/sound.h
@@ -26,9 +26,9 @@
 
 typedef struct
 {
-	qboolean		gamealive;
-	qboolean		soundalive;
-	qboolean		splitbuffer;
+	bool		gamealive;
+	bool		soundalive;
+	bool		splitbuffer;
 	int				channels;
 	int				samples;				// mono samples in buffer
 	int				submission_chunk;		// don't mix less than this #
@@ -88,7 +88,7 @@
 void SND_Spatialize(channel_t *ch);
 
 // initializes cycling through a DMA buffer and returns information on it
-qboolean SNDDMA_Init(void);
+bool SNDDMA_Init(void);
 
 // gets the current DMA position
 int SNDDMA_GetDMAPos(void);
@@ -117,7 +117,7 @@
 // number of times stepsnd() is called per second.
 //
 
-extern qboolean 		fakedma;
+extern bool 		fakedma;
 extern int 			fakedma_updates;
 extern int		paintedtime;
 extern volatile dma_t *shm;
@@ -127,7 +127,7 @@
 extern	cvar_t bgmvolume;
 extern	cvar_t volume;
 
-extern qboolean	snd_initialized;
+extern bool	snd_initialized;
 
 extern int		snd_blocked;
 
--- a/qw/sv_ccmds.c
+++ b/qw/sv_ccmds.c
@@ -3,7 +3,7 @@
 #include <stdio.h>
 #include "quakedef.h"
 
-qboolean	sv_allow_cheats;
+bool	sv_allow_cheats;
 
 int fp_messages=4, fp_persecond=4, fp_secondsdead=10;
 char fp_msg[255];
@@ -142,7 +142,7 @@
 Sets host_client and sv_player to the player with idnum Cmd_Argv(1)
 ==================
 */
-qboolean SV_SetPlayer (void)
+bool SV_SetPlayer (void)
 {
 	client_t	*cl;
 	int			i;
--- a/qw/sv_ents.c
+++ b/qw/sv_ents.c
@@ -78,7 +78,7 @@
 
 extern	int	sv_nailmodel, sv_supernailmodel, sv_playermodel;
 
-qboolean SV_AddNailUpdate (edict_t *ent)
+bool SV_AddNailUpdate (edict_t *ent)
 {
 	if (ent->v.modelindex != sv_nailmodel
 		&& ent->v.modelindex != sv_supernailmodel)
@@ -135,7 +135,7 @@
 Can delta from either a baseline or a previous packet_entity
 ==================
 */
-void SV_WriteDelta (entity_state_t *from, entity_state_t *to, sizebuf_t *msg, qboolean force)
+void SV_WriteDelta (entity_state_t *from, entity_state_t *to, sizebuf_t *msg, bool force)
 {
 	int		bits;
 	int		i;
--- a/qw/sv_main.c
+++ b/qw/sv_main.c
@@ -5,7 +5,7 @@
 
 quakeparms_t host_parms;
 
-qboolean	host_initialized;		// true if into command execution (compatability)
+bool	host_initialized;		// true if into command execution (compatability)
 
 double		host_frametime;
 double		realtime;				// without any filtering or bounding
@@ -63,7 +63,7 @@
 
 //============================================================================
 
-qboolean ServerPaused(void)
+bool ServerPaused(void)
 {
 	return sv.paused;
 }
@@ -103,7 +103,7 @@
 {
 	va_list		argptr;
 	static	char		string[1024];
-	static	qboolean inerror = false;
+	static	bool inerror = false;
 
 	if (inerror)
 		Sys_Error ("SV_Error: recursively entered (%s)", string);
@@ -492,7 +492,7 @@
 	int			edictnum;
 	char		*s;
 	int			clients, spectators;
-	qboolean	spectator;
+	bool	spectator;
 	int			qport;
 	int			version;
 	int			challenge;
@@ -951,7 +951,7 @@
 SV_FilterPacket
 =================
 */
-qboolean SV_FilterPacket (void)
+bool SV_FilterPacket (void)
 {
 	int		i;
 
--- a/qw/sv_move.c
+++ b/qw/sv_move.c
@@ -18,7 +18,7 @@
 */
 int c_yes, c_no;
 
-qboolean SV_CheckBottom (edict_t *ent)
+bool SV_CheckBottom (edict_t *ent)
 {
 	vec3_t	mins, maxs, start, stop;
 	trace_t	trace;
@@ -91,7 +91,7 @@
 pr_global_struct->trace_normal is set to the normal of the blocking wall
 =============
 */
-qboolean SV_movestep (edict_t *ent, vec3_t move, qboolean relink)
+bool SV_movestep (edict_t *ent, vec3_t move, bool relink)
 {
 	float		dz;
 	vec3_t		oldorg, neworg, end;
@@ -214,7 +214,7 @@
 ======================
 */
 void PF_changeyaw (void);
-qboolean SV_StepDirection (edict_t *ent, float yaw, float dist)
+bool SV_StepDirection (edict_t *ent, float yaw, float dist)
 {
 	vec3_t		move, oldorigin;
 	float		delta;
@@ -354,7 +354,7 @@
 
 ======================
 */
-qboolean SV_CloseEnough (edict_t *ent, edict_t *goal, float dist)
+bool SV_CloseEnough (edict_t *ent, edict_t *goal, float dist)
 {
 	int		i;
 	
--- a/qw/sv_phys.c
+++ b/qw/sv_phys.c
@@ -75,12 +75,12 @@
 //
 	for (i=0 ; i<3 ; i++)
 	{
-		if (IS_NAN(ent->v.velocity[i]))
+		if (isnanf(ent->v.velocity[i]))
 		{
 			Con_Printf ("Got a NaN velocity on %s\n", PR_GetString(ent->v.classname));
 			ent->v.velocity[i] = 0;
 		}
-		if (IS_NAN(ent->v.origin[i]))
+		if (isnanf(ent->v.origin[i]))
 		{
 			Con_Printf ("Got a NaN origin on %s\n", PR_GetString(ent->v.classname));
 			ent->v.origin[i] = 0;
@@ -102,7 +102,7 @@
 Returns false if the entity removed itself.
 =============
 */
-qboolean SV_RunThink (edict_t *ent)
+bool SV_RunThink (edict_t *ent)
 {
 	float	thinktime;
 
@@ -402,7 +402,7 @@
 
 ============
 */
-qboolean SV_Push (edict_t *pusher, vec3_t move)
+bool SV_Push (edict_t *pusher, vec3_t move)
 {
 	int			i, e;
 	edict_t		*check, *block;
@@ -766,7 +766,7 @@
 */
 void SV_Physics_Step (edict_t *ent)
 {
-	qboolean	hitsound;
+	bool	hitsound;
 
 // frefall if not onground
 	if ( ! ((int)ent->v.flags & (FL_ONGROUND | FL_FLY | FL_SWIM) ) )
--- a/qw/sv_send.c
+++ b/qw/sv_send.c
@@ -243,7 +243,7 @@
 	mleaf_t		*leaf;
 	int			leafnum;
 	int			j;
-	qboolean	reliable;
+	bool	reliable;
 
 	leaf = Mod_PointInLeaf (origin, sv.worldmodel);
 	if (!leaf)
@@ -337,8 +337,8 @@
     int			i;
 	int			ent;
 	vec3_t		origin;
-	qboolean	use_phs;
-	qboolean	reliable = false;
+	bool	use_phs;
+	bool	reliable = false;
 
 	if (volume < 0 || volume > 255)
 		SV_Error ("SV_StartSound: volume = %d", volume);
@@ -548,7 +548,7 @@
 SV_SendClientDatagram
 =======================
 */
-qboolean SV_SendClientDatagram (client_t *client)
+bool SV_SendClientDatagram (client_t *client)
 {
 	byte		buf[MAX_DATAGRAM];
 	sizebuf_t	msg;
--- a/qw/sv_user.c
+++ b/qw/sv_user.c
@@ -701,7 +701,7 @@
 SV_Say
 ==================
 */
-void SV_Say (qboolean team)
+void SV_Say (bool team)
 {
 	client_t *client;
 	int		j, tmp;
@@ -1514,7 +1514,7 @@
 	usercmd_t	oldest, oldcmd, newcmd;
 	client_frame_t	*frame;
 	vec3_t o;
-	qboolean	move_issued = false; //only allow one move command
+	bool	move_issued = false; //only allow one move command
 	int		checksumIndex;
 	byte	checksum, calculatedChecksum;
 	int		seq_hash;
--- a/qw/svmodel.c
+++ b/qw/svmodel.c
@@ -14,7 +14,7 @@
 void Mod_LoadSpriteModel (model_t *mod, void *buffer);
 void Mod_LoadBrushModel (model_t *mod, void *buffer);
 void Mod_LoadAliasModel (model_t *mod, void *buffer);
-model_t *Mod_LoadModel (model_t *mod, qboolean crash);
+model_t *Mod_LoadModel (model_t *mod, bool crash);
 
 byte	mod_novis[MAX_MAP_LEAFS/8];
 
@@ -177,7 +177,7 @@
 Loads a model into the cache
 ==================
 */
-model_t *Mod_LoadModel (model_t *mod, qboolean crash)
+model_t *Mod_LoadModel (model_t *mod, bool crash)
 {
 	void	*d;
 	unsigned *buf;
@@ -232,7 +232,7 @@
 Loads in a model for the given name
 ==================
 */
-model_t *Mod_ForName (char *name, qboolean crash)
+model_t *Mod_ForName (char *name, bool crash)
 {
 	model_t	*mod;
 	
--- a/qw/vid.c
+++ b/qw/vid.c
@@ -139,8 +139,6 @@
 void
 VID_Init(uchar *)
 {
-	int n;
-
 	vid.maxwarpwidth = WARP_WIDTH;
 	vid.maxwarpheight = WARP_HEIGHT;
 	vid.numpages = 2;
--- a/qw/vid.h
+++ b/qw/vid.h
@@ -58,7 +58,7 @@
 // sets the mode; only used by the Quake engine for resetting to mode 0 (the
 // base mode) on memory allocation failures
 
-void VID_HandlePause (qboolean pause);
+void VID_HandlePause (bool pause);
 // called only on Win32, when pause happens, so the mouse can be released
 
 void VID_LockBuffer (void);
--- a/qw/view.c
+++ b/qw/view.c
@@ -267,7 +267,7 @@
 V_CheckGamma
 =================
 */
-qboolean V_CheckGamma (void)
+bool V_CheckGamma (void)
 {
 	static float oldgammavalue;
 	
@@ -459,11 +459,11 @@
 void V_UpdatePalette (void)
 {
 	int		i, j;
-	qboolean	new;
+	bool	new;
 	byte	*basepal, *newpal;
 	byte	pal[768];
 	int		r,g,b;
-	qboolean force;
+	bool force;
 
 	V_CalcPowerupCshift ();
 	
--- a/qw/world.c
+++ b/qw/world.c
@@ -341,7 +341,7 @@
 
 ===============
 */
-void SV_LinkEdict (edict_t *ent, qboolean touch_triggers)
+void SV_LinkEdict (edict_t *ent, bool touch_triggers)
 {
 	areanode_t	*node;
 	
@@ -507,7 +507,7 @@
 
 ==================
 */
-qboolean SV_RecursiveHullCheck (hull_t *hull, int num, float p1f, float p2f, vec3_t p1, vec3_t p2, trace_t *trace)
+bool SV_RecursiveHullCheck (hull_t *hull, int num, float p1f, float p2f, vec3_t p1, vec3_t p2, trace_t *trace)
 {
 	dclipnode_t	*node;
 	mplane_t	*plane;
--- a/qw/world.h
+++ b/qw/world.h
@@ -6,9 +6,9 @@
 
 typedef struct
 {
-	qboolean	allsolid;	// if true, plane is not valid
-	qboolean	startsolid;	// if true, the initial point was in a solid area
-	qboolean	inopen, inwater;
+	bool	allsolid;	// if true, plane is not valid
+	bool	startsolid;	// if true, the initial point was in a solid area
+	bool	inopen, inwater;
 	float	fraction;		// time completed, 1.0 = didn't hit anything
 	vec3_t	endpos;			// final position
 	plane_t	plane;			// surface normal at impact
@@ -43,7 +43,7 @@
 // so it doesn't clip against itself
 // flags ent->v.modified
 
-void SV_LinkEdict (edict_t *ent, qboolean touch_triggers);
+void SV_LinkEdict (edict_t *ent, bool touch_triggers);
 // Needs to be called any time an entity changes origin, mins, maxs, or solid
 // flags ent->v.modified
 // sets ent->v.absmin and ent->v.absmax
--- a/qw/zone.c
+++ b/qw/zone.c
@@ -254,7 +254,7 @@
 int		hunk_low_used;
 int		hunk_high_used;
 
-qboolean	hunk_tempactive;
+bool	hunk_tempactive;
 int		hunk_tempmark;
 
 void R_FreeTextures (void);
@@ -288,7 +288,7 @@
 Otherwise, allocations with the same name will be totaled up before printing.
 ==============
 */
-void Hunk_Print (qboolean all)
+void Hunk_Print (bool all)
 {
 	hunk_t	*h, *next, *endlow, *starthigh, *endhigh;
 	int		count, sum;
@@ -539,7 +539,7 @@
 	struct cache_system_s	*lru_prev, *lru_next;	// for LRU flushing	
 } cache_system_t;
 
-cache_system_t *Cache_TryAlloc (int size, qboolean nobottom);
+cache_system_t *Cache_TryAlloc (int size, bool nobottom);
 
 cache_system_t	cache_head;
 
@@ -653,7 +653,7 @@
 Size should already include the header and padding
 ============
 */
-cache_system_t *Cache_TryAlloc (int size, qboolean nobottom)
+cache_system_t *Cache_TryAlloc (int size, bool nobottom)
 {
 	cache_system_t	*cs, *new;