]> git.proxmox.com Git - mirror_edk2.git/blobdiff - AppPkg/Applications/Sockets/GetHostByName/GetHostByName.c
StdLib: Fix more GCC warnings/errors caused by variables being set but not used.
[mirror_edk2.git] / AppPkg / Applications / Sockets / GetHostByName / GetHostByName.c
index f81ca96af05436654f70c1437ffe69b86834c4aa..4d4fe5460e0fc97563a027e350c4dec4961bf8d8 100644 (file)
@@ -1,17 +1,15 @@
 /** @file\r
   Translate the host name into an IP address\r
 \r
 /** @file\r
   Translate the host name into an IP address\r
 \r
-  Copyright (c) 2011, Intel Corporation\r
-  All rights reserved. This program and the accompanying materials\r
-  are licensed and made available under the terms and conditions of the BSD License\r
-  which accompanies this distribution.  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php\r
+  Copyright (c) 2011 - 2014, Intel Corporation. All rights reserved.<BR>\r
+  This program and the accompanying materials are licensed and made available under\r
+  the terms and conditions of the BSD License that accompanies this distribution.\r
+  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php.\r
 \r
   THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
   WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
 \r
   THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
   WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
 **/\r
 **/\r
-\r
 #include <errno.h>\r
 #include <netdb.h>\r
 #include <string.h>\r
 #include <errno.h>\r
 #include <netdb.h>\r
 #include <string.h>\r
 char mBuffer[65536];\r
 \r
 \r
 char mBuffer[65536];\r
 \r
 \r
-/**\r
-  Translate the host name into an IP address\r
+/** Translate the host name into an IP address\r
 \r
 \r
-  @param [in] Argc  The number of arguments\r
-  @param [in] Argv  The argument value array\r
+  @param[in]  Argc  The number of arguments\r
+  @param[in]  Argv  The argument value array\r
 \r
   @retval  0        The application exited normally.\r
   @retval  Other    An error occurred.\r
 \r
   @retval  0        The application exited normally.\r
   @retval  Other    An error occurred.\r
@@ -41,7 +38,6 @@ main (
   IN char **Argv\r
   )\r
 {\r
   IN char **Argv\r
   )\r
 {\r
-  int AppStatus;\r
   UINTN Index;\r
   struct hostent * pHost;\r
   UINT8 * pIpAddress;\r
   UINTN Index;\r
   struct hostent * pHost;\r
   UINT8 * pIpAddress;\r
@@ -51,17 +47,12 @@ main (
             "%a starting\r\n",\r
             Argv[0]));\r
 \r
             "%a starting\r\n",\r
             Argv[0]));\r
 \r
-  //\r
   //  Determine if the host name is specified\r
   //  Determine if the host name is specified\r
-  //\r
-  AppStatus = 0;\r
   if ( 1 == Argc ) {\r
     Print ( L"%a  <host name>\r\n", Argv[0]);\r
   }\r
   else {\r
   if ( 1 == Argc ) {\r
     Print ( L"%a  <host name>\r\n", Argv[0]);\r
   }\r
   else {\r
-    //\r
     //  Translate the host name\r
     //  Translate the host name\r
-    //\r
     pHost = gethostbyname ( Argv[1]);\r
     if ( NULL == pHost ) {\r
       Print ( L"ERROR - host not found, h_errno: %d\r\n", h_errno );\r
     pHost = gethostbyname ( Argv[1]);\r
     if ( NULL == pHost ) {\r
       Print ( L"ERROR - host not found, h_errno: %d\r\n", h_errno );\r
@@ -76,9 +67,7 @@ main (
               pHost->h_addrtype,\r
               pHost->h_name );\r
 \r
               pHost->h_addrtype,\r
               pHost->h_name );\r
 \r
-      //\r
       //  Display the other addresses\r
       //  Display the other addresses\r
-      //\r
       for ( Index = 1; NULL != pHost->h_addr_list[Index]; Index++ ) {\r
         pIpAddress = (UINT8 *)pHost->h_addr_list[Index];\r
         Print ( L"%d.%d.%d.%d\r\n",\r
       for ( Index = 1; NULL != pHost->h_addr_list[Index]; Index++ ) {\r
         pIpAddress = (UINT8 *)pHost->h_addr_list[Index];\r
         Print ( L"%d.%d.%d.%d\r\n",\r
@@ -88,9 +77,7 @@ main (
                 pIpAddress[3]);\r
       }\r
 \r
                 pIpAddress[3]);\r
       }\r
 \r
-      //\r
       //  Display the list of aliases\r
       //  Display the list of aliases\r
-      //\r
       ppName = pHost->h_aliases;\r
       if (( NULL == ppName ) || ( NULL == *ppName )) {\r
         Print ( L"No aliases\r\n" );\r
       ppName = pHost->h_aliases;\r
       if (( NULL == ppName ) || ( NULL == *ppName )) {\r
         Print ( L"No aliases\r\n" );\r
@@ -115,9 +102,6 @@ main (
       }\r
     }\r
   }\r
       }\r
     }\r
   }\r
-\r
-  //\r
   //  All done\r
   //  All done\r
-  //\r
   return errno;\r
 }\r
   return errno;\r
 }\r