Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix two compiler warnings generated by updated toolchain #2190

Merged
merged 2 commits into from
Jul 19, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion hardware/arduino/avr/cores/arduino/Stream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion hardware/arduino/sam/cores/arduino/Stream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions libraries/Ethernet/src/utility/socket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change may remove eventual side-effects of reading SnSR register, so to be 100% sure it should be changed from:

status = W5100.readSnSR(s);

to

W5100.readSnSR(s);

BTW looking at the datasheet it seems that the status register is read-only and reading (or not reading) it should be transparent for any subsequent operation.

/* in case of igmp, if send fails, then socket closed */
Expand Down