Fix some errors detected by the GCC 4.4 compiler.
authorlpleahy <lpleahy@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 10 Feb 2012 03:46:25 +0000 (03:46 +0000)
committerlpleahy <lpleahy@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 10 Feb 2012 03:46:25 +0000 (03:46 +0000)
Signed-off-by: lpleahy
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13007 6f19259b-4bc3-4df7-8a09-765794883524

15 files changed:
AppPkg/Applications/Sockets/DataSource/DataSource.c
AppPkg/Applications/Sockets/GetHostByAddr/GetHostByAddr.c
AppPkg/Applications/Sockets/GetNameInfo/GetNameInfo.c
AppPkg/Applications/Sockets/OobRx/OobRx.h
AppPkg/Applications/Sockets/OobTx/OobTx.h
AppPkg/Applications/Sockets/RawIp4Rx/RawIp4Rx.h
AppPkg/Applications/Sockets/RawIp4Tx/RawIp4Tx.h
AppPkg/Applications/Sockets/SetSockOpt/SetSockOpt.c
AppPkg/Applications/Sockets/Sockets.inc
AppPkg/Applications/Sockets/TftpServer/TftpServer.c
AppPkg/Applications/Sockets/WebServer/ACPI.c
AppPkg/Applications/Sockets/WebServer/DhcpOptions.c
AppPkg/Applications/Sockets/WebServer/HTTP.c
AppPkg/Applications/Sockets/WebServer/SystemTable.c
AppPkg/Applications/Sockets/WebServer/WebServer.h

index 31c3895..44605c8 100644 (file)
@@ -31,6 +31,7 @@
 #include <sys/socket.h>\r
 \r
 #include <stdio.h>\r
+#include <string.h>\r
 \r
 \r
 #define DATA_SAMPLE_SHIFT           5       ///<  Shift for number of samples\r
