From cbe398b548ba1a5d979119af1e6163b4b45c5939 Mon Sep 17 00:00:00 2001 From: Brian Fiete Date: Thu, 24 Feb 2022 11:16:45 -0800 Subject: [PATCH] Fixed negative case in GetHighestBitSet --- BeefySysLib/Common.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BeefySysLib/Common.cpp b/BeefySysLib/Common.cpp index a5edbebf..7d89b374 100644 --- a/BeefySysLib/Common.cpp +++ b/BeefySysLib/Common.cpp @@ -1009,7 +1009,7 @@ int32 Beefy::Rand() int32 Beefy::GetHighestBitSet(int32 n) { int i = 0; - for (; n; n >>= 1, i++) + for (; n; n = (int)((uint32)n >> 1), i++) ; /* empty */ return i; }