Browse Source

Fix missing const-qualifiers in engine code. Fix qboolean/int mixing in interface implementations(int is preferred). Replace long by int in COM_RandomLong.

pull/2/head
Alibek Omarov 6 years ago
parent
commit
efe8ddf151
  1. 4
      engine/client/cl_demo.c
  2. 2
      engine/client/cl_game.c
  3. 13
      engine/client/cl_main.c
  4. 4
      engine/client/cl_pmove.c
  5. 6
      engine/client/cl_tent.h
  6. 2
      engine/client/client.h
  7. 16
      engine/client/console.c
  8. 4
      engine/client/gl_frustum.c
  9. 2
      engine/client/gl_local.h
  10. 18
      engine/client/gl_rmain.c
  11. 4
      engine/client/gl_studio.c
  12. 2
      engine/client/in_touch.c
  13. 4
      engine/client/keys.c
  14. 10
      engine/common/cmd.c
  15. 6
      engine/common/common.c
  16. 32
      engine/common/common.h
  17. 2
      engine/common/con_utils.c
  18. 2
      engine/common/crclib.c
  19. 6
      engine/common/crtlib.h
  20. 6
      engine/common/custom.c
  21. 4
      engine/common/cvar.c
  22. 2
      engine/common/cvar.h
  23. 2
      engine/common/filesystem.c
  24. 4
      engine/common/infostring.c
  25. 36
      engine/common/mod_bmodel.c
  26. 4
      engine/common/net_chan.c
  27. 2
      engine/common/net_ws.c
  28. 2
      engine/common/netchan.h
  29. 4
      engine/common/soundlib/soundlib.h
  30. 6
      engine/common/sys_con.c
  31. 2
      engine/common/system.c
  32. 2
      engine/common/system.h
  33. 4
      engine/common/zone.c
  34. 2
      engine/server/server.h
  35. 9
      engine/server/sv_client.c
  36. 18
      engine/server/sv_cmds.c
  37. 4
      engine/server/sv_custom.c
  38. 8
      engine/server/sv_game.c
  39. 2
      engine/server/sv_init.c
  40. 2
      engine/server/sv_log.c
  41. 3
      engine/server/sv_main.c
  42. 4
      engine/server/sv_phys.c
  43. 6
      engine/server/sv_pmove.c
  44. 4
      engine/server/sv_save.c

4
engine/client/cl_demo.c

@ -1014,7 +1014,7 @@ void CL_StopPlayback( void )
CL_GetDemoComment CL_GetDemoComment
================== ==================
*/ */
qboolean CL_GetDemoComment( const char *demoname, char *comment ) int CL_GetDemoComment( const char *demoname, char *comment )
{ {
file_t *demfile; file_t *demfile;
demoheader_t demohdr; demoheader_t demohdr;
@ -1461,4 +1461,4 @@ void CL_Stop_f( void )
{ {
S_StopBackgroundTrack(); S_StopBackgroundTrack();
} }
} }

2
engine/client/cl_game.c

