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...
if test "x$GCC" = "xyes"; 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
CFLAGS="$CFLAGS -Wall"
fi

View file

@ -41,6 +41,5 @@ extern vec3_t lightspot;
void R_RotateForEntity (struct entity_s *e);
void glrmain_init (void);
int R_InitGraphTextures (int base);
#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_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_Load (void);
void Menu_Draw (void);

View file

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

View file

@ -29,6 +29,5 @@
$Id$
*/
void GIB_Process_Variable (struct dstring_s *token);
int GIB_Process_Math (struct dstring_s *token);
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);
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);
ie_translation_index_t *IE_Translation_Index_Create ();
ie_translation_index_t *IE_Translation_Index_Create (void);
/*
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_mark (const vec3_t loc, const char *desc);
int locs_nearest (const vec3_t loc);
void locs_reset ();
void locs_reset (void);
void locs_save (const char *filename, qboolean gz);
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 _VectorCopy (const vec3_t in, vec3_t out);
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,
vec3_t vecc);
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 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
extern inline
#endif

View file

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

View file

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

View file

@ -34,8 +34,8 @@
#include "QF/qtypes.h"
extern int com_argc;
extern char **com_argv;
extern char *com_cmdline;
extern const char **com_argv;
extern const char *com_cmdline;
int COM_CheckParm (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 pos;
unsigned int line;
char *error;
const char *error;
} 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);
void COM_CloseFile (QFile *h);
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);
void COM_StripExtension (const char *in, char *out);
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_ClearDlights (void);
int R_InitGraphTextures (int base);
void R_LineGraph (int x, int y, int *h_vals, int count);
struct progs_s;
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_freply;
typedef char * (*ffunc_t) (char *args);
typedef const char *(*ffunc_t) (char *args);
typedef struct freply_s {
char *name;
const char *name;
ffunc_t func;
float lasttime;
} 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_PolysetDraw (void);
void D_PolysetDrawFinalVerts (finalvert_t *fv, int numverts);
void D_PolysetSetEdgeTable (void);
void D_DrawParticle (particle_t *pparticle);
void D_DrawPoly (void);
void D_DrawSprite (void);

View file

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

View file

@ -127,14 +127,7 @@ struct option
`getopt'. */
#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);
# else /* not __GNU_LIBRARY__ */
extern int getopt ();
# endif /* __GNU_LIBRARY__ */
# ifndef __need_getopt
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));
/* 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 *));
/* POSIX compatibility. */

View file

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

View file

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

View file

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

View file

