]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ShellPkg: Fix several GCC compiler warnings
authorjljusten <jljusten@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 17 Sep 2010 20:09:48 +0000 (20:09 +0000)
committerjljusten <jljusten@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 17 Sep 2010 20:09:48 +0000 (20:09 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10890 6f19259b-4bc3-4df7-8a09-765794883524

ShellPkg/Application/Shell/ShellProtocol.c
ShellPkg/Library/UefiShellLevel1CommandsLib/If.c
ShellPkg/Library/UefiShellLevel2CommandsLib/Cp.c
ShellPkg/Library/UefiShellLevel2CommandsLib/Map.c

index 214693f2ae37dbeff58762930eab5740c5b42d5e..27488ab62ee238aaabc2a3a4c8b5f060076c72f7 100644 (file)
@@ -488,7 +488,9 @@ EfiShellGetDevicePathFromFilePath(
     NewPath = AllocateZeroPool(Size);\r
     ASSERT(NewPath != NULL);\r
     StrCpy(NewPath, Cwd);\r
     NewPath = AllocateZeroPool(Size);\r
     ASSERT(NewPath != NULL);\r
     StrCpy(NewPath, Cwd);\r
-    if (NewPath[StrLen(NewPath)-1] == Path[0] == (CHAR16)L'\\') {\r
+    if ((NewPath[0] == (CHAR16)L'\\') &&\r
+        (NewPath[StrLen(NewPath)-1] == (CHAR16)L'\\')\r
+       ) {\r
       ((CHAR16*)NewPath)[StrLen(NewPath)-1] = CHAR_NULL;\r
     }\r
     StrCat(NewPath, Path);\r
       ((CHAR16*)NewPath)[StrLen(NewPath)-1] = CHAR_NULL;\r
     }\r
     StrCat(NewPath, Path);\r
@@ -2958,7 +2960,7 @@ EFI_SHELL_PROTOCOL         mShellProtocol = {
 \r
   This must be removed via calling CleanUpShellProtocol().\r
 \r
 \r
   This must be removed via calling CleanUpShellProtocol().\r
 \r
-  @param[in,out] NewShell   The pointer to the pointer to the structure \r
+  @param[in,out] NewShell   The pointer to the pointer to the structure\r
   to install.\r
 \r
   @retval EFI_SUCCESS     The operation was successful.\r
   to install.\r
 \r
   @retval EFI_SUCCESS     The operation was successful.\r
@@ -3071,7 +3073,7 @@ CreatePopulateInstallShellProtocol (
 }\r
 \r
 /**\r
 }\r
 \r
 /**\r
-  Opposite of CreatePopulateInstallShellProtocol.  \r
+  Opposite of CreatePopulateInstallShellProtocol.\r
 \r
   Free all memory and restore the system to the state it was in before calling\r
   CreatePopulateInstallShellProtocol.\r
 \r
   Free all memory and restore the system to the state it was in before calling\r
   CreatePopulateInstallShellProtocol.\r
index 3376329622e6f5c075220bfe43dbaa6b00e7fb5f..3a154a2625bb41c0387e1ad1d76fe315e18a070f 100644 (file)
@@ -62,7 +62,7 @@ IsNextFragment (
     //\r
     *Statement+=StrLen(Fragment);\r
     while (*Statement[0] == L' ') {\r
     //\r
     *Statement+=StrLen(Fragment);\r
     while (*Statement[0] == L' ') {\r
-      *Statement++;\r
+      Statement++;\r
     }\r
     FreePool(Tester);\r
     return (TRUE);\r
     }\r
     FreePool(Tester);\r
     return (TRUE);\r
@@ -302,6 +302,9 @@ TestOperation (
     }\r
     return (FALSE);\r
     break;\r
     }\r
     return (FALSE);\r
     break;\r
+  default:\r
+    ASSERT(FALSE);\r
+    return (FALSE);\r
   }\r
   ASSERT(FALSE);\r
   return (FALSE);\r
   }\r
   ASSERT(FALSE);\r
   return (FALSE);\r
index e35bf18824a69532035a767474503a4c4830f106..94161cfecb3bf147b61e963018456ae5d38c55de 100644 (file)
@@ -111,6 +111,8 @@ CopySingleFile(
           *Resp = Response;\r
         case ShellPromptResponseYes:\r
           break;\r
           *Resp = Response;\r
         case ShellPromptResponseYes:\r
           break;\r
+        default:\r
+          return SHELL_ABORTED;\r
       }\r
     }\r
   }\r
       }\r
     }\r
   }\r
index 5d6a200c196abe88e45b129bb95c447deed2dc07..c4c8c87ff409d32bf56a3aba32c682cc1c02d58a 100644 (file)
@@ -790,9 +790,9 @@ IsNumberLetterOnly(
   )\r
 {\r
   while(String != NULL && *String != CHAR_NULL) {\r
   )\r
 {\r
   while(String != NULL && *String != CHAR_NULL) {\r
-    if (! ( *String >= L'a' && *String <= L'z'\r
-         || *String >= L'A' && *String <= L'Z'\r
-         || *String >= L'0' && *String <= L'9')\r
+    if (! ((*String >= L'a' && *String <= L'z') ||\r
+           (*String >= L'A' && *String <= L'Z') ||\r
+           (*String >= L'0' && *String <= L'9'))\r
         ){\r
       return (FALSE);\r
     }\r
         ){\r
       return (FALSE);\r
     }\r