From 569c75246d8a95cb077c52301b47feb3d7e518d8 Mon Sep 17 00:00:00 2001 From: Matt Robinson Date: Wed, 16 Jul 2014 20:27:57 +0100 Subject: [PATCH 1/2] Remove unused variable from ethernet socket utils Remove the variable 'status' as this had a value assigned (from readSnSR), but it was never used. --- libraries/Ethernet/src/utility/socket.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/libraries/Ethernet/src/utility/socket.cpp b/libraries/Ethernet/src/utility/socket.cpp index 5332981d2..b6d76f1a8 100644 --- a/libraries/Ethernet/src/utility/socket.cpp +++ b/libraries/Ethernet/src/utility/socket.cpp @@ -319,7 +319,6 @@ void flush(SOCKET s) { uint16_t igmpsend(SOCKET s, const uint8_t * buf, uint16_t len) { - uint8_t status=0; uint16_t ret=0; if (len > W5100.SSIZE) @@ -335,7 +334,6 @@ uint16_t igmpsend(SOCKET s, const uint8_t * buf, uint16_t len) while ( (W5100.readSnIR(s) & SnIR::SEND_OK) != SnIR::SEND_OK ) { - status = W5100.readSnSR(s); if (W5100.readSnIR(s) & SnIR::TIMEOUT) { /* in case of igmp, if send fails, then socket closed */ From 61a35589460136b56f7a689108ff6c828eb0053c Mon Sep 17 00:00:00 2001 From: Matt Robinson Date: Thu, 17 Jul 2014 16:44:30 +0100 Subject: [PATCH 2/2] Cast empty string to char* to fix compiler warning Stream::find(char *target) passes an empty terminator string to Stream::findUntil(char *target, char *terminator) which caused a compiler warning with the updated toolchain, so cast it to a char*. --- hardware/arduino/avr/cores/arduino/Stream.cpp | 2 +- hardware/arduino/sam/cores/arduino/Stream.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hardware/arduino/avr/cores/arduino/Stream.cpp b/hardware/arduino/avr/cores/arduino/Stream.cpp index 39873aac8..9c581bee1 100644 --- a/hardware/arduino/avr/cores/arduino/Stream.cpp +++ b/hardware/arduino/avr/cores/arduino/Stream.cpp @@ -75,7 +75,7 @@ void Stream::setTimeout(unsigned long timeout) // sets the maximum number of mi // find returns true if the target string is found bool Stream::find(char *target) { - return findUntil(target, ""); + return findUntil(target, (char*)""); } // reads data from the stream until the target string of given length is found diff --git a/hardware/arduino/sam/cores/arduino/Stream.cpp b/hardware/arduino/sam/cores/arduino/Stream.cpp index 39873aac8..9c581bee1 100644 --- a/hardware/arduino/sam/cores/arduino/Stream.cpp +++ b/hardware/arduino/sam/cores/arduino/Stream.cpp @@ -75,7 +75,7 @@ void Stream::setTimeout(unsigned long timeout) // sets the maximum number of mi // find returns true if the target string is found bool Stream::find(char *target) { - return findUntil(target, ""); + return findUntil(target, (char*)""); } // reads data from the stream until the target string of given length is found