@ -3243,7 +3243,7 @@ TriCullFace
============= =============
*/ */
void TriCullFace( int mode ) void TriCullFace( TRICULLSTYLE mode )
{ {
switch( mode ) switch( mode )
{ {

13
engine/client/cl_main.c

@ -83,7 +83,7 @@ client_static_t cls;
clgame_static_t clgame; clgame_static_t clgame;
//====================================================================== //======================================================================
qboolean CL_Active( void ) int CL_Active( void )
{ {
return ( cls.state == ca_active ); return ( cls.state == ca_active );
} }
@ -878,7 +878,7 @@ CL_BeginUpload_f
*/ */
void CL_BeginUpload_f( void ) void CL_BeginUpload_f( void )
{ {
char *name; const char *name;
resource_t custResource; resource_t custResource;
byte *buf = NULL; byte *buf = NULL;
int size = 0; int size = 0;
@ -986,7 +986,7 @@ connect.
void CL_SendConnectPacket( void ) void CL_SendConnectPacket( void )
{ {
char protinfo[MAX_INFO_STRING]; char protinfo[MAX_INFO_STRING];
char *qport; const char *qport;
const char *key; const char *key;
netadr_t adr; 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]; static char infostring[MAX_INFO_STRING+8];
int i, context, type; int i, context, type;
int errorBits = 0; int errorBits = 0;
char *val; const char *val;
context = Q_atoi( Cmd_Argv( 1 )); context = Q_atoi( Cmd_Argv( 1 ));
type = Q_atoi( Cmd_Argv( 2 )); type = Q_atoi( Cmd_Argv( 2 ));
@ -1704,7 +1704,8 @@ Responses to broadcasts, etc
void CL_ConnectionlessPacket( netadr_t from, sizebuf_t *msg ) void CL_ConnectionlessPacket( netadr_t from, sizebuf_t *msg )
{ {
char *args; char *args;
char *c, buf[MAX_SYSPATH]; const char *c;
char buf[MAX_SYSPATH];
int len = sizeof( buf ); int len = sizeof( buf );
int dataoffset = 0; int dataoffset = 0;
netadr_t servadr; netadr_t servadr;
@ -1870,7 +1871,7 @@ void CL_ConnectionlessPacket( netadr_t from, sizebuf_t *msg )
nr->pfnFunc( &nr->resp ); nr->pfnFunc( &nr->resp );
// throw the list, now it will be stored in user area // throw the list, now it will be stored in user area
prev = &nr->resp.response; prev = (net_adrlist_t**)&nr->resp.response;
while( 1 ) while( 1 )
{ {

4
engine/client/cl_pmove.c

@ -992,7 +992,7 @@ void CL_InitClientMove( void )
clgame.pmove->RandomFloat = COM_RandomFloat; clgame.pmove->RandomFloat = COM_RandomFloat;
clgame.pmove->PM_GetModelType = pfnGetModelType; clgame.pmove->PM_GetModelType = pfnGetModelType;
clgame.pmove->PM_GetModelBounds = pfnGetModelBounds; clgame.pmove->PM_GetModelBounds = pfnGetModelBounds;
clgame.pmove->PM_HullForBsp = pfnHullForBsp; clgame.pmove->PM_HullForBsp = (void*)pfnHullForBsp;
clgame.pmove->PM_TraceModel = pfnTraceModel; clgame.pmove->PM_TraceModel = pfnTraceModel;
clgame.pmove->COM_FileSize = COM_FileSize; clgame.pmove->COM_FileSize = COM_FileSize;
clgame.pmove->COM_LoadFile = COM_LoadFile; clgame.pmove->COM_LoadFile = COM_LoadFile;
@ -1407,4 +1407,4 @@ void CL_PredictMovement( qboolean repredicting )
VectorCopy( cl.simorg, cl.local.lastorigin ); VectorCopy( cl.simorg, cl.local.lastorigin );
cl.local.repredicting = false; cl.local.repredicting = false;
} }

6
engine/client/cl_tent.h

@ -16,6 +16,8 @@ GNU General Public License for more details.
#ifndef CL_TENT_H #ifndef CL_TENT_H
#define CL_TENT_H #define CL_TENT_H
#include "triangleapi.h"
// EfxAPI // EfxAPI
struct particle_s *R_AllocParticle( void (*callback)( struct particle_s*, float )); 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 ); 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 TriColor4ub( byte r, byte g, byte b, byte a );
void TriBrightness( float brightness ); void TriBrightness( float brightness );
void TriRenderMode( int mode ); void TriRenderMode( int mode );
void TriCullFace( int mode ); void TriCullFace( TRICULLSTYLE mode );
void TriEnd( void ); void TriEnd( void );
extern model_t *cl_sprite_dot; extern model_t *cl_sprite_dot;
extern model_t *cl_sprite_shell; extern model_t *cl_sprite_shell;
#endif//CL_TENT_H #endif//CL_TENT_H

2
engine/client/client.h

@ -988,7 +988,7 @@ void CL_RunLightStyles( void );
// console.c // console.c
// //
extern convar_t *con_fontsize; extern convar_t *con_fontsize;
qboolean Con_Visible( void ); int Con_Visible( void );
qboolean Con_FixedFont( void ); qboolean Con_FixedFont( void );
void Con_VidInit( void ); void Con_VidInit( void );
void Con_Shutdown( void ); void Con_Shutdown( void );

16
engine/client/console.c

@ -130,8 +130,8 @@ typedef struct
// console auto-complete // console auto-complete
string shortestMatch; string shortestMatch;
field_t *completionField; // con.input or dedicated server fake field-line field_t *completionField; // con.input or dedicated server fake field-line
char *completionString; const char *completionString;
char *completionBuffer; const char *completionBuffer;
char *cmds[CON_MAXCMDS]; char *cmds[CON_MAXCMDS];
int matchCount; int matchCount;
} console_t; } console_t;
@ -537,7 +537,7 @@ void Con_Bottom( void )
Con_Visible Con_Visible
================ ================
*/ */
qboolean Con_Visible( void ) int Con_Visible( void )
{ {
return (con.vislines > 0); return (con.vislines > 0);
} }
@ -1245,7 +1245,7 @@ Con_NPrint
Draw a single debug line with specified height 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; va_list args;
@ -1272,7 +1272,7 @@ Con_NXPrint
Draw a single debug line with specified height, color and time to live 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; va_list args;
@ -1301,7 +1301,7 @@ UI_NPrint
Draw a single debug line with specified height (menu version) 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; va_list args;
@ -1328,7 +1328,7 @@ UI_NXPrint
Draw a single debug line with specified height, color and time to live (menu version) 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; va_list args;
@ -1419,7 +1419,7 @@ Con_ConcatRemaining
*/ */
static void Con_ConcatRemaining( const char *src, const char *start ) static void Con_ConcatRemaining( const char *src, const char *start )
{ {
char *arg; const char *arg;
int i; int i;
arg = Q_strstr( src, start ); arg = Q_strstr( src, start );

4
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] ) 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_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] ); 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; return false;
} }

2
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 ); qboolean R_SpeedsMessage( char *out, size_t size );
void R_SetupSky( const char *skyboxname ); void R_SetupSky( const char *skyboxname );
qboolean R_CullBox( const vec3_t mins, const vec3_t maxs ); 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 ); void R_ScreenToWorld( const vec3_t screen, vec3_t point );
qboolean R_AddEntity( struct cl_entity_s *pRefEntity, int entityType ); 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 ); void Mod_LoadMapSprite( struct model_s *mod, const void *buffer, size_t size, qboolean *loaded );

