]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Update BASE_ARG() macro to pass static analysis tools. This change should not cause...
authormdkinney <mdkinney@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 1 Jul 2009 18:05:03 +0000 (18:05 +0000)
committermdkinney <mdkinney@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 1 Jul 2009 18:05:03 +0000 (18:05 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8707 6f19259b-4bc3-4df7-8a09-765794883524

MdePkg/Include/Base.h

index f429acd65834ad8edeb39d730e494ce7011ee6db..3f71098861f2b3a6dafe51ce930e89a8fd50a898 100644 (file)
@@ -414,6 +414,15 @@ typedef CHAR8 *VA_LIST;
 ///\r
 typedef UINTN  *BASE_LIST;\r
 \r
+/**\r
+  Returns the size of a data type in sizeof(UINTN) units rounded up to the nearest UINTN boundary.\r
+\r
+  @param  TYPE  The date type to determine the size of.\r
+\r
+  @return The size of TYPE in sizeof (UINTN) units rounded up to the nearest UINTN boundary.\r
+**/\r
+#define _BASE_INT_SIZE_OF(TYPE) ((sizeof (TYPE) + sizeof (UINTN) - 1) / sizeof (UINTN))\r
+\r
 /**\r
   Returns an argument of a specified type from a variable argument list and updates \r
   the pointer to the variable argument list to point to the next argument. \r
@@ -430,7 +439,7 @@ typedef UINTN  *BASE_LIST;
   @return  An argument of the type specified by TYPE.\r
 \r
 **/\r
-#define BASE_ARG(Marker, TYPE) (*(TYPE *)((UINT8 *)(Marker = (BASE_LIST)((UINT8 *)Marker + _INT_SIZE_OF (TYPE))) - _INT_SIZE_OF (TYPE)))\r
+#define BASE_ARG(Marker, TYPE)   (*(TYPE *) ((Marker += _BASE_INT_SIZE_OF (TYPE)) - _BASE_INT_SIZE_OF (TYPE)))\r
 \r
 /**\r
   Macro that returns the byte offset of a field in a data structure. \r