Revision: 19712
http://sourceforge.net/p/edk2/code/19712
Author: lersek
Date: 2016-01-21 18:40:17 +0000 (Thu, 21 Jan 2016)
Log Message:
-----------
ShellPkg: BcfgDisplayDump(): call Description[Size] by name
Introduce two more helper variables to avoid repeated pointer arithmetic.
This patch is not supposed to change behavior.
Cc: Jaben Carsey <[email protected]>
Cc: Ryan Harkin <[email protected]>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <[email protected]>
Reviewed-by: Jaben Carsey <[email protected]>
Modified Paths:
--------------
trunk/edk2/ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.c
Modified:
trunk/edk2/ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.c
===================================================================
---
trunk/edk2/ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.c
2016-01-21 18:40:13 UTC (rev 19711)
+++
trunk/edk2/ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.c
2016-01-21 18:40:17 UTC (rev 19712)
@@ -1053,6 +1053,8 @@
VOID *DevPath;
UINTN Errors;
EFI_LOAD_OPTION *LoadOption;
+ CHAR16 *Description;
+ UINTN DescriptionSize;
if (OrderCount == 0) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN(STR_BCFG_NONE),
gShellBcfgHiiHandle, L"bcfg");
@@ -1108,12 +1110,15 @@
++Errors;
goto Cleanup;
}
- LoadOption = (EFI_LOAD_OPTION *)Buffer;
+ LoadOption = (EFI_LOAD_OPTION *)Buffer;
+ Description = (CHAR16 *)(&LoadOption->FilePathListLength + 1);
+ DescriptionSize = StrSize (Description);
+
if (LoadOption->FilePathListLength != 0) {
DevPath = AllocateZeroPool(LoadOption->FilePathListLength);
if (DevPath != NULL) {
- CopyMem(DevPath, Buffer+6+StrSize((CHAR16*)(Buffer+6)),
LoadOption->FilePathListLength);
+ CopyMem(DevPath, Buffer+6+DescriptionSize,
LoadOption->FilePathListLength);
DevPathString = ConvertDevicePathToText(DevPath, TRUE, FALSE);
}
}
@@ -1125,11 +1130,11 @@
gShellBcfgHiiHandle,
LoopVar,
VariableName,
- (CHAR16*)(Buffer+6),
+ Description,
DevPathString,
- (StrSize((CHAR16*)(Buffer+6)) + LoadOption->FilePathListLength + 6) <=
BufferSize?L'N':L'Y');
+ (DescriptionSize + LoadOption->FilePathListLength + 6) <=
BufferSize?L'N':L'Y');
if (VerboseOutput) {
- for (LoopVar2 = (StrSize((CHAR16*)(Buffer+6)) +
LoadOption->FilePathListLength + 6);LoopVar2<BufferSize;LoopVar2++){
+ for (LoopVar2 = (DescriptionSize + LoadOption->FilePathListLength +
6);LoopVar2<BufferSize;LoopVar2++){
ShellPrintEx(
-1,
-1,
------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits