From: jljusten Date: Fri, 17 Sep 2010 20:09:48 +0000 (+0000) Subject: ShellPkg: Fix several GCC compiler warnings X-Git-Tag: edk2-stable201903~15533 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=e97233217ed6d37d7bb7fefb0ff0821515a23b48 ShellPkg: Fix several GCC compiler warnings git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10890 6f19259b-4bc3-4df7-8a09-765794883524 --- diff --git a/ShellPkg/Application/Shell/ShellProtocol.c b/ShellPkg/Application/Shell/ShellProtocol.c index 214693f2ae..27488ab62e 100644 --- a/ShellPkg/Application/Shell/ShellProtocol.c +++ b/ShellPkg/Application/Shell/ShellProtocol.c @@ -488,7 +488,9 @@ EfiShellGetDevicePathFromFilePath( NewPath = AllocateZeroPool(Size); ASSERT(NewPath != NULL); StrCpy(NewPath, Cwd); - if (NewPath[StrLen(NewPath)-1] == Path[0] == (CHAR16)L'\\') { + if ((NewPath[0] == (CHAR16)L'\\') && + (NewPath[StrLen(NewPath)-1] == (CHAR16)L'\\') + ) { ((CHAR16*)NewPath)[StrLen(NewPath)-1] = CHAR_NULL; } StrCat(NewPath, Path); @@ -2958,7 +2960,7 @@ EFI_SHELL_PROTOCOL mShellProtocol = { This must be removed via calling CleanUpShellProtocol(). - @param[in,out] NewShell The pointer to the pointer to the structure + @param[in,out] NewShell The pointer to the pointer to the structure to install. @retval EFI_SUCCESS The operation was successful. @@ -3071,7 +3073,7 @@ CreatePopulateInstallShellProtocol ( } /** - Opposite of CreatePopulateInstallShellProtocol. + Opposite of CreatePopulateInstallShellProtocol. Free all memory and restore the system to the state it was in before calling CreatePopulateInstallShellProtocol. diff --git a/ShellPkg/Library/UefiShellLevel1CommandsLib/If.c b/ShellPkg/Library/UefiShellLevel1CommandsLib/If.c index 3376329622..3a154a2625 100644 --- a/ShellPkg/Library/UefiShellLevel1CommandsLib/If.c +++ b/ShellPkg/Library/UefiShellLevel1CommandsLib/If.c @@ -62,7 +62,7 @@ IsNextFragment ( // *Statement+=StrLen(Fragment); while (*Statement[0] == L' ') { - *Statement++; + Statement++; } FreePool(Tester); return (TRUE); @@ -302,6 +302,9 @@ TestOperation ( } return (FALSE); break; + default: + ASSERT(FALSE); + return (FALSE); } ASSERT(FALSE); return (FALSE); diff --git a/ShellPkg/Library/UefiShellLevel2CommandsLib/Cp.c b/ShellPkg/Library/UefiShellLevel2CommandsLib/Cp.c index e35bf18824..94161cfecb 100644 --- a/ShellPkg/Library/UefiShellLevel2CommandsLib/Cp.c +++ b/ShellPkg/Library/UefiShellLevel2CommandsLib/Cp.c @@ -111,6 +111,8 @@ CopySingleFile( *Resp = Response; case ShellPromptResponseYes: break; + default: + return SHELL_ABORTED; } } } diff --git a/ShellPkg/Library/UefiShellLevel2CommandsLib/Map.c b/ShellPkg/Library/UefiShellLevel2CommandsLib/Map.c index 5d6a200c19..c4c8c87ff4 100644 --- a/ShellPkg/Library/UefiShellLevel2CommandsLib/Map.c +++ b/ShellPkg/Library/UefiShellLevel2CommandsLib/Map.c @@ -790,9 +790,9 @@ IsNumberLetterOnly( ) { while(String != NULL && *String != CHAR_NULL) { - if (! ( *String >= L'a' && *String <= L'z' - || *String >= L'A' && *String <= L'Z' - || *String >= L'0' && *String <= L'9') + if (! ((*String >= L'a' && *String <= L'z') || + (*String >= L'A' && *String <= L'Z') || + (*String >= L'0' && *String <= L'9')) ){ return (FALSE); }