From cbcccd2c9d93a35884c344a3feaa773338675dff Mon Sep 17 00:00:00 2001 From: lgao4 Date: Mon, 13 May 2013 02:36:09 +0000 Subject: Update Code to pass EBC compiler. Signed-off-by: Liming Gao Reviewed-by: Star Zeng git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@14352 6f19259b-4bc3-4df7-8a09-765794883524 --- ShellPkg/Library/UefiShellLevel2CommandsLib/Map.c | 23 +++++++--------- ShellPkg/Library/UefiShellLevel2CommandsLib/Mv.c | 31 +++++++++------------- .../Library/UefiShellLevel3CommandsLib/GetMtc.c | 19 +++++-------- 3 files changed, 30 insertions(+), 43 deletions(-) (limited to 'ShellPkg') diff --git a/ShellPkg/Library/UefiShellLevel2CommandsLib/Map.c b/ShellPkg/Library/UefiShellLevel2CommandsLib/Map.c index 78e432bcd4..2725f4ad39 100644 --- a/ShellPkg/Library/UefiShellLevel2CommandsLib/Map.c +++ b/ShellPkg/Library/UefiShellLevel2CommandsLib/Map.c @@ -1,7 +1,7 @@ /** @file Main file for map shell level 2 command. - Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.
+ Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -1091,18 +1091,15 @@ ShellCommandRunMap ( if (SName != NULL) { Status = PerformMappingDelete(SName); if (EFI_ERROR(Status)) { - switch (Status) { - case EFI_ACCESS_DENIED: - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_ERR_AD), gShellLevel2HiiHandle); - ShellStatus = SHELL_ACCESS_DENIED; - break; - case EFI_NOT_FOUND: - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_MAP_NF), gShellLevel2HiiHandle, SName); - ShellStatus = SHELL_INVALID_PARAMETER; - break; - default: - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_ERR_UK), gShellLevel2HiiHandle, Status); - ShellStatus = SHELL_UNSUPPORTED; + if (Status == EFI_ACCESS_DENIED) { + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_ERR_AD), gShellLevel2HiiHandle); + ShellStatus = SHELL_ACCESS_DENIED; + } else if (Status == EFI_NOT_FOUND) { + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_MAP_NF), gShellLevel2HiiHandle, SName); + ShellStatus = SHELL_INVALID_PARAMETER; + } else { + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_ERR_UK), gShellLevel2HiiHandle, Status); + ShellStatus = SHELL_UNSUPPORTED; } } } else { diff --git a/ShellPkg/Library/UefiShellLevel2CommandsLib/Mv.c b/ShellPkg/Library/UefiShellLevel2CommandsLib/Mv.c index 11abee0766..9ce915b96c 100644 --- a/ShellPkg/Library/UefiShellLevel2CommandsLib/Mv.c +++ b/ShellPkg/Library/UefiShellLevel2CommandsLib/Mv.c @@ -1,7 +1,7 @@ /** @file Main file for mv shell level 2 function. - Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.
+ Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -404,23 +404,18 @@ ValidateAndMoveFiles( // if (EFI_ERROR(Status)) { ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_ERR_UK), gShellLevel2HiiHandle, Status); - // - // move failed - // - switch(Status){ - default: - ShellStatus = SHELL_INVALID_PARAMETER; - case EFI_SECURITY_VIOLATION: - ShellStatus = SHELL_SECURITY_VIOLATION; - case EFI_WRITE_PROTECTED: - ShellStatus = SHELL_WRITE_PROTECTED; - case EFI_OUT_OF_RESOURCES: - ShellStatus = SHELL_OUT_OF_RESOURCES; - case EFI_DEVICE_ERROR: - ShellStatus = SHELL_DEVICE_ERROR; - case EFI_ACCESS_DENIED: - ShellStatus = SHELL_ACCESS_DENIED; - } // switch + ShellStatus = SHELL_INVALID_PARAMETER; + if (Status == EFI_SECURITY_VIOLATION) { + ShellStatus = SHELL_SECURITY_VIOLATION; + } else if (Status == EFI_WRITE_PROTECTED) { + ShellStatus = SHELL_WRITE_PROTECTED; + } else if (Status == EFI_OUT_OF_RESOURCES) { + ShellStatus = SHELL_OUT_OF_RESOURCES; + } else if (Status == EFI_DEVICE_ERROR) { + ShellStatus = SHELL_DEVICE_ERROR; + } else if (Status == EFI_ACCESS_DENIED) { + ShellStatus = SHELL_ACCESS_DENIED; + } } else { ShellPrintEx(-1, -1, L"%s", HiiResultOk); } diff --git a/ShellPkg/Library/UefiShellLevel3CommandsLib/GetMtc.c b/ShellPkg/Library/UefiShellLevel3CommandsLib/GetMtc.c index ce1eb1fcf0..f1b20a13e3 100644 --- a/ShellPkg/Library/UefiShellLevel3CommandsLib/GetMtc.c +++ b/ShellPkg/Library/UefiShellLevel3CommandsLib/GetMtc.c @@ -1,7 +1,7 @@ /** @file Main file for GetMtc shell level 3 function. - Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.
+ Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -70,17 +70,12 @@ ShellCommandRunGetMtc ( // Get the monotonic counter count // Status = gBS->GetNextMonotonicCount(&Mtc); - switch(Status) { - case EFI_DEVICE_ERROR: - ShellStatus = SHELL_DEVICE_ERROR; - break; - case EFI_SECURITY_VIOLATION: - ShellStatus = SHELL_SECURITY_VIOLATION; - break; - default: - if (EFI_ERROR(Status)) { - ShellStatus = SHELL_DEVICE_ERROR; - } + if (Status == EFI_DEVICE_ERROR) { + ShellStatus = SHELL_DEVICE_ERROR; + } else if (Status == EFI_SECURITY_VIOLATION) { + ShellStatus = SHELL_SECURITY_VIOLATION; + } else if (EFI_ERROR(Status)) { + ShellStatus = SHELL_DEVICE_ERROR; } // -- cgit v1.2.3