ASSERT (NewMenuEntry != NULL);\r
NewTerminalContext = (BM_TERMINAL_CONTEXT *) NewMenuEntry->VariableContext;\r
NewTerminalContext->BaudRateIndex = BmmData->COMBaudRate[Index];\r
- ASSERT (BmmData->COMBaudRate[Index] < (sizeof (BaudRateList) / sizeof (BaudRateList[0])));\r
+ ASSERT (BmmData->COMBaudRate[Index] < (ARRAY_SIZE (BaudRateList)));\r
NewTerminalContext->BaudRate = BaudRateList[BmmData->COMBaudRate[Index]].Value;\r
NewTerminalContext->DataBitsIndex = BmmData->COMDataRate[Index];\r
- ASSERT (BmmData->COMDataRate[Index] < (sizeof (DataBitsList) / sizeof (DataBitsList[0])));\r
+ ASSERT (BmmData->COMDataRate[Index] < (ARRAY_SIZE (DataBitsList)));\r
NewTerminalContext->DataBits = (UINT8) DataBitsList[BmmData->COMDataRate[Index]].Value;\r
NewTerminalContext->StopBitsIndex = BmmData->COMStopBits[Index];\r
- ASSERT (BmmData->COMStopBits[Index] < (sizeof (StopBitsList) / sizeof (StopBitsList[0])));\r
+ ASSERT (BmmData->COMStopBits[Index] < (ARRAY_SIZE (StopBitsList)));\r
NewTerminalContext->StopBits = (UINT8) StopBitsList[BmmData->COMStopBits[Index]].Value;\r
NewTerminalContext->ParityIndex = BmmData->COMParity[Index];\r
- ASSERT (BmmData->COMParity[Index] < (sizeof (ParityList) / sizeof (ParityList[0])));\r
+ ASSERT (BmmData->COMParity[Index] < (ARRAY_SIZE (ParityList)));\r
NewTerminalContext->Parity = (UINT8) ParityList[BmmData->COMParity[Index]].Value;\r
NewTerminalContext->TerminalType = BmmData->COMTerminalType[Index];\r
NewTerminalContext->FlowControl = BmmData->COMFlowControl[Index];\r
Vendor.Header.Type = MESSAGING_DEVICE_PATH;\r
Vendor.Header.SubType = MSG_VENDOR_DP;\r
\r
- for (Index2 = 0; Index2 < (sizeof (TerminalTypeGuid) / sizeof (TerminalTypeGuid[0])); Index2++) {\r
+ for (Index2 = 0; Index2 < (ARRAY_SIZE (TerminalTypeGuid)); Index2++) {\r
CopyMem (&Vendor.Guid, &TerminalTypeGuid[Index2], sizeof (EFI_GUID));\r
SetDevicePathNodeLength (&Vendor.Header, sizeof (VENDOR_DEVICE_PATH));\r
NewDevicePath = AppendDevicePathNode (\r
break;\r
}\r
}\r
- for (AttributeIndex = 0; AttributeIndex < sizeof (DataBitsList) / sizeof (DataBitsList[0]); AttributeIndex++) {\r
+ for (AttributeIndex = 0; AttributeIndex < ARRAY_SIZE (DataBitsList); AttributeIndex++) {\r
if (NewTerminalContext->DataBits == (UINT64) (DataBitsList[AttributeIndex].Value)) {\r
NewTerminalContext->DataBitsIndex = AttributeIndex;\r
break;\r
}\r
} \r
\r
- for (AttributeIndex = 0; AttributeIndex < sizeof (ParityList) / sizeof (ParityList[0]); AttributeIndex++) {\r
+ for (AttributeIndex = 0; AttributeIndex < ARRAY_SIZE (ParityList); AttributeIndex++) {\r
if (NewTerminalContext->Parity == (UINT64) (ParityList[AttributeIndex].Value)) {\r
NewTerminalContext->ParityIndex = AttributeIndex;\r
break;\r
}\r
}\r
\r
- for (AttributeIndex = 0; AttributeIndex < sizeof (StopBitsList) / sizeof (StopBitsList[0]); AttributeIndex++) {\r
+ for (AttributeIndex = 0; AttributeIndex < ARRAY_SIZE (StopBitsList); AttributeIndex++) {\r
if (NewTerminalContext->StopBits == (UINT64) (StopBitsList[AttributeIndex].Value)) {\r
NewTerminalContext->StopBitsIndex = AttributeIndex;\r
break;\r
//\r
UnicodeValueToString (ModeString, 0, Col, 0);\r
PStr = &ModeString[0];\r
- StrnCatS (PStr, sizeof (ModeString) / sizeof (ModeString[0]), L" x ", StrLen(L" x ") + 1);\r
+ StrnCatS (PStr, ARRAY_SIZE (ModeString), L" x ", StrLen(L" x ") + 1);\r
PStr = PStr + StrLen (PStr);\r
UnicodeValueToString (PStr , 0, Row, 0);\r
\r
OptionsOpCodeHandle = HiiAllocateOpCodeHandle ();\r
ASSERT (OptionsOpCodeHandle != NULL);\r
\r
- for (Index = 0; Index < sizeof (DataBitsList) / sizeof (DataBitsList[0]); Index++) {\r
+ for (Index = 0; Index < ARRAY_SIZE (DataBitsList); Index++) {\r
CheckFlags = 0;\r
\r
if (DataBitsList[Index].Value == 8) {\r
OptionsOpCodeHandle = HiiAllocateOpCodeHandle ();\r
ASSERT (OptionsOpCodeHandle != NULL);\r
\r
- for (Index = 0; Index < sizeof (ParityList) / sizeof (ParityList[0]); Index++) {\r
+ for (Index = 0; Index < ARRAY_SIZE (ParityList); Index++) {\r
CheckFlags = 0;\r
if (ParityList[Index].Value == NoParity) {\r
CheckFlags |= EFI_IFR_OPTION_DEFAULT;\r
OptionsOpCodeHandle = HiiAllocateOpCodeHandle ();\r
ASSERT (OptionsOpCodeHandle != NULL);\r
\r
- for (Index = 0; Index < sizeof (StopBitsList) / sizeof (StopBitsList[0]); Index++) {\r
+ for (Index = 0; Index < ARRAY_SIZE (StopBitsList); Index++) {\r
CheckFlags = 0;\r
if (StopBitsList[Index].Value == OneStopBit) {\r
CheckFlags |= EFI_IFR_OPTION_DEFAULT;\r
OptionsOpCodeHandle = HiiAllocateOpCodeHandle ();\r
ASSERT (OptionsOpCodeHandle != NULL);\r
\r
- for (Index = 0; Index < sizeof (TerminalType) / sizeof (TerminalType[0]); Index++) {\r
+ for (Index = 0; Index < ARRAY_SIZE (TerminalType); Index++) {\r
CheckFlags = 0;\r
if (Index == 0) {\r
CheckFlags |= EFI_IFR_OPTION_DEFAULT;\r
OptionsOpCodeHandle = HiiAllocateOpCodeHandle ();\r
ASSERT (OptionsOpCodeHandle != NULL);\r
\r
- for (Index = 0; Index < sizeof (mFlowControlType) / sizeof (mFlowControlType[0]); Index++) {\r
+ for (Index = 0; Index < ARRAY_SIZE (mFlowControlType); Index++) {\r
CheckFlags = 0;\r
if (Index == 0) {\r
CheckFlags |= EFI_IFR_OPTION_DEFAULT;\r
Vendor.Header.Type = MESSAGING_DEVICE_PATH;\r
Vendor.Header.SubType = MSG_VENDOR_DP;\r
\r
- ASSERT (NewTerminalContext->TerminalType < (sizeof (TerminalTypeGuid) / sizeof (TerminalTypeGuid[0])));\r
+ ASSERT (NewTerminalContext->TerminalType < (ARRAY_SIZE (TerminalTypeGuid)));\r
CopyMem (\r
&Vendor.Guid,\r
&TerminalTypeGuid[NewTerminalContext->TerminalType],\r