ref: 0e037180474abd0d37e2d87a878378e83dd06895
parent: a0da60563b7139df88d76fee3ed43167002a9209
author: Sigrid Solveig Haflínudóttir <sigrid@ftrv.se>
date: Thu Oct 12 21:04:18 EDT 2023
more static; uncomment what that spams the console because of a bug
--- a/cl_parse.c
+++ b/cl_parse.c
@@ -4,7 +4,7 @@
#include "quakedef.h"
#include "fns.h"
-char *svc_strings[] =
+static char *svc_strings[] =
{
"svc_bad",
"svc_nop",
@@ -63,7 +63,7 @@
This error checks and tracks the total number of entities
===============
*/
-entity_t *CL_EntityNum (int num)
+static entity_t *CL_EntityNum(int num)
{
if (num >= cl.num_entities)
{
@@ -85,7 +85,7 @@
CL_ParseStartSoundPacket
==================
*/
-void CL_ParseStartSoundPacket(void)
+static void CL_ParseStartSoundPacket(void)
{
vec3_t pos;
int channel, ent;
@@ -122,7 +122,7 @@
so the server doesn't disconnect.
==================
*/
-void CL_KeepaliveMessage (void)
+static void CL_KeepaliveMessage (void)
{
float time;
static float lastmsg;
@@ -180,7 +180,7 @@
CL_ParseServerInfo
==================
*/
-void CL_ParseServerInfo (void)
+static void CL_ParseServerInfo (void)
{
char *str;
void *p;
@@ -313,7 +313,7 @@
*/
static int bitcounts[16];
-void CL_ParseUpdate (int bits)
+static void CL_ParseUpdate (int bits)
{
int i;
model_t *model;
@@ -420,7 +420,7 @@
CL_ParseBaseline
==================
*/
-void CL_ParseBaseline (int withbits, entity_t *ent)
+static void CL_ParseBaseline (int withbits, entity_t *ent)
{
int i, bits;
@@ -444,7 +444,7 @@
Server information pertaining to this client only
==================
*/
-void CL_ParseClientdata (unsigned int bits)
+static void CL_ParseClientdata (unsigned int bits)
{
int i, j, weaponmodel;
@@ -536,7 +536,7 @@
CL_NewTranslation
=====================
*/
-void CL_NewTranslation (int slot)
+static void CL_NewTranslation (int slot)
{
int i, j;
int top, bottom;
@@ -571,7 +571,7 @@
CL_ParseStatic
=====================
*/
-void CL_ParseStatic (int withbits)
+static void CL_ParseStatic (int withbits)
{
entity_t *ent;
int i;
@@ -600,7 +600,7 @@
CL_ParseStaticSound
===================
*/
-void CL_ParseStaticSound (int large_sound)
+static void CL_ParseStaticSound (int large_sound)
{
vec3_t org;
int sound_num, vol, atten;
--- a/cl_tent.c
+++ b/cl_tent.c
@@ -4,8 +4,8 @@
#include "quakedef.h"
#include "fns.h"
-int num_temp_entities;
-entity_t cl_temp_entities[MAX_TEMP_ENTITIES];
+static int num_temp_entities;
+static entity_t cl_temp_entities[MAX_TEMP_ENTITIES];
beam_t cl_beams[MAX_BEAMS];
Sfx *cl_sfx_wizhit;
@@ -37,7 +37,7 @@
CL_ParseBeam
=================
*/
-void CL_ParseBeam (model_t *m)
+static void CL_ParseBeam (model_t *m)
{
int ent;
vec3_t start, end;
@@ -214,7 +214,7 @@
CL_NewTempEntity
=================
*/
-entity_t *CL_NewTempEntity (void)
+static entity_t *CL_NewTempEntity (void)
{
entity_t *ent;
--- a/client.h
+++ b/client.h
@@ -245,7 +245,6 @@
extern entity_t *cl_static_entities;
extern lightstyle_t cl_lightstyle[Nlights];
extern dlight_t cl_dlights[MAX_DLIGHTS];
-extern entity_t cl_temp_entities[MAX_TEMP_ENTITIES];
extern beam_t cl_beams[MAX_BEAMS];
//=============================================================================
@@ -307,7 +306,6 @@
// cl_parse.c
//
void CL_ParseServerMessage (void);
-void CL_NewTranslation (int slot);
//
// view
--- a/console.c
+++ b/console.c
@@ -5,9 +5,9 @@
#include "quakedef.h"
#include "fns.h"
-int con_linewidth;
+static int con_linewidth;
-float con_cursorspeed = 4;
+static float con_cursorspeed = 4;
#define CON_TEXTSIZE 16384
#define MAXPRINTMSG 4096
@@ -16,17 +16,17 @@
int con_totallines; // total lines in console scrollback
int con_backscroll; // lines up from bottom to display
-int con_current; // where next message will be printed
-int con_x; // offset in current line for next print
-char *con_text=0;
+static int con_current; // where next message will be printed
+static int con_x; // offset in current line for next print
+static char *con_text;
-cvar_t con_notifytime = {"con_notifytime","3"}; //seconds
+static cvar_t con_notifytime = {"con_notifytime","3"}; //seconds
#define NUM_CON_TIMES 4
-float con_times[NUM_CON_TIMES]; // realtime time the line was generated
+static float con_times[NUM_CON_TIMES]; // realtime time the line was generated
// for transparent notify lines
-int con_vislines;
+static int con_vislines;
#define MAXCMDLINE 256
extern char key_lines[32][MAXCMDLINE];
@@ -288,37 +288,17 @@
}
}
-/* all this because of the color printing hack */
-static void
-print1(char *s, int n)
-{
- char buf[MAXPRINTMSG], *p, *d;
-
- if(!debug)
- return;
- p = s;
- d = buf;
- while(*p)
- *d++ = *p++ & 0x7f;
- write(1, buf, n);
-}
-
/* Handles cursor positioning, line wrapping, etc */
void
Con_Printf(char *fmt, ...)
{
- int n;
va_list arg;
char msg[MAXPRINTMSG];
static qboolean inupdate;
- /* FIXME: Con_Print() above uses 1<<7 bit for color printing select
- * letters, notably in mods. this does not amuse print(2) (dofmt()?). */
va_start(arg, fmt);
- n = vsnprintf(msg, sizeof msg, fmt, arg);
+ vsnprintf(msg, sizeof msg, fmt, arg);
va_end(arg);
-
- print1(msg, n);
if(!con_initialized)
return;
--- a/host.c
+++ b/host.c
@@ -33,26 +33,24 @@
byte *host_basepal;
byte *host_colormap;
-cvar_t host_framerate = {"host_framerate","0"}; // set for slow motion
-cvar_t host_speeds = {"host_speeds","0"}; // set for running times
+static cvar_t host_framerate = {"host_framerate","0"}; // set for slow motion
+static cvar_t host_speeds = {"host_speeds","0"}; // set for running times
+static cvar_t serverprofile = {"serverprofile","0"};
+static cvar_t samelevel = {"samelevel","0"};
+static cvar_t noexit = {"noexit","0",false,true};
+static cvar_t temp1 = {"temp1","0"};
cvar_t sys_ticrate = {"sys_ticrate","0.05"};
-cvar_t serverprofile = {"serverprofile","0"};
cvar_t fraglimit = {"fraglimit","0",false,true};
cvar_t timelimit = {"timelimit","0",false,true};
cvar_t teamplay = {"teamplay","0",false,true};
-cvar_t samelevel = {"samelevel","0"};
-cvar_t noexit = {"noexit","0",false,true};
-
cvar_t skill = {"skill","1"}; // 0 - 3
cvar_t deathmatch = {"deathmatch","0"}; // 0, 1, or 2
cvar_t coop = {"coop","0"}; // 0 or 1
cvar_t pausable = {"pausable","1"};
-
-cvar_t temp1 = {"temp1","0"};
/*
================
--- a/net_main.c
+++ b/net_main.c
@@ -16,7 +16,7 @@
int unreliableMessagesSent = 0;
int unreliableMessagesReceived = 0;
-cvar_t net_messagetimeout = {"net_messagetimeout","300"};
+static cvar_t net_messagetimeout = {"net_messagetimeout","300"};
cvar_t hostname = {"hostname", "UNNAMED"};
Netdrv netdrv[MAX_NET_DRIVERS] = {
--- a/r_alias.c
+++ b/r_alias.c
@@ -92,7 +92,7 @@
// TODO: don't repeat this check when drawing?
if ((frame >= pmdl->numframes) || (frame < 0))
{
- //Con_DPrintf("No such frame %d %s\n", frame, pmodel->name);
+ Con_DPrintf("No such frame %d %s\n", frame, pmodel->name);
frame = 0;
}
@@ -544,7 +544,7 @@
skinnum = currententity->skinnum;
if ((skinnum >= pmdl->numskins) || (skinnum < 0))
{
- //Con_DPrintf("R_AliasSetupSkin: no such skin # %d\n", skinnum);
+ Con_DPrintf("R_AliasSetupSkin: no such skin # %d\n", skinnum);
skinnum = 0;
}
@@ -634,7 +634,7 @@
frame = currententity->frame;
if ((frame >= pmdl->numframes) || (frame < 0))
{
- //Con_DPrintf("R_AliasSetupFrame: no such frame %d\n", frame);
+ Con_DPrintf("R_AliasSetupFrame: no such frame %d\n", frame);
frame = 0;
}
--- a/r_sprite.c
+++ b/r_sprite.c
@@ -226,7 +226,7 @@
if ((frame >= psprite->numframes) || (frame < 0))
{
- //Con_Printf ("R_DrawSprite: no such frame %d\n", frame);
+ Con_DPrintf ("R_DrawSprite: no such frame %d\n", frame);
frame = 0;
}