Skip to content

Commit

Permalink
fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
wootguy committed Nov 14, 2024
1 parent efff33e commit b946049
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 6 deletions.
4 changes: 3 additions & 1 deletion common/Platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 <limits.h>
#include <stdarg.h>
#define _vsnprintf(a,b,c,d) vsnprintf(a,b,c,d)
Expand Down
8 changes: 7 additions & 1 deletion dlls/hooks/rehlds.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion dlls/sound.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down
4 changes: 2 additions & 2 deletions dlls/util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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];
}
Expand Down
3 changes: 2 additions & 1 deletion dlls/weapon/CGauss.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit b946049

Please sign in to comment.