summaryrefslogtreecommitdiff
path: root/MdePkg
diff options
context:
space:
mode:
authormdkinney <mdkinney@6f19259b-4bc3-4df7-8a09-765794883524>2009-07-01 18:05:03 +0000
committermdkinney <mdkinney@6f19259b-4bc3-4df7-8a09-765794883524>2009-07-01 18:05:03 +0000
commit2229029afc183e4b84c255893d0a2974d8086863 (patch)
treebcb197414f40cb5bc3aceec6bf6335e390f958e5 /MdePkg
parent04dd6cc01af0c18f6d75686b55537ba308a92ae6 (diff)
downloadedk2-2229029afc183e4b84c255893d0a2974d8086863.zip
edk2-2229029afc183e4b84c255893d0a2974d8086863.tar.gz
edk2-2229029afc183e4b84c255893d0a2974d8086863.tar.bz2
Update BASE_ARG() macro to pass static analysis tools. This change should not cause any changes in behavior
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8707 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdePkg')
-rw-r--r--MdePkg/Include/Base.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/MdePkg/Include/Base.h b/MdePkg/Include/Base.h
index f429acd..3f71098 100644
--- a/MdePkg/Include/Base.h
+++ b/MdePkg/Include/Base.h
@@ -415,6 +415,15 @@ typedef CHAR8 *VA_LIST;
typedef UINTN *BASE_LIST;
/**
+ Returns the size of a data type in sizeof(UINTN) units rounded up to the nearest UINTN boundary.
+
+ @param TYPE The date type to determine the size of.
+
+ @return The size of TYPE in sizeof (UINTN) units rounded up to the nearest UINTN boundary.
+**/
+#define _BASE_INT_SIZE_OF(TYPE) ((sizeof (TYPE) + sizeof (UINTN) - 1) / sizeof (UINTN))
+
+/**
Returns an argument of a specified type from a variable argument list and updates
the pointer to the variable argument list to point to the next argument.
@@ -430,7 +439,7 @@ typedef UINTN *BASE_LIST;
@return An argument of the type specified by TYPE.
**/
-#define BASE_ARG(Marker, TYPE) (*(TYPE *)((UINT8 *)(Marker = (BASE_LIST)((UINT8 *)Marker + _INT_SIZE_OF (TYPE))) - _INT_SIZE_OF (TYPE)))
+#define BASE_ARG(Marker, TYPE) (*(TYPE *) ((Marker += _BASE_INT_SIZE_OF (TYPE)) - _BASE_INT_SIZE_OF (TYPE)))
/**
Macro that returns the byte offset of a field in a data structure.