From efe8ddf151f88962d863e51eaadff847a7d9f7e6 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Mon, 23 Apr 2018 23:07:54 +0300 Subject: [PATCH] Fix missing const-qualifiers in engine code. Fix qboolean/int mixing in interface implementations(int is preferred). Replace long by int in COM_RandomLong. --- engine/client/cl_demo.c | 4 ++-- engine/client/cl_game.c | 2 +- engine/client/cl_main.c | 13 +++++------ engine/client/cl_pmove.c | 4 ++-- engine/client/cl_tent.h | 6 ++++-- engine/client/client.h | 2 +- engine/client/console.c | 16 +++++++------- engine/client/gl_frustum.c | 4 ++-- engine/client/gl_local.h | 2 +- engine/client/gl_rmain.c | 18 ++++++++-------- engine/client/gl_studio.c | 4 ++-- engine/client/in_touch.c | 2 +- engine/client/keys.c | 4 ++-- engine/common/cmd.c | 10 ++++----- engine/common/common.c | 6 +++--- engine/common/common.h | 32 +++++++++++++-------------- engine/common/con_utils.c | 2 +- engine/common/crclib.c | 2 +- engine/common/crtlib.h | 6 +++--- engine/common/custom.c | 6 +++--- engine/common/cvar.c | 4 ++-- engine/common/cvar.h | 2 +- engine/common/filesystem.c | 2 +- engine/common/infostring.c | 4 ++-- engine/common/mod_bmodel.c | 36 +++++++++++++++---------------- engine/common/net_chan.c | 4 ++-- engine/common/net_ws.c | 2 +- engine/common/netchan.h | 2 +- engine/common/soundlib/soundlib.h | 4 ++-- engine/common/sys_con.c | 6 +++--- engine/common/system.c | 2 +- engine/common/system.h | 2 +- engine/common/zone.c | 4 ++-- engine/server/server.h | 2 +- engine/server/sv_client.c | 9 ++++---- engine/server/sv_cmds.c | 18 ++++++++-------- engine/server/sv_custom.c | 4 ++-- engine/server/sv_game.c | 8 +++---- engine/server/sv_init.c | 2 +- engine/server/sv_log.c | 2 +- engine/server/sv_main.c | 3 ++- engine/server/sv_phys.c | 4 ++-- engine/server/sv_pmove.c | 6 +++--- engine/server/sv_save.c | 4 ++-- 44 files changed, 143 insertions(+), 138 deletions(-) diff --git a/engine/client/cl_demo.c b/engine/client/cl_demo.c index 04b7ec18..98b5e7cd 100644 --- a/engine/client/cl_demo.c +++ b/engine/client/cl_demo.c @@ -1014,7 +1014,7 @@ void CL_StopPlayback( void ) CL_GetDemoComment ================== */ -qboolean CL_GetDemoComment( const char *demoname, char *comment ) +int CL_GetDemoComment( const char *demoname, char *comment ) { file_t *demfile; demoheader_t demohdr; @@ -1461,4 +1461,4 @@ void CL_Stop_f( void ) { S_StopBackgroundTrack(); } -} \ No newline at end of file +} diff --git a/engine/client/cl_game.c b/engine/client/cl_game.c index b28a0ba2..fff6d7cb 100644 --- a/engine/client/cl_game.c +++ b/engine/client/cl_game.c @@ -3243,7 +3243,7 @@ TriCullFace ============= */ -void TriCullFace( int mode ) +void TriCullFace( TRICULLSTYLE mode ) { switch( mode ) { diff --git a/engine/client/cl_main.c b/engine/client/cl_main.c index 906246c7..778b1800 100644 --- a/engine/client/cl_main.c +++ b/engine/client/cl_main.c @@ -83,7 +83,7 @@ client_static_t cls; clgame_static_t clgame; //====================================================================== -qboolean CL_Active( void ) +int CL_Active( void ) { return ( cls.state == ca_active ); } @@ -878,7 +878,7 @@ CL_BeginUpload_f */ void CL_BeginUpload_f( void ) { - char *name; + const char *name; resource_t custResource; byte *buf = NULL; int size = 0; @@ -986,7 +986,7 @@ connect. void CL_SendConnectPacket( void ) { char protinfo[MAX_INFO_STRING]; - char *qport; + const char *qport; const char *key; netadr_t adr; @@ -1583,7 +1583,7 @@ void CL_ParseNETInfoMessage( netadr_t from, sizebuf_t *msg, const char *s ) static char infostring[MAX_INFO_STRING+8]; int i, context, type; int errorBits = 0; - char *val; + const char *val; context = Q_atoi( Cmd_Argv( 1 )); type = Q_atoi( Cmd_Argv( 2 )); @@ -1704,7 +1704,8 @@ Responses to broadcasts, etc void CL_ConnectionlessPacket( netadr_t from, sizebuf_t *msg ) { char *args; - char *c, buf[MAX_SYSPATH]; + const char *c; + char buf[MAX_SYSPATH]; int len = sizeof( buf ); int dataoffset = 0; netadr_t servadr; @@ -1870,7 +1871,7 @@ void CL_ConnectionlessPacket( netadr_t from, sizebuf_t *msg ) nr->pfnFunc( &nr->resp ); // throw the list, now it will be stored in user area - prev = &nr->resp.response; + prev = (net_adrlist_t**)&nr->resp.response; while( 1 ) { diff --git a/engine/client/cl_pmove.c b/engine/client/cl_pmove.c index f6ddde84..f564bf0e 100644 --- a/engine/client/cl_pmove.c +++ b/engine/client/cl_pmove.c @@ -992,7 +992,7 @@ void CL_InitClientMove( void ) clgame.pmove->RandomFloat = COM_RandomFloat; clgame.pmove->PM_GetModelType = pfnGetModelType; clgame.pmove->PM_GetModelBounds = pfnGetModelBounds; - clgame.pmove->PM_HullForBsp = pfnHullForBsp; + clgame.pmove->PM_HullForBsp = (void*)pfnHullForBsp; clgame.pmove->PM_TraceModel = pfnTraceModel; clgame.pmove->COM_FileSize = COM_FileSize; clgame.pmove->COM_LoadFile = COM_LoadFile; @@ -1407,4 +1407,4 @@ void CL_PredictMovement( qboolean repredicting ) VectorCopy( cl.simorg, cl.local.lastorigin ); cl.local.repredicting = false; -} \ No newline at end of file +} diff --git a/engine/client/cl_tent.h b/engine/client/cl_tent.h index b4c49835..6c991ec7 100644 --- a/engine/client/cl_tent.h +++ b/engine/client/cl_tent.h @@ -16,6 +16,8 @@ GNU General Public License for more details. #ifndef CL_TENT_H #define CL_TENT_H +#include "triangleapi.h" + // EfxAPI struct particle_s *R_AllocParticle( void (*callback)( struct particle_s*, float )); void R_Explosion( vec3_t pos, int model, float scale, float framerate, int flags ); @@ -111,10 +113,10 @@ int TriWorldToScreen( float *world, float *screen ); void TriColor4ub( byte r, byte g, byte b, byte a ); void TriBrightness( float brightness ); void TriRenderMode( int mode ); -void TriCullFace( int mode ); +void TriCullFace( TRICULLSTYLE mode ); void TriEnd( void ); extern model_t *cl_sprite_dot; extern model_t *cl_sprite_shell; -#endif//CL_TENT_H \ No newline at end of file +#endif//CL_TENT_H diff --git a/engine/client/client.h b/engine/client/client.h index 783dba36..10be20cf 100644 --- a/engine/client/client.h +++ b/engine/client/client.h @@ -988,7 +988,7 @@ void CL_RunLightStyles( void ); // console.c // extern convar_t *con_fontsize; -qboolean Con_Visible( void ); +int Con_Visible( void ); qboolean Con_FixedFont( void ); void Con_VidInit( void ); void Con_Shutdown( void ); diff --git a/engine/client/console.c b/engine/client/console.c index 78c0a81f..cb741ab1 100644 --- a/engine/client/console.c +++ b/engine/client/console.c @@ -130,8 +130,8 @@ typedef struct // console auto-complete string shortestMatch; field_t *completionField; // con.input or dedicated server fake field-line - char *completionString; - char *completionBuffer; + const char *completionString; + const char *completionBuffer; char *cmds[CON_MAXCMDS]; int matchCount; } console_t; @@ -537,7 +537,7 @@ void Con_Bottom( void ) Con_Visible ================ */ -qboolean Con_Visible( void ) +int Con_Visible( void ) { return (con.vislines > 0); } @@ -1245,7 +1245,7 @@ Con_NPrint Draw a single debug line with specified height ================ */ -void Con_NPrintf( int idx, char *fmt, ... ) +void Con_NPrintf( int idx, const char *fmt, ... ) { va_list args; @@ -1272,7 +1272,7 @@ Con_NXPrint Draw a single debug line with specified height, color and time to live ================ */ -void Con_NXPrintf( con_nprint_t *info, char *fmt, ... ) +void Con_NXPrintf( con_nprint_t *info, const char *fmt, ... ) { va_list args; @@ -1301,7 +1301,7 @@ UI_NPrint Draw a single debug line with specified height (menu version) ================ */ -void UI_NPrintf( int idx, char *fmt, ... ) +void UI_NPrintf( int idx, const char *fmt, ... ) { va_list args; @@ -1328,7 +1328,7 @@ UI_NXPrint Draw a single debug line with specified height, color and time to live (menu version) ================ */ -void UI_NXPrintf( con_nprint_t *info, char *fmt, ... ) +void UI_NXPrintf( con_nprint_t *info, const char *fmt, ... ) { va_list args; @@ -1419,7 +1419,7 @@ Con_ConcatRemaining */ static void Con_ConcatRemaining( const char *src, const char *start ) { - char *arg; + const char *arg; int i; arg = Q_strstr( src, start ); diff --git a/engine/client/gl_frustum.c b/engine/client/gl_frustum.c index c17432a5..aa1c0a5d 100644 --- a/engine/client/gl_frustum.c +++ b/engine/client/gl_frustum.c @@ -198,7 +198,7 @@ void GL_FrustumInitProjFromMatrix( gl_frustum_t *out, const matrix4x4 projection void GL_FrustumComputeCorners( gl_frustum_t *out, vec3_t corners[8] ) { - memset( corners, 0, sizeof( corners )); + memset( corners, 0, sizeof( vec3_t ) * 8 ); PlanesGetIntersectionPoint( &out->planes[FRUSTUM_LEFT], &out->planes[FRUSTUM_TOP], &out->planes[FRUSTUM_FAR], corners[0] ); PlanesGetIntersectionPoint( &out->planes[FRUSTUM_RIGHT], &out->planes[FRUSTUM_TOP], &out->planes[FRUSTUM_FAR], corners[1] ); @@ -352,4 +352,4 @@ qboolean GL_FrustumCullSphere( gl_frustum_t *out, const vec3_t center, float rad } return false; -} \ No newline at end of file +} diff --git a/engine/client/gl_local.h b/engine/client/gl_local.h index 16020102..757dac32 100644 --- a/engine/client/gl_local.h +++ b/engine/client/gl_local.h @@ -459,7 +459,7 @@ void R_DrawStretchPic( float x, float y, float w, float h, float s1, float t1, f qboolean R_SpeedsMessage( char *out, size_t size ); void R_SetupSky( const char *skyboxname ); qboolean R_CullBox( const vec3_t mins, const vec3_t maxs ); -qboolean R_WorldToScreen( const vec3_t point, vec3_t screen ); +int R_WorldToScreen( const vec3_t point, vec3_t screen ); void R_ScreenToWorld( const vec3_t screen, vec3_t point ); qboolean R_AddEntity( struct cl_entity_s *pRefEntity, int entityType ); void Mod_LoadMapSprite( struct model_s *mod, const void *buffer, size_t size, qboolean *loaded ); diff --git a/engine/client/gl_rmain.c b/engine/client/gl_rmain.c index a48a5e33..ac816760 100644 --- a/engine/client/gl_rmain.c +++ b/engine/client/gl_rmain.c @@ -136,7 +136,7 @@ Convert a given point from world into screen space Returns true if we behind to screen =============== */ -qboolean R_WorldToScreen( const vec3_t point, vec3_t screen ) +int R_WorldToScreen( const vec3_t point, vec3_t screen ) { matrix4x4 worldToScreen; qboolean behind; @@ -1275,7 +1275,7 @@ R_EnvShot ================= */ -static void R_EnvShot( const float *vieworg, const char *name, int skyshot, int shotsize ) +static void R_EnvShot( const float *vieworg, const char *name, qboolean skyshot, int shotsize ) { static vec3_t viewPoint; @@ -1469,13 +1469,13 @@ static render_api_t gRenderAPI = DrawSingleDecal, R_DecalSetupVerts, R_EntityRemoveDecals, - AVI_LoadVideoNoSound, - AVI_GetVideoInfo, - AVI_GetVideoFrameNumber, - AVI_GetVideoFrame, + (void*)AVI_LoadVideoNoSound, + (void*)AVI_GetVideoInfo, + (void*)AVI_GetVideoFrameNumber, + (void*)AVI_GetVideoFrame, R_UploadStretchRaw, - AVI_FreeVideo, - AVI_IsActive, + (void*)AVI_FreeVideo, + (void*)AVI_IsActive, NULL, NULL, NULL, @@ -1506,7 +1506,7 @@ static render_api_t gRenderAPI = pfnFileBufferCRC32, COM_CompareFileTime, Host_Error, - CL_ModelHandle, + (void*)CL_ModelHandle, pfnTime, Cvar_Set, S_FadeMusicVolume, diff --git a/engine/client/gl_studio.c b/engine/client/gl_studio.c index 9fb6151b..e9785109 100644 --- a/engine/client/gl_studio.c +++ b/engine/client/gl_studio.c @@ -3631,13 +3631,13 @@ static engine_studio_api_t gStudioAPI = R_StudioDrawHulls, R_StudioDrawAbsBBox, R_StudioDrawBones, - R_StudioSetupSkin, + (void*)R_StudioSetupSkin, R_StudioSetRemapColors, R_StudioSetupPlayerModel, R_StudioClientEvents, R_StudioGetForceFaceFlags, R_StudioSetForceFaceFlags, - R_StudioSetHeader, + (void*)R_StudioSetHeader, R_StudioSetRenderModel, R_StudioSetupRenderer, R_StudioRestoreRenderer, diff --git a/engine/client/in_touch.c b/engine/client/in_touch.c index fef5104c..29bc44c3 100644 --- a/engine/client/in_touch.c +++ b/engine/client/in_touch.c @@ -246,7 +246,7 @@ void IN_TouchWriteConfig( void ) void IN_TouchExportConfig_f( void ) { file_t *f; - char *name; + const char *name; if( Cmd_Argc() != 2 ) { diff --git a/engine/client/keys.c b/engine/client/keys.c index 0cdf5a08..f9b424e1 100644 --- a/engine/client/keys.c +++ b/engine/client/keys.c @@ -108,7 +108,7 @@ keyname_t keynames[] = Key_IsDown =================== */ -qboolean Key_IsDown( int keynum ) +int Key_IsDown( int keynum ) { if( keynum == -1 ) return false; @@ -516,7 +516,7 @@ Key_Event Called by the system for both key up and key down events =================== */ -void Key_Event( int key, qboolean down ) +void Key_Event( int key, int down ) { const char *kb; char cmd[1024]; diff --git a/engine/common/cmd.c b/engine/common/cmd.c index a3fe80ce..eee29541 100644 --- a/engine/common/cmd.c +++ b/engine/common/cmd.c @@ -338,7 +338,7 @@ void Cmd_Alias_f( void ) cmdalias_t *a; char cmd[MAX_CMD_LINE]; int i, c; - char *s; + const char *s; if( Cmd_Argc() == 1 ) { @@ -465,7 +465,7 @@ static cmd_t *cmd_functions; // possible commands to execute Cmd_Argc ============ */ -uint Cmd_Argc( void ) +int Cmd_Argc( void ) { return cmd_argc; } @@ -475,7 +475,7 @@ uint Cmd_Argc( void ) Cmd_Argv ============ */ -char *Cmd_Argv( int arg ) +const char *Cmd_Argv( int arg ) { if((uint)arg >= cmd_argc ) return ""; @@ -487,7 +487,7 @@ char *Cmd_Argv( int arg ) Cmd_Args ============ */ -char *Cmd_Args( void ) +const char *Cmd_Args( void ) { return cmd_args; } @@ -1091,7 +1091,7 @@ void Cmd_List_f( void ) { cmd_t *cmd; int i = 0; - char *match; + const char *match; if( Cmd_Argc() > 1 ) match = Cmd_Argv( 1 ); else match = NULL; diff --git a/engine/common/common.c b/engine/common/common.c index 1980087d..4e5795dd 100644 --- a/engine/common/common.c +++ b/engine/common/common.c @@ -121,7 +121,7 @@ float COM_RandomFloat( float flLow, float flHigh ) return (fl * (flHigh - flLow)) + flLow; // float in [low, high) } -long COM_RandomLong( long lLow, long lHigh ) +int COM_RandomLong( int lLow, int lHigh ) { dword maxAcceptable; dword n, x = lHigh - lLow + 1; @@ -1009,7 +1009,7 @@ byte* COM_LoadFileForMe( const char *filename, int *pLength ) { string name; byte *file, *pfile; - int iLength; + long iLength; if( !COM_CheckString( filename )) { @@ -1022,7 +1022,7 @@ byte* COM_LoadFileForMe( const char *filename, int *pLength ) COM_FixSlashes( name ); pfile = FS_LoadFile( name, &iLength, false ); - if( pLength ) *pLength = iLength; + if( pLength ) *pLength = (int)iLength; if( pfile ) { diff --git a/engine/common/common.h b/engine/common/common.h index 64f4d389..1f00383f 100644 --- a/engine/common/common.h +++ b/engine/common/common.h @@ -544,7 +544,7 @@ long FS_FileSize( const char *filename, qboolean gamedironly ); long FS_FileTime( const char *filename, qboolean gamedironly ); int FS_Print( file_t *file, const char *msg ); qboolean FS_Rename( const char *oldname, const char *newname ); -qboolean FS_FileExists( const char *filename, qboolean gamedironly ); +int FS_FileExists( const char *filename, int gamedironly ); qboolean FS_SysFileExists( const char *path, qboolean casesensitive ); qboolean FS_FileCopy( file_t *pOutput, file_t *pInput, int fileSize ); qboolean FS_Delete( const char *path ); @@ -822,7 +822,7 @@ void CL_Init( void ); void CL_Shutdown( void ); void Host_ClientBegin( void ); void Host_ClientFrame( void ); -qboolean CL_Active( void ); +int CL_Active( void ); void SV_Init( void ); void SV_Shutdown( const char *finalmsg ); @@ -859,9 +859,9 @@ void pfnGetGameDir( char *szGetGameDir ); int pfnDecalIndex( const char *m ); int pfnGetModelType( model_t *mod ); int pfnIsMapValid( char *filename ); -void Con_Reportf( char *szFmt, ... ) _format( 1 ); -void Con_DPrintf( char *fmt, ... ) _format( 1 ); -void Con_Printf( char *szFmt, ... ) _format( 1 ); +void Con_Reportf( const char *szFmt, ... ) _format( 1 ); +void Con_DPrintf( const char *fmt, ... ) _format( 1 ); +void Con_Printf( const char *szFmt, ... ) _format( 1 ); int pfnNumberOfEntities( void ); int pfnIsInGame( void ); float pfnTime( void ); @@ -935,9 +935,9 @@ void HPAK_FlushHostQueue( void ); // // keys.c // -qboolean Key_IsDown( int keynum ); +int Key_IsDown( int keynum ); const char *Key_IsBind( int keynum ); -void Key_Event( int key, qboolean down ); +void Key_Event( int key, int down ); void Key_Init( void ); void Key_WriteBindings( file_t *f ); const char *Key_GetBinding( int keynum ); @@ -968,7 +968,7 @@ qboolean CL_DisableVisibility( void ); int CL_PointContents( const vec3_t point ); char *COM_ParseFile( char *data, char *token ); byte *COM_LoadFile( const char *filename, int usehunk, int *pLength ); -qboolean CL_GetDemoComment( const char *demoname, char *comment ); +int CL_GetDemoComment( const char *demoname, char *comment ); void COM_AddAppDirectoryToSearchPath( const char *pszBaseDir, const char *appName ); int COM_ExpandFilename( const char *fileName, char *nameOutBuffer, int nameOutBufferSize ); struct cmd_s *Cmd_GetFirstFunctionHandle( void ); @@ -1008,7 +1008,7 @@ qboolean CL_IsBackgroundDemo( void ); qboolean CL_IsBackgroundMap( void ); qboolean SV_Initialized( void ); qboolean CL_LoadProgs( const char *name ); -qboolean SV_GetSaveComment( const char *savename, char *comment ); +int SV_GetSaveComment( const char *savename, char *comment ); qboolean SV_NewGame( const char *mapName, qboolean loadGame ); void SV_ClipPMoveToEntity( physent_t *pe, const vec3_t start, vec3_t mins, vec3_t maxs, const vec3_t end, struct pmtrace_s *tr ); void CL_ClipPMoveToEntity( physent_t *pe, const vec3_t start, vec3_t mins, vec3_t maxs, const vec3_t end, struct pmtrace_s *tr ); @@ -1037,11 +1037,11 @@ long SCR_GetAudioChunk( char *rawdata, long length ); wavdata_t *SCR_GetMovieInfo( void ); void SCR_Shutdown( void ); void Con_Print( const char *txt ); -void Con_NPrintf( int idx, char *fmt, ... ) _format( 2 ); -void Con_NXPrintf( con_nprint_t *info, char *fmt, ... ) _format( 2 ); -void UI_NPrintf( int idx, char *fmt, ... ) _format( 2 ); -void UI_NXPrintf( con_nprint_t *info, char *fmt, ... ) _format( 2 ); -char *Info_ValueForKey( const char *s, const char *key ); +void Con_NPrintf( int idx, const char *fmt, ... ) _format( 2 ); +void Con_NXPrintf( con_nprint_t *info, const char *fmt, ... ) _format( 2 ); +void UI_NPrintf( int idx, const char *fmt, ... ) _format( 2 ); +void UI_NXPrintf( con_nprint_t *info, const char *fmt, ... ) _format( 2 ); +const char *Info_ValueForKey( const char *s, const char *key ); void Info_RemovePrefixedKeys( char *start, char prefix ); qboolean Info_RemoveKey( char *s, const char *key ); qboolean Info_SetValueForKey( char *s, const char *key, const char *value, int maxsize ); @@ -1050,11 +1050,11 @@ qboolean Info_IsValid( const char *s ); void Info_WriteVars( file_t *f ); void Info_Print( const char *s ); void Cmd_WriteVariables( file_t *f ); -qboolean Cmd_CheckMapsList( qboolean fRefresh ); +int Cmd_CheckMapsList( int fRefresh ); qboolean Cmd_AutocompleteName( const char *source, char *buffer, size_t bufsize ); void Cmd_AutoComplete( char *complete_string ); void COM_SetRandomSeed( long lSeed ); -long COM_RandomLong( long lMin, long lMax ); +int COM_RandomLong( int lMin, int lMax ); float COM_RandomFloat( float fMin, float fMax ); qboolean LZSS_IsCompressed( const byte *source ); uint LZSS_GetActualSize( const byte *source ); diff --git a/engine/common/con_utils.c b/engine/common/con_utils.c index fde70227..bcd6479b 100644 --- a/engine/common/con_utils.c +++ b/engine/common/con_utils.c @@ -802,7 +802,7 @@ qboolean Cmd_CheckMapsList_R( qboolean fRefresh, qboolean onlyingamedir ) return false; } -qboolean Cmd_CheckMapsList( qboolean fRefresh ) +int Cmd_CheckMapsList( int fRefresh ) { return Cmd_CheckMapsList_R( fRefresh, true ); } diff --git a/engine/common/crclib.c b/engine/common/crclib.c index 165708bc..5f4cc802 100644 --- a/engine/common/crclib.c +++ b/engine/common/crclib.c @@ -601,4 +601,4 @@ uint COM_HashKey( const char *string, uint hashSize ) hashKey = (hashKey + i) * 37 + Q_tolower( string[i] ); return (hashKey % hashSize); -} \ No newline at end of file +} diff --git a/engine/common/crtlib.h b/engine/common/crtlib.h index 6f28b3b6..a3c1e262 100644 --- a/engine/common/crtlib.h +++ b/engine/common/crtlib.h @@ -48,9 +48,9 @@ void Cbuf_AddText( const char *text ); void Cbuf_InsertText( const char *text ); void Cbuf_ExecStuffCmds( void ); void Cbuf_Execute (void); -uint Cmd_Argc( void ); -char *Cmd_Args( void ); -char *Cmd_Argv( int arg ); +int Cmd_Argc( void ); +const char *Cmd_Args( void ); +const char *Cmd_Argv( int arg ); void Cmd_Init( void ); void Cmd_Unlink( int group ); void Cmd_AddCommand( const char *cmd_name, xcommand_t function, const char *cmd_desc ); diff --git a/engine/common/custom.c b/engine/common/custom.c index 4a51bf1f..651be8a1 100644 --- a/engine/common/custom.c +++ b/engine/common/custom.c @@ -63,7 +63,7 @@ void COM_ClearCustomizationList( customization_t *pHead, qboolean bCleanDecals ) qboolean COM_CreateCustomization( customization_t *pListHead, resource_t *pResource, int playernumber, int flags, customization_t **pOut, int *nLumps ) { qboolean bError = false; - int checksize = 0; + long checksize = 0; customization_t *pCust; if( pOut ) *pOut = NULL; @@ -85,7 +85,7 @@ qboolean COM_CreateCustomization( customization_t *pListHead, resource_t *pResou { pCust->pBuffer = FS_LoadFile( pResource->szFileName, &checksize, true ); - if( checksize != pCust->resource.nDownloadSize ) + if( (int)checksize != pCust->resource.nDownloadSize ) bError = true; } @@ -149,4 +149,4 @@ int COM_SizeofResourceList( resource_t *pList, resourceinfo_t *ri ) } return nSize; -} \ No newline at end of file +} diff --git a/engine/common/cvar.c b/engine/common/cvar.c index bd08225f..55932406 100644 --- a/engine/common/cvar.c +++ b/engine/common/cvar.c @@ -647,7 +647,7 @@ int Cvar_VariableInteger( const char *var_name ) Cvar_VariableString ============ */ -char *Cvar_VariableString( const char *var_name ) +const char *Cvar_VariableString( const char *var_name ) { convar_t *var; @@ -818,7 +818,7 @@ Cvar_List_f void Cvar_List_f( void ) { convar_t *var; - char *match = NULL; + const char *match = NULL; char *value; int count = 0; diff --git a/engine/common/cvar.h b/engine/common/cvar.h index 45015798..464a4dff 100644 --- a/engine/common/cvar.h +++ b/engine/common/cvar.h @@ -61,7 +61,7 @@ void Cvar_SetValue( const char *var_name, float value ); const char *Cvar_BuildAutoDescription( int flags ); float Cvar_VariableValue( const char *var_name ); int Cvar_VariableInteger( const char *var_name ); -char *Cvar_VariableString( const char *var_name ); +const char *Cvar_VariableString( const char *var_name ); void Cvar_WriteVariables( file_t *f, int group ); void Cvar_Reset( const char *var_name ); void Cvar_SetCheatState( void ); diff --git a/engine/common/filesystem.c b/engine/common/filesystem.c index 73bfab1b..81acf773 100644 --- a/engine/common/filesystem.c +++ b/engine/common/filesystem.c @@ -2415,7 +2415,7 @@ FS_FileExists Look for a file in the packages and in the filesystem ================== */ -qboolean FS_FileExists( const char *filename, qboolean gamedironly ) +int FS_FileExists( const char *filename, int gamedironly ) { if( FS_FindFile( filename, NULL, gamedironly )) return true; diff --git a/engine/common/infostring.c b/engine/common/infostring.c index 3e65072a..a7de6c46 100644 --- a/engine/common/infostring.c +++ b/engine/common/infostring.c @@ -188,7 +188,7 @@ Searches the string for the given key and returns the associated value, or an empty string. =============== */ -char *Info_ValueForKey( const char *s, const char *key ) +const char *Info_ValueForKey( const char *s, const char *key ) { char pkey[MAX_KV_SIZE]; static char value[4][MAX_KV_SIZE]; // use two buffers so compares work without stomping on each other @@ -499,4 +499,4 @@ qboolean Info_SetValueForKey( char *s, const char *key, const char *value, int m } return Info_SetValueForStarKey( s, key, value, maxsize ); -} \ No newline at end of file +} diff --git a/engine/common/mod_bmodel.c b/engine/common/mod_bmodel.c index 0074dcef..5589f8cd 100644 --- a/engine/common/mod_bmodel.c +++ b/engine/common/mod_bmodel.c @@ -181,28 +181,28 @@ static model_t *worldmodel; static mlumpstat_t worldstats[HEADER_LUMPS+EXTRA_LUMPS]; static mlumpinfo_t srclumps[HEADER_LUMPS] = { -{ LUMP_ENTITIES, 32, MAX_MAP_ENTSTRING, sizeof( byte ), -1, "entities", 0, (void **)&srcmodel.entdata, &srcmodel.entdatasize }, -{ LUMP_PLANES, 1, MAX_MAP_PLANES, sizeof( dplane_t ), -1, "planes", 0, (void **)&srcmodel.planes, &srcmodel.numplanes }, -{ LUMP_TEXTURES, 1, MAX_MAP_MIPTEX, sizeof( byte ), -1, "textures", 0, (void **)&srcmodel.textures, &srcmodel.texdatasize }, -{ LUMP_VERTEXES, 0, MAX_MAP_VERTS, sizeof( dvertex_t ), -1, "vertexes", 0, (void **)&srcmodel.vertexes, &srcmodel.numvertexes }, -{ LUMP_VISIBILITY, 0, MAX_MAP_VISIBILITY, sizeof( byte ), -1, "visibility", 0, (void **)&srcmodel.visdata, &srcmodel.visdatasize }, -{ LUMP_NODES, 1, MAX_MAP_NODES, sizeof( dnode_t ), sizeof( dnode32_t ), "nodes", CHECK_OVERFLOW, (void **)&srcmodel.nodes, &srcmodel.numnodes }, -{ LUMP_TEXINFO, 0, MAX_MAP_TEXINFO, sizeof( dtexinfo_t ), -1, "texinfo", CHECK_OVERFLOW, (void **)&srcmodel.texinfo, &srcmodel.numtexinfo }, -{ LUMP_FACES, 0, MAX_MAP_FACES, sizeof( dface_t ), sizeof( dface32_t ), "faces", CHECK_OVERFLOW, (void **)&srcmodel.surfaces, &srcmodel.numsurfaces }, -{ LUMP_LIGHTING, 0, MAX_MAP_LIGHTING, sizeof( byte ), -1, "lightmaps", 0, (void **)&srcmodel.lightdata, &srcmodel.lightdatasize }, -{ LUMP_CLIPNODES, 0, MAX_MAP_CLIPNODES, sizeof( dclipnode_t ), sizeof( dclipnode32_t ), "clipnodes", 0, (void **)&srcmodel.clipnodes, &srcmodel.numclipnodes }, -{ LUMP_LEAFS, 1, MAX_MAP_LEAFS, sizeof( dleaf_t ), sizeof( dleaf32_t ), "leafs", CHECK_OVERFLOW, (void **)&srcmodel.leafs, &srcmodel.numleafs }, -{ LUMP_MARKSURFACES, 0, MAX_MAP_MARKSURFACES, sizeof( dmarkface_t ), sizeof( dmarkface32_t ), "markfaces", 0, (void **)&srcmodel.markfaces, &srcmodel.nummarkfaces }, -{ LUMP_EDGES, 0, MAX_MAP_EDGES, sizeof( dedge_t ), sizeof( dedge32_t ), "edges", 0, (void **)&srcmodel.edges, &srcmodel.numedges }, -{ LUMP_SURFEDGES, 0, MAX_MAP_SURFEDGES, sizeof( dsurfedge_t ), -1, "surfedges", 0, (void **)&srcmodel.surfedges, &srcmodel.numsurfedges }, -{ LUMP_MODELS, 1, MAX_MAP_MODELS, sizeof( dmodel_t ), -1, "models", CHECK_OVERFLOW, (void **)&srcmodel.submodels, &srcmodel.numsubmodels }, +{ LUMP_ENTITIES, 32, MAX_MAP_ENTSTRING, sizeof( byte ), -1, "entities", 0, (const void **)&srcmodel.entdata, &srcmodel.entdatasize }, +{ LUMP_PLANES, 1, MAX_MAP_PLANES, sizeof( dplane_t ), -1, "planes", 0, (const void **)&srcmodel.planes, &srcmodel.numplanes }, +{ LUMP_TEXTURES, 1, MAX_MAP_MIPTEX, sizeof( byte ), -1, "textures", 0, (const void **)&srcmodel.textures, &srcmodel.texdatasize }, +{ LUMP_VERTEXES, 0, MAX_MAP_VERTS, sizeof( dvertex_t ), -1, "vertexes", 0, (const void **)&srcmodel.vertexes, &srcmodel.numvertexes }, +{ LUMP_VISIBILITY, 0, MAX_MAP_VISIBILITY, sizeof( byte ), -1, "visibility", 0, (const void **)&srcmodel.visdata, &srcmodel.visdatasize }, +{ LUMP_NODES, 1, MAX_MAP_NODES, sizeof( dnode_t ), sizeof( dnode32_t ), "nodes", CHECK_OVERFLOW, (const void **)&srcmodel.nodes, &srcmodel.numnodes }, +{ LUMP_TEXINFO, 0, MAX_MAP_TEXINFO, sizeof( dtexinfo_t ), -1, "texinfo", CHECK_OVERFLOW, (const void **)&srcmodel.texinfo, &srcmodel.numtexinfo }, +{ LUMP_FACES, 0, MAX_MAP_FACES, sizeof( dface_t ), sizeof( dface32_t ), "faces", CHECK_OVERFLOW, (const void **)&srcmodel.surfaces, &srcmodel.numsurfaces }, +{ LUMP_LIGHTING, 0, MAX_MAP_LIGHTING, sizeof( byte ), -1, "lightmaps", 0, (const void **)&srcmodel.lightdata, &srcmodel.lightdatasize }, +{ LUMP_CLIPNODES, 0, MAX_MAP_CLIPNODES, sizeof( dclipnode_t ), sizeof( dclipnode32_t ), "clipnodes", 0, (const void **)&srcmodel.clipnodes, &srcmodel.numclipnodes }, +{ LUMP_LEAFS, 1, MAX_MAP_LEAFS, sizeof( dleaf_t ), sizeof( dleaf32_t ), "leafs", CHECK_OVERFLOW, (const void **)&srcmodel.leafs, &srcmodel.numleafs }, +{ LUMP_MARKSURFACES, 0, MAX_MAP_MARKSURFACES, sizeof( dmarkface_t ), sizeof( dmarkface32_t ), "markfaces", 0, (const void **)&srcmodel.markfaces, &srcmodel.nummarkfaces }, +{ LUMP_EDGES, 0, MAX_MAP_EDGES, sizeof( dedge_t ), sizeof( dedge32_t ), "edges", 0, (const void **)&srcmodel.edges, &srcmodel.numedges }, +{ LUMP_SURFEDGES, 0, MAX_MAP_SURFEDGES, sizeof( dsurfedge_t ), -1, "surfedges", 0, (const void **)&srcmodel.surfedges, &srcmodel.numsurfedges }, +{ LUMP_MODELS, 1, MAX_MAP_MODELS, sizeof( dmodel_t ), -1, "models", CHECK_OVERFLOW, (const void **)&srcmodel.submodels, &srcmodel.numsubmodels }, }; static mlumpinfo_t extlumps[EXTRA_LUMPS] = { -{ LUMP_LIGHTVECS, 0, MAX_MAP_LIGHTING, sizeof( byte ), -1, "deluxmaps", USE_EXTRAHEADER, (void **)&srcmodel.deluxdata, &srcmodel.deluxdatasize }, -{ LUMP_FACEINFO, 0, MAX_MAP_FACEINFO, sizeof( dfaceinfo_t ), -1, "faceinfos", CHECK_OVERFLOW|USE_EXTRAHEADER, (void **)&srcmodel.faceinfo, &srcmodel.numfaceinfo }, -{ LUMP_SHADOWMAP, 0, MAX_MAP_LIGHTING / 3, sizeof( byte ), -1, "shadowmap", USE_EXTRAHEADER, (void **)&srcmodel.shadowdata, &srcmodel.shadowdatasize }, +{ LUMP_LIGHTVECS, 0, MAX_MAP_LIGHTING, sizeof( byte ), -1, "deluxmaps", USE_EXTRAHEADER, (const void **)&srcmodel.deluxdata, &srcmodel.deluxdatasize }, +{ LUMP_FACEINFO, 0, MAX_MAP_FACEINFO, sizeof( dfaceinfo_t ), -1, "faceinfos", CHECK_OVERFLOW|USE_EXTRAHEADER, (const void **)&srcmodel.faceinfo, &srcmodel.numfaceinfo }, +{ LUMP_SHADOWMAP, 0, MAX_MAP_LIGHTING / 3, sizeof( byte ), -1, "shadowmap", USE_EXTRAHEADER, (const void **)&srcmodel.shadowdata, &srcmodel.shadowdatasize }, }; /* diff --git a/engine/common/net_chan.c b/engine/common/net_chan.c index e4f1a075..d71f69c5 100644 --- a/engine/common/net_chan.c +++ b/engine/common/net_chan.c @@ -726,7 +726,7 @@ Netchan_CreateFileFragmentsFromBuffer ============================== */ -void Netchan_CreateFileFragmentsFromBuffer( netchan_t *chan, char *filename, byte *pbuf, int size ) +void Netchan_CreateFileFragmentsFromBuffer( netchan_t *chan, const char *filename, byte *pbuf, int size ) { int chunksize; int send, pos; @@ -1747,4 +1747,4 @@ qboolean Netchan_Process( netchan_t *chan, sizebuf_t *msg ) } return true; -} \ No newline at end of file +} diff --git a/engine/common/net_ws.c b/engine/common/net_ws.c index d862ac75..9802d885 100644 --- a/engine/common/net_ws.c +++ b/engine/common/net_ws.c @@ -1708,7 +1708,7 @@ void NET_GetLocalAddress( void ) { net_local.port = address.sin_port; Con_Printf( "Server IP address %s\n", NET_AdrToString( net_local )); - Cvar_FullSet( "net_address", va( NET_AdrToString( net_local )), FCVAR_READ_ONLY ); + Cvar_FullSet( "net_address", va( "%s", NET_AdrToString( net_local )), FCVAR_READ_ONLY ); } } else diff --git a/engine/common/netchan.h b/engine/common/netchan.h index 7c5c5b73..bc5384c3 100644 --- a/engine/common/netchan.h +++ b/engine/common/netchan.h @@ -214,7 +214,7 @@ extern int net_drop; void Netchan_Init( void ); void Netchan_Shutdown( void ); void Netchan_Setup( netsrc_t sock, netchan_t *chan, netadr_t adr, int qport, void *client, int (*pfnBlockSize)(void * ) ); -void Netchan_CreateFileFragmentsFromBuffer( netchan_t *chan, char *filename, byte *pbuf, int size ); +void Netchan_CreateFileFragmentsFromBuffer( netchan_t *chan, const char *filename, byte *pbuf, int size ); qboolean Netchan_CopyNormalFragments( netchan_t *chan, sizebuf_t *msg, size_t *length ); qboolean Netchan_CopyFileFragments( netchan_t *chan, sizebuf_t *msg ); void Netchan_CreateFragments( netchan_t *chan, sizebuf_t *msg ); diff --git a/engine/common/soundlib/soundlib.h b/engine/common/soundlib/soundlib.h index f345ef57..df384d22 100644 --- a/engine/common/soundlib/soundlib.h +++ b/engine/common/soundlib/soundlib.h @@ -77,7 +77,7 @@ typedef struct stream_s char temp[OUTBUF_SIZE]; // mpeg decoder stuff size_t pos; // actual track position (or actual buffer remains) int buffsize; // cached buffer size -}; +} stream_t; /* ======================================================================== @@ -134,4 +134,4 @@ long Stream_SetPosMPG( stream_t *stream, long newpos ); long Stream_GetPosMPG( stream_t *stream ); void Stream_FreeMPG( stream_t *stream ); -#endif//SOUNDLIB_H \ No newline at end of file +#endif//SOUNDLIB_H diff --git a/engine/common/sys_con.c b/engine/common/sys_con.c index 495ebd60..47824edd 100644 --- a/engine/common/sys_con.c +++ b/engine/common/sys_con.c @@ -237,7 +237,7 @@ Con_Printf ============= */ -void Con_Printf( char *szFmt, ... ) +void Con_Printf( const char *szFmt, ... ) { static char buffer[MAX_PRINT_MSG]; va_list args; @@ -258,7 +258,7 @@ Con_DPrintf ============= */ -void Con_DPrintf( char *szFmt, ... ) +void Con_DPrintf( const char *szFmt, ... ) { static char buffer[MAX_PRINT_MSG]; va_list args; @@ -282,7 +282,7 @@ Con_Reportf ============= */ -void Con_Reportf( char *szFmt, ... ) +void Con_Reportf( const char *szFmt, ... ) { static char buffer[MAX_PRINT_MSG]; va_list args; diff --git a/engine/common/system.c b/engine/common/system.c index b7f4a956..5b531070 100644 --- a/engine/common/system.c +++ b/engine/common/system.c @@ -287,7 +287,7 @@ static qboolean Sys_FindExecutable( const char *baseName, char *buf, size_t size Sys_ShellExecute ================= */ -void Sys_ShellExecute( const char *path, const char *parms, qboolean shouldExit ) +void Sys_ShellExecute( const char *path, const char *parms, int shouldExit ) { #ifdef _WIN32 if( !Q_strcmp( path, GENERIC_UPDATE_PAGE ) || !Q_strcmp( path, PLATFORM_UPDATE_PAGE )) diff --git a/engine/common/system.h b/engine/common/system.h index cfbb4dd4..1f941dad 100644 --- a/engine/common/system.h +++ b/engine/common/system.h @@ -95,7 +95,7 @@ void Sys_SetClipboardData( const byte *buffer, size_t size ); #define Sys_GetParmFromCmdLine( parm, out ) _Sys_GetParmFromCmdLine( parm, out, sizeof( out )) qboolean _Sys_GetParmFromCmdLine( const char *parm, char *out, size_t size ); qboolean Sys_GetIntFromCmdLine( const char *parm, int *out ); -void Sys_ShellExecute( const char *path, const char *parms, qboolean exit ); +void Sys_ShellExecute( const char *path, const char *parms, int exit ); void Sys_SendKeyEvents( void ); void Sys_Print( const char *pMsg ); void Sys_PrintLog( const char *pMsg ); diff --git a/engine/common/zone.c b/engine/common/zone.c index f1292d01..3608dd4c 100644 --- a/engine/common/zone.c +++ b/engine/common/zone.c @@ -166,7 +166,7 @@ static const char *Mem_CheckFilename( const char *filename ) if( !out ) return dummy; for( i = 0; i < 128; i++, out++ ) - if( out == '\0' ) break; // valid name + if( *out == '\0' ) break; // valid name if( i == 128 ) return dummy; return filename; } @@ -483,4 +483,4 @@ Memory_Init void Memory_Init( void ) { poolchain = NULL; // init mem chain -} \ No newline at end of file +} diff --git a/engine/server/server.h b/engine/server/server.h index 7af9fdd3..199228e6 100644 --- a/engine/server/server.h +++ b/engine/server/server.h @@ -599,7 +599,7 @@ void SV_PlaybackEventFull( int flags, const edict_t *pInvoker, word eventindex, float *angles, float fparam1, float fparam2, int iparam1, int iparam2, int bparam1, int bparam2 ); void SV_PlaybackReliableEvent( sizebuf_t *msg, word eventindex, float delay, event_args_t *args ); int SV_BuildSoundMsg( sizebuf_t *msg, edict_t *ent, int chan, const char *sample, int vol, float attn, int flags, int pitch, const vec3_t pos ); -qboolean SV_BoxInPVS( const vec3_t org, const vec3_t absmin, const vec3_t absmax ); +int SV_BoxInPVS( const vec3_t org, const vec3_t absmin, const vec3_t absmax ); void SV_WriteEntityPatch( const char *filename ); float SV_AngleMod( float ideal, float current, float speed ); void SV_SpawnEntities( const char *mapname ); diff --git a/engine/server/sv_client.c b/engine/server/sv_client.c index 31a313c2..63815ba5 100644 --- a/engine/server/sv_client.c +++ b/engine/server/sv_client.c @@ -241,7 +241,7 @@ void SV_ConnectClient( netadr_t from ) int qport, version; int i, count = 0; int challenge; - char *s; + const char *s; if( Cmd_Argc() < 5 ) { @@ -1562,7 +1562,7 @@ void SV_UserinfoChanged( sv_client_t *cl ) edict_t *ent = cl->edict; string name1, name2; sv_client_t *current; - char *val; + const char *val; if( !COM_CheckString( cl->userinfo )) return; @@ -1810,7 +1810,7 @@ SV_DownloadFile_f */ static qboolean SV_DownloadFile_f( sv_client_t *cl ) { - char *name; + const char *name; if( Cmd_Argc() < 2 ) return true; @@ -2077,7 +2077,8 @@ connectionless packets. void SV_ConnectionlessPacket( netadr_t from, sizebuf_t *msg ) { char *args; - char *pcmd, buf[MAX_SYSPATH]; + const char *pcmd; + char buf[MAX_SYSPATH]; int len = sizeof( buf ); MSG_Clear( msg ); diff --git a/engine/server/sv_cmds.c b/engine/server/sv_cmds.c index 8027f58b..dbb571ec 100644 --- a/engine/server/sv_cmds.c +++ b/engine/server/sv_cmds.c @@ -73,7 +73,7 @@ void SV_BroadcastPrintf( sv_client_t *ignore, char *fmt, ... ) } // echo to console - Con_DPrintf( string ); + Con_DPrintf( "%s", string ); } /* @@ -108,7 +108,7 @@ Sets sv_client and sv_player to the player with idnum Cmd_Argv(1) */ static sv_client_t *SV_SetPlayer( void ) { - char *s; + const char *s; sv_client_t *cl; int i, idnum; @@ -550,7 +550,8 @@ SV_ConSay_f */ void SV_ConSay_f( void ) { - char *p, text[MAX_SYSPATH]; + const char *p; + char text[MAX_SYSPATH]; if( Cmd_Argc() < 2 ) return; @@ -560,18 +561,17 @@ void SV_ConSay_f( void ) return; } - Q_snprintf( text, sizeof( text ), "%s: ", Cvar_VariableString( "hostname" )); p = Cmd_Args(); + Q_strncpy( text, *p == '"' ? p + 1 : p, MAX_SYSPATH ); if( *p == '"' ) { - p++; - p[Q_strlen(p) - 1] = 0; + text[Q_strlen(text) - 1] = 0; } - Q_strncat( text, p, MAX_SYSPATH ); + Log_Printf( "Server say: \"%s\"\n", text ); + Q_snprintf( text, sizeof( text ), "%s: %s", Cvar_VariableString( "hostname" ), p ); SV_BroadcastPrintf( NULL, "%s\n", text ); - Log_Printf( "Server say: \"%s\"\n", p ); } /* @@ -866,4 +866,4 @@ void SV_KillOperatorCommands( void ) { Cmd_RemoveCommand( "say" ); } -} \ No newline at end of file +} diff --git a/engine/server/sv_custom.c b/engine/server/sv_custom.c index e0fb73c3..4f0cd574 100644 --- a/engine/server/sv_custom.c +++ b/engine/server/sv_custom.c @@ -181,7 +181,7 @@ void SV_ParseConsistencyResponse( sv_client_t *cl, sizebuf_t *msg ) if( svgame.dllFuncs.pfnInconsistentFile( cl->edict, sv.resources[badresindex - 1].szFileName, dropmessage )) { if( COM_CheckString( dropmessage )) - SV_ClientPrintf( cl, dropmessage ); + SV_ClientPrintf( cl, "%s", dropmessage ); SV_DropClient( cl, false ); } } @@ -575,4 +575,4 @@ void SV_SendResources( sv_client_t *cl, sizebuf_t *msg ) } SV_SendConsistencyList( cl, msg ); -} \ No newline at end of file +} diff --git a/engine/server/sv_game.c b/engine/server/sv_game.c index b3a01916..9a736988 100644 --- a/engine/server/sv_game.c +++ b/engine/server/sv_game.c @@ -649,7 +649,7 @@ SV_BoxInPVS check brush boxes in fat pvs ============== */ -qboolean SV_BoxInPVS( const vec3_t org, const vec3_t absmin, const vec3_t absmax ) +int SV_BoxInPVS( const vec3_t org, const vec3_t absmin, const vec3_t absmax ) { if( !Mod_BoxVisible( absmin, absmax, Mod_GetPVSForPoint( org ))) return false; @@ -4379,12 +4379,12 @@ static enginefuncs_t gEngfuncs = pfnAnimationAutomove, pfnGetBonePosition, (void*)pfnFunctionFromName, - pfnNameForFunction, + (void*)pfnNameForFunction, pfnClientPrintf, pfnServerPrint, Cmd_Args, Cmd_Argv, - Cmd_Argc, + (void*)Cmd_Argc, pfnGetAttachment, CRC32_Init, CRC32_ProcessBuffer, @@ -4418,7 +4418,7 @@ static enginefuncs_t gEngfuncs = pfnIsDedicatedServer, pfnCVarGetPointer, pfnGetPlayerWONId, - Info_RemoveKey, + (void*)Info_RemoveKey, pfnGetPhysicsKeyValue, pfnSetPhysicsKeyValue, pfnGetPhysicsInfoString, diff --git a/engine/server/sv_init.c b/engine/server/sv_init.c index e09481d4..04c21752 100644 --- a/engine/server/sv_init.c +++ b/engine/server/sv_init.c @@ -565,7 +565,7 @@ void SV_ActivateServer( int runPhysics ) Con_Printf( "%i player server started\n", svs.maxclients ); else Con_Printf( "Game started\n" ); - Log_Printf( "Started map \"%s\" (CRC \"%lu\")\n", sv.name, sv.worldmapCRC ); + Log_Printf( "Started map \"%s\" (CRC \"%u\")\n", sv.name, sv.worldmapCRC ); // dedicated server purge unused resources here if( host.type == HOST_DEDICATED ) diff --git a/engine/server/sv_log.c b/engine/server/sv_log.c index 8c50e5a8..dac1610a 100644 --- a/engine/server/sv_log.c +++ b/engine/server/sv_log.c @@ -23,7 +23,7 @@ void Log_Open( void ) char szFileBase[ MAX_OSPATH ]; char szTestFile[ MAX_OSPATH ]; file_t *fp = NULL; - char *temp; + const char *temp; int i; if( !svs.log.active ) diff --git a/engine/server/sv_main.c b/engine/server/sv_main.c index e0e6e55b..94e03790 100644 --- a/engine/server/sv_main.c +++ b/engine/server/sv_main.c @@ -345,7 +345,8 @@ void SV_ReadPackets( void ) { if( !svs.initialized ) { - char *args, *c; + char *args; + const char *c; MSG_Clear( &net_message ); MSG_ReadLong( &net_message );// skip the -1 marker diff --git a/engine/server/sv_phys.c b/engine/server/sv_phys.c index 500c7483..00e39014 100644 --- a/engine/server/sv_phys.c +++ b/engine/server/sv_phys.c @@ -2002,7 +2002,7 @@ static server_physics_api_t gPhysicsAPI = SV_LinkEdict, SV_GetServerTime, SV_GetFrameTime, - SV_ModelHandle, + (void*)SV_ModelHandle, SV_GetHeadNode, SV_ServerState, Host_Error, @@ -2074,4 +2074,4 @@ qboolean SV_InitPhysicsAPI( void ) // physic interface is missed return true; -} \ No newline at end of file +} diff --git a/engine/server/sv_pmove.c b/engine/server/sv_pmove.c index 1f344188..de5c2914 100644 --- a/engine/server/sv_pmove.c +++ b/engine/server/sv_pmove.c @@ -336,7 +336,7 @@ void SV_AddLaddersToPmove( areanode_t *node, const vec3_t pmove_mins, const vec3 SV_AddLaddersToPmove( node->children[1], pmove_mins, pmove_maxs ); } -static void pfnParticle( float *origin, int color, float life, int zpos, int zvel ) +static void pfnParticle( const float *origin, int color, float life, int zpos, int zvel ) { int v; @@ -614,7 +614,7 @@ void SV_InitClientMove( void ) svgame.pmove->RandomFloat = COM_RandomFloat; svgame.pmove->PM_GetModelType = pfnGetModelType; svgame.pmove->PM_GetModelBounds = pfnGetModelBounds; - svgame.pmove->PM_HullForBsp = pfnHullForBsp; + svgame.pmove->PM_HullForBsp = (void*)pfnHullForBsp; svgame.pmove->PM_TraceModel = pfnTraceModel; svgame.pmove->COM_FileSize = COM_FileSize; svgame.pmove->COM_LoadFile = COM_LoadFile; @@ -1140,4 +1140,4 @@ void SV_RunCmd( sv_client_t *cl, usercmd_t *ucmd, int random_seed ) { SV_RestoreMoveInterpolant( cl ); } -} \ No newline at end of file +} diff --git a/engine/server/sv_save.c b/engine/server/sv_save.c index a3f00995..f7d1243e 100644 --- a/engine/server/sv_save.c +++ b/engine/server/sv_save.c @@ -2154,7 +2154,7 @@ SV_GetSaveComment check savegame for valid ================== */ -qboolean SV_GetSaveComment( const char *savename, char *comment ) +int SV_GetSaveComment( const char *savename, char *comment ) { int i, tag, size, nNumberOfFields, nFieldSize, tokenSize, tokenCount; char *pData, *pSaveData, *pFieldName, **pTokenList; @@ -2341,4 +2341,4 @@ qboolean SV_GetSaveComment( const char *savename, char *comment ) void SV_InitSaveRestore( void ) { pfnSaveGameComment = COM_GetProcAddress( svgame.hInstance, "SV_SaveGameComment" ); -} \ No newline at end of file +}