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
This commit is contained in:
lpleahy 2012-02-10 03:46:25 +00:00
parent 826f9005c2
commit d3a595ceb9
15 changed files with 59 additions and 40 deletions

View File

@ -31,6 +31,7 @@
#include <sys/socket.h> #include <sys/socket.h>
#include <stdio.h> #include <stdio.h>
#include <string.h>
#define DATA_SAMPLE_SHIFT 5 ///< Shift for number of samples #define DATA_SAMPLE_SHIFT 5 ///< Shift for number of samples

View File

@ -73,7 +73,7 @@ main (
IpAddress[1] = (UINT8)RemoteAddress[1]; IpAddress[1] = (UINT8)RemoteAddress[1];
IpAddress[2] = (UINT8)RemoteAddress[2]; IpAddress[2] = (UINT8)RemoteAddress[2];
IpAddress[3] = (UINT8)RemoteAddress[3]; IpAddress[3] = (UINT8)RemoteAddress[3];
pHost = gethostbyaddr ( &IpAddress[0], INADDRSZ, AF_INET ); pHost = gethostbyaddr ( (const char *)&IpAddress[0], INADDRSZ, AF_INET );
if ( NULL == pHost ) { if ( NULL == pHost ) {
Print ( L"ERROR - host not found, h_errno: %d\r\n", h_errno ); Print ( L"ERROR - host not found, h_errno: %d\r\n", h_errno );
} }

View File

@ -97,7 +97,7 @@ main (
// //
// Display this entry // 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]); printf ( "%s: Service Name\r\n", &mServiceName[0]);
// //

View File

@ -45,6 +45,7 @@
#include <Uefi.h> #include <Uefi.h>
#include <errno.h> #include <errno.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h>
#include <netinet/in.h> #include <netinet/in.h>

View File

@ -45,6 +45,7 @@
#include <Uefi.h> #include <Uefi.h>
#include <errno.h> #include <errno.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h>
#include <netinet/in.h> #include <netinet/in.h>

View File

@ -44,6 +44,7 @@
#include <Uefi.h> #include <Uefi.h>
#include <errno.h> #include <errno.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h>
#include <netinet/in.h> #include <netinet/in.h>

View File

@ -45,6 +45,7 @@
#include <Uefi.h> #include <Uefi.h>
#include <errno.h> #include <errno.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h>
#include <netinet/in.h> #include <netinet/in.h>

View File

@ -192,6 +192,9 @@ GetOptionValue (
if ( pOption->bSetAllowed ) { if ( pOption->bSetAllowed ) {
Value.u8 = &mValue[0]; Value.u8 = &mValue[0];
switch ( pOption->DataType ) { switch ( pOption->DataType ) {
default:
break;
case DATA_TYPE_INT32_DECIMAL: case DATA_TYPE_INT32_DECIMAL:
Values = sscanf ( pValue, "%d", Value.i32 ); Values = sscanf ( pValue, "%d", Value.i32 );
if ( 1 == Values ) { if ( 1 == Values ) {
@ -201,7 +204,7 @@ GetOptionValue (
break; break;
case DATA_TYPE_TIMEVAL: case DATA_TYPE_TIMEVAL:
Values = sscanf ( pValue, "%d.%0d", Values = sscanf ( pValue, "%d.%d",
&Value.TimeVal->tv_sec, &Value.TimeVal->tv_sec,
&Value.TimeVal->tv_usec ); &Value.TimeVal->tv_usec );
if (( 2 == Values ) if (( 2 == Values )

View File

@ -22,9 +22,16 @@
AppPkg/Applications/Sockets/RecvDgram/RecvDgram.inf AppPkg/Applications/Sockets/RecvDgram/RecvDgram.inf
AppPkg/Applications/Sockets/SetHostName/SetHostName.inf AppPkg/Applications/Sockets/SetHostName/SetHostName.inf
AppPkg/Applications/Sockets/SetSockOpt/SetSockOpt.inf AppPkg/Applications/Sockets/SetSockOpt/SetSockOpt.inf
AppPkg/Applications/Sockets/TftpServer/TftpServer.inf
AppPkg/Applications/Sockets/WebServer/WebServer.inf { AppPkg/Applications/Sockets/WebServer/WebServer.inf {
<PcdsFixedAtBuild> <PcdsFixedAtBuild>
gStdLibTokenSpaceGuid.WebServer_HttpPort|80 gAppPkgTokenSpaceGuid.WebServer_HttpPort|80
} }
################################################################################
# The following application requires TimerLib (platform specific library)
################################################################################
[Components]
# AppPkg/Applications/Sockets/TftpServer/TftpServer.inf

View File

@ -1781,9 +1781,9 @@ TftpRead (
// //
// Determine the file length // Determine the file length
// //
pContext->File = fopen ( pFileName, pReadMode ); pContext->File = fopen ((const char *)pFileName, pReadMode );
if (( NULL == pContext->File ) if (( NULL == pContext->File )
|| ( -1 == stat ( pFileName, &FileStatus ))) { || ( -1 == stat ((const char *)pFileName, &FileStatus ))) {
// //
// File not found // File not found
// //

View File

@ -28,7 +28,9 @@ Intel Corporation.
#include <IndustryStandard/Acpi10.h> #include <IndustryStandard/Acpi10.h>
#include <IndustryStandard/Acpi30.h> #include <IndustryStandard/Acpi30.h>
#if defined(_MSC_VER) // Handle Microsoft VC++ compiler specifics.
#pragma warning ( disable : 4305 ) #pragma warning ( disable : 4305 )
#endif // defined(_MSC_VER)
// //
// Ensure proper structure formats // Ensure proper structure formats
@ -848,7 +850,7 @@ AcpiDsdtPage (
Status = EFI_NOT_FOUND; Status = EFI_NOT_FOUND;
break; break;
} }
pDsdt = (VOID *)pFadt->XDsdt; pDsdt = (VOID *)(UINTN)pFadt->XDsdt;
// //
// Send the page and table header // Send the page and table header
@ -895,7 +897,7 @@ AcpiDsdtPage (
pPort, pPort,
"OEMID", "OEMID",
sizeof ( pDsdt->OemId ), sizeof ( pDsdt->OemId ),
&pDsdt->OemId[ 0 ]); (CONST CHAR8 *)&pDsdt->OemId[ 0 ]);
if ( EFI_ERROR ( Status )) { if ( EFI_ERROR ( Status )) {
break; break;
} }
@ -903,7 +905,7 @@ AcpiDsdtPage (
pPort, pPort,
"OEM Table ID", "OEM Table ID",
sizeof ( pDsdt->OemTableId ), sizeof ( pDsdt->OemTableId ),
&pDsdt->OemTableId[ 0 ]); (CONST CHAR8 *)&pDsdt->OemTableId[ 0 ]);
if ( EFI_ERROR ( Status )) { if ( EFI_ERROR ( Status )) {
break; break;
} }
@ -1039,7 +1041,7 @@ AcpiFadtPage (
pPort, pPort,
"OEMID", "OEMID",
sizeof ( pFadt->OemId ), sizeof ( pFadt->OemId ),
&pFadt->OemId[ 0 ]); (CONST CHAR8 *)&pFadt->OemId[ 0 ]);
if ( EFI_ERROR ( Status )) { if ( EFI_ERROR ( Status )) {
break; break;
} }
@ -1047,7 +1049,7 @@ AcpiFadtPage (
pPort, pPort,
"OEM Table ID", "OEM Table ID",
sizeof ( pFadt->OemTableId ), sizeof ( pFadt->OemTableId ),
&pFadt->OemTableId[ 0 ]); (CONST CHAR8 *)&pFadt->OemTableId[ 0 ]);
if ( EFI_ERROR ( Status )) { if ( EFI_ERROR ( Status )) {
break; break;
} }
@ -1576,7 +1578,7 @@ AcpiRsdp10Page (
pPort, pPort,
"OemId", "OemId",
sizeof ( pRsdp10b->OemId ), sizeof ( pRsdp10b->OemId ),
&pRsdp10b->OemId[ 0 ]); (CONST CHAR8 *)&pRsdp10b->OemId[ 0 ]);
if ( EFI_ERROR ( Status )) { if ( EFI_ERROR ( Status )) {
break; break;
} }
@ -1679,7 +1681,7 @@ AcpiRsdp30Page (
pPort, pPort,
"OemId", "OemId",
sizeof ( pRsdp30->OemId ), sizeof ( pRsdp30->OemId ),
&pRsdp30->OemId[ 0 ]); (CONST CHAR8 *)&pRsdp30->OemId[ 0 ]);
if ( EFI_ERROR ( Status )) { if ( EFI_ERROR ( Status )) {
break; break;
} }
@ -1709,7 +1711,7 @@ AcpiRsdp30Page (
Status = RowPointer ( SocketFD, Status = RowPointer ( SocketFD,
pPort, pPort,
"XsdtAddress", "XsdtAddress",
(VOID *)pRsdp30->XsdtAddress, (VOID *)(UINTN)pRsdp30->XsdtAddress,
NULL ); NULL );
if ( EFI_ERROR ( Status )) { if ( EFI_ERROR ( Status )) {
break; break;
@ -1833,7 +1835,7 @@ AcpiRsdtPage (
pPort, pPort,
"OEMID", "OEMID",
sizeof ( pRsdt->OemId ), sizeof ( pRsdt->OemId ),
&pRsdt->OemId[ 0 ]); (CONST CHAR8 *)&pRsdt->OemId[ 0 ]);
if ( EFI_ERROR ( Status )) { if ( EFI_ERROR ( Status )) {
break; break;
} }
@ -1841,7 +1843,7 @@ AcpiRsdtPage (
pPort, pPort,
"OEM Table ID", "OEM Table ID",
sizeof ( pRsdt->OemTableId ), sizeof ( pRsdt->OemTableId ),
&pRsdt->OemTableId[ 0 ]); (CONST CHAR8 *)&pRsdt->OemTableId[ 0 ]);
if ( EFI_ERROR ( Status )) { if ( EFI_ERROR ( Status )) {
break; break;
} }

View File

@ -151,7 +151,7 @@ DhcpOptionsPage (
Status = gBS->OpenProtocol ( *pHandle, Status = gBS->OpenProtocol ( *pHandle,
// Dhcp4Handle, // Dhcp4Handle,
&gEfiDhcp4ProtocolGuid, &gEfiDhcp4ProtocolGuid,
&pDhcp4, (VOID **)&pDhcp4,
NULL, NULL,
gImageHandle, gImageHandle,
EFI_OPEN_PROTOCOL_GET_PROTOCOL ); EFI_OPEN_PROTOCOL_GET_PROTOCOL );

View File

@ -918,7 +918,7 @@ HttpSendDump (
Status = HttpSendHexBits ( SocketFD, Status = HttpSendHexBits ( SocketFD,
pPort, pPort,
sizeof ( pData ) * 8, sizeof ( pData ) * 8,
(UINT64)pData ); (UINT64)(UINTN)pData );
if ( EFI_ERROR ( Status )) { if ( EFI_ERROR ( Status )) {
break; break;
} }
@ -1663,25 +1663,25 @@ HttpSendValue (
CONST UINT64 * pEnd; CONST UINT64 * pEnd;
CONST UINT64 * pDivisor; CONST UINT64 * pDivisor;
CONST UINT64 pDivisors[ ] = { CONST UINT64 pDivisors[ ] = {
10000000000000000000L, 10000000000000000000ULL,
1000000000000000000L, 1000000000000000000ULL,
100000000000000000L, 100000000000000000ULL,
10000000000000000L, 10000000000000000ULL,
1000000000000000L, 1000000000000000ULL,
100000000000000L, 100000000000000ULL,
10000000000000L, 10000000000000ULL,
1000000000000L, 1000000000000ULL,
100000000000L, 100000000000ULL,
10000000000L, 10000000000ULL,
1000000000L, 1000000000ULL,
100000000L, 100000000ULL,
10000000L, 10000000ULL,
1000000L, 1000000ULL,
100000L, 100000ULL,
10000L, 10000ULL,
1000L, 1000ULL,
100L, 100ULL,
10L 10ULL
}; };
EFI_STATUS Status; EFI_STATUS Status;
UINT64 Temp; UINT64 Temp;

View File

@ -358,7 +358,7 @@ RowPointer (
Status = HttpSendHexBits ( SocketFD, Status = HttpSendHexBits ( SocketFD,
pPort, pPort,
sizeof ( pAddress ) * 8, sizeof ( pAddress ) * 8,
(UINT64) pAddress ); (UINT64)(UINTN)pAddress );
if ( EFI_ERROR ( Status )) { if ( EFI_ERROR ( Status )) {
break; break;
} }
@ -586,7 +586,7 @@ TableHeader (
Status = HttpSendHexBits ( SocketFD, Status = HttpSendHexBits ( SocketFD,
pPort, pPort,
sizeof ( pTable ) * 8, sizeof ( pTable ) * 8,
(UINT64)pTable ); (UINT64)(UINTN)pTable );
if ( EFI_ERROR ( Status )) { if ( EFI_ERROR ( Status )) {
break; break;
} }

View File

@ -34,8 +34,10 @@
#include <sys/poll.h> #include <sys/poll.h>
#include <sys/socket.h> #include <sys/socket.h>
#if defined(_MSC_VER) // Handle Microsoft VC++ compiler specifics.
#pragma warning ( disable : 4054 ) #pragma warning ( disable : 4054 )
#pragma warning ( disable : 4152 ) #pragma warning ( disable : 4152 )
#endif // defined(_MSC_VER)
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Pages // Pages