From f9d8bc7ea04ff91fcbd90fe50a299b37724b349b Mon Sep 17 00:00:00 2001 From: havoc Date: Fri, 21 Oct 2005 06:08:25 +0000 Subject: [PATCH] gave names to nearly all structs and enums which should make for better C++ error messages, and fix any more of those anonymous struct errors git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@5750 d7cf8633-e32d-0410-b094-e92efae38249 --- bspfile.h | 26 ++++++++--------- cl_particles.c | 2 +- client.h | 18 ++++++------ clprogdefs.h | 4 +-- common.c | 2 +- cvar.h | 6 ++-- dpvsimpledecode.c | 4 +-- fs.c | 8 +++--- gl_backend.c | 2 +- gl_backend.h | 2 +- gl_textures.c | 4 +-- image.c | 4 +-- input.h | 2 +- keys.c | 6 ++-- keys.h | 8 ++++-- mathlib.h | 4 +-- menu.c | 10 +++---- model_alias.h | 14 +++++---- model_brush.c | 2 +- model_brush.h | 54 +++++++++++++++++------------------ model_shared.h | 6 ++-- modelgen.h | 72 +++++++++++++++++++++++++++++++---------------- mprogdefs.h | 6 ++-- netconn.h | 8 +++--- pr_comp.h | 38 ++++++++++++++----------- pr_edict.c | 14 --------- pr_exec.c | 2 +- progdefs.h | 6 ++-- protocol.c | 2 +- protocol.h | 8 +++--- qtypes.h | 2 +- r_light.c | 2 +- r_lightning.c | 6 +++- r_textures.h | 4 +-- sbar.c | 2 +- server.h | 6 ++-- snd_main.h | 8 +++--- snd_mix.c | 2 +- snd_wav.c | 2 +- snd_win.c | 2 +- spritegn.h | 18 ++++++------ sys.h | 2 +- ui.h | 2 +- vid.h | 2 +- wad.c | 2 +- wad.h | 6 ++-- 46 files changed, 218 insertions(+), 194 deletions(-) diff --git a/bspfile.h b/bspfile.h index c9697b36..0755c030 100644 --- a/bspfile.h +++ b/bspfile.h @@ -33,7 +33,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define BSPVERSION 29 #define MCBSPVERSION 2 -typedef struct +typedef struct lump_s { int fileofs, filelen; } lump_t; @@ -55,14 +55,14 @@ typedef struct #define LUMP_MODELS 14 #define HEADER_LUMPS 15 -typedef struct +typedef struct hullinfo_s { int numhulls; int filehulls; float hullsizes[MAX_MAP_HULLS][2][3]; } hullinfo_t; -typedef struct +typedef struct dmodel_s { float mins[3], maxs[3]; float origin[3]; @@ -71,13 +71,13 @@ typedef struct int firstface, numfaces; } dmodel_t; -typedef struct +typedef struct dheader_s { int version; lump_t lumps[HEADER_LUMPS]; } dheader_t; -typedef struct +typedef struct dmiptexlump_s { int nummiptex; int dataofs[4]; // [nummiptex] @@ -92,7 +92,7 @@ typedef struct miptex_s } miptex_t; -typedef struct +typedef struct dvertex_s { float point[3]; } dvertex_t; @@ -108,7 +108,7 @@ typedef struct #define PLANE_ANYY 4 #define PLANE_ANYZ 5 -typedef struct +typedef struct dplane_s { float normal[3]; float dist; @@ -218,7 +218,7 @@ typedef struct */ -typedef struct +typedef struct dnode_s { int planenum; short children[2]; // negative numbers are -(leafs+1), not nodes @@ -228,14 +228,14 @@ typedef struct unsigned short numfaces; // counting both sides } dnode_t; -typedef struct +typedef struct dclipnode_s { int planenum; short children[2]; // negative numbers are contents } dclipnode_t; -typedef struct +typedef struct texinfo_s { float vecs[2][4]; // [s/t][xyz offset] int miptex; @@ -245,13 +245,13 @@ typedef struct // note that edge 0 is never used, because negative edge nums are used for // counterclockwise use of the edge in a face -typedef struct +typedef struct dedge_s { unsigned short v[2]; // vertex numbers } dedge_t; #define MAXLIGHTMAPS 4 -typedef struct +typedef struct dface_s { // LordHavoc: changed from short to unsigned short for q2 support unsigned short planenum; @@ -277,7 +277,7 @@ typedef struct // leaf 0 is the generic CONTENTS_SOLID leaf, used for all solid areas // all other leafs need visibility info -typedef struct +typedef struct dleaf_s { int contents; int visofs; // -1 = no visibility info diff --git a/cl_particles.c b/cl_particles.c index 775df5e4..f4c0f752 100644 --- a/cl_particles.c +++ b/cl_particles.c @@ -1522,7 +1522,7 @@ void CL_MoveParticles (void) #define MAX_PARTICLETEXTURES 64 // particletexture_t is a rectangle in the particlefonttexture -typedef struct +typedef struct particletexture_s { rtexture_t *texture; float s1, t1, s2, t2; diff --git a/client.h b/client.h index 338f2ba6..3781bd3f 100644 --- a/client.h +++ b/client.h @@ -57,7 +57,7 @@ typedef struct effect_s } cl_effect_t; -typedef struct +typedef struct beam_s { int entity; // draw this as lightning polygons, or a model? @@ -332,7 +332,7 @@ typedef struct entity_s } entity_t; -typedef struct +typedef struct usercmd_s { vec3_t viewangles; @@ -356,20 +356,20 @@ typedef struct int sequence; } usercmd_t; -typedef struct +typedef struct lightstyle_s { int length; char map[MAX_STYLESTRING]; } lightstyle_t; -typedef struct +typedef struct scoreboard_s { char name[MAX_SCOREBOARDNAME]; int frags; int colors; // two 4 bit fields } scoreboard_t; -typedef struct +typedef struct cshift_s { int destcolor[3]; int percent; // 0-256 @@ -406,7 +406,7 @@ cactive_t; // the client_static_t structure is persistent through an arbitrary number // of server connections // -typedef struct +typedef struct client_static_s { cactive_t state; @@ -474,7 +474,7 @@ client_movementqueue_t; // the client_state_t structure is wiped completely at every // server signon // -typedef struct +typedef struct client_state_s { // true if playing in a local game and no one else is connected int islocalgame; @@ -735,7 +735,7 @@ extern cvar_t cl_beams_lightatend; // // cl_input // -typedef struct +typedef struct kbutton_s { int down[2]; // key nums holding it down int state; // low bit is down state @@ -865,7 +865,7 @@ void R_NewExplosion(vec3_t org); #include "cl_screen.h" -typedef struct +typedef struct refdef_s { // area to render in int x, y, width, height; diff --git a/clprogdefs.h b/clprogdefs.h index c84f2636..900831d3 100644 --- a/clprogdefs.h +++ b/clprogdefs.h @@ -1,11 +1,11 @@ /* file generated by qcc, do not modify */ -typedef struct +typedef struct cl_globalvars_s { int pad[28]; } cl_globalvars_t; -/*typedef struct +/*typedef struct cl_entvars_s { } cl_entvars_t;*/ diff --git a/common.c b/common.c index 334a31b1..c34ca93a 100644 --- a/common.c +++ b/common.c @@ -901,7 +901,7 @@ void COM_InitArgv (void) // Game mods -typedef struct +typedef struct gamemode_info_s { const char* prog_name; const char* cmdline; diff --git a/cvar.h b/cvar.h index b587e6b1..ef564156 100644 --- a/cvar.h +++ b/cvar.h @@ -8,7 +8,7 @@ of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. @@ -85,14 +85,14 @@ interface from being ambiguous. #define MAX_CVAROPTIONS 16 -typedef struct +typedef struct cvaroption_s { int value; const char *name; } cvaroption_t; -typedef struct +typedef struct menucvar_s { int type; float valuemin, valuemax, valuestep; diff --git a/dpvsimpledecode.c b/dpvsimpledecode.c index a8d537ef..6544ac7a 100644 --- a/dpvsimpledecode.c +++ b/dpvsimpledecode.c @@ -9,7 +9,7 @@ //#define HZREADBLOCKSIZE 16000 #define HZREADBLOCKSIZE 1048576 -typedef struct +typedef struct hz_bitstream_read_s { qfile_t *file; int endoffile; @@ -24,7 +24,7 @@ typedef struct hz_bitstream_readblock_s } hz_bitstream_readblock_t; -typedef struct +typedef struct hz_bitstream_readblocks_s { hz_bitstream_readblock_t *blocks; hz_bitstream_readblock_t *current; diff --git a/fs.c b/fs.c index 1a071c2c..67ffa9fd 100644 --- a/fs.c +++ b/fs.c @@ -172,7 +172,7 @@ struct qfile_s // You can get the complete ZIP format description from PKWARE website -typedef struct +typedef struct pk3_endOfCentralDir_s { unsigned int signature; unsigned short disknum; @@ -186,13 +186,13 @@ typedef struct // ------ PAK files on disk ------ // -typedef struct +typedef struct dpackfile_s { char name[56]; int filepos, filelen; } dpackfile_t; -typedef struct +typedef struct dpackheader_s { char id[4]; int dirofs; @@ -206,7 +206,7 @@ typedef struct // file compressed using the deflate algorithm #define PACKFILE_FLAG_DEFLATED (1 << 1) -typedef struct +typedef struct packfile_s { char name [MAX_QPATH]; int flags; diff --git a/gl_backend.c b/gl_backend.c index 61e606fe..57372862 100644 --- a/gl_backend.c +++ b/gl_backend.c @@ -407,7 +407,7 @@ typedef struct gltextureunit_s } gltextureunit_t; -static struct +static struct gl_state_s { int blendfunc1; int blendfunc2; diff --git a/gl_backend.h b/gl_backend.h index 73d317db..32ede019 100644 --- a/gl_backend.h +++ b/gl_backend.h @@ -35,7 +35,7 @@ extern cvar_t gl_paranoid; extern cvar_t gl_printcheckerror; //input to R_Mesh_State -typedef struct +typedef struct rmeshstate_s { // textures int tex1d[MAX_TEXTUREUNITS]; diff --git a/gl_textures.c b/gl_textures.c index 3d2c5b06..e8476796 100644 --- a/gl_textures.c +++ b/gl_textures.c @@ -27,7 +27,7 @@ static mempool_t *texturemempool; // size of images which hold fragment textures, ignores picmip and max_size static int block_size; -typedef struct +typedef struct textypeinfo_s { int textype; int inputbytesperpixel; @@ -288,7 +288,7 @@ void R_FreeTexturePool(rtexturepool_t **rtexturepool) } -typedef struct +typedef struct glmode_s { char *name; int minification, magnification; diff --git a/image.c b/image.c index 83032091..fd971ecc 100644 --- a/image.c +++ b/image.c @@ -159,7 +159,7 @@ void Image_Copy8bitRGBA(const qbyte *in, qbyte *out, int pixels, const unsigned ================================================================= */ -typedef struct +typedef struct pcx_s { char manufacturer; char version; @@ -582,7 +582,7 @@ static qbyte *LoadLMPRGBA (const qbyte *f, int matchwidth, int matchheight) } -typedef struct +typedef struct q2wal_s { char name[32]; unsigned width, height; diff --git a/input.h b/input.h index 58d256f9..05732964 100644 --- a/input.h +++ b/input.h @@ -28,7 +28,7 @@ extern cvar_t in_pitch_max; extern qboolean in_client_mouse; extern float in_mouse_x, in_mouse_y; -//enum {input_game,input_message,input_menu} input_dest; +//enum input_dest_e {input_game,input_message,input_menu} input_dest; void IN_Move (void); // add additional movement on top of the keyboard move cmd diff --git a/keys.c b/keys.c index b17c3f66..7a218b58 100644 --- a/keys.c +++ b/keys.c @@ -39,10 +39,12 @@ char *keybindings[MAX_BINDMAPS][MAX_KEYS]; static int key_bmap, key_bmap2; static qbyte keydown[MAX_KEYS]; // 0 = up, 1 = down, 2 = repeating -typedef struct { +typedef struct keyname_s +{ const char *name; int keynum; -} keyname_t; +} +keyname_t; static const keyname_t keynames[] = { {"TAB", K_TAB}, diff --git a/keys.h b/keys.h index eacbffac..70915a98 100644 --- a/keys.h +++ b/keys.h @@ -32,7 +32,8 @@ // // these are the key numbers that should be passed to Key_Event // -extern enum { +extern enum keynum_e +{ K_TAB = 9, K_ENTER = 13, K_ESCAPE = 27, @@ -181,9 +182,10 @@ extern enum { K_AUX31, K_AUX32, -} keynum_t; +} +keynum_t; -typedef enum { key_game, key_message, key_menu } keydest_t; +typedef enum keydest_e { key_game, key_message, key_menu } keydest_t; #define MAX_INPUTLINES 32 #define MAX_INPUTLINE 256 diff --git a/mathlib.h b/mathlib.h index 678f4e22..8c5f8243 100644 --- a/mathlib.h +++ b/mathlib.h @@ -208,13 +208,13 @@ void BoxPlaneCornerDistances_Separate(const vec3_t emins, const vec3_t emaxs, co #define PlaneDiff(point,plane) (((plane)->type < 3 ? (point)[(plane)->type] : DotProduct((point), (plane)->normal)) - (plane)->dist) // LordHavoc: minimal plane structure -typedef struct +typedef struct tinyplane_s { float normal[3], dist; } tinyplane_t; -typedef struct +typedef struct tinydoubleplane_s { double normal[3], dist; } diff --git a/menu.c b/menu.c index a49f2eb7..55e7b4f1 100644 --- a/menu.c +++ b/menu.c @@ -115,7 +115,7 @@ void M_Update_Return_Reason(char *s) // Nehahra #define NumberOfNehahraDemos 34 -typedef struct +typedef struct nehahrademonames_s { char *name; char *desc; @@ -3286,20 +3286,20 @@ void M_LanConfig_Key (int key, char ascii) //============================================================================= /* GAME OPTIONS MENU */ -typedef struct +typedef struct level_s { char *name; char *description; } level_t; -typedef struct +typedef struct episode_s { char *description; int firstLevel; int levels; } episode_t; -typedef struct +typedef struct gamelevels_s { char *gamename; level_t *levels; @@ -3677,7 +3677,7 @@ gamelevels_t battlemechgame = {"Battlemech", battlemechlevels, battlemechepisode gamelevels_t openquartzgame = {"OpenQuartz", openquartzlevels, openquartzepisodes, 3}; gamelevels_t defeatindetail2game = {"Defeat In Detail 2", defeatindetail2levels, defeatindetail2episodes, 1}; -typedef struct +typedef struct gameinfo_s { gamemode_t gameid; gamelevels_t *notregistered; diff --git a/model_alias.h b/model_alias.h index 73ad9344..9b769bda 100644 --- a/model_alias.h +++ b/model_alias.h @@ -32,7 +32,8 @@ Alias models are position independent, so the cache manager can move them. #include "modelgen.h" -typedef struct { +typedef struct daliashdr_s +{ int ident; int version; vec3_t scale; @@ -48,7 +49,8 @@ typedef struct { synctype_t synctype; int flags; float size; -} daliashdr_t; +} +daliashdr_t; /* ======================================================================== @@ -64,19 +66,19 @@ typedef struct { #define MD2ALIAS_VERSION 8 #define MD2_SKINNAME 64 -typedef struct +typedef struct md2stvert_s { short s; short t; } md2stvert_t; -typedef struct +typedef struct md2triangle_s { short index_xyz[3]; short index_st[3]; } md2triangle_t; -typedef struct +typedef struct md2frame_s { float scale[3]; // multiply byte verts by this float translate[3]; // then add this @@ -92,7 +94,7 @@ typedef struct // and an integer vertex index. -typedef struct +typedef struct md2_s { int ident; int version; diff --git a/model_brush.c b/model_brush.c index 3e57add4..0d3f10dc 100644 --- a/model_brush.c +++ b/model_brush.c @@ -429,7 +429,7 @@ int Mod_Q1BSP_NativeContentsFromSuperContents(model_t *model, int supercontents) return CONTENTS_EMPTY; } -typedef struct +typedef struct RecursiveHullCheckTraceInfo_s { // the hull we're tracing through const hull_t *hull; diff --git a/model_brush.h b/model_brush.h index f2de302c..7fe0a591 100644 --- a/model_brush.h +++ b/model_brush.h @@ -35,7 +35,7 @@ BRUSH MODELS // // in memory representation // -typedef struct +typedef struct mvertex_s { vec3_t position; } @@ -87,7 +87,7 @@ mplane_t; // probably used only on q1bsp water #define MATERIALFLAG_LIGHTBOTHSIDES 1024 -typedef struct +typedef struct medge_s { unsigned short v[2]; } @@ -140,7 +140,7 @@ typedef struct mleaf_s } mleaf_t; -typedef struct +typedef struct hull_s { dclipnode_t *clipnodes; mplane_t *planes; @@ -241,14 +241,14 @@ mlight_t; #define Q2LUMP_AREAPORTALS 18 #define Q2HEADER_LUMPS 19 -typedef struct +typedef struct q2dheader_s { int ident; int version; lump_t lumps[HEADER_LUMPS]; } q2dheader_t; -typedef struct +typedef struct q2dmodel_s { float mins[3], maxs[3]; float origin[3]; // for sounds or lights @@ -314,7 +314,7 @@ typedef struct -typedef struct +typedef struct q2dnode_s { int planenum; int children[2]; // negative numbers are -(leafs+1), not nodes @@ -325,7 +325,7 @@ typedef struct } q2dnode_t; -typedef struct +typedef struct q2texinfo_s { float vecs[2][4]; // [s/t][xyz offset] int flags; // miptex flags + overrides @@ -334,7 +334,7 @@ typedef struct int nexttexinfo; // for animations, -1 = end of chain } q2texinfo_t; -typedef struct +typedef struct q2dleaf_s { int contents; // OR of all brushes (not needed?) @@ -351,13 +351,13 @@ typedef struct unsigned short numleafbrushes; } q2dleaf_t; -typedef struct +typedef struct q2dbrushside_s { unsigned short planenum; // facing out of the leaf short texinfo; } q2dbrushside_t; -typedef struct +typedef struct q2dbrush_s { int firstside; int numsides; @@ -370,7 +370,7 @@ typedef struct // compressed bit vectors #define Q2DVIS_PVS 0 #define Q2DVIS_PHS 1 -typedef struct +typedef struct q2dvis_s { int numclusters; int bitofs[8][2]; // bitofs[numclusters][2] @@ -379,13 +379,13 @@ typedef struct // each area has a list of portals that lead into other areas // when portals are closed, other areas may not be visible or // hearable even if the vis info says that it should be -typedef struct +typedef struct q2dareaportal_s { int portalnum; int otherarea; } q2dareaportal_t; -typedef struct +typedef struct q2darea_s { int numareaportals; int firstareaportal; @@ -415,14 +415,14 @@ typedef struct #define Q3LUMP_PVS 16 // potentially visible set; bit[clusters][clusters] (used by rendering) #define Q3HEADER_LUMPS 17 -typedef struct +typedef struct q3dheader_s { int ident; int version; lump_t lumps[HEADER_LUMPS]; } q3dheader_t; -typedef struct +typedef struct q3dtexture_s { char name[Q3PATHLENGTH]; int surfaceflags; @@ -431,14 +431,14 @@ typedef struct q3dtexture_t; // note: planes are paired, the pair of planes with i and i ^ 1 are opposites. -typedef struct +typedef struct q3dplane_s { float normal[3]; float dist; } q3dplane_t; -typedef struct +typedef struct q3dnode_s { int planeindex; int childrenindex[2]; @@ -447,7 +447,7 @@ typedef struct } q3dnode_t; -typedef struct +typedef struct q3dleaf_s { int clusterindex; // pvs index int areaindex; // area index @@ -460,7 +460,7 @@ typedef struct } q3dleaf_t; -typedef struct +typedef struct q3dmodel_s { float mins[3]; float maxs[3]; @@ -471,7 +471,7 @@ typedef struct } q3dmodel_t; -typedef struct +typedef struct q3dbrush_s { int firstbrushside; int numbrushsides; @@ -479,14 +479,14 @@ typedef struct } q3dbrush_t; -typedef struct +typedef struct q3dbrushside_s { int planeindex; int textureindex; } q3dbrushside_t; -typedef struct +typedef struct q3dvertex_s { float origin3f[3]; float texcoord2f[2]; @@ -496,7 +496,7 @@ typedef struct } q3dvertex_t; -typedef struct +typedef struct q3dmeshvertex_s { int offset; // first vertex index of mesh } @@ -515,7 +515,7 @@ q3deffect_t; #define Q3FACETYPE_MESH 3 // common #define Q3FACETYPE_FLARE 4 // rare (is this ever used?) -typedef struct +typedef struct q3dface_s { int textureindex; int effectindex; // -1 if none @@ -586,13 +586,13 @@ typedef struct } q3dface_t; -typedef struct +typedef struct q3dlightmap_s { unsigned char rgb[128*128*3]; } q3dlightmap_t; -typedef struct +typedef struct q3dlightgrid_s { unsigned char ambientrgb[3]; unsigned char diffusergb[3]; @@ -601,7 +601,7 @@ typedef struct } q3dlightgrid_t; -typedef struct +typedef struct q3dpvs_s { int numclusters; int chainlength; diff --git a/model_shared.h b/model_shared.h index 3d76921e..c7e339bd 100644 --- a/model_shared.h +++ b/model_shared.h @@ -21,7 +21,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #ifndef MODEL_SHARED_H #define MODEL_SHARED_H -typedef enum {ST_SYNC=0, ST_RAND } synctype_t; +typedef enum synctype_e {ST_SYNC=0, ST_RAND } synctype_t; /* @@ -30,7 +30,7 @@ m*_t structures are in-memory */ -typedef enum {mod_invalid, mod_brushq1, mod_sprite, mod_alias, mod_brushq2, mod_brushq3} modtype_t; +typedef enum modtype_e {mod_invalid, mod_brushq1, mod_sprite, mod_alias, mod_brushq2, mod_brushq3} modtype_t; typedef struct animscene_s { @@ -223,7 +223,7 @@ typedef struct texture_s } texture_t; -typedef struct +typedef struct mtexinfo_s { float vecs[2][4]; texture_t *texture; diff --git a/modelgen.h b/modelgen.h index 7439c281..c399f5e4 100644 --- a/modelgen.h +++ b/modelgen.h @@ -8,7 +8,7 @@ of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. @@ -34,11 +34,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define ALIAS_ONSEAM 0x0020 -typedef enum { ALIAS_SINGLE=0, ALIAS_GROUP } aliasframetype_t; +typedef enum aliasframetype_e { ALIAS_SINGLE=0, ALIAS_GROUP } aliasframetype_t; -typedef enum { ALIAS_SKIN_SINGLE=0, ALIAS_SKIN_GROUP } aliasskintype_t; +typedef enum aliasskintype_e { ALIAS_SKIN_SINGLE=0, ALIAS_SKIN_GROUP } aliasskintype_t; -typedef struct { +typedef struct mdl_s +{ int ident; int version; vec3_t scale; @@ -54,62 +55,83 @@ typedef struct { synctype_t synctype; int flags; float size; -} mdl_t; +} +mdl_t; // TODO: could be shorts -typedef struct { +typedef struct stvert_s +{ int onseam; int s; int t; -} stvert_t; +} +stvert_t; -typedef struct dtriangle_s { +typedef struct dtriangle_s +{ int facesfront; int vertindex[3]; -} dtriangle_t; +} +dtriangle_t; #define DT_FACES_FRONT 0x0010 // This mirrors trivert_t in trilib.h, is present so Quake knows how to // load this data -typedef struct { +typedef struct trivertx_s +{ qbyte v[3]; qbyte lightnormalindex; -} trivertx_t; +} +trivertx_t; -typedef struct { +typedef struct daliasframe_s +{ trivertx_t bboxmin; // lightnormal isn't used trivertx_t bboxmax; // lightnormal isn't used char name[16]; // frame name from grabbing -} daliasframe_t; +} +daliasframe_t; -typedef struct { +typedef struct daliasgroup_s +{ int numframes; trivertx_t bboxmin; // lightnormal isn't used trivertx_t bboxmax; // lightnormal isn't used -} daliasgroup_t; +} +daliasgroup_t; -typedef struct { +typedef struct daliasskingroup_s +{ int numskins; -} daliasskingroup_t; +} +daliasskingroup_t; -typedef struct { +typedef struct daliasinterval_s +{ float interval; -} daliasinterval_t; +} +daliasinterval_t; -typedef struct { +typedef struct daliasskininterval_s +{ float interval; -} daliasskininterval_t; +} +daliasskininterval_t; -typedef struct { +typedef struct daliasframetype_s +{ aliasframetype_t type; -} daliasframetype_t; +} +daliasframetype_t; -typedef struct { +typedef struct daliasskintype_s +{ aliasskintype_t type; -} daliasskintype_t; +} +daliasskintype_t; #endif diff --git a/mprogdefs.h b/mprogdefs.h index 0c7435cf..3ca5093f 100644 --- a/mprogdefs.h +++ b/mprogdefs.h @@ -1,13 +1,13 @@ /* file generated by qcc, do not modify */ -typedef struct -{ +typedef struct m_globalvars_s +{ int pad[28]; int self; } m_globalvars_t; -/*typedef struct +/*typedef struct m_entvars_s { } m_entvars_t;*/ diff --git a/netconn.h b/netconn.h index e66b71d1..4c021544 100755 --- a/netconn.h +++ b/netconn.h @@ -155,7 +155,7 @@ extern int playercolor; #define SERVERLIST_ANDMASKCOUNT 5 #define SERVERLIST_ORMASKCOUNT 5 -typedef enum +typedef enum serverlist_maskop_e { // SLMO_CONTAINS is the default for strings // SLMO_GREATEREQUAL is the default for numbers (also used when OP == CONTAINS or NOTCONTAINS @@ -171,7 +171,7 @@ typedef enum } serverlist_maskop_t; // struct with all fields that you can search for or sort by -typedef struct +typedef struct serverlist_info_s { // address for connecting char cname[128]; @@ -215,7 +215,7 @@ typedef enum SQS_TIMEDOUT } serverlist_query_state; -typedef struct +typedef struct serverlist_entry_s { // used to determine whether this entry should be included into the final view serverlist_query_state query; @@ -231,7 +231,7 @@ typedef struct char line2[128]; } serverlist_entry_t; -typedef struct +typedef struct serverlist_mask_s { qboolean active; serverlist_maskop_t tests[SLIF_COUNT]; diff --git a/pr_comp.h b/pr_comp.h index 46fdc6b7..5fd9f048 100644 --- a/pr_comp.h +++ b/pr_comp.h @@ -8,7 +8,7 @@ of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. @@ -26,7 +26,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. typedef unsigned int func_t; typedef int string_t; -typedef enum {ev_void, ev_string, ev_float, ev_vector, ev_entity, ev_field, ev_function, ev_pointer} etype_t; +typedef enum etype_e {ev_void, ev_string, ev_float, ev_vector, ev_entity, ev_field, ev_function, ev_pointer} etype_t; #define OFS_NULL 0 @@ -42,7 +42,8 @@ typedef enum {ev_void, ev_string, ev_float, ev_vector, ev_entity, ev_field, ev_f #define RESERVED_OFS 28 -enum { +enum opcode_e +{ OP_DONE, OP_MUL_F, OP_MUL_V, @@ -53,19 +54,19 @@ enum { OP_ADD_V, OP_SUB_F, OP_SUB_V, - + OP_EQ_F, OP_EQ_V, OP_EQ_S, OP_EQ_E, OP_EQ_FNC, - + OP_NE_F, OP_NE_V, OP_NE_S, OP_NE_E, OP_NE_FNC, - + OP_LE, OP_GE, OP_LT, @@ -115,7 +116,7 @@ enum { OP_GOTO, OP_AND, OP_OR, - + OP_BITAND, OP_BITOR }; @@ -125,20 +126,22 @@ typedef struct statement_s { unsigned short op; signed short a,b,c; -} dstatement_t; +} +dstatement_t; -typedef struct +typedef struct ddef_s { unsigned short type; // if DEF_SAVEGLOBGAL bit is set // the variable needs to be saved in savegames unsigned short ofs; int s_name; -} ddef_t; +} +ddef_t; #define DEF_SAVEGLOBAL (1<<15) #define MAX_PARMS 8 -typedef struct +typedef struct dfunction_s { int first_statement; // negative numbers are builtins int parm_start; @@ -151,9 +154,10 @@ typedef struct int numparms; qbyte parm_size[MAX_PARMS]; -} dfunction_t; +} +dfunction_t; -typedef struct +typedef struct mfunction_s { int first_statement; // negative numbers are builtins int parm_start; @@ -168,11 +172,12 @@ typedef struct int numparms; qbyte parm_size[MAX_PARMS]; -} mfunction_t; +} +mfunction_t; #define PROG_VERSION 6 -typedef struct +typedef struct dprograms_s { int version; int crc; // check of header file @@ -196,7 +201,8 @@ typedef struct int numglobals; int entityfields; -} dprograms_t; +} +dprograms_t; #endif diff --git a/pr_edict.c b/pr_edict.c index 8d784193..1fe3079d 100644 --- a/pr_edict.c +++ b/pr_edict.c @@ -75,16 +75,6 @@ cvar_t pr_boundscheck = {0, "pr_boundscheck", "1"}; // LordHavoc: prints every opcode as it executes - warning: this is significant spew cvar_t pr_traceqc = {0, "pr_traceqc", "0"}; -#define MAX_FIELD_LEN 64 -#define GEFV_CACHESIZE 2 - -typedef struct { - ddef_t *pcache; - char field[MAX_FIELD_LEN]; -} gefv_cache; - -static gefv_cache gefvCache[GEFV_CACHESIZE] = {{NULL, ""}, {NULL, ""}}; - ddef_t *ED_FindField (const char *name); mfunction_t *PRVM_ED_FindFunction (const char *name); @@ -1291,10 +1281,6 @@ void PR_LoadProgs (const char *progsname) if (!progsname || !*progsname) Host_Error("PR_LoadProgs: passed empty progsname"); -// flush the non-C variable lookup cache - for (i=0 ; i