Skip to content

Commit c6bf061

Browse files
committed
fix: linux warnings
1 parent 5ba792d commit c6bf061

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/Features/Hud/EHMDebugHud.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ std::vector<SlotInfoRecord> g_slotStates;
2929
std::vector<int> g_hudSlots;
3030

3131
static bool isSlotDisplayed(int slot) {
32-
for (int i = 0; i < g_hudSlots.size(); i++) {
32+
for (size_t i = 0; i < g_hudSlots.size(); i++) {
3333
if (g_hudSlots[i] == slot) {
3434
return true;
3535
}
@@ -41,23 +41,23 @@ static void pushHudSlotOnTop(int slot) {
4141
if (isSlotDisplayed(slot)) return;
4242

4343
g_hudSlots.insert(g_hudSlots.begin(), slot);
44-
if (g_hudSlots.size() >= sar_ehm_hud_list_length.GetInt()) {
44+
if (g_hudSlots.size() >= (size_t)sar_ehm_hud_list_length.GetInt()) {
4545
g_hudSlots.pop_back();
4646
}
4747
}
4848

4949
static void swapOldestSlotWith(int slot) {
5050
if (isSlotDisplayed(slot)) return;
5151

52-
if (g_hudSlots.size() < sar_ehm_hud_list_length.GetInt()) {
52+
if (g_hudSlots.size() < (size_t)sar_ehm_hud_list_length.GetInt()) {
5353
g_hudSlots.insert(g_hudSlots.begin(), slot);
5454
return;
5555
}
5656

5757
int oldest_index = -1;
5858
float oldest_lifetime = -1.0f;
5959

60-
for (int i = 0; i < g_hudSlots.size(); i++) {
60+
for (size_t i = 0; i < g_hudSlots.size(); i++) {
6161
float lifetime = g_slotStates[g_hudSlots[i]].lifetime;
6262
if (lifetime > oldest_lifetime) {
6363
oldest_index = i;
@@ -72,7 +72,7 @@ static void swapOldestSlotWith(int slot) {
7272

7373
static void handleSlotRecords() {
7474
bool fresh = false;
75-
if (g_slotStates.size() != Offsets::NUM_ENT_ENTRIES) {
75+
if (g_slotStates.size() != (size_t)Offsets::NUM_ENT_ENTRIES) {
7676
g_slotStates.resize(Offsets::NUM_ENT_ENTRIES);
7777
fresh = true;
7878
}
@@ -112,12 +112,12 @@ static void clearSlotRecords() {
112112
}
113113

114114
static void handleHudSlotsResizing() {
115-
while (g_hudSlots.size() < sar_ehm_hud_list_length.GetInt()) {
115+
while (g_hudSlots.size() < (size_t)sar_ehm_hud_list_length.GetInt()) {
116116
int slotToAssign = (g_hudSlots.size() > 0) ? (g_hudSlots[g_hudSlots.size() - 1] + 1) : 0;
117117
slotToAssign %= Offsets::NUM_ENT_ENTRIES;
118118
g_hudSlots.push_back(slotToAssign);
119119
}
120-
if (g_hudSlots.size() > sar_ehm_hud_list_length.GetInt()) {
120+
if (g_hudSlots.size() > (size_t)sar_ehm_hud_list_length.GetInt()) {
121121
g_hudSlots.resize(sar_ehm_hud_list_length.GetInt());
122122
}
123123
}
@@ -204,7 +204,7 @@ class EHMDebugHud : public Hud {
204204
surface->DrawTxt(font, hudX + serialHeaderX, hudY + paddingBorder, Color(255, 255, 255, 255), serialHeader);
205205
surface->DrawTxt(font, hudX + classnameHeaderX, hudY + paddingBorder, Color(255, 255, 255, 255), classnameHeader);
206206

207-
for (int i = 0; i < g_hudSlots.size(); ++i) {
207+
for (size_t i = 0; i < g_hudSlots.size(); ++i) {
208208
int slot = g_hudSlots[i];
209209
auto slotRecord = g_slotStates[slot];
210210
auto info = entityList->GetEntityInfoByIndex(slot);

0 commit comments

Comments
 (0)