From b94604964e5f15176d6f17b58191f7930f998ccd Mon Sep 17 00:00:00 2001 From: wootguy Date: Thu, 14 Nov 2024 07:30:14 -0800 Subject: [PATCH] fix warnings --- common/Platform.h | 4 +++- dlls/hooks/rehlds.h | 8 +++++++- dlls/sound.cpp | 2 +- dlls/util.cpp | 4 ++-- dlls/weapon/CGauss.cpp | 3 ++- 5 files changed, 15 insertions(+), 6 deletions(-) diff --git a/common/Platform.h b/common/Platform.h index bcb1630d..be60c34c 100644 --- a/common/Platform.h +++ b/common/Platform.h @@ -69,7 +69,9 @@ typedef uint32 ULONG; typedef unsigned char BYTE; typedef int BOOL; -#define MAX_PATH PATH_MAX +#ifndef REHLDS_INCLUDE + #define MAX_PATH PATH_MAX +#endif #include #include #define _vsnprintf(a,b,c,d) vsnprintf(a,b,c,d) diff --git a/dlls/hooks/rehlds.h b/dlls/hooks/rehlds.h index 2ad9ba58..f179ee35 100644 --- a/dlls/hooks/rehlds.h +++ b/dlls/hooks/rehlds.h @@ -16,11 +16,17 @@ typedef struct cache_user_s void* data; } cache_user_t; +#ifdef _WIN32 +#define EXT_FUNC +#else +#define EXT_FUNC __attribute__((force_align_arg_pointer)) +#endif + #define CACHE_USER #define SYNCTYPE_T #define DID_VEC3_T_DEFINE -#define EXT_FUNC #define EIFACE_H +#define REHLDS_INCLUDE #endif #include "extdll.h" diff --git a/dlls/sound.cpp b/dlls/sound.cpp index 5eedf811..12d23ed3 100644 --- a/dlls/sound.cpp +++ b/dlls/sound.cpp @@ -712,7 +712,7 @@ void PLAY_DISTANT_SOUND(edict_t* emitter, int soundType) { // randomize pitch per entity, so you get a better idea of how many players/npcs are shooting int pitch = 95 + ((ENTINDEX(emitter) * 7) % 11); - StartSound(NULL, CHAN_STATIC, sample, volume, attn, 0, pitch, emitter->v.origin, pbits, false); + StartSound((edict_t*)NULL, CHAN_STATIC, sample, volume, attn, 0, pitch, emitter->v.origin, pbits, false); } } diff --git a/dlls/util.cpp b/dlls/util.cpp index 8bcc9831..1b00dbcf 100644 --- a/dlls/util.cpp +++ b/dlls/util.cpp @@ -897,7 +897,7 @@ void UTIL_ELight_msg(int entindex, int attachment, Vector origin, float radius, MESSAGE_END(); } void UTIL_ELight(int entindex, int attachment, Vector origin, float radius, RGBA color, int life, float decay, int msgMode, const float* msgOrigin, edict_t* targetEnt) { - SAFE_MESSAGE_ENT_LOGIC(UTIL_ELight_msg, entindex, attachment, origin, radius, color, life, decay, msgMode, origin, targetEnt); + SAFE_MESSAGE_ENT_LOGIC(UTIL_ELight_msg, entindex, attachment, origin, radius, color, life, decay, msgMode, msgOrigin, targetEnt); } void UTIL_BeamEntPoint_msg(int entindex, int attachment, Vector point, int modelIdx, uint8_t frameStart, @@ -2751,7 +2751,7 @@ std::string getGameFilePath(const char* path) { normalize_path(gameDir + std::string("_downloads/") + lowerPath), }; - for (int i = 0; i < ARRAY_SZ(searchPaths); i++) { + for (int i = 0; i < (int)ARRAY_SZ(searchPaths); i++) { if (fileExists(searchPaths[i].c_str())) { return searchPaths[i]; } diff --git a/dlls/weapon/CGauss.cpp b/dlls/weapon/CGauss.cpp index 2a9d4bd6..46ea9d59 100644 --- a/dlls/weapon/CGauss.cpp +++ b/dlls/weapon/CGauss.cpp @@ -301,7 +301,8 @@ void CGauss::SecondaryAttack() m_lastPitch = 0; // always playback the current pitch #endif - if (pitch != m_lastPitch && (m_lastPitch % 4 == 0 || pitch == 250) || m_iSoundState != SND_CHANGE_PITCH) { + bool pitchChangedEnough = m_lastPitch % 4 == 0 || pitch == 250; + if ((pitch != m_lastPitch && pitchChangedEnough) || m_iSoundState != SND_CHANGE_PITCH) { PLAYBACK_EVENT_FULL(FEV_NOTHOST, m_pPlayer->edict(), m_usGaussSpin, 0.0, (float*)&g_vecZero, (float*)&g_vecZero, 0.0, 0.0, pitch, 0, (m_iSoundState == SND_CHANGE_PITCH) ? 1 : 0, 0); }