shithub: qk1

Download patch

ref: 54dfc8929a5f41d0fc78e9a25b50ebf5748f0496
parent: 0dc9ef358fb9de3a87a1f54ffaf6ce4b05892f24
author: Sigrid Solveig Haflínudóttir <sigrid@ftrv.se>
date: Wed Feb 7 20:36:55 EST 2024

add -Wmissing-prototypes; mark a bunch of funcs static

--- a/chase.c
+++ b/chase.c
@@ -16,7 +16,8 @@
 	Cvar_RegisterVariable (&chase_active);
 }
 
-void TraceLine (vec3_t start, vec3_t end, vec3_t impact)
+static void
+TraceLine(vec3_t start, vec3_t end, vec3_t impact)
 {
 	trace_t	trace;
 
--- a/cl_input.c
+++ b/cl_input.c
@@ -331,6 +331,10 @@
 		bits |= 2;
 	in_jump.state &= ~2;
 
+	if(in_use.state & 3)
+		bits |= 4;
+	in_use.state &= ~2;
+
 	MSG_WriteByte (&buf, bits);
 
 	MSG_WriteByte (&buf, in_impulse);
--- a/cl_main.c
+++ b/cl_main.c
@@ -30,7 +30,7 @@
 dlight_t		cl_dlights[MAX_DLIGHTS];
 int				cl_numvisedicts;
 
-void
+static void
 CL_ApplyInterpolation(entity_t *e, float frac)
 {
 	float d, f;
--- a/cmd.c
+++ b/cmd.c
@@ -179,7 +179,8 @@
 Cmd_Exec_f
 ===============
 */
-void Cmd_Exec_f (void)
+static void
+Cmd_Exec_f(void)
 {
 	char	*f;
 	void	*mark;
@@ -210,7 +211,8 @@
 Just prints the rest of the line to the console
 ===============
 */
-void Cmd_Echo_f (void)
+static void
+Cmd_Echo_f(void)
 {
 	int		i;
 
@@ -219,15 +221,8 @@
 	Con_Printf ("\n");
 }
 
-/*
-===============
-Cmd_Alias_f
-
-Creates a new command that executes a command string (possibly ; seperated)
-===============
-*/
-
-char *CopyString (char *in)
+static char *
+CopyString(char *in)
 {
 	char	*out;
 
@@ -236,7 +231,15 @@
 	return out;
 }
 
-void Cmd_Alias_f (void)
+/*
+===============
+Cmd_Alias_f
+
+Creates a new command that executes a command string (possibly ; seperated)
+===============
+*/
+static void
+Cmd_Alias_f(void)
 {
 	cmdalias_t	*a;
 	char		cmd[1024];
@@ -364,7 +367,8 @@
 Parses the given string into command line tokens.
 ============
 */
-void Cmd_TokenizeString (char *text)
+static void
+Cmd_TokenizeString(char *text)
 {
 	int		i;
 
--- a/console.c
+++ b/console.c
@@ -84,7 +84,8 @@
 */
 extern bool team_message;
 
-void Con_MessageMode_f (void)
+static void
+Con_MessageMode_f(void)
 {
 	key_dest = key_message;
 	team_message = false;
@@ -96,7 +97,8 @@
 Con_MessageMode2_f
 ================
 */
-void Con_MessageMode2_f (void)
+static void
+Con_MessageMode2_f(void)
 {
 	key_dest = key_message;
 	team_message = true;
@@ -193,7 +195,8 @@
 Con_Linefeed
 ===============
 */
-void Con_Linefeed (void)
+static void
+Con_Linefeed(void)
 {
 	con_x = 0;
 	con_current++;
@@ -354,7 +357,8 @@
 The input line scrolls horizontally if typing goes beyond the right edge
 ================
 */
-void Con_DrawInput (void)
+static void
+Con_DrawInput(void)
 {
 	int		y;
 	int		i;
--- a/d_polyse.c
+++ b/d_polyse.c
@@ -423,8 +423,8 @@
 D_PolysetSetUpForLineScan
 ====================
 */
-void D_PolysetSetUpForLineScan(fixed8_t startvertu, fixed8_t startvertv,
-		fixed8_t endvertu, fixed8_t endvertv)
+static void
+D_PolysetSetUpForLineScan(fixed8_t startvertu, fixed8_t startvertv, fixed8_t endvertu, fixed8_t endvertv)
 {
 	double		dm, dn;
 	int			tm, tn, n;
--- a/d_sky.c
+++ b/d_sky.c
@@ -10,7 +10,8 @@
 D_Sky_uv_To_st
 =================
 */
-void D_Sky_uv_To_st (int u, int v, fixed16_t *s, fixed16_t *t, float skydist)
+static void
+D_Sky_uv_To_st(int u, int v, fixed16_t *s, fixed16_t *t, float skydist)
 {
 	double	wu, wv;
 	vec3_t	end;
--- a/d_surf.c
+++ b/d_surf.c
@@ -24,7 +24,8 @@
 	return size;
 }
 
-void D_CheckCacheGuard (void)
+static void
+D_CheckCacheGuard(void)
 {
 	byte	*s;
 	int			 i;
@@ -35,7 +36,8 @@
 			fatal ("D_CheckCacheGuard: failed");
 }
 
-void D_ClearCacheGuard (void)
+static void
+D_ClearCacheGuard(void)
 {
 	byte	*s;
 	int			 i;
--- a/draw.c
+++ b/draw.c
@@ -368,7 +368,8 @@
 R_DrawRect8
 ==============
 */
-void R_DrawRect8 (vrect_t *prect, int rowbytes, pixel_t *psrc, int transparent)
+static void
+R_DrawRect8(vrect_t *prect, int rowbytes, pixel_t *psrc, int transparent)
 {
 	pixel_t	t, *pdest;
 	int		i, j, srcdelta, destdelta;
--- a/host.c
+++ b/host.c
@@ -120,7 +120,8 @@
 Host_FindMaxClients
 ================
 */
-void	Host_FindMaxClients (void)
+static void
+Host_FindMaxClients(void)
 {
 	svs.maxclients = 1;
 	cls.state = ca_disconnected;
@@ -150,7 +151,8 @@
 Host_InitLocal
 ======================
 */
-void Host_InitLocal (void)
+static void
+Host_InitLocal(void)
 {
 	Host_InitCommands ();
 
@@ -440,7 +442,8 @@
 	return 0;
 }
 
-void _Host_Frame (float time)
+static void
+_Host_Frame(float time)
 {
 	static double		time1 = 0;
 	static double		time2 = 0;
--- a/host_cmd.c
+++ b/host_cmd.c
@@ -29,7 +29,8 @@
 Host_Status_f
 ==================
 */
-void Host_Status_f (void)
+static void
+Host_Status_f(void)
 {
 	client_t	*client;
 	int			seconds;
@@ -82,7 +83,8 @@
 Sets client to godmode
 ==================
 */
-void Host_God_f (void)
+static void
+Host_God_f(void)
 {
 	if (cmd_source == src_command)
 	{
@@ -100,7 +102,8 @@
 		SV_ClientPrintf ("godmode ON\n");
 }
 
-void Host_Notarget_f (void)
+static void
+Host_Notarget_f(void)
 {
 	if (cmd_source == src_command)
 	{
@@ -120,7 +123,8 @@
 
 bool noclip_anglehack;
 
-void Host_Noclip_f (void)
+static void
+Host_Noclip_f(void)
 {
 	if (cmd_source == src_command)
 	{
@@ -152,7 +156,8 @@
 Sets client to flymode
 ==================
 */
-void Host_Fly_f (void)
+static void
+Host_Fly_f(void)
 {
 	if (cmd_source == src_command)
 	{
@@ -182,7 +187,8 @@
 
 ==================
 */
-void Host_Ping_f (void)
+static void
+Host_Ping_f(void)
 {
 	int		i, j;
 	float	total;
@@ -225,7 +231,8 @@
 command from the console.  Active clients are kicked off.
 ======================
 */
-void Host_Map_f (void)
+static void
+Host_Map_f(void)
 {
 	int		i;
 	char	name[Npath];
@@ -276,7 +283,8 @@
 Goes to a new map, taking all clients along
 ==================
 */
-void Host_Changelevel_f (void)
+static void
+Host_Changelevel_f(void)
 {
 	char	level[Npath];
 
@@ -302,7 +310,8 @@
 Restarts the current server for a dead player
 ==================
 */
-void Host_Restart_f (void)
+static void
+Host_Restart_f(void)
 {
 	char	mapname[Npath];
 
@@ -331,7 +340,8 @@
 User command to connect to server
 =====================
 */
-void Host_Connect_f (void)
+static void
+Host_Connect_f(void)
 {
 	char	name[Npath];
 
@@ -351,7 +361,8 @@
 Host_Name_f
 ======================
 */
-void Host_Name_f (void)
+static void
+Host_Name_f(void)
 {
 	char	newName[16];
 
@@ -389,15 +400,15 @@
 	MSG_WriteString (&sv.reliable_datagram, host_client->name);
 }
 
-
-void Host_Version_f (void)
+static void
+Host_Version_f(void)
 {
-	Con_Printf ("Version %4.2f\n", VERSION);
-	Con_Printf ("Exe: 00:00:00 Jun 22 1996\n");
+	Con_Printf("Version %4.2f\n", VERSION);
+	Con_Printf("Exe: <REDACTED>\n");
 }
 
-
-void Host_Say(bool teamonly)
+static void
+Host_Say(bool teamonly)
 {
 	client_t *client;
 	client_t *save;
@@ -460,20 +471,20 @@
 	Con_DPrintf("%s", &text[1]);
 }
 
-
-void Host_Say_f(void)
+static void
+Host_Say_f(void)
 {
 	Host_Say(false);
 }
 
-
-void Host_Say_Team_f(void)
+static void
+Host_Say_Team_f(void)
 {
 	Host_Say(true);
 }
 
-
-void Host_Tell_f(void)
+static void
+Host_Tell_f(void)
 {
 	client_t *client;
 	client_t *save;
@@ -530,7 +541,8 @@
 Host_Color_f
 ==================
 */
-void Host_Color_f(void)
+static void
+Host_Color_f(void)
 {
 	int		top, bottom;
 	int		playercolor;
@@ -581,7 +593,8 @@
 Host_Kill_f
 ==================
 */
-void Host_Kill_f (void)
+static void
+Host_Kill_f(void)
 {
 	if (cmd_source == src_command)
 	{
@@ -606,7 +619,8 @@
 Host_Pause_f
 ==================
 */
-void Host_Pause_f (void)
+static void
+Host_Pause_f(void)
 {
 
 	if (cmd_source == src_command)
@@ -643,7 +657,8 @@
 Host_PreSpawn_f
 ==================
 */
-void Host_PreSpawn_f (void)
+static void
+Host_PreSpawn_f(void)
 {
 	if(cmd_source == src_command){
 		Con_Printf("prespawn is not valid from the console\n");
@@ -663,7 +678,8 @@
 Host_Spawn_f
 ==================
 */
-void Host_Spawn_f (void)
+static void
+Host_Spawn_f(void)
 {
 	int		i;
 	client_t	*client;
@@ -786,7 +802,8 @@
 Host_Begin_f
 ==================
 */
-void Host_Begin_f (void)
+static void
+Host_Begin_f(void)
 {
 	if (cmd_source == src_command)
 	{
@@ -895,7 +912,8 @@
 Kicks a user off of the server
 ==================
 */
-void Host_Kick_f (void)
+static void
+Host_Kick_f(void)
 {
 	char		*who;
 	char		*message = nil;
@@ -987,7 +1005,8 @@
 Host_Give_f
 ==================
 */
-void Host_Give_f (void)
+static void
+Host_Give_f(void)
 {
 	char	*t;
 	int		v;
@@ -1141,7 +1160,8 @@
 	}
 }
 
-edict_t	*FindViewthing (void)
+static edict_t *
+FindViewthing(void)
 {
 	int		i;
 	edict_t	*e;
@@ -1161,7 +1181,8 @@
 Host_Viewmodel_f
 ==================
 */
-void Host_Viewmodel_f (void)
+static void
+Host_Viewmodel_f(void)
 {
 	edict_t	*e;
 	model_t	*m;
@@ -1186,7 +1207,8 @@
 Host_Viewframe_f
 ==================
 */
-void Host_Viewframe_f (void)
+static void
+Host_Viewframe_f(void)
 {
 	edict_t	*e;
 	int		f;
@@ -1204,8 +1226,8 @@
 	e->v.frame = f;
 }
 
-
-void PrintFrameName (model_t *m, int frame)
+static void
+PrintFrameName(model_t *m, int frame)
 {
 	aliashdr_t 			*hdr;
 	maliasframedesc_t	*pframedesc;
@@ -1223,7 +1245,8 @@
 Host_Viewnext_f
 ==================
 */
-void Host_Viewnext_f (void)
+static void
+Host_Viewnext_f(void)
 {
 	edict_t	*e;
 	model_t	*m;
@@ -1245,7 +1268,8 @@
 Host_Viewprev_f
 ==================
 */
-void Host_Viewprev_f (void)
+static void
+Host_Viewprev_f(void)
 {
 	edict_t	*e;
 	model_t	*m;
@@ -1277,7 +1301,8 @@
 Host_Startdemos_f
 ==================
 */
-void Host_Startdemos_f (void)
+static void
+Host_Startdemos_f(void)
 {
 	int		i, c;
 
@@ -1316,7 +1341,8 @@
 Return to looping demos
 ==================
 */
-void Host_Demos_f (void)
+static void
+Host_Demos_f(void)
 {
 	if (cls.state == ca_dedicated)
 		return;
@@ -1333,7 +1359,8 @@
 Return to looping demos
 ==================
 */
-void Host_Stopdemo_f (void)
+static void
+Host_Stopdemo_f(void)
 {
 	if (cls.state == ca_dedicated)
 		return;
@@ -1350,7 +1377,8 @@
 Host_InitCommands
 ==================
 */
-void Host_InitCommands (void)
+void
+Host_InitCommands(void)
 {
 	Cmd_AddCommand ("status", Host_Status_f);
 	Cmd_AddCommand ("quit", Host_Quit_f);
--- a/keys.c
+++ b/keys.c
@@ -137,7 +137,8 @@
 Interactive line editing and console scrollback
 ====================
 */
-void Key_Console (int key)
+static void
+Key_Console(int key)
 {
 	char	*cmd;
 
@@ -260,7 +261,8 @@
 char chat_buffer[32];
 bool team_message = false;
 
-void Key_Message (int key)
+static void
+Key_Message(int key)
 {
 	static int chat_bufferlen = 0;
 
@@ -310,7 +312,7 @@
 /* Returns a key number to be used to index keybindings[] by looking at the
  * given string. Single ascii characters return themselves, while the K_* names
  * are matched up. */
-int
+static int
 Key_StringToKeynum(char *s)
 {
 	keyname_t *k;
@@ -390,7 +392,8 @@
 Key_Unbind_f
 ===================
 */
-void Key_Unbind_f (void)
+static void
+Key_Unbind_f(void)
 {
 	int		b;
 
@@ -410,7 +413,8 @@
 	Key_SetBinding (b, "");
 }
 
-void Key_Unbindall_f (void)
+static void
+Key_Unbindall_f(void)
 {
 	int		i;
 
@@ -425,7 +429,8 @@
 Key_Bind_f
 ===================
 */
-void Key_Bind_f (void)
+static void
+Key_Bind_f(void)
 {
 	int			i, c, b;
 	char		cmd[1024];
--- a/menu.h
+++ b/menu.h
@@ -5,3 +5,4 @@
 void M_Keydown (int key);
 void M_Draw (void);
 void M_ToggleMenu_f (void);
+void M_DrawPic(int x, int y, qpic_t *pic);
--- a/meson.build
+++ b/meson.build
@@ -11,6 +11,7 @@
 )
 
 add_project_arguments(
+	'-Wmissing-prototypes',
 	'-Wno-unknown-pragmas',
 	'-Wno-missing-field-initializers',
 	'-Wno-implicit-fallthrough',
--- a/model.c
+++ b/model.c
@@ -2,10 +2,7 @@
 
 static char loadname[32];	// for hunk tags
 
-void Mod_LoadSpriteModel (model_t *mod, byte *buffer, int total);
-void Mod_LoadBrushModel (model_t *mod, byte *buffer, int total);
-void Mod_LoadAliasModel (model_t *mod, void *buffer);
-model_t *Mod_LoadModel (model_t *mod, bool crash);
+static model_t *Mod_LoadModel (model_t *mod, bool crash);
 
 #define	MAX_MOD_KNOWN	4096
 static model_t *mod_known;
@@ -224,7 +221,8 @@
 Loads a model into the cache
 ==================
 */
-model_t *Mod_LoadModel (model_t *mod, bool crash)
+static model_t *
+Mod_LoadModel (model_t *mod, bool crash)
 {
 	byte *buf;
 	int len;
--- a/model.h
+++ b/model.h
@@ -377,6 +377,7 @@
 
 void	Mod_Init (void);
 void	Mod_ClearAll (void);
+model_t *Mod_FindName (char *name);
 model_t *Mod_ForName (char *name, bool crash);
 void	*Mod_Extradata (model_t *mod);	// handles caching
 void	Mod_TouchModel (char *name);
@@ -386,3 +387,7 @@
 void	Mod_Print(void);
 
 texture_t *Load_ExternalTexture(char *map, char *name);
+
+void Mod_LoadBrushModel(model_t *mod, byte *buffer, int total);
+void Mod_LoadSpriteModel(model_t *mod, byte *buffer, int total);
+void Mod_LoadAliasModel(model_t *mod, void *buffer);
--- a/model_brush.c
+++ b/model_brush.c
@@ -1,7 +1,6 @@
 #include "quakedef.h"
 
 void BSP_MakeHull0(model_t *mod);
-model_t *Mod_FindName (char *name);
 
 int BSP_LoadClipnodes(model_t *mod, byte *in, int sz);
 int BSP_LoadEdges(model_t *mod, byte *in, int sz);
--- a/model_bsp.c
+++ b/model_bsp.c
@@ -1,5 +1,6 @@
 #include "quakedef.h"
 #include "softfloat.h"
+#include "model_bsp.h"
 
 static float
 dotadd80(float *a, float *b)
--- /dev/null
+++ b/model_bsp.h
@@ -1,0 +1,31 @@
+void BSP_MakeHull0(model_t *mod);
+void BSP_SetParent(mnode_t *node, mnode_t *parent);
+int BSP_CalcSurfaceExtents(model_t *mod, msurface_t *s);
+
+int BSP_LoadClipnodes(model_t *mod, byte *in, int sz);
+int BSP_LoadEdges(model_t *mod, byte *in, int sz);
+int BSP_LoadEntities(model_t *mod, byte *in, int sz);
+int BSP_LoadFaces(model_t *mod, byte *in, int sz);
+int BSP_LoadLeafs(model_t *mod, byte *in, int sz);
+int BSP_LoadLighting(model_t *mod, byte *in, int sz);
+int BSP_LoadMarksurfaces(model_t *mod, byte *in, int sz);
+int BSP_LoadNodes(model_t *mod, byte *in, int sz);
+int BSP_LoadPlanes(model_t *mod, byte *in, int sz);
+int BSP_LoadSubmodels(model_t *mod, byte *in, int sz);
+int BSP_LoadSurfedges(model_t *mod, byte *in, int sz);
+int BSP_LoadTexinfo(model_t *mod, byte *in, int sz);
+int BSP_LoadTextures(model_t *mod, byte *in, int sz);
+int BSP_LoadVertexes(model_t *mod, byte *in, int sz);
+int BSP_LoadVisibility(model_t *mod, byte *in, int sz);
+
+int BSP2_LoadClipnodes(model_t *mod, byte *in, int sz);
+int BSP2_LoadEdges(model_t *mod, byte *in, int sz);
+int BSP2_LoadFaces(model_t *mod, byte *in, int sz);
+int BSP2_LoadLeafs(model_t *mod, byte *in, int sz);
+int BSP2_LoadMarksurfaces(model_t *mod, byte *in, int sz);
+int BSP2_LoadNodes(model_t *mod, byte *in, int sz);
+
+int BSP30_LoadEntities(model_t *mod, byte *in, int sz);
+int BSP30_LoadLighting(model_t *mod, byte *in, int sz);
+int BSP30_LoadFaces(model_t *mod, byte *in, int sz);
+int BSP30_LoadTextures(model_t *mod, byte *in, int sz);
--- a/model_bsp2.c
+++ b/model_bsp2.c
@@ -1,8 +1,5 @@
 #include "quakedef.h"
-
-void BSP_SetParent(mnode_t *node, mnode_t *parent);
-void BSP_MakeHull0(model_t *mod);
-int BSP_CalcSurfaceExtents(model_t *mod, msurface_t *s);
+#include "model_bsp.h"
 
 int
 BSP2_LoadEdges(model_t *mod, byte *in, int sz)
--- a/model_bsp30.c
+++ b/model_bsp30.c
@@ -1,6 +1,5 @@
 #include "quakedef.h"
-
-int BSP_CalcSurfaceExtents(model_t *mod, msurface_t *s);
+#include "model_bsp.h"
 
 int
 BSP30_LoadEntities(model_t *mod, byte *in, int sz)
--- a/net_udp_unix.c
+++ b/net_udp_unix.c
@@ -180,7 +180,8 @@
 
 //=============================================================================
 
-int UDP_CheckNewConnections (void)
+static int
+UDP_CheckNewConnections(void)
 {
 	unsigned long available;
 
@@ -196,7 +197,8 @@
 
 //=============================================================================
 
-int UDP_Read (int socket, uint8_t *buf, int len, Addr *addr)
+static int
+UDP_Read(int socket, uint8_t *buf, int len, Addr *addr)
 {
 	socklen_t addrlen = sizeof (Addr);
 	int ret;
@@ -209,7 +211,8 @@
 
 //=============================================================================
 
-int UDP_MakeSocketBroadcastCapable (int socket)
+static int
+UDP_MakeSocketBroadcastCapable (int socket)
 {
 	int i = 1;
 
@@ -223,7 +226,8 @@
 
 //=============================================================================
 
-static int UDP_Write (int socket, uint8_t *buf, int len, Addr *addr)
+static int
+UDP_Write(int socket, uint8_t *buf, int len, Addr *addr)
 {
 	int ret;
 
@@ -235,7 +239,8 @@
 
 //=============================================================================
 
-int UDP_Broadcast (int socket, uint8_t *buf, int len)
+static int
+UDP_Broadcast(int socket, uint8_t *buf, int len)
 {
 	int ret;
 
@@ -268,7 +273,8 @@
 
 //=============================================================================
 
-int UDP_StringToAddr (char *string, Addr *addr)
+static int
+UDP_StringToAddr(char *string, Addr *addr)
 {
 	int ha1, ha2, ha3, ha4, hp;
 	int ipaddr;
@@ -299,7 +305,8 @@
 
 //=============================================================================
 
-int UDP_GetNameFromAddr (Addr *addr, char *name)
+static int
+UDP_GetNameFromAddr(Addr *addr, char *name)
 {
 	struct hostent *hostentry;
 
@@ -316,7 +323,8 @@
 
 //=============================================================================
 
-int UDP_GetAddrFromName(char *name, Addr *addr)
+static int
+UDP_GetAddrFromName(char *name, Addr *addr)
 {
 	struct hostent *hostentry;
 
--- a/net_udp_windows.c
+++ b/net_udp_windows.c
@@ -185,7 +185,8 @@
 
 //=============================================================================
 
-int UDP_CheckNewConnections (void)
+static int
+UDP_CheckNewConnections(void)
 {
 	unsigned long available;
 
--- a/pr_cmds.c
+++ b/pr_cmds.c
@@ -989,9 +989,6 @@
 	return true;
 }
 
-bool SV_StepDirection (edict_t *ent, float yaw, float dist);
-void SV_NewChaseDir (edict_t *actor, edict_t *enemy, float dist);
-
 static void
 PF_MoveToGoal(pr_t *pr)
 {
--- a/pr_edict.c
+++ b/pr_edict.c
@@ -13,8 +13,6 @@
 
 bool	ED_ParseEpair (pr_t *pr, void *base, ddef_t *key, char *s);
 
-void PR_InitSV(pr_t *pr);
-
 cvar_t	nomonsters = {"nomonsters", "0"};
 
 static cvar_t scratch1 = {"scratch1", "0"};
@@ -59,7 +57,7 @@
 	return PR_SetStr(pr, t);
 }
 
-int
+static int
 PR_StrSlot(pr_t *pr)
 {
 	if(pr->num_str >= pr->max_str){
@@ -105,7 +103,7 @@
 Sets everything to nil
 =================
 */
-void
+static void
 ED_ClearEdict(pr_t *pr, edict_t *e)
 {
 	memset(&e->v, 0, pr->entityfields * 4);
@@ -157,7 +155,8 @@
 FIXME: walk all entities and NULL out references to this entity
 =================
 */
-void ED_Free (edict_t *ed)
+void
+ED_Free(edict_t *ed)
 {
 	SV_UnlinkEdict (ed);		// unlink from world bsp
 
@@ -183,7 +182,8 @@
 ED_GlobalAtOfs
 ============
 */
-ddef_t *ED_GlobalAtOfs (pr_t *pr, int ofs)
+static ddef_t *
+ED_GlobalAtOfs(pr_t *pr, int ofs)
 {
 	ddef_t		*def;
 	int			i;
@@ -202,7 +202,8 @@
 ED_FieldAtOfs
 ============
 */
-ddef_t *ED_FieldAtOfs (pr_t *pr, int ofs)
+ddef_t *
+ED_FieldAtOfs(pr_t *pr, int ofs)
 {
 	ddef_t		*def;
 	int			i;
@@ -221,7 +222,8 @@
 ED_FindField
 ============
 */
-ddef_t *ED_FindField (pr_t *pr, char *name)
+static ddef_t *
+ED_FindField(pr_t *pr, char *name)
 {
 	ddef_t		*def;
 	int			i;
@@ -241,7 +243,8 @@
 ED_FindGlobal
 ============
 */
-ddef_t *ED_FindGlobal (pr_t *pr, char *name)
+static ddef_t *
+ED_FindGlobal(pr_t *pr, char *name)
 {
 	ddef_t		*def;
 	int			i;
@@ -315,7 +318,8 @@
 Returns a string describing *data in a type specific manner
 =============
 */
-char *PR_ValueString (pr_t *pr, etype_t type, eval_t *val)
+static char *
+PR_ValueString(pr_t *pr, etype_t type, eval_t *val)
 {
 	static char	line[256];
 	ddef_t		*def;
@@ -416,7 +420,8 @@
 padded to 20 field width
 ============
 */
-char *PR_GlobalString (pr_t *pr, int ofs)
+char *
+PR_GlobalString(pr_t *pr, int ofs)
 {
 	char	*s;
 	int		i;
@@ -442,7 +447,8 @@
 	return line;
 }
 
-char *PR_GlobalStringNoContents (pr_t *pr, int ofs)
+char *
+PR_GlobalStringNoContents(pr_t *pr, int ofs)
 {
 	int		i;
 	ddef_t	*def;
@@ -525,7 +531,8 @@
 For debugging, prints all the entities in the current server
 =============
 */
-void ED_PrintEdicts (void)
+void
+ED_PrintEdicts(void)
 {
 	int		i;
 
@@ -541,7 +548,8 @@
 For debugging, prints a single edicy
 =============
 */
-void ED_PrintEdict_f (void)
+static void
+ED_PrintEdict_f(void)
 {
 	int		i;
 
@@ -561,7 +569,8 @@
 For debugging
 =============
 */
-void ED_Count (void)
+static void
+ED_Count(void)
 {
 	int		i;
 	edict_t	*ent;
--- a/pr_exec.c
+++ b/pr_exec.c
@@ -93,10 +93,6 @@
 "BITOR"
 };
 
-char *PR_GlobalString (pr_t *pr, int ofs);
-char *PR_GlobalStringNoContents (pr_t *pr, int ofs);
-
-
 //=============================================================================
 
 /*
@@ -104,7 +100,8 @@
 PR_PrintStatement
 =================
 */
-void PR_PrintStatement (pr_t *pr, dstatement_t *s)
+static void
+PR_PrintStatement(pr_t *pr, dstatement_t *s)
 {
 	int		i;
 
@@ -144,7 +141,8 @@
 PR_StackTrace
 ============
 */
-void PR_StackTrace (pr_t *pr)
+static void
+PR_StackTrace(pr_t *pr)
 {
 	dfunction_t	*f;
 	int			i;
@@ -248,7 +246,8 @@
 Returns the new program statement counter
 ====================
 */
-int PR_EnterFunction (pr_t *pr, dfunction_t *f)
+static int
+PR_EnterFunction(pr_t *pr, dfunction_t *f)
 {
 	int		i, j, c, o;
 
@@ -287,7 +286,8 @@
 PR_LeaveFunction
 ====================
 */
-int PR_LeaveFunction (pr_t *pr)
+static int
+PR_LeaveFunction(pr_t *pr)
 {
 	int		i, c;
 
--- a/progs.h
+++ b/progs.h
@@ -149,3 +149,8 @@
 void ED_PrintNum(pr_t *pr, int ent);
 
 eval_t *GetEdictFieldValue(pr_t *pr, edict_t *ed, char *field);
+
+char *PR_GlobalString(pr_t *pr, int ofs);
+char *PR_GlobalStringNoContents(pr_t *pr, int ofs);
+void PF_changeyaw(pr_t *pr);
+void PR_InitSV(pr_t *pr);
--- a/r_aclip.c
+++ b/r_aclip.c
@@ -21,7 +21,8 @@
 pfv0 is the unclipped vertex, pfv1 is the z-clipped vertex
 ================
 */
-void R_Alias_clip_z (finalvert_t *pfv0, finalvert_t *pfv1, finalvert_t *out)
+static void
+R_Alias_clip_z(finalvert_t *pfv0, finalvert_t *pfv1, finalvert_t *out)
 {
 	float		scale;
 	auxvert_t	*pav0, *pav1, avout;
@@ -139,9 +140,8 @@
 	}
 }
 
-
-int R_AliasClip (finalvert_t *in, finalvert_t *out, int flag, int count,
-	void(*clip)(finalvert_t *pfv0, finalvert_t *pfv1, finalvert_t *out) )
+static int
+R_AliasClip(finalvert_t *in, finalvert_t *out, int flag, int count, void(*clip)(finalvert_t *pfv0, finalvert_t *pfv1, finalvert_t *out) )
 {
 	int			i,j,k;
 	int			flags, oldflags;
--- a/r_alias.c
+++ b/r_alias.c
@@ -225,7 +225,8 @@
 General clipped case
 ================
 */
-void R_AliasPreparePoints (trivertx_t *apverts, auxvert_t *auxverts, pixel_t *colormap)
+static void
+R_AliasPreparePoints(trivertx_t *apverts, auxvert_t *auxverts, pixel_t *colormap)
 {
 	int			i;
 	stvert_t	*pstverts;
@@ -409,7 +410,8 @@
 R_AliasTransformAndProjectFinalVerts
 ================
 */
-void R_AliasTransformAndProjectFinalVerts (finalvert_t *fv, stvert_t *pstverts, trivertx_t *pverts)
+static void
+R_AliasTransformAndProjectFinalVerts(finalvert_t *fv, stvert_t *pstverts, trivertx_t *pverts)
 {
 	int			i;
 	float		lightcos, zi;
@@ -477,7 +479,8 @@
 R_AliasPrepareUnclippedPoints
 ================
 */
-void R_AliasPrepareUnclippedPoints (trivertx_t *pverts, pixel_t *colormap)
+static void
+R_AliasPrepareUnclippedPoints(trivertx_t *pverts, pixel_t *colormap)
 {
 	stvert_t	*pstverts;
 	finalvert_t	*fv;
@@ -504,7 +507,8 @@
 R_AliasSetupSkin
 ===============
 */
-void R_AliasSetupSkin (void)
+static void
+R_AliasSetupSkin(void)
 {
 	int					skinnum;
 	int					i, numskins;
@@ -560,7 +564,8 @@
 R_AliasSetupLighting
 ================
 */
-void R_AliasSetupLighting (alight_t *plighting)
+static void
+R_AliasSetupLighting(alight_t *plighting)
 {
 	int i;
 
@@ -592,7 +597,8 @@
 set r_apverts
 =================
 */
-trivertx_t *R_AliasSetupFrame (void)
+static trivertx_t *
+R_AliasSetupFrame(void)
 {
 	int				frame;
 	int				i, numframes;
--- a/r_draw.c
+++ b/r_draw.c
@@ -67,7 +67,7 @@
 R_EmitEdge
 ================
 */
-void
+static void
 R_EmitEdge(mvertex_t *pv0, mvertex_t *pv1, view_t *view)
 {
 	edge_t	*edge, *pcheck;
@@ -309,7 +309,8 @@
 R_EmitCachedEdge
 ================
 */
-void R_EmitCachedEdge (void)
+static void
+R_EmitCachedEdge(void)
 {
 	edge_t		*pedge_t;
 
--- a/r_light.c
+++ b/r_light.c
@@ -115,7 +115,7 @@
 =============================================================================
 */
 
-int
+static int
 RecursiveLightPoint(mnode_t *node, vec3_t start, vec3_t end, int *r)
 {
 	float		front, back, frac;
--- a/r_main.c
+++ b/r_main.c
@@ -575,7 +575,8 @@
 R_DrawViewModel
 =============
 */
-void R_DrawViewModel (view_t *view)
+static void
+R_DrawViewModel(view_t *view)
 {
 	// FIXME: remove and do real lighting
 	vec3_t		lightvec = {-1, 0, 0};
@@ -642,7 +643,7 @@
 	R_AliasDrawModel(&r_viewlighting, &v);
 }
 
-void
+static void
 R_RenderSolidBrushes(view_t *v)
 {
 	entity_t *e;
--- a/r_misc.c
+++ b/r_misc.c
@@ -5,7 +5,8 @@
 R_CheckVariables
 ===============
 */
-void R_CheckVariables (void)
+static void
+R_CheckVariables(void)
 {
 	static float	oldbright;
 
--- a/render.h
+++ b/render.h
@@ -21,10 +21,13 @@
 	struct efrag_s			*efrag;			// linked list of efrags
 	pixel_t					*colormap;
 	struct entity_s			*last_reject;
-	entity_state_t			baseline;		// to fill in defaults in updates
-
+	struct mnode_s			*topnode;		// for bmodels, first world node
+											//  that splits bmodel, or NULL if
+											//  not split
 	double					msgtime;		// time of last update
 
+	entity_state_t			baseline;		// to fill in defaults in updates
+
 	vec3_t					msg_origins[2];	// last two updates (0 is newest)
 	vec3_t					origin;
 	vec3_t					msg_angles[2];	// last two updates (0 is newest)
@@ -39,15 +42,10 @@
 	int						dlightframe;	// dynamic lighting
 	int						dlightbits;
 
-	bool forcelink;		// model changed
 	int update_type;
+	int trivial_accept;
 	byte alpha;
-
-// FIXME: could turn these into a union
-	int						trivial_accept;
-	struct mnode_s			*topnode;		// for bmodels, first world node
-											//  that splits bmodel, or NULL if
-											//  not split
+	bool forcelink;		// model changed
 } entity_t;
 
 // !!! if this is changed, it must be changed in asm_draw.h too !!!
--- a/sbar.c
+++ b/sbar.c
@@ -42,7 +42,6 @@
 
 void Sbar_MiniDeathmatchOverlay (void);
 void Sbar_DeathmatchOverlay (void);
-void M_DrawPic (int x, int y, qpic_t *pic);
 
 /*
 ===============
@@ -51,7 +50,8 @@
 Tab key down
 ===============
 */
-void Sbar_ShowScores (void)
+static void
+Sbar_ShowScores(void)
 {
 	if (sb_showscores)
 		return;
@@ -66,7 +66,8 @@
 Tab key up
 ===============
 */
-void Sbar_DontShowScores (void)
+static void
+Sbar_DontShowScores(void)
 {
 	sb_showscores = false;
 	sb_updates = 0;
@@ -236,7 +237,8 @@
 Sbar_DrawPic
 =============
 */
-void Sbar_DrawPic (int x, int y, qpic_t *pic)
+static void
+Sbar_DrawPic(int x, int y, qpic_t *pic)
 {
 	if (cl.gametype == GAME_DEATHMATCH)
 		Draw_Pic (x /* + ((vid.width - 320)>>1)*/, y + (vid.height-SBAR_HEIGHT), pic);
@@ -249,7 +251,8 @@
 Sbar_DrawTransPic
 =============
 */
-void Sbar_DrawTransPic (int x, int y, qpic_t *pic)
+static void
+Sbar_DrawTransPic(int x, int y, qpic_t *pic)
 {
 	if (cl.gametype == GAME_DEATHMATCH)
 		Draw_TransPic (x /*+ ((vid.width - 320)>>1)*/, y + (vid.height-SBAR_HEIGHT), pic);
@@ -264,7 +267,8 @@
 Draws one solid graphics character
 ================
 */
-void Sbar_DrawCharacter (int x, int y, int num)
+static void
+Sbar_DrawCharacter(int x, int y, int num)
 {
 	if (cl.gametype == GAME_DEATHMATCH)
 		Draw_Character ( x /*+ ((vid.width - 320)>>1) */ + 4 , y + vid.height-SBAR_HEIGHT, num);
@@ -277,7 +281,8 @@
 Sbar_DrawString
 ================
 */
-void Sbar_DrawString (int x, int y, char *str)
+static void
+Sbar_DrawString(int x, int y, char *str)
 {
 	if (cl.gametype == GAME_DEATHMATCH)
 		Draw_String (x /*+ ((vid.width - 320)>>1)*/, y+ vid.height-SBAR_HEIGHT, str);
@@ -290,7 +295,8 @@
 Sbar_itoa
 =============
 */
-int Sbar_itoa (int num, char *buf)
+static int
+Sbar_itoa(int num, char *buf)
 {
 	char	*str;
 	int		pow10;
@@ -326,7 +332,8 @@
 Sbar_DrawNum
 =============
 */
-void Sbar_DrawNum (int x, int y, int num, int digits, int color)
+static void
+Sbar_DrawNum(int x, int y, int num, int digits, int color)
 {
 	char			str[12];
 	char			*ptr;
@@ -362,7 +369,8 @@
 Sbar_SortFrags
 ===============
 */
-void Sbar_SortFrags (void)
+static void
+Sbar_SortFrags(void)
 {
 	int		i, j, k;
 
@@ -387,7 +395,8 @@
 			}
 }
 
-int	Sbar_ColorForMap (int m)
+static int
+Sbar_ColorForMap(int m)
 {
 	return m < 128 ? m + 8 : m + 8;
 }
@@ -397,7 +406,8 @@
 Sbar_SoloScoreboard
 ===============
 */
-void Sbar_SoloScoreboard (void)
+static void
+Sbar_SoloScoreboard(void)
 {
 	char	str[80];
 	int		minutes, seconds, tens, units;
@@ -427,7 +437,8 @@
 Sbar_DrawScoreboard
 ===============
 */
-void Sbar_DrawScoreboard (void)
+static void
+Sbar_DrawScoreboard(void)
 {
 	Sbar_SoloScoreboard ();
 	if (cl.gametype == GAME_DEATHMATCH)
@@ -441,7 +452,8 @@
 Sbar_DrawInventory
 ===============
 */
-void Sbar_DrawInventory (void)
+static void
+Sbar_DrawInventory(void)
 {
 	int		i;
 	char	num[6];
@@ -661,7 +673,8 @@
 Sbar_DrawFrags
 ===============
 */
-void Sbar_DrawFrags (void)
+static void
+Sbar_DrawFrags(void)
 {
 	int				i, k, l;
 	int				top, bottom;
@@ -723,7 +736,8 @@
 Sbar_DrawFace
 ===============
 */
-void Sbar_DrawFace (void)
+static void
+Sbar_DrawFace(void)
 {
 	int		f, anim;
 
@@ -821,7 +835,8 @@
 Sbar_Draw
 ===============
 */
-void Sbar_Draw (void)
+void
+Sbar_Draw(void)
 {
 	if (scr_con_current == vid.height)
 		return;		// console is full screen
@@ -947,7 +962,8 @@
 
 ==================
 */
-void Sbar_IntermissionNumber (int x, int y, int num, int digits, int color)
+static void
+Sbar_IntermissionNumber(int x, int y, int num, int digits, int color)
 {
 	char			str[12];
 	char			*ptr;
--- a/seprint.c
+++ b/seprint.c
@@ -1,5 +1,4 @@
-#include <stdio.h>
-#include <stdarg.h>
+#include "platform.h"
 
 char *
 seprint(char *buf, char *e, char *fmt, ...)
--- a/server.h
+++ b/server.h
@@ -215,3 +215,6 @@
 void SV_RunClients (void);
 void SV_SaveSpawnparms (void);
 void SV_SpawnServer (char *server);
+
+bool SV_StepDirection (edict_t *ent, float yaw, float dist);
+void SV_NewChaseDir (edict_t *actor, edict_t *enemy, float dist);
--- a/sv_main.c
+++ b/sv_main.c
@@ -93,6 +93,7 @@
 	extern	cvar_t	sv_maxspeed;
 	extern	cvar_t	sv_accelerate;
 	extern	cvar_t	sv_idealpitchscale;
+	extern	cvar_t	sv_nouse;
 	extern	cvar_t	sv_aim;
 
 	Cvar_RegisterVariable (&sv_maxvelocity);
@@ -105,6 +106,7 @@
 	Cvar_RegisterVariable (&sv_idealpitchscale);
 	Cvar_RegisterVariable (&sv_aim);
 	Cvar_RegisterVariable (&sv_nostep);
+	Cvar_RegisterVariable (&sv_nouse);
 	Cvar_RegisterVariable (&developer);
 
 	Cmd_AddCommand("sv_protocol", SV_Protocol_f);
@@ -241,7 +243,8 @@
 This will be sent on the initial connection and upon each server load.
 ================
 */
-void SV_SendServerinfo (client_t *client)
+static void
+SV_SendServerinfo(client_t *client)
 {
 	char **s;
 	int n;
@@ -292,7 +295,8 @@
 once for a player each game, not once for each level change.
 ================
 */
-void SV_ConnectClient (int clientnum)
+static void
+SV_ConnectClient(int clientnum)
 {
 	int i, edictnum;
 	float spawn_parms[Nparms];
@@ -406,7 +410,8 @@
 static byte	*fatpvs;
 static int fatpvs_size;
 
-void SV_AddToFatPVS (vec3_t org, mnode_t *node, model_t *m)
+static void
+SV_AddToFatPVS(vec3_t org, mnode_t *node, model_t *m)
 {
 	int		i, sz;
 	byte	*pvs;
@@ -449,7 +454,8 @@
 given point.
 =============
 */
-byte *SV_FatPVS (vec3_t org, model_t *m)
+static byte *
+SV_FatPVS(vec3_t org, model_t *m)
 {
 	fatbytes = (m->numleafs+31)>>3;
 	if(fatpvs == nil || fatbytes > fatpvs_size){
@@ -470,7 +476,8 @@
 
 =============
 */
-void SV_WriteEntitiesToClient (edict_t	*clent, sizebuf_t *msg)
+static void
+SV_WriteEntitiesToClient(edict_t *clent, sizebuf_t *msg)
 {
 	u32int	bits;
 	int		e, i, model, alpha;
@@ -615,7 +622,8 @@
 
 =============
 */
-void SV_CleanupEnts (void)
+static void
+SV_CleanupEnts(void)
 {
 	int		e;
 	edict_t	*ent;
@@ -799,7 +807,8 @@
 SV_SendClientDatagram
 =======================
 */
-bool SV_SendClientDatagram (client_t *client)
+static bool
+SV_SendClientDatagram(client_t *client)
 {
 	static byte		buf[MAX_DATAGRAM_LOCAL];
 	sizebuf_t	msg;
@@ -837,7 +846,8 @@
 SV_UpdateToReliableMessages
 =======================
 */
-void SV_UpdateToReliableMessages (void)
+static void
+SV_UpdateToReliableMessages(void)
 {
 	int			i, j;
 	client_t *client;
@@ -879,7 +889,8 @@
 message buffer
 =======================
 */
-void SV_SendNop (client_t *client)
+static void
+SV_SendNop(client_t *client)
 {
 	sizebuf_t	msg;
 	byte		buf[4];
@@ -1023,7 +1034,8 @@
 
 ================
 */
-void SV_CreateBaseline (void)
+static void
+SV_CreateBaseline(void)
 {
 	u32int bits;
 	int			i;
@@ -1103,7 +1115,8 @@
 Tell all the clients that the server is changing levels
 ================
 */
-void SV_SendReconnect (void)
+static void
+SV_SendReconnect(void)
 {
 	byte data[128];
 	sizebuf_t	msg;
--- a/sv_move.c
+++ b/sv_move.c
@@ -202,8 +202,8 @@
 
 ======================
 */
-void PF_changeyaw (pr_t *pr);
-bool 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;
@@ -238,7 +238,8 @@
 
 ======================
 */
-void SV_FixCheckBottom (edict_t *ent)
+static void
+SV_FixCheckBottom(edict_t *ent)
 {
 	//Con_Printf ("SV_FixCheckBottom\n");
 
--- a/sv_phys.c
+++ b/sv_phys.c
@@ -26,7 +26,7 @@
 
 #define	MOVE_EPSILON	0.01
 
-void SV_Physics_Toss (edict_t *ent);
+static void SV_Physics_Toss (edict_t *ent);
 
 /*
 ================
@@ -33,7 +33,8 @@
 SV_CheckVelocity
 ================
 */
-void SV_CheckVelocity (edict_t *ent)
+static void
+SV_CheckVelocity(edict_t *ent)
 {
 	int		i;
 	float wishspeed;
@@ -67,7 +68,8 @@
 Returns false if the entity removed itself.
 =============
 */
-bool SV_RunThink (edict_t *ent)
+static bool
+SV_RunThink(edict_t *ent)
 {
 	float	thinktime;
 
@@ -94,7 +96,8 @@
 Two entities have touched, so run their touch functions
 ==================
 */
-void SV_Impact (edict_t *e1, edict_t *e2)
+static void
+SV_Impact(edict_t *e1, edict_t *e2)
 {
 	int		old_self, old_other;
 
@@ -131,7 +134,8 @@
 */
 #define	STOP_EPSILON	0.1
 
-int ClipVelocity (vec3_t in, vec3_t normal, vec3_t out, float overbounce)
+static int
+ClipVelocity(vec3_t in, vec3_t normal, vec3_t out, float overbounce)
 {
 	float	backoff;
 	float	change;
@@ -170,7 +174,8 @@
 ============
 */
 #define	MAX_CLIP_PLANES	5
-int SV_FlyMove (edict_t *ent, float time, trace_t *steptrace)
+static int
+SV_FlyMove(edict_t *ent, float time, trace_t *steptrace)
 {
 	int			bumpcount, numbumps;
 	vec3_t		dir;
@@ -304,10 +309,10 @@
 /*
 ============
 SV_AddGravity
-
 ============
 */
-void SV_AddGravity (edict_t *ent)
+static void
+SV_AddGravity(edict_t *ent)
 {
 	float	ent_gravity;
 
@@ -337,7 +342,8 @@
 Does not change the entities velocity at all
 ============
 */
-trace_t SV_PushEntity (edict_t *ent, vec3_t push)
+static trace_t
+SV_PushEntity(edict_t *ent, vec3_t push)
 {
 	trace_t	trace;
 	vec3_t	end;
@@ -368,7 +374,8 @@
 
 ============
 */
-void SV_PushMove (edict_t *pusher, float movetime)
+static void
+SV_PushMove(edict_t *pusher, float movetime)
 {
 	int			i, e;
 	edict_t		*check, *block;
@@ -491,7 +498,8 @@
 
 ================
 */
-void SV_Physics_Pusher (edict_t *ent)
+static void
+SV_Physics_Pusher(edict_t *ent)
 {
 	float	thinktime;
 	float	oldltime;
@@ -542,7 +550,8 @@
 clipping hull.
 =============
 */
-void SV_CheckStuck (edict_t *ent)
+static void
+SV_CheckStuck(edict_t *ent)
 {
 	int		i, j;
 	int		z;
@@ -588,7 +597,8 @@
 SV_CheckWater
 =============
 */
-bool SV_CheckWater (edict_t *ent)
+static bool
+SV_CheckWater(edict_t *ent)
 {
 	vec3_t	point;
 	int		cont;
@@ -625,7 +635,8 @@
 
 ============
 */
-void SV_WallFriction (edict_t *ent, trace_t *trace)
+static void
+SV_WallFriction(edict_t *ent, trace_t *trace)
 {
 	vec3_t		forward, right, up;
 	float		d, i;
@@ -659,7 +670,8 @@
 This is a hack, but in the interest of good gameplay...
 ======================
 */
-int SV_TryUnstick (edict_t *ent, vec3_t oldvel)
+static int
+SV_TryUnstick(edict_t *ent, vec3_t oldvel)
 {
 	int		i;
 	vec3_t	oldorg;
@@ -716,7 +728,8 @@
 ======================
 */
 #define	STEPSIZE	18
-void SV_WalkMove (edict_t *ent)
+static void
+SV_WalkMove(edict_t *ent)
 {
 	vec3_t		upmove, downmove;
 	vec3_t		oldorg, oldvel;
@@ -813,7 +826,8 @@
 Player character actions
 ================
 */
-void SV_Physics_Client (edict_t	*ent, int num)
+static void
+SV_Physics_Client(edict_t *ent, int num)
 {
 	if ( ! svs.clients[num-1].active )
 		return;		// unconnected slot
@@ -881,7 +895,8 @@
 Non moving objects can only think
 =============
 */
-void SV_Physics_None (edict_t *ent)
+static void
+SV_Physics_None(edict_t *ent)
 {
 	// regular thinking
 	SV_RunThink (ent);
@@ -894,7 +909,8 @@
 A moving object that doesn't obey physics
 =============
 */
-void SV_Physics_Noclip (edict_t *ent)
+static void
+SV_Physics_Noclip(edict_t *ent)
 {
 	// regular thinking
 	if (!SV_RunThink (ent))
@@ -920,7 +936,8 @@
 
 =============
 */
-void SV_CheckWaterTransition (edict_t *ent)
+static void
+SV_CheckWaterTransition(edict_t *ent)
 {
 	int		cont;
 	cont = SV_PointContents (ent->v.origin);
@@ -958,7 +975,8 @@
 Toss, bounce, and fly movement.  When onground, do nothing.
 =============
 */
-void SV_Physics_Toss (edict_t *ent)
+static void
+SV_Physics_Toss(edict_t *ent)
 {
 	trace_t	trace;
 	vec3_t	move;
@@ -1026,7 +1044,8 @@
 will fall if the floor is pulled out from under them.
 =============
 */
-void SV_Physics_Step (edict_t *ent)
+static void
+SV_Physics_Step(edict_t *ent)
 {
 	bool	hitsound;
 
--- a/sv_user.c
+++ b/sv_user.c
@@ -22,9 +22,9 @@
 
 usercmd_t	cmd;
 
-cvar_t	sv_idealpitchscale = {"sv_idealpitchscale","0.8"};
+cvar_t sv_idealpitchscale = {"sv_idealpitchscale","0.8"};
+cvar_t sv_nouse = {"sv_nouse", "0"};
 
-
 /*
 ===============
 SV_SetIdealPitch
@@ -100,7 +100,8 @@
 
 ==================
 */
-void SV_UserFriction (void)
+static void
+SV_UserFriction(void)
 {
 	float	*vel;
 	float	speed, newspeed, control;
@@ -147,7 +148,8 @@
 */
 cvar_t	sv_maxspeed = {"sv_maxspeed", "320", false, true};
 cvar_t	sv_accelerate = {"sv_accelerate", "10"};
-void SV_Accelerate (void)
+static void
+SV_Accelerate(void)
 {
 	int			i;
 	float		addspeed, accelspeed, currentspeed;
@@ -164,7 +166,8 @@
 		velocity[i] += accelspeed*wishdir[i];
 }
 
-void SV_AirAccelerate (vec3_t wishveloc)
+static void
+SV_AirAccelerate(vec3_t wishveloc)
 {
 	int			i;
 	float		addspeed, wishspd, accelspeed, currentspeed;
@@ -184,8 +187,8 @@
 		velocity[i] += accelspeed*wishveloc[i];
 }
 
-
-void DropPunchAngle (void)
+static void
+DropPunchAngle(void)
 {
 	float	len;
 
@@ -203,7 +206,8 @@
 
 ===================
 */
-void SV_WaterMove (void)
+static void
+SV_WaterMove(void)
 {
 	int		i;
 	vec3_t	wishvel;
@@ -257,7 +261,8 @@
 		velocity[i] += accelspeed * wishvel[i];
 }
 
-void SV_WaterJump (void)
+static void
+SV_WaterJump(void)
 {
 	if (sv.time > sv_player->v.teleport_time
 	|| !sv_player->v.waterlevel)
@@ -273,10 +278,10 @@
 /*
 ===================
 SV_AirMove
-
 ===================
 */
-void SV_AirMove (void)
+static void
+SV_AirMove(void)
 {
 	int			i;
 	vec3_t		wishvel;
@@ -384,7 +389,8 @@
 SV_ReadClientMove
 ===================
 */
-void SV_ReadClientMove (usercmd_t *move)
+static void
+SV_ReadClientMove(usercmd_t *move)
 {
 	int		i;
 	vec3_t	angle;
@@ -408,8 +414,10 @@
 
 	// read buttons
 	bits = MSG_ReadByte ();
-	host_client->edict->v.button0 = bits & 1;
-	host_client->edict->v.button2 = (bits & 2)>>1;
+	host_client->edict->v.button0 = (bits & 1) != 0;
+	host_client->edict->v.button2 = (bits & 2) != 0;
+	if(!sv_nouse.value)
+		host_client->edict->v.button1 = (bits & 4) != 0;
 
 	i = MSG_ReadByte ();
 	if (i)
@@ -423,7 +431,8 @@
 Returns false if the client should be killed
 ===================
 */
-bool SV_ReadClientMessage (void)
+static bool
+SV_ReadClientMessage(void)
 {
 	int ret, i, cmd;
 	client_t *tmp;
--- a/view.c
+++ b/view.c
@@ -90,7 +90,8 @@
 
 ===============
 */
-float V_CalcBob (void)
+static float
+V_CalcBob(void)
 {
 	float	bob;
 	float	cycle;
@@ -158,7 +159,8 @@
 lookspring is non 0, or when
 ===============
 */
-void V_DriftPitch (void)
+static void
+V_DriftPitch(void)
 {
 	float		delta, move;
 
@@ -239,7 +241,8 @@
 
 static byte gammatable[256];	// palette is sent through this
 
-void BuildGammaTable (float g)
+static void
+BuildGammaTable(float g)
 {
 	int		i, inf;
 
@@ -266,7 +269,8 @@
 V_CheckGamma
 =================
 */
-bool V_CheckGamma (void)
+static bool
+V_CheckGamma(void)
 {
 	static float oldgammavalue;
 
@@ -354,7 +358,8 @@
 V_cshift_f
 ==================
 */
-void V_cshift_f (void)
+static void
+V_cshift_f(void)
 {
 	cshift_empty.destcolor[0] = atoi(Cmd_Argv(1));
 	cshift_empty.destcolor[1] = atoi(Cmd_Argv(2));
@@ -370,7 +375,8 @@
 When you run over an item, the server sends this command
 ==================
 */
-void V_BonusFlash_f (void)
+static void
+V_BonusFlash_f(void)
 {
 	cl.cshifts[CSHIFT_BONUS].destcolor[0] = 215;
 	cl.cshifts[CSHIFT_BONUS].destcolor[1] = 186;
@@ -409,7 +415,8 @@
 V_CalcPowerupCshift
 =============
 */
-void V_CalcPowerupCshift (void)
+static void
+V_CalcPowerupCshift(void)
 {
 	if (cl.items & IT_QUAD)
 	{
@@ -524,7 +531,8 @@
 ==============================================================================
 */
 
-float angledelta (float a)
+static float
+angledelta(float a)
 {
 	a = anglemod(a);
 	if (a > 180)
@@ -537,7 +545,8 @@
 CalcGunAngle
 ==================
 */
-void CalcGunAngle (void)
+static void
+CalcGunAngle(void)
 {
 	float	yaw, pitch, move;
 	static float oldyaw = 0;
@@ -595,7 +604,8 @@
 V_BoundOffsets
 ==============
 */
-void V_BoundOffsets (void)
+static void
+V_BoundOffsets(void)
 {
 	entity_t	*ent;
 
@@ -625,7 +635,8 @@
 Idle swaying
 ==============
 */
-void V_AddIdle (void)
+static void
+V_AddIdle(void)
 {
 	r_refdef.view.angles[ROLL] += v_idlescale.value * sinf(cl.time*v_iroll_cycle.value) * v_iroll_level.value;
 	r_refdef.view.angles[PITCH] += v_idlescale.value * sinf(cl.time*v_ipitch_cycle.value) * v_ipitch_level.value;
@@ -640,7 +651,8 @@
 Roll is induced by movement and damage
 ==============
 */
-void V_CalcViewRoll (void)
+static void
+V_CalcViewRoll(void)
 {
 	float		side;
 
@@ -669,7 +681,8 @@
 
 ==================
 */
-void V_CalcIntermissionRefdef (void)
+static void
+V_CalcIntermissionRefdef(void)
 {
 	entity_t	*ent, *view;
 	float		old;
@@ -696,7 +709,8 @@
 
 ==================
 */
-void V_CalcRefdef (void)
+static void
+V_CalcRefdef(void)
 {
 	entity_t	*ent, *view;
 	int			i;
--- a/world.c
+++ b/world.c
@@ -44,7 +44,8 @@
 can just be stored out and get a proper hull_t structure.
 ===================
 */
-void SV_InitBoxHull (void)
+static void
+SV_InitBoxHull(void)
 {
 	int		i;
 	int		side;
@@ -81,7 +82,8 @@
 BSP trees instead of being compared directly.
 ===================
 */
-hull_t	*SV_HullForBox (vec3_t mins, vec3_t maxs)
+static hull_t
+*SV_HullForBox(vec3_t mins, vec3_t maxs)
 {
 	box_planes[0].dist = maxs[0];
 	box_planes[1].dist = mins[0];
@@ -93,8 +95,6 @@
 	return &box_hull;
 }
 
-
-
 /*
 ================
 SV_HullForEntity
@@ -105,7 +105,8 @@
 testing object's origin to get a point to use with the returned hull.
 ================
 */
-hull_t *SV_HullForEntity (edict_t *ent, vec3_t mins, vec3_t maxs, vec3_t offset)
+static hull_t *
+SV_HullForEntity(edict_t *ent, vec3_t mins, vec3_t maxs, vec3_t offset)
 {
 	model_t		*model;
 	vec3_t		size;
@@ -174,7 +175,8 @@
 
 ===============
 */
-areanode_t *SV_CreateAreaNode (int depth, vec3_t mins, vec3_t maxs)
+static areanode_t *
+SV_CreateAreaNode(int depth, vec3_t mins, vec3_t maxs)
 {
 	areanode_t	*anode;
 	vec3_t		size;
@@ -241,7 +243,8 @@
 SV_TouchLinks
 ====================
 */
-void SV_TouchLinks ( edict_t *ent, areanode_t *node )
+static void
+SV_TouchLinks(edict_t *ent, areanode_t *node)
 {
 	link_t		*l, *next;
 	edict_t		*touch;
@@ -622,7 +625,8 @@
 eventually rotation) of the end points
 ==================
 */
-trace_t SV_ClipMoveToEntity (edict_t *ent, vec3_t start, vec3_t mins, vec3_t maxs, vec3_t end)
+static trace_t
+SV_ClipMoveToEntity(edict_t *ent, vec3_t start, vec3_t mins, vec3_t maxs, vec3_t end)
 {
 	trace_t		trace;
 	vec3_t		offset;
@@ -664,7 +668,8 @@
 Mins and maxs enclose the entire area swept by the move
 ====================
 */
-void SV_ClipToLinks ( areanode_t *node, moveclip_t *clip )
+static void
+SV_ClipToLinks(areanode_t *node, moveclip_t *clip)
 {
 	link_t		*l, *next;
 	edict_t		*touch;
@@ -743,7 +748,8 @@
 SV_MoveBounds
 ==================
 */
-void SV_MoveBounds (vec3_t start, vec3_t mins, vec3_t maxs, vec3_t end, vec3_t boxmins, vec3_t boxmaxs)
+static void
+SV_MoveBounds(vec3_t start, vec3_t mins, vec3_t maxs, vec3_t end, vec3_t boxmins, vec3_t boxmaxs)
 {
 	/* debug to test against everything
 	boxmins[0] = boxmins[1] = boxmins[2] = -Q_MAXFLOAT;