]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg/DxeCore: Fixed build error.
authorStar Zeng <star.zeng@intel.com>
Fri, 29 May 2015 04:04:01 +0000 (04:04 +0000)
committerlzeng14 <lzeng14@Edk2>
Fri, 29 May 2015 04:04:01 +0000 (04:04 +0000)
ARM toolchain raises the build error: "enumerated type mixed with
another type".

To fix the issue, typecase can be used like below.
 -    return EfiMaxMemoryType + 1;
 +    return (EFI_MEMORY_TYPE)(EfiMaxMemoryType + 1);

But to eliminate the confusion, update the return type of
GetProfileMemoryIndex() from EFI_MEMORY_TYPE to UINTN.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17535 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Core/Dxe/Mem/MemoryProfileRecord.c

index 2c6713f5e97bd2c2c2b66766220a4b44e26ebcc1..1f17947808e92972aca50f6f2d0ad06449337e50 100644 (file)
@@ -778,10 +778,10 @@ CoreNeedRecordProfile (
 \r
   @param MemoryType     Memory type.\r
 \r
-  @return EFI memory type as profile memory index.\r
+  @return Profile memory index.\r
 \r
 **/\r
-EFI_MEMORY_TYPE\r
+UINTN\r
 GetProfileMemoryIndex (\r
   IN EFI_MEMORY_TYPE    MemoryType\r
   )\r
@@ -824,7 +824,7 @@ CoreUpdateProfileAllocate (
   MEMORY_PROFILE_CONTEXT_DATA       *ContextData;\r
   MEMORY_PROFILE_DRIVER_INFO_DATA   *DriverInfoData;\r
   MEMORY_PROFILE_ALLOC_INFO_DATA    *AllocInfoData;\r
-  EFI_MEMORY_TYPE                   ProfileMemoryIndex;\r
+  UINTN                             ProfileMemoryIndex;\r
 \r
   AllocInfoData = NULL;\r
 \r
@@ -977,7 +977,7 @@ CoreUpdateProfileFree (
   LIST_ENTRY                       *DriverInfoList;\r
   MEMORY_PROFILE_DRIVER_INFO_DATA  *ThisDriverInfoData;\r
   MEMORY_PROFILE_ALLOC_INFO_DATA   *AllocInfoData;\r
-  EFI_MEMORY_TYPE                  ProfileMemoryIndex;\r
+  UINTN                            ProfileMemoryIndex;\r
 \r
   ContextData = GetMemoryProfileContext ();\r
   if (ContextData == NULL) {\r