18
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 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; matrix4x4 worldToScreen;
qboolean behind; 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; static vec3_t viewPoint;
@ -1469,13 +1469,13 @@ static render_api_t gRenderAPI =
DrawSingleDecal, DrawSingleDecal,
R_DecalSetupVerts, R_DecalSetupVerts,
R_EntityRemoveDecals, R_EntityRemoveDecals,
AVI_LoadVideoNoSound, (void*)AVI_LoadVideoNoSound,
AVI_GetVideoInfo, (void*)AVI_GetVideoInfo,
AVI_GetVideoFrameNumber, (void*)AVI_GetVideoFrameNumber,
AVI_GetVideoFrame, (void*)AVI_GetVideoFrame,
R_UploadStretchRaw, R_UploadStretchRaw,
AVI_FreeVideo, (void*)AVI_FreeVideo,
AVI_IsActive, (void*)AVI_IsActive,
NULL, NULL,
NULL, NULL,
NULL, NULL,
@ -1506,7 +1506,7 @@ static render_api_t gRenderAPI =
pfnFileBufferCRC32, pfnFileBufferCRC32,
COM_CompareFileTime, COM_CompareFileTime,
Host_Error, Host_Error,
CL_ModelHandle, (void*)CL_ModelHandle,
pfnTime, pfnTime,
Cvar_Set, Cvar_Set,
S_FadeMusicVolume, S_FadeMusicVolume,

4
engine/client/gl_studio.c

@ -3631,13 +3631,13 @@ static engine_studio_api_t gStudioAPI =
R_StudioDrawHulls, R_StudioDrawHulls,
R_StudioDrawAbsBBox, R_StudioDrawAbsBBox,
R_StudioDrawBones, R_StudioDrawBones,
R_StudioSetupSkin, (void*)R_StudioSetupSkin,
R_StudioSetRemapColors, R_StudioSetRemapColors,
R_StudioSetupPlayerModel, R_StudioSetupPlayerModel,
R_StudioClientEvents, R_StudioClientEvents,
R_StudioGetForceFaceFlags, R_StudioGetForceFaceFlags,
R_StudioSetForceFaceFlags, R_StudioSetForceFaceFlags,
R_StudioSetHeader, (void*)R_StudioSetHeader,
R_StudioSetRenderModel, R_StudioSetRenderModel,
R_StudioSetupRenderer, R_StudioSetupRenderer,
R_StudioRestoreRenderer, R_StudioRestoreRenderer,

2
engine/client/in_touch.c

