X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=ShellPkg%2FLibrary%2FUefiShellDebug1CommandsLib%2FComp.c;h=f45f663dbbbf20399274f47f62a67907796b4b91;hb=8a765da2a3da23607cd46c18c7d05937cd09d799;hp=5b91327efcb7d219ceb9b514b565057641439eed;hpb=31abcf1dc773c7663363d599b8e34bfe58b7a0e5;p=mirror_edk2.git diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/Comp.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/Comp.c index 5b91327efc..f45f663dbb 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Comp.c +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/Comp.c @@ -30,7 +30,8 @@ typedef enum { /** Function to print differnt point data. - @param[in] FileName File name + @param[in] FileName File name. + @param[in] FileTag File tag name. @param[in] Buffer Data buffer to be printed. @param[in] BufferSize Size of the data to be printed. @param[in] Address Address of the differnt point. @@ -40,24 +41,25 @@ typedef enum { VOID PrintDifferentPoint( CONST CHAR16 *FileName, + CHAR16 *FileTag, UINT8 *Buffer, - UINT64 DataSize, + UINT64 BufferSize, UINTN Address, - UINT64 BufferSize + UINT64 DifferentBytes ) { UINTN Index; - ShellPrintEx (-1, -1, L"%s: %s\r\n %08x:", L"File1", FileName, Address); + ShellPrintEx (-1, -1, L"%s: %s\r\n %08x:", FileTag, FileName, Address); // // Print data in hex-format. // - for (Index = 0; Index < DataSize; Index++) { + for (Index = 0; Index < BufferSize; Index++) { ShellPrintEx (-1, -1, L" %02x", Buffer[Index]); } - if (DataSize < BufferSize) { + if (BufferSize < DifferentBytes) { ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_COMP_END_OF_FILE), gShellDebug1HiiHandle); } @@ -66,7 +68,7 @@ PrintDifferentPoint( // // Print data in char-format. // - for (Index = 0; Index < DataSize; Index++) { + for (Index = 0; Index < BufferSize; Index++) { if (Buffer[Index] >= 0x20 && Buffer[Index] <= 0x7E) { ShellPrintEx (-1, -1, L"%c", Buffer[Index]); } else { @@ -302,8 +304,8 @@ ShellCommandRunComp ( ) { ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_COMP_DIFFERENCE_POINT), gShellDebug1HiiHandle, ++DiffPointNumber); - PrintDifferentPoint (FileName1, DataFromFile1, InsertPosition1, DiffPointAddress, DifferentBytes); - PrintDifferentPoint (FileName2, DataFromFile2, InsertPosition2, DiffPointAddress, DifferentBytes); + PrintDifferentPoint (FileName1, L"File1", DataFromFile1, InsertPosition1, DiffPointAddress, DifferentBytes); + PrintDifferentPoint (FileName2, L"File2", DataFromFile2, InsertPosition2, DiffPointAddress, DifferentBytes); // // One of two buffuers is empty, it means this is the last different point.