]> git.proxmox.com Git - mirror_edk2.git/commitdiff
EdkCompatibilityPkg/Sample/Tools: rebase to ARRAY_SIZE()
authorLaszlo Ersek <lersek@redhat.com>
Wed, 26 Oct 2016 16:31:20 +0000 (18:31 +0200)
committerLaszlo Ersek <lersek@redhat.com>
Thu, 27 Oct 2016 09:10:54 +0000 (11:10 +0200)
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
EdkCompatibilityPkg/Sample/Tools/Source/EfiRom/EfiRom.c
EdkCompatibilityPkg/Sample/Tools/Source/HiiPack/IfrParse.c

index cf8efc86e1b4855b9e64416a7f4daec2d3f67afa..f787ae81c2b30af2c12f8c8a6244692431938cdc 100644 (file)
@@ -397,8 +397,8 @@ GetCodeTypeStr (
   UINT8     CodeType\r
   )\r
 {\r
-  if (CodeType >= sizeof (mCodeTypeStr) / sizeof (*mCodeTypeStr)) {\r
-    CodeType = sizeof (mCodeTypeStr) / sizeof (*mCodeTypeStr) - 1;\r
+  if (CodeType >= ARRAY_SIZE (mCodeTypeStr)) {\r
+    CodeType = ARRAY_SIZE (mCodeTypeStr) - 1;\r
   }\r
   return mCodeTypeStr[CodeType];\r
 }\r
index e69af5c25932542d134101f85b878ee01a797d5b..e60a2d9eeb306325951ff7f2b737ca75ed280b42 100644 (file)
@@ -470,7 +470,7 @@ static const IFR_PARSE_TABLE_ENTRY  mIfrParseTable[] = {
     IfrParse2A\r
   },\r
 };\r
-#define PARSE_TABLE_ENTRIES (sizeof (mIfrParseTable) / sizeof (mIfrParseTable[0]))\r
+#define PARSE_TABLE_ENTRIES (ARRAY_SIZE (mIfrParseTable))\r
 \r
 static\r
 STATUS\r