ShellPkg: Apply uncrustify changes

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3737

Apply uncrustify changes to .c/.h files in the ShellPkg package

Cc: Andrew Fish <afish@apple.com>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
This commit is contained in:
Michael Kubacki
2021-12-05 14:54:13 -08:00
committed by mergify[bot]
parent c411b485b6
commit 47d20b54f9
211 changed files with 30269 additions and 27004 deletions

View File

@ -9,22 +9,22 @@
#include "HexEditor.h"
#include <Protocol/BlockIo.h>
extern EFI_HANDLE HImageHandleBackup;
extern HEFI_EDITOR_BUFFER_IMAGE HBufferImage;
extern EFI_HANDLE HImageHandleBackup;
extern HEFI_EDITOR_BUFFER_IMAGE HBufferImage;
extern BOOLEAN HBufferImageNeedRefresh;
extern BOOLEAN HBufferImageOnlyLineNeedRefresh;
extern BOOLEAN HBufferImageMouseNeedRefresh;
extern BOOLEAN HBufferImageNeedRefresh;
extern BOOLEAN HBufferImageOnlyLineNeedRefresh;
extern BOOLEAN HBufferImageMouseNeedRefresh;
extern HEFI_EDITOR_GLOBAL_EDITOR HMainEditor;
HEFI_EDITOR_DISK_IMAGE HDiskImage;
HEFI_EDITOR_DISK_IMAGE HDiskImageBackupVar;
HEFI_EDITOR_DISK_IMAGE HDiskImage;
HEFI_EDITOR_DISK_IMAGE HDiskImageBackupVar;
//
// for basic initialization of HDiskImage
//
HEFI_EDITOR_DISK_IMAGE HDiskImageConst = {
HEFI_EDITOR_DISK_IMAGE HDiskImageConst = {
NULL,
0,
0,
@ -70,13 +70,13 @@ HDiskImageBackup (
//
SHELL_FREE_NON_NULL (HDiskImageBackupVar.Name);
HDiskImageBackupVar.Name = CatSPrint(NULL, L"%s", HDiskImage.Name);
HDiskImageBackupVar.Name = CatSPrint (NULL, L"%s", HDiskImage.Name);
if (HDiskImageBackupVar.Name == NULL) {
return EFI_OUT_OF_RESOURCES;
}
HDiskImageBackupVar.Offset = HDiskImage.Offset;
HDiskImageBackupVar.Size = HDiskImage.Size;
HDiskImageBackupVar.Offset = HDiskImage.Offset;
HDiskImageBackupVar.Size = HDiskImage.Size;
return EFI_SUCCESS;
}
@ -109,9 +109,9 @@ HDiskImageCleanup (
**/
EFI_STATUS
HDiskImageSetDiskNameOffsetSize (
IN CONST CHAR16 *Str,
IN UINTN Offset,
IN UINTN Size
IN CONST CHAR16 *Str,
IN UINTN Offset,
IN UINTN Size
)
{
if (Str == HDiskImage.Name) {
@ -131,8 +131,8 @@ HDiskImageSetDiskNameOffsetSize (
return EFI_OUT_OF_RESOURCES;
}
HDiskImage.Offset = Offset;
HDiskImage.Size = Size;
HDiskImage.Offset = Offset;
HDiskImage.Size = Size;
return EFI_SUCCESS;
}
@ -152,10 +152,10 @@ HDiskImageSetDiskNameOffsetSize (
**/
EFI_STATUS
HDiskImageRead (
IN CONST CHAR16 *DeviceName,
IN UINTN Offset,
IN UINTN Size,
IN BOOLEAN Recover
IN CONST CHAR16 *DeviceName,
IN UINTN Offset,
IN UINTN Size,
IN BOOLEAN Recover
)
{
CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath;
@ -165,46 +165,49 @@ HDiskImageRead (
EFI_BLOCK_IO_PROTOCOL *BlkIo;
EFI_STATUS Status;
VOID *Buffer;
CHAR16 *Str;
UINTN Bytes;
VOID *Buffer;
CHAR16 *Str;
UINTN Bytes;
HEFI_EDITOR_LINE *Line;
HEFI_EDITOR_LINE *Line;
HBufferImage.BufferType = FileTypeDiskBuffer;
DevicePath = gEfiShellProtocol->GetDevicePathFromMap(DeviceName);
DevicePath = gEfiShellProtocol->GetDevicePathFromMap (DeviceName);
if (DevicePath == NULL) {
StatusBarSetStatusString (L"Cannot Find Device");
return EFI_INVALID_PARAMETER;
}
DupDevicePath = DuplicateDevicePath(DevicePath);
DupDevicePath = DuplicateDevicePath (DevicePath);
DupDevicePathForFree = DupDevicePath;
//
// get blkio interface
//
Status = gBS->LocateDevicePath(&gEfiBlockIoProtocolGuid,&DupDevicePath,&Handle);
FreePool(DupDevicePathForFree);
Status = gBS->LocateDevicePath (&gEfiBlockIoProtocolGuid, &DupDevicePath, &Handle);
FreePool (DupDevicePathForFree);
if (EFI_ERROR (Status)) {
StatusBarSetStatusString (L"Read Disk Failed");
return Status;
}
Status = gBS->OpenProtocol(Handle, &gEfiBlockIoProtocolGuid, (VOID**)&BlkIo, gImageHandle, NULL, EFI_OPEN_PROTOCOL_GET_PROTOCOL);
Status = gBS->OpenProtocol (Handle, &gEfiBlockIoProtocolGuid, (VOID **)&BlkIo, gImageHandle, NULL, EFI_OPEN_PROTOCOL_GET_PROTOCOL);
if (EFI_ERROR (Status)) {
StatusBarSetStatusString (L"Read Disk Failed");
return Status;
}
//
// if Offset exceeds LastBlock,
// return error
//
if (Offset > BlkIo->Media->LastBlock || Offset + Size > BlkIo->Media->LastBlock) {
if ((Offset > BlkIo->Media->LastBlock) || (Offset + Size > BlkIo->Media->LastBlock)) {
StatusBarSetStatusString (L"Invalid Offset + Size");
return EFI_LOAD_ERROR;
}
Bytes = BlkIo->Media->BlockSize * Size;
Buffer = AllocateZeroPool (Bytes);
Bytes = BlkIo->Media->BlockSize * Size;
Buffer = AllocateZeroPool (Bytes);
if (Buffer == NULL) {
StatusBarSetStatusString (L"Read Disk Failed");
@ -246,25 +249,26 @@ HDiskImageRead (
StatusBarSetStatusString (L"Read Disk Failed");
return EFI_OUT_OF_RESOURCES;
}
//
// initialize some variables
//
HDiskImage.BlockSize = BlkIo->Media->BlockSize;
HDiskImage.BlockSize = BlkIo->Media->BlockSize;
HBufferImage.DisplayPosition.Row = 2;
HBufferImage.DisplayPosition.Column = 10;
HBufferImage.MousePosition.Row = 2;
HBufferImage.MousePosition.Column = 10;
HBufferImage.MousePosition.Row = 2;
HBufferImage.MousePosition.Column = 10;
HBufferImage.LowVisibleRow = 1;
HBufferImage.HighBits = TRUE;
HBufferImage.LowVisibleRow = 1;
HBufferImage.HighBits = TRUE;
HBufferImage.BufferPosition.Row = 1;
HBufferImage.BufferPosition.Column = 1;
HBufferImage.BufferPosition.Row = 1;
HBufferImage.BufferPosition.Column = 1;
if (!Recover) {
Str = CatSPrint(NULL, L"%d Lines Read", HBufferImage.NumLines);
Str = CatSPrint (NULL, L"%d Lines Read", HBufferImage.NumLines);
if (Str == NULL) {
StatusBarSetStatusString (L"Read Disk Failed");
return EFI_OUT_OF_RESOURCES;
@ -275,7 +279,6 @@ HDiskImageRead (
HMainEditor.SelectStart = 0;
HMainEditor.SelectEnd = 0;
}
//
@ -283,11 +286,11 @@ HDiskImageRead (
//
if (HBufferImage.Lines != NULL) {
HBufferImage.CurrentLine = CR (
HBufferImage.ListHead->ForwardLink,
HEFI_EDITOR_LINE,
Link,
EFI_EDITOR_LINE_LIST
);
HBufferImage.ListHead->ForwardLink,
HEFI_EDITOR_LINE,
Link,
EFI_EDITOR_LINE_LIST
);
} else {
//
// create a dummy line
@ -324,12 +327,11 @@ HDiskImageRead (
**/
EFI_STATUS
HDiskImageSave (
IN CHAR16 *DeviceName,
IN UINTN Offset,
IN UINTN Size
IN CHAR16 *DeviceName,
IN UINTN Offset,
IN UINTN Size
)
{
CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath;
EFI_DEVICE_PATH_PROTOCOL *DupDevicePath;
EFI_DEVICE_PATH_PROTOCOL *DupDevicePathForFree;
@ -348,35 +350,38 @@ HDiskImageSave (
HBufferImage.BufferType = FileTypeDiskBuffer;
DevicePath = gEfiShellProtocol->GetDevicePathFromMap(DeviceName);
DevicePath = gEfiShellProtocol->GetDevicePathFromMap (DeviceName);
if (DevicePath == NULL) {
// StatusBarSetStatusString (L"Cannot Find Device");
// StatusBarSetStatusString (L"Cannot Find Device");
return EFI_INVALID_PARAMETER;
}
DupDevicePath = DuplicateDevicePath(DevicePath);
DupDevicePath = DuplicateDevicePath (DevicePath);
DupDevicePathForFree = DupDevicePath;
//
// get blkio interface
//
Status = gBS->LocateDevicePath(&gEfiBlockIoProtocolGuid,&DupDevicePath,&Handle);
FreePool(DupDevicePathForFree);
Status = gBS->LocateDevicePath (&gEfiBlockIoProtocolGuid, &DupDevicePath, &Handle);
FreePool (DupDevicePathForFree);
if (EFI_ERROR (Status)) {
// StatusBarSetStatusString (L"Read Disk Failed");
return Status;
}
Status = gBS->OpenProtocol(Handle, &gEfiBlockIoProtocolGuid, (VOID**)&BlkIo, gImageHandle, NULL, EFI_OPEN_PROTOCOL_GET_PROTOCOL);
if (EFI_ERROR (Status)) {
// StatusBarSetStatusString (L"Read Disk Failed");
// StatusBarSetStatusString (L"Read Disk Failed");
return Status;
}
Bytes = BlkIo->Media->BlockSize * Size;
Buffer = AllocateZeroPool (Bytes);
Status = gBS->OpenProtocol (Handle, &gEfiBlockIoProtocolGuid, (VOID **)&BlkIo, gImageHandle, NULL, EFI_OPEN_PROTOCOL_GET_PROTOCOL);
if (EFI_ERROR (Status)) {
// StatusBarSetStatusString (L"Read Disk Failed");
return Status;
}
Bytes = BlkIo->Media->BlockSize * Size;
Buffer = AllocateZeroPool (Bytes);
if (Buffer == NULL) {
return EFI_OUT_OF_RESOURCES;
}
//
// concatenate the line list to a buffer
//
@ -402,6 +407,7 @@ HDiskImageSave (
if (EFI_ERROR (Status)) {
return EFI_LOAD_ERROR;
}
//
// now not modified
//