shithub: qk1

Download patch

ref: b223b47fa37a9b31565f81d1fbf538f2d9465105
parent: 07150873bdc2c1c8570bb1f34821eab8ccb744cf
author: Sigrid Solveig Haflínudóttir <[email protected]>
date: Fri Nov 10 00:41:47 EST 2023

use bool as is

--- a/cl_input.c
+++ b/cl_input.c
@@ -151,7 +151,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/cl_parse.c
+++ b/cl_parse.c
@@ -305,7 +305,7 @@
 	int			i;
 	model_t		*model;
 	int			modnum;
-	qboolean	forcelink;
+	bool	forcelink;
 	entity_t	*ent;
 	int			num, skin, colormap;
 
--- a/client.h
+++ b/client.h
@@ -95,9 +95,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;
 	int			forcetrack;			// -1 = use normal cd track
 	int			td_lastframe;		// to meter out one message a frame
 	int			td_startframe;		// host_framecount at start
@@ -152,7 +152,7 @@
 // pitch drifting vars
 	float		idealpitch;
 	float		pitchvel;
-	qboolean	nodrift;
+	bool	nodrift;
 	float		driftmove;
 	double		laststop;
 
@@ -159,9 +159,9 @@
 	float		viewheight;
 	float		crouch;			// local amount for smoothing stepups
 
-	qboolean	paused;			// send over by server
-	qboolean	onground;
-	qboolean	inwater;
+	bool	paused;			// send over by server
+	bool	onground;
+	bool	inwater;
 
 	int			intermission;	// don't change view angle, full screen, etc
 	int			completed_time;	// latched at intermission start
--- a/cmd.c
+++ b/cmd.c
@@ -16,7 +16,7 @@
 int trashtest;
 int *trashspot;
 
-qboolean	cmd_wait;
+bool	cmd_wait;
 
 //=============================================================================
 
@@ -534,7 +534,7 @@
 Cmd_Exists
 ============
 */
