diff options
| author | Dean <Dean@d5102386-fcda-11dd-9fdb-3debd5008f28> | 2011-10-09 13:14:53 +0000 |
|---|---|---|
| committer | Dean <Dean@d5102386-fcda-11dd-9fdb-3debd5008f28> | 2011-10-09 13:14:53 +0000 |
| commit | 66d6c41697b02e6f7b642578c9e159a107e5aa21 (patch) | |
| tree | 46c9d5000fdde239763fdfd4d4ebb4c697986d6a | |
| parent | 0ad1429e4a0597626f6e20be3d0a28fb86fcbe87 (diff) | |
Fixed port state table corruption in the TCP layer of the RNDIS Ethernet device demos.
Fix additional warnings under GCC 4.6.
git-svn-id: http://lufa-lib.googlecode.com/svn/trunk@1940 d5102386-fcda-11dd-9fdb-3debd5008f28
| -rw-r--r-- | Demos/Device/ClassDriver/RNDISEthernet/Lib/TCP.c | 6 | ||||
| -rw-r--r-- | Demos/Device/LowLevel/RNDISEthernet/Lib/TCP.c | 6 | ||||
| -rw-r--r-- | Demos/Host/LowLevel/MassStorageHost/MassStorageHost.c | 2 | ||||
| -rw-r--r-- | Demos/Host/LowLevel/MassStorageHost/MassStorageHost.h | 2 | ||||
| -rw-r--r-- | Demos/Host/LowLevel/StillImageHost/StillImageHost.c | 2 | ||||
| -rw-r--r-- | LUFA/ManPages/ChangeLog.txt | 1 |
6 files changed, 10 insertions, 9 deletions
diff --git a/Demos/Device/ClassDriver/RNDISEthernet/Lib/TCP.c b/Demos/Device/ClassDriver/RNDISEthernet/Lib/TCP.c index a49995cc..ccaac4cf 100644 --- a/Demos/Device/ClassDriver/RNDISEthernet/Lib/TCP.c +++ b/Demos/Device/ClassDriver/RNDISEthernet/Lib/TCP.c @@ -182,7 +182,7 @@ bool TCP_SetPortState(const uint16_t Port, /* Note, Port number should be specified in BIG endian to simplify network code */ /* Check to see if the port entry is already in the port state table */ - for (uint8_t PTableEntry = 0; PTableEntry < MAX_TCP_CONNECTIONS; PTableEntry++) + for (uint8_t PTableEntry = 0; PTableEntry < MAX_OPEN_TCP_PORTS; PTableEntry++) { /* Find existing entry for the port in the table, update it if found */ if (PortStateTable[PTableEntry].Port == Port) @@ -196,7 +196,7 @@ bool TCP_SetPortState(const uint16_t Port, /* Check if trying to open the port -- if so we need to find an unused (closed) entry and replace it */ if (State == TCP_Port_Open) { - for (uint8_t PTableEntry = 0; PTableEntry < MAX_TCP_CONNECTIONS; PTableEntry++) + for (uint8_t PTableEntry = 0; PTableEntry < MAX_OPEN_TCP_PORTS; PTableEntry++) { /* Find a closed port entry in the table, change it to the given port and state */ if (PortStateTable[PTableEntry].State == TCP_Port_Closed) @@ -228,7 +228,7 @@ uint8_t TCP_GetPortState(const uint16_t Port) { /* Note, Port number should be specified in BIG endian to simplify network code */ - for (uint8_t PTableEntry = 0; PTableEntry < MAX_TCP_CONNECTIONS; PTableEntry++) + for (uint8_t PTableEntry = 0; PTableEntry < MAX_OPEN_TCP_PORTS; PTableEntry++) { /* Find existing entry for the port in the table, return the port status if found */ if (PortStateTable[PTableEntry].Port == Port) diff --git a/Demos/Device/LowLevel/RNDISEthernet/Lib/TCP.c b/Demos/Device/LowLevel/RNDISEthernet/Lib/TCP.c index c8a12da7..e9431f95 100644 --- a/Demos/Device/LowLevel/RNDISEthernet/Lib/TCP.c +++ b/Demos/Device/LowLevel/RNDISEthernet/Lib/TCP.c @@ -181,7 +181,7 @@ bool TCP_SetPortState(const uint16_t Port, /* Note, Port number should be specified in BIG endian to simplify network code */ /* Check to see if the port entry is already in the port state table */ - for (uint8_t PTableEntry = 0; PTableEntry < MAX_TCP_CONNECTIONS; PTableEntry++) + for (uint8_t PTableEntry = 0; PTableEntry < MAX_OPEN_TCP_PORTS; PTableEntry++) { /* Find existing entry for the port in the table, update it if found */ if (PortStateTable[PTableEntry].Port == Port) @@ -195,7 +195,7 @@ bool TCP_SetPortState(const uint16_t Port, /* Check if trying to open the port -- if so we need to find an unused (closed) entry and replace it */ if (State == TCP_Port_Open) { - for (uint8_t PTableEntry = 0; PTableEntry < MAX_TCP_CONNECTIONS; PTableEntry++) + for (uint8_t PTableEntry = 0; PTableEntry < MAX_OPEN_TCP_PORTS; PTableEntry++) { /* Find a closed port entry in the table, change it to the given port and state */ if (PortStateTable[PTableEntry].State == TCP_Port_Closed) @@ -227,7 +227,7 @@ uint8_t TCP_GetPortState(const uint16_t Port) { /* Note, Port number should be specified in BIG endian to simplify network code */ - for (uint8_t PTableEntry = 0; PTableEntry < MAX_TCP_CONNECTIONS; PTableEntry++) + for (uint8_t PTableEntry = 0; PTableEntry < MAX_OPEN_TCP_PORTS; PTableEntry++) { /* Find existing entry for the port in the table, return the port status if found */ if (PortStateTable[PTableEntry].Port == Port) diff --git a/Demos/Host/LowLevel/MassStorageHost/MassStorageHost.c b/Demos/Host/LowLevel/MassStorageHost/MassStorageHost.c index a1d39cbb..d2066310 100644 --- a/Demos/Host/LowLevel/MassStorageHost/MassStorageHost.c +++ b/Demos/Host/LowLevel/MassStorageHost/MassStorageHost.c @@ -348,7 +348,7 @@ void MassStorageHost_Task(void) * \param[in] CommandString ASCII string located in PROGMEM space indicating what operation failed * \param[in] ErrorCode Error code of the function which failed to complete successfully */ -void ShowDiskReadError(char* CommandString, +void ShowDiskReadError(const char* CommandString, const uint8_t ErrorCode) { if (ErrorCode == MASS_STORE_SCSI_COMMAND_FAILED) diff --git a/Demos/Host/LowLevel/MassStorageHost/MassStorageHost.h b/Demos/Host/LowLevel/MassStorageHost/MassStorageHost.h index 0aec46fd..3f4ae07e 100644 --- a/Demos/Host/LowLevel/MassStorageHost/MassStorageHost.h +++ b/Demos/Host/LowLevel/MassStorageHost/MassStorageHost.h @@ -84,7 +84,7 @@ const uint8_t SubErrorCode); void EVENT_USB_Host_DeviceEnumerationComplete(void); - void ShowDiskReadError(char* CommandString, + void ShowDiskReadError(const char* CommandString, const uint8_t ErrorCode); #endif diff --git a/Demos/Host/LowLevel/StillImageHost/StillImageHost.c b/Demos/Host/LowLevel/StillImageHost/StillImageHost.c index d2eecb40..51f62016 100644 --- a/Demos/Host/LowLevel/StillImageHost/StillImageHost.c +++ b/Demos/Host/LowLevel/StillImageHost/StillImageHost.c @@ -353,7 +353,7 @@ void UnicodeToASCII(uint8_t* UnicodeString, void ShowCommandError(uint8_t ErrorCode, bool ResponseCodeError) { - char* FailureType = ((ResponseCodeError) ? PSTR("Response Code != OK") : PSTR("Transaction Fail")); + const char* FailureType = ((ResponseCodeError) ? PSTR("Response Code != OK") : PSTR("Transaction Fail")); printf_P(PSTR(ESC_FG_RED "Command Error (%S).\r\n" " -- Error Code %d\r\n" ESC_FG_WHITE), FailureType, ErrorCode); diff --git a/LUFA/ManPages/ChangeLog.txt b/LUFA/ManPages/ChangeLog.txt index c07f10a9..e8a7b9eb 100644 --- a/LUFA/ManPages/ChangeLog.txt +++ b/LUFA/ManPages/ChangeLog.txt @@ -94,6 +94,7 @@ * - Fixed incorrect Dataflash buffer use in the DataflashManager_WriteBlocks_RAM() function of several demos/projects (thanks to Jeremy Willden) * - Fixed incorrect logging interval (always 500ms longer than requested) in the TempDataLogger project * - Fixed incorrect buffer size check in the USBtoSerial project (thanks to Yuri A Nikiforov) + * - Fixed port state table corruption in the TCP layer of the RNDIS Ethernet device demos * * \section Sec_ChangeLog110528 Version 110528 * <b>New:</b> |
