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

This commit is contained in:
Alibek Omarov 2018-04-23 23:07:54 +03:00
parent e1f80fba3d
commit efe8ddf151
44 changed files with 143 additions and 138 deletions

View File

@ -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();
}
}
}

View File

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

View File

@ -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 )
{

View File

@ -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;
}
}

View File

@ -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
#endif//CL_TENT_H

View File

@ -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 );

View File

@ -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 );

View File

@ -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;
}
}

View File

@ -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 );

View File

@ -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,

View File

@ -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,

View File

@ -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 )
{

View File

@ -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];

View File

@ -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;

View File

@ -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 )
{

View File

@ -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 );

View File

@ -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 );
}

View File

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

View File

@ -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 );

View File

@ -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;
}
}

View File

@ -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;

View File

@ -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 );

View File

@ -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;

View File

@ -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 );
}
}

View File

@ -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 },
};
/*

View File

@ -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;
}
}

View File

@ -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

View File

@ -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 );

View File

@ -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
#endif//SOUNDLIB_H

View File

@ -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;

View File

@ -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 ))

View File

@ -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 );

View File

@ -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
}
}

View File

@ -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 );

View File

@ -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 );

View File

@ -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" );
}
}
}

View File

@ -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 );
}
}

View File

@ -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,

View File

@ -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 )

View File

@ -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 )

View File

@ -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

View File

@ -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;
}
}

View File

@ -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 );
}
}
}

View File

@ -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" );
}
}