-qboolean	Cmd_Exists (char *cmd_name)
+bool	Cmd_Exists (char *cmd_name)
 {
 	cmd_function_t	*cmd;
 
--- a/cmd.h
+++ b/cmd.h
@@ -64,7 +64,7 @@
 // register commands and functions to call for them.
 // The cmd_name is referenced later, so it should not be in temp memory
 
-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/common.c
+++ b/common.c
@@ -2,13 +2,13 @@
 
 cvar_t  registered = {"registered","0"};
 
-qboolean		msg_suppress_1 = 0;
+bool		msg_suppress_1 = 0;
 
 char	com_token[1024];
 int		com_argc;
 char	**com_argv;
 
-qboolean		standard_quake = true, rogue, hipnotic;
+bool		standard_quake = true, rogue, hipnotic;
 
 /*
 
@@ -178,7 +178,7 @@
 // reading functions
 //
 int					 msg_readcount;
-qboolean		msg_badread;
+bool		msg_badread;
 
 void MSG_BeginReading (void)
 {
--- a/common.h
+++ b/common.h
@@ -2,8 +2,8 @@
 
 typedef struct sizebuf_s
 {
-	qboolean	allowoverflow;	// if false, do a fatal
-	qboolean	overflowed;		// set to true if the buffer size failed
+	bool	allowoverflow;	// if false, do a fatal
+	bool	overflowed;		// set to true if the buffer size failed
 	char	*name;
 	byte	*data;
 	int		maxsize;
@@ -79,7 +79,7 @@
 void MSG_WriteAngleInt16 (sizebuf_t *sb, float f);
 
 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_ReadChar (void);
@@ -109,7 +109,7 @@
 //============================================================================
 
 extern	char		com_token[1024];
-extern	qboolean	com_eof;
+extern	bool	com_eof;
 
 char *COM_Parse (char *data);
 extern	int		com_argc;
@@ -125,4 +125,4 @@
 
 extern cvar_t registered;
 
-extern qboolean		standard_quake, rogue, hipnotic;
+extern bool		standard_quake, rogue, hipnotic;
--- a/console.c
+++ b/console.c
@@ -7,7 +7,7 @@
 #define		CON_TEXTSIZE	16384
 #define		MAXPRINTMSG		4096
 
-qboolean 	con_forcedup;		// because no entities to refresh
+bool 	con_forcedup;		// because no entities to refresh
 
 int			con_totallines;		// total lines in console scrollback
 int			con_backscroll;		// lines up from bottom to display
@@ -29,7 +29,7 @@
 extern	int		key_linepos;
 
 
-qboolean	con_initialized;
+bool	con_initialized;
 
 int			con_notifylines;		// scan lines to clear for notify lines
 
@@ -82,7 +82,7 @@
 Con_MessageMode_f
 ================
 */
-extern qboolean team_message;
+extern bool team_message;
 
 void Con_MessageMode_f (void)
 {
@@ -286,7 +286,7 @@
 {
 	va_list arg;
 	char msg[MAXPRINTMSG];
-	static qboolean	inupdate;
+	static bool	inupdate;
 
 	va_start(arg, fmt);
 	vsnprintf(msg, sizeof msg, fmt, arg);
@@ -453,7 +453,7 @@
 The typing input line at the bottom should only be drawn if typing is allowed
 ================
 */
-void Con_DrawConsole (int lines, qboolean drawinput)
+void Con_DrawConsole (int lines, bool drawinput)
 {
 	int				i, x, y;
 	int				rows;
--- a/console.h
+++ b/console.h
@@ -3,8 +3,8 @@
 //
 extern int con_totallines;
 extern int con_backscroll;
-extern	qboolean con_forcedup;	// because no entities to refresh
-extern qboolean con_initialized;
+extern	bool con_forcedup;	// because no entities to refresh
+extern bool con_initialized;
 extern byte *con_chars;
 extern	int	con_notifylines;		// scan lines to clear for notify lines
 
@@ -12,7 +12,7 @@
 
 void Con_CheckResize (void);
 void Con_Init (void);
-void Con_DrawConsole (int lines, qboolean drawinput);
+void Con_DrawConsole (int lines, bool drawinput);
 #pragma varargck	argpos	Con_Printf	1
 void Con_Printf (char *fmt, ...);
 #pragma varargck	argpos	Con_DPrintf	1
--- a/cvar.c
+++ b/cvar.c
@@ -113,7 +113,7 @@
 Handles variable inspection and changing from the console
 ============
 */
-qboolean	Cvar_Command (void)
+bool	Cvar_Command (void)
 {
 	cvar_t			*v;
 
--- a/cvar.h
+++ b/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 server;		// notifies players when changed
+	bool archive;		// set to true to cause it to be saved to vars.rc
+	bool server;		// notifies players when changed
 	float	value;
 	struct cvar_s *next;
 } cvar_t;
@@ -56,7 +56,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/d_iface.h
+++ b/d_iface.h
@@ -91,7 +91,7 @@
 extern int		d_spanpixcount;
 extern int		r_framecount;		// sequence # of current frame since Quake
 									//  started
-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
@@ -100,7 +100,7 @@
 											//  driver)
 extern float	r_aliasuvscale;		// scale-up factor for screen u and v
 									//  on Alias vertices passed to driver
-extern qboolean	r_dowarp;
+extern bool	r_dowarp;
 
 extern affinetridesc_t	r_affinetridesc;
 extern spritedesc_t		r_spritedesc;
--- a/d_init.c
+++ b/d_init.c
@@ -6,7 +6,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/d_local.h
+++ b/d_local.h
@@ -39,7 +39,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/d_surf.c
+++ b/d_surf.c
@@ -1,7 +1,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
 
 surfcache_t *sc_rover;
 
@@ -101,7 +101,7 @@
 surfcache_t	 *D_SCAlloc (int width, uintptr size)
 {
 	surfcache_t			 *new;
-	qboolean				wrapped_this_time;
+	bool				wrapped_this_time;
 
 	if ((width < 0) || (width > 256))
 		Host_Error("D_SCAlloc: bad cache width %d\n", width);
--- a/host.c
+++ b/host.c
@@ -12,7 +12,7 @@
 */
 int dedicated;
 
-qboolean	host_initialized;		// true if into command execution
+bool	host_initialized;		// true if into command execution
 
 double		host_frametime;
 double		host_time;
@@ -87,7 +87,7 @@
 {
 	va_list arg;
 	char s[1024];
-	static qboolean inerror = false;
+	static bool inerror = false;
 
 	if(inerror)
 		fatal("Host_Error: recursively entered");
@@ -249,7 +249,7 @@
 if (crash = true), don't bother sending signofs
 =====================
 */
-void SV_DropClient (qboolean crash)
+void SV_DropClient (bool crash)
 {
 	int		saveSelf;
 	int		i;
@@ -311,7 +311,7 @@
 This only happens at the end of a game, not between levels
 ==================
 */
-void Host_ShutdownServer(qboolean crash)
+void Host_ShutdownServer(bool crash)
 {
 	int		i;
 	int		count;
@@ -646,7 +646,7 @@
 */
 void Host_Shutdown(void)
 {
-	static qboolean isdown = false;
+	static bool isdown = false;
 
 	if (isdown)
 	{
--- a/host_cmd.c
+++ b/host_cmd.c
@@ -118,7 +118,7 @@
 		SV_ClientPrintf ("notarget ON\n");
 }
 
-qboolean noclip_anglehack;
+bool noclip_anglehack;
 
 void Host_Noclip_f (void)
 {
@@ -397,7 +397,7 @@
 }
 
 
-void Host_Say(qboolean teamonly)
+void Host_Say(bool teamonly)
 {
 	client_t *client;
 	client_t *save;
@@ -404,7 +404,7 @@
 	int		j;
 	char	*p;
 	char	text[64];
-	qboolean	fromServer = false;
+	bool	fromServer = false;
 
 	if (cmd_source == src_command)
 	{
@@ -904,7 +904,7 @@
 	char		*message = nil;
 	client_t	*save;
 	int			i;
-	qboolean	byNumber = false;
+	bool	byNumber = false;
 
 	if (cmd_source == src_command)
 	{
--- a/keys.c
+++ b/keys.c
@@ -21,8 +21,8 @@
 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
 
@@ -257,7 +257,7 @@
 //============================================================================
 
 char chat_buffer[32];
-qboolean team_message = false;
+bool team_message = false;
 
 void Key_Message (int key)
 {
@@ -544,7 +544,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/keys.h
+++ b/keys.h
@@ -105,7 +105,7 @@
 extern	int		key_count;			// incremented every key event
 extern	int		key_lastpress;
 
-void Key_Event (int key, qboolean down);
+void Key_Event (int key, bool down);
 void Key_Init (void);
 void Key_SetBinding (int keynum, char *binding);
 void Key_ClearStates (void);
--- a/menu.c
+++ b/menu.c
@@ -47,12 +47,12 @@
 void M_LanConfig_Key (int key);
 void M_GameOptions_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)
@@ -1353,7 +1353,7 @@
 
 int		msgNumber;
 int		m_quit_prevstate;
-qboolean	wasInMenus;
+bool	wasInMenus;
 
 char *quitMessage [] =
 {
@@ -1779,7 +1779,7 @@
 int	startepisode;
 int	startlevel;
 int maxplayers;
-qboolean m_serverInfoMessage = false;
+bool m_serverInfoMessage = false;
 double m_serverInfoMessageTime;
 
 void M_Menu_GameOptions_f (void)
--- a/model.c
+++ b/model.c
@@ -6,7 +6,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);
 
 #define	MAX_MOD_KNOWN	4096
 model_t	*mod_known;
@@ -225,7 +225,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)
 {
 	unsigned *buf;
 	byte stackbuf[1024];		// avoid dirtying the cache heap
@@ -287,7 +287,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/model.h
+++ b/model.h
@@ -287,8 +287,8 @@
 typedef struct model_s
 {
 	char		name[Npath];
-	qboolean	needload;		// bmodels and sprites don't cache normally
-	qboolean	blend;
+	int	needload;		// bmodels and sprites don't cache normally
+	bool	blend;
 
 	modtype_t	type;
 	int			numframes;
@@ -360,7 +360,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/net.h
+++ b/net.h
@@ -57,10 +57,10 @@
 	double			lastMessageTime;
 	double			lastSendTime;
 
-	qboolean		disconnected;
-	qboolean		canSend;
-	qboolean		sendNext;
-	qboolean		local;
+	bool		disconnected;
+	bool		canSend;
+	bool		sendNext;
+	bool		local;
 
 	int				driver;
 	int				landriver;
@@ -92,7 +92,7 @@
 
 struct Landrv{
 	char *name;
-	qboolean initialized;
+	bool initialized;
 	int	(*Init)(void);
 	void	(*Shutdown)(void);
 	int	(*Connect)(Addr *);
@@ -109,7 +109,7 @@
 
 struct Netdrv{
 	char *name;
-	qboolean initialized;
+	bool initialized;
 	int	(*Init)(void);
 	qsocket_t*	(*Connect)(char *);
 	qsocket_t*	(*CheckNewConnections)(void);
@@ -116,8 +116,8 @@
 	int	(*QGetMessage)(qsocket_t *);
 	int	(*QSendMessage)(qsocket_t *, sizebuf_t *);
 	int	(*SendUnreliableMessage)(qsocket_t *, sizebuf_t *);
-	qboolean	(*CanSendMessage)(qsocket_t *);
-	qboolean	(*CanSendUnreliableMessage)(qsocket_t *);
+	bool	(*CanSendMessage)(qsocket_t *);
+	bool	(*CanSendUnreliableMessage)(qsocket_t *);
 	void	(*Close)(qsocket_t *);
 	void	(*Shutdown)(void);
 };
@@ -157,7 +157,7 @@
 struct qsocket_s	*NET_Connect (char *host);
 // called by client to connect to a host.  Returns -1 if not able to
 
-qboolean NET_CanSendMessage (qsocket_t *sock);
+bool NET_CanSendMessage (qsocket_t *sock);
 // Returns true or false if the given qsocket can currently accept a
 // message to be transmitted.
 
@@ -189,32 +189,32 @@
 // A netcon_t number will not be reused until this function is called for it
 
 int			Datagram_Init (void);
-void		Datagram_Listen (qboolean state);
+void		Datagram_Listen (bool state);
 qsocket_t	*Datagram_Connect (char *host);
 qsocket_t 	*Datagram_CheckNewConnections (void);
 int			Datagram_GetMessage (qsocket_t *sock);
 int			Datagram_SendMessage (qsocket_t *sock, sizebuf_t *data);
 int			Datagram_SendUnreliableMessage (qsocket_t *sock, sizebuf_t *data);
-qboolean	Datagram_CanSendMessage (qsocket_t *sock);
-qboolean	Datagram_CanSendUnreliableMessage (qsocket_t *sock);
+bool	Datagram_CanSendMessage (qsocket_t *sock);
+bool	Datagram_CanSendUnreliableMessage (qsocket_t *sock);
 void	Datagram_Close(qsocket_t *);
 void		Datagram_Shutdown (void);
 
 int			Loop_Init (void);
-void		Loop_Listen (qboolean state);
+void		Loop_Listen (bool state);
 qsocket_t 	*Loop_Connect (char *host);
 qsocket_t 	*Loop_CheckNewConnections (void);
 int			Loop_GetMessage (qsocket_t *sock);
 int			Loop_SendMessage (qsocket_t *sock, sizebuf_t *data);
 int			Loop_SendUnreliableMessage (qsocket_t *sock, sizebuf_t *data);
-qboolean	Loop_CanSendMessage (qsocket_t *sock);
-qboolean	Loop_CanSendUnreliableMessage (qsocket_t *sock);
+bool	Loop_CanSendMessage (qsocket_t *sock);
+bool	Loop_CanSendUnreliableMessage (qsocket_t *sock);
 void		Loop_Close (qsocket_t *sock);
 void		Loop_Shutdown (void);
 
 int	UDP_Init(void);
 void	UDP_Shutdown(void);
-void	UDP_Listen(qboolean);
+void	UDP_Listen(bool);
 int	UDP_Connect(Addr *);
 int	udpread(uchar *, int, Addr *);
 int	udpwrite(uchar *, int, Addr *);
--- a/net_dgrm.c
+++ b/net_dgrm.c
@@ -23,7 +23,7 @@
 
 extern int m_return_state;
 extern int m_state;
-extern qboolean m_return_onerror;
+extern bool m_return_onerror;
 extern char m_return_reason[32];
 
 static int
@@ -115,7 +115,7 @@
 }
 
 
-qboolean Datagram_CanSendMessage (qsocket_t *sock)
+bool Datagram_CanSendMessage (qsocket_t *sock)
 {
 	if (sock->sendNext)
 		SendMessageNext (sock);
@@ -124,7 +124,7 @@
 }
 
 
-qboolean Datagram_CanSendUnreliableMessage (qsocket_t *)
+bool Datagram_CanSendUnreliableMessage (qsocket_t *)
 {
 	return true;
 }
--- a/net_loop.c
+++ b/net_loop.c
@@ -1,6 +1,6 @@
 #include "quakedef.h"
 
-qboolean	localconnectpending = false;
+bool	localconnectpending = false;
 qsocket_t	*loop_client = nil;
 qsocket_t	*loop_server = nil;
 
@@ -17,7 +17,7 @@
 }
 
 
-void Loop_Listen (qboolean) /*state*/
+void Loop_Listen (bool) /*state*/
 {
 }
 
@@ -178,7 +178,7 @@
 }
 
 
-qboolean Loop_CanSendMessage (qsocket_t *sock)
+bool Loop_CanSendMessage (qsocket_t *sock)
 {
 	if (!sock->driverdata)
 		return false;
@@ -186,7 +186,7 @@
 }
 
 
-qboolean Loop_CanSendUnreliableMessage (qsocket_t *) /*sock*/
+bool Loop_CanSendUnreliableMessage (qsocket_t *) /*sock*/
 {
 	return true;
 }
--- a/net_main.c
+++ b/net_main.c
@@ -411,7 +411,7 @@
 message to be transmitted.
 ==================
 */
-qboolean NET_CanSendMessage (qsocket_t *sock)
+bool NET_CanSendMessage (qsocket_t *sock)
 {
 	int		r;
 
@@ -434,8 +434,8 @@
 	double		start;
 	int			i;
 	int			count = 0;
-	qboolean	state1 [MAX_SCOREBOARD];
-	qboolean	state2 [MAX_SCOREBOARD];
+	bool	state1 [MAX_SCOREBOARD];
+	bool	state2 [MAX_SCOREBOARD];
 
 	for (i=0, host_client = svs.clients ; i<svs.maxclients ; i++, host_client++)
 	{
--- a/net_udp.c
+++ b/net_udp.c
@@ -59,7 +59,7 @@
 }
 
 void
-UDP_Listen(qboolean on)
+UDP_Listen(bool on)
 {
 	if(lpid < 0){
 		if(on)
--- a/pr_cmds.c
+++ b/pr_cmds.c
@@ -109,7 +109,7 @@
 }
 
 
-void SetMinMaxSize (edict_t *e, float *min, float *max, qboolean rotate)
+void SetMinMaxSize (edict_t *e, float *min, float *max, bool rotate)
 {
 	float	*angles;
 	vec3_t	rmin, rmax;
--- a/pr_edict.c
+++ b/pr_edict.c
@@ -23,7 +23,7 @@
 };
 
 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);
 
 cvar_t	nomonsters = {"nomonsters", "0"};
 cvar_t	gamecfg = {"gamecfg", "0"};
@@ -698,7 +698,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)
 {
 	ddef_t	*def;
 	char	*v, *w;
@@ -774,8 +774,8 @@
 char *ED_ParseEdict (char *data, edict_t *ent)
 {
 	ddef_t		*key;
-	qboolean	anglehack;
-	qboolean	init;
+	bool	anglehack;
+	bool	init;
 	char		keyname[256];
 	int			n;
 
--- a/pr_exec.c
+++ b/pr_exec.c
@@ -15,7 +15,7 @@
 static int			localstack_used;
 
 
-qboolean	pr_trace;
+bool	pr_trace;
 dfunction_t	*pr_xfunction;
 int			pr_xstatement;
 
--- a/progs.h
+++ b/progs.h
@@ -14,7 +14,7 @@
 #define	MAX_ENT_LEAFS	32
 typedef struct edict_s
 {
-	qboolean	free;
+	bool	free;
 	link_t		area;				// linked to a division node or leaf
 	byte		alpha;
 
@@ -104,7 +104,7 @@
 
 extern int		pr_argc;
 
-extern	qboolean	pr_trace;
+extern	bool	pr_trace;
 extern	dfunction_t	*pr_xfunction;
 extern	int			pr_xstatement;
 
--- a/quakedef.h
+++ b/quakedef.h
@@ -4,6 +4,10 @@
 #include <libc.h>
 #include <stdio.h>
 
+#ifdef __plan9__
+typedef enum {false, true} bool;
+#endif
+
 #define	QUAKE_GAME			// as opposed to utilities
 #define	VERSION				1.09
 //#define	PARANOID			// speed sapping error checking
@@ -109,7 +113,6 @@
 //===========================================
 
 typedef u8int byte;
-typedef enum {false, true} qboolean;
 
 #include "cvar.h"
 #include "common.h"
@@ -158,7 +161,7 @@
 #include "r_local.h"
 #include "d_local.h"
 
-extern qboolean noclip_anglehack;
+extern bool noclip_anglehack;
 
 
 //
@@ -167,7 +170,7 @@
 extern	cvar_t		sys_ticrate;
 extern	cvar_t		developer;
 
-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;
@@ -185,10 +188,10 @@
 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 cvar_t	pausable;
-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
 extern int			current_skill;		// skill level for currently loaded level (in case
 										//  the user changes the cvar while the level is
--- a/r_alias.c
+++ b/r_alias.c
@@ -50,7 +50,7 @@
 R_AliasCheckBBox
 ================
 */
-qboolean R_AliasCheckBBox (void)
+bool R_AliasCheckBBox (void)
 {
 	int					i, flags, frame, numv;
 	aliashdr_t			*pahdr;
@@ -58,7 +58,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;
 
--- a/r_bsp.c
+++ b/r_bsp.c
@@ -3,7 +3,7 @@
 //
 // current entity info
 //
-qboolean		insubmodel;
+bool		insubmodel;
 entity_t		*currententity;
 vec3_t			modelorg, base_modelorg;
 								// modelorg is the viewpoint reletive to
@@ -38,7 +38,7 @@
 
 static mvertex_t	*pfrontenter, *pfrontexit;
 
-static qboolean		makeclippededge;
+static bool		makeclippededge;
 
 
 //===========================================================================
--- a/r_draw.c
+++ b/r_draw.c
@@ -22,9 +22,9 @@
 
 static medge_t			*r_pedge;
 
-static qboolean r_leftclipped, r_rightclipped;
-static qboolean makeleftedge, makerightedge;
-static qboolean r_nearzionly;
+static bool r_leftclipped, r_rightclipped;
+static bool makeleftedge, makerightedge;
+static bool r_nearzionly;
 
 int		sintable[SIN_BUFFER_SIZE];
 int		intsintable[SIN_BUFFER_SIZE];
@@ -43,7 +43,7 @@
 static float r_u1, r_v1, r_lzi1;
 static int r_ceilv1;
 
-qboolean	r_lastvertvalid;
+bool	r_lastvertvalid;
 
 int
 surfdrawflags(int flags)
@@ -659,7 +659,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/r_local.h
+++ b/r_local.h
@@ -110,7 +110,7 @@
 //
 // current entity info
 //
-extern	qboolean		insubmodel;
+extern	bool		insubmodel;
 
 void R_DrawSprite (void);
 int R_RenderFace (msurface_t *fa, int clipflags);
@@ -185,7 +185,7 @@
 
 extern finalvert_t		*pfinalverts;
 
-qboolean R_AliasCheckBBox (void);
+bool R_AliasCheckBBox (void);
 
 //=========================================================
 // turbulence stuff
@@ -230,8 +230,8 @@
 
 extern int		r_frustum_indexes[4*6];
 extern int		r_maxsurfsseen, r_maxedgesseen, r_cnumsurfs;
-extern qboolean	r_surfsonstack;
-extern qboolean	r_dowarpold, r_viewchanged;
+extern bool	r_surfsonstack;
+extern bool	r_dowarpold, r_viewchanged;
 
 extern mleaf_t	*r_viewleaf, *r_oldviewleaf;
 
--- a/r_main.c
+++ b/r_main.c
@@ -8,19 +8,19 @@
 int			r_numallocatededges;
 int			r_numallocatedbasespans;
 byte		*r_basespans;
-qboolean	r_recursiveaffinetriangles = true;
+bool	r_recursiveaffinetriangles = true;
 float		r_aliasuvscale = 1.0;
 int			r_outofsurfaces;
 int			r_outofedges;
 int			r_outofspans;
 
-qboolean	r_dowarp, r_dowarpold, r_viewchanged;
+bool	r_dowarp, r_dowarpold, r_viewchanged;
 
 mvertex_t	*r_pcurrentvertbase;
 
 int			c_surf;
 int			r_maxsurfsseen, r_maxedgesseen, r_cnumsurfs;
-qboolean	r_surfsonstack;
+bool	r_surfsonstack;
 int			r_clipflags;
 
 byte		*r_warpbuffer;
--- a/r_shared.h
+++ b/r_shared.h
@@ -64,7 +64,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/render.h
+++ b/render.h
@@ -18,7 +18,7 @@
 
 typedef struct entity_s
 {
-	qboolean				forcelink;		// model changed
+	bool				forcelink;		// model changed
 
 	int						update_type;
 
@@ -128,7 +128,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/sbar.c
+++ b/sbar.c
@@ -23,7 +23,7 @@
 qpic_t	*sb_face_invuln;
 qpic_t	*sb_face_invis_invuln;
 
-qboolean	sb_showscores;
+bool	sb_showscores;
 
 int			sb_lines;			// scan lines to draw
 
--- a/screen.c
+++ b/screen.c
@@ -18,7 +18,7 @@
 cvar_t		scr_printspeed = {"scr_printspeed","8"};
 cvar_t		scr_showfps = {"showfps","0", true};
 
-qboolean	scr_initialized;		// ready to draw
+bool	scr_initialized;		// ready to draw
 
 qpic_t		*scr_net;
 qpic_t		*scr_turtle;
@@ -32,12 +32,12 @@
 
 vrect_t		scr_vrect;
 
-qboolean	scr_disabled_for_loading;
-qboolean	scr_drawloading;
+bool	scr_disabled_for_loading;
+bool	scr_drawloading;
 float		scr_disabled_time;
-qboolean	scr_skipupdate;
+bool	scr_skipupdate;
 
-qboolean	block_drawing;
+bool	block_drawing;
 
 /*
 ===============================================================================
@@ -524,7 +524,7 @@
 //=============================================================================
 
 char	*scr_notifystring;
-qboolean	scr_drawdialog;
+bool	scr_drawdialog;
 
 void SCR_DrawNotifyString (void)
 {
--- a/screen.h
+++ b/screen.h
@@ -20,8 +20,8 @@
 extern	int			sb_lines;
 
 extern	int			clearnotify;	// set to 0 whenever notify text is drawn
-extern	qboolean	scr_disabled_for_loading;
-extern	qboolean	scr_skipupdate;
+extern	bool	scr_disabled_for_loading;
+extern	bool	scr_skipupdate;
 
 extern cvar_t scr_viewsize;
 
@@ -29,4 +29,4 @@
 extern	int			scr_copytop;
 extern	int			scr_copyeverything;
 
-extern qboolean		block_drawing;
+extern bool		block_drawing;
--- a/server.h
+++ b/server.h
@@ -4,7 +4,7 @@
 	int			maxclientslimit;
 	struct client_s	*clients;		// [maxclients]
 	int			serverflags;		// episode completion information
-	qboolean	changelevel_issued;	// cleared when at SV_SpawnServer
+	bool	changelevel_issued;	// cleared when at SV_SpawnServer
 } server_static_t;
 
 //=============================================================================
@@ -13,11 +13,11 @@
 
 typedef struct
 {
-	qboolean	active;				// false if only a net client
+	bool	active;				// false if only a net client
 	protocol_t	*protocol;
 
-	qboolean	paused;
-	qboolean	loadgame;			// handle connections specially
+	bool	paused;
+	bool	loadgame;			// handle connections specially
 
 	double		time;
 
@@ -53,10 +53,10 @@
 
 typedef struct client_s
 {
-	qboolean		active;				// false = client is free
-	qboolean		spawned;			// false = don't send datagrams
-	qboolean		dropasap;			// has been told to go to another level
-	qboolean		sendsignon;			// only valid before spawned
+	bool		active;				// false = client is free
+	bool		spawned;			// false = don't send datagrams
+	bool		dropasap;			// has been told to go to another level
+	bool		sendsignon;			// only valid before spawned
 
 	double			last_message;		// reliable messages must be sent
 										// periodically
@@ -172,7 +172,7 @@
 void SV_StartSound (edict_t *entity, int channel, char *sample, int volume,
     float attenuation);
 
-void SV_DropClient (qboolean crash);
+void SV_DropClient (bool crash);
 
 void SV_SendClientMessages (void);
 void SV_ClearDatagram (void);
@@ -193,8 +193,8 @@
 
 void SV_Physics (void);
 
-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 (edict_t *ent, sizebuf_t *msg);
 
--- a/sv_main.c
+++ b/sv_main.c
@@ -747,7 +747,7 @@
 SV_SendClientDatagram
 =======================
 */
-qboolean SV_SendClientDatagram (client_t *client)
+bool SV_SendClientDatagram (client_t *client)
 {
 	static byte		buf[MAX_DATAGRAM_LOCAL];
 	sizebuf_t	msg;
--- a/sv_move.c
+++ b/sv_move.c
@@ -13,7 +13,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;
@@ -85,7 +85,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;
@@ -208,7 +208,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;
@@ -348,7 +348,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/sv_phys.c
+++ b/sv_phys.c
@@ -93,7 +93,7 @@
 Returns false if the entity removed itself.
 =============
 */
-qboolean SV_RunThink (edict_t *ent)
+bool SV_RunThink (edict_t *ent)
 {
 	float	thinktime;
 
@@ -613,7 +613,7 @@
 SV_CheckWater
 =============
 */
-qboolean SV_CheckWater (edict_t *ent)
+bool SV_CheckWater (edict_t *ent)
 {
 	vec3_t	point;
 	int		cont;
@@ -1059,7 +1059,7 @@
 */
 void SV_Physics_Step (edict_t *ent)
 {
-	qboolean	hitsound;
+	bool	hitsound;
 
 	// freefall if not onground
 	if ( ! ((int)ent->v.flags & (FL_ONGROUND | FL_FLY | FL_SWIM) ) )
--- a/sv_user.c
+++ b/sv_user.c
@@ -18,7 +18,7 @@
 float	*origin;
 float	*velocity;
 
-qboolean	onground;
+bool	onground;
 
 usercmd_t	cmd;
 
@@ -423,7 +423,7 @@
 Returns false if the client should be killed
 ===================
 */
-qboolean SV_ReadClientMessage (void)
+bool SV_ReadClientMessage (void)
 {
 	int		ret;
 	int		cmd;
--- a/unix/net_udp.c
+++ b/unix/net_udp.c
@@ -63,7 +63,7 @@
 
 //=============================================================================
 
-void UDP_Listen (qboolean state)
+void UDP_Listen (bool state)
 {
 	// enable listening
 	if (state)
--- a/unix/u.h
+++ b/unix/u.h
@@ -5,6 +5,7 @@
 #include <math.h>
 #include <setjmp.h>
 #include <stdarg.h>
+#include <stdbool.h>
 #include <stddef.h>
 #include <stdint.h>
 #include <stdio.h>
--- a/view.c
+++ b/view.c
@@ -264,7 +264,7 @@
 V_CheckGamma
 =================
 */
-qboolean V_CheckGamma (void)
+bool V_CheckGamma (void)
 {
 	static float oldgammavalue;
 
@@ -449,11 +449,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/world.c
+++ b/world.c
@@ -332,7 +332,7 @@
 
 ===============
 */
-void SV_LinkEdict (edict_t *ent, qboolean touch_triggers)
+void SV_LinkEdict (edict_t *ent, bool touch_triggers)
 {
 	areanode_t	*node;
 
@@ -501,7 +501,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)
 {
 	mclipnode_t	*node;
 	mplane_t	*plane;
--- a/world.h
+++ b/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
@@ -30,7 +30,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
@@ -43,7 +43,7 @@
 // the non-true version remaps the water current contents to content_water
 
 edict_t	*SV_TestEntityPosition (edict_t *ent);
-qboolean SV_RecursiveHullCheck (hull_t *hull, int num, float p1f, float p2f,
+bool SV_RecursiveHullCheck (hull_t *hull, int num, float p1f, float p2f,
 vec3_t p1, vec3_t p2, trace_t *trace);
 
 trace_t SV_Move (vec3_t start, vec3_t mins, vec3_t maxs, vec3_t end, int type, edict_t *passedict);