summaryrefslogtreecommitdiff
path: root/AppPkg
diff options
context:
space:
mode:
authorlpleahy <lpleahy@6f19259b-4bc3-4df7-8a09-765794883524>2012-02-10 03:46:25 +0000
committerlpleahy <lpleahy@6f19259b-4bc3-4df7-8a09-765794883524>2012-02-10 03:46:25 +0000
commitd3a595ceb902372504db27442bca278c67d41b10 (patch)
treee85752587f3ebfe199b42dd2f00c070e01b85d1f /AppPkg
parent826f9005c21d61845f64f779bc86c4ca15caa1e6 (diff)
downloadedk2-platforms-d3a595ceb902372504db27442bca278c67d41b10.tar.xz
Fix some errors detected by the GCC 4.4 compiler.
Signed-off-by: lpleahy git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13007 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'AppPkg')
-rw-r--r--AppPkg/Applications/Sockets/DataSource/DataSource.c1
-rw-r--r--AppPkg/Applications/Sockets/GetHostByAddr/GetHostByAddr.c2
-rw-r--r--AppPkg/Applications/Sockets/GetNameInfo/GetNameInfo.c2
-rw-r--r--AppPkg/Applications/Sockets/OobRx/OobRx.h1
-rw-r--r--AppPkg/Applications/Sockets/OobTx/OobTx.h1
-rw-r--r--AppPkg/Applications/Sockets/RawIp4Rx/RawIp4Rx.h1
-rw-r--r--AppPkg/Applications/Sockets/RawIp4Tx/RawIp4Tx.h1
-rw-r--r--AppPkg/Applications/Sockets/SetSockOpt/SetSockOpt.c5
-rw-r--r--AppPkg/Applications/Sockets/Sockets.inc11
-rw-r--r--AppPkg/Applications/Sockets/TftpServer/TftpServer.c4
-rw-r--r--AppPkg/Applications/Sockets/WebServer/ACPI.c22
-rw-r--r--AppPkg/Applications/Sockets/WebServer/DhcpOptions.c2
-rw-r--r--AppPkg/Applications/Sockets/WebServer/HTTP.c40
-rw-r--r--AppPkg/Applications/Sockets/WebServer/SystemTable.c4
-rw-r--r--AppPkg/Applications/Sockets/WebServer/WebServer.h2
15 files changed, 59 insertions, 40 deletions
diff --git a/AppPkg/Applications/Sockets/DataSource/DataSource.c b/AppPkg/Applications/Sockets/DataSource/DataSource.c
index 31c38950a6..44605c86e2 100644
--- a/AppPkg/Applications/Sockets/DataSource/DataSource.c
+++ b/AppPkg/Applications/Sockets/DataSource/DataSource.c
@@ -31,6 +31,7 @@
#include <sys/socket.h>
#include <stdio.h>
+#include <string.h>
#define DATA_SAMPLE_SHIFT 5 ///< Shift for number of samples
diff --git a/AppPkg/Applications/Sockets/GetHostByAddr/GetHostByAddr.c b/AppPkg/Applications/Sockets/GetHostByAddr/GetHostByAddr.c
index cec6b6c7c9..bb5841588e 100644
--- a/AppPkg/Applications/Sockets/GetHostByAddr/GetHostByAddr.c
+++ b/AppPkg/Applications/Sockets/GetHostByAddr/GetHostByAddr.c
@@ -73,7 +73,7 @@ main (
IpAddress[1] = (UINT8)RemoteAddress[1];
IpAddress[2] = (UINT8)RemoteAddress[2];
IpAddress[3] = (UINT8)RemoteAddress[3];
- pHost = gethostbyaddr ( &IpAddress[0], INADDRSZ, AF_INET );
+ pHost = gethostbyaddr ( (const char *)&IpAddress[0], INADDRSZ, AF_INET );
if ( NULL == pHost ) {
Print ( L"ERROR - host not found, h_errno: %d\r\n", h_errno );
}
diff --git a/AppPkg/Applications/Sockets/GetNameInfo/GetNameInfo.c b/AppPkg/Applications/Sockets/GetNameInfo/GetNameInfo.c
index c9292e1fa7..df5c2d6317 100644
--- a/AppPkg/Applications/Sockets/GetNameInfo/GetNameInfo.c
+++ b/AppPkg/Applications/Sockets/GetNameInfo/GetNameInfo.c
@@ -97,7 +97,7 @@ main (
//
// Display this entry
//
- printf ( "%s: HostName\r\n", mHostName[0]);
+ printf ( "%s: HostName\r\n", &mHostName[0]);
printf ( "%s: Service Name\r\n", &mServiceName[0]);
//
diff --git a/AppPkg/Applications/Sockets/OobRx/OobRx.h b/AppPkg/Applications/Sockets/OobRx/OobRx.h
index 37730cada7..cd31ddc2d4 100644
--- a/AppPkg/Applications/Sockets/OobRx/OobRx.h
+++ b/AppPkg/Applications/Sockets/OobRx/OobRx.h
@@ -45,6 +45,7 @@
#include <Uefi.h>
#include <errno.h>
#include <stdlib.h>
+#include <string.h>
#include <netinet/in.h>
diff --git a/AppPkg/Applications/Sockets/OobTx/OobTx.h b/AppPkg/Applications/Sockets/OobTx/OobTx.h
index d700d3e59f..ab8f39aa26 100644
--- a/AppPkg/Applications/Sockets/OobTx/OobTx.h
+++ b/AppPkg/Applications/Sockets/OobTx/OobTx.h
@@ -45,6 +45,7 @@
#include <Uefi.h>
#include <errno.h>
#include <stdlib.h>
+#include <string.h>
#include <netinet/in.h>
diff --git a/AppPkg/Applications/Sockets/RawIp4Rx/RawIp4Rx.h b/AppPkg/Applications/Sockets/RawIp4Rx/RawIp4Rx.h
index 679692c176..177222fc17 100644
--- a/AppPkg/Applications/Sockets/RawIp4Rx/RawIp4Rx.h
+++ b/AppPkg/Applications/Sockets/RawIp4Rx/RawIp4Rx.h
@@ -44,6 +44,7 @@
#include <Uefi.h>
#include <errno.h>
#include <stdlib.h>
+#include <string.h>
#include <netinet/in.h>
diff --git a/AppPkg/Applications/Sockets/RawIp4Tx/RawIp4Tx.h b/AppPkg/Applications/Sockets/RawIp4Tx/RawIp4Tx.h
index c37b718c5d..820ff58f0c 100644
--- a/AppPkg/Applications/Sockets/RawIp4Tx/RawIp4Tx.h
+++ b/AppPkg/Applications/Sockets/RawIp4Tx/RawIp4Tx.h
@@ -45,6 +45,7 @@
#include <Uefi.h>
#include <errno.h>
#include <stdlib.h>
+#include <string.h>
#include <netinet/in.h>
diff --git a/AppPkg/Applications/Sockets/SetSockOpt/SetSockOpt.c b/AppPkg/Applications/Sockets/SetSockOpt/SetSockOpt.c
index dbecda35ac..0df143a514 100644
--- a/AppPkg/Applications/Sockets/SetSockOpt/SetSockOpt.c
+++ b/AppPkg/Applications/Sockets/SetSockOpt/SetSockOpt.c
@@ -192,6 +192,9 @@ GetOptionValue (
if ( pOption->bSetAllowed ) {
Value.u8 = &mValue[0];
switch ( pOption->DataType ) {
+ default:
+ break;
+
case DATA_TYPE_INT32_DECIMAL:
Values = sscanf ( pValue, "%d", Value.i32 );
if ( 1 == Values ) {
@@ -201,7 +204,7 @@ GetOptionValue (
break;
case DATA_TYPE_TIMEVAL:
- Values = sscanf ( pValue, "%d.%0d",
+ Values = sscanf ( pValue, "%d.%d",
&Value.TimeVal->tv_sec,
&Value.TimeVal->tv_usec );
if (( 2 == Values )
diff --git a/AppPkg/Applications/Sockets/Sockets.inc b/AppPkg/Applications/Sockets/Sockets.inc
index 8b6bf8ed65..4aa8822038 100644
--- a/AppPkg/Applications/Sockets/Sockets.inc
+++ b/AppPkg/Applications/Sockets/Sockets.inc
@@ -22,9 +22,16 @@
AppPkg/Applications/Sockets/RecvDgram/RecvDgram.inf
AppPkg/Applications/Sockets/SetHostName/SetHostName.inf
AppPkg/Applications/Sockets/SetSockOpt/SetSockOpt.inf
- AppPkg/Applications/Sockets/TftpServer/TftpServer.inf
AppPkg/Applications/Sockets/WebServer/WebServer.inf {
<PcdsFixedAtBuild>
- gStdLibTokenSpaceGuid.WebServer_HttpPort|80
+ gAppPkgTokenSpaceGuid.WebServer_HttpPort|80
}
+################################################################################
+# The following application requires TimerLib (platform specific library)
+################################################################################
+
+[Components]
+# AppPkg/Applications/Sockets/TftpServer/TftpServer.inf
+
+
diff --git a/AppPkg/Applications/Sockets/TftpServer/TftpServer.c b/AppPkg/Applications/Sockets/TftpServer/TftpServer.c
index e9ab0dee5f..30d9dae41d 100644
--- a/AppPkg/Applications/Sockets/TftpServer/TftpServer.c
+++ b/AppPkg/Applications/Sockets/TftpServer/TftpServer.c
@@ -1781,9 +1781,9 @@ TftpRead (
//
// Determine the file length
//
- pContext->File = fopen ( pFileName, pReadMode );
+ pContext->File = fopen ((const char *)pFileName, pReadMode );
if (( NULL == pContext->File )
- || ( -1 == stat ( pFileName, &FileStatus ))) {
+ || ( -1 == stat ((const char *)pFileName, &FileStatus ))) {
//
// File not found
//
diff --git a/AppPkg/Applications/Sockets/WebServer/ACPI.c b/AppPkg/Applications/Sockets/WebServer/ACPI.c
index c6caa1a568..18321d2b12 100644
--- a/AppPkg/Applications/Sockets/WebServer/ACPI.c
+++ b/AppPkg/Applications/Sockets/WebServer/ACPI.c
@@ -28,7 +28,9 @@ Intel Corporation.
#include <IndustryStandard/Acpi10.h>
#include <IndustryStandard/Acpi30.h>
+#if defined(_MSC_VER) // Handle Microsoft VC++ compiler specifics.
#pragma warning ( disable : 4305 )
+#endif // defined(_MSC_VER)
//
// Ensure proper structure formats
@@ -848,7 +850,7 @@ AcpiDsdtPage (
Status = EFI_NOT_FOUND;
break;
}
- pDsdt = (VOID *)pFadt->XDsdt;
+ pDsdt = (VOID *)(UINTN)pFadt->XDsdt;
//
// Send the page and table header
@@ -895,7 +897,7 @@ AcpiDsdtPage (
pPort,
"OEMID",
sizeof ( pDsdt->OemId ),
- &pDsdt->OemId[ 0 ]);
+ (CONST CHAR8 *)&pDsdt->OemId[ 0 ]);
if ( EFI_ERROR ( Status )) {
break;
}
@@ -903,7 +905,7 @@ AcpiDsdtPage (
pPort,
"OEM Table ID",
sizeof ( pDsdt->OemTableId ),
- &pDsdt->OemTableId[ 0 ]);
+ (CONST CHAR8 *)&pDsdt->OemTableId[ 0 ]);
if ( EFI_ERROR ( Status )) {
break;
}
@@ -1039,7 +1041,7 @@ AcpiFadtPage (
pPort,
"OEMID",
sizeof ( pFadt->OemId ),
- &pFadt->OemId[ 0 ]);
+ (CONST CHAR8 *)&pFadt->OemId[ 0 ]);
if ( EFI_ERROR ( Status )) {
break;
}
@@ -1047,7 +1049,7 @@ AcpiFadtPage (
pPort,
"OEM Table ID",
sizeof ( pFadt->OemTableId ),
- &pFadt->OemTableId[ 0 ]);
+ (CONST CHAR8 *)&pFadt->OemTableId[ 0 ]);
if ( EFI_ERROR ( Status )) {
break;
}
@@ -1576,7 +1578,7 @@ AcpiRsdp10Page (
pPort,
"OemId",
sizeof ( pRsdp10b->OemId ),
- &pRsdp10b->OemId[ 0 ]);
+ (CONST CHAR8 *)&pRsdp10b->OemId[ 0 ]);
if ( EFI_ERROR ( Status )) {
break;
}
@@ -1679,7 +1681,7 @@ AcpiRsdp30Page (
pPort,
"OemId",
sizeof ( pRsdp30->OemId ),
- &pRsdp30->OemId[ 0 ]);
+ (CONST CHAR8 *)&pRsdp30->OemId[ 0 ]);
if ( EFI_ERROR ( Status )) {
break;
}
@@ -1709,7 +1711,7 @@ AcpiRsdp30Page (
Status = RowPointer ( SocketFD,
pPort,
"XsdtAddress",
- (VOID *)pRsdp30->XsdtAddress,
+ (VOID *)(UINTN)pRsdp30->XsdtAddress,
NULL );
if ( EFI_ERROR ( Status )) {
break;
@@ -1833,7 +1835,7 @@ AcpiRsdtPage (
pPort,
"OEMID",
sizeof ( pRsdt->OemId ),
- &pRsdt->OemId[ 0 ]);
+ (CONST CHAR8 *)&pRsdt->OemId[ 0 ]);
if ( EFI_ERROR ( Status )) {
break;
}
@@ -1841,7 +1843,7 @@ AcpiRsdtPage (
pPort,
"OEM Table ID",
sizeof ( pRsdt->OemTableId ),
- &pRsdt->OemTableId[ 0 ]);
+ (CONST CHAR8 *)&pRsdt->OemTableId[ 0 ]);
if ( EFI_ERROR ( Status )) {
break;
}
diff --git a/AppPkg/Applications/Sockets/WebServer/DhcpOptions.c b/AppPkg/Applications/Sockets/WebServer/DhcpOptions.c
index fe37d3deb7..0a2e6cfde1 100644
--- a/AppPkg/Applications/Sockets/WebServer/DhcpOptions.c
+++ b/AppPkg/Applications/Sockets/WebServer/DhcpOptions.c
@@ -151,7 +151,7 @@ DhcpOptionsPage (
Status = gBS->OpenProtocol ( *pHandle,
// Dhcp4Handle,
&gEfiDhcp4ProtocolGuid,
- &pDhcp4,
+ (VOID **)&pDhcp4,
NULL,
gImageHandle,
EFI_OPEN_PROTOCOL_GET_PROTOCOL );
diff --git a/AppPkg/Applications/Sockets/WebServer/HTTP.c b/AppPkg/Applications/Sockets/WebServer/HTTP.c
index 9a8bd70a9d..5237ac1a49 100644
--- a/AppPkg/Applications/Sockets/WebServer/HTTP.c
+++ b/AppPkg/Applications/Sockets/WebServer/HTTP.c
@@ -918,7 +918,7 @@ HttpSendDump (
Status = HttpSendHexBits ( SocketFD,
pPort,
sizeof ( pData ) * 8,
- (UINT64)pData );
+ (UINT64)(UINTN)pData );
if ( EFI_ERROR ( Status )) {
break;
}
@@ -1663,25 +1663,25 @@ HttpSendValue (
CONST UINT64 * pEnd;
CONST UINT64 * pDivisor;
CONST UINT64 pDivisors[ ] = {
- 10000000000000000000L,
- 1000000000000000000L,
- 100000000000000000L,
- 10000000000000000L,
- 1000000000000000L,
- 100000000000000L,
- 10000000000000L,
- 1000000000000L,
- 100000000000L,
- 10000000000L,
- 1000000000L,
- 100000000L,
- 10000000L,
- 1000000L,
- 100000L,
- 10000L,
- 1000L,
- 100L,
- 10L
+ 10000000000000000000ULL,
+ 1000000000000000000ULL,
+ 100000000000000000ULL,
+ 10000000000000000ULL,
+ 1000000000000000ULL,
+ 100000000000000ULL,
+ 10000000000000ULL,
+ 1000000000000ULL,
+ 100000000000ULL,
+ 10000000000ULL,
+ 1000000000ULL,
+ 100000000ULL,
+ 10000000ULL,
+ 1000000ULL,
+ 100000ULL,
+ 10000ULL,
+ 1000ULL,
+ 100ULL,
+ 10ULL
};
EFI_STATUS Status;
UINT64 Temp;
diff --git a/AppPkg/Applications/Sockets/WebServer/SystemTable.c b/AppPkg/Applications/Sockets/WebServer/SystemTable.c
index 0d2a1f2040..916c4b92b6 100644
--- a/AppPkg/Applications/Sockets/WebServer/SystemTable.c
+++ b/AppPkg/Applications/Sockets/WebServer/SystemTable.c
@@ -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;
}
diff --git a/AppPkg/Applications/Sockets/WebServer/WebServer.h b/AppPkg/Applications/Sockets/WebServer/WebServer.h
index a5dcea4969..48839f3456 100644
--- a/AppPkg/Applications/Sockets/WebServer/WebServer.h
+++ b/AppPkg/Applications/Sockets/WebServer/WebServer.h
@@ -34,8 +34,10 @@
#include <sys/poll.h>
#include <sys/socket.h>
+#if defined(_MSC_VER) // Handle Microsoft VC++ compiler specifics.
#pragma warning ( disable : 4054 )
#pragma warning ( disable : 4152 )
+#endif // defined(_MSC_VER)
//------------------------------------------------------------------------------
// Pages