]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Core/Dxe/Gcd/Gcd.c
Fix comparisons of enumerated types which may cause warnings for some compilers.
[mirror_edk2.git] / MdeModulePkg / Core / Dxe / Gcd / Gcd.c
index 49697ae89c0535a7ae9dbfca0fcee8e8c5e434d1..c351d215dc284b5ac94259b5c055fe2ed353b4cf 100644 (file)
@@ -3,7 +3,7 @@
   The GCD services are used to manage the memory and I/O regions that\r
   are accessible to the CPU that is executing the DXE core.\r
 \r
-Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -1012,15 +1012,15 @@ CoreAllocateSpace (
   //\r
   // Make sure parameters are valid\r
   //\r
-  if (GcdAllocateType < 0 || GcdAllocateType >= EfiGcdMaxAllocateType) {\r
+  if ((UINT32)GcdAllocateType >= EfiGcdMaxAllocateType) {\r
     DEBUG ((DEBUG_GCD, "  Status = %r\n", EFI_INVALID_PARAMETER));\r
     return EFI_INVALID_PARAMETER;\r
   }\r
-  if (GcdMemoryType < 0 || GcdMemoryType >= EfiGcdMemoryTypeMaximum) {\r
+  if ((UINT32)GcdMemoryType >= EfiGcdMemoryTypeMaximum) {\r
     DEBUG ((DEBUG_GCD, "  Status = %r\n", EFI_INVALID_PARAMETER));\r
     return EFI_INVALID_PARAMETER;\r
   }\r
-  if (GcdIoType < 0 || GcdIoType >= EfiGcdIoTypeMaximum) {\r
+  if ((UINT32)GcdIoType >= EfiGcdIoTypeMaximum) {\r
     DEBUG ((DEBUG_GCD, "  Status = %r\n", EFI_INVALID_PARAMETER));\r
     return EFI_INVALID_PARAMETER;\r
   }\r