UINT64 PreviousBytes;\r
UINT64 AverageBytes;\r
UINT64 Samples;\r
-UINT8 Buffer [ DATA_BUFFER_SIZE ];\r
+UINT8 Buffer[ DATA_BUFFER_SIZE ];\r
\r
\r
//\r
// Walk the digits\r
//\r
Value = 0;\r
- while (( '0' <= *pDigit ) && ( '9' >= *pDigit ))\r
- {\r
+ while (( '0' <= *pDigit ) && ( '9' >= *pDigit )) {\r
//\r
// Make room for the new least significant digit\r
//\r
//\r
// Check for user stop request\r
//\r
- while ( ! bTick ) {\r
+ while ( !bTick ) {\r
Status = ControlCCheck ( );\r
if ( EFI_ERROR ( Status )) {\r
break;\r
//\r
// Use do/while and break instead of goto\r
//\r
- do\r
- {\r
+ do {\r
//\r
// Wait for the network layer to initialize\r
//\r
//\r
// Open the network controller's service protocol\r
//\r
- Tcp4Controller = pHandles [ Tcp4Index++ ];\r
+ Tcp4Controller = pHandles[ Tcp4Index++ ];\r
Status = gBS->OpenProtocol (\r
Tcp4Controller,\r
&gEfiTcp4ServiceBindingProtocolGuid,\r
//\r
// Validate the command line\r
//\r
- if ( 2 != Argc ) {\r
- Print ( L"%s <remote IP address>\r\n", Argv[0] );\r
+ if ( 2 > Argc ) {\r
+ Print ( L"%s <remote IP address> [Use TCP]\r\n", Argv[0] );\r
return -1;\r
}\r
\r
-bTcp4 = TRUE;\r
+ //\r
+ // Determine if TCP should be used\r
+ //\r
+ bTcp4 = (BOOLEAN)( 2 < Argc );\r
\r
//\r
// Determine the support routines\r
//\r
// Use for/break instead of goto\r
//\r
- for ( ; ; )\r
- {\r
+ for ( ; ; ) {\r
//\r
// No bytes sent so far\r
//\r
RemoteHostAddress.sin_family = AF_INET;\r
RemoteHostAddress.sin_port = htons ( PcdGet16 ( DataSource_Port ));\r
\r
-Print ( L"Argc: %d\r\n", Argc);\r
-Print ( L"Argv[0]: %a\r\n", Argv[0]);\r
-Print ( L"Argv[1]: %a\r\n", Argv[1]);\r
-\r
//\r
// Get the IP address\r
//\r
- pRemoteHost = Argv [1];\r
+ pRemoteHost = Argv[1];\r
Status = IpAddress ( );\r
if ( EFI_ERROR ( Status )) {\r
break;\r