EdkCompatibilityPkg/Sample/Tools: rebase to ARRAY_SIZE()

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>
This commit is contained in:
Laszlo Ersek 2016-10-26 18:31:20 +02:00
parent abcdd98be3
commit bd79132f3e
2 changed files with 3 additions and 3 deletions

View File

@ -397,8 +397,8 @@ GetCodeTypeStr (
UINT8 CodeType
)
{
if (CodeType >= sizeof (mCodeTypeStr) / sizeof (*mCodeTypeStr)) {
CodeType = sizeof (mCodeTypeStr) / sizeof (*mCodeTypeStr) - 1;
if (CodeType >= ARRAY_SIZE (mCodeTypeStr)) {
CodeType = ARRAY_SIZE (mCodeTypeStr) - 1;
}
return mCodeTypeStr[CodeType];
}

View File

@ -470,7 +470,7 @@ static const IFR_PARSE_TABLE_ENTRY mIfrParseTable[] = {
IfrParse2A
},
};
#define PARSE_TABLE_ENTRIES (sizeof (mIfrParseTable) / sizeof (mIfrParseTable[0]))
#define PARSE_TABLE_ENTRIES (ARRAY_SIZE (mIfrParseTable))
static
STATUS