ref: 7955211a31c09579beb3f3e2da95902bb07b6c62
parent: 7922956e930c3b3e1e97e867ec92d5395487642e
author: Sigrid Solveig Haflínudóttir <[email protected]>
date: Wed Nov 29 21:06:54 EST 2023
mark a bunch of PF_* static
--- a/pr_cmds.c
+++ b/pr_cmds.c
@@ -10,7 +10,8 @@
===============================================================================
*/
-char *PF_VarString (pr_t *pr, int first)
+static char *
+PF_VarString(pr_t *pr, int first)
{
int i;
static char out[256];
@@ -34,7 +35,8 @@
error(value)
=================
*/
-void PF_error (pr_t *pr)
+static void
+PF_error(pr_t *pr)
{
char *s;
edict_t *ed;
@@ -57,7 +59,8 @@
objerror(value)
=================
*/
-void PF_objerror (pr_t *pr)
+static void
+PF_objerror(pr_t *pr)
{
char *s;
edict_t *ed;
@@ -81,7 +84,8 @@
makevectors(vector)
==============
*/
-void PF_makevectors (pr_t *pr)
+static void
+PF_makevectors(pr_t *pr)
{
AngleVectors (G_VECTOR(pr, OFS_PARM0), pr->global_struct->v_forward, pr->global_struct->v_right, pr->global_struct->v_up);
}
@@ -95,7 +99,8 @@
setorigin (entity, origin)
=================
*/
-void PF_setorigin (pr_t *pr)
+static void
+PF_setorigin(pr_t *pr)
{
edict_t *e;
float *org;
@@ -106,8 +111,8 @@
SV_LinkEdict (e, false);
}
-
-void SetMinMaxSize (pr_t *pr, edict_t *e, float *min, float *max, bool rotate)
+static void
+SetMinMaxSize(pr_t *pr, edict_t *e, float *min, float *max, bool rotate)
{
float *angles;
vec3_t rmin, rmax;
@@ -190,7 +195,8 @@
setsize (entity, minvector, maxvector)
=================
*/
-void PF_setsize (pr_t *pr)
+static void
+PF_setsize(pr_t *pr)
{
edict_t *e;
float *min, *max;
@@ -209,7 +215,8 @@
setmodel(entity, model)
=================
*/
-void PF_setmodel (pr_t *pr)
+static void
+PF_setmodel(pr_t *pr)
{
edict_t *e;
char *m, **check;
@@ -245,7 +252,8 @@
bprint(value)
=================
*/
-void PF_bprint (pr_t *pr)
+static void
+PF_bprint(pr_t *pr)
{
char *s;
@@ -262,7 +270,8 @@
sprint(clientent, value)
=================
*/
-void PF_sprint (pr_t *pr)
+static void
+PF_sprint(pr_t *pr)
{
char *s;
client_t *client;
@@ -293,7 +302,8 @@
centerprint(clientent, value)
=================
*/
-void PF_centerprint (pr_t *pr)
+static void
+PF_centerprint(pr_t *pr)
{
char *s;
client_t *client;
@@ -322,7 +332,8 @@
vector normalize(vector)
=================
*/
-void PF_normalize (pr_t *pr)
+static void
+PF_normalize(pr_t *pr)
{
float *v;
vec3_t newvalue;
@@ -352,7 +363,8 @@
scalar vlen(vector)
=================
*/
-void PF_vlen (pr_t *pr)
+static void
+PF_vlen(pr_t *pr)
{
float *v;
double a, b, c;
@@ -371,7 +383,8 @@
float vectoyaw(vector)
=================
*/
-void PF_vectoyaw (pr_t *pr)
+static void
+PF_vectoyaw(pr_t *pr)
{
float *value1;
float yaw;
@@ -398,7 +411,8 @@
vector vectoangles(vector)
=================
*/
-void PF_vectoangles (pr_t *pr)
+static void
+PF_vectoangles(pr_t *pr)
{
float *value1;
double forward;
@@ -440,7 +454,8 @@
random()
=================
*/
-void PF_random (pr_t *pr)
+static void
+PF_random(pr_t *pr)
{
static double xmax;
static long xand;
@@ -465,7 +480,8 @@
particle(origin, color, count)
=================
*/
-void PF_particle (pr_t *pr)
+static void
+PF_particle(pr_t *pr)
{
float *org, *dir;
float color;
@@ -485,7 +501,8 @@
=================
*/
-void PF_ambientsound (pr_t *pr)
+static void
+PF_ambientsound(pr_t *pr)
{
char **check;
char *samp;
@@ -546,7 +563,8 @@
=================
*/
-void PF_sound (pr_t *pr)
+static void
+PF_sound(pr_t *pr)
{
char *sample;
int channel;
@@ -579,7 +597,8 @@
break()
=================
*/
-void PF_break (pr_t *pr)
+static void
+PF_break(pr_t *pr)
{
USED(pr);
Con_Printf("break statement\n");
@@ -598,7 +617,8 @@
traceline (vector1, vector2, tryents)
=================
*/
-void PF_traceline (pr_t *pr)
+static void
+PF_traceline(pr_t *pr)
{
float *v1, *v2;
trace_t trace;
@@ -631,7 +651,8 @@
static byte *checkpvs;
static int checkpvs_size;
-int PF_newcheckclient (pr_t *pr, int check)
+static int
+PF_newcheckclient(pr_t *pr, int check)
{
int i, size;
byte *pvs;
@@ -701,7 +722,8 @@
=================
*/
#define MAX_CHECK 16
-void PF_checkclient (pr_t *pr)
+static void
+PF_checkclient(pr_t *pr)
{
edict_t *ent, *self;
mleaf_t *leaf;
@@ -750,7 +772,8 @@
stuffcmd (clientent, value)
=================
*/
-void PF_stuffcmd (pr_t *pr)
+static void
+PF_stuffcmd(pr_t *pr)
{
int entnum;
char *str;
@@ -776,7 +799,8 @@
localcmd (string)
=================
*/
-void PF_localcmd (pr_t *pr)
+static void
+PF_localcmd(pr_t *pr)
{
char *str;
@@ -791,7 +815,8 @@
float cvar (string)
=================
*/
-void PF_cvar (pr_t *pr)
+static void
+PF_cvar(pr_t *pr)
{
char *str;
@@ -807,7 +832,8 @@
float cvar (string)
=================
*/
-void PF_cvar_set (pr_t *pr)
+static void
+PF_cvar_set(pr_t *pr)
{
char *var, *val;
@@ -826,7 +852,8 @@
findradius (origin, radius)
=================
*/
-void PF_findradius (pr_t *pr)
+static void
+PF_findradius(pr_t *pr)
{
edict_t *ent, *chain;
float rad;
@@ -858,13 +885,14 @@
RETURN_EDICT(pr, chain);
}
-void
+static void
PF_dprint(pr_t *pr)
{
Con_DPrintf("%s", PF_VarString(pr, 0));
}
-void PF_ftos (pr_t *pr)
+static void
+PF_ftos(pr_t *pr)
{
float v;
char *s;
@@ -878,7 +906,8 @@
G_INT(pr, OFS_RETURN) = PR_SetStr(pr, s);
}
-void PF_fabs (pr_t *pr)
+static void
+PF_fabs(pr_t *pr)
{
float v;
v = G_FLOAT(pr, OFS_PARM0);
@@ -885,7 +914,8 @@
G_FLOAT(pr, OFS_RETURN) = fabs(v);
}
-void PF_vtos (pr_t *pr)
+static void
+PF_vtos(pr_t *pr)
{
char *s;
s = PR_StrTmp(pr);
@@ -893,7 +923,8 @@
G_INT(pr, OFS_RETURN) = PR_SetStr(pr, s);
}
-void PF_Spawn (pr_t *pr)
+static void
+PF_Spawn(pr_t *pr)
{
edict_t *ed;
ed = ED_Alloc(pr);
@@ -900,7 +931,8 @@
RETURN_EDICT(pr, ed);
}
-void PF_Remove (pr_t *pr)
+static void
+PF_Remove(pr_t *pr)
{
edict_t *ed;
@@ -910,7 +942,8 @@
// entity (entity start, .string field, string match) find = #5;
-void PF_Find (pr_t *pr)
+static void
+PF_Find(pr_t *pr)
{
int e;
int f;
@@ -941,7 +974,8 @@
RETURN_EDICT(pr, pr->edicts);
}
-void PR_CheckEmptyString (pr_t *pr, char *s)
+static void
+PR_CheckEmptyString(pr_t *pr, char *s)
{
if (s[0] <= ' ')
PR_RunError (pr, "Bad string");
@@ -965,7 +999,8 @@
bool SV_StepDirection (edict_t *ent, float yaw, float dist);
void SV_NewChaseDir (edict_t *actor, edict_t *enemy, float dist);
-void PF_MoveToGoal (pr_t *pr)
+static void
+PF_MoveToGoal(pr_t *pr)
{
edict_t *ent, *goal;
float dist;
@@ -992,12 +1027,14 @@
}
}
-void PF_precache_file (pr_t *pr)
+static void
+PF_precache_file(pr_t *pr)
{ // precache_file is only used to copy files with qcc, it does nothing
G_INT(pr, OFS_RETURN) = G_INT(pr, OFS_PARM0);
}
-void PF_precache_sound (pr_t *pr)
+static void
+PF_precache_sound(pr_t *pr)
{
char *s;
int i;
@@ -1022,7 +1059,8 @@
PR_RunError(pr, "PF_precache_sound: overflow");
}
-void PF_precache_model (pr_t *pr)
+static void
+PF_precache_model(pr_t *pr)
{
char *s;
int i;
@@ -1048,8 +1086,8 @@
PR_RunError (pr,"PF_precache_model: overflow");
}
-
-void PF_coredump (pr_t *pr)
+static void
+PF_coredump(pr_t *pr)
{
// FIXME(sigrid): needs to be pr-specific
USED(pr);
@@ -1056,17 +1094,20 @@
ED_PrintEdicts();
}
-void PF_traceon (pr_t *pr)
+static void
+PF_traceon(pr_t *pr)
{
pr->trace = true;
}
-void PF_traceoff (pr_t *pr)
+static void
+PF_traceoff(pr_t *pr)
{
pr->trace = false;
}
-void PF_eprint (pr_t *pr)
+static void
+PF_eprint(pr_t *pr)
{
ED_PrintNum(pr, G_EDICTNUM(pr, OFS_PARM0));
}
@@ -1078,7 +1119,8 @@
float(float yaw, float dist) walkmove
===============
*/
-void PF_walkmove (pr_t *pr)
+static void
+PF_walkmove(pr_t *pr)
{
edict_t *ent;
float yaw, dist;
@@ -1121,7 +1163,8 @@
void() droptofloor
===============
*/
-void PF_droptofloor (pr_t *pr)
+static void
+PF_droptofloor(pr_t *pr)
{
edict_t *ent;
vec3_t end;
@@ -1153,7 +1196,8 @@
void(float style, string value) lightstyle
===============
*/
-void PF_lightstyle (pr_t *pr)
+static void
+PF_lightstyle(pr_t *pr)
{
int style;
char *val;
@@ -1179,7 +1223,8 @@
}
}
-void PF_rint (pr_t *pr)
+static void
+PF_rint(pr_t *pr)
{
float f;
f = G_FLOAT(pr, OFS_PARM0);
@@ -1186,12 +1231,14 @@
G_FLOAT(pr, OFS_RETURN) = Qrint(f);
}
-void PF_floor (pr_t *pr)
+static void
+PF_floor(pr_t *pr)
{
G_FLOAT(pr, OFS_RETURN) = floor(G_FLOAT(pr, OFS_PARM0));
}
-void PF_ceil (pr_t *pr)
+static void
+PF_ceil(pr_t *pr)
{
G_FLOAT(pr, OFS_RETURN) = ceil(G_FLOAT(pr, OFS_PARM0));
}
@@ -1201,7 +1248,8 @@
PF_checkbottom
=============
*/
-void PF_checkbottom (pr_t *pr)
+static void
+PF_checkbottom(pr_t *pr)
{
edict_t *ent;
@@ -1215,7 +1263,8 @@
PF_pointcontents
=============
*/
-void PF_pointcontents (pr_t *pr)
+static void
+PF_pointcontents(pr_t *pr)
{
float *v;
@@ -1231,7 +1280,8 @@
entity nextent(entity)
=============
*/
-void PF_nextent (pr_t *pr)
+static void
+PF_nextent(pr_t *pr)
{
int i;
edict_t *ent;
@@ -1262,8 +1312,9 @@
vector aim(entity, missilespeed)
=============
*/
-cvar_t sv_aim = {"sv_aim", "0.93"};
-void PF_aim (pr_t *pr)
+cvar_t sv_aim = {"sv_aim", "0.93"};
+static void
+PF_aim(pr_t *pr)
{
edict_t *ent, *check, *bestent;
vec3_t start, dir, end, bestdir;
@@ -1340,7 +1391,8 @@
This was a major timewaster in progs, so it was converted to C
==============
*/
-void PF_changeyaw (pr_t *pr)
+void
+PF_changeyaw(pr_t *pr)
{
edict_t *ent;
float ideal, current, move, speed;
@@ -1390,7 +1442,8 @@
#define MSG_ALL 2 // reliable to all
#define MSG_INIT 3 // write to the init string
-sizebuf_t *WriteDest (pr_t *pr)
+static sizebuf_t *
+WriteDest(pr_t *pr)
{
int entnum;
int dest;
@@ -1423,43 +1476,50 @@
return nil;
}
-void PF_WriteByte (pr_t *pr)
+static void
+PF_WriteByte(pr_t *pr)
{
MSG_WriteByte (WriteDest(pr), G_FLOAT(pr, OFS_PARM1));
}
-void PF_WriteChar (pr_t *pr)
+static void
+PF_WriteChar(pr_t *pr)
{
MSG_WriteChar (WriteDest(pr), G_FLOAT(pr, OFS_PARM1));
}
-void PF_WriteShort (pr_t *pr)
+static void
+PF_WriteShort(pr_t *pr)
{
MSG_WriteShort (WriteDest(pr), G_FLOAT(pr, OFS_PARM1));
}
-void PF_WriteLong (pr_t *pr)
+static void
+PF_WriteLong(pr_t *pr)
{
MSG_WriteLong (WriteDest(pr), G_FLOAT(pr, OFS_PARM1));
}
-void PF_WriteAngle (pr_t *pr)
+static void
+PF_WriteAngle(pr_t *pr)
{
sv.protocol->MSG_WriteAngle (WriteDest(pr), G_FLOAT(pr, OFS_PARM1));
}
-void PF_WriteCoord (pr_t *pr)
+static void
+PF_WriteCoord(pr_t *pr)
{
sv.protocol->MSG_WriteCoord (WriteDest(pr), G_FLOAT(pr, OFS_PARM1));
}
-void PF_WriteString (pr_t *pr)
+static void
+PF_WriteString(pr_t *pr)
{
MSG_WriteString (WriteDest(pr), G_STRING(pr, OFS_PARM1));
}
-
-void PF_WriteEntity (pr_t *pr)
+static void
+PF_WriteEntity(pr_t *pr)
{
MSG_WriteShort (WriteDest(pr), G_EDICTNUM(pr, OFS_PARM1));
}
@@ -1468,7 +1528,8 @@
int SV_ModelIndex (char *name);
-void PF_makestatic (pr_t *pr)
+static void
+PF_makestatic(pr_t *pr)
{
edict_t *ent;
int i, model, frame, bits;
@@ -1523,7 +1584,8 @@
PF_setspawnparms
==============
*/
-void PF_setspawnparms (pr_t *pr)
+static void
+PF_setspawnparms(pr_t *pr)
{
edict_t *ent;
int i;
@@ -1546,7 +1608,8 @@
PF_changelevel
==============
*/
-void PF_changelevel (pr_t *pr)
+static void
+PF_changelevel(pr_t *pr)
{
char *s;
@@ -1559,7 +1622,8 @@
Cbuf_AddText (va("changelevel %s\n",s));
}
-void PF_Fixme (pr_t *pr)
+static void
+PF_Fixme(pr_t *pr)
{
PR_RunError (pr, "unimplemented builtin");
}