From: mdkinney Date: Thu, 9 Nov 2006 22:01:56 +0000 (+0000) Subject: Fix ALIGN_POINTER() macro. The pointer (p) passed in must always be converted to... X-Git-Tag: edk2-stable201903~23955 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=b5b60e8b4975a3f7c9ddf4a59c28fe971414d179;ds=sidebyside Fix ALIGN_POINTER() macro. The pointer (p) passed in must always be converted to (UINTN) prior to performing math operations. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1922 6f19259b-4bc3-4df7-8a09-765794883524 --- diff --git a/MdePkg/Include/Common/BaseTypes.h b/MdePkg/Include/Common/BaseTypes.h index 3935919300..92e9c141f7 100644 --- a/MdePkg/Include/Common/BaseTypes.h +++ b/MdePkg/Include/Common/BaseTypes.h @@ -139,7 +139,7 @@ typedef CHAR8 *VA_LIST; /// /// ALIGN_POINTER - aligns a pointer to the lowest boundry /// -#define ALIGN_POINTER(p, s) ((VOID *) ((p) + (((s) - ((UINTN) (p))) & ((s) - 1)))) +#define ALIGN_POINTER(p, s) ((VOID *) ((UINTN)(p) + (((s) - ((UINTN) (p))) & ((s) - 1)))) /// /// ALIGN_VARIABLE - aligns a variable up to the next natural boundry for int size of a processor