@ -246,7 +246,7 @@ void IN_TouchWriteConfig( void )
void IN_TouchExportConfig_f( void ) void IN_TouchExportConfig_f( void )
{ {
file_t *f; file_t *f;
char *name; const char *name;
if( Cmd_Argc() != 2 ) if( Cmd_Argc() != 2 )
{ {

4
engine/client/keys.c

@ -108,7 +108,7 @@ keyname_t keynames[] =
Key_IsDown Key_IsDown
=================== ===================
*/ */
qboolean Key_IsDown( int keynum ) int Key_IsDown( int keynum )
{ {
if( keynum == -1 ) if( keynum == -1 )
return false; return false;
@ -516,7 +516,7 @@ Key_Event
Called by the system for both key up and key down events 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; const char *kb;
char cmd[1024]; char cmd[1024];

10
engine/common/cmd.c

@ -338,7 +338,7 @@ void Cmd_Alias_f( void )
cmdalias_t *a; cmdalias_t *a;
char cmd[MAX_CMD_LINE]; char cmd[MAX_CMD_LINE];
int i, c; int i, c;
char *s; const char *s;
if( Cmd_Argc() == 1 ) if( Cmd_Argc() == 1 )
{ {
@ -465,7 +465,7 @@ static cmd_t *cmd_functions; // possible commands to execute
Cmd_Argc Cmd_Argc
============ ============
*/ */
uint Cmd_Argc( void ) int Cmd_Argc( void )
{ {
return cmd_argc; return cmd_argc;
} }
@ -475,7 +475,7 @@ uint Cmd_Argc( void )
Cmd_Argv Cmd_Argv
============ ============
*/ */
char *Cmd_Argv( int arg ) const char *Cmd_Argv( int arg )
{ {
if((uint)arg >= cmd_argc ) if((uint)arg >= cmd_argc )
return ""; return "";
@ -487,7 +487,7 @@ char *Cmd_Argv( int arg )
Cmd_Args Cmd_Args
============ ============
*/ */
char *Cmd_Args( void ) const char *Cmd_Args( void )
{ {
return cmd_args; return cmd_args;
} }
@ -1091,7 +1091,7 @@ void Cmd_List_f( void )
{ {
cmd_t *cmd; cmd_t *cmd;
int i = 0; int i = 0;
char *match; const char *match;
if( Cmd_Argc() > 1 ) match = Cmd_Argv( 1 ); if( Cmd_Argc() > 1 ) match = Cmd_Argv( 1 );
else match = NULL; else match = NULL;

6
engine/common/common.c

@ -121,7 +121,7 @@ float COM_RandomFloat( float flLow, float flHigh )
return (fl * (flHigh - flLow)) + flLow; // float in [low, high) 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 maxAcceptable;
dword n, x = lHigh - lLow + 1; dword n, x = lHigh - lLow + 1;
@ -1009,7 +1009,7 @@ byte* COM_LoadFileForMe( const char *filename, int *pLength )
{ {
string name; string name;
byte *file, *pfile; byte *file, *pfile;
int iLength; long iLength;
if( !COM_CheckString( filename )) if( !COM_CheckString( filename ))
{ {
@ -1022,7 +1022,7 @@ byte* COM_LoadFileForMe( const char *filename, int *pLength )
COM_FixSlashes( name ); COM_FixSlashes( name );
pfile = FS_LoadFile( name, &iLength, false ); pfile = FS_LoadFile( name, &iLength, false );
if( pLength ) *pLength = iLength; if( pLength ) *pLength = (int)iLength;
if( pfile ) if( pfile )
{ {

32
engine/common/common.h

@ -544,7 +544,7 @@ long FS_FileSize( const char *filename, qboolean gamedironly );
long FS_FileTime( const char *filename, qboolean gamedironly ); long FS_FileTime( const char *filename, qboolean gamedironly );
int FS_Print( file_t *file, const char *msg ); int FS_Print( file_t *file, const char *msg );
qboolean FS_Rename( const char *oldname, const char *newname ); 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_SysFileExists( const char *path, qboolean casesensitive );
qboolean FS_FileCopy( file_t *pOutput, file_t *pInput, int fileSize ); qboolean FS_FileCopy( file_t *pOutput, file_t *pInput, int fileSize );
qboolean FS_Delete( const char *path ); qboolean FS_Delete( const char *path );
@ -822,7 +822,7 @@ void CL_Init( void );
void CL_Shutdown( void ); void CL_Shutdown( void );
void Host_ClientBegin( void ); void Host_ClientBegin( void );
void Host_ClientFrame( void ); void Host_ClientFrame( void );
qboolean CL_Active( void ); int CL_Active( void );
void SV_Init( void ); void SV_Init( void );
void SV_Shutdown( const char *finalmsg ); void SV_Shutdown( const char *finalmsg );
@ -859,9 +859,9 @@ void pfnGetGameDir( char *szGetGameDir );
int pfnDecalIndex( const char *m ); int pfnDecalIndex( const char *m );
int pfnGetModelType( model_t *mod ); int pfnGetModelType( model_t *mod );
int pfnIsMapValid( char *filename ); int pfnIsMapValid( char *filename );
void Con_Reportf( char *szFmt, ... ) _format( 1 ); void Con_Reportf( const char *szFmt, ... ) _format( 1 );
void Con_DPrintf( char *fmt, ... ) _format( 1 ); void Con_DPrintf( const char *fmt, ... ) _format( 1 );
void Con_Printf( char *szFmt, ... ) _format( 1 ); void Con_Printf( const char *szFmt, ... ) _format( 1 );
int pfnNumberOfEntities( void ); int pfnNumberOfEntities( void );
int pfnIsInGame( void ); int pfnIsInGame( void );
float pfnTime( void ); float pfnTime( void );
@ -935,9 +935,9 @@ void HPAK_FlushHostQueue( void );
// //
// keys.c // keys.c
// //
qboolean Key_IsDown( int keynum ); int Key_IsDown( int keynum );
const char *Key_IsBind( 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_Init( void );
void Key_WriteBindings( file_t *f ); void Key_WriteBindings( file_t *f );
const char *Key_GetBinding( int keynum ); const char *Key_GetBinding( int keynum );
@ -968,7 +968,7 @@ qboolean CL_DisableVisibility( void );
int CL_PointContents( const vec3_t point ); int CL_PointContents( const vec3_t point );
char *COM_ParseFile( char *data, char *token ); char *COM_ParseFile( char *data, char *token );
byte *COM_LoadFile( const char *filename, int usehunk, int *pLength ); 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 ); void COM_AddAppDirectoryToSearchPath( const char *pszBaseDir, const char *appName );
int COM_ExpandFilename( const char *fileName, char *nameOutBuffer, int nameOutBufferSize ); int COM_ExpandFilename( const char *fileName, char *nameOutBuffer, int nameOutBufferSize );
struct cmd_s *Cmd_GetFirstFunctionHandle( void ); struct cmd_s *Cmd_GetFirstFunctionHandle( void );
@ -1008,7 +1008,7 @@ qboolean CL_IsBackgroundDemo( void );
qboolean CL_IsBackgroundMap( void ); qboolean CL_IsBackgroundMap( void );
qboolean SV_Initialized( void ); qboolean SV_Initialized( void );
qboolean CL_LoadProgs( const char *name ); 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 ); 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 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 ); 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 ); wavdata_t *SCR_GetMovieInfo( void );
void SCR_Shutdown( void ); void SCR_Shutdown( void );
void Con_Print( const char *txt ); void Con_Print( const char *txt );
void Con_NPrintf( int idx, char *fmt, ... ) _format( 2 ); void Con_NPrintf( int idx, const char *fmt, ... ) _format( 2 );
void Con_NXPrintf( con_nprint_t *info, char *fmt, ... ) _format( 2 ); void Con_NXPrintf( con_nprint_t *info, const char *fmt, ... ) _format( 2 );
void UI_NPrintf( int idx, char *fmt, ... ) _format( 2 ); void UI_NPrintf( int idx, const char *fmt, ... ) _format( 2 );
void UI_NXPrintf( con_nprint_t *info, char *fmt, ... ) _format( 2 ); void UI_NXPrintf( con_nprint_t *info, const char *fmt, ... ) _format( 2 );
char *Info_ValueForKey( const char *s, const char *key ); const char *Info_ValueForKey( const char *s, const char *key );
void Info_RemovePrefixedKeys( char *start, char prefix ); void Info_RemovePrefixedKeys( char *start, char prefix );
qboolean Info_RemoveKey( char *s, const char *key ); qboolean Info_RemoveKey( char *s, const char *key );
qboolean Info_SetValueForKey( char *s, const char *key, const char *value, int maxsize ); 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_WriteVars( file_t *f );
void Info_Print( const char *s ); void Info_Print( const char *s );
void Cmd_WriteVariables( file_t *f ); 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 ); qboolean Cmd_AutocompleteName( const char *source, char *buffer, size_t bufsize );
void Cmd_AutoComplete( char *complete_string ); void Cmd_AutoComplete( char *complete_string );
void COM_SetRandomSeed( long lSeed ); 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 ); float COM_RandomFloat( float fMin, float fMax );
qboolean LZSS_IsCompressed( const byte *source ); qboolean LZSS_IsCompressed( const byte *source );
uint LZSS_GetActualSize( const byte *source ); uint LZSS_GetActualSize( const byte *source );

2
engine/common/con_utils.c

@ -802,7 +802,7 @@ qboolean Cmd_CheckMapsList_R( qboolean fRefresh, qboolean onlyingamedir )
return false; return false;
} }
qboolean Cmd_CheckMapsList( qboolean fRefresh ) int Cmd_CheckMapsList( int fRefresh )
{ {
return Cmd_CheckMapsList_R( fRefresh, true ); return Cmd_CheckMapsList_R( fRefresh, true );
} }

2
engine/common/crclib.c

@ -601,4 +601,4 @@ uint COM_HashKey( const char *string, uint hashSize )
hashKey = (hashKey + i) * 37 + Q_tolower( string[i] ); hashKey = (hashKey + i) * 37 + Q_tolower( string[i] );
return (hashKey % hashSize); return (hashKey % hashSize);
} }

6
engine/common/crtlib.h

@ -48,9 +48,9 @@ void Cbuf_AddText( const char *text );
void Cbuf_InsertText( const char *text ); void Cbuf_InsertText( const char *text );
void Cbuf_ExecStuffCmds( void ); void Cbuf_ExecStuffCmds( void );
void Cbuf_Execute (void); void Cbuf_Execute (void);
uint Cmd_Argc( void ); int Cmd_Argc( void );
char *Cmd_Args( void ); const char *Cmd_Args( void );
char *Cmd_Argv( int arg ); const char *Cmd_Argv( int arg );
void Cmd_Init( void ); void Cmd_Init( void );
void Cmd_Unlink( int group ); void Cmd_Unlink( int group );
void Cmd_AddCommand( const char *cmd_name, xcommand_t function, const char *cmd_desc ); void Cmd_AddCommand( const char *cmd_name, xcommand_t function, const char *cmd_desc );

6
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 COM_CreateCustomization( customization_t *pListHead, resource_t *pResource, int playernumber, int flags, customization_t **pOut, int *nLumps )
{ {
qboolean bError = false; qboolean bError = false;
int checksize = 0; long checksize = 0;
customization_t *pCust; customization_t *pCust;
if( pOut ) *pOut = NULL; 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 ); pCust->pBuffer = FS_LoadFile( pResource->szFileName, &checksize, true );
if( checksize != pCust->resource.nDownloadSize ) if( (int)checksize != pCust->resource.nDownloadSize )
bError = true; bError = true;
} }
@ -149,4 +149,4 @@ int COM_SizeofResourceList( resource_t *pList, resourceinfo_t *ri )
} }
return nSize; return nSize;
} }

4
engine/common/cvar.c

@ -647,7 +647,7 @@ int Cvar_VariableInteger( const char *var_name )
Cvar_VariableString Cvar_VariableString
============ ============
*/ */
char *Cvar_VariableString( const char *var_name ) const char *Cvar_VariableString( const char *var_name )
{ {
convar_t *var; convar_t *var;
@ -818,7 +818,7 @@ Cvar_List_f
void Cvar_List_f( void ) void Cvar_List_f( void )
{ {
convar_t *var; convar_t *var;
char *match = NULL; const char *match = NULL;
char *value; char *value;
int count = 0; int count = 0;

2
engine/common/cvar.h

@ -61,7 +61,7 @@ void Cvar_SetValue( const char *var_name, float value );
const char *Cvar_BuildAutoDescription( int flags ); const char *Cvar_BuildAutoDescription( int flags );
float Cvar_VariableValue( const char *var_name ); float Cvar_VariableValue( const char *var_name );
int Cvar_VariableInteger( 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_WriteVariables( file_t *f, int group );
void Cvar_Reset( const char *var_name ); void Cvar_Reset( const char *var_name );
void Cvar_SetCheatState( void ); void Cvar_SetCheatState( void );

2
engine/common/filesystem.c

@ -2415,7 +2415,7 @@ FS_FileExists
Look for a file in the packages and in the filesystem 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 )) if( FS_FindFile( filename, NULL, gamedironly ))
return true; return true;

4
engine/common/infostring.c

@ -188,7 +188,7 @@ Searches the string for the given
key and returns the associated value, or an empty string. 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]; char pkey[MAX_KV_SIZE];
static char value[4][MAX_KV_SIZE]; // use two buffers so compares work without stomping on each other 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 ); return Info_SetValueForStarKey( s, key, value, maxsize );
} }

36
engine/common/mod_bmodel.c

@ -181,28 +181,28 @@ static model_t *worldmodel;
static mlumpstat_t worldstats[HEADER_LUMPS+EXTRA_LUMPS]; static mlumpstat_t worldstats[HEADER_LUMPS+EXTRA_LUMPS];
static mlumpinfo_t srclumps[HEADER_LUMPS] = static mlumpinfo_t srclumps[HEADER_LUMPS] =
{ {
{ LUMP_ENTITIES, 32, MAX_MAP_ENTSTRING, sizeof( byte ), -1, "entities", 0, (void **)&srcmodel.entdata, &srcmodel.entdatasize }, { 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, (void **)&srcmodel.planes, &srcmodel.numplanes }, { 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, (void **)&srcmodel.textures, &srcmodel.texdatasize }, { 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, (void **)&srcmodel.vertexes, &srcmodel.numvertexes }, { 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, (void **)&srcmodel.visdata, &srcmodel.visdatasize }, { 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, (void **)&srcmodel.nodes, &srcmodel.numnodes }, { 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, (void **)&srcmodel.texinfo, &srcmodel.numtexinfo }, { 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, (void **)&srcmodel.surfaces, &srcmodel.numsurfaces }, { 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, (void **)&srcmodel.lightdata, &srcmodel.lightdatasize }, { 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, (void **)&srcmodel.clipnodes, &srcmodel.numclipnodes }, { 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, (void **)&srcmodel.leafs, &srcmodel.numleafs }, { 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, (void **)&srcmodel.markfaces, &srcmodel.nummarkfaces }, { 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, (void **)&srcmodel.edges, &srcmodel.numedges }, { 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, (void **)&srcmodel.surfedges, &srcmodel.numsurfedges }, { 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, (void **)&srcmodel.submodels, &srcmodel.numsubmodels }, { 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] = static mlumpinfo_t extlumps[EXTRA_LUMPS] =
{ {
{ LUMP_LIGHTVECS, 0, MAX_MAP_LIGHTING, sizeof( byte ), -1, "deluxmaps", USE_EXTRAHEADER, (void **)&srcmodel.deluxdata, &srcmodel.deluxdatasize }, { 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, (void **)&srcmodel.faceinfo, &srcmodel.numfaceinfo }, { 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, (void **)&srcmodel.shadowdata, &srcmodel.shadowdatasize }, { LUMP_SHADOWMAP, 0, MAX_MAP_LIGHTING / 3, sizeof( byte ), -1, "shadowmap", USE_EXTRAHEADER, (const void **)&srcmodel.shadowdata, &srcmodel.shadowdatasize },
}; };
/* /*

4
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 chunksize;
int send, pos; int send, pos;
@ -1747,4 +1747,4 @@ qboolean Netchan_Process( netchan_t *chan, sizebuf_t *msg )
} }
return true; return true;
} }

2
engine/common/net_ws.c

@ -1708,7 +1708,7 @@ void NET_GetLocalAddress( void )
{ {
net_local.port = address.sin_port; net_local.port = address.sin_port;
Con_Printf( "Server IP address %s\n", NET_AdrToString( net_local )); 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 else

2
engine/common/netchan.h

@ -214,7 +214,7 @@ extern int net_drop;
void Netchan_Init( void ); void Netchan_Init( void );
void Netchan_Shutdown( 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_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_CopyNormalFragments( netchan_t *chan, sizebuf_t *msg, size_t *length );
qboolean Netchan_CopyFileFragments( netchan_t *chan, sizebuf_t *msg ); qboolean Netchan_CopyFileFragments( netchan_t *chan, sizebuf_t *msg );
void Netchan_CreateFragments( netchan_t *chan, sizebuf_t *msg ); void Netchan_CreateFragments( netchan_t *chan, sizebuf_t *msg );

4
engine/common/soundlib/soundlib.h

@ -77,7 +77,7 @@ typedef struct stream_s
char temp[OUTBUF_SIZE]; // mpeg decoder stuff char temp[OUTBUF_SIZE]; // mpeg decoder stuff
size_t pos; // actual track position (or actual buffer remains) size_t pos; // actual track position (or actual buffer remains)
int buffsize; // cached buffer size 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 ); long Stream_GetPosMPG( stream_t *stream );
void Stream_FreeMPG( stream_t *stream ); void Stream_FreeMPG( stream_t *stream );
#endif//SOUNDLIB_H #endif//SOUNDLIB_H

6
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]; static char buffer[MAX_PRINT_MSG];
va_list args; 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]; static char buffer[MAX_PRINT_MSG];
va_list args; 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]; static char buffer[MAX_PRINT_MSG];
va_list args; va_list args;

2
engine/common/system.c

@ -287,7 +287,7 @@ static qboolean Sys_FindExecutable( const char *baseName, char *buf, size_t size
Sys_ShellExecute 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 #ifdef _WIN32
if( !Q_strcmp( path, GENERIC_UPDATE_PAGE ) || !Q_strcmp( path, PLATFORM_UPDATE_PAGE )) if( !Q_strcmp( path, GENERIC_UPDATE_PAGE ) || !Q_strcmp( path, PLATFORM_UPDATE_PAGE ))

2
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 )) #define Sys_GetParmFromCmdLine( parm, out ) _Sys_GetParmFromCmdLine( parm, out, sizeof( out ))
qboolean _Sys_GetParmFromCmdLine( const char *parm, char *out, size_t size ); qboolean _Sys_GetParmFromCmdLine( const char *parm, char *out, size_t size );
qboolean Sys_GetIntFromCmdLine( const char *parm, int *out ); 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_SendKeyEvents( void );
void Sys_Print( const char *pMsg ); void Sys_Print( const char *pMsg );
void Sys_PrintLog( const char *pMsg ); void Sys_PrintLog( const char *pMsg );

4
engine/common/zone.c

@ -166,7 +166,7 @@ static const char *Mem_CheckFilename( const char *filename )
if( !out ) return dummy; if( !out ) return dummy;
for( i = 0; i < 128; i++, out++ ) for( i = 0; i < 128; i++, out++ )
if( out == '\0' ) break; // valid name if( *out == '\0' ) break; // valid name
if( i == 128 ) return dummy; if( i == 128 ) return dummy;
return filename; return filename;
} }
@ -483,4 +483,4 @@ Memory_Init
void Memory_Init( void ) void Memory_Init( void )
{ {
poolchain = NULL; // init mem chain poolchain = NULL; // init mem chain
} }

2
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 ); 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 ); 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 ); 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 ); void SV_WriteEntityPatch( const char *filename );
float SV_AngleMod( float ideal, float current, float speed ); float SV_AngleMod( float ideal, float current, float speed );
void SV_SpawnEntities( const char *mapname ); void SV_SpawnEntities( const char *mapname );

9
engine/server/sv_client.c

@ -241,7 +241,7 @@ void SV_ConnectClient( netadr_t from )
int qport, version; int qport, version;
int i, count = 0; int i, count = 0;
int challenge; int challenge;
char *s; const char *s;
if( Cmd_Argc() < 5 ) if( Cmd_Argc() < 5 )
{ {
@ -1562,7 +1562,7 @@ void SV_UserinfoChanged( sv_client_t *cl )
edict_t *ent = cl->edict; edict_t *ent = cl->edict;
string name1, name2; string name1, name2;
sv_client_t *current; sv_client_t *current;
char *val; const char *val;
if( !COM_CheckString( cl->userinfo )) if( !COM_CheckString( cl->userinfo ))
return; return;
@ -1810,7 +1810,7 @@ SV_DownloadFile_f
*/ */
static qboolean SV_DownloadFile_f( sv_client_t *cl ) static qboolean SV_DownloadFile_f( sv_client_t *cl )
{ {
char *name; const char *name;
if( Cmd_Argc() < 2 ) if( Cmd_Argc() < 2 )
return true; return true;
@ -2077,7 +2077,8 @@ connectionless packets.
void SV_ConnectionlessPacket( netadr_t from, sizebuf_t *msg ) void SV_ConnectionlessPacket( netadr_t from, sizebuf_t *msg )
{ {
char *args; char *args;
char *pcmd, buf[MAX_SYSPATH]; const char *pcmd;
char buf[MAX_SYSPATH];
int len = sizeof( buf ); int len = sizeof( buf );
MSG_Clear( msg ); MSG_Clear( msg );

18
engine/server/sv_cmds.c

@ -73,7 +73,7 @@ void SV_BroadcastPrintf( sv_client_t *ignore, char *fmt, ... )
} }
// echo to console // 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 ) static sv_client_t *SV_SetPlayer( void )
{ {
char *s; const char *s;
sv_client_t *cl; sv_client_t *cl;
int i, idnum; int i, idnum;
@ -550,7 +550,8 @@ SV_ConSay_f
*/ */
void SV_ConSay_f( void ) void SV_ConSay_f( void )
{ {
char *p, text[MAX_SYSPATH]; const char *p;
char text[MAX_SYSPATH];
if( Cmd_Argc() < 2 ) return; if( Cmd_Argc() < 2 ) return;
@ -560,18 +561,17 @@ void SV_ConSay_f( void )
return; return;
} }
Q_snprintf( text, sizeof( text ), "%s: ", Cvar_VariableString( "hostname" ));
p = Cmd_Args(); p = Cmd_Args();
Q_strncpy( text, *p == '"' ? p + 1 : p, MAX_SYSPATH );
if( *p == '"' ) if( *p == '"' )
{ {
p++; text[Q_strlen(text) - 1] = 0;
p[Q_strlen(p) - 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 ); SV_BroadcastPrintf( NULL, "%s\n", text );
Log_Printf( "Server say: \"%s\"\n", p );
} }
/* /*
@ -866,4 +866,4 @@ void SV_KillOperatorCommands( void )
{ {
Cmd_RemoveCommand( "say" ); Cmd_RemoveCommand( "say" );
} }
} }

4
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( svgame.dllFuncs.pfnInconsistentFile( cl->edict, sv.resources[badresindex - 1].szFileName, dropmessage ))
{ {
if( COM_CheckString( dropmessage )) if( COM_CheckString( dropmessage ))
SV_ClientPrintf( cl, dropmessage ); SV_ClientPrintf( cl, "%s", dropmessage );
SV_DropClient( cl, false ); SV_DropClient( cl, false );
} }
} }
@ -575,4 +575,4 @@ void SV_SendResources( sv_client_t *cl, sizebuf_t *msg )
} }
SV_SendConsistencyList( cl, msg ); SV_SendConsistencyList( cl, msg );
} }

8
engine/server/sv_game.c

@ -649,7 +649,7 @@ SV_BoxInPVS
check brush boxes in fat pvs 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 ))) if( !Mod_BoxVisible( absmin, absmax, Mod_GetPVSForPoint( org )))
return false; return false;
@ -4379,12 +4379,12 @@ static enginefuncs_t gEngfuncs =
pfnAnimationAutomove, pfnAnimationAutomove,
pfnGetBonePosition, pfnGetBonePosition,
(void*)pfnFunctionFromName, (void*)pfnFunctionFromName,
pfnNameForFunction, (void*)pfnNameForFunction,
pfnClientPrintf, pfnClientPrintf,
pfnServerPrint, pfnServerPrint,
Cmd_Args, Cmd_Args,
Cmd_Argv, Cmd_Argv,
Cmd_Argc, (void*)Cmd_Argc,
pfnGetAttachment, pfnGetAttachment,
CRC32_Init, CRC32_Init,
CRC32_ProcessBuffer, CRC32_ProcessBuffer,
@ -4418,7 +4418,7 @@ static enginefuncs_t gEngfuncs =
pfnIsDedicatedServer, pfnIsDedicatedServer,
pfnCVarGetPointer, pfnCVarGetPointer,
pfnGetPlayerWONId, pfnGetPlayerWONId,
Info_RemoveKey, (void*)Info_RemoveKey,
pfnGetPhysicsKeyValue, pfnGetPhysicsKeyValue,
pfnSetPhysicsKeyValue, pfnSetPhysicsKeyValue,
pfnGetPhysicsInfoString, pfnGetPhysicsInfoString,

2
engine/server/sv_init.c

@ -565,7 +565,7 @@ void SV_ActivateServer( int runPhysics )
Con_Printf( "%i player server started\n", svs.maxclients ); Con_Printf( "%i player server started\n", svs.maxclients );
else Con_Printf( "Game started\n" ); 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 // dedicated server purge unused resources here
if( host.type == HOST_DEDICATED ) if( host.type == HOST_DEDICATED )

2
engine/server/sv_log.c

@ -23,7 +23,7 @@ void Log_Open( void )
char szFileBase[ MAX_OSPATH ]; char szFileBase[ MAX_OSPATH ];
char szTestFile[ MAX_OSPATH ]; char szTestFile[ MAX_OSPATH ];
file_t *fp = NULL; file_t *fp = NULL;
char *temp; const char *temp;
int i; int i;
if( !svs.log.active ) if( !svs.log.active )

3
engine/server/sv_main.c

@ -345,7 +345,8 @@ void SV_ReadPackets( void )
{ {
if( !svs.initialized ) if( !svs.initialized )
{ {
char *args, *c; char *args;
const char *c;
MSG_Clear( &net_message ); MSG_Clear( &net_message );
MSG_ReadLong( &net_message );// skip the -1 marker MSG_ReadLong( &net_message );// skip the -1 marker

4
engine/server/sv_phys.c

@ -2002,7 +2002,7 @@ static server_physics_api_t gPhysicsAPI =
SV_LinkEdict, SV_LinkEdict,
SV_GetServerTime, SV_GetServerTime,
SV_GetFrameTime, SV_GetFrameTime,
SV_ModelHandle, (void*)SV_ModelHandle,
SV_GetHeadNode, SV_GetHeadNode,
SV_ServerState, SV_ServerState,
Host_Error, Host_Error,
@ -2074,4 +2074,4 @@ qboolean SV_InitPhysicsAPI( void )
// physic interface is missed // physic interface is missed
return true; return true;
} }

6
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 ); 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; int v;
@ -614,7 +614,7 @@ void SV_InitClientMove( void )
svgame.pmove->RandomFloat = COM_RandomFloat; svgame.pmove->RandomFloat = COM_RandomFloat;
svgame.pmove->PM_GetModelType = pfnGetModelType; svgame.pmove->PM_GetModelType = pfnGetModelType;
svgame.pmove->PM_GetModelBounds = pfnGetModelBounds; svgame.pmove->PM_GetModelBounds = pfnGetModelBounds;
svgame.pmove->PM_HullForBsp = pfnHullForBsp; svgame.pmove->PM_HullForBsp = (void*)pfnHullForBsp;
svgame.pmove->PM_TraceModel = pfnTraceModel; svgame.pmove->PM_TraceModel = pfnTraceModel;
svgame.pmove->COM_FileSize = COM_FileSize; svgame.pmove->COM_FileSize = COM_FileSize;
svgame.pmove->COM_LoadFile = COM_LoadFile; 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 ); SV_RestoreMoveInterpolant( cl );
} }
} }

4
engine/server/sv_save.c

@ -2154,7 +2154,7 @@ SV_GetSaveComment
check savegame for valid 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; int i, tag, size, nNumberOfFields, nFieldSize, tokenSize, tokenCount;
char *pData, *pSaveData, *pFieldName, **pTokenList; char *pData, *pSaveData, *pFieldName, **pTokenList;
@ -2341,4 +2341,4 @@ qboolean SV_GetSaveComment( const char *savename, char *comment )
void SV_InitSaveRestore( void ) void SV_InitSaveRestore( void )
{ {
pfnSaveGameComment = COM_GetProcAddress( svgame.hInstance, "SV_SaveGameComment" ); pfnSaveGameComment = COM_GetProcAddress( svgame.hInstance, "SV_SaveGameComment" );
} }

Loading…
Cancel
Save