From 85c9e0ab1e429231cca4b6caabf4bee20888175e Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Mon, 29 Oct 2001 17:46:03 +0000 Subject: [PATCH] more externs cleaned up --- configure.ac | 4 +++- include/QF/vfs.h | 1 + libs/audio/renderer/snd_dma.c | 2 -- libs/models/brush/sw32_model_brush.c | 2 +- libs/video/renderer/gl/gl_draw.c | 1 - libs/video/renderer/gl/gl_rmain.c | 1 - libs/video/renderer/gl/gl_rsurf.c | 2 -- libs/video/renderer/gl/gl_screen.c | 2 +- libs/video/renderer/sw/draw.c | 2 -- libs/video/renderer/sw32/draw.c | 2 -- libs/video/targets/in_win.c | 1 - nq/include/client.h | 2 ++ nq/source/net_udp.c | 2 -- nq/source/sys_unix.c | 3 +-- qw/include/cl_input.h | 1 + qw/include/cl_parse.h | 4 ++++ qw/include/server.h | 19 +++++++++++++++++++ qw/source/cl_demo.c | 2 -- qw/source/cl_ents.c | 5 ----- qw/source/cl_parse.c | 4 ---- qw/source/net_packetlog.c | 2 -- qw/source/sv_main.c | 13 ------------- qw/source/sv_sys_unix.c | 1 - qw/source/sv_user.c | 7 ------- qw/source/teamplay.c | 3 +-- tools/qwaq/main.c | 3 --- 26 files changed, 34 insertions(+), 57 deletions(-) diff --git a/configure.ac b/configure.ac index 96b6e4732..41d650971 100644 --- a/configure.ac +++ b/configure.ac @@ -1268,7 +1268,9 @@ if test "x$HAVE_ZLIB" = xyes; then HAVE_ZLIB="no, due to conflicting $x11_old_libz/libz.a" Z_LIBS="" else - AC_MSG_RESULT(no) + if test -n "$X_LIBS"; then + AC_MSG_RESULT(no) + fi AC_DEFINE(HAVE_ZLIB) fi fi diff --git a/include/QF/vfs.h b/include/QF/vfs.h index 8915a31e7..f89700a2f 100644 --- a/include/QF/vfs.h +++ b/include/QF/vfs.h @@ -43,6 +43,7 @@ extern struct cvar_s *fs_sharepath; extern struct cvar_s *fs_basegame; extern struct cvar_s *fs_skinbase; +extern int file_from_pak; extern int com_filesize; struct cache_user_s; diff --git a/libs/audio/renderer/snd_dma.c b/libs/audio/renderer/snd_dma.c index 46aabc5e5..3e49bb908 100644 --- a/libs/audio/renderer/snd_dma.c +++ b/libs/audio/renderer/snd_dma.c @@ -65,8 +65,6 @@ void SND_Init_Cvars (); // Internal sound data & structures =========================================== -//extern double host_frametime; // From host.h - int snd_blocked = 0; static qboolean snd_ambient = 1; diff --git a/libs/models/brush/sw32_model_brush.c b/libs/models/brush/sw32_model_brush.c index f16060991..199a22730 100644 --- a/libs/models/brush/sw32_model_brush.c +++ b/libs/models/brush/sw32_model_brush.c @@ -43,7 +43,7 @@ static const char rcsid[] = #include "QF/model.h" -const int mod_lightmap_bytes = 1; // was extern const int mod_lightmap_bytes; +const int mod_lightmap_bytes = 1; void diff --git a/libs/video/renderer/gl/gl_draw.c b/libs/video/renderer/gl/gl_draw.c index f176a2bed..bd03fa6c2 100644 --- a/libs/video/renderer/gl/gl_draw.c +++ b/libs/video/renderer/gl/gl_draw.c @@ -387,7 +387,6 @@ Draw_Crosshair (int swap) { unsigned char *pColor; int x, y; - extern vrect_t scr_vrect; switch (crosshair->int_val) { case 0: diff --git a/libs/video/renderer/gl/gl_rmain.c b/libs/video/renderer/gl/gl_rmain.c index a4ec99cf5..5d152a764 100644 --- a/libs/video/renderer/gl/gl_rmain.c +++ b/libs/video/renderer/gl/gl_rmain.c @@ -320,7 +320,6 @@ R_SetupGL (void) { float screenaspect; int x, x2, y2, y, w, h; - extern int glwidth, glheight; // set up viewpoint qfglMatrixMode (GL_PROJECTION); diff --git a/libs/video/renderer/gl/gl_rsurf.c b/libs/video/renderer/gl/gl_rsurf.c index 57ba221f5..be1d03b28 100644 --- a/libs/video/renderer/gl/gl_rsurf.c +++ b/libs/video/renderer/gl/gl_rsurf.c @@ -90,8 +90,6 @@ glRect_t lightmap_rectchange[MAX_LIGHTMAPS]; msurface_t *waterchain = NULL; msurface_t *sky_chain; -//extern vec3_t shadecolor; // Ender (Extend) Colormod - // LordHavoc: place for gl_rsurf setup code void diff --git a/libs/video/renderer/gl/gl_screen.c b/libs/video/renderer/gl/gl_screen.c index 4e5beb1b6..93a75c943 100644 --- a/libs/video/renderer/gl/gl_screen.c +++ b/libs/video/renderer/gl/gl_screen.c @@ -406,7 +406,7 @@ SCR_DrawFPS (int swap) int i, x, y; static int lastfps; - extern int fps_count; + extern int fps_count; //FIXME if (!show_fps->int_val) return; diff --git a/libs/video/renderer/sw/draw.c b/libs/video/renderer/sw/draw.c index 4897d3ab0..8ab477938 100644 --- a/libs/video/renderer/sw/draw.c +++ b/libs/video/renderer/sw/draw.c @@ -324,8 +324,6 @@ void Draw_Crosshair (int swap) { int x, y; - extern cvar_t *crosshair, *cl_crossx, *cl_crossy, *crosshaircolor; - extern vrect_t scr_vrect; byte c = crosshaircolor->int_val; if (crosshair->int_val == 2) { diff --git a/libs/video/renderer/sw32/draw.c b/libs/video/renderer/sw32/draw.c index 510380911..22a6185ba 100644 --- a/libs/video/renderer/sw32/draw.c +++ b/libs/video/renderer/sw32/draw.c @@ -361,8 +361,6 @@ void Draw_Crosshair (int swap) { int x, y; - extern cvar_t *crosshair, *cl_crossx, *cl_crossy, *crosshaircolor; - extern vrect_t scr_vrect; byte c = crosshaircolor->int_val; if (crosshair->int_val == 2) { diff --git a/libs/video/targets/in_win.c b/libs/video/targets/in_win.c index 3a4cd1a02..ef97f40bd 100644 --- a/libs/video/targets/in_win.c +++ b/libs/video/targets/in_win.c @@ -775,7 +775,6 @@ MainWndProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) LONG lRet = 1; int fActive, fMinimized, temp; int key, unicode; - extern unsigned int uiWheelMessage; if (uMsg == uiWheelMessage) uMsg = WM_MOUSEWHEEL; diff --git a/nq/include/client.h b/nq/include/client.h index 1525c24c8..06b86b11c 100644 --- a/nq/include/client.h +++ b/nq/include/client.h @@ -364,6 +364,8 @@ extern kbutton_t in_up, in_down; extern double realtime; +extern qboolean recording; + void Cvar_Info (struct cvar_s *var); void CL_UpdateScreen (double realtime); diff --git a/nq/source/net_udp.c b/nq/source/net_udp.c index dc06b48a6..e3dd9532a 100644 --- a/nq/source/net_udp.c +++ b/nq/source/net_udp.c @@ -102,8 +102,6 @@ static const char rcsid[] = # endif #endif -//extern int gethostname (char *, int); - static int net_acceptsocket = -1; // socket for fielding new // connections static int net_controlsocket; diff --git a/nq/source/sys_unix.c b/nq/source/sys_unix.c index b9620526f..ced154e95 100644 --- a/nq/source/sys_unix.c +++ b/nq/source/sys_unix.c @@ -56,6 +56,7 @@ static const char rcsid[] = #include "QF/qargs.h" #include "QF/sys.h" +#include "client.h" #include "host.h" #include "server.h" @@ -149,8 +150,6 @@ main (int c, const char *v[]) double time, oldtime, newtime; quakeparms_t parms; - extern VFile *vcrFile; - extern int recording; int j; signal (SIGFPE, SIG_IGN); diff --git a/qw/include/cl_input.h b/qw/include/cl_input.h index 2e1ef689d..0ea907806 100644 --- a/qw/include/cl_input.h +++ b/qw/include/cl_input.h @@ -51,5 +51,6 @@ extern kbutton_t in_left, in_right, in_forward, in_back; extern kbutton_t in_lookup, in_lookdown, in_moveleft, in_moveright; extern kbutton_t in_use, in_jump, in_attack; extern kbutton_t in_up, in_down; +extern int in_impulse; #endif diff --git a/qw/include/cl_parse.h b/qw/include/cl_parse.h index 2e90e84ea..c4be728ea 100644 --- a/qw/include/cl_parse.h +++ b/qw/include/cl_parse.h @@ -43,6 +43,10 @@ extern int cl_playerindex; extern int cl_flagindex; extern int cl_spikeindex; extern int viewentity; +extern int cl_h_playerindex; +extern int cl_gib1index; +extern int cl_gib2index; +extern int cl_gib3index; int CL_CalcNet (void); void CL_ParseServerMessage (void); diff --git a/qw/include/server.h b/qw/include/server.h index fe7279ced..be8aaf737 100644 --- a/qw/include/server.h +++ b/qw/include/server.h @@ -557,6 +557,23 @@ extern struct cvar_s *sv_maxrate; extern struct cvar_s *sv_timestamps; extern struct cvar_s *sv_timefmt; extern struct cvar_s *sv_phs; +extern struct cvar_s *sv_maxvelocity; +extern struct cvar_s *sv_gravity; +extern struct cvar_s *sv_aim; +extern struct cvar_s *sv_stopspeed; +extern struct cvar_s *sv_spectatormaxspeed; +extern struct cvar_s *sv_accelerate; +extern struct cvar_s *sv_airaccelerate; +extern struct cvar_s *sv_wateraccelerate; +extern struct cvar_s *sv_friction; +extern struct cvar_s *sv_waterfriction; +extern struct cvar_s *pr_double_remove; +extern struct cvar_s *allow_download; +extern struct cvar_s *allow_download_skins; +extern struct cvar_s *allow_download_models; +extern struct cvar_s *allow_download_sounds; +extern struct cvar_s *allow_download_maps; + extern int fp_messages; extern int fp_persecond; extern int fp_secondsdead; @@ -567,4 +584,6 @@ extern char fp_msg[255]; extern int sv_nailmodel, sv_supernailmodel, sv_playermodel; +extern int con_printf_no_log; + #endif // _SERVER_H diff --git a/qw/source/cl_demo.c b/qw/source/cl_demo.c index ee573bbac..6d7e04725 100644 --- a/qw/source/cl_demo.c +++ b/qw/source/cl_demo.c @@ -414,8 +414,6 @@ CL_Record_f (void) player_info_t *player; sizebuf_t buf; - extern char gamedirfile[]; - c = Cmd_Argc (); if (c != 2) { Con_Printf ("record \n"); diff --git a/qw/source/cl_ents.c b/qw/source/cl_ents.c index fef3b9e39..a9d3f3035 100644 --- a/qw/source/cl_ents.c +++ b/qw/source/cl_ents.c @@ -373,9 +373,6 @@ CL_LinkPacketEntities (void) model_t *model; packet_entities_t *pack; - extern int cl_h_playerindex, cl_gib1index, cl_gib2index, cl_gib3index; - extern int cl_playerindex; - pack = &cl.frames[cls.netchan.incoming_sequence & UPDATE_MASK].packet_entities; @@ -966,8 +963,6 @@ CL_SetSolidPlayers (int playernum) physent_t *pent; struct predicted_player *pplayer; - extern vec3_t player_maxs, player_mins; - if (!cl_solid_players->int_val) return; diff --git a/qw/source/cl_parse.c b/qw/source/cl_parse.c index 097ca9261..5aa3666e4 100644 --- a/qw/source/cl_parse.c +++ b/qw/source/cl_parse.c @@ -253,8 +253,6 @@ Model_NextDownload (void) char *s; int i; - extern char gamedirfile[]; - if (cls.downloadnumber == 0) { Con_Printf ("Checking models...\n"); CL_UpdateScreen (realtime); @@ -649,8 +647,6 @@ CL_ParseServerData (void) qboolean cflag = false; net_svc_serverdata_t serverdata; - extern char gamedirfile[MAX_OSPATH]; - Con_DPrintf ("Serverdata packet received.\n"); if (NET_SVC_ServerData_Parse (&serverdata, net_message)) { diff --git a/qw/source/net_packetlog.c b/qw/source/net_packetlog.c index 12c2a2404..b318ee00a 100644 --- a/qw/source/net_packetlog.c +++ b/qw/source/net_packetlog.c @@ -62,8 +62,6 @@ static const char rcsid[] = cvar_t *net_packetlog; cvar_t *net_loglevel; -//extern server_t sv; - int Net_LogStart (const char *fname); void Analyze_Server_Packet (const byte *data, int len); diff --git a/qw/source/sv_main.c b/qw/source/sv_main.c index 9d2bdd246..bd4943e44 100644 --- a/qw/source/sv_main.c +++ b/qw/source/sv_main.c @@ -493,8 +493,6 @@ SVC_Status (void) client_t *cl; int ping, bottom, top, i; - extern int con_printf_no_log; - if (!sv_allow_status->int_val) return; if (CheckForFlood (FLOOD_STATUS)) @@ -1893,17 +1891,6 @@ void SV_InitLocal (void) { int i; - extern cvar_t *sv_maxvelocity; - extern cvar_t *sv_gravity; - extern cvar_t *sv_aim; - extern cvar_t *sv_stopspeed; - extern cvar_t *sv_spectatormaxspeed; - extern cvar_t *sv_accelerate; - extern cvar_t *sv_airaccelerate; - extern cvar_t *sv_wateraccelerate; - extern cvar_t *sv_friction; - extern cvar_t *sv_waterfriction; - extern cvar_t *pr_double_remove; SV_UserInit (); diff --git a/qw/source/sv_sys_unix.c b/qw/source/sv_sys_unix.c index b84926973..c91218e89 100644 --- a/qw/source/sv_sys_unix.c +++ b/qw/source/sv_sys_unix.c @@ -108,7 +108,6 @@ main (int argc, const char *argv[]) double time, oldtime, newtime; fd_set fdset; int j; - extern int net_socket; memset (&host_parms, 0, sizeof (host_parms)); diff --git a/qw/source/sv_user.c b/qw/source/sv_user.c index 3c3e938ad..b5b0f133e 100644 --- a/qw/source/sv_user.c +++ b/qw/source/sv_user.c @@ -691,13 +691,6 @@ SV_BeginDownload_f (void) char realname[MAX_OSPATH]; int zip; - extern cvar_t *allow_download; - extern cvar_t *allow_download_skins; - extern cvar_t *allow_download_models; - extern cvar_t *allow_download_sounds; - extern cvar_t *allow_download_maps; - extern int file_from_pak; // ZOID did file come from pak? - name = Cmd_Argv (1); // hacked by zoid to allow more conrol over download // first off, no .. or global allow check diff --git a/qw/source/teamplay.c b/qw/source/teamplay.c index 444a3db9e..334983875 100644 --- a/qw/source/teamplay.c +++ b/qw/source/teamplay.c @@ -48,6 +48,7 @@ static const char rcsid[] = #include "QF/teamplay.h" #include "bothdefs.h" +#include "cl_input.h" #include "client.h" #include "compat.h" @@ -66,8 +67,6 @@ Team_BestWeaponImpulse (void) { int best, i, imp, items; - extern int in_impulse; - items = cl.stats[STAT_ITEMS]; best = 0; diff --git a/tools/qwaq/main.c b/tools/qwaq/main.c index 88fdff3d9..d0a7a7d7d 100644 --- a/tools/qwaq/main.c +++ b/tools/qwaq/main.c @@ -51,9 +51,6 @@ int reserved_edicts; void BI_Init (progs_t *progs); -extern char *type_name[]; -extern cvar_t *developer; - extern int *read_result; //FIXME: eww int