Changing unsigned int into UINTN according to code review comments.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5960 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
vanjeff 2008-09-24 08:31:38 +00:00
parent ce7a12fba0
commit 28ca72bc97
2 changed files with 22 additions and 22 deletions

View File

@ -472,10 +472,10 @@ InternalSyncCompareExchange64 (
@return The bit field read. @return The bit field read.
**/ **/
unsigned int UINTN
EFIAPI EFIAPI
BitFieldReadUint ( BitFieldReadUint (
IN unsigned int Operand, IN UINTN Operand,
IN UINTN StartBit, IN UINTN StartBit,
IN UINTN EndBit IN UINTN EndBit
); );
@ -497,13 +497,13 @@ BitFieldReadUint (
@return The new value. @return The new value.
**/ **/
unsigned int UINTN
EFIAPI EFIAPI
BitFieldOrUint ( BitFieldOrUint (
IN unsigned int Operand, IN UINTN Operand,
IN UINTN StartBit, IN UINTN StartBit,
IN UINTN EndBit, IN UINTN EndBit,
IN unsigned int OrData IN UINTN OrData
); );
@ -523,13 +523,13 @@ BitFieldOrUint (
@return The new value. @return The new value.
**/ **/
unsigned int UINTN
EFIAPI EFIAPI
BitFieldAndUint ( BitFieldAndUint (
IN unsigned int Operand, IN UINTN Operand,
IN UINTN StartBit, IN UINTN StartBit,
IN UINTN EndBit, IN UINTN EndBit,
IN unsigned int AndData IN UINTN AndData
); );

View File

@ -26,19 +26,19 @@
@return The bit field read. @return The bit field read.
**/ **/
unsigned int UINTN
EFIAPI EFIAPI
BitFieldReadUint ( BitFieldReadUint (
IN unsigned int Operand, IN UINTN Operand,
IN UINTN StartBit, IN UINTN StartBit,
IN UINTN EndBit IN UINTN EndBit
) )
{ {
// //
// ~((unsigned int)-2 << EndBit) is a mask in which bit[0] thru bit[EndBit] // ~((UINTN)-2 << EndBit) is a mask in which bit[0] thru bit[EndBit]
// are 1's while bit[EndBit + 1] thru the most significant bit are 0's. // are 1's while bit[EndBit + 1] thru the most significant bit are 0's.
// //
return (Operand & ~((unsigned int)-2 << EndBit)) >> StartBit; return (Operand & ~((UINTN)-2 << EndBit)) >> StartBit;
} }
/** /**
@ -57,20 +57,20 @@ BitFieldReadUint (
@return The new value. @return The new value.
**/ **/
unsigned int UINTN
EFIAPI EFIAPI
BitFieldOrUint ( BitFieldOrUint (
IN unsigned int Operand, IN UINTN Operand,
IN UINTN StartBit, IN UINTN StartBit,
IN UINTN EndBit, IN UINTN EndBit,
IN unsigned int OrData IN UINTN OrData
) )
{ {
// //
// ~((unsigned int)-2 << EndBit) is a mask in which bit[0] thru bit[EndBit] // ~((UINTN)-2 << EndBit) is a mask in which bit[0] thru bit[EndBit]
// are 1's while bit[EndBit + 1] thru the most significant bit are 0's. // are 1's while bit[EndBit + 1] thru the most significant bit are 0's.
// //
return Operand | ((OrData << StartBit) & ~((unsigned int) -2 << EndBit)); return Operand | ((OrData << StartBit) & ~((UINTN) -2 << EndBit));
} }
/** /**
@ -89,20 +89,20 @@ BitFieldOrUint (
@return The new value. @return The new value.
**/ **/
unsigned int UINTN
EFIAPI EFIAPI
BitFieldAndUint ( BitFieldAndUint (
IN unsigned int Operand, IN UINTN Operand,
IN UINTN StartBit, IN UINTN StartBit,
IN UINTN EndBit, IN UINTN EndBit,
IN unsigned int AndData IN UINTN AndData
) )
{ {
// //
// ~((unsigned int)-2 << EndBit) is a mask in which bit[0] thru bit[EndBit] // ~((UINTN)-2 << EndBit) is a mask in which bit[0] thru bit[EndBit]
// are 1's while bit[EndBit + 1] thru the most significant bit are 0's. // are 1's while bit[EndBit + 1] thru the most significant bit are 0's.
// //
return Operand & ~((~AndData << StartBit) & ~((unsigned int) -2 << EndBit)); return Operand & ~((~AndData << StartBit) & ~((UINTN)-2 << EndBit));
} }
/** /**