host_cmd.c: make a lot of procedures static.

This commit is contained in:
Ozkan Sezer 2021-10-01 11:10:04 +03:00
parent b58efad209
commit 081e73c709
3 changed files with 51 additions and 72 deletions

View file

@ -1682,7 +1682,6 @@ static int COM_FindFile (const char *filename, int *handle, FILE **file,
&& strcmp(COM_FileGetExtension(filename), "ent") != 0) && strcmp(COM_FileGetExtension(filename), "ent") != 0)
Con_DPrintf ("FindFile: can't find %s\n", filename); Con_DPrintf ("FindFile: can't find %s\n", filename);
else Con_DPrintf2("FindFile: can't find %s\n", filename); else Con_DPrintf2("FindFile: can't find %s\n", filename);
// Log pcx, tga, lit, ent misses only if (developer.value >= 2)
if (handle) if (handle)
*handle = -1; *handle = -1;
@ -2075,7 +2074,6 @@ _add_path:
//============================================================================== //==============================================================================
//johnfitz -- dynamic gamedir stuff -- modified by QuakeSpasm team. //johnfitz -- dynamic gamedir stuff -- modified by QuakeSpasm team.
//============================================================================== //==============================================================================
void ExtraMaps_NewGame (void);
static void COM_Game_f (void) static void COM_Game_f (void)
{ {
if (Cmd_Argc() > 1) if (Cmd_Argc() > 1)

View file

@ -37,7 +37,6 @@ void Mod_Print (void);
Host_Quit_f Host_Quit_f
================== ==================
*/ */
void Host_Quit_f (void) void Host_Quit_f (void)
{ {
if (key_dest != key_console && cls.state != ca_dedicated) if (key_dest != key_console && cls.state != ca_dedicated)
@ -60,7 +59,7 @@ void Host_Quit_f (void)
FileList_Add FileList_Add
================== ==================
*/ */
void FileList_Add (const char *name, filelist_item_t **list) static void FileList_Add (const char *name, filelist_item_t **list)
{ {
filelist_item_t *item,*cursor,*prev; filelist_item_t *item,*cursor,*prev;
@ -109,7 +108,7 @@ static void FileList_Clear (filelist_item_t **list)
filelist_item_t *extralevels; filelist_item_t *extralevels;
void ExtraMaps_Add (const char *name) static void ExtraMaps_Add (const char *name)
{ {
FileList_Add(name, &extralevels); FileList_Add(name, &extralevels);
} }
@ -200,7 +199,7 @@ void ExtraMaps_NewGame (void)
Host_Maps_f Host_Maps_f
================== ==================
*/ */
void Host_Maps_f (void) static void Host_Maps_f (void)
{ {
int i; int i;
filelist_item_t *level; filelist_item_t *level;
@ -220,7 +219,7 @@ void Host_Maps_f (void)
filelist_item_t *modlist; filelist_item_t *modlist;
void Modlist_Add (const char *name) static void Modlist_Add (const char *name)
{ {
FileList_Add(name, &modlist); FileList_Add(name, &modlist);
} }
@ -368,7 +367,6 @@ void DemoList_Init (void)
} }
} }
/* /*
================== ==================
Host_Mods_f -- johnfitz Host_Mods_f -- johnfitz
@ -376,7 +374,7 @@ Host_Mods_f -- johnfitz
list all potential mod directories (contain either a pak file or a progs.dat) list all potential mod directories (contain either a pak file or a progs.dat)
================== ==================
*/ */
void Host_Mods_f (void) static void Host_Mods_f (void)
{ {
int i; int i;
filelist_item_t *mod; filelist_item_t *mod;
@ -397,7 +395,7 @@ void Host_Mods_f (void)
Host_Mapname_f -- johnfitz Host_Mapname_f -- johnfitz
============= =============
*/ */
void Host_Mapname_f (void) static void Host_Mapname_f (void)
{ {
if (sv.active) if (sv.active)
{ {
@ -419,7 +417,7 @@ void Host_Mapname_f (void)
Host_Status_f Host_Status_f
================== ==================
*/ */
void Host_Status_f (void) static void Host_Status_f (void)
{ {
void (*print_fn) (const char *fmt, ...) void (*print_fn) (const char *fmt, ...)
FUNCP_PRINTF(1,2); FUNCP_PRINTF(1,2);
@ -476,7 +474,7 @@ Host_God_f
Sets client to godmode Sets client to godmode
================== ==================
*/ */
void Host_God_f (void) static void Host_God_f (void)
{ {
if (cmd_source == src_command) if (cmd_source == src_command)
{ {
@ -521,7 +519,7 @@ void Host_God_f (void)
Host_Notarget_f Host_Notarget_f
================== ==================
*/ */
void Host_Notarget_f (void) static void Host_Notarget_f (void)
{ {
if (cmd_source == src_command) if (cmd_source == src_command)
{ {
@ -568,7 +566,7 @@ qboolean noclip_anglehack;
Host_Noclip_f Host_Noclip_f
================== ==================
*/ */
void Host_Noclip_f (void) static void Host_Noclip_f (void)
{ {
if (cmd_source == src_command) if (cmd_source == src_command)
{ {
@ -624,7 +622,7 @@ Host_SetPos_f
adapted from fteqw, originally by Alex Shadowalker adapted from fteqw, originally by Alex Shadowalker
==================== ====================
*/ */
void Host_SetPos_f(void) static void Host_SetPos_f(void)
{ {
if (cmd_source == src_command) if (cmd_source == src_command)
{ {
@ -685,7 +683,7 @@ Host_Fly_f
Sets client to flymode Sets client to flymode
================== ==================
*/ */
void Host_Fly_f (void) static void Host_Fly_f (void)
{ {
if (cmd_source == src_command) if (cmd_source == src_command)
{ {
@ -730,14 +728,13 @@ void Host_Fly_f (void)
//johnfitz //johnfitz
} }
/* /*
================== ==================
Host_Ping_f Host_Ping_f
================== ==================
*/ */
void Host_Ping_f (void) static void Host_Ping_f (void)
{ {
int i, j; int i, j;
float total; float total;
@ -770,7 +767,6 @@ SERVER TRANSITIONS
=============================================================================== ===============================================================================
*/ */
/* /*
====================== ======================
Host_Map_f Host_Map_f
@ -780,7 +776,7 @@ map <servername>
command from the console. Active clients are kicked off. command from the console. Active clients are kicked off.
====================== ======================
*/ */
void Host_Map_f (void) static void Host_Map_f (void)
{ {
int i; int i;
char name[MAX_QPATH], *p; char name[MAX_QPATH], *p;
@ -848,7 +844,7 @@ Host_Randmap_f
Loads a random map from the "maps" list. Loads a random map from the "maps" list.
====================== ======================
*/ */
void Host_Randmap_f (void) static void Host_Randmap_f (void)
{ {
int i, randlevel, numlevels; int i, randlevel, numlevels;
filelist_item_t *level; filelist_item_t *level;
@ -885,7 +881,7 @@ Host_Changelevel_f
Goes to a new map, taking all clients along Goes to a new map, taking all clients along
================== ==================
*/ */
void Host_Changelevel_f (void) static void Host_Changelevel_f (void)
{ {
char level[MAX_QPATH]; char level[MAX_QPATH];
@ -924,7 +920,7 @@ Host_Restart_f
Restarts the current server for a dead player Restarts the current server for a dead player
================== ==================
*/ */
void Host_Restart_f (void) static void Host_Restart_f (void)
{ {
char mapname[MAX_QPATH]; char mapname[MAX_QPATH];
@ -947,7 +943,7 @@ This command causes the client to wait for the signon messages again.
This is sent just before a server changes levels This is sent just before a server changes levels
================== ==================
*/ */
void Host_Reconnect_f (void) static void Host_Reconnect_f (void)
{ {
if (cls.demoplayback) // cross-map demo playback fix from Baker if (cls.demoplayback) // cross-map demo playback fix from Baker
return; return;
@ -963,7 +959,7 @@ Host_Connect_f
User command to connect to server User command to connect to server
===================== =====================
*/ */
void Host_Connect_f (void) static void Host_Connect_f (void)
{ {
char name[MAX_QPATH]; char name[MAX_QPATH];
@ -996,7 +992,7 @@ Host_SavegameComment
Writes a SAVEGAME_COMMENT_LENGTH character comment describing the current Writes a SAVEGAME_COMMENT_LENGTH character comment describing the current
=============== ===============
*/ */
void Host_SavegameComment (char *text) static void Host_SavegameComment (char *text)
{ {
int i; int i;
char kills[20]; char kills[20];
@ -1026,13 +1022,12 @@ void Host_SavegameComment (char *text)
text[SAVEGAME_COMMENT_LENGTH] = '\0'; text[SAVEGAME_COMMENT_LENGTH] = '\0';
} }
/* /*
=============== ===============
Host_Savegame_f Host_Savegame_f
=============== ===============
*/ */
void Host_Savegame_f (void) static void Host_Savegame_f (void)
{ {
char name[MAX_OSPATH]; char name[MAX_OSPATH];
FILE *f; FILE *f;
@ -1102,7 +1097,6 @@ void Host_Savegame_f (void)
fprintf (f, "%f\n",sv.time); fprintf (f, "%f\n",sv.time);
// write the light styles // write the light styles
for (i = 0; i < MAX_LIGHTSTYLES; i++) for (i = 0; i < MAX_LIGHTSTYLES; i++)
{ {
if (sv.lightstyles[i]) if (sv.lightstyles[i])
@ -1111,7 +1105,6 @@ void Host_Savegame_f (void)
fprintf (f,"m\n"); fprintf (f,"m\n");
} }
ED_WriteGlobals (f); ED_WriteGlobals (f);
for (i = 0; i < sv.num_edicts; i++) for (i = 0; i < sv.num_edicts; i++)
{ {
@ -1122,13 +1115,12 @@ void Host_Savegame_f (void)
Con_Printf ("done.\n"); Con_Printf ("done.\n");
} }
/* /*
=============== ===============
Host_Loadgame_f Host_Loadgame_f
=============== ===============
*/ */
void Host_Loadgame_f (void) static void Host_Loadgame_f (void)
{ {
static char *start; static char *start;
@ -1281,7 +1273,7 @@ void Host_Loadgame_f (void)
Host_Name_f Host_Name_f
====================== ======================
*/ */
void Host_Name_f (void) static void Host_Name_f (void)
{ {
char newName[32]; char newName[32];
@ -1315,13 +1307,12 @@ void Host_Name_f (void)
host_client->edict->v.netname = PR_SetEngineString(host_client->name); host_client->edict->v.netname = PR_SetEngineString(host_client->name);
// send notification to all clients // send notification to all clients
MSG_WriteByte (&sv.reliable_datagram, svc_updatename); MSG_WriteByte (&sv.reliable_datagram, svc_updatename);
MSG_WriteByte (&sv.reliable_datagram, host_client - svs.clients); MSG_WriteByte (&sv.reliable_datagram, host_client - svs.clients);
MSG_WriteString (&sv.reliable_datagram, host_client->name); MSG_WriteString (&sv.reliable_datagram, host_client->name);
} }
void Host_Say(qboolean teamonly) static void Host_Say(qboolean teamonly)
{ {
int j; int j;
client_t *client; client_t *client;
@ -1398,20 +1389,17 @@ void Host_Say(qboolean teamonly)
Sys_Printf("%s", &text[1]); Sys_Printf("%s", &text[1]);
} }
static void Host_Say_f(void)
void Host_Say_f(void)
{ {
Host_Say(false); Host_Say(false);
} }
static void Host_Say_Team_f(void)
void Host_Say_Team_f(void)
{ {
Host_Say(true); Host_Say(true);
} }
static void Host_Tell_f(void)
void Host_Tell_f(void)
{ {
int j; int j;
client_t *client; client_t *client;
@ -1475,13 +1463,12 @@ void Host_Tell_f(void)
host_client = save; host_client = save;
} }
/* /*
================== ==================
Host_Color_f Host_Color_f
================== ==================
*/ */
void Host_Color_f(void) static void Host_Color_f(void)
{ {
int top, bottom; int top, bottom;
int playercolor; int playercolor;
@ -1532,7 +1519,7 @@ void Host_Color_f(void)
Host_Kill_f Host_Kill_f
================== ==================
*/ */
void Host_Kill_f (void) static void Host_Kill_f (void)
{ {
if (cmd_source == src_command) if (cmd_source == src_command)
{ {
@ -1551,13 +1538,12 @@ void Host_Kill_f (void)
PR_ExecuteProgram (pr_global_struct->ClientKill); PR_ExecuteProgram (pr_global_struct->ClientKill);
} }
/* /*
================== ==================
Host_Pause_f Host_Pause_f
================== ==================
*/ */
void Host_Pause_f (void) static void Host_Pause_f (void)
{ {
//ericw -- demo pause support (inspired by MarkV) //ericw -- demo pause support (inspired by MarkV)
if (cls.demoplayback) if (cls.demoplayback)
@ -1595,13 +1581,12 @@ void Host_Pause_f (void)
//=========================================================================== //===========================================================================
/* /*
================== ==================
Host_PreSpawn_f Host_PreSpawn_f
================== ==================
*/ */
void Host_PreSpawn_f (void) static void Host_PreSpawn_f (void)
{ {
if (cmd_source == src_command) if (cmd_source == src_command)
{ {
@ -1626,7 +1611,7 @@ void Host_PreSpawn_f (void)
Host_Spawn_f Host_Spawn_f
================== ==================
*/ */
void Host_Spawn_f (void) static void Host_Spawn_f (void)
{ {
int i; int i;
client_t *client; client_t *client;
@ -1674,7 +1659,6 @@ void Host_Spawn_f (void)
PR_ExecuteProgram (pr_global_struct->PutClientInServer); PR_ExecuteProgram (pr_global_struct->PutClientInServer);
} }
// send all current names, colors, and frag counts // send all current names, colors, and frag counts
SZ_Clear (&host_client->message); SZ_Clear (&host_client->message);
@ -1746,7 +1730,7 @@ void Host_Spawn_f (void)
Host_Begin_f Host_Begin_f
================== ==================
*/ */
void Host_Begin_f (void) static void Host_Begin_f (void)
{ {
if (cmd_source == src_command) if (cmd_source == src_command)
{ {
@ -1759,7 +1743,6 @@ void Host_Begin_f (void)
//=========================================================================== //===========================================================================
/* /*
================== ==================
Host_Kick_f Host_Kick_f
@ -1767,7 +1750,7 @@ Host_Kick_f
Kicks a user off of the server Kicks a user off of the server
================== ==================
*/ */
void Host_Kick_f (void) static void Host_Kick_f (void)
{ {
const char *who; const char *who;
const char *message = NULL; const char *message = NULL;
@ -1859,7 +1842,7 @@ DEBUGGING TOOLS
Host_Give_f Host_Give_f
================== ==================
*/ */
void Host_Give_f (void) static void Host_Give_f (void)
{ {
const char *t; const char *t;
int v; int v;
@ -2084,7 +2067,7 @@ void Host_Give_f (void)
//johnfitz //johnfitz
} }
edict_t *FindViewthing (void) static edict_t *FindViewthing (void)
{ {
int i; int i;
edict_t *e; edict_t *e;
@ -2104,7 +2087,7 @@ edict_t *FindViewthing (void)
Host_Viewmodel_f Host_Viewmodel_f
================== ==================
*/ */
void Host_Viewmodel_f (void) static void Host_Viewmodel_f (void)
{ {
edict_t *e; edict_t *e;
qmodel_t *m; qmodel_t *m;
@ -2129,7 +2112,7 @@ void Host_Viewmodel_f (void)
Host_Viewframe_f Host_Viewframe_f
================== ==================
*/ */
void Host_Viewframe_f (void) static void Host_Viewframe_f (void)
{ {
edict_t *e; edict_t *e;
int f; int f;
@ -2147,8 +2130,7 @@ void Host_Viewframe_f (void)
e->v.frame = f; e->v.frame = f;
} }
static void PrintFrameName (qmodel_t *m, int frame)
void PrintFrameName (qmodel_t *m, int frame)
{ {
aliashdr_t *hdr; aliashdr_t *hdr;
maliasframedesc_t *pframedesc; maliasframedesc_t *pframedesc;
@ -2166,7 +2148,7 @@ void PrintFrameName (qmodel_t *m, int frame)
Host_Viewnext_f Host_Viewnext_f
================== ==================
*/ */
void Host_Viewnext_f (void) static void Host_Viewnext_f (void)
{ {
edict_t *e; edict_t *e;
qmodel_t *m; qmodel_t *m;
@ -2188,7 +2170,7 @@ void Host_Viewnext_f (void)
Host_Viewprev_f Host_Viewprev_f
================== ==================
*/ */
void Host_Viewprev_f (void) static void Host_Viewprev_f (void)
{ {
edict_t *e; edict_t *e;
qmodel_t *m; qmodel_t *m;
@ -2214,13 +2196,12 @@ DEMO LOOP CONTROL
=============================================================================== ===============================================================================
*/ */
/* /*
================== ==================
Host_Startdemos_f Host_Startdemos_f
================== ==================
*/ */
void Host_Startdemos_f (void) static void Host_Startdemos_f (void)
{ {
int i, c; int i, c;
@ -2256,7 +2237,6 @@ void Host_Startdemos_f (void)
} }
} }
/* /*
================== ==================
Host_Demos_f Host_Demos_f
@ -2264,7 +2244,7 @@ Host_Demos_f
Return to looping demos Return to looping demos
================== ==================
*/ */
void Host_Demos_f (void) static void Host_Demos_f (void)
{ {
if (cls.state == ca_dedicated) if (cls.state == ca_dedicated)
return; return;
@ -2281,7 +2261,7 @@ Host_Stopdemo_f
Return to looping demos Return to looping demos
================== ==================
*/ */
void Host_Stopdemo_f (void) static void Host_Stopdemo_f (void)
{ {
if (cls.state == ca_dedicated) if (cls.state == ca_dedicated)
return; return;

View file

@ -320,6 +320,7 @@ void ExtraMaps_Init (void);
void Modlist_Init (void); void Modlist_Init (void);
void DemoList_Init (void); void DemoList_Init (void);
void ExtraMaps_NewGame (void);
void DemoList_Rebuild (void); void DemoList_Rebuild (void);
extern int current_skill; // skill level for currently loaded level (in case extern int current_skill; // skill level for currently loaded level (in case