diff --git a/rehlds/engine/APIProxy.h b/rehlds/engine/APIProxy.h index 0ac2dcb..15c4c26 100644 --- a/rehlds/engine/APIProxy.h +++ b/rehlds/engine/APIProxy.h @@ -576,7 +576,7 @@ typedef void(*pfnEngDst_pfnGetScreenFade_t) (struct screenfade_s **); typedef void(*pfnEngDst_pfnSetScreenFade_t) (struct screenfade_s **); typedef void(*pfnEngDst_VGui_GetPanel_t) (); typedef void(*pfnEngDst_VGui_ViewportPaintBackground_t) (int **); -typedef void(*pfnEngDst_COM_LoadFile_t) (char **, int *, int **); +typedef void(*pfnEngDst_COM_LoadFile_t) (const char **, int *, int **); typedef void(*pfnEngDst_COM_ParseFile_t) (char **, char **); typedef void(*pfnEngDst_COM_FreeFile_t) (void **); typedef void(*pfnEngDst_IsSpectateOnly_t) (void); diff --git a/rehlds/engine/common.cpp b/rehlds/engine/common.cpp index 4b36514..169b688 100644 --- a/rehlds/engine/common.cpp +++ b/rehlds/engine/common.cpp @@ -1973,7 +1973,7 @@ NOXREF int COM_ExpandFilename(char *filename) return *filename != 0; } -int EXT_FUNC COM_FileSize(char *filename) +int EXT_FUNC COM_FileSize(const char *filename) { FileHandle_t fp; int iSize; @@ -2385,7 +2385,7 @@ void COM_Log(char *pszFile, char *fmt, ...) } } -unsigned char* EXT_FUNC COM_LoadFileForMe(char *filename, int *pLength) +unsigned char* EXT_FUNC COM_LoadFileForMe(const char *filename, int *pLength) { return COM_LoadFile(filename, 5, pLength); } diff --git a/rehlds/engine/common.h b/rehlds/engine/common.h index 3ea8174..6c30045 100644 --- a/rehlds/engine/common.h +++ b/rehlds/engine/common.h @@ -317,7 +317,7 @@ void COM_FixSlashes(char *pname); void COM_CreatePath(char *path); NOXREF void COM_CopyFile(char *netpath, char *cachepath); NOXREF int COM_ExpandFilename(char *filename); -int COM_FileSize(char *filename); +int COM_FileSize(const char *filename); unsigned char *COM_LoadFile(const char *path, int usehunk, int *pLength); void COM_FreeFile(void *buffer); void COM_CopyFileChunk(FileHandle_t dst, FileHandle_t src, int nSize); @@ -335,7 +335,7 @@ qboolean COM_SetupDirectories(void); void COM_CheckPrintMap(dheader_t *header, const char *mapname, qboolean bShowOutdated); void COM_ListMaps(char *pszSubString); void COM_Log(char *pszFile, char *fmt, ...); -unsigned char *COM_LoadFileForMe(char *filename, int *pLength); +unsigned char *COM_LoadFileForMe(const char *filename, int *pLength); int COM_CompareFileTime(char *filename1, char *filename2, int *iCompare); void COM_GetGameDir(char *szGameDir); int COM_EntsForPlayerSlots(int nPlayers); diff --git a/rehlds/engine/delta.cpp b/rehlds/engine/delta.cpp index d6f029d..6b242e6 100644 --- a/rehlds/engine/delta.cpp +++ b/rehlds/engine/delta.cpp @@ -993,7 +993,7 @@ int DELTA_ParseDelta(unsigned char *from, unsigned char *to, delta_t *pFields) return MSG_CurrentBit() - startbit; } -void EXT_FUNC DELTA_AddEncoder(char *name, void(*conditionalencode)(struct delta_s *, const unsigned char *, const unsigned char *)) +void EXT_FUNC DELTA_AddEncoder(const char *name, void(*conditionalencode)(struct delta_s *, const unsigned char *, const unsigned char *)) { delta_encoder_t *p = (delta_encoder_t *)Mem_ZeroMalloc(sizeof(delta_encoder_t)); p->name = Mem_Strdup(name); diff --git a/rehlds/engine/delta.h b/rehlds/engine/delta.h index 92b439e..953530e 100644 --- a/rehlds/engine/delta.h +++ b/rehlds/engine/delta.h @@ -136,7 +136,7 @@ qboolean DELTA_WriteDeltaForceMask(unsigned char *from, unsigned char *to, qbool qboolean DELTA_WriteDelta(unsigned char *from, unsigned char *to, qboolean force, delta_t *pFields, void(*callback)(void)); qboolean _DELTA_WriteDelta(unsigned char *from, unsigned char *to, qboolean force, delta_t *pFields, void(*callback)(void), qboolean sendfields); int DELTA_ParseDelta(unsigned char *from, unsigned char *to, delta_t *pFields); -void DELTA_AddEncoder(char *name, void(*conditionalencode)(struct delta_s *, const unsigned char *, const unsigned char *)); +void DELTA_AddEncoder(const char *name, void(*conditionalencode)(struct delta_s *, const unsigned char *, const unsigned char *)); void DELTA_ClearEncoders(void); encoder_t DELTA_LookupEncoder(char *name); int DELTA_CountLinks(delta_link_t *plinks); diff --git a/rehlds/engine/pr_cmds.cpp b/rehlds/engine/pr_cmds.cpp index ba88336..74936c5 100644 --- a/rehlds/engine/pr_cmds.cpp +++ b/rehlds/engine/pr_cmds.cpp @@ -816,7 +816,7 @@ qboolean EXT_FUNC ValidCmd(const char *pCmd) return len && (pCmd[len - 1] == '\n' || pCmd[len - 1] == ';'); } -void EXT_FUNC PF_stuffcmd_I(edict_t *pEdict, char *szFmt, ...) +void EXT_FUNC PF_stuffcmd_I(edict_t *pEdict, const char *szFmt, ...) { int entnum; client_t *old; @@ -850,7 +850,7 @@ void EXT_FUNC PF_stuffcmd_I(edict_t *pEdict, char *szFmt, ...) } } -void EXT_FUNC PF_localcmd_I(char *str) +void EXT_FUNC PF_localcmd_I(const char *str) { if (ValidCmd(str)) Cbuf_AddText(str); @@ -1457,7 +1457,7 @@ int EXT_FUNC PF_precache_model_I(const char *s) } #ifdef REHLDS_FIXES -int EXT_FUNC PF_precache_generic_I(char *s) +int EXT_FUNC PF_precache_generic_I(const char *s) { if (!s) Host_Error("%s: NULL pointer", __func__); @@ -1504,7 +1504,7 @@ int EXT_FUNC PF_precache_generic_I(char *s) return g_rehlds_sv.precachedGenericResourceCount++; } #else // REHLDS_FIXES -int EXT_FUNC PF_precache_generic_I(char *s) +int EXT_FUNC PF_precache_generic_I(const char *s) { if (!s) Host_Error("%s: NULL pointer", __func__); @@ -1544,7 +1544,7 @@ int EXT_FUNC PF_precache_generic_I(char *s) } #endif // REHLDS_FIXES -int EXT_FUNC PF_IsMapValid_I(char *mapname) +int EXT_FUNC PF_IsMapValid_I(const char *mapname) { char cBuf[260]; if (!mapname || Q_strlen(mapname) == 0) diff --git a/rehlds/engine/pr_cmds.h b/rehlds/engine/pr_cmds.h index 553615f..e1a12f0 100644 --- a/rehlds/engine/pr_cmds.h +++ b/rehlds/engine/pr_cmds.h @@ -129,8 +129,8 @@ mnode_t *PVSNode(mnode_t *node, vec_t *emins, vec_t *emaxs); void PVSMark(model_t *pmodel, unsigned char *ppvs); edict_t *PVSFindEntities(edict_t *pplayer); qboolean ValidCmd(const char *pCmd); -void PF_stuffcmd_I(edict_t *pEdict, char *szFmt, ...); -void PF_localcmd_I(char *str); +void PF_stuffcmd_I(edict_t *pEdict, const char *szFmt, ...); +void PF_localcmd_I(const char *str); void PF_localexec_I(void); edict_t *FindEntityInSphere(edict_t *pEdictStartSearchAfter, const float *org, float rad); edict_t *PF_Spawn_I(void); @@ -150,8 +150,8 @@ void EV_PlayReliableEvent_internal(client_t *cl, int entindex, unsigned short ev void EV_Playback(int flags, const edict_t *pInvoker, unsigned short eventindex, float delay, float *origin, float *angles, float fparam1, float fparam2, int iparam1, int iparam2, int bparam1, int bparam2); void EV_SV_Playback(int flags, int clientindex, unsigned short eventindex, float delay, float *origin, float *angles, float fparam1, float fparam2, int iparam1, int iparam2, int bparam1, int bparam2); int PF_precache_model_I(const char *s); -int PF_precache_generic_I(char *s); -int PF_IsMapValid_I(char *mapname); +int PF_precache_generic_I(const char *s); +int PF_IsMapValid_I(const char *mapname); int PF_NumberOfEntities_I(void); char *PF_GetInfoKeyBuffer_I(edict_t *e); char *PF_InfoKeyValue_I(char *infobuffer, const char *key); diff --git a/rehlds/pm_shared/pm_defs.h b/rehlds/pm_shared/pm_defs.h index 1a5f01d..7350c1a 100644 --- a/rehlds/pm_shared/pm_defs.h +++ b/rehlds/pm_shared/pm_defs.h @@ -208,7 +208,7 @@ typedef struct playermove_s void (*PM_GetModelBounds)( struct model_s *mod, float *mins, float *maxs ); void *(*PM_HullForBsp)( physent_t *pe, float *offset ); float (*PM_TraceModel)( physent_t *pEnt, float *start, float *end, trace_t *trace ); - int (*COM_FileSize)(char *filename); + int (*COM_FileSize)(const char *filename); byte *(*COM_LoadFile) (const char *path, int usehunk, int *pLength); void (*COM_FreeFile) ( void *buffer ); char *(*memfgets)( byte *pMemFile, int fileSize, int *pFilePos, char *pBuffer, int bufferSize ); diff --git a/rehlds/public/rehlds/eiface.h b/rehlds/public/rehlds/eiface.h index b679719..f773e98 100644 --- a/rehlds/public/rehlds/eiface.h +++ b/rehlds/public/rehlds/eiface.h @@ -144,9 +144,9 @@ typedef struct enginefuncs_s const char *(*pfnTraceTexture) (edict_t *pTextureEntity, const float *v1, const float *v2 ); void (*pfnTraceSphere) (const float *v1, const float *v2, int fNoMonsters, float radius, edict_t *pentToSkip, TraceResult *ptr); void (*pfnGetAimVector) (edict_t* ent, float speed, float *rgflReturn); - void (*pfnServerCommand) (char* str); + void (*pfnServerCommand) (const char* str); void (*pfnServerExecute) (void); - void (*pfnClientCommand) (edict_t* pEdict, char* szFmt, ...); + void (*pfnClientCommand) (edict_t* pEdict, const char* szFmt, ...); void (*pfnParticleEffect) (const float *org, const float *dir, float color, float count); void (*pfnLightStyle) (int style, char* val); int (*pfnDecalIndex) (const char *name); @@ -200,7 +200,7 @@ typedef struct enginefuncs_s void (*pfnSetView) (const edict_t *pClient, const edict_t *pViewent ); float (*pfnTime) ( void ); void (*pfnCrosshairAngle) (const edict_t *pClient, float pitch, float yaw); - byte * (*pfnLoadFileForMe) (char *filename, int *pLength); + byte * (*pfnLoadFileForMe) (const char *filename, int *pLength); void (*pfnFreeFile) (void *buffer); void (*pfnEndSection) (const char *pszSectionName); // trigger_endsection int (*pfnCompareFileTime) (char *filename1, char *filename2, int *iCompare); @@ -215,9 +215,9 @@ typedef struct enginefuncs_s char* (*pfnInfoKeyValue) (char *infobuffer, const char *key); void (*pfnSetKeyValue) (char *infobuffer, const char *key, const char *value); void (*pfnSetClientKeyValue) (int clientIndex, char *infobuffer, const char *key, const char *value); - int (*pfnIsMapValid) (char *filename); + int (*pfnIsMapValid) (const char *filename); void (*pfnStaticDecal) ( const float *origin, int decalIndex, int entityIndex, int modelIndex ); - int (*pfnPrecacheGeneric) (char* s); + int (*pfnPrecacheGeneric) (const char* s); int (*pfnGetPlayerUserId) (edict_t *e ); // returns the server assigned userid for this player. useful for logging frags, etc. returns -1 if the edict couldn't be found in the list of clients void (*pfnBuildSoundMsg) (edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch, int msg_dest, int msg_type, const float *pOrigin, edict_t *ed); int (*pfnIsDedicatedServer) (void);// is this a dedicated server? @@ -239,7 +239,7 @@ typedef struct enginefuncs_s void (*pfnDeltaSetField) ( struct delta_s *pFields, const char *fieldname ); void (*pfnDeltaUnsetField) ( struct delta_s *pFields, const char *fieldname ); - void (*pfnDeltaAddEncoder) ( char *name, void (*conditionalencode)( struct delta_s *pFields, const unsigned char *from, const unsigned char *to ) ); + void (*pfnDeltaAddEncoder) ( const char *name, void (*conditionalencode)( struct delta_s *pFields, const unsigned char *from, const unsigned char *to ) ); int (*pfnGetCurrentPlayer) ( void ); int (*pfnCanSkipPlayer) ( const edict_t *player ); int (*pfnDeltaFindField) ( struct delta_s *pFields, const char *fieldname ); @@ -274,7 +274,7 @@ typedef struct enginefuncs_s sentenceEntry_s* (*pfnSequencePickSentence) ( const char* groupName, int pickMethod, int *picked ); // LH: Give access to filesize via filesystem - int (*pfnGetFileSize) ( char *filename ); + int (*pfnGetFileSize) ( const char *filename ); unsigned int (*pfnGetApproxWavePlayLen) (const char *filepath); // MDC: Added for CZ career-mode