diff options
author | mdkinney <mdkinney@6f19259b-4bc3-4df7-8a09-765794883524> | 2009-07-01 18:05:03 +0000 |
---|---|---|
committer | mdkinney <mdkinney@6f19259b-4bc3-4df7-8a09-765794883524> | 2009-07-01 18:05:03 +0000 |
commit | 2229029afc183e4b84c255893d0a2974d8086863 (patch) | |
tree | bcb197414f40cb5bc3aceec6bf6335e390f958e5 | |
parent | 04dd6cc01af0c18f6d75686b55537ba308a92ae6 (diff) | |
download | edk2-platforms-2229029afc183e4b84c255893d0a2974d8086863.tar.xz |
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
-rw-r--r-- | MdePkg/Include/Base.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/MdePkg/Include/Base.h b/MdePkg/Include/Base.h index f429acd658..3f71098861 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.
|