@ -360,7 +360,8 @@ I_SGI_Init (void)
return ;
}
QFPLUGIN plugin_t *
QFPLUGIN plugin_t *PLUGIN_INFO(cd, sgi) (void);
QFPLUGIN plugin_t *
PLUGIN_INFO(cd, sgi) (void)
{
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 *
PLUGIN_INFO(cd, win) (void)
{

View file

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

View file

@ -114,7 +114,7 @@ SND_AmbientOn (void)
snd_ambient = true;
}
void
static void
SND_SoundInfo_f (void)
{
if (!sound_started || !shm) {
@ -132,7 +132,7 @@ SND_SoundInfo_f (void)
Sys_Printf ("%5d total_channels\n", total_channels);
}
void
static void
SND_Startup (void)
{
int rc;
@ -154,7 +154,7 @@ SND_Startup (void)
}
// Load a sound ===============================================================
sfx_t *
static sfx_t *
SND_FindName (const char *name)
{
int i;
@ -406,7 +406,7 @@ SND_StopAllSounds (qboolean clear)
SND_ClearBuffer ();
}
void
static void
SND_StopAllSoundsC (void)
{
SND_StopAllSounds (true);
@ -484,7 +484,7 @@ SND_StaticSound (sfx_t *sfx, const vec3_t origin, float vol,
//=============================================================================
void
static void
SND_UpdateAmbientSounds (void)
{
float vol;
@ -534,7 +534,7 @@ SND_UpdateAmbientSounds (void)
}
}
void
static void
SND_GetSoundtime (void)
{
int fullsamples, samplepos;
@ -561,7 +561,7 @@ SND_GetSoundtime (void)
soundtime = buffers * fullsamples + samplepos / shm->channels;
}
void
static void
SND_Update_ (void)
{
int samps;
@ -689,7 +689,7 @@ SND_ExtraUpdate (void)
/* console functions */
void
static void
SND_Play (void)
{
char name[256];
@ -715,7 +715,7 @@ SND_Play (void)
}
}
void
static void
SND_PlayVol (void)
{
char name[256];
@ -743,7 +743,7 @@ SND_PlayVol (void)
}
}
void
static void
SND_SoundList (void)
{
int load, size, total, i;
@ -828,7 +828,7 @@ SND_UnblockSound (void)
S_O_UnblockSound ();
}
void
static void
SND_Init_Cvars (void)
{
ambient_fade = Cvar_Get ("ambient_fade", "100", CVAR_NONE, NULL,
@ -952,6 +952,7 @@ SND_Shutdown (void)
shm = 0;
}
QFPLUGIN plugin_t *PLUGIN_INFO(snd_render, default) (void);
QFPLUGIN plugin_t *
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]);
}
sfxcache_t *
static sfxcache_t *
SND_LoadSound (sfx_t *sfx, cache_allocator_t allocator)
{
char namebuffer[256];
@ -250,7 +250,7 @@ byte *last_chunk;
byte *iff_data;
int iff_chunk_len;
short
static short
SND_GetLittleShort (void)
{
short val = 0;
@ -261,7 +261,7 @@ SND_GetLittleShort (void)
return val;
}
int
static int
SND_GetLittleLong (void)
{
int val = 0;
@ -274,8 +274,8 @@ SND_GetLittleLong (void)
return val;
}
void
SND_FindNexctChunk (char *name)
static void
SND_FindNexctChunk (const char *name)
{
while (1) {
data_p = last_chunk;
@ -299,14 +299,14 @@ SND_FindNexctChunk (char *name)
}
}
void
SND_FindChunk (char *name)
static void
SND_FindChunk (const char *name)
{
last_chunk = iff_data;
SND_FindNexctChunk (name);
}
void
/*
static void
SND_DumpChunks (void)
{
char str[5];
@ -322,7 +322,7 @@ SND_DumpChunks (void)
data_p += (iff_chunk_len + 1) & ~1;
} while (data_p < iff_end);
}
*/
wavinfo_t
SND_GetWavinfo (const char *name, byte * wav, int wavlength)
{

View file

@ -79,7 +79,7 @@ SND_WriteLinearBlastStereo16 (void)
}
#endif
void
static void
SND_TransferStereo16 (int endtime)
{
int lpaintedtime, lpos;
@ -133,7 +133,7 @@ SND_TransferStereo16 (int endtime)
#endif
}
void
static void
SND_TransferPaintBuffer (int endtime)
{
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 *
PLUGIN_INFO(snd_render, null) (void)
{

View file

@ -403,8 +403,10 @@ SNDDMA_UnblockSound (void)
snd_pcm_playback_pause (pcm_handle, 0);
}
plugin_t *
PLUGIN_INFO(snd_output, alsa0_5) (void) {
QFPLUGIN plugin_t *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.api_version = QFPLUGIN_VERSION;
plugin_info.plugin_version = "0.1";

View file

@ -362,7 +362,8 @@ SNDDMA_UnblockSound (void)
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.type = qfp_snd_output;

View file

@ -152,6 +152,7 @@ SNDDMA_UnblockSound (void)
--snd_blocked;
}
QFPLUGIN plugin_t *PLUGIN_INFO(snd_output, disk) (void);
QFPLUGIN plugin_t *
PLUGIN_INFO(snd_output, disk) (void) {
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 *
PLUGIN_INFO(snd_output, null) (void) {
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 *
PLUGIN_INFO(snd_output, oss) (void) {
plugin_info.type = qfp_snd_output;

View file

@ -228,6 +228,7 @@ SNDDMA_UnblockSound (void)
--snd_blocked;
}
QFPLUGIN plugin_t *PLUGIN_INFO(snd_output, sdl) (void);
QFPLUGIN plugin_t *
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 *
PLUGIN_INFO(snd_output, sgi) (void)
{

View file

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

View file

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

View file

@ -269,7 +269,7 @@ Condump_f (void)
Qclose (file);
}
qboolean
static qboolean
CheckForCommand (const char *line)
{
char command[128];
@ -340,7 +340,7 @@ C_SayTeam (const char *line)
}
void
static void
C_GIB_Print_Center_f (void)
{
if (GIB_Argc () != 2) {
@ -439,7 +439,7 @@ Linefeed (void)
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.
*/
void
static void
C_Print (const char *fmt, va_list args)
{
char *s;
@ -857,6 +857,7 @@ static plugin_t plugin_info = {
&plugin_info_data,
};
QFPLUGIN plugin_t *PLUGIN_INFO(console, client) (void);
QFPLUGIN plugin_t *
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.
*/
void
static void
filelist_fill (struct filelist *filelist, const char *path, const char *ext)
{
searchpath_t *search;
@ -224,7 +224,7 @@ Con_Skinlist_f (void)
filelist_free (skinlist);
}
char *sb_endings[] = {
const char *sb_endings[] = {
"bk",
"dn",
"ft",

View file

@ -45,10 +45,6 @@ static const char rcsid[] =
#include "QF/render.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 {
struct menu_pic_s *next;
int x, y;
@ -87,7 +83,7 @@ static const char *top_menu;
static int
menu_resolve_globals (void)
{
char *sym;
const char *sym;
dfunction_t *f;
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 *flags = strrchr (fname, ':');
if (flags)
if (flags) {
*flags++ = 0;
else
flags = "";
flags = nva ("a%s", flags);
flags = nva ("a%s", flags);
} else {
flags = nva ("a");
}
log_file = Qopen (va ("%s/%s", fs_userpath->string, fname), flags);
free (flags);
free (fname);
@ -452,22 +453,22 @@ C_ProcessInput (void)
}
}
void
static void
C_KeyEvent (knum_t key, short unicode, qboolean down)
{
}
void
static void
C_DrawConsole (int lines)
{
}
void
static void
C_CheckResize (void)
{
}
void
static void
C_NewMap (void)
{
}
@ -515,6 +516,7 @@ static plugin_t plugin_info = {
&plugin_info_data,
};
QFPLUGIN plugin_t *PLUGIN_INFO(console, server) (void);
QFPLUGIN plugin_t *
PLUGIN_INFO(console, server) (void)
{

View file

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

View file

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

View file

@ -38,6 +38,7 @@ static const char rcsid[] =
# include <strings.h>
#endif
#include "QF/csqc.h"
#include "QF/cvar.h"
#include "QF/progs.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);
#endif
#include "QF/csqc.h"
#include "QF/progs.h"
#include "QF/quakefs.h"
#include "QF/va.h"

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -157,36 +157,6 @@ ED_Alloc (progs_t *pr)
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
@ -218,7 +188,7 @@ ED_Free (progs_t *pr, edict_t *ed)
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)
{
static char line[256];
@ -295,7 +265,7 @@ PR_GlobalString (progs_t *pr, int ofs, etype_t type)
{
ddef_t *def = NULL;
static dstring_t *line = NULL;
char *s;
const char *s;
if (!line)
line = dstring_newstr();
@ -312,8 +282,8 @@ PR_GlobalString (progs_t *pr, int ofs, etype_t type)
if (!def && type == ev_void)
dsprintf (line, "[$%x]", ofs);
else {
char *name = "?";
char *oi = "";
const char *name = "?";
const char *oi = "";
if (def) {
if (type == ev_void)
type = def->type;

View file

@ -144,7 +144,7 @@ PR_EnterFunction (progs_t * pr, dfunction_t *f)
return;
}
void
static void
PR_LeaveFunction (progs_t * pr)
{
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)
{
pr_class_t *class;

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -92,7 +92,7 @@ GIB_Thread_New (void)
return new;
}
void
static void
GIB_Thread_Delete (gib_thread_t *thread)
{
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)
{
return ((gib_event_t *)ele)->name;
}
void
static void
GIB_Event_Free (void *ele, void *ptr)
{
gib_event_t *ev = (gib_event_t *)ele;

View file

@ -41,7 +41,7 @@ static const char rcsid[] =
hashtab_t *gib_globals = 0;
gib_var_t *
static gib_var_t *
GIB_Var_New (void)
{
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);
}
gib_var_t *
static gib_var_t *
GIB_Var_Get_R (hashtab_t *vars, char *name)
{
char *p;
@ -86,7 +86,7 @@ GIB_Var_Get_R (hashtab_t *vars, char *name)
return Hash_Find (vars, name);
}
void
static void
GIB_Var_Set_R (hashtab_t *vars, char *name, const char *value)
{
char *p;

View file

@ -21,6 +21,8 @@
#include <math.h>
#include "ops.h"
double
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 void
init_syntax_once ()
init_syntax_once (void)
{
register int c;
static int done = 0;
@ -839,11 +839,23 @@ static const char *re_error_msg[] =
/* Subroutine declarations and macros for regex_compile. */
static void store_op1 (), store_op2 ();
static void insert_op1 (), insert_op2 ();
static boolean at_begline_loc_p (), at_endline_loc_p ();
static boolean group_in_compile_stack ();
static reg_errcode_t compile_range ();
typedef struct
{
struct compile_stack_elt_t *stack;
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
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. */
#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. */
@ -980,7 +988,7 @@ typedef unsigned regnum_t;
be able to hold values from -(MAX_BUF_SIZE - 1) to MAX_BUF_SIZE - 1. */
typedef int pattern_offset_t;
typedef struct
typedef struct compile_stack_elt_t
{
pattern_offset_t begalt_offset;
pattern_offset_t fixup_alt_jump;
@ -990,14 +998,6 @@ typedef struct
} 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 COMPILE_STACK_EMPTY (compile_stack.avail == 0)
@ -1058,6 +1058,7 @@ typedef struct
The `fastmap' and `newline_anchor' fields are neither
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
regex_compile (pattern, size, syntax, bufp)
const char *pattern;
@ -2996,11 +2997,11 @@ re_search_2 (bufp, string1, size1, string2, size2, startpos, range, regs, stop)
} /* re_search_2 */
/* Declarations and macros for re_match_2. */
static int bcmp_translate ();
static boolean alt_match_null_string_p (),
common_op_match_null_string_p (),
group_match_null_string_p ();
union register_info_type;
static int bcmp_translate (const unsigned char *s1, const unsigned char *s2, int len, char *translate);
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 (unsigned char **p, unsigned char *end, union register_info_type *reg_info),
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.
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 type of `word', i.e., is something that fits into one item on the
failure stack. */
typedef union
typedef union register_info_type
{
fail_stack_elt_t word;
struct
@ -4595,11 +4596,11 @@ common_op_match_null_string_p (p, end, reg_info)
static int
bcmp_translate (s1, s2, len, translate)
unsigned char *s1, *s2;
const unsigned char *s1, *s2;
register int len;
char *translate;
{
register unsigned char *p1 = s1, *p2 = s2;
register const unsigned char *p1 = s1, *p2 = s2;
while (len)
{
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. */
static struct re_pattern_buffer re_comp_buf;
char *
const char *
re_comp (s)
const char *s;
{

View file

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

View file

@ -82,7 +82,7 @@ typedef struct {
Fill background pixels so mipmapping doesn't have halos - Ed
*/
void
static void
Mod_FloodFillSkin (byte * skin, int skinwidth, int skinheight)
{
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)
{
tex_t *targa;

View file

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

View file

@ -163,7 +163,7 @@ Mod_LoadLighting (lump_t *l)
msurface_t *warpface;
void
static void
BoundPoly (int numverts, float *verts, vec3_t mins, vec3_t maxs)
{
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)
{
float frac, m, s, t;

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -52,7 +52,7 @@ const vec3_t vec3_origin = { 0, 0, 0 };
#define DEG2RAD(a) (a * (M_PI / 180.0))
void
static void
ProjectPointOnPlane (vec3_t dst, const vec3_t p, const vec3_t normal)
{
float inv_denom, d;
@ -68,7 +68,7 @@ ProjectPointOnPlane (vec3_t dst, const vec3_t p, const vec3_t normal)
}
// assumes "src" is normalized
void
static void
PerpendicularVector (vec3_t dst, const vec3_t src)
{
int pos, i;
@ -181,6 +181,7 @@ anglemod (float a)
Split out like this for ASM to call.
*/
void __attribute__ ((noreturn)) BOPS_Error (void);
void __attribute__ ((noreturn))
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");
}
void
static void
PI_InitCvars (void)
{
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/crc.h"
#include "QF/qargs.h"
#include "QF/qtypes.h"
#include "QF/sys.h"
static char **largv;
static char *argvdummy = " ";
static const char **largv;
static const char *argvdummy = " ";
static char *safeargvs[] =
static const char *safeargvs[] =
{ "-stdvid", "-nolan", "-nosound", "-nocdaudio", "-nojoy", "-nomouse",
"-dibonly" };
#define NUM_SAFE_ARGVS (sizeof(safeargvs)/sizeof(safeargvs[0]))
int com_argc;
char **com_argv;
char *com_cmdline;
const char **com_argv;
const char *com_cmdline;
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
*/
int
COM_CheckParm (char *parm)
COM_CheckParm (const char *parm)
{
int i;
@ -87,15 +88,16 @@ COM_CheckParm (char *parm)
}
void
COM_InitArgv (int argc, char **argv)
COM_InitArgv (int argc, const char **argv)
{
qboolean safe;
int i, len;
char *cmdline;
safe = false;
largv = (char **) calloc (1, (argc + NUM_SAFE_ARGVS + 1) *
sizeof (char **));
largv = (const char **) calloc (1, (argc + NUM_SAFE_ARGVS + 1) *
sizeof (const char **));
for (com_argc = 0, len = 0; com_argc < argc; com_argc++) {
largv[com_argc] = argv[com_argc];
@ -105,16 +107,17 @@ COM_InitArgv (int argc, char **argv)
len += strlen (argv[com_argc]) + 1;
}
com_cmdline = (char *) calloc (1, len + 1); // need strlen(com_cmdline)+2
com_cmdline[0] = 0;
cmdline = (char *) calloc (1, len + 1); // need strlen(cmdline)+2
cmdline[0] = 0;
if (len) {
for (i = 1; i < argc; i++) {
strncat (com_cmdline, argv[i], len - strlen (com_cmdline));
assert (len - strlen (com_cmdline) > 0);
strncat (com_cmdline, " ", len - strlen (com_cmdline));
strncat (cmdline, argv[i], len - strlen (cmdline));
assert (len - strlen (cmdline) > 0);
strncat (cmdline, " ", len - strlen (cmdline));
}
com_cmdline[len - 1] = '\0';
cmdline[len - 1] = '\0';
}
com_cmdline = cmdline;
if (safe) {
// 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
*/
void
COM_AddParm (char *parm)
COM_AddParm (const char *parm)
{
largv[com_argc++] = parm;
}

View file

@ -219,7 +219,7 @@ PL_ParseQuotedString (pldata_t *pl)
}
if (pl->pos - start - shrink == 0) {
str = "";
str = strdup ("");
} else {
char chars[pl->pos - start - shrink];
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)
{
QFile *file;
@ -328,7 +328,7 @@ COM_CompressPath (const char *pth)
Checks if a string contains an updir ('..'), either at the ends or
surrounded by slashes ('/'). Doesn't check for leading slash.
*/
int
static int
contains_updir (const char *filename)
{
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
of the list so they override previous pack files.
*/
pack_t *
static pack_t *
COM_LoadPackFile (char *packfile)
{
pack_t *pack = pack_open (packfile);
@ -613,7 +613,7 @@ qstrcmp (char **os1, char **os2)
}
}
void
static void
COM_LoadGameDirectory (const char *dir)
{
searchpath_t *search;
@ -692,7 +692,7 @@ COM_LoadGameDirectory (const char *dir)
Sets com_gamedir, adds the directory to the head of the path,
then loads and adds pak1.pak pak2.pak ...
*/
void
static void
COM_AddDirectory (const char *dir)
{
searchpath_t *search;
@ -720,7 +720,7 @@ COM_AddDirectory (const char *dir)
COM_LoadGameDirectory (dir);
}
void
static void
COM_AddGameDirectory (const char *dir)
{
Sys_DPrintf ("COM_AddGameDirectory (\"%s/%s\")\n",
@ -852,7 +852,7 @@ COM_FileExtension (const char *in)
}
void
COM_DefaultExtension (char *path, char *extension)
COM_DefaultExtension (char *path, const char *extension)
{
char *src;

View file

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

View file

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

View file

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

View file

@ -54,6 +54,7 @@ static const char rcsid[] =
#include "compat.h"
#include "r_cvar.h"
#include "r_dynamic.h"
#include "r_local.h"
#include "r_shared.h"
#include "varrays.h"
@ -203,7 +204,7 @@ R_ReadPointFile_f (void)
Con_Printf ("%i points read\n", c);
}
void
static void
R_ParticleExplosion_QF (const vec3_t org)
{
// R_NewExplosion (org);
@ -214,7 +215,7 @@ R_ParticleExplosion_QF (const vec3_t org)
0.5 + qfrandom (0.25), 0.0);
}
void
static void
R_ParticleExplosion2_QF (const vec3_t org, int colorStart, int colorLength)
{
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)
{
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);
}
void
static void
R_BloodPuffEffect_QF (const vec3_t org, int count)
{
R_BloodPuff_QF (org, count);
}
void
static void
R_GunshotEffect_QF (const vec3_t org, int count)
{
int scale = 16;
@ -301,7 +302,7 @@ R_GunshotEffect_QF (const vec3_t org, int count)
R_RunSparkEffect_QF (org, count >> 1, scale);
}
void
static void
R_LightningBloodEffect_QF (const vec3_t org)
{
int count = 7;
@ -322,7 +323,7 @@ R_LightningBloodEffect_QF (const vec3_t org)
0.0);
}
void
static void
R_RunParticleEffect_QF (const vec3_t org, const vec3_t dir, int color,
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_RunSparkEffect_QF (org, 5, 8);
}
void
static void
R_SuperSpikeEffect_QF (const vec3_t org)
{
R_RunSparkEffect_QF (org, 10, 8);
}
void
static void
R_KnightSpikeEffect_QF (const vec3_t org)
{
unsigned int count = 10;
@ -378,7 +379,7 @@ R_KnightSpikeEffect_QF (const vec3_t org)
r_realtime + 5.0, 234, 1.0, 0.0);
}
void
static void
R_WizSpikeEffect_QF (const vec3_t org)
{
unsigned int count = 15;
@ -395,7 +396,7 @@ R_WizSpikeEffect_QF (const vec3_t org)
r_realtime + 5.0, 63, 1.0, 0.0);
}
void
static void
R_LavaSplash_QF (const vec3_t org)
{
float vel;
@ -431,7 +432,7 @@ R_LavaSplash_QF (const vec3_t org)
}
}
void
static void
R_TeleportSplash_QF (const vec3_t org)
{
float vel;
@ -470,7 +471,7 @@ R_TeleportSplash_QF (const vec3_t org)
}
}
void
static void
R_RocketTrail_QF (entity_t *ent)
{
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)
{
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)
{
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)
{
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)
{
float maxlen, origlen, percent;
@ -654,7 +655,7 @@ R_WizTrail_QF (entity_t *ent)
}
}
void
static void
R_FlameTrail_QF (entity_t *ent)
{
float maxlen, origlen, percent;
@ -694,7 +695,7 @@ R_FlameTrail_QF (entity_t *ent)
}
}
void
static void
R_VoorTrail_QF (entity_t *ent)
{
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)
{
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)
{
/*
@ -772,7 +773,7 @@ R_ParticleExplosion_EE (const vec3_t org)
0.5 + qfrandom (0.25), 0.0);
}
void
static void
R_TeleportSplash_EE (const vec3_t org)
{
float vel;
@ -809,7 +810,7 @@ R_TeleportSplash_EE (const vec3_t org)
}
}
void
static void
R_RocketTrail_EE (entity_t *ent)
{
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)
{
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)
{
unsigned int i;
@ -899,7 +900,7 @@ R_ParticleExplosion_ID (const vec3_t org)
}
}
void
static void
R_BlobExplosion_ID (const vec3_t org)
{
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,
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_RunParticleEffect_ID (org, vec3_origin, 73, count);
}
void
static void
R_GunshotEffect_ID (const vec3_t org, int count)
{
R_RunParticleEffect_ID (org, vec3_origin, 0, count);
}
void
static void
R_LightningBloodEffect_ID (const vec3_t org)
{
R_RunParticleEffect_ID (org, vec3_origin, 225, 50);
}
void
static void
R_SpikeEffect_ID (const vec3_t org)
{
R_RunParticleEffect_ID (org, vec3_origin, 0, 10);
}
void
static void
R_SuperSpikeEffect_ID (const vec3_t org)
{
R_RunParticleEffect_ID (org, vec3_origin, 0, 20);
}
void
static void
R_KnightSpikeEffect_ID (const vec3_t org)
{
R_RunParticleEffect_ID (org, vec3_origin, 226, 20);
}
void
static void
R_WizSpikeEffect_ID (const vec3_t org)
{
R_RunParticleEffect_ID (org, vec3_origin, 20, 30);
}
void
static void
R_LavaSplash_ID (const vec3_t org)
{
float vel;
@ -1032,7 +1033,7 @@ R_LavaSplash_ID (const vec3_t org)
}
}
void
static void
R_TeleportSplash_ID (const vec3_t org)
{
float vel;
@ -1071,7 +1072,7 @@ R_TeleportSplash_ID (const vec3_t org)
}
}
void
static void
R_RocketTrail_ID (entity_t *ent)
{
float maxlen;
@ -1102,7 +1103,7 @@ R_RocketTrail_ID (entity_t *ent)
}
}
void
static void
R_GrenadeTrail_ID (entity_t *ent)
{
float maxlen;
@ -1133,7 +1134,7 @@ R_GrenadeTrail_ID (entity_t *ent)
}
}
void
static void
R_BloodTrail_ID (entity_t *ent)
{
float maxlen;
@ -1163,7 +1164,7 @@ R_BloodTrail_ID (entity_t *ent)
}
}
void
static void
R_SlightBloodTrail_ID (entity_t *ent)
{
float maxlen;
@ -1193,7 +1194,7 @@ R_SlightBloodTrail_ID (entity_t *ent)
}
}
void
static void
R_WizTrail_ID (entity_t *ent)
{
float maxlen;
@ -1229,7 +1230,7 @@ R_WizTrail_ID (entity_t *ent)
}
}
void
static void
R_FlameTrail_ID (entity_t *ent)
{
float maxlen;
@ -1265,7 +1266,7 @@ R_FlameTrail_ID (entity_t *ent)
}
}
void
static void
R_VoorTrail_ID (entity_t *ent)
{
float maxlen;
@ -1609,7 +1610,7 @@ r_particles_style_f (cvar_t *var)
}
}
void
static void
R_ParticleFunctionInit (void)
{
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/funcs.h"
#include "QF/GL/qf_noisetextures.h"
#include "QF/GL/qf_textures.h"
#include "QF/GL/qf_vid.h"
/*

View file

@ -42,6 +42,7 @@ static const char rcsid[] =
#include "QF/cvar.h"
#include "QF/draw.h"
#include "QF/render.h"
#include "QF/sys.h"
#include "QF/GL/defines.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)
{
float interval;
@ -362,7 +362,7 @@ GL_GetAliasFrameVerts16 (int frame, aliashdr_t *paliashdr, entity_t *e)
return vo;
}
vert_order_t *
static vert_order_t *
GL_GetAliasFrameVerts (int frame, aliashdr_t *paliashdr, entity_t *e)
{
float interval;
@ -464,7 +464,7 @@ GL_GetAliasFrameVerts (int frame, aliashdr_t *paliashdr, entity_t *e)
return vo;
}
maliasskindesc_t *
static maliasskindesc_t *
R_AliasGetSkindesc (int skinnum, aliashdr_t *ahdr)
{
maliasskindesc_t *pskindesc;

View file

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

View file

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

View file

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

View file

@ -56,7 +56,7 @@ static const char rcsid[] =
#include "r_shared.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 alphaskytexture;
@ -109,7 +109,7 @@ R_LoadSkys (const char *skyname)
Con_Printf ("Unable to load skybox %s, using normal sky\n", skyname);
}
inline void
static inline void
R_SkyBoxPolyVec (vec5_t v)
{
// avoid interpolation seams
@ -165,7 +165,7 @@ vec5_t skyvec[6][4] = {
};
#undef ftc
void
static void
R_DrawSkyBox (void)
{
int i, j;
@ -186,7 +186,7 @@ R_DrawSkyBox (void)
vec3_t domescale;
void
static void
R_DrawSkyLayer (float s)
{
float x, y, a1x, a1y, a2x, a2y;
@ -230,7 +230,7 @@ R_DrawSkyLayer (float s)
}
}
void
static void
R_DrawSkyDome (void)
{
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)
{
int i;
@ -657,7 +657,7 @@ R_DrawSkyBoxPoly (const glpoly_t *poly)
render_box (&box);
}
void
static void
EmitSkyPolys (float speedscale, const msurface_t *fa)
{
float length, s, t;

View file

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

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