From 48d1aa5115c4ba7343f24c1c88330d453d562c6c Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Sat, 6 Oct 2018 03:34:01 +0300 Subject: [PATCH] engine: fix warnings --- common/net_api.h | 3 ++- engine/cdll_exp.h | 8 ++++++++ engine/client/cl_main.c | 2 +- engine/client/console.c | 3 ++- engine/client/gl_sprite.c | 4 ++-- engine/common/filesystem.c | 2 +- engine/common/masterlist.c | 2 +- engine/common/zone.c | 2 +- engine/eiface.h | 6 ++++++ engine/menu_int.h | 2 ++ 10 files changed, 26 insertions(+), 8 deletions(-) diff --git a/common/net_api.h b/common/net_api.h index 00831394..956b16ef 100644 --- a/common/net_api.h +++ b/common/net_api.h @@ -28,6 +28,7 @@ // kill the request hook after receiving the first response #define FNETAPI_MULTIPLE_RESPONSE ( 1<<0 ) +struct net_response_s; typedef void (*net_api_response_func_t) ( struct net_response_s *response ); #define NET_SUCCESS ( 0 ) @@ -94,4 +95,4 @@ typedef struct net_api_s void (*SetValueForKey)( char *s, const char *key, const char *value, int maxsize ); } net_api_t; -#endif//NET_APIH \ No newline at end of file +#endif//NET_APIH diff --git a/engine/cdll_exp.h b/engine/cdll_exp.h index 9d72df37..240d9c25 100644 --- a/engine/cdll_exp.h +++ b/engine/cdll_exp.h @@ -15,6 +15,14 @@ GNU General Public License for more details. #ifndef CDLL_EXP_H #define CDLL_EXP_H +struct tempent_s; +struct usercmd_s; +struct physent_s; +struct playermove_s; +struct mstudioevent_s; +struct engine_studio_api_s; +struct r_studio_interface_s; + // NOTE: ordering is important! typedef struct cldll_func_s { diff --git a/engine/client/cl_main.c b/engine/client/cl_main.c index a0e56d1c..f692285b 100644 --- a/engine/client/cl_main.c +++ b/engine/client/cl_main.c @@ -1839,7 +1839,7 @@ void CL_ConnectionlessPacket( netadr_t from, sizebuf_t *msg ) { // packet was sucessfully delivered, adjust the fragment size and get challenge - Con_DPrintf( "CRC %p is matched, get challenge, fragment size %d\n", crcValue, cls.max_fragment_size ); + Con_DPrintf( "CRC %x is matched, get challenge, fragment size %d\n", crcValue, cls.max_fragment_size ); Netchan_OutOfBandPrint( NS_CLIENT, from, "getchallenge\n" ); Cvar_SetValue( "cl_dlmax", cls.max_fragment_size ); cls.connect_time = host.realtime; diff --git a/engine/client/console.c b/engine/client/console.c index 87268412..9f431506 100644 --- a/engine/client/console.c +++ b/engine/client/console.c @@ -122,6 +122,7 @@ typedef struct static console_t con; +void Con_ClearField( field_t *edit ); void Field_CharEvent( field_t *edit, int ch ); /* @@ -1388,7 +1389,7 @@ EDIT FIELDS Con_ClearField ================ */ -void Con_ClearField(field_t *edit) +void Con_ClearField( field_t *edit ) { memset(edit->buffer, 0, MAX_STRING); edit->cursor = 0; diff --git a/engine/client/gl_sprite.c b/engine/client/gl_sprite.c index fdf09cfe..4792ff8a 100644 --- a/engine/client/gl_sprite.c +++ b/engine/client/gl_sprite.c @@ -243,7 +243,7 @@ void Mod_LoadSpriteModel( model_t *mod, const void *buffer, qboolean *loaded, ui // install palette switch( psprite->texFormat ) { - case SPR_INDEXALPHA: + case SPR_INDEXALPHA: pal = FS_LoadImage( "#gradient.pal", src, 768 ); break; case SPR_ALPHTEST: @@ -1092,4 +1092,4 @@ void R_DrawSpriteModel( cl_entity_t *e ) pglTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE ); pglEnable( GL_DEPTH_TEST ); } -} \ No newline at end of file +} diff --git a/engine/common/filesystem.c b/engine/common/filesystem.c index b9fbee00..5263c013 100644 --- a/engine/common/filesystem.c +++ b/engine/common/filesystem.c @@ -2500,7 +2500,7 @@ Filename are relative to the xash directory. Always appends a 0 byte. ============ */ -byte *FS_LoadDirectFile(const char *path, long *filesizeptr ) +byte *FS_LoadDirectFile( const char *path, long *filesizeptr ) { file_t *file; byte *buf = NULL; diff --git a/engine/common/masterlist.c b/engine/common/masterlist.c index dff68b04..f067824f 100644 --- a/engine/common/masterlist.c +++ b/engine/common/masterlist.c @@ -92,7 +92,7 @@ NET_AddMaster Add master to the list ======================== */ -static void NET_AddMaster( char *addr, qboolean save ) +static void NET_AddMaster( const char *addr, qboolean save ) { master_t *master, *last; diff --git a/engine/common/zone.c b/engine/common/zone.c index 1fa46dc6..015b3c9a 100644 --- a/engine/common/zone.c +++ b/engine/common/zone.c @@ -307,7 +307,7 @@ void Mem_PrintStats( void ) realsize += pool->realsize; } - Con_Printf( "^3%lu^7 memory pools, totalling: ^1%s\n", (dword)count, Q_memprint( size )); + Con_Printf( "^3%lu^7 memory pools, totalling: ^1%s\n", count, Q_memprint( size )); Con_Printf( "total allocated size: ^1%s\n", Q_memprint( realsize )); } diff --git a/engine/eiface.h b/engine/eiface.h index bd197786..c25093b6 100644 --- a/engine/eiface.h +++ b/engine/eiface.h @@ -393,6 +393,12 @@ typedef struct #undef ARRAYSIZE #define ARRAYSIZE(p) (sizeof(p)/sizeof(p[0])) +struct weapon_data_s; +struct playermove_s; +struct clientdata_s; +struct usercmd_s; +struct edict_s; + typedef struct { // Initialize/shutdown the game (one-time call after loading of game .dll ) diff --git a/engine/menu_int.h b/engine/menu_int.h index 2f7810d6..ab59bc48 100644 --- a/engine/menu_int.h +++ b/engine/menu_int.h @@ -47,6 +47,8 @@ typedef struct ui_globalvars_s char maptitle[64]; // title of active map } ui_globalvars_t; +struct ref_viewpass_s; + typedef struct ui_enginefuncs_s { // image handlers