Explorar el Código

Fixed negative case in GetHighestBitSet

Brian Fiete hace 3 años
padre
commit
cbe398b548
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      BeefySysLib/Common.cpp

+ 1 - 1
BeefySysLib/Common.cpp

@@ -1009,7 +1009,7 @@ int32 Beefy::Rand()
 int32 Beefy::GetHighestBitSet(int32 n)
 int32 Beefy::GetHighestBitSet(int32 n)
 {
 {
 	int i = 0;
 	int i = 0;
-	for (; n; n >>= 1, i++)
+	for (; n; n = (int)((uint32)n >> 1), i++)
 		; /* empty */
 		; /* empty */
 	return i;
 	return i;
 }
 }