make gcc more anal about prototypes, string constants and function

visibility (ie, global functions must have a prototype)
This commit is contained in:
Bill Currie 2003-01-06 18:28:13 +00:00
parent 6b705adc31
commit 71196fedf6
311 changed files with 1641 additions and 2891 deletions

View file

@ -1389,7 +1389,7 @@ AC_ARG_ENABLE(Werror,
dnl We want warnings, lots of warnings... dnl We want warnings, lots of warnings...
if test "x$GCC" = "xyes"; then if test "x$GCC" = "xyes"; then
if test "x$enable_Werror" $cvs_def_enabled; then if test "x$enable_Werror" $cvs_def_enabled; then
CFLAGS="$CFLAGS -Wall -Werror" CFLAGS="$CFLAGS -Wall -Werror -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations"
else else
CFLAGS="$CFLAGS -Wall" CFLAGS="$CFLAGS -Wall"
fi fi

View file

@ -41,6 +41,5 @@ extern vec3_t lightspot;
void R_RotateForEntity (struct entity_s *e); void R_RotateForEntity (struct entity_s *e);
void glrmain_init (void); void glrmain_init (void);
int R_InitGraphTextures (int base);
#endif // __QF_GL_rmain_h #endif // __QF_GL_rmain_h

View file

@ -129,6 +129,10 @@ void Con_Skyboxlist_f (void);
void Con_Demolist_QWD_f (void); void Con_Demolist_QWD_f (void);
void Con_Demolist_DEM_f (void); void Con_Demolist_DEM_f (void);
//FIXME need a better way to communicate this (bah, need a better menu system
// in general :P)
void C_DrawInputLine (inputline_t *il);
void Menu_Init (void); void Menu_Init (void);
void Menu_Load (void); void Menu_Load (void);
void Menu_Draw (void); void Menu_Draw (void);

View file

@ -32,7 +32,7 @@
#ifndef __QF_csqc_h #ifndef __QF_csqc_h
#define __QF_csqc_h #define __QF_csqc_h
void BI_Init (); void BI_Init (void);
struct progs_s; struct progs_s;
struct cbuf_s; struct cbuf_s;

View file

@ -29,6 +29,5 @@
$Id$ $Id$
*/ */
void GIB_Process_Variable (struct dstring_s *token);
int GIB_Process_Math (struct dstring_s *token); int GIB_Process_Math (struct dstring_s *token);
int GIB_Process_Token (struct dstring_s *token, char delim); int GIB_Process_Token (struct dstring_s *token, char delim);

View file

@ -90,9 +90,9 @@ void IE_Multiplier_Event (ie_event_t *event, float value);
void IE_CallHandler (ie_handler handler, ie_event_t *event, float value); void IE_CallHandler (ie_handler handler, ie_event_t *event, float value);
ie_translation_table_t *IE_Translation_Table_Create (); ie_translation_table_t *IE_Translation_Table_Create (void);
void IE_Translation_Table_Modify (ie_translation_table_t *table, int offset, ie_event_t *event); void IE_Translation_Table_Modify (ie_translation_table_t *table, int offset, ie_event_t *event);
ie_translation_index_t *IE_Translation_Index_Create (); ie_translation_index_t *IE_Translation_Index_Create (void);
/* /*
typedef struct { typedef struct {

View file

@ -44,7 +44,7 @@ void locs_edit (const vec3_t loc, const char *desc);
void locs_load(const char *filename); void locs_load(const char *filename);
void locs_mark (const vec3_t loc, const char *desc); void locs_mark (const vec3_t loc, const char *desc);
int locs_nearest (const vec3_t loc); int locs_nearest (const vec3_t loc);
void locs_reset (); void locs_reset (void);
void locs_save (const char *filename, qboolean gz); void locs_save (const char *filename, qboolean gz);
void map_to_loc (const char *mapname, char *filename); void map_to_loc (const char *mapname, char *filename);

View file

@ -88,7 +88,7 @@ vec_t _DotProduct (const vec3_t v1, const vec3_t v2);
void _VectorAdd (const vec3_t veca, const vec3_t vecb, vec3_t out); void _VectorAdd (const vec3_t veca, const vec3_t vecb, vec3_t out);
void _VectorCopy (const vec3_t in, vec3_t out); void _VectorCopy (const vec3_t in, vec3_t out);
int _VectorCompare (const vec3_t v1, const vec3_t v2); // uses EQUAL_EPSILON int _VectorCompare (const vec3_t v1, const vec3_t v2); // uses EQUAL_EPSILON
//vec_t _VectorLength (vec3_t v); vec_t _VectorLength (const vec3_t v);
void _VectorMA (const vec3_t veca, float scale, const vec3_t vecb, void _VectorMA (const vec3_t veca, float scale, const vec3_t vecb,
vec3_t vecc); vec3_t vecc);
void _VectorScale (const vec3_t in, vec_t scale, vec3_t out); void _VectorScale (const vec3_t in, vec_t scale, vec3_t out);
@ -138,7 +138,8 @@ void RotatePointAroundVector (vec3_t dst, const vec3_t axis,
extern mplane_t frustum[4]; extern mplane_t frustum[4];
extern inline qboolean R_CullBox (const vec3_t mins, const vec3_t maxs);
extern inline qboolean R_CullSphere (const vec3_t origin, const float radius);
#ifndef IMPLEMENT_R_Cull #ifndef IMPLEMENT_R_Cull
extern inline extern inline
#endif #endif

View file

@ -85,10 +85,10 @@ typedef struct plugin_data_s {
typedef struct plugin_s { typedef struct plugin_s {
plugin_type_t type; plugin_type_t type;
void *handle; void *handle;
char *api_version; const char *api_version;
char *plugin_version; const char *plugin_version;
char *description; const char *description;
char *copyright; const char *copyright;
plugin_funcs_t *functions; plugin_funcs_t *functions;
plugin_data_t *data; plugin_data_t *data;
} plugin_t; } plugin_t;

View file

@ -257,6 +257,7 @@ extern const char *pr_gametype;
// PR Cmds stuff // PR Cmds stuff
// //
const char *PF_VarString (progs_t *pr, int first);
void PR_Cmds_Init (progs_t *pr); void PR_Cmds_Init (progs_t *pr);
//============================================================================ //============================================================================

View file

@ -34,8 +34,8 @@
#include "QF/qtypes.h" #include "QF/qtypes.h"
extern int com_argc; extern int com_argc;
extern char **com_argv; extern const char **com_argv;
extern char *com_cmdline; extern const char *com_cmdline;
int COM_CheckParm (const char *parm); int COM_CheckParm (const char *parm);
void COM_AddParm (const char *parm); void COM_AddParm (const char *parm);

View file

@ -89,7 +89,7 @@ typedef struct pldata_s { // Unparsed property list string
unsigned int end; unsigned int end;
unsigned int pos; unsigned int pos;
unsigned int line; unsigned int line;
char *error; const char *error;
} pldata_t; } pldata_t;
/* /*

View file

@ -66,7 +66,7 @@ int _COM_FOpenFile (const char *filename, QFile **gzfile, char *foundname, int z
int COM_FOpenFile (const char *filename, QFile **gzfile); int COM_FOpenFile (const char *filename, QFile **gzfile);
void COM_CloseFile (QFile *h); void COM_CloseFile (QFile *h);
void COM_FileBase (const char *in, char *out); void COM_FileBase (const char *in, char *out);
void COM_DefaultExtension (char *path, char *extension); void COM_DefaultExtension (char *path, const char *extension);
const char *COM_SkipPath (const char *pathname); const char *COM_SkipPath (const char *pathname);
void COM_StripExtension (const char *in, char *out); void COM_StripExtension (const char *in, char *out);
int COM_NextFilename (char *filename, const char *prefix, const char *ext); int COM_NextFilename (char *filename, const char *prefix, const char *ext);

View file

@ -192,6 +192,7 @@ dlight_t *R_AllocDlight (int key);
void R_DecayLights (double frametime); void R_DecayLights (double frametime);
void R_ClearDlights (void); void R_ClearDlights (void);
int R_InitGraphTextures (int base);
void R_LineGraph (int x, int y, int *h_vals, int count); void R_LineGraph (int x, int y, int *h_vals, int count);
struct progs_s; struct progs_s;
void R_Progs_Init (struct progs_s *pr); void R_Progs_Init (struct progs_s *pr);

View file

@ -33,9 +33,9 @@ extern struct cvar_s *cl_parsesay;
extern struct cvar_s *cl_nofake; extern struct cvar_s *cl_nofake;
extern struct cvar_s *cl_freply; extern struct cvar_s *cl_freply;
typedef char * (*ffunc_t) (char *args); typedef const char *(*ffunc_t) (char *args);
typedef struct freply_s { typedef struct freply_s {
char *name; const char *name;
ffunc_t func; ffunc_t func;
float lasttime; float lasttime;
} freply_t; } freply_t;

View file

@ -180,6 +180,7 @@ void D_DisableBackBufferAccess (void);
void D_EndDirectRect (int x, int y, int width, int height); void D_EndDirectRect (int x, int y, int width, int height);
void D_PolysetDraw (void); void D_PolysetDraw (void);
void D_PolysetDrawFinalVerts (finalvert_t *fv, int numverts); void D_PolysetDrawFinalVerts (finalvert_t *fv, int numverts);
void D_PolysetSetEdgeTable (void);
void D_DrawParticle (particle_t *pparticle); void D_DrawParticle (particle_t *pparticle);
void D_DrawPoly (void); void D_DrawPoly (void);
void D_DrawSprite (void); void D_DrawSprite (void);

View file

@ -31,14 +31,14 @@ typedef double (*funcfunc) (double *oplist, unsigned int numops);
typedef struct optable_s typedef struct optable_s
{ {
char *str; const char *str;
opfunc func; opfunc func;
unsigned int operands; unsigned int operands;
} optable_t; } optable_t;
typedef struct functable_s typedef struct functable_s
{ {
char *str; const char *str;
funcfunc func; // Heh funcfunc func; // Heh
unsigned int operands; unsigned int operands;
} functable_t; } functable_t;

View file

@ -127,14 +127,7 @@ struct option
`getopt'. */ `getopt'. */
#if defined __STDC__ && __STDC__ #if defined __STDC__ && __STDC__
# ifdef __GNU_LIBRARY__
/* Many other libraries have conflicting prototypes for getopt, with
differences in the consts, in stdlib.h. To avoid compilation
errors, only prototype getopt for the GNU C library. */
extern int getopt (int argc, char *const *argv, const char *__shortopts); extern int getopt (int argc, char *const *argv, const char *__shortopts);
# else /* not __GNU_LIBRARY__ */
extern int getopt ();
# endif /* __GNU_LIBRARY__ */
# ifndef __need_getopt # ifndef __need_getopt
extern int getopt_long (int argc, char *const *argv, const char *__shortopts, extern int getopt_long (int argc, char *const *argv, const char *__shortopts,

View file

@ -466,7 +466,7 @@ extern void re_set_registers
unsigned num_regs, regoff_t *starts, regoff_t *ends)); unsigned num_regs, regoff_t *starts, regoff_t *ends));
/* 4.2 bsd compatibility. */ /* 4.2 bsd compatibility. */
extern char *re_comp _RE_ARGS ((const char *)); extern const char *re_comp _RE_ARGS ((const char *));
extern int re_exec _RE_ARGS ((const char *)); extern int re_exec _RE_ARGS ((const char *));
/* POSIX compatibility. */ /* POSIX compatibility. */

View file

@ -83,7 +83,7 @@ CDAudio_Update (void)
cdmodule->functions->cd->pCDAudio_Update (); cdmodule->functions->cd->pCDAudio_Update ();
} }
void static void
CD_f (void) CD_f (void)
{ {
if (cdmodule) if (cdmodule)

View file

@ -451,6 +451,7 @@ I_CDAudio_Init (void)
Mus_CDChange, "device to use for CD music"); Mus_CDChange, "device to use for CD music");
} }
QFPLUGIN plugin_t *PLUGIN_INFO(cd, linux) (void);
QFPLUGIN plugin_t * QFPLUGIN plugin_t *
PLUGIN_INFO(cd, linux) (void) PLUGIN_INFO(cd, linux) (void)
{ {

View file

@ -78,6 +78,7 @@ I_CD_f (void)
{ {
} }
QFPLUGIN plugin_t *PLUGIN_INFO(cd, null) (void);
QFPLUGIN plugin_t * QFPLUGIN plugin_t *
PLUGIN_INFO(cd, null) (void) PLUGIN_INFO(cd, null) (void)
{ {

View file

@ -277,6 +277,7 @@ I_CDAudio_Init (void)
Sys_Printf ("CD Audio Initialized.\n"); Sys_Printf ("CD Audio Initialized.\n");
} }
QFPLUGIN plugin_t *PLUGIN_INFO(cd, sdl) (void);
QFPLUGIN plugin_t * QFPLUGIN plugin_t *
PLUGIN_INFO(cd, sdl) (void) PLUGIN_INFO(cd, sdl) (void)
{ {

View file

@ -360,7 +360,8 @@ I_SGI_Init (void)
return ; return ;
} }
QFPLUGIN plugin_t * QFPLUGIN plugin_t *PLUGIN_INFO(cd, sgi) (void);
QFPLUGIN plugin_t *
PLUGIN_INFO(cd, sgi) (void) PLUGIN_INFO(cd, sgi) (void)
{ {
plugin_info.type = qfp_cd; plugin_info.type = qfp_cd;

View file

@ -496,6 +496,7 @@ I_CDAudio_Init (void)
} }
} }
QFPLUGIN plugin_t *PLUGIN_INFO(cd, win) (void);
QFPLUGIN plugin_t * QFPLUGIN plugin_t *
PLUGIN_INFO(cd, win) (void) PLUGIN_INFO(cd, win) (void)
{ {

View file

@ -533,7 +533,8 @@ I_XMMS_f (void)
return; return;
} }
QFPLUGIN plugin_t * QFPLUGIN plugin_t *PLUGIN_INFO(cd, xmms) (void);
QFPLUGIN plugin_t *
PLUGIN_INFO(cd, xmms) (void) PLUGIN_INFO(cd, xmms) (void)
{ {
plugin_info.type = qfp_cd; plugin_info.type = qfp_cd;

View file

@ -114,7 +114,7 @@ SND_AmbientOn (void)
snd_ambient = true; snd_ambient = true;
} }
void static void
SND_SoundInfo_f (void) SND_SoundInfo_f (void)
{ {
if (!sound_started || !shm) { if (!sound_started || !shm) {
@ -132,7 +132,7 @@ SND_SoundInfo_f (void)
Sys_Printf ("%5d total_channels\n", total_channels); Sys_Printf ("%5d total_channels\n", total_channels);
} }
void static void
SND_Startup (void) SND_Startup (void)
{ {
int rc; int rc;
@ -154,7 +154,7 @@ SND_Startup (void)
} }
// Load a sound =============================================================== // Load a sound ===============================================================
sfx_t * static sfx_t *
SND_FindName (const char *name) SND_FindName (const char *name)
{ {
int i; int i;
@ -406,7 +406,7 @@ SND_StopAllSounds (qboolean clear)
SND_ClearBuffer (); SND_ClearBuffer ();
} }
void static void
SND_StopAllSoundsC (void) SND_StopAllSoundsC (void)
{ {
SND_StopAllSounds (true); SND_StopAllSounds (true);
@ -484,7 +484,7 @@ SND_StaticSound (sfx_t *sfx, const vec3_t origin, float vol,
//============================================================================= //=============================================================================
void static void
SND_UpdateAmbientSounds (void) SND_UpdateAmbientSounds (void)
{ {
float vol; float vol;
@ -534,7 +534,7 @@ SND_UpdateAmbientSounds (void)
} }
} }
void static void
SND_GetSoundtime (void) SND_GetSoundtime (void)
{ {
int fullsamples, samplepos; int fullsamples, samplepos;
@ -561,7 +561,7 @@ SND_GetSoundtime (void)
soundtime = buffers * fullsamples + samplepos / shm->channels; soundtime = buffers * fullsamples + samplepos / shm->channels;
} }
void static void
SND_Update_ (void) SND_Update_ (void)
{ {
int samps; int samps;
@ -689,7 +689,7 @@ SND_ExtraUpdate (void)
/* console functions */ /* console functions */
void static void
SND_Play (void) SND_Play (void)
{ {
char name[256]; char name[256];
@ -715,7 +715,7 @@ SND_Play (void)
} }
} }
void static void
SND_PlayVol (void) SND_PlayVol (void)
{ {
char name[256]; char name[256];
@ -743,7 +743,7 @@ SND_PlayVol (void)
} }
} }
void static void
SND_SoundList (void) SND_SoundList (void)
{ {
int load, size, total, i; int load, size, total, i;
@ -828,7 +828,7 @@ SND_UnblockSound (void)
S_O_UnblockSound (); S_O_UnblockSound ();
} }
void static void
SND_Init_Cvars (void) SND_Init_Cvars (void)
{ {
ambient_fade = Cvar_Get ("ambient_fade", "100", CVAR_NONE, NULL, ambient_fade = Cvar_Get ("ambient_fade", "100", CVAR_NONE, NULL,
@ -952,6 +952,7 @@ SND_Shutdown (void)
shm = 0; shm = 0;
} }
QFPLUGIN plugin_t *PLUGIN_INFO(snd_render, default) (void);
QFPLUGIN plugin_t * QFPLUGIN plugin_t *
PLUGIN_INFO(snd_render, default) (void) PLUGIN_INFO(snd_render, default) (void)
{ {

View file

@ -177,7 +177,7 @@ SND_ResampleSfx (sfxcache_t *sc, byte * data)
sc->data[sc->bytes + 2], sc->data[sc->bytes + 3]); sc->data[sc->bytes + 2], sc->data[sc->bytes + 3]);
} }
sfxcache_t * static sfxcache_t *
SND_LoadSound (sfx_t *sfx, cache_allocator_t allocator) SND_LoadSound (sfx_t *sfx, cache_allocator_t allocator)
{ {
char namebuffer[256]; char namebuffer[256];
@ -250,7 +250,7 @@ byte *last_chunk;
byte *iff_data; byte *iff_data;
int iff_chunk_len; int iff_chunk_len;
short static short
SND_GetLittleShort (void) SND_GetLittleShort (void)
{ {
short val = 0; short val = 0;
@ -261,7 +261,7 @@ SND_GetLittleShort (void)
return val; return val;
} }
int static int
SND_GetLittleLong (void) SND_GetLittleLong (void)
{ {
int val = 0; int val = 0;
@ -274,8 +274,8 @@ SND_GetLittleLong (void)
return val; return val;
} }
void static void
SND_FindNexctChunk (char *name) SND_FindNexctChunk (const char *name)
{ {
while (1) { while (1) {
data_p = last_chunk; data_p = last_chunk;
@ -299,14 +299,14 @@ SND_FindNexctChunk (char *name)
} }
} }
void static void
SND_FindChunk (char *name) SND_FindChunk (const char *name)
{ {
last_chunk = iff_data; last_chunk = iff_data;
SND_FindNexctChunk (name); SND_FindNexctChunk (name);
} }
/*
void static void
SND_DumpChunks (void) SND_DumpChunks (void)
{ {
char str[5]; char str[5];
@ -322,7 +322,7 @@ SND_DumpChunks (void)
data_p += (iff_chunk_len + 1) & ~1; data_p += (iff_chunk_len + 1) & ~1;
} while (data_p < iff_end); } while (data_p < iff_end);
} }
*/
wavinfo_t wavinfo_t
SND_GetWavinfo (const char *name, byte * wav, int wavlength) SND_GetWavinfo (const char *name, byte * wav, int wavlength)
{ {

View file

@ -79,7 +79,7 @@ SND_WriteLinearBlastStereo16 (void)
} }
#endif #endif
void static void
SND_TransferStereo16 (int endtime) SND_TransferStereo16 (int endtime)
{ {
int lpaintedtime, lpos; int lpaintedtime, lpos;
@ -133,7 +133,7 @@ SND_TransferStereo16 (int endtime)
#endif #endif
} }
void static void
SND_TransferPaintBuffer (int endtime) SND_TransferPaintBuffer (int endtime)
{ {
int count, out_idx, out_mask, snd_vol, step, val; int count, out_idx, out_mask, snd_vol, step, val;

View file

@ -162,6 +162,7 @@ SND_UnblockSound (void)
{ {
} }
QFPLUGIN plugin_t *PLUGIN_INFO(snd_render, null) (void);
QFPLUGIN plugin_t * QFPLUGIN plugin_t *
PLUGIN_INFO(snd_render, null) (void) PLUGIN_INFO(snd_render, null) (void)
{ {

View file

@ -403,8 +403,10 @@ SNDDMA_UnblockSound (void)
snd_pcm_playback_pause (pcm_handle, 0); snd_pcm_playback_pause (pcm_handle, 0);
} }
plugin_t * QFPLUGIN plugin_t *PLUGIN_INFO(snd_output, alsa0_5) (void);
PLUGIN_INFO(snd_output, alsa0_5) (void) { QFPLUGIN plugin_t *
PLUGIN_INFO(snd_output, alsa0_5) (void)
{
plugin_info.type = qfp_snd_output; plugin_info.type = qfp_snd_output;
plugin_info.api_version = QFPLUGIN_VERSION; plugin_info.api_version = QFPLUGIN_VERSION;
plugin_info.plugin_version = "0.1"; plugin_info.plugin_version = "0.1";

View file

@ -362,7 +362,8 @@ SNDDMA_UnblockSound (void)
qfsnd_pcm_pause (pcm, 0); qfsnd_pcm_pause (pcm, 0);
} }
plugin_t * QFPLUGIN plugin_t *PLUGIN_INFO(snd_output, alsa0_9) (void);
QFPLUGIN plugin_t *
PLUGIN_INFO(snd_output, alsa0_9) (void) PLUGIN_INFO(snd_output, alsa0_9) (void)
{ {
plugin_info.type = qfp_snd_output; plugin_info.type = qfp_snd_output;

View file

@ -152,6 +152,7 @@ SNDDMA_UnblockSound (void)
--snd_blocked; --snd_blocked;
} }
QFPLUGIN plugin_t *PLUGIN_INFO(snd_output, disk) (void);
QFPLUGIN plugin_t * QFPLUGIN plugin_t *
PLUGIN_INFO(snd_output, disk) (void) { PLUGIN_INFO(snd_output, disk) (void) {
plugin_info.type = qfp_snd_output; plugin_info.type = qfp_snd_output;

View file

@ -84,6 +84,7 @@ SNDDMA_UnblockSound (void)
{ {
} }
QFPLUGIN plugin_t *PLUGIN_INFO(snd_output, null) (void);
QFPLUGIN plugin_t * QFPLUGIN plugin_t *
PLUGIN_INFO(snd_output, null) (void) { PLUGIN_INFO(snd_output, null) (void) {
plugin_info.type = qfp_snd_output; plugin_info.type = qfp_snd_output;

View file

@ -377,6 +377,7 @@ SNDDMA_UnblockSound (void)
{ {
} }
QFPLUGIN plugin_t *PLUGIN_INFO(snd_output, oss) (void);
QFPLUGIN plugin_t * QFPLUGIN plugin_t *
PLUGIN_INFO(snd_output, oss) (void) { PLUGIN_INFO(snd_output, oss) (void) {
plugin_info.type = qfp_snd_output; plugin_info.type = qfp_snd_output;

View file

@ -228,6 +228,7 @@ SNDDMA_UnblockSound (void)
--snd_blocked; --snd_blocked;
} }
QFPLUGIN plugin_t *PLUGIN_INFO(snd_output, sdl) (void);
QFPLUGIN plugin_t * QFPLUGIN plugin_t *
PLUGIN_INFO(snd_output, sdl) (void) PLUGIN_INFO(snd_output, sdl) (void)
{ {

View file

@ -339,6 +339,7 @@ SNDDMA_UnblockSound (void)
{ {
} }
QFPLUGIN plugin_t *PLUGIN_INFO(snd_output, sgi) (void);
QFPLUGIN plugin_t * QFPLUGIN plugin_t *
PLUGIN_INFO(snd_output, sgi) (void) PLUGIN_INFO(snd_output, sgi) (void)
{ {

View file

@ -251,6 +251,7 @@ SNDDMA_UnblockSound (void)
--snd_blocked; --snd_blocked;
} }
QFPLUGIN plugin_t *PLUGIN_INFO(snd_output, sun) (void);
QFPLUGIN plugin_t * QFPLUGIN plugin_t *
PLUGIN_INFO(snd_output, sun) (void) { PLUGIN_INFO(snd_output, sun) (void) {
plugin_info.type = qfp_snd_output; plugin_info.type = qfp_snd_output;

View file

@ -106,7 +106,7 @@ SNDDMA_Init_Cvars (void)
{ {
} }
void static void
SNDDMA_BlockSound (void) SNDDMA_BlockSound (void)
{ {
// DirectSound takes care of blocking itself // DirectSound takes care of blocking itself
@ -115,7 +115,7 @@ SNDDMA_BlockSound (void)
waveOutReset (hWaveOut); waveOutReset (hWaveOut);
} }
void static void
SNDDMA_UnblockSound (void) SNDDMA_UnblockSound (void)
{ {
// DirectSound takes care of blocking itself // DirectSound takes care of blocking itself
@ -492,7 +492,7 @@ SNDDMA_InitWav (void)
Try to find a sound device to mix for. Try to find a sound device to mix for.
Returns false if nothing is found. Returns false if nothing is found.
*/ */
qboolean static qboolean
SNDDMA_Init (void) SNDDMA_Init (void)
{ {
sndinitstat stat; sndinitstat stat;
@ -718,6 +718,7 @@ DSOUND_Restore (void)
return; return;
} }
QFPLUGIN plugin_t *PLUGIN_INFO(snd_output, win) (void);
QFPLUGIN plugin_t * QFPLUGIN plugin_t *
PLUGIN_INFO(snd_output, win) (void) { PLUGIN_INFO(snd_output, win) (void) {
plugin_info.type = qfp_snd_output; plugin_info.type = qfp_snd_output;

View file

@ -269,7 +269,7 @@ Condump_f (void)
Qclose (file); Qclose (file);
} }
qboolean static qboolean
CheckForCommand (const char *line) CheckForCommand (const char *line)
{ {
char command[128]; char command[128];
@ -340,7 +340,7 @@ C_SayTeam (const char *line)
} }
void static void
C_GIB_Print_Center_f (void) C_GIB_Print_Center_f (void)
{ {
if (GIB_Argc () != 2) { if (GIB_Argc () != 2) {
@ -439,7 +439,7 @@ Linefeed (void)
All console printing must go through this in order to be logged to disk All console printing must go through this in order to be logged to disk
If no console is visible, the notify window will pop up. If no console is visible, the notify window will pop up.
*/ */
void static void
C_Print (const char *fmt, va_list args) C_Print (const char *fmt, va_list args)
{ {
char *s; char *s;
@ -857,6 +857,7 @@ static plugin_t plugin_info = {
&plugin_info_data, &plugin_info_data,
}; };
QFPLUGIN plugin_t *PLUGIN_INFO(console, client) (void);
QFPLUGIN plugin_t * QFPLUGIN plugin_t *
PLUGIN_INFO(console, client) (void) PLUGIN_INFO(console, client) (void)
{ {

View file

@ -168,7 +168,7 @@ filelist_print (struct filelist *filelist)
Fills a list with files of a specific extension. Fills a list with files of a specific extension.
*/ */
void static void
filelist_fill (struct filelist *filelist, const char *path, const char *ext) filelist_fill (struct filelist *filelist, const char *path, const char *ext)
{ {
searchpath_t *search; searchpath_t *search;
@ -224,7 +224,7 @@ Con_Skinlist_f (void)
filelist_free (skinlist); filelist_free (skinlist);
} }
char *sb_endings[] = { const char *sb_endings[] = {
"bk", "bk",
"dn", "dn",
"ft", "ft",

View file

@ -45,10 +45,6 @@ static const char rcsid[] =
#include "QF/render.h" #include "QF/render.h"
#include "QF/sys.h" #include "QF/sys.h"
//FIXME need a better way to communicate this (bah, need a better menu system
// in general :P)
void C_DrawInputLine (inputline_t *il);
typedef struct menu_pic_s { typedef struct menu_pic_s {
struct menu_pic_s *next; struct menu_pic_s *next;
int x, y; int x, y;
@ -87,7 +83,7 @@ static const char *top_menu;
static int static int
menu_resolve_globals (void) menu_resolve_globals (void)
{ {
char *sym; const char *sym;
dfunction_t *f; dfunction_t *f;
if (!(f = ED_FindFunction (&menu_pr_state, sym = "menu_init"))) if (!(f = ED_FindFunction (&menu_pr_state, sym = "menu_init")))

View file

@ -237,11 +237,12 @@ sv_logfile_f (cvar_t *var)
char *fname = strdup (var->string); char *fname = strdup (var->string);
char *flags = strrchr (fname, ':'); char *flags = strrchr (fname, ':');
if (flags) if (flags) {
*flags++ = 0; *flags++ = 0;
else flags = nva ("a%s", flags);
flags = ""; } else {
flags = nva ("a%s", flags); flags = nva ("a");
}
log_file = Qopen (va ("%s/%s", fs_userpath->string, fname), flags); log_file = Qopen (va ("%s/%s", fs_userpath->string, fname), flags);
free (flags); free (flags);
free (fname); free (fname);
@ -452,22 +453,22 @@ C_ProcessInput (void)
} }
} }
void static void
C_KeyEvent (knum_t key, short unicode, qboolean down) C_KeyEvent (knum_t key, short unicode, qboolean down)
{ {
} }
void static void
C_DrawConsole (int lines) C_DrawConsole (int lines)
{ {
} }
void static void
C_CheckResize (void) C_CheckResize (void)
{ {
} }
void static void
C_NewMap (void) C_NewMap (void)
{ {
} }
@ -515,6 +516,7 @@ static plugin_t plugin_info = {
&plugin_info_data, &plugin_info_data,
}; };
QFPLUGIN plugin_t *PLUGIN_INFO(console, server) (void);
QFPLUGIN plugin_t * QFPLUGIN plugin_t *
PLUGIN_INFO(console, server) (void) PLUGIN_INFO(console, server) (void)
{ {

View file

@ -33,6 +33,7 @@ static const char rcsid[] =
#include <stdlib.h> #include <stdlib.h>
#include "QF/cbuf.h" #include "QF/cbuf.h"
#include "QF/csqc.h"
#include "QF/idparse.h" // For now, use the id console parser #include "QF/idparse.h" // For now, use the id console parser
#include "QF/progs.h" #include "QF/progs.h"

View file

@ -43,6 +43,7 @@ static const char rcsid[] =
#endif #endif
#include "QF/cmd.h" #include "QF/cmd.h"
#include "QF/csqc.h"
#include "QF/hash.h" #include "QF/hash.h"
#include "QF/progs.h" #include "QF/progs.h"
#include "QF/sys.h" #include "QF/sys.h"

View file

@ -38,6 +38,7 @@ static const char rcsid[] =
# include <strings.h> # include <strings.h>
#endif #endif
#include "QF/csqc.h"
#include "QF/cvar.h" #include "QF/cvar.h"
#include "QF/progs.h" #include "QF/progs.h"
#include "QF/zone.h" #include "QF/zone.h"

View file

@ -52,6 +52,7 @@ static const char rcsid[] =
int fnmatch (const char *__pattern, const char *__string, int __flags); int fnmatch (const char *__pattern, const char *__string, int __flags);
#endif #endif
#include "QF/csqc.h"
#include "QF/progs.h" #include "QF/progs.h"
#include "QF/quakefs.h" #include "QF/quakefs.h"
#include "QF/va.h" #include "QF/va.h"

View file

@ -40,6 +40,7 @@ static const char rcsid[] =
#endif #endif
#include "QF/console.h" #include "QF/console.h"
#include "QF/csqc.h"
#include "QF/draw.h" #include "QF/draw.h"
#include "QF/progs.h" #include "QF/progs.h"
#include "QF/sys.h" #include "QF/sys.h"

View file

@ -39,6 +39,7 @@ static const char rcsid[] =
# include <strings.h> # include <strings.h>
#endif #endif
#include "QF/csqc.h"
#include "QF/console.h" #include "QF/console.h"
#include "QF/draw.h" #include "QF/draw.h"
#include "QF/progs.h" #include "QF/progs.h"

View file

@ -38,6 +38,7 @@ static const char rcsid[] =
# include <strings.h> # include <strings.h>
#endif #endif
#include "QF/csqc.h"
#include "QF/progs.h" #include "QF/progs.h"
#include "QF/zone.h" #include "QF/zone.h"

View file

@ -81,7 +81,7 @@ PF_VarString (progs_t *pr, int first)
vector normalize(vector) vector normalize(vector)
*/ */
void static void
PF_normalize (progs_t *pr) PF_normalize (progs_t *pr)
{ {
float new; float new;
@ -111,7 +111,7 @@ PF_normalize (progs_t *pr)
scalar vlen(vector) scalar vlen(vector)
*/ */
void static void
PF_vlen (progs_t *pr) PF_vlen (progs_t *pr)
{ {
float new; float new;
@ -131,7 +131,7 @@ PF_vlen (progs_t *pr)
float vectoyaw(vector) float vectoyaw(vector)
*/ */
void static void
PF_vectoyaw (progs_t *pr) PF_vectoyaw (progs_t *pr)
{ {
float yaw; float yaw;
@ -155,7 +155,7 @@ PF_vectoyaw (progs_t *pr)
vector vectoangles(vector) vector vectoangles(vector)
*/ */
void static void
PF_vectoangles (progs_t *pr) PF_vectoangles (progs_t *pr)
{ {
float forward, pitch, yaw; float forward, pitch, yaw;
@ -192,7 +192,7 @@ PF_vectoangles (progs_t *pr)
random() random()
*/ */
void static void
PF_random (progs_t *pr) PF_random (progs_t *pr)
{ {
float num; float num;
@ -207,7 +207,7 @@ PF_random (progs_t *pr)
break() break()
*/ */
void static void
PF_break (progs_t *pr) PF_break (progs_t *pr)
{ {
Sys_Printf ("break statement\n"); Sys_Printf ("break statement\n");
@ -239,7 +239,7 @@ PF_localcmd (progs_t *pr)
float cvar (string) float cvar (string)
*/ */
void static void
PF_cvar (progs_t *pr) PF_cvar (progs_t *pr)
{ {
const char *str; const char *str;
@ -254,7 +254,7 @@ PF_cvar (progs_t *pr)
float cvar (string) float cvar (string)
*/ */
void static void
PF_cvar_set (progs_t *pr) PF_cvar_set (progs_t *pr)
{ {
const char *var_name, *val; const char *var_name, *val;
@ -273,7 +273,7 @@ PF_cvar_set (progs_t *pr)
Cvar_Set (var, val); Cvar_Set (var, val);
} }
void static void
PF_fabs (progs_t *pr) PF_fabs (progs_t *pr)
{ {
float v; float v;
@ -283,7 +283,7 @@ PF_fabs (progs_t *pr)
} }
// entity (entity start, .string field, string match) find = #5; // entity (entity start, .string field, string match) find = #5;
void static void
PF_Find (progs_t *pr) PF_Find (progs_t *pr)
{ {
const char *s = 0, *t; // ev_string const char *s = 0, *t; // ev_string
@ -344,37 +344,37 @@ PF_Find (progs_t *pr)
RETURN_EDICT (pr, *pr->edicts); RETURN_EDICT (pr, *pr->edicts);
} }
void static void
PF_coredump (progs_t *pr) PF_coredump (progs_t *pr)
{ {
ED_PrintEdicts (pr, ""); ED_PrintEdicts (pr, "");
} }
void static void
PF_traceon (progs_t *pr) PF_traceon (progs_t *pr)
{ {
pr->pr_trace = true; pr->pr_trace = true;
} }
void static void
PF_traceoff (progs_t *pr) PF_traceoff (progs_t *pr)
{ {
pr->pr_trace = false; pr->pr_trace = false;
} }
void static void
PF_eprint (progs_t *pr) PF_eprint (progs_t *pr)
{ {
ED_PrintNum (pr, P_EDICTNUM (pr, 0)); ED_PrintNum (pr, P_EDICTNUM (pr, 0));
} }
void static void
PF_dprint (progs_t *pr) PF_dprint (progs_t *pr)
{ {
Sys_Printf ("%s", PF_VarString (pr, 0)); Sys_Printf ("%s", PF_VarString (pr, 0));
} }
void static void
PF_rint (progs_t *pr) PF_rint (progs_t *pr)
{ {
float f; float f;
@ -386,13 +386,13 @@ PF_rint (progs_t *pr)
R_FLOAT (pr) = (int) (f - 0.5); R_FLOAT (pr) = (int) (f - 0.5);
} }
void static void
PF_floor (progs_t *pr) PF_floor (progs_t *pr)
{ {
R_FLOAT (pr) = floor (P_FLOAT (pr, 0)); R_FLOAT (pr) = floor (P_FLOAT (pr, 0));
} }
void static void
PF_ceil (progs_t *pr) PF_ceil (progs_t *pr)
{ {
R_FLOAT (pr) = ceil (P_FLOAT (pr, 0)); R_FLOAT (pr) = ceil (P_FLOAT (pr, 0));
@ -403,7 +403,7 @@ PF_ceil (progs_t *pr)
entity nextent(entity) entity nextent(entity)
*/ */
void static void
PF_nextent (progs_t *pr) PF_nextent (progs_t *pr)
{ {
int i; int i;
@ -436,7 +436,7 @@ PF_nextent (progs_t *pr)
integer (float f) ftoi integer (float f) ftoi
*/ */
void static void
PF_ftoi (progs_t *pr) PF_ftoi (progs_t *pr)
{ {
R_INT (pr) = P_FLOAT (pr, 0); R_INT (pr) = P_FLOAT (pr, 0);
@ -447,7 +447,7 @@ PF_ftoi (progs_t *pr)
string (float f) ftos string (float f) ftos
*/ */
void static void
PF_ftos (progs_t *pr) PF_ftos (progs_t *pr)
{ {
char string[STRING_BUF]; char string[STRING_BUF];
@ -473,7 +473,7 @@ PF_ftos (progs_t *pr)
float (integer i) itof float (integer i) itof
*/ */
void static void
PF_itof (progs_t *pr) PF_itof (progs_t *pr)
{ {
R_FLOAT (pr) = P_INT (pr, 0); R_FLOAT (pr) = P_INT (pr, 0);
@ -484,7 +484,7 @@ PF_itof (progs_t *pr)
string (integer i) itos string (integer i) itos
*/ */
void static void
PF_itos (progs_t *pr) PF_itos (progs_t *pr)
{ {
char string[STRING_BUF]; char string[STRING_BUF];
@ -499,7 +499,7 @@ PF_itos (progs_t *pr)
float (string s) stof float (string s) stof
*/ */
void static void
PF_stof (progs_t *pr) PF_stof (progs_t *pr)
{ {
R_FLOAT (pr) = atof (P_STRING (pr, 0)); R_FLOAT (pr) = atof (P_STRING (pr, 0));
@ -510,7 +510,7 @@ PF_stof (progs_t *pr)
integer (string s) stoi integer (string s) stoi
*/ */
void static void
PF_stoi (progs_t *pr) PF_stoi (progs_t *pr)
{ {
R_INT (pr) = atoi (P_STRING (pr, 0)); R_INT (pr) = atoi (P_STRING (pr, 0));
@ -521,7 +521,7 @@ PF_stoi (progs_t *pr)
vector (string s) stov vector (string s) stov
*/ */
void static void
PF_stov (progs_t *pr) PF_stov (progs_t *pr)
{ {
float v[3] = {0, 0, 0}; float v[3] = {0, 0, 0};
@ -536,7 +536,7 @@ PF_stov (progs_t *pr)
string (vector v) vtos string (vector v) vtos
*/ */
void static void
PF_vtos (progs_t *pr) PF_vtos (progs_t *pr)
{ {
char string[STRING_BUF * 3 + 5]; char string[STRING_BUF * 3 + 5];
@ -554,7 +554,7 @@ PF_vtos (progs_t *pr)
float(string s) strlen float(string s) strlen
*/ */
void static void
PF_strlen (progs_t *pr) PF_strlen (progs_t *pr)
{ {
const char *s; const char *s;
@ -568,7 +568,7 @@ PF_strlen (progs_t *pr)
float(string char, string s) charcount float(string char, string s) charcount
*/ */
void static void
PF_charcount (progs_t *pr) PF_charcount (progs_t *pr)
{ {
char goal; char goal;
@ -599,7 +599,7 @@ PF_charcount (progs_t *pr)
#define MAX_ARG 23 #define MAX_ARG 23
void static void
PF_sprintf (progs_t *pr) PF_sprintf (progs_t *pr)
{ {
char *format; char *format;
@ -834,7 +834,7 @@ PF_sprintf (progs_t *pr)
PR_Error (pr, "PF_sprintf: argument limit exceeded\n"); PR_Error (pr, "PF_sprintf: argument limit exceeded\n");
} }
void static void
PR_gametype (progs_t *pr) PR_gametype (progs_t *pr)
{ {
RETURN_STRING (pr, pr_gametype); RETURN_STRING (pr, pr_gametype);

View file

@ -103,7 +103,7 @@ PR_Debug_Init_Cvars (void)
"to look (within gamedir) for source files"); "to look (within gamedir) for source files");
} }
file_t * static file_t *
PR_Load_Source_File (progs_t *pr, const char *fname) PR_Load_Source_File (progs_t *pr, const char *fname)
{ {
char *path, *l; char *path, *l;

View file

@ -157,36 +157,6 @@ ED_Alloc (progs_t *pr)
return e; return e;
} }
/*
ED_FreeRefs
NULLs all references to entity
*/
void
ED_FreeRefs (progs_t *pr, edict_t *ed)
{
int i, j, k;
ddef_t *def;
for (i = 0; i < pr->progs->numglobaldefs; i++) {
def = &pr->pr_globaldefs[i];
if ((def->type & ~DEF_SAVEGLOBAL) == ev_entity) {
if (ed == G_EDICT (pr, def->ofs)) {
Sys_Printf ("Reference found to free'd edict: %p\n", ed);
}
}
}
for (i = 0; i < pr->progs->numfielddefs; i++) {
def = &pr->pr_fielddefs[i];
if ((def->type & ~DEF_SAVEGLOBAL) == ev_entity) {
for (j = 0; j < *pr->num_edicts; j++) {
k = E_var (EDICT_NUM (pr, j), def->ofs, entity);
if (ed == PROG_TO_EDICT (pr, k))
Sys_Printf ("Reference found to free'd edict: %p\n", ed);
}
}
}
}
/* /*
ED_Free ED_Free
@ -218,7 +188,7 @@ ED_Free (progs_t *pr, edict_t *ed)
Returns a string describing *data in a type-specific manner Returns a string describing *data in a type-specific manner
*/ */
char * static const char *
PR_ValueString (progs_t *pr, etype_t type, pr_type_t *val) PR_ValueString (progs_t *pr, etype_t type, pr_type_t *val)
{ {
static char line[256]; static char line[256];
@ -295,7 +265,7 @@ PR_GlobalString (progs_t *pr, int ofs, etype_t type)
{ {
ddef_t *def = NULL; ddef_t *def = NULL;
static dstring_t *line = NULL; static dstring_t *line = NULL;
char *s; const char *s;
if (!line) if (!line)
line = dstring_newstr(); line = dstring_newstr();
@ -312,8 +282,8 @@ PR_GlobalString (progs_t *pr, int ofs, etype_t type)
if (!def && type == ev_void) if (!def && type == ev_void)
dsprintf (line, "[$%x]", ofs); dsprintf (line, "[$%x]", ofs);
else { else {
char *name = "?"; const char *name = "?";
char *oi = ""; const char *oi = "";
if (def) { if (def) {
if (type == ev_void) if (type == ev_void)
type = def->type; type = def->type;

View file

@ -144,7 +144,7 @@ PR_EnterFunction (progs_t * pr, dfunction_t *f)
return; return;
} }
void static void
PR_LeaveFunction (progs_t * pr) PR_LeaveFunction (progs_t * pr)
{ {
int c; int c;

View file

@ -115,7 +115,7 @@ dump_ivars (progs_t *pr, pointer_t _ivars)
} }
} }
string_t static string_t
object_get_class_name (progs_t *pr, pr_id_t *object) object_get_class_name (progs_t *pr, pr_id_t *object)
{ {
pr_class_t *class; pr_class_t *class;

View file

@ -61,7 +61,7 @@ static const char rcsid[] =
Returns a string describing *data in a type specific manner Returns a string describing *data in a type specific manner
Easier to parse than PR_ValueString Easier to parse than PR_ValueString
*/ */
char * static char *
PR_UglyValueString (progs_t *pr, etype_t type, pr_type_t *val) PR_UglyValueString (progs_t *pr, etype_t type, pr_type_t *val)
{ {
static char line[256]; static char line[256];
@ -221,7 +221,7 @@ ED_NewString (progs_t *pr, const char *string)
Can parse either fields or globals Can parse either fields or globals
returns false if error returns false if error
*/ */
qboolean static qboolean
ED_ParseEpair (progs_t *pr, pr_type_t *base, ddef_t *key, const char *s) ED_ParseEpair (progs_t *pr, pr_type_t *base, ddef_t *key, const char *s)
{ {
int i; int i;

View file

@ -161,8 +161,8 @@ ED_FindFunction (progs_t * pr, const char *name)
int int
PR_ResolveGlobals (progs_t *pr) PR_ResolveGlobals (progs_t *pr)
{ {
char *sym; const char *sym;
ddef_t *def; ddef_t *def;
if (!(def = PR_FindGlobal (pr, sym = "time"))) if (!(def = PR_FindGlobal (pr, sym = "time")))
goto error; goto error;

View file

@ -69,7 +69,7 @@ functable_t functable[] =
}; };
// Error handling // Error handling
exp_error_t static exp_error_t
EXP_Error (exp_error_t err, const char *msg) EXP_Error (exp_error_t err, const char *msg)
{ {
EXP_ERROR = err; EXP_ERROR = err;
@ -85,7 +85,7 @@ EXP_GetErrorMsg (void)
return exp_error_msg; return exp_error_msg;
} }
token static token
*EXP_NewToken (void) *EXP_NewToken (void)
{ {
token *new; token *new;
@ -110,7 +110,7 @@ EXP_FindIndexByFunc (opfunc func)
} }
*/ */
optable_t * static optable_t *
EXP_FindOpByStr (const char *str) EXP_FindOpByStr (const char *str)
{ {
int i, len, fi; int i, len, fi;
@ -126,7 +126,7 @@ EXP_FindOpByStr (const char *str)
return 0; return 0;
} }
functable_t * static functable_t *
EXP_FindFuncByStr (const char *str) EXP_FindFuncByStr (const char *str)
{ {
int i, len, fi; int i, len, fi;
@ -142,7 +142,7 @@ EXP_FindFuncByStr (const char *str)
return 0; return 0;
} }
int static int
EXP_ContainsCommas (token *chain) EXP_ContainsCommas (token *chain)
{ {
token *cur; token *cur;
@ -160,7 +160,7 @@ EXP_ContainsCommas (token *chain)
return -1; // We should never get here return -1; // We should never get here
} }
int static int
EXP_DoFunction (token *chain) EXP_DoFunction (token *chain)
{ {
token *cur, *temp; token *cur, *temp;
@ -196,7 +196,7 @@ EXP_DoFunction (token *chain)
return -2; // We shouldn't get here return -2; // We shouldn't get here
} }
int static int
EXP_DoUnary (token *chain) EXP_DoUnary (token *chain)
{ {
if (chain->generic.next->generic.type == TOKEN_OP) if (chain->generic.next->generic.type == TOKEN_OP)

View file

@ -67,12 +67,12 @@ hashtab_t *gib_builtins;
/* /*
Hashtable callbacks Hashtable callbacks
*/ */
const char * static const char *
GIB_Builtin_Get_Key (void *ele, void *ptr) GIB_Builtin_Get_Key (void *ele, void *ptr)
{ {
return ((gib_builtin_t *)ele)->name->str; return ((gib_builtin_t *)ele)->name->str;
} }
void static void
GIB_Builtin_Free (void *ele, void *ptr) GIB_Builtin_Free (void *ele, void *ptr)
{ {
gib_builtin_t *b; gib_builtin_t *b;
@ -153,7 +153,7 @@ GIB_Return (const char *str)
See GIB docs for information. See GIB docs for information.
*/ */
void static void
GIB_Function_f (void) GIB_Function_f (void)
{ {
if (GIB_Argc () != 3) if (GIB_Argc () != 3)
@ -162,7 +162,7 @@ GIB_Function_f (void)
GIB_Function_Define (GIB_Argv(1), GIB_Argv(2)); GIB_Function_Define (GIB_Argv(1), GIB_Argv(2));
} }
void static void
GIB_Function_Get_f (void) GIB_Function_Get_f (void)
{ {
if (GIB_Argc () != 2) if (GIB_Argc () != 2)
@ -176,7 +176,7 @@ GIB_Function_Get_f (void)
} }
} }
void static void
GIB_Local_f (void) GIB_Local_f (void)
{ {
int i; int i;
@ -188,7 +188,7 @@ GIB_Local_f (void)
GIB_Var_Set_Local (cbuf_active, GIB_Argv(i), ""); GIB_Var_Set_Local (cbuf_active, GIB_Argv(i), "");
} }
void static void
GIB_Global_f (void) GIB_Global_f (void)
{ {
int i; int i;
@ -200,7 +200,7 @@ GIB_Global_f (void)
GIB_Var_Set_Global (GIB_Argv(i), ""); GIB_Var_Set_Global (GIB_Argv(i), "");
} }
void static void
GIB_Global_Delete_f (void) GIB_Global_Delete_f (void)
{ {
if (GIB_Argc () != 2) if (GIB_Argc () != 2)
@ -209,7 +209,7 @@ GIB_Global_Delete_f (void)
GIB_Var_Free_Global (GIB_Argv(1)); GIB_Var_Free_Global (GIB_Argv(1));
} }
void static void
GIB_Return_f (void) GIB_Return_f (void)
{ {
cbuf_t *sp; cbuf_t *sp;
@ -243,7 +243,7 @@ GIB_Return_f (void)
} }
} }
void static void
GIB_If_f (void) GIB_If_f (void)
{ {
int condition; int condition;
@ -264,7 +264,7 @@ GIB_If_f (void)
GIB_USAGE ("condition program [else ...]"); GIB_USAGE ("condition program [else ...]");
} }
void static void
GIB_While_f (void) GIB_While_f (void)
{ {
if (GIB_Argc() != 3) { if (GIB_Argc() != 3) {
@ -285,12 +285,12 @@ GIB_While_f (void)
} }
} }
void static void
GIB_Field_Get_f (void) GIB_Field_Get_f (void)
{ {
unsigned int field; unsigned int field;
char *list, *end; char *end;
const char *ifs; const char *list, *ifs;
if (GIB_Argc() < 3 || GIB_Argc() > 4) { if (GIB_Argc() < 3 || GIB_Argc() > 4) {
GIB_USAGE ("list element [fs]"); GIB_USAGE ("list element [fs]");
return; return;
@ -303,7 +303,7 @@ GIB_Field_Get_f (void)
ifs = " \t\n\r"; ifs = " \t\n\r";
if (!*ifs) { if (!*ifs) {
if (field < strlen(GIB_Argv(1))) { if (field < strlen(GIB_Argv(1))) {
GIB_Argv(1)[field+1] = 0; ((char *)GIB_Argv(1))[field+1] = 0;
GIB_Return (GIB_Argv(1)+field); GIB_Return (GIB_Argv(1)+field);
} else } else
GIB_Return (""); GIB_Return ("");
@ -321,13 +321,13 @@ GIB_Field_Get_f (void)
} }
field--; field--;
} }
for (end = list; !strchr(ifs, *end); end++); for (end = (char *)list; !strchr(ifs, *end); end++);
*end = 0; *end = 0;
GIB_Return (list); GIB_Return (list);
} }
void static void
GIB___For_f (void) GIB___For_f (void)
{ {
char *end = 0, old = 0; char *end = 0, old = 0;
@ -356,7 +356,7 @@ GIB___For_f (void)
GIB_DATA(cbuf_active)->loop_list_p = end; GIB_DATA(cbuf_active)->loop_list_p = end;
} }
void static void
GIB_For_f (void) GIB_For_f (void)
{ {
if (strcmp ("in", GIB_Argv (2)) || if (strcmp ("in", GIB_Argv (2)) ||
@ -396,7 +396,7 @@ GIB_For_f (void)
} }
} }
void static void
GIB_Break_f (void) GIB_Break_f (void)
{ {
if (GIB_DATA(cbuf_active)->type != GIB_BUFFER_LOOP) if (GIB_DATA(cbuf_active)->type != GIB_BUFFER_LOOP)
@ -409,7 +409,7 @@ GIB_Break_f (void)
} }
} }
void static void
GIB_Continue_f (void) GIB_Continue_f (void)
{ {
if (GIB_DATA(cbuf_active)->type != GIB_BUFFER_LOOP) if (GIB_DATA(cbuf_active)->type != GIB_BUFFER_LOOP)
@ -421,7 +421,7 @@ GIB_Continue_f (void)
} }
// Note: this is a standard console command, not a GIB builtin // Note: this is a standard console command, not a GIB builtin
void static void
GIB_Runexported_f (void) GIB_Runexported_f (void)
{ {
gib_function_t *f; gib_function_t *f;
@ -439,7 +439,7 @@ GIB_Runexported_f (void)
} }
} }
void static void
GIB_Function_Export_f (void) GIB_Function_Export_f (void)
{ {
gib_function_t *f; gib_function_t *f;
@ -457,7 +457,7 @@ GIB_Function_Export_f (void)
} }
} }
void static void
GIB_String_Length_f (void) GIB_String_Length_f (void)
{ {
dstring_t *ret; dstring_t *ret;
@ -467,7 +467,7 @@ GIB_String_Length_f (void)
dsprintf (ret, "%i", (int) strlen(GIB_Argv(1))); dsprintf (ret, "%i", (int) strlen(GIB_Argv(1)));
} }
void static void
GIB_String_Equal_f (void) GIB_String_Equal_f (void)
{ {
if (GIB_Argc() != 3) if (GIB_Argc() != 3)
@ -478,11 +478,11 @@ GIB_String_Equal_f (void)
GIB_Return ("1"); GIB_Return ("1");
} }
void static void
GIB_String_Findsub_f (void) GIB_String_Findsub_f (void)
{ {
dstring_t *ret; dstring_t *ret;
char *haystack, *res; const char *haystack, *res;
if (GIB_Argc() != 3) { if (GIB_Argc() != 3) {
GIB_USAGE ("string substr"); GIB_USAGE ("string substr");
return; return;
@ -495,7 +495,7 @@ GIB_String_Findsub_f (void)
GIB_Return ("-1"); GIB_Return ("-1");
} }
void static void
GIB_Regex_Match_f (void) GIB_Regex_Match_f (void)
{ {
regex_t *reg; regex_t *reg;
@ -513,7 +513,7 @@ GIB_Regex_Match_f (void)
GIB_Return ("1"); GIB_Return ("1");
} }
void static void
GIB_Regex_Replace_f (void) GIB_Regex_Replace_f (void)
{ {
regex_t *reg; regex_t *reg;
@ -538,7 +538,7 @@ GIB_Regex_Replace_f (void)
GIB_Return (GIB_Argv(1)); GIB_Return (GIB_Argv(1));
} }
void static void
GIB_Regex_Extract_f (void) GIB_Regex_Extract_f (void)
{ {
regex_t *reg; regex_t *reg;
@ -559,9 +559,9 @@ GIB_Regex_Extract_f (void)
for (i = 0; i < GIB_Argc() - 4; i++) { for (i = 0; i < GIB_Argc() - 4; i++) {
if (match[i].rm_so != -1 && *GIB_Argv(i+4)) { if (match[i].rm_so != -1 && *GIB_Argv(i+4)) {
o = GIB_Argv(1)[match[i].rm_eo]; o = GIB_Argv(1)[match[i].rm_eo];
GIB_Argv(1)[match[i].rm_eo] = 0; ((char *)GIB_Argv(1))[match[i].rm_eo] = 0;
GIB_Var_Set_Local (cbuf_active, GIB_Argv(i+4), GIB_Argv(1)+match[i].rm_so); GIB_Var_Set_Local (cbuf_active, GIB_Argv(i+4), GIB_Argv(1)+match[i].rm_so);
GIB_Argv(1)[match[i].rm_eo] = o; ((char *)GIB_Argv(1))[match[i].rm_eo] = o;
} }
} }
if ((ret = GIB_Return (0))) if ((ret = GIB_Return (0)))
@ -571,7 +571,7 @@ GIB_Regex_Extract_f (void)
free (match); free (match);
} }
void static void
GIB_Thread_Create_f (void) GIB_Thread_Create_f (void)
{ {
dstring_t *ret; dstring_t *ret;
@ -586,7 +586,7 @@ GIB_Thread_Create_f (void)
} }
} }
void static void
GIB_Thread_Kill_f (void) GIB_Thread_Kill_f (void)
{ {
if (GIB_Argc() != 2) if (GIB_Argc() != 2)
@ -610,7 +610,7 @@ GIB_Thread_Kill_f (void)
} }
} }
void static void
GIB_Event_Register_f (void) GIB_Event_Register_f (void)
{ {
gib_function_t *func; gib_function_t *func;
@ -626,7 +626,7 @@ GIB_Event_Register_f (void)
int (*GIB_File_Transform_Path) (dstring_t *path) = NULL; int (*GIB_File_Transform_Path) (dstring_t *path) = NULL;
int static int
GIB_File_Transform_Path_Null (dstring_t *path) GIB_File_Transform_Path_Null (dstring_t *path)
{ {
char *s; char *s;
@ -637,7 +637,7 @@ GIB_File_Transform_Path_Null (dstring_t *path)
return 0; return 0;
} }
int static int
GIB_File_Transform_Path_Secure (dstring_t *path) GIB_File_Transform_Path_Secure (dstring_t *path)
{ {
char *s /* , e_dir[MAX_OSPATH] */; char *s /* , e_dir[MAX_OSPATH] */;
@ -652,11 +652,11 @@ GIB_File_Transform_Path_Secure (dstring_t *path)
return 0; return 0;
} }
void static void
GIB_File_Read_f (void) GIB_File_Read_f (void)
{ {
QFile *file; QFile *file;
char *path; const char *path;
int len; int len;
dstring_t *ret; dstring_t *ret;
@ -693,11 +693,11 @@ GIB_File_Read_f (void)
} }
} }
void static void
GIB_File_Write_f (void) GIB_File_Write_f (void)
{ {
QFile *file; QFile *file;
char *path; const char *path;
if (GIB_Argc () != 3) { if (GIB_Argc () != 3) {
GIB_USAGE ("file data"); GIB_USAGE ("file data");
@ -723,12 +723,13 @@ GIB_File_Write_f (void)
Qclose (file); Qclose (file);
} }
void static void
GIB_File_Find_f (void) GIB_File_Find_f (void)
{ {
DIR *directory; DIR *directory;
struct dirent *entry; struct dirent *entry;
char *path, *glob = 0, *s; const char *path, *glob = 0;
char *s;
const char *ifs; const char *ifs;
dstring_t *list; dstring_t *list;
@ -773,10 +774,10 @@ GIB_File_Find_f (void)
closedir (directory); closedir (directory);
} }
void static void
GIB_File_Move_f (void) GIB_File_Move_f (void)
{ {
char *path1, *path2; const char *path1, *path2;
if (GIB_Argc () != 3) { if (GIB_Argc () != 3) {
GIB_USAGE ("from_file to_file"); GIB_USAGE ("from_file to_file");
@ -800,10 +801,10 @@ GIB_File_Move_f (void)
path1, path2, strerror(errno)); path1, path2, strerror(errno));
} }
void static void
GIB_File_Delete_f (void) GIB_File_Delete_f (void)
{ {
char *path; const char *path;
if (GIB_Argc () != 2) { if (GIB_Argc () != 2) {
GIB_USAGE ("file"); GIB_USAGE ("file");
@ -821,7 +822,7 @@ GIB_File_Delete_f (void)
path, strerror(errno)); path, strerror(errno));
} }
void static void
GIB_Range_f (void) GIB_Range_f (void)
{ {
double i, inc, start, limit; double i, inc, start, limit;
@ -846,7 +847,7 @@ GIB_Range_f (void)
dstr->str[dstr->size-2] = 0; dstr->str[dstr->size-2] = 0;
} }
void static void
GIB_Print_f (void) GIB_Print_f (void)
{ {
if (GIB_Argc() != 2) { if (GIB_Argc() != 2) {

View file

@ -55,7 +55,7 @@ hashtab_t *gib_functions = 0;
Builds a new function struct and returns Builds a new function struct and returns
a pointer to it. a pointer to it.
*/ */
gib_function_t * static gib_function_t *
GIB_Function_New (void) GIB_Function_New (void)
{ {
gib_function_t *new = calloc (1, sizeof (gib_function_t)); gib_function_t *new = calloc (1, sizeof (gib_function_t));
@ -68,12 +68,12 @@ GIB_Function_New (void)
/* /*
Hashtable callbacks Hashtable callbacks
*/ */
const char * static const char *
GIB_Function_Get_Key (void *ele, void *ptr) GIB_Function_Get_Key (void *ele, void *ptr)
{ {
return ((gib_function_t *)ele)->name->str; return ((gib_function_t *)ele)->name->str;
} }
void static void
GIB_Function_Free (void *ele, void *ptr) GIB_Function_Free (void *ele, void *ptr)
{ {
gib_function_t *func = (gib_function_t *)ele; gib_function_t *func = (gib_function_t *)ele;

View file

@ -35,6 +35,7 @@ static const char rcsid[] =
#include "QF/qtypes.h" #include "QF/qtypes.h"
#include "QF/cbuf.h" #include "QF/cbuf.h"
#include "QF/quakefs.h" #include "QF/quakefs.h"
#include "QF/gib_init.h"
#include "QF/gib_parse.h" #include "QF/gib_parse.h"
#include "QF/gib_builtin.h" #include "QF/gib_builtin.h"
#include "QF/gib_regex.h" #include "QF/gib_regex.h"
@ -44,7 +45,7 @@ static const char rcsid[] =
#include "QF/zone.h" #include "QF/zone.h"
#include "QF/cvar.h" #include "QF/cvar.h"
void static void
GIB_Exec_Override_f (void) { GIB_Exec_Override_f (void) {
char *f; char *f;
int mark; int mark;

View file

@ -91,7 +91,7 @@ GIB_Escaped (const char *str, int i)
0 on success, or the character it could not 0 on success, or the character it could not
match otherwise match otherwise
*/ */
char static char
GIB_Parse_Match_Dquote (const char *str, unsigned int *i) GIB_Parse_Match_Dquote (const char *str, unsigned int *i)
{ {
unsigned int n = *i; unsigned int n = *i;
@ -494,7 +494,7 @@ FILTER_ERROR:
return; return;
} }
inline qboolean static inline qboolean
GIB_Parse_Execute_Varexp (cbuf_t *cbuf) GIB_Parse_Execute_Varexp (cbuf_t *cbuf)
{ {
char *s; char *s;

View file

@ -44,11 +44,12 @@ static const char rcsid[] =
#include "QF/cvar.h" #include "QF/cvar.h"
#include "QF/gib_buffer.h" #include "QF/gib_buffer.h"
#include "QF/gib_parse.h" #include "QF/gib_parse.h"
#include "QF/gib_process.h"
#include "QF/gib_vars.h" #include "QF/gib_vars.h"
#include "exp.h" #include "exp.h"
int static int
GIB_Process_Index (dstring_t *index, unsigned int pos, int *i1, int *i2) GIB_Process_Index (dstring_t *index, unsigned int pos, int *i1, int *i2)
{ {
int i, v1, v2; int i, v1, v2;
@ -77,7 +78,7 @@ GIB_Process_Index (dstring_t *index, unsigned int pos, int *i1, int *i2)
return 0; return 0;
} }
unsigned int static unsigned int
GIB_Process_Variable (struct dstring_s *dstr, unsigned int pos, qboolean tolerant) GIB_Process_Variable (struct dstring_s *dstr, unsigned int pos, qboolean tolerant)
{ {
cvar_t *cvar; cvar_t *cvar;
@ -119,7 +120,7 @@ GIB_Process_Math (struct dstring_s *token)
return 0; return 0;
} }
int static int
GIB_Process_Embedded (struct dstring_s *token) GIB_Process_Embedded (struct dstring_s *token)
{ {
cbuf_t *sub; cbuf_t *sub;
@ -264,7 +265,7 @@ ERROR:
return c ? -1 : 0; return c ? -1 : 0;
} }
void static void
GIB_Process_Escapes (dstring_t *token) GIB_Process_Escapes (dstring_t *token)
{ {
int i; int i;

View file

@ -45,13 +45,13 @@ static const char rcsid[] =
hashtab_t *gib_regexs; hashtab_t *gib_regexs;
static char errstr[1024]; static char errstr[1024];
const char * static const char *
GIB_Regex_Get_Key (void *ele, void *ptr) GIB_Regex_Get_Key (void *ele, void *ptr)
{ {
return ((gib_regex_t *) ele)->regex; return ((gib_regex_t *) ele)->regex;
} }
void static void
GIB_Regex_Free (void *ele, void *ptr) GIB_Regex_Free (void *ele, void *ptr)
{ {
regfree (&(((gib_regex_t *) ele)->comp)); regfree (&(((gib_regex_t *) ele)->comp));

View file

@ -92,7 +92,7 @@ GIB_Thread_New (void)
return new; return new;
} }
void static void
GIB_Thread_Delete (gib_thread_t *thread) GIB_Thread_Delete (gib_thread_t *thread)
{ {
Cbuf_DeleteStack (thread->cbuf); Cbuf_DeleteStack (thread->cbuf);
@ -117,12 +117,13 @@ GIB_Thread_Execute (void)
} }
} }
const char * static const char *
GIB_Event_Get_Key (void *ele, void *ptr) GIB_Event_Get_Key (void *ele, void *ptr)
{ {
return ((gib_event_t *)ele)->name; return ((gib_event_t *)ele)->name;
} }
void
static void
GIB_Event_Free (void *ele, void *ptr) GIB_Event_Free (void *ele, void *ptr)
{ {
gib_event_t *ev = (gib_event_t *)ele; gib_event_t *ev = (gib_event_t *)ele;

View file

@ -41,7 +41,7 @@ static const char rcsid[] =
hashtab_t *gib_globals = 0; hashtab_t *gib_globals = 0;
gib_var_t * static gib_var_t *
GIB_Var_New (void) GIB_Var_New (void)
{ {
gib_var_t *new = calloc (1, sizeof (gib_var_t)); gib_var_t *new = calloc (1, sizeof (gib_var_t));
@ -67,7 +67,7 @@ GIB_Var_Free (void *ele, void *ptr)
Hash_DelTable (l->subvars); Hash_DelTable (l->subvars);
} }
gib_var_t * static gib_var_t *
GIB_Var_Get_R (hashtab_t *vars, char *name) GIB_Var_Get_R (hashtab_t *vars, char *name)
{ {
char *p; char *p;
@ -86,7 +86,7 @@ GIB_Var_Get_R (hashtab_t *vars, char *name)
return Hash_Find (vars, name); return Hash_Find (vars, name);
} }
void static void
GIB_Var_Set_R (hashtab_t *vars, char *name, const char *value) GIB_Var_Set_R (hashtab_t *vars, char *name, const char *value)
{ {
char *p; char *p;

View file

@ -21,6 +21,8 @@
#include <math.h> #include <math.h>
#include "ops.h"
double double
OP_Not (double op1, double op2) OP_Not (double op1, double op2)
{ {

View file

@ -91,7 +91,7 @@ extern char *re_syntax_table;
static char re_syntax_table[CHAR_SET_SIZE]; static char re_syntax_table[CHAR_SET_SIZE];
static void static void
init_syntax_once () init_syntax_once (void)
{ {
register int c; register int c;
static int done = 0; static int done = 0;
@ -839,11 +839,23 @@ static const char *re_error_msg[] =
/* Subroutine declarations and macros for regex_compile. */ /* Subroutine declarations and macros for regex_compile. */
static void store_op1 (), store_op2 ();
static void insert_op1 (), insert_op2 (); typedef struct
static boolean at_begline_loc_p (), at_endline_loc_p (); {
static boolean group_in_compile_stack (); struct compile_stack_elt_t *stack;
static reg_errcode_t compile_range (); unsigned size;
unsigned avail; /* Offset of next open position. */
} compile_stack_type;
/* But patterns can have more than `MAX_REGNUM' registers. We just
ignore the excess. */
typedef unsigned regnum_t;
static void store_op1 (re_opcode_t op, unsigned char *loc, int arg), store_op2 (re_opcode_t op, unsigned char *loc, int arg1, int arg2);
static void insert_op1 (re_opcode_t op, unsigned char *loc, int arg, unsigned char *end), insert_op2 (re_opcode_t op, unsigned char *loc, int arg1, int arg2, unsigned char *end);
static boolean at_begline_loc_p (const char *pattern, const char *p, reg_syntax_t syntax), at_endline_loc_p (const char *pattern, const char *p, int syntax);
static boolean group_in_compile_stack (compile_stack_type compile_stack, regnum_t regnum);
static reg_errcode_t compile_range (const char **p_ptr, const char *pend, char *translate, reg_syntax_t syntax, unsigned char *b);
/* Fetch the next character in the uncompiled pattern---translating it /* Fetch the next character in the uncompiled pattern---translating it
if necessary. Also cast from a signed character in the constant if necessary. Also cast from a signed character in the constant
@ -969,10 +981,6 @@ static reg_errcode_t compile_range ();
things about is what fits in that byte. */ things about is what fits in that byte. */
#define MAX_REGNUM 255 #define MAX_REGNUM 255
/* But patterns can have more than `MAX_REGNUM' registers. We just
ignore the excess. */
typedef unsigned regnum_t;
/* Macros for the compile stack. */ /* Macros for the compile stack. */
@ -980,7 +988,7 @@ typedef unsigned regnum_t;
be able to hold values from -(MAX_BUF_SIZE - 1) to MAX_BUF_SIZE - 1. */ be able to hold values from -(MAX_BUF_SIZE - 1) to MAX_BUF_SIZE - 1. */
typedef int pattern_offset_t; typedef int pattern_offset_t;
typedef struct typedef struct compile_stack_elt_t
{ {
pattern_offset_t begalt_offset; pattern_offset_t begalt_offset;
pattern_offset_t fixup_alt_jump; pattern_offset_t fixup_alt_jump;
@ -990,14 +998,6 @@ typedef struct
} compile_stack_elt_t; } compile_stack_elt_t;
typedef struct
{
compile_stack_elt_t *stack;
unsigned size;
unsigned avail; /* Offset of next open position. */
} compile_stack_type;
#define INIT_COMPILE_STACK_SIZE 32 #define INIT_COMPILE_STACK_SIZE 32
#define COMPILE_STACK_EMPTY (compile_stack.avail == 0) #define COMPILE_STACK_EMPTY (compile_stack.avail == 0)
@ -1058,6 +1058,7 @@ typedef struct
The `fastmap' and `newline_anchor' fields are neither The `fastmap' and `newline_anchor' fields are neither
examined nor set. */ examined nor set. */
static reg_errcode_t regex_compile (const char *pattern, int size, reg_syntax_t syntax, struct re_pattern_buffer *bufp);
static reg_errcode_t static reg_errcode_t
regex_compile (pattern, size, syntax, bufp) regex_compile (pattern, size, syntax, bufp)
const char *pattern; const char *pattern;
@ -2996,11 +2997,11 @@ re_search_2 (bufp, string1, size1, string2, size2, startpos, range, regs, stop)
} /* re_search_2 */ } /* re_search_2 */
/* Declarations and macros for re_match_2. */ /* Declarations and macros for re_match_2. */
union register_info_type;
static int bcmp_translate (); static int bcmp_translate (const unsigned char *s1, const unsigned char *s2, int len, char *translate);
static boolean alt_match_null_string_p (), static boolean alt_match_null_string_p (unsigned char *p, unsigned char *end, union register_info_type *reg_info),
common_op_match_null_string_p (), common_op_match_null_string_p (unsigned char **p, unsigned char *end, union register_info_type *reg_info),
group_match_null_string_p (); group_match_null_string_p (unsigned char **p, unsigned char *end, union register_info_type *reg_info);
/* Structure for per-register (a.k.a. per-group) information. /* Structure for per-register (a.k.a. per-group) information.
This must not be longer than one word, because we push this value This must not be longer than one word, because we push this value
@ -3013,7 +3014,7 @@ static boolean alt_match_null_string_p (),
the compiler will pack our bit fields into something that fits into the compiler will pack our bit fields into something that fits into
the type of `word', i.e., is something that fits into one item on the the type of `word', i.e., is something that fits into one item on the
failure stack. */ failure stack. */
typedef union typedef union register_info_type
{ {
fail_stack_elt_t word; fail_stack_elt_t word;
struct struct
@ -4595,11 +4596,11 @@ common_op_match_null_string_p (p, end, reg_info)
static int static int
bcmp_translate (s1, s2, len, translate) bcmp_translate (s1, s2, len, translate)
unsigned char *s1, *s2; const unsigned char *s1, *s2;
register int len; register int len;
char *translate; char *translate;
{ {
register unsigned char *p1 = s1, *p2 = s2; register const unsigned char *p1 = s1, *p2 = s2;
while (len) while (len)
{ {
if (translate[*p1++] != translate[*p2++]) return 1; if (translate[*p1++] != translate[*p2++]) return 1;
@ -4652,7 +4653,7 @@ re_compile_pattern (pattern, length, bufp)
/* BSD has one and only one pattern buffer. */ /* BSD has one and only one pattern buffer. */
static struct re_pattern_buffer re_comp_buf; static struct re_pattern_buffer re_comp_buf;
char * const char *
re_comp (s) re_comp (s)
const char *s; const char *s;
{ {

View file

@ -74,7 +74,7 @@ int stripcount;
int strip_size; int strip_size;
void static void
alloc_used (int size) alloc_used (int size)
{ {
if (size <= used_size) if (size <= used_size)
@ -86,7 +86,7 @@ alloc_used (int size)
used_size = size; used_size = size;
} }
void static void
add_command (int cmd) add_command (int cmd)
{ {
if (numcommands + 1 > commands_size) { if (numcommands + 1 > commands_size) {
@ -98,7 +98,7 @@ add_command (int cmd)
commands[numcommands++] = cmd; commands[numcommands++] = cmd;
} }
void static void
add_vertex (int vert) add_vertex (int vert)
{ {
if (numorder + 1 > vertexorder_size) { if (numorder + 1 > vertexorder_size) {
@ -110,7 +110,7 @@ add_vertex (int vert)
vertexorder[numorder++] = vert; vertexorder[numorder++] = vert;
} }
void static void
add_strip (int vert, int tri) add_strip (int vert, int tri)
{ {
if (stripcount + 1 > strip_size) { if (stripcount + 1 > strip_size) {
@ -125,7 +125,7 @@ add_strip (int vert, int tri)
stripcount++; stripcount++;
} }
int static int
StripLength (int starttri, int startv) StripLength (int starttri, int startv)
{ {
int m1, m2, j, k; int m1, m2, j, k;
@ -183,7 +183,7 @@ done:
return stripcount - 2; return stripcount - 2;
} }
int static int
FanLength (int starttri, int startv) FanLength (int starttri, int startv)
{ {
int m1, m2, j, k; int m1, m2, j, k;
@ -245,7 +245,7 @@ FanLength (int starttri, int startv)
Generate a list of trifans or strips Generate a list of trifans or strips
for the model, which holds for all frames for the model, which holds for all frames
*/ */
void static void
BuildTris (void) BuildTris (void)
{ {
float s, t; float s, t;

View file

@ -82,7 +82,7 @@ typedef struct {
Fill background pixels so mipmapping doesn't have halos - Ed Fill background pixels so mipmapping doesn't have halos - Ed
*/ */
void static void
Mod_FloodFillSkin (byte * skin, int skinwidth, int skinheight) Mod_FloodFillSkin (byte * skin, int skinwidth, int skinheight)
{ {
byte fillcolor = *skin; // assume this is the pixel to fill byte fillcolor = *skin; // assume this is the pixel to fill
@ -264,7 +264,7 @@ Mod_FinalizeAliasModel (model_t *m, aliashdr_t *hdr)
} }
} }
void static void
Mod_LoadExternalSkin (maliasskindesc_t *pskindesc, char *filename) Mod_LoadExternalSkin (maliasskindesc_t *pskindesc, char *filename)
{ {
tex_t *targa; tex_t *targa;

View file

@ -65,7 +65,7 @@ int posenum = 0;
int aliasbboxmins[3], aliasbboxmaxs[3]; int aliasbboxmins[3], aliasbboxmaxs[3];
void * static void *
Mod_LoadAllSkins (int numskins, daliasskintype_t *pskintype, int *pskinindex) Mod_LoadAllSkins (int numskins, daliasskintype_t *pskintype, int *pskinindex)
{ {
byte *skin; byte *skin;

View file

@ -163,7 +163,7 @@ Mod_LoadLighting (lump_t *l)
msurface_t *warpface; msurface_t *warpface;
void static void
BoundPoly (int numverts, float *verts, vec3_t mins, vec3_t maxs) BoundPoly (int numverts, float *verts, vec3_t mins, vec3_t maxs)
{ {
float *v; float *v;
@ -181,7 +181,7 @@ BoundPoly (int numverts, float *verts, vec3_t mins, vec3_t maxs)
} }
} }
void static void
SubdividePolygon (int numverts, float *verts) SubdividePolygon (int numverts, float *verts)
{ {
float frac, m, s, t; float frac, m, s, t;

View file

@ -80,7 +80,7 @@ Mod_PointInLeaf (const vec3_t p, model_t *model)
return NULL; // never reached return NULL; // never reached
} }
byte * static byte *
Mod_DecompressVis (byte * in, model_t *model) Mod_DecompressVis (byte * in, model_t *model)
{ {
static byte decompressed[MAX_MAP_LEAFS / 8]; static byte decompressed[MAX_MAP_LEAFS / 8];
@ -131,7 +131,7 @@ Mod_LeafPVS (mleaf_t *leaf, model_t *model)
byte *mod_base; byte *mod_base;
void static void
Mod_LoadTextures (lump_t *l) Mod_LoadTextures (lump_t *l)
{ {
dmiptexlump_t *m; dmiptexlump_t *m;
@ -265,7 +265,7 @@ Mod_LoadTextures (lump_t *l)
} }
} }
void static void
Mod_LoadVisibility (lump_t *l) Mod_LoadVisibility (lump_t *l)
{ {
if (!l->filelen) { if (!l->filelen) {
@ -276,7 +276,7 @@ Mod_LoadVisibility (lump_t *l)
memcpy (loadmodel->visdata, mod_base + l->fileofs, l->filelen); memcpy (loadmodel->visdata, mod_base + l->fileofs, l->filelen);
} }
void static void
Mod_LoadEntities (lump_t *l) Mod_LoadEntities (lump_t *l)
{ {
if (!l->filelen) { if (!l->filelen) {
@ -287,7 +287,7 @@ Mod_LoadEntities (lump_t *l)
memcpy (loadmodel->entities, mod_base + l->fileofs, l->filelen); memcpy (loadmodel->entities, mod_base + l->fileofs, l->filelen);
} }
void static void
Mod_LoadVertexes (lump_t *l) Mod_LoadVertexes (lump_t *l)
{ {
dvertex_t *in; dvertex_t *in;
@ -310,7 +310,7 @@ Mod_LoadVertexes (lump_t *l)
} }
} }
void static void
Mod_LoadSubmodels (lump_t *l) Mod_LoadSubmodels (lump_t *l)
{ {
dmodel_t *in, *out; dmodel_t *in, *out;
@ -339,7 +339,7 @@ Mod_LoadSubmodels (lump_t *l)
} }
} }
void static void
Mod_LoadEdges (lump_t *l) Mod_LoadEdges (lump_t *l)
{ {
dedge_t *in; dedge_t *in;
@ -361,7 +361,7 @@ Mod_LoadEdges (lump_t *l)
} }
} }
void static void
Mod_LoadTexinfo (lump_t *l) Mod_LoadTexinfo (lump_t *l)
{ {
float len1, len2; float len1, len2;
@ -419,7 +419,7 @@ Mod_LoadTexinfo (lump_t *l)
Fills in s->texturemins[] and s->extents[] Fills in s->texturemins[] and s->extents[]
*/ */
void static void
CalcSurfaceExtents (msurface_t *s) CalcSurfaceExtents (msurface_t *s)
{ {
float mins[2], maxs[2], val; float mins[2], maxs[2], val;
@ -464,7 +464,7 @@ CalcSurfaceExtents (msurface_t *s)
} }
} }
void static void
Mod_LoadFaces (lump_t *l) Mod_LoadFaces (lump_t *l)
{ {
dface_t *in; dface_t *in;
@ -531,7 +531,7 @@ Mod_LoadFaces (lump_t *l)
} }
} }
void static void
Mod_SetParent (mnode_t *node, mnode_t *parent) Mod_SetParent (mnode_t *node, mnode_t *parent)
{ {
node->parent = parent; node->parent = parent;
@ -541,7 +541,7 @@ Mod_SetParent (mnode_t *node, mnode_t *parent)
Mod_SetParent (node->children[1], node); Mod_SetParent (node->children[1], node);
} }
void static void
Mod_LoadNodes (lump_t *l) Mod_LoadNodes (lump_t *l)
{ {
dnode_t *in; dnode_t *in;
@ -581,7 +581,7 @@ Mod_LoadNodes (lump_t *l)
Mod_SetParent (loadmodel->nodes, NULL); // sets nodes and leafs Mod_SetParent (loadmodel->nodes, NULL); // sets nodes and leafs
} }
void static void
Mod_LoadLeafs (lump_t *l) Mod_LoadLeafs (lump_t *l)
{ {
dleaf_t *in; dleaf_t *in;
@ -636,7 +636,7 @@ Mod_LoadLeafs (lump_t *l)
} }
} }
void static void
Mod_LoadClipnodes (lump_t *l) Mod_LoadClipnodes (lump_t *l)
{ {
dclipnode_t *in, *out; dclipnode_t *in, *out;
@ -695,7 +695,7 @@ Mod_LoadClipnodes (lump_t *l)
Deplicate the drawing hull structure as a clipping hull Deplicate the drawing hull structure as a clipping hull
*/ */
void static void
Mod_MakeHull0 (void) Mod_MakeHull0 (void)
{ {
dclipnode_t *out; dclipnode_t *out;
@ -726,7 +726,7 @@ Mod_MakeHull0 (void)
} }
} }
void static void
Mod_LoadMarksurfaces (lump_t *l) Mod_LoadMarksurfaces (lump_t *l)
{ {
int count, i, j; int count, i, j;
@ -750,7 +750,7 @@ Mod_LoadMarksurfaces (lump_t *l)
} }
} }
void static void
Mod_LoadSurfedges (lump_t *l) Mod_LoadSurfedges (lump_t *l)
{ {
int count, i; int count, i;
@ -769,7 +769,7 @@ Mod_LoadSurfedges (lump_t *l)
out[i] = LittleLong (in[i]); out[i] = LittleLong (in[i]);
} }
void static void
Mod_LoadPlanes (lump_t *l) Mod_LoadPlanes (lump_t *l)
{ {
dplane_t *in; dplane_t *in;

View file

@ -140,7 +140,7 @@ Mod_FindName (const char *name)
return mod; return mod;
} }
model_t * static model_t *
Mod_RealLoadModel (model_t *mod, qboolean crash, cache_allocator_t allocator) Mod_RealLoadModel (model_t *mod, qboolean crash, cache_allocator_t allocator)
{ {
unsigned int *buf; unsigned int *buf;
@ -211,7 +211,7 @@ Mod_RealLoadModel (model_t *mod, qboolean crash, cache_allocator_t allocator)
Loads a model into the cache Loads a model into the cache
*/ */
model_t * static model_t *
Mod_LoadModel (model_t *mod, qboolean crash) Mod_LoadModel (model_t *mod, qboolean crash)
{ {
if (!mod->needload) { if (!mod->needload) {

View file

@ -43,7 +43,7 @@ static const char rcsid[] =
#include "compat.h" #include "compat.h"
void * static void *
Mod_LoadSpriteFrame (void *pin, mspriteframe_t **ppframe, int framenum) Mod_LoadSpriteFrame (void *pin, mspriteframe_t **ppframe, int framenum)
{ {
dspriteframe_t *pinframe; dspriteframe_t *pinframe;
@ -79,7 +79,7 @@ Mod_LoadSpriteFrame (void *pin, mspriteframe_t **ppframe, int framenum)
return (void *) ((byte *) pinframe + sizeof (dspriteframe_t) + size); return (void *) ((byte *) pinframe + sizeof (dspriteframe_t) + size);
} }
void * static void *
Mod_LoadSpriteGroup (void *pin, mspriteframe_t **ppframe, int framenum) Mod_LoadSpriteGroup (void *pin, mspriteframe_t **ppframe, int framenum)
{ {
dspritegroup_t *pingroup; dspritegroup_t *pingroup;

View file

@ -39,10 +39,12 @@ static const char rcsid[] =
#include <stdlib.h> #include <stdlib.h>
static char *date = __DATE__; // Was "Dec 21 1999" #include "buildnum.h"
static char *mon[12] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul",
"Aug", "Sep", "Oct", "Nov", "Dec" }; static const char *date = __DATE__; // Was "Dec 21 1999"
static char mond[12] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; static const char *mon[12] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul",
"Aug", "Sep", "Oct", "Nov", "Dec" };
static const char mond[12] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
/* returns days since Dec 21 1999 */ /* returns days since Dec 21 1999 */

View file

@ -309,7 +309,7 @@ cmd_get_key (void *c, void *unused)
return cmd->name; return cmd->name;
} }
void static void
Cmd_Runalias_f (void) Cmd_Runalias_f (void)
{ {
cmdalias_t *a; cmdalias_t *a;
@ -325,7 +325,7 @@ Cmd_Runalias_f (void)
} }
} }
void static void
Cmd_Alias_f (void) Cmd_Alias_f (void)
{ {
cmdalias_t *alias; cmdalias_t *alias;
@ -381,7 +381,7 @@ Cmd_Alias_f (void)
alias->value = cmd; alias->value = cmd;
} }
void static void
Cmd_UnAlias_f (void) Cmd_UnAlias_f (void)
{ {
cmdalias_t *alias; cmdalias_t *alias;
@ -412,7 +412,7 @@ Cmd_UnAlias_f (void)
} }
} }
void static void
Cmd_CmdList_f (void) Cmd_CmdList_f (void)
{ {
cmd_function_t *cmd; cmd_function_t *cmd;
@ -432,7 +432,7 @@ Cmd_CmdList_f (void)
Sys_Printf ("------------\n%d commands\n", i); Sys_Printf ("------------\n%d commands\n", i);
} }
void static void
Cmd_Help_f (void) Cmd_Help_f (void)
{ {
const char *name; const char *name;
@ -463,7 +463,7 @@ Cmd_Help_f (void)
Sys_Printf ("variable/command not found\n"); Sys_Printf ("variable/command not found\n");
} }
void static void
Cmd_Exec_f (void) Cmd_Exec_f (void)
{ {
char *f; char *f;
@ -492,7 +492,7 @@ Cmd_Exec_f (void)
Just prints the rest of the line to the console Just prints the rest of the line to the console
*/ */
void static void
Cmd_Echo_f (void) Cmd_Echo_f (void)
{ {
if (Cmd_Argc () == 2) if (Cmd_Argc () == 2)
@ -503,7 +503,7 @@ Cmd_Echo_f (void)
/* Pauses execution of the current stack until /* Pauses execution of the current stack until
next call of Cmd_Execute (usually next frame) */ next call of Cmd_Execute (usually next frame) */
void static void
Cmd_Wait_f (void) Cmd_Wait_f (void)
{ {
cbuf_active->state = CBUF_STATE_WAIT; cbuf_active->state = CBUF_STATE_WAIT;
@ -511,7 +511,7 @@ Cmd_Wait_f (void)
/* Pauses execution for a specified number /* Pauses execution for a specified number
of seconds */ of seconds */
void static void
Cmd_Sleep_f (void) Cmd_Sleep_f (void)
{ {
double waittime; double waittime;
@ -528,31 +528,33 @@ Cmd_StuffCmds (cbuf_t *cbuf)
int i, j; int i, j;
int s; int s;
char *build, c; char *build, c;
char *cmdline;
s = strlen (com_cmdline); s = strlen (com_cmdline);
if (!s) if (!s)
return; return;
cmdline = strdup (com_cmdline);
// pull out the commands // pull out the commands
build = malloc (s + 1); build = malloc (s + 1);
SYS_CHECKMEM (build); SYS_CHECKMEM (build);
build[0] = 0; build[0] = 0;
for (i = 0; i < s - 1; i++) { for (i = 0; i < s - 1; i++) {
if (com_cmdline[i] == '+') { if (cmdline[i] == '+') {
i++; i++;
for (j = i; !((com_cmdline[j] == '+') for (j = i; !((cmdline[j] == '+')
|| (com_cmdline[j] == '-' || (cmdline[j] == '-'
&& (j == 0 || com_cmdline[j - 1] == ' ')) && (j == 0 || cmdline[j - 1] == ' '))
|| (com_cmdline[j] == 0)); j++); || (cmdline[j] == 0)); j++);
c = com_cmdline[j]; c = cmdline[j];
com_cmdline[j] = 0; cmdline[j] = 0;
strncat (build, com_cmdline + i, s - strlen (build)); strncat (build, cmdline + i, s - strlen (build));
strncat (build, "\n", s - strlen (build)); strncat (build, "\n", s - strlen (build));
com_cmdline[j] = c; cmdline[j] = c;
i = j - 1; i = j - 1;
} }
} }
@ -561,9 +563,10 @@ Cmd_StuffCmds (cbuf_t *cbuf)
Cbuf_InsertText (cbuf, build); Cbuf_InsertText (cbuf, build);
free (build); free (build);
free (cmdline);
} }
void static void
Cmd_StuffCmds_f (void) Cmd_StuffCmds_f (void)
{ {
Cmd_StuffCmds (cbuf_active); Cmd_StuffCmds (cbuf_active);

View file

@ -58,7 +58,7 @@ static const char rcsid[] =
cvar_t *developer; cvar_t *developer;
cvar_t *cvar_vars; cvar_t *cvar_vars;
char *cvar_null_string = ""; const char *cvar_null_string = "";
cvar_alias_t *calias_vars; cvar_alias_t *calias_vars;
hashtab_t *cvar_hash; hashtab_t *cvar_hash;
hashtab_t *calias_hash; hashtab_t *calias_hash;
@ -339,7 +339,7 @@ Cvar_WriteVariables (QFile *f)
Qprintf (f, "%s \"%s\"\n", var->name, var->string); Qprintf (f, "%s \"%s\"\n", var->name, var->string);
} }
void static void
Cvar_Set_f (void) Cvar_Set_f (void)
{ {
cvar_t *var; cvar_t *var;
@ -370,7 +370,7 @@ Cvar_Set_f (void)
} }
} }
void static void
Cvar_Setrom_f (void) Cvar_Setrom_f (void)
{ {
cvar_t *var; cvar_t *var;
@ -402,7 +402,7 @@ Cvar_Setrom_f (void)
} }
} }
void static void
Cvar_Toggle_f (void) Cvar_Toggle_f (void)
{ {
cvar_t *var; cvar_t *var;
@ -423,7 +423,7 @@ Cvar_Toggle_f (void)
Cvar_Set (var, var->int_val ? "0" : "1"); Cvar_Set (var, var->int_val ? "0" : "1");
} }
void static void
Cvar_CvarList_f (void) Cvar_CvarList_f (void)
{ {
cvar_t *var; cvar_t *var;

View file

@ -209,9 +209,11 @@ static char *posixly_correct;
whose names are inconsistent. */ whose names are inconsistent. */
#ifndef getenv #ifndef getenv
extern char *getenv (); extern char *getenv (const char *);
#endif #endif
static char *my_index (const char *str, int chr);
static char * static char *
my_index (str, chr) my_index (str, chr)
const char *str; const char *str;

View file

@ -40,6 +40,7 @@ static const char rcsid[] =
#include "QF/dstring.h" #include "QF/dstring.h"
#include "QF/cbuf.h" #include "QF/cbuf.h"
#include "QF/cmd.h" #include "QF/cmd.h"
#include "QF/idparse.h"
static dstring_t *_com_token; static dstring_t *_com_token;
const char *com_token; const char *com_token;
@ -120,7 +121,7 @@ COM_TokenizeString (const char *str, cbuf_args_t *args)
return; return;
} }
void static void
COM_extract_line (cbuf_t *cbuf) COM_extract_line (cbuf_t *cbuf)
{ {
int i; int i;
@ -159,14 +160,14 @@ COM_extract_line (cbuf_t *cbuf)
} }
} }
void static void
COM_parse_line (cbuf_t *cbuf) COM_parse_line (cbuf_t *cbuf)
{ {
COM_TokenizeString (cbuf->line->str, cbuf->args); COM_TokenizeString (cbuf->line->str, cbuf->args);
dstring_clearstr (cbuf->line); dstring_clearstr (cbuf->line);
} }
void static void
COM_execute_line (cbuf_t *cbuf) COM_execute_line (cbuf_t *cbuf)
{ {
Cmd_Command (cbuf->args); Cmd_Command (cbuf->args);

View file

@ -226,7 +226,7 @@ Info_ParseString (const char *s, int maxsize)
if (*end) if (*end)
*end++ = 0; *end++ = 0;
} else { } else {
value = end = ""; value = end = (char *)"";
} }
Info_SetValueForStarKey (info, key, value, 0); Info_SetValueForStarKey (info, key, value, 0);
key = end; key = end;

View file

@ -52,7 +52,7 @@ const vec3_t vec3_origin = { 0, 0, 0 };
#define DEG2RAD(a) (a * (M_PI / 180.0)) #define DEG2RAD(a) (a * (M_PI / 180.0))
void static void
ProjectPointOnPlane (vec3_t dst, const vec3_t p, const vec3_t normal) ProjectPointOnPlane (vec3_t dst, const vec3_t p, const vec3_t normal)
{ {
float inv_denom, d; float inv_denom, d;
@ -68,7 +68,7 @@ ProjectPointOnPlane (vec3_t dst, const vec3_t p, const vec3_t normal)
} }
// assumes "src" is normalized // assumes "src" is normalized
void static void
PerpendicularVector (vec3_t dst, const vec3_t src) PerpendicularVector (vec3_t dst, const vec3_t src)
{ {
int pos, i; int pos, i;
@ -181,6 +181,7 @@ anglemod (float a)
Split out like this for ASM to call. Split out like this for ASM to call.
*/ */
void __attribute__ ((noreturn)) BOPS_Error (void);
void __attribute__ ((noreturn)) void __attribute__ ((noreturn))
BOPS_Error (void) BOPS_Error (void)
{ {

View file

@ -138,7 +138,7 @@ pi_info_name (char *info_name, int size, const char *type, const char *name)
snprintf (info_name, size, "PluginInfo"); snprintf (info_name, size, "PluginInfo");
} }
void static void
PI_InitCvars (void) PI_InitCvars (void)
{ {
fs_pluginpath = Cvar_Get ("fs_pluginpath", FS_PLUGINPATH, CVAR_ROM, NULL, fs_pluginpath = Cvar_Get ("fs_pluginpath", FS_PLUGINPATH, CVAR_ROM, NULL,

View file

@ -45,21 +45,22 @@ static const char rcsid[] =
#include "QF/cmd.h" #include "QF/cmd.h"
#include "QF/crc.h" #include "QF/crc.h"
#include "QF/qargs.h"
#include "QF/qtypes.h" #include "QF/qtypes.h"
#include "QF/sys.h" #include "QF/sys.h"
static char **largv; static const char **largv;
static char *argvdummy = " "; static const char *argvdummy = " ";
static char *safeargvs[] = static const char *safeargvs[] =
{ "-stdvid", "-nolan", "-nosound", "-nocdaudio", "-nojoy", "-nomouse", { "-stdvid", "-nolan", "-nosound", "-nocdaudio", "-nojoy", "-nomouse",
"-dibonly" }; "-dibonly" };
#define NUM_SAFE_ARGVS (sizeof(safeargvs)/sizeof(safeargvs[0])) #define NUM_SAFE_ARGVS (sizeof(safeargvs)/sizeof(safeargvs[0]))
int com_argc; int com_argc;
char **com_argv; const char **com_argv;
char *com_cmdline; const char *com_cmdline;
qboolean nouse = false; // 1999-10-29 +USE fix by Maddes qboolean nouse = false; // 1999-10-29 +USE fix by Maddes
@ -71,7 +72,7 @@ qboolean nouse = false; // 1999-10-29 +USE fix by Maddes
where the given parameter apears, or 0 if not present where the given parameter apears, or 0 if not present
*/ */
int int
COM_CheckParm (char *parm) COM_CheckParm (const char *parm)
{ {
int i; int i;
@ -87,15 +88,16 @@ COM_CheckParm (char *parm)
} }
void void
COM_InitArgv (int argc, char **argv) COM_InitArgv (int argc, const char **argv)
{ {
qboolean safe; qboolean safe;
int i, len; int i, len;
char *cmdline;
safe = false; safe = false;
largv = (char **) calloc (1, (argc + NUM_SAFE_ARGVS + 1) * largv = (const char **) calloc (1, (argc + NUM_SAFE_ARGVS + 1) *
sizeof (char **)); sizeof (const char **));
for (com_argc = 0, len = 0; com_argc < argc; com_argc++) { for (com_argc = 0, len = 0; com_argc < argc; com_argc++) {
largv[com_argc] = argv[com_argc]; largv[com_argc] = argv[com_argc];
@ -105,16 +107,17 @@ COM_InitArgv (int argc, char **argv)
len += strlen (argv[com_argc]) + 1; len += strlen (argv[com_argc]) + 1;
} }
com_cmdline = (char *) calloc (1, len + 1); // need strlen(com_cmdline)+2 cmdline = (char *) calloc (1, len + 1); // need strlen(cmdline)+2
com_cmdline[0] = 0; cmdline[0] = 0;
if (len) { if (len) {
for (i = 1; i < argc; i++) { for (i = 1; i < argc; i++) {
strncat (com_cmdline, argv[i], len - strlen (com_cmdline)); strncat (cmdline, argv[i], len - strlen (cmdline));
assert (len - strlen (com_cmdline) > 0); assert (len - strlen (cmdline) > 0);
strncat (com_cmdline, " ", len - strlen (com_cmdline)); strncat (cmdline, " ", len - strlen (cmdline));
} }
com_cmdline[len - 1] = '\0'; cmdline[len - 1] = '\0';
} }
com_cmdline = cmdline;
if (safe) { if (safe) {
// force all the safe-mode switches. Note that we reserved extra space // force all the safe-mode switches. Note that we reserved extra space
@ -139,7 +142,7 @@ COM_InitArgv (int argc, char **argv)
Adds the given string at the end of the current argument list Adds the given string at the end of the current argument list
*/ */
void void
COM_AddParm (char *parm) COM_AddParm (const char *parm)
{ {
largv[com_argc++] = parm; largv[com_argc++] = parm;
} }

View file

@ -219,7 +219,7 @@ PL_ParseQuotedString (pldata_t *pl)
} }
if (pl->pos - start - shrink == 0) { if (pl->pos - start - shrink == 0) {
str = ""; str = strdup ("");
} else { } else {
char chars[pl->pos - start - shrink]; char chars[pl->pos - start - shrink];
unsigned int j; unsigned int j;

View file

@ -252,7 +252,7 @@ COM_CreatePath (const char *path)
} }
} }
QFile * static QFile *
COM_OpenRead (const char *path, int offs, int len, int zip) COM_OpenRead (const char *path, int offs, int len, int zip)
{ {
QFile *file; QFile *file;
@ -328,7 +328,7 @@ COM_CompressPath (const char *pth)
Checks if a string contains an updir ('..'), either at the ends or Checks if a string contains an updir ('..'), either at the ends or
surrounded by slashes ('/'). Doesn't check for leading slash. surrounded by slashes ('/'). Doesn't check for leading slash.
*/ */
int static int
contains_updir (const char *filename) contains_updir (const char *filename)
{ {
int i; int i;
@ -566,7 +566,7 @@ COM_LoadStackFile (const char *path, void *buffer, int bufsize)
Loads the header and directory, adding the files at the beginning Loads the header and directory, adding the files at the beginning
of the list so they override previous pack files. of the list so they override previous pack files.
*/ */
pack_t * static pack_t *
COM_LoadPackFile (char *packfile) COM_LoadPackFile (char *packfile)
{ {
pack_t *pack = pack_open (packfile); pack_t *pack = pack_open (packfile);
@ -613,7 +613,7 @@ qstrcmp (char **os1, char **os2)
} }
} }
void static void
COM_LoadGameDirectory (const char *dir) COM_LoadGameDirectory (const char *dir)
{ {
searchpath_t *search; searchpath_t *search;
@ -692,7 +692,7 @@ COM_LoadGameDirectory (const char *dir)
Sets com_gamedir, adds the directory to the head of the path, Sets com_gamedir, adds the directory to the head of the path,
then loads and adds pak1.pak pak2.pak ... then loads and adds pak1.pak pak2.pak ...
*/ */
void static void
COM_AddDirectory (const char *dir) COM_AddDirectory (const char *dir)
{ {
searchpath_t *search; searchpath_t *search;
@ -720,7 +720,7 @@ COM_AddDirectory (const char *dir)
COM_LoadGameDirectory (dir); COM_LoadGameDirectory (dir);
} }
void static void
COM_AddGameDirectory (const char *dir) COM_AddGameDirectory (const char *dir)
{ {
Sys_DPrintf ("COM_AddGameDirectory (\"%s/%s\")\n", Sys_DPrintf ("COM_AddGameDirectory (\"%s/%s\")\n",
@ -852,7 +852,7 @@ COM_FileExtension (const char *in)
} }
void void
COM_DefaultExtension (char *path, char *extension) COM_DefaultExtension (char *path, const char *extension)
{ {
char *src; char *src;

View file

@ -34,7 +34,7 @@ static const char rcsid[] =
#include <string.h> #include <string.h>
#include <stdio.h> #include <stdio.h>
#include "compat.h" #include "qstring.h"
#ifdef IRIX #ifdef IRIX
#define _vsnprintf vsnprintf #define _vsnprintf vsnprintf

View file

@ -36,6 +36,7 @@ static const char rcsid[] =
#include <stdlib.h> #include <stdlib.h>
#include "QF/qtypes.h" #include "QF/qtypes.h"
#include "QF/ver_check.h"
/* /*

View file

@ -253,8 +253,8 @@ Z_Realloc (memzone_t *zone, void *ptr, int size)
return ptr; return ptr;
} }
/*
void static void
Z_Print (memzone_t *zone) Z_Print (memzone_t *zone)
{ {
memblock_t *block; memblock_t *block;
@ -276,7 +276,7 @@ Z_Print (memzone_t *zone)
Sys_Printf ("ERROR: two consecutive free blocks\n"); Sys_Printf ("ERROR: two consecutive free blocks\n");
} }
} }
*/
void void
Z_CheckHeap (memzone_t *zone) Z_CheckHeap (memzone_t *zone)
{ {
@ -339,7 +339,8 @@ Hunk_Check (void)
Otherwise, allocations with the same name will be totaled up before Otherwise, allocations with the same name will be totaled up before
printing. printing.
*/ */
void /*
static void
Hunk_Print (qboolean all) Hunk_Print (qboolean all)
{ {
char name[9]; char name[9];
@ -403,7 +404,7 @@ Hunk_Print (qboolean all)
Sys_Printf ("-------------------------\n"); Sys_Printf ("-------------------------\n");
Sys_Printf ("%8i total blocks\n", totalblocks); Sys_Printf ("%8i total blocks\n", totalblocks);
} }
*/
void * void *
Hunk_AllocName (int size, const char *name) Hunk_AllocName (int size, const char *name)
{ {
@ -577,7 +578,7 @@ static void *Cache_RealAlloc (cache_user_t *c, int size, const char *name);
cache_writelock--; } cache_writelock--; }
#ifndef MMAPPED_CACHE #ifndef MMAPPED_CACHE
void static void
Cache_Move (cache_system_t * c) Cache_Move (cache_system_t * c)
{ {
cache_system_t *new; cache_system_t *new;
@ -650,7 +651,7 @@ Cache_FreeHigh (int new_high_hunk)
#endif #endif
} }
void static void
Cache_UnlinkLRU (cache_system_t * cs) Cache_UnlinkLRU (cache_system_t * cs)
{ {
if (!cs->lru_next || !cs->lru_prev) if (!cs->lru_next || !cs->lru_prev)
@ -662,7 +663,7 @@ Cache_UnlinkLRU (cache_system_t * cs)
cs->lru_prev = cs->lru_next = NULL; cs->lru_prev = cs->lru_next = NULL;
} }
void static void
Cache_MakeLRU (cache_system_t * cs) Cache_MakeLRU (cache_system_t * cs)
{ {
if (cs->lru_next || cs->lru_prev) if (cs->lru_next || cs->lru_prev)
@ -674,8 +675,8 @@ Cache_MakeLRU (cache_system_t * cs)
cache_head.lru_next = cs; cache_head.lru_next = cs;
} }
qboolean static qboolean
Cache_FreeLRU () Cache_FreeLRU (void)
{ {
cache_system_t *cs; cache_system_t *cs;
@ -805,7 +806,7 @@ Cache_Flush (void)
CACHE_WRITE_UNLOCK; CACHE_WRITE_UNLOCK;
} }
void static void
Cache_Print (void) Cache_Print (void)
{ {
cache_system_t *cd; cache_system_t *cd;
@ -827,12 +828,7 @@ Cache_Report (void)
CACHE_WRITE_UNLOCK; CACHE_WRITE_UNLOCK;
} }
void static void
Cache_Compact (void)
{
}
void
Cache_Init (void) Cache_Init (void)
{ {
cache_head.next = cache_head.prev = &cache_head; cache_head.next = cache_head.prev = &cache_head;

View file

@ -44,8 +44,10 @@ static const char rcsid[] =
#include "QF/render.h" #include "QF/render.h"
#include "QF/GL/defines.h" #include "QF/GL/defines.h"
#include "QF/GL/funcs.h" #include "QF/GL/funcs.h"
#include "QF/GL/qf_rlight.h"
#include "r_cvar.h" #include "r_cvar.h"
#include "r_dynamic.h"
#include "r_local.h" #include "r_local.h"
#include "r_shared.h" #include "r_shared.h"
@ -69,7 +71,7 @@ R_InitBubble (void)
} }
} }
void static void
R_RenderDlight (dlight_t *light) R_RenderDlight (dlight_t *light)
{ {
float rad; float rad;

View file

@ -54,6 +54,7 @@ static const char rcsid[] =
#include "compat.h" #include "compat.h"
#include "r_cvar.h" #include "r_cvar.h"
#include "r_dynamic.h" #include "r_dynamic.h"
#include "r_local.h"
#include "r_shared.h" #include "r_shared.h"
#include "varrays.h" #include "varrays.h"
@ -203,7 +204,7 @@ R_ReadPointFile_f (void)
Con_Printf ("%i points read\n", c); Con_Printf ("%i points read\n", c);
} }
void static void
R_ParticleExplosion_QF (const vec3_t org) R_ParticleExplosion_QF (const vec3_t org)
{ {
// R_NewExplosion (org); // R_NewExplosion (org);
@ -214,7 +215,7 @@ R_ParticleExplosion_QF (const vec3_t org)
0.5 + qfrandom (0.25), 0.0); 0.5 + qfrandom (0.25), 0.0);
} }
void static void
R_ParticleExplosion2_QF (const vec3_t org, int colorStart, int colorLength) R_ParticleExplosion2_QF (const vec3_t org, int colorStart, int colorLength)
{ {
unsigned int i; unsigned int i;
@ -233,7 +234,7 @@ R_ParticleExplosion2_QF (const vec3_t org, int colorStart, int colorLength)
} }
} }
void static void
R_BlobExplosion_QF (const vec3_t org) R_BlobExplosion_QF (const vec3_t org)
{ {
unsigned int i; unsigned int i;
@ -285,13 +286,13 @@ R_BloodPuff_QF (const vec3_t org, int count)
r_realtime + 99.0, 70 + (rand () & 3), 0.5, 0.0); r_realtime + 99.0, 70 + (rand () & 3), 0.5, 0.0);
} }
void static void
R_BloodPuffEffect_QF (const vec3_t org, int count) R_BloodPuffEffect_QF (const vec3_t org, int count)
{ {
R_BloodPuff_QF (org, count); R_BloodPuff_QF (org, count);
} }
void static void
R_GunshotEffect_QF (const vec3_t org, int count) R_GunshotEffect_QF (const vec3_t org, int count)
{ {
int scale = 16; int scale = 16;
@ -301,7 +302,7 @@ R_GunshotEffect_QF (const vec3_t org, int count)
R_RunSparkEffect_QF (org, count >> 1, scale); R_RunSparkEffect_QF (org, count >> 1, scale);
} }
void static void
R_LightningBloodEffect_QF (const vec3_t org) R_LightningBloodEffect_QF (const vec3_t org)
{ {
int count = 7; int count = 7;
@ -322,7 +323,7 @@ R_LightningBloodEffect_QF (const vec3_t org)
0.0); 0.0);
} }
void static void
R_RunParticleEffect_QF (const vec3_t org, const vec3_t dir, int color, R_RunParticleEffect_QF (const vec3_t org, const vec3_t dir, int color,
int count) int count)
{ {
@ -349,19 +350,19 @@ R_RunParticleEffect_QF (const vec3_t org, const vec3_t dir, int color,
} }
} }
void static void
R_SpikeEffect_QF (const vec3_t org) R_SpikeEffect_QF (const vec3_t org)
{ {
R_RunSparkEffect_QF (org, 5, 8); R_RunSparkEffect_QF (org, 5, 8);
} }
void static void
R_SuperSpikeEffect_QF (const vec3_t org) R_SuperSpikeEffect_QF (const vec3_t org)
{ {
R_RunSparkEffect_QF (org, 10, 8); R_RunSparkEffect_QF (org, 10, 8);
} }
void static void
R_KnightSpikeEffect_QF (const vec3_t org) R_KnightSpikeEffect_QF (const vec3_t org)
{ {
unsigned int count = 10; unsigned int count = 10;
@ -378,7 +379,7 @@ R_KnightSpikeEffect_QF (const vec3_t org)
r_realtime + 5.0, 234, 1.0, 0.0); r_realtime + 5.0, 234, 1.0, 0.0);
} }
void static void
R_WizSpikeEffect_QF (const vec3_t org) R_WizSpikeEffect_QF (const vec3_t org)
{ {
unsigned int count = 15; unsigned int count = 15;
@ -395,7 +396,7 @@ R_WizSpikeEffect_QF (const vec3_t org)
r_realtime + 5.0, 63, 1.0, 0.0); r_realtime + 5.0, 63, 1.0, 0.0);
} }
void static void
R_LavaSplash_QF (const vec3_t org) R_LavaSplash_QF (const vec3_t org)
{ {
float vel; float vel;
@ -431,7 +432,7 @@ R_LavaSplash_QF (const vec3_t org)
} }
} }
void static void
R_TeleportSplash_QF (const vec3_t org) R_TeleportSplash_QF (const vec3_t org)
{ {
float vel; float vel;
@ -470,7 +471,7 @@ R_TeleportSplash_QF (const vec3_t org)
} }
} }
void static void
R_RocketTrail_QF (entity_t *ent) R_RocketTrail_QF (entity_t *ent)
{ {
float dist, maxlen, origlen, percent, pscale, pscalenext; float dist, maxlen, origlen, percent, pscale, pscalenext;
@ -503,7 +504,7 @@ R_RocketTrail_QF (entity_t *ent)
} }
} }
void static void
R_GrenadeTrail_QF (entity_t *ent) R_GrenadeTrail_QF (entity_t *ent)
{ {
float dist, maxlen, origlen, percent, pscale, pscalenext; float dist, maxlen, origlen, percent, pscale, pscalenext;
@ -536,7 +537,7 @@ R_GrenadeTrail_QF (entity_t *ent)
} }
} }
void static void
R_BloodTrail_QF (entity_t *ent) R_BloodTrail_QF (entity_t *ent)
{ {
float dist, maxlen, origlen, percent, pscale, pscalenext; float dist, maxlen, origlen, percent, pscale, pscalenext;
@ -575,7 +576,7 @@ R_BloodTrail_QF (entity_t *ent)
} }
} }
void static void
R_SlightBloodTrail_QF (entity_t *ent) R_SlightBloodTrail_QF (entity_t *ent)
{ {
float dist, maxlen, origlen, percent, pscale, pscalenext; float dist, maxlen, origlen, percent, pscale, pscalenext;
@ -614,7 +615,7 @@ R_SlightBloodTrail_QF (entity_t *ent)
} }
} }
void static void
R_WizTrail_QF (entity_t *ent) R_WizTrail_QF (entity_t *ent)
{ {
float maxlen, origlen, percent; float maxlen, origlen, percent;
@ -654,7 +655,7 @@ R_WizTrail_QF (entity_t *ent)
} }
} }
void static void
R_FlameTrail_QF (entity_t *ent) R_FlameTrail_QF (entity_t *ent)
{ {
float maxlen, origlen, percent; float maxlen, origlen, percent;
@ -694,7 +695,7 @@ R_FlameTrail_QF (entity_t *ent)
} }
} }
void static void
R_VoorTrail_QF (entity_t *ent) R_VoorTrail_QF (entity_t *ent)
{ {
float maxlen, origlen, percent; float maxlen, origlen, percent;
@ -726,7 +727,7 @@ R_VoorTrail_QF (entity_t *ent)
} }
} }
void static void
R_GlowTrail_QF (entity_t *ent, int glow_color) R_GlowTrail_QF (entity_t *ent, int glow_color)
{ {
float maxlen, origlen, percent; float maxlen, origlen, percent;
@ -759,7 +760,7 @@ R_GlowTrail_QF (entity_t *ent, int glow_color)
} }
} }
void static void
R_ParticleExplosion_EE (const vec3_t org) R_ParticleExplosion_EE (const vec3_t org)
{ {
/* /*
@ -772,7 +773,7 @@ R_ParticleExplosion_EE (const vec3_t org)
0.5 + qfrandom (0.25), 0.0); 0.5 + qfrandom (0.25), 0.0);
} }
void static void
R_TeleportSplash_EE (const vec3_t org) R_TeleportSplash_EE (const vec3_t org)
{ {
float vel; float vel;
@ -809,7 +810,7 @@ R_TeleportSplash_EE (const vec3_t org)
} }
} }
void static void
R_RocketTrail_EE (entity_t *ent) R_RocketTrail_EE (entity_t *ent)
{ {
float dist, maxlen, origlen, percent, pscale, pscalenext; float dist, maxlen, origlen, percent, pscale, pscalenext;
@ -843,7 +844,7 @@ R_RocketTrail_EE (entity_t *ent)
} }
} }
void static void
R_GrenadeTrail_EE (entity_t *ent) R_GrenadeTrail_EE (entity_t *ent)
{ {
float dist, maxlen, origlen, percent, pscale, pscalenext; float dist, maxlen, origlen, percent, pscale, pscalenext;
@ -877,7 +878,7 @@ R_GrenadeTrail_EE (entity_t *ent)
} }
} }
void static void
R_ParticleExplosion_ID (const vec3_t org) R_ParticleExplosion_ID (const vec3_t org)
{ {
unsigned int i; unsigned int i;
@ -899,7 +900,7 @@ R_ParticleExplosion_ID (const vec3_t org)
} }
} }
void static void
R_BlobExplosion_ID (const vec3_t org) R_BlobExplosion_ID (const vec3_t org)
{ {
unsigned int i; unsigned int i;
@ -922,7 +923,7 @@ R_BlobExplosion_ID (const vec3_t org)
} }
} }
void static void
R_RunParticleEffect_ID (const vec3_t org, const vec3_t dir, int color, R_RunParticleEffect_ID (const vec3_t org, const vec3_t dir, int color,
int count) int count)
{ {
@ -954,49 +955,49 @@ R_RunParticleEffect_ID (const vec3_t org, const vec3_t dir, int color,
} }
} }
void static void
R_BloodPuffEffect_ID (const vec3_t org, int count) R_BloodPuffEffect_ID (const vec3_t org, int count)
{ {
R_RunParticleEffect_ID (org, vec3_origin, 73, count); R_RunParticleEffect_ID (org, vec3_origin, 73, count);
} }
void static void
R_GunshotEffect_ID (const vec3_t org, int count) R_GunshotEffect_ID (const vec3_t org, int count)
{ {
R_RunParticleEffect_ID (org, vec3_origin, 0, count); R_RunParticleEffect_ID (org, vec3_origin, 0, count);
} }
void static void
R_LightningBloodEffect_ID (const vec3_t org) R_LightningBloodEffect_ID (const vec3_t org)
{ {
R_RunParticleEffect_ID (org, vec3_origin, 225, 50); R_RunParticleEffect_ID (org, vec3_origin, 225, 50);
} }
void static void
R_SpikeEffect_ID (const vec3_t org) R_SpikeEffect_ID (const vec3_t org)
{ {
R_RunParticleEffect_ID (org, vec3_origin, 0, 10); R_RunParticleEffect_ID (org, vec3_origin, 0, 10);
} }
void static void
R_SuperSpikeEffect_ID (const vec3_t org) R_SuperSpikeEffect_ID (const vec3_t org)
{ {
R_RunParticleEffect_ID (org, vec3_origin, 0, 20); R_RunParticleEffect_ID (org, vec3_origin, 0, 20);
} }
void static void
R_KnightSpikeEffect_ID (const vec3_t org) R_KnightSpikeEffect_ID (const vec3_t org)
{ {
R_RunParticleEffect_ID (org, vec3_origin, 226, 20); R_RunParticleEffect_ID (org, vec3_origin, 226, 20);
} }
void static void
R_WizSpikeEffect_ID (const vec3_t org) R_WizSpikeEffect_ID (const vec3_t org)
{ {
R_RunParticleEffect_ID (org, vec3_origin, 20, 30); R_RunParticleEffect_ID (org, vec3_origin, 20, 30);
} }
void static void
R_LavaSplash_ID (const vec3_t org) R_LavaSplash_ID (const vec3_t org)
{ {
float vel; float vel;
@ -1032,7 +1033,7 @@ R_LavaSplash_ID (const vec3_t org)
} }
} }
void static void
R_TeleportSplash_ID (const vec3_t org) R_TeleportSplash_ID (const vec3_t org)
{ {
float vel; float vel;
@ -1071,7 +1072,7 @@ R_TeleportSplash_ID (const vec3_t org)
} }
} }
void static void
R_RocketTrail_ID (entity_t *ent) R_RocketTrail_ID (entity_t *ent)
{ {
float maxlen; float maxlen;
@ -1102,7 +1103,7 @@ R_RocketTrail_ID (entity_t *ent)
} }
} }
void static void
R_GrenadeTrail_ID (entity_t *ent) R_GrenadeTrail_ID (entity_t *ent)
{ {
float maxlen; float maxlen;
@ -1133,7 +1134,7 @@ R_GrenadeTrail_ID (entity_t *ent)
} }
} }
void static void
R_BloodTrail_ID (entity_t *ent) R_BloodTrail_ID (entity_t *ent)
{ {
float maxlen; float maxlen;
@ -1163,7 +1164,7 @@ R_BloodTrail_ID (entity_t *ent)
} }
} }
void static void
R_SlightBloodTrail_ID (entity_t *ent) R_SlightBloodTrail_ID (entity_t *ent)
{ {
float maxlen; float maxlen;
@ -1193,7 +1194,7 @@ R_SlightBloodTrail_ID (entity_t *ent)
} }
} }
void static void
R_WizTrail_ID (entity_t *ent) R_WizTrail_ID (entity_t *ent)
{ {
float maxlen; float maxlen;
@ -1229,7 +1230,7 @@ R_WizTrail_ID (entity_t *ent)
} }
} }
void static void
R_FlameTrail_ID (entity_t *ent) R_FlameTrail_ID (entity_t *ent)
{ {
float maxlen; float maxlen;
@ -1265,7 +1266,7 @@ R_FlameTrail_ID (entity_t *ent)
} }
} }
void static void
R_VoorTrail_ID (entity_t *ent) R_VoorTrail_ID (entity_t *ent)
{ {
float maxlen; float maxlen;
@ -1609,7 +1610,7 @@ r_particles_style_f (cvar_t *var)
} }
} }
void static void
R_ParticleFunctionInit (void) R_ParticleFunctionInit (void)
{ {
r_particles_style_f (r_particles_style); r_particles_style_f (r_particles_style);

View file

@ -43,6 +43,7 @@ static const char rcsid[] =
#include "QF/GL/defines.h" #include "QF/GL/defines.h"
#include "QF/GL/funcs.h" #include "QF/GL/funcs.h"
#include "QF/GL/qf_noisetextures.h" #include "QF/GL/qf_noisetextures.h"
#include "QF/GL/qf_textures.h"
#include "QF/GL/qf_vid.h" #include "QF/GL/qf_vid.h"
/* /*

View file

@ -42,6 +42,7 @@ static const char rcsid[] =
#include "QF/cvar.h" #include "QF/cvar.h"
#include "QF/draw.h" #include "QF/draw.h"
#include "QF/render.h"
#include "QF/sys.h" #include "QF/sys.h"
#include "QF/GL/defines.h" #include "QF/GL/defines.h"
#include "QF/GL/funcs.h" #include "QF/GL/funcs.h"

View file

@ -258,7 +258,7 @@ GL_DrawAliasShadow (aliashdr_t *paliashdr, vert_order_t *vo)
} }
} }
vert_order_t * static vert_order_t *
GL_GetAliasFrameVerts16 (int frame, aliashdr_t *paliashdr, entity_t *e) GL_GetAliasFrameVerts16 (int frame, aliashdr_t *paliashdr, entity_t *e)
{ {
float interval; float interval;
@ -362,7 +362,7 @@ GL_GetAliasFrameVerts16 (int frame, aliashdr_t *paliashdr, entity_t *e)
return vo; return vo;
} }
vert_order_t * static vert_order_t *
GL_GetAliasFrameVerts (int frame, aliashdr_t *paliashdr, entity_t *e) GL_GetAliasFrameVerts (int frame, aliashdr_t *paliashdr, entity_t *e)
{ {
float interval; float interval;
@ -464,7 +464,7 @@ GL_GetAliasFrameVerts (int frame, aliashdr_t *paliashdr, entity_t *e)
return vo; return vo;
} }
maliasskindesc_t * static maliasskindesc_t *
R_AliasGetSkindesc (int skinnum, aliashdr_t *ahdr) R_AliasGetSkindesc (int skinnum, aliashdr_t *ahdr)
{ {
maliasskindesc_t *pskindesc; maliasskindesc_t *pskindesc;

View file

@ -54,6 +54,7 @@ static const char rcsid[] =
#include "QF/GL/defines.h" #include "QF/GL/defines.h"
#include "QF/GL/funcs.h" #include "QF/GL/funcs.h"
#include "QF/GL/qf_rlight.h" #include "QF/GL/qf_rlight.h"
#include "QF/GL/qf_rmain.h"
#include "QF/GL/qf_rsurf.h" #include "QF/GL/qf_rsurf.h"
#include "QF/GL/qf_screen.h" #include "QF/GL/qf_screen.h"
#include "QF/GL/qf_vid.h" #include "QF/GL/qf_vid.h"

View file

@ -67,7 +67,7 @@ int r_init = 0;
Grab six views for environment mapping tests Grab six views for environment mapping tests
*/ */
void static void
R_Envmap_f (void) R_Envmap_f (void)
{ {
byte buffer[256 * 256 * 4]; byte buffer[256 * 256 * 4];

View file

@ -217,7 +217,7 @@ SCR_ScreenShot_f (void)
Con_Printf ("Wrote %s\n", pcxname); Con_Printf ("Wrote %s\n", pcxname);
} }
void static void
SCR_TileClear (void) SCR_TileClear (void)
{ {
if (r_refdef.vrect.x > 0) { if (r_refdef.vrect.x > 0) {

View file

@ -56,7 +56,7 @@ static const char rcsid[] =
#include "r_shared.h" #include "r_shared.h"
#include "view.h" #include "view.h"
char *suf[6] = { "rt", "bk", "lf", "ft", "up", "dn" }; const char *suf[6] = { "rt", "bk", "lf", "ft", "up", "dn" };
int solidskytexture; int solidskytexture;
int alphaskytexture; int alphaskytexture;
@ -109,7 +109,7 @@ R_LoadSkys (const char *skyname)
Con_Printf ("Unable to load skybox %s, using normal sky\n", skyname); Con_Printf ("Unable to load skybox %s, using normal sky\n", skyname);
} }
inline void static inline void
R_SkyBoxPolyVec (vec5_t v) R_SkyBoxPolyVec (vec5_t v)
{ {
// avoid interpolation seams // avoid interpolation seams
@ -165,7 +165,7 @@ vec5_t skyvec[6][4] = {
}; };
#undef ftc #undef ftc
void static void
R_DrawSkyBox (void) R_DrawSkyBox (void)
{ {
int i, j; int i, j;
@ -186,7 +186,7 @@ R_DrawSkyBox (void)
vec3_t domescale; vec3_t domescale;
void static void
R_DrawSkyLayer (float s) R_DrawSkyLayer (float s)
{ {
float x, y, a1x, a1y, a2x, a2y; float x, y, a1x, a1y, a2x, a2y;
@ -230,7 +230,7 @@ R_DrawSkyLayer (float s)
} }
} }
void static void
R_DrawSkyDome (void) R_DrawSkyDome (void)
{ {
float speedscale; // for top sky and bottom sky float speedscale; // for top sky and bottom sky

View file

@ -599,7 +599,7 @@ render_box (const struct box_def *box)
} }
} }
void static void
R_DrawSkyBoxPoly (const glpoly_t *poly) R_DrawSkyBoxPoly (const glpoly_t *poly)
{ {
int i; int i;
@ -657,7 +657,7 @@ R_DrawSkyBoxPoly (const glpoly_t *poly)
render_box (&box); render_box (&box);
} }
void static void
EmitSkyPolys (float speedscale, const msurface_t *fa) EmitSkyPolys (float speedscale, const msurface_t *fa)
{ {
float length, s, t; float length, s, t;

View file

@ -70,7 +70,7 @@ static gltexture_t gltextures[MAX_GLTEXTURES];
static int numgltextures = 0; static int numgltextures = 0;
typedef struct { typedef struct {
char *name; const char *name;
int minimize, maximize; int minimize, maximize;
} glmode_t; } glmode_t;
@ -84,10 +84,10 @@ static glmode_t modes[] = {
}; };
typedef struct { typedef struct {
char *name; const char *name;
int format; int format;
} glformat_t; } glformat_t;
#if 0
static glformat_t formats[] = { static glformat_t formats[] = {
/* /*
1-4 are standardly supported formats by GL, not exactly the 1-4 are standardly supported formats by GL, not exactly the
@ -174,7 +174,7 @@ static glformat_t formats[] = {
*/ */
{"NULL", 0} {"NULL", 0}
}; };
#endif
int gl_alpha_format = 4, gl_lightmap_format = 4, gl_solid_format = 3; int gl_alpha_format = 4, gl_lightmap_format = 4, gl_solid_format = 3;
@ -218,8 +218,8 @@ GL_TextureMode_f (void)
} }
} }
} }
#if 0
int static int
GL_TextureDepth_f (int format) GL_TextureDepth_f (int format)
{ {
int i; int i;
@ -245,7 +245,7 @@ GL_TextureDepth_f (int format)
return formats[i].format; return formats[i].format;
} }
#endif
static void static void
GL_ResampleTexture (unsigned int *in, int inwidth, int inheight, GL_ResampleTexture (unsigned int *in, int inwidth, int inheight,
unsigned int *out, int outwidth, int outheight) unsigned int *out, int outwidth, int outheight)

Some files were not shown because too many files have changed in this diff Show more