1. Fix one bug on EBC for GetPowerOfTwo64.c

2. Fix one bug for GetPowerOfTwo32.c and GetPowerOfTwo64.c, when Operand is 1, 1 should be returned

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@873 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
vanjeff 2006-07-11 07:48:43 +00:00
parent 67513de537
commit 4748b24d77
2 changed files with 5 additions and 3 deletions

View File

@ -34,6 +34,7 @@ GetPowerOfTwo32 (
)
{
INTN BitPos;
return (BitPos = HighBitSet32 (Operand)) > 0 ? 1ul << BitPos : 0;
BitPos = HighBitSet32 (Operand);
return BitPos >= 0 ? 1ul << BitPos : 0;
}

View File

@ -35,5 +35,6 @@ GetPowerOfTwo64 (
{
INTN BitPos;
return (BitPos = HighBitSet64 (Operand)) > 0 ? LShiftU64 (1, BitPos) : 0;
BitPos = HighBitSet64 (Operand);
return BitPos >= 0 ? LShiftU64 (1, BitPos) : 0;
}