WIZNet W5500 with additional enhancements
Fork of WIZnetInterface by
Revision 32:f6d76a55a50b, committed 2017-10-07
- Comitter:
- Helmut Tschemernjak
- Date:
- Sat Oct 07 16:26:55 2017 +0200
- Parent:
- 31:a3fbfa5c8351
- Child:
- 33:879cfe51e66e
- Commit message:
- Fixed compiler warnings
Changed in this revision
--- a/Socket/Endpoint.cpp Sat Oct 07 15:08:58 2017 +0200
+++ b/Socket/Endpoint.cpp Sat Oct 07 16:26:55 2017 +0200
@@ -44,7 +44,7 @@
error("DNS error : Cannot get url from DNS server\r\n");
return -1;
}
- snprintf(_ipAddress, sizeof(_ipAddress), "%d.%d.%d.%d", (addr>>24)&0xff, (addr>>16)&0xff, (addr>>8)&0xff, addr&0xff);
+ snprintf(_ipAddress, sizeof(_ipAddress), "%d.%d.%d.%d", (int)(addr>>24)&0xff, (int)(addr>>16)&0xff, (int)(addr>>8)&0xff, (int)addr&0xff);
_port = port;
return 0;
}
--- a/Socket/TCPSocketServer.cpp Sat Oct 07 15:08:58 2017 +0200
+++ b/Socket/TCPSocketServer.cpp Sat Oct 07 16:26:55 2017 +0200
@@ -71,7 +71,7 @@
}
uint32_t ip = eth->sreg<uint32_t>(_sock_fd, Sn_DIPR);
char host[16];
- snprintf(host, sizeof(host), "%d.%d.%d.%d", (ip>>24)&0xff, (ip>>16)&0xff, (ip>>8)&0xff, ip&0xff);
+ snprintf(host, sizeof(host), "%d.%d.%d.%d", (int)(ip>>24)&0xff, (int)(ip>>16)&0xff, (int)(ip>>8)&0xff, (int)ip&0xff);
uint16_t port = eth->sreg<uint16_t>(_sock_fd, Sn_DPORT);
// change this server socket to connection socket.
--- a/Socket/UDPSocket.cpp Sat Oct 07 15:08:58 2017 +0200
+++ b/Socket/UDPSocket.cpp Sat Oct 07 16:26:55 2017 +0200
@@ -79,7 +79,7 @@
readEndpoint(remote, info);
int udp_size = info[6]<<8|info[7];
//TEST_ASSERT(udp_size <= (size-sizeof(info)));
- if (udp_size > (size-sizeof(info))) {
+ if (udp_size > (int)(size-sizeof(info))) {
return -1;
}
--- a/Socket/pico_string.h Sat Oct 07 15:08:58 2017 +0200
+++ b/Socket/pico_string.h Sat Oct 07 16:26:55 2017 +0200
@@ -38,7 +38,7 @@
if (_buf) {
return _buf;
}
- return "";
+ return (char *)"";
}
private:
char* _buf;
--- a/arch/ext/W5500.cpp Sat Oct 07 15:08:58 2017 +0200
+++ b/arch/ext/W5500.cpp Sat Oct 07 16:26:55 2017 +0200
@@ -119,7 +119,7 @@
{
uint32_t addr = str_to_ip(host);
char buf[17];
- snprintf(buf, sizeof(buf), "%d.%d.%d.%d", (addr>>24)&0xff, (addr>>16)&0xff, (addr>>8)&0xff, addr&0xff);
+ snprintf(buf, sizeof(buf), "%d.%d.%d.%d", (int)(addr>>24)&0xff, (int)(addr>>16)&0xff, (int)(addr>>8)&0xff, (int)addr&0xff);
if (strcmp(buf, host) == 0) {
*ip = addr;
return true;
--- a/arch/ext/W5500.h Sat Oct 07 15:08:58 2017 +0200
+++ b/arch/ext/W5500.h Sat Oct 07 16:26:55 2017 +0200
@@ -324,7 +324,7 @@
void reg_wr(uint16_t addr, uint8_t cb, T data) {
uint8_t buf[sizeof(T)];
*reinterpret_cast<T*>(buf) = data;
- for(int i = 0; i < sizeof(buf)/2; i++) { // Little Endian to Big Endian
+ for(int i = 0; i < (int)sizeof(buf)/2; i++) { // Little Endian to Big Endian
uint8_t t = buf[i];
buf[i] = buf[sizeof(buf)-1-i];
buf[sizeof(buf)-1-i] = t;
@@ -341,7 +341,7 @@
T reg_rd(uint16_t addr, uint8_t cb) {
uint8_t buf[sizeof(T)];
spi_read(addr, cb, buf, sizeof(buf));
- for(int i = 0; i < sizeof(buf)/2; i++) { // Big Endian to Little Endian
+ for(int i = 0; i < (int)sizeof(buf)/2; i++) { // Big Endian to Little Endian
uint8_t t = buf[i];
buf[i] = buf[sizeof(buf)-1-i];
buf[sizeof(buf)-1-i] = t;
Helmut Tschemernjak
