summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlpleahy <lpleahy@6f19259b-4bc3-4df7-8a09-765794883524>2011-08-24 21:32:52 +0000
committerlpleahy <lpleahy@6f19259b-4bc3-4df7-8a09-765794883524>2011-08-24 21:32:52 +0000
commitdd0b3568cd10c96d09333ee4c672ff5d32109224 (patch)
tree0fc0c31fbf4f66f65351d740ffc0580ce7c8e348
parent9c5172b8fdf63f445365434d01aeaeafae2cfc42 (diff)
downloadedk2-dd0b3568cd10c96d09333ee4c672ff5d32109224.zip
edk2-dd0b3568cd10c96d09333ee4c672ff5d32109224.tar.gz
edk2-dd0b3568cd10c96d09333ee4c672ff5d32109224.tar.bz2
Code cleanup to better match coding standard
Signed-off by: Lee Leahy git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/branches/EADK@12200 6f19259b-4bc3-4df7-8a09-765794883524
-rw-r--r--AppPkg/Applications/Sockets/DataSink/DataSink.c207
-rw-r--r--AppPkg/Applications/Sockets/DataSource/DataSource.c17
-rw-r--r--AppPkg/Applications/Sockets/GetHostByAddr/GetHostByAddr.c10
-rw-r--r--AppPkg/Applications/Sockets/GetHostByDns/GetHostByDns.c4
-rw-r--r--AppPkg/Applications/Sockets/GetHostByName/GetHostByName.c2
-rw-r--r--AppPkg/Applications/Sockets/GetNetByAddr/GetNetByAddr.c8
-rw-r--r--AppPkg/Applications/Sockets/GetNetByName/GetNetByName.c2
-rw-r--r--AppPkg/Applications/Sockets/GetServByName/GetServByName.c2
-rw-r--r--AppPkg/Applications/Sockets/GetServByPort/GetServByPort.c2
-rw-r--r--AppPkg/Applications/Sockets/PortScan/PortScan.c4
-rw-r--r--AppPkg/Applications/Sockets/RawIp4Rx/RawIp4Rx.c40
-rw-r--r--AppPkg/Applications/Sockets/RecvDgram/RecvDgram.c2
-rw-r--r--AppPkg/Applications/Sockets/SetHostName/SetHostName.c2
-rw-r--r--AppPkg/Applications/Sockets/SetSockOpt/SetSockOpt.c17
-rw-r--r--AppPkg/Applications/Sockets/TftpServer/TftpServer.c9
-rw-r--r--AppPkg/Applications/Sockets/TftpServer/TftpServer.h6
-rw-r--r--AppPkg/Applications/Sockets/WebServer/ACPI.c64
-rw-r--r--AppPkg/Applications/Sockets/WebServer/ConfigurationTable.c6
-rw-r--r--AppPkg/Applications/Sockets/WebServer/HTTP.c19
-rw-r--r--AppPkg/Applications/Sockets/WebServer/PageList.c2
-rw-r--r--AppPkg/Applications/Sockets/WebServer/WebServer.c38
-rw-r--r--AppPkg/Applications/Sockets/WebServer/WebServer.h12
22 files changed, 231 insertions, 244 deletions
diff --git a/AppPkg/Applications/Sockets/DataSink/DataSink.c b/AppPkg/Applications/Sockets/DataSink/DataSink.c
index 911cf36..8223ead 100644
--- a/AppPkg/Applications/Sockets/DataSink/DataSink.c
+++ b/AppPkg/Applications/Sockets/DataSink/DataSink.c
@@ -51,9 +51,9 @@ BOOLEAN bTimerRunning;
struct sockaddr_in LocalAddress;
EFI_EVENT pTimer;
int ListenSocket;
-UINT8 Buffer [ DATA_BUFFER_SIZE ];
-struct pollfd PollFd [ MAX_CONNECTIONS ];
-DT_PORT Port [ MAX_CONNECTIONS ];
+UINT8 Buffer[ DATA_BUFFER_SIZE ];
+struct pollfd PollFd[ MAX_CONNECTIONS ];
+DT_PORT Port[ MAX_CONNECTIONS ];
nfds_t MaxPort;
@@ -136,17 +136,17 @@ SocketAccept (
// Allocate a port
//
Index = MaxPort++;
- PollFd [ Index ].fd = ListenSocket;
- PollFd [ Index ].events = POLLRDNORM | POLLHUP;
- PollFd [ Index ].revents = 0;
- Port [ Index ].BytesAverage = 0;
- Port [ Index ].BytesPrevious = 0;
- Port [ Index ].BytesTotal = 0;
- Port [ Index ].Samples = 0;
- Port [ Index ].RemoteAddress.sin_len = 0;
- Port [ Index ].RemoteAddress.sin_family = 0;
- Port [ Index ].RemoteAddress.sin_port = 0;
- Port [ Index ].RemoteAddress.sin_addr.s_addr= 0;
+ PollFd[ Index ].fd = ListenSocket;
+ PollFd[ Index ].events = POLLRDNORM | POLLHUP;
+ PollFd[ Index ].revents = 0;
+ Port[ Index ].BytesAverage = 0;
+ Port[ Index ].BytesPrevious = 0;
+ Port[ Index ].BytesTotal = 0;
+ Port[ Index ].Samples = 0;
+ Port[ Index ].RemoteAddress.sin_len = 0;
+ Port[ Index ].RemoteAddress.sin_family = 0;
+ Port[ Index ].RemoteAddress.sin_port = 0;
+ Port[ Index ].RemoteAddress.sin_addr.s_addr= 0;
}
}
@@ -242,8 +242,7 @@ SocketNew (
"0x%08x: Socket created\r\n",
ListenSocket ));
}
- else
- {
+ else {
Status = EFI_NOT_STARTED;
}
}
@@ -312,16 +311,16 @@ SocketPoll (
//
// Account for this descriptor
//
- if ( 0 != PollFd [ Index ].revents ) {
+ if ( 0 != PollFd[ Index ].revents ) {
FdCount -= 1;
}
//
// Check for a broken connection
//
- if ( 0 != ( PollFd [ Index ].revents & POLLHUP )) {
+ if ( 0 != ( PollFd[ Index ].revents & POLLHUP )) {
bRemoveSocket = TRUE;
- if ( ListenSocket == PollFd [ Index ].fd ) {
+ if ( ListenSocket == PollFd[ Index ].fd ) {
bListenError = TRUE;
DEBUG (( DEBUG_ERROR,
"ERROR - Network closed on listen socket, errno: %d\r\n",
@@ -330,37 +329,37 @@ SocketPoll (
else {
DEBUG (( DEBUG_ERROR,
"ERROR - Network closed on socket %d.%d.%d.%d:%d, errno: %d\r\n",
- Port [ Index ].RemoteAddress.sin_addr.s_addr & 0xff,
- ( Port [ Index ].RemoteAddress.sin_addr.s_addr >> 8 ) & 0xff,
- ( Port [ Index ].RemoteAddress.sin_addr.s_addr >> 16 ) & 0xff,
- ( Port [ Index ].RemoteAddress.sin_addr.s_addr >> 24 ) & 0xff,
- htons ( Port [ Index ].RemoteAddress.sin_port ),
+ Port[ Index ].RemoteAddress.sin_addr.s_addr & 0xff,
+ ( Port[ Index ].RemoteAddress.sin_addr.s_addr >> 8 ) & 0xff,
+ ( Port[ Index ].RemoteAddress.sin_addr.s_addr >> 16 ) & 0xff,
+ ( Port[ Index ].RemoteAddress.sin_addr.s_addr >> 24 ) & 0xff,
+ htons ( Port[ Index ].RemoteAddress.sin_port ),
errno ));
//
// Close the socket
//
- CloseStatus = close ( PollFd [ Index ].fd );
+ CloseStatus = close ( PollFd[ Index ].fd );
if ( 0 == CloseStatus ) {
bRemoveSocket = TRUE;
DEBUG (( DEBUG_INFO,
"0x%08x: Socket closed for %d.%d.%d.%d:%d\r\n",
- PollFd [ Index ].fd,
- Port [ Index ].RemoteAddress.sin_addr.s_addr & 0xff,
- ( Port [ Index ].RemoteAddress.sin_addr.s_addr >> 8 ) & 0xff,
- ( Port [ Index ].RemoteAddress.sin_addr.s_addr >> 16 ) & 0xff,
- ( Port [ Index ].RemoteAddress.sin_addr.s_addr >> 24 ) & 0xff,
- htons ( Port [ Index ].RemoteAddress.sin_port )));
+ PollFd[ Index ].fd,
+ Port[ Index ].RemoteAddress.sin_addr.s_addr & 0xff,
+ ( Port[ Index ].RemoteAddress.sin_addr.s_addr >> 8 ) & 0xff,
+ ( Port[ Index ].RemoteAddress.sin_addr.s_addr >> 16 ) & 0xff,
+ ( Port[ Index ].RemoteAddress.sin_addr.s_addr >> 24 ) & 0xff,
+ htons ( Port[ Index ].RemoteAddress.sin_port )));
}
else {
DEBUG (( DEBUG_ERROR,
"ERROR - Failed to close socket 0x%08x for %d.%d.%d.%d:%d, errno: %d\r\n",
- PollFd [ Index ].fd,
- Port [ Index ].RemoteAddress.sin_addr.s_addr & 0xff,
- ( Port [ Index ].RemoteAddress.sin_addr.s_addr >> 8 ) & 0xff,
- ( Port [ Index ].RemoteAddress.sin_addr.s_addr >> 16 ) & 0xff,
- ( Port [ Index ].RemoteAddress.sin_addr.s_addr >> 24 ) & 0xff,
- htons ( Port [ Index ].RemoteAddress.sin_port ),
+ PollFd[ Index ].fd,
+ Port[ Index ].RemoteAddress.sin_addr.s_addr & 0xff,
+ ( Port[ Index ].RemoteAddress.sin_addr.s_addr >> 8 ) & 0xff,
+ ( Port[ Index ].RemoteAddress.sin_addr.s_addr >> 16 ) & 0xff,
+ ( Port[ Index ].RemoteAddress.sin_addr.s_addr >> 24 ) & 0xff,
+ htons ( Port[ Index ].RemoteAddress.sin_port ),
errno ));
}
}
@@ -369,11 +368,11 @@ SocketPoll (
//
// Check for a connection or read data
//
- if ( 0 != ( PollFd [ Index ].revents & POLLRDNORM )) {
+ if ( 0 != ( PollFd[ Index ].revents & POLLRDNORM )) {
//
// Check for a connection
//
- if ( ListenSocket == PollFd [ Index ].fd ) {
+ if ( ListenSocket == PollFd[ Index ].fd ) {
//
// Another client connection was received
//
@@ -416,7 +415,7 @@ SocketPoll (
bRemoveSocket = TRUE;
DEBUG (( DEBUG_INFO,
"0x%08x: Socket closed for %d.%d.%d.%d:%d\r\n",
- PollFd [ Index ].fd,
+ PollFd[ Index ].fd,
RemoteAddress.sin_addr.s_addr & 0xff,
( RemoteAddress.sin_addr.s_addr >> 8 ) & 0xff,
( RemoteAddress.sin_addr.s_addr >> 16 ) & 0xff,
@@ -426,7 +425,7 @@ SocketPoll (
else {
DEBUG (( DEBUG_ERROR,
"ERROR - Failed to close socket 0x%08x, errno: %d\r\n",
- PollFd [ Index ].fd,
+ PollFd[ Index ].fd,
errno ));
}
@@ -436,8 +435,7 @@ SocketPoll (
//
Status = EFI_SUCCESS;
}
- else
- {
+ else {
//
// Display the connection
//
@@ -452,17 +450,17 @@ SocketPoll (
// Allocate the client connection
//
Index = MaxPort++;
- Port [ Index ].BytesAverage = 0;
- Port [ Index ].BytesPrevious = 0;
- Port [ Index ].BytesTotal = 0;
- Port [ Index ].Samples = 0;
- Port [ Index ].RemoteAddress.sin_len = RemoteAddress.sin_len;
- Port [ Index ].RemoteAddress.sin_family = RemoteAddress.sin_family;
- Port [ Index ].RemoteAddress.sin_port = RemoteAddress.sin_port;
- Port [ Index ].RemoteAddress.sin_addr = RemoteAddress.sin_addr;
- PollFd [ Index ].fd = Socket;
- PollFd [ Index ].events = POLLRDNORM | POLLHUP;
- PollFd [ Index ].revents = 0;
+ Port[ Index ].BytesAverage = 0;
+ Port[ Index ].BytesPrevious = 0;
+ Port[ Index ].BytesTotal = 0;
+ Port[ Index ].Samples = 0;
+ Port[ Index ].RemoteAddress.sin_len = RemoteAddress.sin_len;
+ Port[ Index ].RemoteAddress.sin_family = RemoteAddress.sin_family;
+ Port[ Index ].RemoteAddress.sin_port = RemoteAddress.sin_port;
+ Port[ Index ].RemoteAddress.sin_addr = RemoteAddress.sin_addr;
+ PollFd[ Index ].fd = Socket;
+ PollFd[ Index ].events = POLLRDNORM | POLLHUP;
+ PollFd[ Index ].revents = 0;
}
}
}
@@ -470,7 +468,7 @@ SocketPoll (
//
// Data received
//
- BytesReceived = read ( PollFd [ Index ].fd,
+ BytesReceived = read ( PollFd[ Index ].fd,
&Buffer,
sizeof ( Buffer ));
if ( 0 < BytesReceived ) {
@@ -479,13 +477,13 @@ SocketPoll (
//
DEBUG (( DEBUG_INFO,
"0x%08x: Socket received 0x%08x bytes from %d.%d.%d.%d:%d\r\n",
- PollFd [ Index ].fd,
+ PollFd[ Index ].fd,
BytesReceived,
- Port [ Index ].RemoteAddress.sin_addr.s_addr & 0xff,
- ( Port [ Index ].RemoteAddress.sin_addr.s_addr >> 8 ) & 0xff,
- ( Port [ Index ].RemoteAddress.sin_addr.s_addr >> 16 ) & 0xff,
- ( Port [ Index ].RemoteAddress.sin_addr.s_addr >> 24 ) & 0xff,
- htons ( Port [ Index ].RemoteAddress.sin_port )));
+ Port[ Index ].RemoteAddress.sin_addr.s_addr & 0xff,
+ ( Port[ Index ].RemoteAddress.sin_addr.s_addr >> 8 ) & 0xff,
+ ( Port[ Index ].RemoteAddress.sin_addr.s_addr >> 16 ) & 0xff,
+ ( Port[ Index ].RemoteAddress.sin_addr.s_addr >> 24 ) & 0xff,
+ htons ( Port[ Index ].RemoteAddress.sin_port )));
//
// Synchronize with the TimerCallback routine
@@ -495,7 +493,7 @@ SocketPoll (
//
// Account for the data received
//
- Port [ Index ].BytesTotal += BytesReceived;
+ Port[ Index ].BytesTotal += BytesReceived;
//
// Release the synchronization with the TimerCallback routine
@@ -508,33 +506,33 @@ SocketPoll (
//
DEBUG (( DEBUG_INFO,
"ERROR - Receive failure for %d.%d.%d.%d:%d, errno: %d\r\n",
- Port [ Index ].RemoteAddress.sin_addr.s_addr & 0xff,
- ( Port [ Index ].RemoteAddress.sin_addr.s_addr >> 8 ) & 0xff,
- ( Port [ Index ].RemoteAddress.sin_addr.s_addr >> 16 ) & 0xff,
- ( Port [ Index ].RemoteAddress.sin_addr.s_addr >> 24 ) & 0xff,
- htons ( Port [ Index ].RemoteAddress.sin_port ),
+ Port[ Index ].RemoteAddress.sin_addr.s_addr & 0xff,
+ ( Port[ Index ].RemoteAddress.sin_addr.s_addr >> 8 ) & 0xff,
+ ( Port[ Index ].RemoteAddress.sin_addr.s_addr >> 16 ) & 0xff,
+ ( Port[ Index ].RemoteAddress.sin_addr.s_addr >> 24 ) & 0xff,
+ htons ( Port[ Index ].RemoteAddress.sin_port ),
errno ));
- CloseStatus = close ( PollFd [ Index ].fd );
+ CloseStatus = close ( PollFd[ Index ].fd );
if ( 0 == CloseStatus ) {
bRemoveSocket = TRUE;
DEBUG (( DEBUG_INFO,
"0x%08x: Socket closed for %d.%d.%d.%d:%d\r\n",
- PollFd [ Index ].fd,
- Port [ Index ].RemoteAddress.sin_addr.s_addr & 0xff,
- ( Port [ Index ].RemoteAddress.sin_addr.s_addr >> 8 ) & 0xff,
- ( Port [ Index ].RemoteAddress.sin_addr.s_addr >> 16 ) & 0xff,
- ( Port [ Index ].RemoteAddress.sin_addr.s_addr >> 24 ) & 0xff,
- htons ( Port [ Index ].RemoteAddress.sin_port )));
+ PollFd[ Index ].fd,
+ Port[ Index ].RemoteAddress.sin_addr.s_addr & 0xff,
+ ( Port[ Index ].RemoteAddress.sin_addr.s_addr >> 8 ) & 0xff,
+ ( Port[ Index ].RemoteAddress.sin_addr.s_addr >> 16 ) & 0xff,
+ ( Port[ Index ].RemoteAddress.sin_addr.s_addr >> 24 ) & 0xff,
+ htons ( Port[ Index ].RemoteAddress.sin_port )));
}
else {
DEBUG (( DEBUG_ERROR,
"ERROR - Failed to close socket 0x%08x for %d.%d.%d.%d:%d, errno: %d\r\n",
- PollFd [ Index ].fd,
- Port [ Index ].RemoteAddress.sin_addr.s_addr & 0xff,
- ( Port [ Index ].RemoteAddress.sin_addr.s_addr >> 8 ) & 0xff,
- ( Port [ Index ].RemoteAddress.sin_addr.s_addr >> 16 ) & 0xff,
- ( Port [ Index ].RemoteAddress.sin_addr.s_addr >> 24 ) & 0xff,
- htons ( Port [ Index ].RemoteAddress.sin_port ),
+ PollFd[ Index ].fd,
+ Port[ Index ].RemoteAddress.sin_addr.s_addr & 0xff,
+ ( Port[ Index ].RemoteAddress.sin_addr.s_addr >> 8 ) & 0xff,
+ ( Port[ Index ].RemoteAddress.sin_addr.s_addr >> 16 ) & 0xff,
+ ( Port[ Index ].RemoteAddress.sin_addr.s_addr >> 24 ) & 0xff,
+ htons ( Port[ Index ].RemoteAddress.sin_port ),
errno ));
}
}
@@ -553,23 +551,23 @@ SocketPoll (
if ( bRemoveSocket ) {
DEBUG (( DEBUG_INFO,
"0x%08x: Socket removed from polling\r\n",
- PollFd [ Index ].fd ));
+ PollFd[ Index ].fd ));
MaxPort -= 1;
for ( Entry = Index + 1; MaxPort >= Entry; Entry++ ) {
EntryPrevious = Entry;
- Port [ EntryPrevious ].BytesAverage = Port [ Entry ].BytesAverage;
- Port [ EntryPrevious ].BytesPrevious = Port [ Entry ].BytesPrevious;
- Port [ EntryPrevious ].BytesTotal = Port [ Entry ].BytesTotal;
- Port [ EntryPrevious ].RemoteAddress.sin_len = Port [ Entry ].RemoteAddress.sin_len;
- Port [ EntryPrevious ].RemoteAddress.sin_family = Port [ Entry ].RemoteAddress.sin_family;
- Port [ EntryPrevious ].RemoteAddress.sin_port = Port [ Entry ].RemoteAddress.sin_port;
- Port [ EntryPrevious ].RemoteAddress.sin_addr.s_addr = Port [ Entry ].RemoteAddress.sin_addr.s_addr;
- Port [ EntryPrevious ].Samples = Port [ Entry ].Samples;
- PollFd [ EntryPrevious ].events = PollFd [ Entry ].events;
- PollFd [ EntryPrevious ].fd = PollFd [ Entry ].fd;
- PollFd [ EntryPrevious ].revents = PollFd [ Entry ].revents;
+ Port[ EntryPrevious ].BytesAverage = Port[ Entry ].BytesAverage;
+ Port[ EntryPrevious ].BytesPrevious = Port[ Entry ].BytesPrevious;
+ Port[ EntryPrevious ].BytesTotal = Port[ Entry ].BytesTotal;
+ Port[ EntryPrevious ].RemoteAddress.sin_len = Port[ Entry ].RemoteAddress.sin_len;
+ Port[ EntryPrevious ].RemoteAddress.sin_family = Port[ Entry ].RemoteAddress.sin_family;
+ Port[ EntryPrevious ].RemoteAddress.sin_port = Port[ Entry ].RemoteAddress.sin_port;
+ Port[ EntryPrevious ].RemoteAddress.sin_addr.s_addr = Port[ Entry ].RemoteAddress.sin_addr.s_addr;
+ Port[ EntryPrevious ].Samples = Port[ Entry ].Samples;
+ PollFd[ EntryPrevious ].events = PollFd[ Entry ].events;
+ PollFd[ EntryPrevious ].fd = PollFd[ Entry ].fd;
+ PollFd[ EntryPrevious ].revents = PollFd[ Entry ].revents;
}
- PollFd [ MaxPort ].fd = -1;
+ PollFd[ MaxPort ].fd = -1;
Index -= 1;
}
@@ -625,31 +623,31 @@ TimerCallback (
//
// Determine if any data was received
//
- BytesReceived = Port [ Index ].BytesTotal;
- if (( ListenSocket != PollFd [ Index ].fd )
+ BytesReceived = Port[ Index ].BytesTotal;
+ if (( ListenSocket != PollFd[ Index ].fd )
&& ( 0 != BytesReceived )) {
//
// Update the average bytes per second
//
- DeltaBytes = Port [ Index ].BytesAverage >> AVERAGE_SHIFT_COUNT;
- Port [ Index ].BytesAverage -= DeltaBytes;
- DeltaBytes = BytesReceived - Port [ Index ].BytesPrevious;
- Port [ Index ].BytesPrevious = BytesReceived;
- Port [ Index ].BytesAverage += DeltaBytes;
+ DeltaBytes = Port[ Index ].BytesAverage >> AVERAGE_SHIFT_COUNT;
+ Port[ Index ].BytesAverage -= DeltaBytes;
+ DeltaBytes = BytesReceived - Port[ Index ].BytesPrevious;
+ Port[ Index ].BytesPrevious = BytesReceived;
+ Port[ Index ].BytesAverage += DeltaBytes;
//
// Separate the samples
//
- if (( 2 << AVERAGE_SHIFT_COUNT ) == Port [ Index ].Samples ) {
+ if (( 2 << AVERAGE_SHIFT_COUNT ) == Port[ Index ].Samples ) {
Print ( L"---------- Stable average ----------\r\n" );
}
- Port [ Index ].Samples += 1;
+ Port[ Index ].Samples += 1;
//
// Display the data rate
//
Delta = (UINT32)( DeltaBytes >> DATA_RATE_UPDATE_SHIFT );
- Average = Port [ Index ].BytesAverage >> ( AVERAGE_SHIFT_COUNT + DATA_RATE_UPDATE_SHIFT );
+ Average = Port[ Index ].BytesAverage >> ( AVERAGE_SHIFT_COUNT + DATA_RATE_UPDATE_SHIFT );
if ( Average < RANGE_SWITCH ) {
Print ( L"%d Bytes/sec, Ave: %d Bytes/Sec\r\n",
Delta,
@@ -919,8 +917,7 @@ main (
//
// Use for/break instead of goto
//
- for ( ; ; )
- {
+ for ( ; ; ) {
//
// Create the timer
//
diff --git a/AppPkg/Applications/Sockets/DataSource/DataSource.c b/AppPkg/Applications/Sockets/DataSource/DataSource.c
index 9add3f2..15867f0 100644
--- a/AppPkg/Applications/Sockets/DataSource/DataSource.c
+++ b/AppPkg/Applications/Sockets/DataSource/DataSource.c
@@ -84,7 +84,7 @@ UINT64 TotalBytesSent;
UINT64 PreviousBytes;
UINT64 AverageBytes;
UINT64 Samples;
-UINT8 Buffer [ DATA_BUFFER_SIZE ];
+UINT8 Buffer[ DATA_BUFFER_SIZE ];
//
@@ -146,8 +146,7 @@ GetDigit (
// Walk the digits
//
Value = 0;
- while (( '0' <= *pDigit ) && ( '9' >= *pDigit ))
- {
+ while (( '0' <= *pDigit ) && ( '9' >= *pDigit )) {
//
// Make room for the new least significant digit
//
@@ -313,7 +312,7 @@ SocketConnect (
//
// Check for user stop request
//
- while ( ! bTick ) {
+ while ( !bTick ) {
Status = ControlCCheck ( );
if ( EFI_ERROR ( Status )) {
break;
@@ -494,8 +493,7 @@ SocketOpen (
//
// Use do/while and break instead of goto
//
- do
- {
+ do {
//
// Wait for the network layer to initialize
//
@@ -801,7 +799,7 @@ Tcp4Locate (
//
// Open the network controller's service protocol
//
- Tcp4Controller = pHandles [ Tcp4Index++ ];
+ Tcp4Controller = pHandles[ Tcp4Index++ ];
Status = gBS->OpenProtocol (
Tcp4Controller,
&gEfiTcp4ServiceBindingProtocolGuid,
@@ -1522,8 +1520,7 @@ bTcp4 = TRUE;
//
// Use for/break instead of goto
//
- for ( ; ; )
- {
+ for ( ; ; ) {
//
// No bytes sent so far
//
@@ -1547,7 +1544,7 @@ Print ( L"Argv[1]: %a\r\n", Argv[1]);
//
// Get the IP address
//
- pRemoteHost = Argv [1];
+ pRemoteHost = Argv[1];
Status = IpAddress ( );
if ( EFI_ERROR ( Status )) {
break;
diff --git a/AppPkg/Applications/Sockets/GetHostByAddr/GetHostByAddr.c b/AppPkg/Applications/Sockets/GetHostByAddr/GetHostByAddr.c
index 2e62639..63299a1 100644
--- a/AppPkg/Applications/Sockets/GetHostByAddr/GetHostByAddr.c
+++ b/AppPkg/Applications/Sockets/GetHostByAddr/GetHostByAddr.c
@@ -59,10 +59,10 @@ main (
&RemoteAddress[1],
&RemoteAddress[2],
&RemoteAddress[3]))
- || ( 255 < RemoteAddress [0])
- || ( 255 < RemoteAddress [1])
- || ( 255 < RemoteAddress [2])
- || ( 255 < RemoteAddress [3])) {
+ || ( 255 < RemoteAddress[0])
+ || ( 255 < RemoteAddress[1])
+ || ( 255 < RemoteAddress[2])
+ || ( 255 < RemoteAddress[3])) {
Print ( L"%a <IPv4 Address>\r\n", Argv[0]);
}
else {
@@ -78,7 +78,7 @@ main (
Print ( L"ERROR - host not found, errno: %d\r\n", errno );
}
else {
- pIpAddress = (UINT8 *)pHost->h_addr_list [ 0 ];
+ pIpAddress = (UINT8 *)pHost->h_addr_list[ 0 ];
Print ( L"%d.%d.%d.%d, %a\r\n",
pIpAddress[0],
pIpAddress[1],
diff --git a/AppPkg/Applications/Sockets/GetHostByDns/GetHostByDns.c b/AppPkg/Applications/Sockets/GetHostByDns/GetHostByDns.c
index 47453ac..c5c78ac 100644
--- a/AppPkg/Applications/Sockets/GetHostByDns/GetHostByDns.c
+++ b/AppPkg/Applications/Sockets/GetHostByDns/GetHostByDns.c
@@ -23,9 +23,9 @@
#include <sys/socket.h>
-struct hostent * _gethostbydnsname(const char *, int);
+struct hostent * _gethostbydnsname (const char *, int);
-char mBuffer [65536];
+char mBuffer[65536];
/**
diff --git a/AppPkg/Applications/Sockets/GetHostByName/GetHostByName.c b/AppPkg/Applications/Sockets/GetHostByName/GetHostByName.c
index d539c99..c58552a 100644
--- a/AppPkg/Applications/Sockets/GetHostByName/GetHostByName.c
+++ b/AppPkg/Applications/Sockets/GetHostByName/GetHostByName.c
@@ -23,7 +23,7 @@
#include <sys/socket.h>
-char mBuffer [65536];
+char mBuffer[65536];
/**
diff --git a/AppPkg/Applications/Sockets/GetNetByAddr/GetNetByAddr.c b/AppPkg/Applications/Sockets/GetNetByAddr/GetNetByAddr.c
index 51d8c6d..ce07cea 100644
--- a/AppPkg/Applications/Sockets/GetNetByAddr/GetNetByAddr.c
+++ b/AppPkg/Applications/Sockets/GetNetByAddr/GetNetByAddr.c
@@ -53,10 +53,10 @@ main (
&RemoteAddress[1],
&RemoteAddress[2],
&RemoteAddress[3]))
- || ( 255 < RemoteAddress [0])
- || ( 255 < RemoteAddress [1])
- || ( 255 < RemoteAddress [2])
- || ( 255 < RemoteAddress [3])) {
+ || ( 255 < RemoteAddress[0])
+ || ( 255 < RemoteAddress[1])
+ || ( 255 < RemoteAddress[2])
+ || ( 255 < RemoteAddress[3])) {
Print ( L"%a <IPv4 Address>\r\n", Argv[0]);
}
else {
diff --git a/AppPkg/Applications/Sockets/GetNetByName/GetNetByName.c b/AppPkg/Applications/Sockets/GetNetByName/GetNetByName.c
index b3609c9..be81b34 100644
--- a/AppPkg/Applications/Sockets/GetNetByName/GetNetByName.c
+++ b/AppPkg/Applications/Sockets/GetNetByName/GetNetByName.c
@@ -23,7 +23,7 @@
#include <sys/socket.h>
-char mBuffer [65536];
+char mBuffer[65536];
/**
diff --git a/AppPkg/Applications/Sockets/GetServByName/GetServByName.c b/AppPkg/Applications/Sockets/GetServByName/GetServByName.c
index d7237d3..f90bcf2 100644
--- a/AppPkg/Applications/Sockets/GetServByName/GetServByName.c
+++ b/AppPkg/Applications/Sockets/GetServByName/GetServByName.c
@@ -23,7 +23,7 @@
#include <sys/socket.h>
-char mBuffer [65536];
+char mBuffer[65536];
/**
diff --git a/AppPkg/Applications/Sockets/GetServByPort/GetServByPort.c b/AppPkg/Applications/Sockets/GetServByPort/GetServByPort.c
index 6a5fc46..5be0361 100644
--- a/AppPkg/Applications/Sockets/GetServByPort/GetServByPort.c
+++ b/AppPkg/Applications/Sockets/GetServByPort/GetServByPort.c
@@ -24,7 +24,7 @@
#include <sys/socket.h>
-char mBuffer [65536];
+char mBuffer[65536];
/**
diff --git a/AppPkg/Applications/Sockets/PortScan/PortScan.c b/AppPkg/Applications/Sockets/PortScan/PortScan.c
index cc13a0c..c649d46 100644
--- a/AppPkg/Applications/Sockets/PortScan/PortScan.c
+++ b/AppPkg/Applications/Sockets/PortScan/PortScan.c
@@ -314,7 +314,7 @@ PortScan (
//
// Finish computing the TCP header checksum
//
- Checksum = TcpChecksum + htons( *(UINT16 *)&pTcpHeader[2]);
+ Checksum = TcpChecksum + htons ( *(UINT16 *)&pTcpHeader[2]);
while ( 0xffff < Checksum ) {
Checksum = ( Checksum >> 16 ) + ( Checksum & 0xffff );
}
@@ -355,7 +355,7 @@ PortScan (
// Validate the response (SYN ACK)
//
pRxIpHeader = &mRxBuffer[0];
- pRxTcpHeader = &pRxIpHeader [( pRxIpHeader [0] & 0xf ) << 2 ];
+ pRxTcpHeader = &pRxIpHeader[( pRxIpHeader[0] & 0xf ) << 2 ];
if (( pIpHeader[12] == pRxIpHeader[16]) // Our address
&& ( pIpHeader[13] == pRxIpHeader[17])
&& ( pIpHeader[14] == pRxIpHeader[18])
diff --git a/AppPkg/Applications/Sockets/RawIp4Rx/RawIp4Rx.c b/AppPkg/Applications/Sockets/RawIp4Rx/RawIp4Rx.c
index 94c7c31..9b6725f 100644
--- a/AppPkg/Applications/Sockets/RawIp4Rx/RawIp4Rx.c
+++ b/AppPkg/Applications/Sockets/RawIp4Rx/RawIp4Rx.c
@@ -120,26 +120,26 @@ RawIp4Rx (
(UINT8)( SIN_ADDR ( RemotePort ) >> 16 ),
(UINT8)( SIN_ADDR ( RemotePort ) >> 24 ),
SIN_PORT ( RemotePort ),
- mBuffer [0],
- mBuffer [1],
- mBuffer [2],
- mBuffer [3],
- mBuffer [4],
- mBuffer [5],
- mBuffer [6],
- mBuffer [7],
- mBuffer [8],
- mBuffer [9],
- mBuffer [10],
- mBuffer [11],
- mBuffer [12],
- mBuffer [13],
- mBuffer [14],
- mBuffer [15],
- mBuffer [16],
- mBuffer [17],
- mBuffer [18],
- mBuffer [19]);
+ mBuffer[0],
+ mBuffer[1],
+ mBuffer[2],
+ mBuffer[3],
+ mBuffer[4],
+ mBuffer[5],
+ mBuffer[6],
+ mBuffer[7],
+ mBuffer[8],
+ mBuffer[9],
+ mBuffer[10],
+ mBuffer[11],
+ mBuffer[12],
+ mBuffer[13],
+ mBuffer[14],
+ mBuffer[15],
+ mBuffer[16],
+ mBuffer[17],
+ mBuffer[18],
+ mBuffer[19]);
TotalBytesReceived += BytesReceived;
//
diff --git a/AppPkg/Applications/Sockets/RecvDgram/RecvDgram.c b/AppPkg/Applications/Sockets/RecvDgram/RecvDgram.c
index 7809e80..695db93 100644
--- a/AppPkg/Applications/Sockets/RecvDgram/RecvDgram.c
+++ b/AppPkg/Applications/Sockets/RecvDgram/RecvDgram.c
@@ -25,7 +25,7 @@
#include <sys/socket.h>
#include <sys/time.h>
-UINT8 mBuffer [ 65536 ];
+UINT8 mBuffer[ 65536 ];
/**
Receive a datagram
diff --git a/AppPkg/Applications/Sockets/SetHostName/SetHostName.c b/AppPkg/Applications/Sockets/SetHostName/SetHostName.c
index 85dc1c4..2986b66 100644
--- a/AppPkg/Applications/Sockets/SetHostName/SetHostName.c
+++ b/AppPkg/Applications/Sockets/SetHostName/SetHostName.c
@@ -22,7 +22,7 @@
#include <sys/socket.h>
-char mBuffer [65536];
+char mBuffer[65536];
/**
diff --git a/AppPkg/Applications/Sockets/SetSockOpt/SetSockOpt.c b/AppPkg/Applications/Sockets/SetSockOpt/SetSockOpt.c
index fdc4552..dbecda3 100644
--- a/AppPkg/Applications/Sockets/SetSockOpt/SetSockOpt.c
+++ b/AppPkg/Applications/Sockets/SetSockOpt/SetSockOpt.c
@@ -39,7 +39,7 @@ typedef struct {
DATA_TYPE DataType;
} OPTIONS;
-CONST OPTIONS mOptions [] = {
+CONST OPTIONS mOptions[] = {
{ "SO_ACCEPTCONN", SO_ACCEPTCONN, SOL_SOCKET, FALSE, DATA_TYPE_UNKNOWN },
{ "SO_BROADCAST", SO_BROADCAST, SOL_SOCKET, TRUE, DATA_TYPE_UNKNOWN },
{ "SO_DEBUG", SO_DEBUG, SOL_SOCKET, TRUE, DATA_TYPE_UNKNOWN },
@@ -62,9 +62,9 @@ CONST OPTIONS mOptions [] = {
};
-UINT8 mBuffer [ 65536 ];
-UINT8 mValue [ 65536 ];
-char * mSocketType [] = {
+UINT8 mBuffer[ 65536 ];
+UINT8 mValue[ 65536 ];
+char * mSocketType[] = {
"SOCK_STREAM",
"SOCK_DGRAM",
"SOCK_RAW",
@@ -103,11 +103,10 @@ DisplayOption (
// Display the value
//
Value.u8 = &mBuffer[0];
- switch ( pOption->DataType )
- {
+ switch ( pOption->DataType ) {
case DATA_TYPE_UNKNOWN:
Print ( L"%a:", pOption->pOptionName );
- pEnd = &Value.u8 [ LengthInBytes ];
+ pEnd = &Value.u8[ LengthInBytes ];
while ( pEnd > Value.u8 ) {
Print ( L" %02x", *Value.u8 );
Value.u8 += 1;
@@ -127,7 +126,7 @@ DisplayOption (
case DATA_TYPE_SOCKET_TYPE:
if ( 4 == LengthInBytes ) {
if (( SOCK_STREAM <= *Value.i32 ) && ( SOCK_SEQPACKET >= *Value.i32 )) {
- pString = mSocketType [ *Value.i32 - SOCK_STREAM ];
+ pString = mSocketType[ *Value.i32 - SOCK_STREAM ];
Print ( L"%a", pString );
}
else {
@@ -295,7 +294,7 @@ main (
//
BytesToWrite = 0;
if (( 3 > Argc )
- || ( 0 < ( BytesToWrite = GetOptionValue ( pOption, Argv [2])))) {
+ || ( 0 < ( BytesToWrite = GetOptionValue ( pOption, Argv[2])))) {
//
// Get the socket
//
diff --git a/AppPkg/Applications/Sockets/TftpServer/TftpServer.c b/AppPkg/Applications/Sockets/TftpServer/TftpServer.c
index 9b522d1..1da3c25 100644
--- a/AppPkg/Applications/Sockets/TftpServer/TftpServer.c
+++ b/AppPkg/Applications/Sockets/TftpServer/TftpServer.c
@@ -846,8 +846,7 @@ Print ( L"TFTP Opcode: 0x%08x\r\n", Opcode );
bIgnorePacket = TRUE;
break;
}
- if ( pTftpServer->RxBytes > (ssize_t)( pContext->BlockSize + 2 + 2 ))
- {
+ if ( pTftpServer->RxBytes > (ssize_t)( pContext->BlockSize + 2 + 2 )) {
DEBUG (( DEBUG_ERROR,
"ERROR - Receive data length of %d > %d bytes (maximum block size) for pContext 0x%08x\r\n",
pTftpServer->RxBytes - 2 - 2,
@@ -1049,8 +1048,7 @@ pContext->File = (EFI_HANDLE)1;
"ACK for block 0x%04x received\r\n",
BlockNumber ));
if (( !pContext->bExpectAck )
- || ( BlockNumber != pContext->AckNext ))
- {
+ || ( BlockNumber != pContext->AckNext )) {
DEBUG (( DEBUG_WARN | DEBUG_TFTP_ACK,
"WARNING - Expecting ACK 0x%0x4 not received ACK 0x%08x\r\n",
pContext->AckNext,
@@ -1248,8 +1246,7 @@ TftpServerTimer (
pTftpServer->TftpPort.fd = socket ( AF_INET,
SOCK_DGRAM,
IPPROTO_UDP );
- if ( -1 != pTftpServer->TftpPort.fd )
- {
+ if ( -1 != pTftpServer->TftpPort.fd ) {
//
// Set the socket address
//
diff --git a/AppPkg/Applications/Sockets/TftpServer/TftpServer.h b/AppPkg/Applications/Sockets/TftpServer/TftpServer.h
index e56d21b..0c875d0 100644
--- a/AppPkg/Applications/Sockets/TftpServer/TftpServer.h
+++ b/AppPkg/Applications/Sockets/TftpServer/TftpServer.h
@@ -155,13 +155,13 @@ typedef struct _TSDT_CONNECTION_CONTEXT {
BOOLEAN bEofSent; ///< End of file sent
UINT8 * pBuffer; ///< Pointer into the file data
UINT8 * pEnd; ///< End of the file data
- UINT8 FileData [ 64 * TFTP_MAX_BLOCK_SIZE ]; ///< File data to send
+ UINT8 FileData[ 64 * TFTP_MAX_BLOCK_SIZE ]; ///< File data to send
//
// Buffer management
//
ssize_t TxBytes; ///< Bytes in the TX buffer
- UINT8 TxBuffer [ 2 + 2 + TFTP_MAX_BLOCK_SIZE ]; ///< Transmit buffer
+ UINT8 TxBuffer[ 2 + 2 + TFTP_MAX_BLOCK_SIZE ]; ///< Transmit buffer
}GCC_TSDT_CONNECTION_CONTEXT;
/**
@@ -188,7 +188,7 @@ typedef struct {
//
struct sockaddr_in RemoteAddress; ///< Remote address
ssize_t RxBytes; ///< Receive data length in bytes
- UINT8 RxBuffer [ 2 + 2 + TFTP_MAX_BLOCK_SIZE ]; ///< Receive buffer
+ UINT8 RxBuffer[ 2 + 2 + TFTP_MAX_BLOCK_SIZE ]; ///< Receive buffer
//
// Client port management
diff --git a/AppPkg/Applications/Sockets/WebServer/ACPI.c b/AppPkg/Applications/Sockets/WebServer/ACPI.c
index bcb56d0..c6caa1a 100644
--- a/AppPkg/Applications/Sockets/WebServer/ACPI.c
+++ b/AppPkg/Applications/Sockets/WebServer/ACPI.c
@@ -106,19 +106,19 @@ typedef struct {
UINT16 IapcBootArch; // 109
UINT8 Reserved2; // 111
UINT32 Flags; // 112
- UINT32 ResetReg [3]; // 116
+ UINT32 ResetReg[3]; // 116
UINT8 ResetValue; // 128
- UINT8 Reserved3 [3]; // 129
+ UINT8 Reserved3[3]; // 129
UINT64 XFirmwareCtrl; // 132
UINT64 XDsdt; // 140
- UINT32 XPm1aEvtBlk [3]; // 148
- UINT32 XPm1bEvtBlk [3]; // 160
- UINT32 XPm1aCntBlk [3]; // 172
- UINT32 XPm1bCntBlk [3]; // 184
- UINT32 XPm2CntBlk [3]; // 196
- UINT32 XPmTmrBlk [3]; // 208
- UINT32 XGpe0Blk [3]; // 220
- UINT32 XGpe1Blk [3]; // 232
+ UINT32 XPm1aEvtBlk[3]; // 148
+ UINT32 XPm1bEvtBlk[3]; // 160
+ UINT32 XPm1aCntBlk[3]; // 172
+ UINT32 XPm1bCntBlk[3]; // 184
+ UINT32 XPm2CntBlk[3]; // 196
+ UINT32 XPmTmrBlk[3]; // 208
+ UINT32 XGpe0Blk[3]; // 220
+ UINT32 XGpe1Blk[3]; // 232
} ACPI_FADT;
@@ -146,7 +146,7 @@ typedef struct {
} TABLE_SIGNATURE;
-CONST TABLE_SIGNATURE mTableId [] = {
+CONST TABLE_SIGNATURE mTableId[] = {
{ DSDT_SIGNATURE, "DSDT", PAGE_ACPI_DSDT },
{ FADT_SIGNATURE, "FADT", PAGE_ACPI_FADT }
};
@@ -240,8 +240,8 @@ LocateTable (
//
// Walk the list of entries
//
- pEntry = &pRsdt->Entry [ 0 ];
- pEnd = &pEntry [(( pRsdt->Length - sizeof ( *pRsdt )) >> 2 ) + 1 ];
+ pEntry = &pRsdt->Entry[ 0 ];
+ pEnd = &pEntry[(( pRsdt->Length - sizeof ( *pRsdt )) >> 2 ) + 1 ];
while ( pEnd > pEntry ) {
//
// The entry is actually a 32-bit physical table address
@@ -324,7 +324,7 @@ RowAnsiArray (
// Display the characters
//
pData = pChar;
- pEnd = &pChar [ Length ];
+ pEnd = &pChar[ Length ];
while ( pEnd > pData ) {
Status = HttpSendCharacter ( SocketFD,
pPort,
@@ -440,7 +440,7 @@ RowBytes (
if ( EFI_ERROR ( Status )) {
break;
}
- pEnd = &pData [ ByteCount ];
+ pEnd = &pData[ ByteCount ];
while ( pEnd > pData ) {
Status = HttpSendHexBits ( SocketFD,
pPort,
@@ -784,8 +784,8 @@ SignatureLookup (
// Walk the list of tables
//
Signature = *pSignature;
- pTableId = &mTableId [ 0 ];
- pEnd = &pTableId [ sizeof ( mTableId ) / sizeof ( mTableId [ 0 ])];
+ pTableId = &mTableId[ 0 ];
+ pEnd = &pTableId[ sizeof ( mTableId ) / sizeof ( mTableId[ 0 ])];
while ( pEnd > pTableId ) {
//
// Attempt to locate the table signature
@@ -895,7 +895,7 @@ AcpiDsdtPage (
pPort,
"OEMID",
sizeof ( pDsdt->OemId ),
- &pDsdt->OemId [ 0 ]);
+ &pDsdt->OemId[ 0 ]);
if ( EFI_ERROR ( Status )) {
break;
}
@@ -903,7 +903,7 @@ AcpiDsdtPage (
pPort,
"OEM Table ID",
sizeof ( pDsdt->OemTableId ),
- &pDsdt->OemTableId [ 0 ]);
+ &pDsdt->OemTableId[ 0 ]);
if ( EFI_ERROR ( Status )) {
break;
}
@@ -1039,7 +1039,7 @@ AcpiFadtPage (
pPort,
"OEMID",
sizeof ( pFadt->OemId ),
- &pFadt->OemId [ 0 ]);
+ &pFadt->OemId[ 0 ]);
if ( EFI_ERROR ( Status )) {
break;
}
@@ -1047,7 +1047,7 @@ AcpiFadtPage (
pPort,
"OEM Table ID",
sizeof ( pFadt->OemTableId ),
- &pFadt->OemTableId [ 0 ]);
+ &pFadt->OemTableId[ 0 ]);
if ( EFI_ERROR ( Status )) {
break;
}
@@ -1576,7 +1576,7 @@ AcpiRsdp10Page (
pPort,
"OemId",
sizeof ( pRsdp10b->OemId ),
- &pRsdp10b->OemId [ 0 ]);
+ &pRsdp10b->OemId[ 0 ]);
if ( EFI_ERROR ( Status )) {
break;
}
@@ -1679,7 +1679,7 @@ AcpiRsdp30Page (
pPort,
"OemId",
sizeof ( pRsdp30->OemId ),
- &pRsdp30->OemId [ 0 ]);
+ &pRsdp30->OemId[ 0 ]);
if ( EFI_ERROR ( Status )) {
break;
}
@@ -1726,7 +1726,7 @@ AcpiRsdp30Page (
pPort,
"Reserved",
sizeof ( pRsdp30->Reserved ),
- &pRsdp30->Reserved [ 0 ]);
+ &pRsdp30->Reserved[ 0 ]);
if ( EFI_ERROR ( Status )) {
break;
}
@@ -1771,7 +1771,7 @@ AcpiRsdtPage (
CONST CHAR8 * pTableName;
CONST CHAR16 * pWebPage;
EFI_STATUS Status;
- UINT32 TableName [ 2 ];
+ UINT32 TableName[ 2 ];
DBG_ENTER ( );
@@ -1833,7 +1833,7 @@ AcpiRsdtPage (
pPort,
"OEMID",
sizeof ( pRsdt->OemId ),
- &pRsdt->OemId [ 0 ]);
+ &pRsdt->OemId[ 0 ]);
if ( EFI_ERROR ( Status )) {
break;
}
@@ -1841,7 +1841,7 @@ AcpiRsdtPage (
pPort,
"OEM Table ID",
sizeof ( pRsdt->OemTableId ),
- &pRsdt->OemTableId [ 0 ]);
+ &pRsdt->OemTableId[ 0 ]);
if ( EFI_ERROR ( Status )) {
break;
}
@@ -1871,16 +1871,16 @@ AcpiRsdtPage (
//
// Walk the list of entries
//
- pEntry = &pRsdt->Entry [ 0 ];
- pEnd = &pEntry [(( pRsdt->Length - sizeof ( *pRsdt )) >> 2 ) + 1 ];
- TableName [ 1 ] = 0;
+ pEntry = &pRsdt->Entry[ 0 ];
+ pEnd = &pEntry[(( pRsdt->Length - sizeof ( *pRsdt )) >> 2 ) + 1 ];
+ TableName[ 1 ] = 0;
while ( pEnd > pEntry ) {
//
// The entry is actually a 32-bit physical table address
// The first entry in the table is the 32-bit table signature
//
- TableName [ 0 ] = *(UINT32 *)*pEntry;
- pWebPage = SignatureLookup ( &TableName [ 0 ], &pTableName );
+ TableName[ 0 ] = *(UINT32 *)*pEntry;
+ pWebPage = SignatureLookup ( &TableName[ 0 ], &pTableName );
//
// Display the table address
diff --git a/AppPkg/Applications/Sockets/WebServer/ConfigurationTable.c b/AppPkg/Applications/Sockets/WebServer/ConfigurationTable.c
index 8a3de87..9208a46 100644
--- a/AppPkg/Applications/Sockets/WebServer/ConfigurationTable.c
+++ b/AppPkg/Applications/Sockets/WebServer/ConfigurationTable.c
@@ -38,7 +38,7 @@ typedef struct {
CHAR16 * pWebPage;
} GUID_NAME;
-CONST GUID_NAME mGuidName [] = {
+CONST GUID_NAME mGuidName[] = {
{ L"gEfiAcpi10TableGuid", &gEfiAcpi10TableGuid, PAGE_ACPI_RSDP_10B },
{ L"gEfiAcpiTableGuid", &gEfiAcpiTableGuid, PAGE_ACPI_RSDP_30 },
{ L"gEfiDebugImageInfoTableGuid", &gEfiDebugImageInfoTableGuid, NULL },
@@ -101,7 +101,7 @@ RowGuid (
// Determine if this is a known GUID
//
pGuidName = &mGuidName[0];
- pGuidNameEnd = &pGuidName [ sizeof ( mGuidName ) / sizeof ( mGuidName[0])];
+ pGuidNameEnd = &pGuidName[ sizeof ( mGuidName ) / sizeof ( mGuidName[0])];
while ( pGuidNameEnd > pGuidName ) {
if ( CompareGuid ( pGuidName->pGuid, pGuid )) {
//
@@ -339,7 +339,7 @@ ConfigurationTablePage (
// Determine the location of the configuration tables
//
pTable = gST->ConfigurationTable;
- pEnd = &pTable [ gST->NumberOfTableEntries ];
+ pEnd = &pTable[ gST->NumberOfTableEntries ];
while ( pEnd > pTable ) {
Status = RowGuid ( SocketFD,
pPort,
diff --git a/AppPkg/Applications/Sockets/WebServer/HTTP.c b/AppPkg/Applications/Sockets/WebServer/HTTP.c
index 314705b..8487de7 100644
--- a/AppPkg/Applications/Sockets/WebServer/HTTP.c
+++ b/AppPkg/Applications/Sockets/WebServer/HTTP.c
@@ -561,7 +561,7 @@ HttpRequest (
// Attempt to parse the command
//
pData = &pPort->Request[0];
- pEnd = &pData [ pPort->RequestLength ];
+ pEnd = &pData[ pPort->RequestLength ];
pVerb = pData;
pWebPage = HttpReplaceSpace ( pVerb, pEnd );
if ( pEnd <= pWebPage ) {
@@ -589,7 +589,7 @@ HttpRequest (
// Walk the page table
//
pPage = &mPageList[0];
- pPageEnd = &pPage [ mPageCount ];
+ pPageEnd = &pPage[ mPageCount ];
while ( pPageEnd > pPage ) {
//
// Determine if the page was located
@@ -668,15 +668,14 @@ HttpSend (
//
MaxBytes = sizeof ( pPort->TxBuffer );
DataBytes = MaxBytes - pPort->TxBytes;
- if ( DataBytes > LengthInBytes )
- {
+ if ( DataBytes > LengthInBytes ) {
DataBytes = LengthInBytes;
}
//
// Copy the data into the buffer
//
- CopyMem ( &pPort->TxBuffer [ pPort->TxBytes ],
+ CopyMem ( &pPort->TxBuffer[ pPort->TxBytes ],
pBuffer,
DataBytes );
@@ -910,7 +909,7 @@ HttpSendDump (
//
// Walk the bytes to be displayed
//
- pEnd = &pData [ ByteCount ];
+ pEnd = &pData[ ByteCount ];
while ( pEnd > pData ) {
//
// Display the address
@@ -958,7 +957,7 @@ HttpSendDump (
if (( BYTES_ON_A_LINE - InitialSpaces ) < BytesToDisplay ) {
BytesToDisplay = BYTES_ON_A_LINE - InitialSpaces;
}
- pDataEnd = &pData [ BytesToDisplay ];
+ pDataEnd = &pData[ BytesToDisplay ];
pTemp = pData;
while ( pDataEnd > pTemp ) {
Status = HttpSendHexBits ( SocketFD,
@@ -1151,7 +1150,7 @@ HttpSendGuid (
Status = HttpSendHexBits ( SocketFD,
pPort,
8,
- pGuid->Data4 [ Index ]);
+ pGuid->Data4[ Index ]);
if ( EFI_ERROR ( Status )) {
break;
}
@@ -1488,7 +1487,7 @@ HttpSendValue (
UINT64 Digit;
CONST UINT64 * pEnd;
CONST UINT64 * pDivisor;
- CONST UINT64 pDivisors [ ] = {
+ CONST UINT64 pDivisors[ ] = {
10000000000000000000L,
1000000000000000000L,
100000000000000000L,
@@ -1522,7 +1521,7 @@ HttpSendValue (
//
bDisplayZeros = FALSE;
pDivisor = &pDivisors[0];
- pEnd = &pDivisor [ sizeof ( pDivisors ) / sizeof ( pDivisors [0])];
+ pEnd = &pDivisor[ sizeof ( pDivisors ) / sizeof ( pDivisors[0])];
while ( pEnd > pDivisor ) {
//
// Determine the next digit
diff --git a/AppPkg/Applications/Sockets/WebServer/PageList.c b/AppPkg/Applications/Sockets/WebServer/PageList.c
index 5eccfb2..f26ab0f 100644
--- a/AppPkg/Applications/Sockets/WebServer/PageList.c
+++ b/AppPkg/Applications/Sockets/WebServer/PageList.c
@@ -29,7 +29,7 @@ Intel Corporation.
/**
List of pages in the system
**/
-CONST DT_PAGE mPageList [] = {
+CONST DT_PAGE mPageList[] = {
//
// The index page must be first
diff --git a/AppPkg/Applications/Sockets/WebServer/WebServer.c b/AppPkg/Applications/Sockets/WebServer/WebServer.c
index 00bf4b6..5c73bfe 100644
--- a/AppPkg/Applications/Sockets/WebServer/WebServer.c
+++ b/AppPkg/Applications/Sockets/WebServer/WebServer.c
@@ -124,9 +124,9 @@ PortAdd (
// Initialize the new entries in the FD list
//
for ( ; MaxEntriesNew > Index; Index++ ) {
- pFdListNew [ Index ].fd = -1;
- pFdListNew [ Index ].events = 0;
- pFdListNew [ Index ].revents = 0;
+ pFdListNew[ Index ].fd = -1;
+ pFdListNew[ Index ].events = 0;
+ pFdListNew[ Index ].revents = 0;
}
//
@@ -156,7 +156,7 @@ PortAdd (
// Initialize the new entries in the port list
//
for ( ; MaxEntriesNew > Index; Index++ ) {
- ppPortListNew [ Index ] = NULL;
+ ppPortListNew[ Index ] = NULL;
}
//
@@ -200,15 +200,15 @@ PortAdd (
//
// Add the socket to the FD list
//
- pFdList [ pWebServer->Entries ].fd = SocketFD;
- pFdList [ pWebServer->Entries ].events = POLLRDNORM
+ pFdList[ pWebServer->Entries ].fd = SocketFD;
+ pFdList[ pWebServer->Entries ].events = POLLRDNORM
| POLLHUP;
- pFdList [ pWebServer->Entries ].revents = 0;
+ pFdList[ pWebServer->Entries ].revents = 0;
//
// Add the port to the port list
//
- pWebServer->ppPortList [ pWebServer->Entries ] = pPort;
+ pWebServer->ppPortList[ pWebServer->Entries ] = pPort;
//
// Account for the new entry
@@ -263,7 +263,7 @@ PortRemove (
//
// Locate the specified socket file descriptor
//
- if ( SocketFD == pFdList [ Index ].fd ) {
+ if ( SocketFD == pFdList[ Index ].fd ) {
//
// Determine if this is the listen port
//
@@ -279,7 +279,7 @@ PortRemove (
//
// Free the port structure
//
- gBS->FreePool ( ppPortList [ Index ]);
+ gBS->FreePool ( ppPortList[ Index ]);
//
// Remove this port from the list by copying
@@ -287,13 +287,13 @@ PortRemove (
//
Entries -= 1;
for ( ; Entries > Index; Index++ ) {
- pFdList [ Index ] = pFdList [ Index + 1 ];
- ppPortList [ Index ] = ppPortList [ Index + 1 ];
+ pFdList[ Index ] = pFdList[ Index + 1 ];
+ ppPortList[ Index ] = ppPortList[ Index + 1 ];
}
- pFdList [ Index ].fd = -1;
- pFdList [ Index ].events = 0;
- pFdList [ Index ].revents = 0;
- ppPortList [ Index ] = NULL;
+ pFdList[ Index ].fd = -1;
+ pFdList[ Index ].events = 0;
+ pFdList[ Index ].revents = 0;
+ ppPortList[ Index ] = NULL;
//
// Update the number of entries in the list
@@ -439,8 +439,7 @@ PortWork (
}
}
}
- else
- {
+ else {
//
// Receive the file data
//
@@ -610,8 +609,7 @@ WebServerTimer (
pWebServer->HttpListenPort = socket ( AF_INET,
SOCK_STREAM,
IPPROTO_TCP );
- if ( -1 != pWebServer->HttpListenPort )
- {
+ if ( -1 != pWebServer->HttpListenPort ) {
//
// Set the socket address
//
diff --git a/AppPkg/Applications/Sockets/WebServer/WebServer.h b/AppPkg/Applications/Sockets/WebServer/WebServer.h
index 6078df0..0eee114 100644
--- a/AppPkg/Applications/Sockets/WebServer/WebServer.h
+++ b/AppPkg/Applications/Sockets/WebServer/WebServer.h
@@ -125,7 +125,7 @@
#endif // MDEPKG_NDEBUG
-#define WEB_SERVER_SIGNATURE SIGNATURE_32('W','e','b','S') ///< DT_WEB_SERVER memory signature
+#define WEB_SERVER_SIGNATURE SIGNATURE_32 ('W','e','b','S') ///< DT_WEB_SERVER memory signature
#define SPACES_ADDRESS_TO_DATA 2
#define BYTES_ON_A_LINE 16
@@ -154,9 +154,9 @@ typedef struct {
//
size_t RequestLength; ///< Request length in bytes
size_t TxBytes; ///< Bytes in the TX buffer
- UINT8 Request [ 65536 ]; ///< Page request
- UINT8 RxBuffer [ 65536 ]; ///< Receive buffer
- UINT8 TxBuffer [ 65536 ]; ///< Transmit buffer
+ UINT8 Request[ 65536 ]; ///< Page request
+ UINT8 RxBuffer[ 65536 ]; ///< Receive buffer
+ UINT8 TxBuffer[ 65536 ]; ///< Transmit buffer
} WSDT_PORT;
/**
@@ -186,7 +186,7 @@ typedef struct {
WSDT_PORT ** ppPortList; ///< List of port management structures
} DT_WEB_SERVER;
-//#define SERVER_FROM_SERVICE(a) CR(a, DT_WEB_SERVER, ServiceBinding, WEB_SERVER_SIGNATURE) ///< Locate DT_LAYER from service binding
+//#define SERVER_FROM_SERVICE(a) CR (a, DT_WEB_SERVER, ServiceBinding, WEB_SERVER_SIGNATURE) ///< Locate DT_LAYER from service binding
extern DT_WEB_SERVER mWebServer;
@@ -217,7 +217,7 @@ typedef struct {
UINT16 * pDescription; ///< Description of the page
} DT_PAGE;
-extern CONST DT_PAGE mPageList []; ///< List of pages
+extern CONST DT_PAGE mPageList[]; ///< List of pages
extern CONST UINTN mPageCount; ///< Number of pages
//------------------------------------------------------------------------------