From 922709f4d91aee3f6db3d6fc3166e1d71abab3ff Mon Sep 17 00:00:00 2001 From: Kawe Mazidjatari <48657826+Mauler125@users.noreply.github.com> Date: Sun, 2 Apr 2023 15:51:08 +0200 Subject: [PATCH] /W4: Fix verbose compiler warnings caused by incorrect type conversion Fixed bug caused by incorrect type conversion. Type should be as wide as the type used for 'CUtlMemory::m_nAllocationCount', which is 64-bits on this particular implementation. --- r5dev/tier1/utlmemory.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/r5dev/tier1/utlmemory.h b/r5dev/tier1/utlmemory.h index 297c7cdf..d8baa356 100644 --- a/r5dev/tier1/utlmemory.h +++ b/r5dev/tier1/utlmemory.h @@ -703,7 +703,7 @@ inline bool CUtlMemory::IsIdxValid(I i) const { // GCC warns if I is an unsigned type and we do a ">= 0" against it (since the comparison is always 0). // We get the warning even if we cast inside the expression. It only goes away if we assign to another variable. - long x = i; + int64 x = i; return (x >= 0) && (x < m_nAllocationCount); }