index cec6b6c..bb58415 100644 (file)
@@ -73,7 +73,7 @@ main (
     IpAddress[1] = (UINT8)RemoteAddress[1];\r
     IpAddress[2] = (UINT8)RemoteAddress[2];\r
     IpAddress[3] = (UINT8)RemoteAddress[3];\r
-    pHost = gethostbyaddr ( &IpAddress[0], INADDRSZ, AF_INET );\r
+    pHost = gethostbyaddr ( (const char *)&IpAddress[0], INADDRSZ, AF_INET );\r
     if ( NULL == pHost ) {\r
       Print ( L"ERROR - host not found, h_errno: %d\r\n", h_errno );\r
     }\r
index c9292e1..df5c2d6 100644 (file)
@@ -97,7 +97,7 @@ main (
         //\r
         //  Display this entry\r
         //\r
-        printf ( "%s: HostName\r\n", mHostName[0]);\r
+        printf ( "%s: HostName\r\n", &mHostName[0]);\r
         printf ( "%s: Service Name\r\n", &mServiceName[0]);\r
 \r
         //\r
index 37730ca..cd31ddc 100644 (file)
@@ -45,6 +45,7 @@
 #include <Uefi.h>\r
 #include <errno.h>\r
 #include <stdlib.h>\r
+#include <string.h>\r
 \r
 #include <netinet/in.h>\r
 \r
index d700d3e..ab8f39a 100644 (file)
@@ -45,6 +45,7 @@
 #include <Uefi.h>\r
 #include <errno.h>\r
 #include <stdlib.h>\r
+#include <string.h>\r
 \r
 #include <netinet/in.h>\r
 \r
index 679692c..177222f 100644 (file)
@@ -44,6 +44,7 @@
 #include <Uefi.h>\r
 #include <errno.h>\r
 #include <stdlib.h>\r
+#include <string.h>\r
 \r
 #include <netinet/in.h>\r
 \r
index c37b718..820ff58 100644 (file)
@@ -45,6 +45,7 @@
 #include <Uefi.h>\r
 #include <errno.h>\r
 #include <stdlib.h>\r
+#include <string.h>\r
 \r
 #include <netinet/in.h>\r
 \r
index dbecda3..0df143a 100644 (file)
@@ -192,6 +192,9 @@ GetOptionValue (
   if ( pOption->bSetAllowed ) {\r
     Value.u8 = &mValue[0];\r
     switch ( pOption->DataType ) {\r
+    default:\r
+      break;\r
+\r
     case DATA_TYPE_INT32_DECIMAL:\r
       Values = sscanf ( pValue, "%d", Value.i32 );\r
       if ( 1 == Values ) {\r
@@ -201,7 +204,7 @@ GetOptionValue (
       break;\r
 \r
     case DATA_TYPE_TIMEVAL:\r
-      Values = sscanf ( pValue, "%d.%0d",\r
+      Values = sscanf ( pValue, "%d.%d",\r
                         &Value.TimeVal->tv_sec,\r
                         &Value.TimeVal->tv_usec );\r
       if (( 2 == Values )\r
index 8b6bf8e..4aa8822 100644 (file)
   AppPkg/Applications/Sockets/RecvDgram/RecvDgram.inf\r
   AppPkg/Applications/Sockets/SetHostName/SetHostName.inf\r
   AppPkg/Applications/Sockets/SetSockOpt/SetSockOpt.inf\r
-  AppPkg/Applications/Sockets/TftpServer/TftpServer.inf\r
   AppPkg/Applications/Sockets/WebServer/WebServer.inf {\r
     <PcdsFixedAtBuild>\r
-      gStdLibTokenSpaceGuid.WebServer_HttpPort|80\r
+      gAppPkgTokenSpaceGuid.WebServer_HttpPort|80\r
   }\r
 \r
+################################################################################\r
+#  The following application requires TimerLib (platform specific library)\r
+################################################################################\r
+\r
+[Components]\r
+#  AppPkg/Applications/Sockets/TftpServer/TftpServer.inf\r
+\r
+\r
index e9ab0de..30d9dae 100644 (file)
@@ -1781,9 +1781,9 @@ TftpRead (
     //\r
     //  Determine the file length\r
     //\r
-    pContext->File = fopen ( pFileName, pReadMode );\r
+    pContext->File = fopen ((const char *)pFileName, pReadMode );\r
     if (( NULL == pContext->File )\r
-        || ( -1 == stat ( pFileName, &FileStatus ))) {\r
+        || ( -1 == stat ((const char *)pFileName, &FileStatus ))) {\r
       //\r
       //  File not found\r
       //\r
index c6caa1a..18321d2 100644 (file)
@@ -28,7 +28,9 @@ Intel Corporation.
 #include <IndustryStandard/Acpi10.h>\r
 #include <IndustryStandard/Acpi30.h>\r
 \r
+#if defined(_MSC_VER)   //  Handle Microsoft VC++ compiler specifics.\r
 #pragma warning ( disable : 4305 )\r
+#endif  //  defined(_MSC_VER)\r
 \r
 //\r
 // Ensure proper structure formats\r
@@ -848,7 +850,7 @@ AcpiDsdtPage (
       Status = EFI_NOT_FOUND;\r
       break;\r
     }\r
-    pDsdt = (VOID *)pFadt->XDsdt;\r
+    pDsdt = (VOID *)(UINTN)pFadt->XDsdt;\r
 \r
     //\r
     //  Send the page and table header\r
@@ -895,7 +897,7 @@ AcpiDsdtPage (
                             pPort,\r
                             "OEMID",\r
                             sizeof ( pDsdt->OemId ),\r
-                            &pDsdt->OemId[ 0 ]);\r
+                            (CONST CHAR8 *)&pDsdt->OemId[ 0 ]);\r
     if ( EFI_ERROR ( Status )) {\r
       break;\r
     }\r
@@ -903,7 +905,7 @@ AcpiDsdtPage (
                             pPort,\r
                             "OEM Table ID",\r
                             sizeof ( pDsdt->OemTableId ),\r
-                            &pDsdt->OemTableId[ 0 ]);\r
+                            (CONST CHAR8 *)&pDsdt->OemTableId[ 0 ]);\r
     if ( EFI_ERROR ( Status )) {\r
       break;\r
     }\r
@@ -1039,7 +1041,7 @@ AcpiFadtPage (
                             pPort,\r
                             "OEMID",\r
                             sizeof ( pFadt->OemId ),\r
-                            &pFadt->OemId[ 0 ]);\r
+                            (CONST CHAR8 *)&pFadt->OemId[ 0 ]);\r
     if ( EFI_ERROR ( Status )) {\r
       break;\r
     }\r
@@ -1047,7 +1049,7 @@ AcpiFadtPage (
                             pPort,\r
                             "OEM Table ID",\r
                             sizeof ( pFadt->OemTableId ),\r
-                            &pFadt->OemTableId[ 0 ]);\r
+                            (CONST CHAR8 *)&pFadt->OemTableId[ 0 ]);\r
     if ( EFI_ERROR ( Status )) {\r
       break;\r
     }\r
@@ -1576,7 +1578,7 @@ AcpiRsdp10Page (
                             pPort,\r
                             "OemId",\r
                             sizeof ( pRsdp10b->OemId ),\r
-                            &pRsdp10b->OemId[ 0 ]);\r
+                            (CONST CHAR8 *)&pRsdp10b->OemId[ 0 ]);\r
     if ( EFI_ERROR ( Status )) {\r
       break;\r
     }\r
@@ -1679,7 +1681,7 @@ AcpiRsdp30Page (
                             pPort,\r
                             "OemId",\r
                             sizeof ( pRsdp30->OemId ),\r
-                            &pRsdp30->OemId[ 0 ]);\r
+                            (CONST CHAR8 *)&pRsdp30->OemId[ 0 ]);\r
     if ( EFI_ERROR ( Status )) {\r
       break;\r
     }\r
@@ -1709,7 +1711,7 @@ AcpiRsdp30Page (
     Status = RowPointer ( SocketFD,\r
                           pPort,\r
                           "XsdtAddress",\r
-                          (VOID *)pRsdp30->XsdtAddress,\r
+                          (VOID *)(UINTN)pRsdp30->XsdtAddress,\r
                           NULL );\r
     if ( EFI_ERROR ( Status )) {\r
       break;\r
@@ -1833,7 +1835,7 @@ AcpiRsdtPage (
                             pPort,\r
                             "OEMID",\r
                             sizeof ( pRsdt->OemId ),\r
-                            &pRsdt->OemId[ 0 ]);\r
+                            (CONST CHAR8 *)&pRsdt->OemId[ 0 ]);\r
     if ( EFI_ERROR ( Status )) {\r
       break;\r
     }\r
@@ -1841,7 +1843,7 @@ AcpiRsdtPage (
                             pPort,\r
                             "OEM Table ID",\r
                             sizeof ( pRsdt->OemTableId ),\r
-                            &pRsdt->OemTableId[ 0 ]);\r
+                            (CONST CHAR8 *)&pRsdt->OemTableId[ 0 ]);\r
     if ( EFI_ERROR ( Status )) {\r
       break;\r
     }\r
index fe37d3d..0a2e6cf 100644 (file)
@@ -151,7 +151,7 @@ DhcpOptionsPage (
           Status = gBS->OpenProtocol ( *pHandle,
 //                                       Dhcp4Handle,
                                        &gEfiDhcp4ProtocolGuid,
-                                       &pDhcp4,
+                                       (VOID **)&pDhcp4,
                                        NULL,
                                        gImageHandle,
                                        EFI_OPEN_PROTOCOL_GET_PROTOCOL );
index 9a8bd70..5237ac1 100644 (file)
@@ -918,7 +918,7 @@ HttpSendDump (
       Status = HttpSendHexBits ( SocketFD,\r
                                  pPort,\r
                                  sizeof ( pData ) * 8,\r
-                                 (UINT64)pData );\r
+                                 (UINT64)(UINTN)pData );\r
       if ( EFI_ERROR ( Status )) {\r
         break;\r
       }\r
@@ -1663,25 +1663,25 @@ HttpSendValue (
   CONST UINT64 * pEnd;\r
   CONST UINT64 * pDivisor;\r
   CONST UINT64 pDivisors[ ] = {\r
-     10000000000000000000L,\r
-      1000000000000000000L,\r
-       100000000000000000L,\r
-        10000000000000000L,\r
-         1000000000000000L,\r
-          100000000000000L,\r
-           10000000000000L,\r
-            1000000000000L,\r
-             100000000000L,\r
-              10000000000L,\r
-               1000000000L,\r
-                100000000L,\r
-                 10000000L,\r
-                  1000000L,\r
-                   100000L,\r
-                    10000L,\r
-                     1000L,\r
-                      100L,\r
-                       10L\r
+     10000000000000000000ULL,\r
+      1000000000000000000ULL,\r
+       100000000000000000ULL,\r
+        10000000000000000ULL,\r
+         1000000000000000ULL,\r
+          100000000000000ULL,\r
+           10000000000000ULL,\r
+            1000000000000ULL,\r
+             100000000000ULL,\r
+              10000000000ULL,\r
+               1000000000ULL,\r
+                100000000ULL,\r
+                 10000000ULL,\r
+                  1000000ULL,\r
+                   100000ULL,\r
+                    10000ULL,\r
+                     1000ULL,\r
+                      100ULL,\r
+                       10ULL\r
   };\r
   EFI_STATUS Status;\r
   UINT64 Temp;\r
index 0d2a1f2..916c4b9 100644 (file)
@@ -358,7 +358,7 @@ RowPointer (
     Status = HttpSendHexBits ( SocketFD,
                                pPort,
                                sizeof ( pAddress ) * 8,
-                               (UINT64) pAddress );
+                               (UINT64)(UINTN)pAddress );
     if ( EFI_ERROR ( Status )) {
       break;
     }
@@ -586,7 +586,7 @@ TableHeader (
       Status = HttpSendHexBits ( SocketFD,
                                  pPort,
                                  sizeof ( pTable ) *  8,
-                                 (UINT64)pTable );
+                                 (UINT64)(UINTN)pTable );
       if ( EFI_ERROR ( Status )) {
         break;
       }
index a5dcea4..48839f3 100644 (file)
 #include <sys/poll.h>\r
 #include <sys/socket.h>\r
 \r
+#if defined(_MSC_VER)   //  Handle Microsoft VC++ compiler specifics.\r
 #pragma warning ( disable : 4054 )\r
 #pragma warning ( disable : 4152 )\r
+#endif  //  defined(_MSC_VER)\r
 \r
 //------------------------------------------------------------------------------\r
 //  Pages\r