diff --git a/arch/platform/cooja/platform.c b/arch/platform/cooja/platform.c index f9beff84c8b8f07312f09c388cd632f6fb566a10..3dea7d653869d16ca328dbd9c57e43a47f88275c 100644 --- a/arch/platform/cooja/platform.c +++ b/arch/platform/cooja/platform.c @@ -154,12 +154,9 @@ set_lladdr(void) memset(&addr, 0, sizeof(linkaddr_t)); #if NETSTACK_CONF_WITH_IPV6 - { - int i; - for(i = 0; i < sizeof(uip_lladdr.addr); i += 2) { - addr.u8[i + 1] = simMoteID & 0xff; - addr.u8[i + 0] = simMoteID >> 8; - } + for(size_t i = 0; i < sizeof(uip_lladdr.addr); i += 2) { + addr.u8[i + 1] = simMoteID & 0xff; + addr.u8[i + 0] = simMoteID >> 8; } #else /* NETSTACK_CONF_WITH_IPV6 */ addr.u8[0] = simMoteID & 0xff; diff --git a/os/lib/sensors.c b/os/lib/sensors.c index ccfbdad5eff23e13fac97b38bfe0cc116bc9582b..91472ba2e9e150241c7e92cf3af78b849da4e9fc 100644 --- a/os/lib/sensors.c +++ b/os/lib/sensors.c @@ -29,8 +29,6 @@ * This file is part of the Contiki operating system. * */ -/* exeperimental code, will be renamed to sensors.c when done */ - #include <string.h> @@ -38,7 +36,7 @@ #include "lib/sensors.h" -const extern struct sensors_sensor *sensors[]; +extern const struct sensors_sensor *sensors[]; extern unsigned char sensors_flags[]; #define FLAG_CHANGED 0x80 diff --git a/os/net/ipv6/sicslowpan.c b/os/net/ipv6/sicslowpan.c index 0b570e45e2c8ae5a533aa2f4e73590b2fe3ddf24..5ccacfd13375e67aa1426e82f17d2e845410efe3 100644 --- a/os/net/ipv6/sicslowpan.c +++ b/os/net/ipv6/sicslowpan.c @@ -434,7 +434,7 @@ copy_frags2uip(int context) for(i = 0; i < SICSLOWPAN_FRAGMENT_BUFFERS; i++) { /* And also copy all matching fragments */ if(frag_buf[i].len > 0 && frag_buf[i].index == context) { - if((frag_buf[i].offset << 3) + frag_buf[i].len > sizeof(uip_buf)) { + if(((size_t)frag_buf[i].offset << 3) + frag_buf[i].len > sizeof(uip_buf)) { LOG_WARN("input: invalid fragment offset\n"); clear_fragments(context); return false; @@ -2026,12 +2026,12 @@ input(void) /* Sanity-check size of incoming packet to avoid buffer overflow */ { - int req_size = uncomp_hdr_len + (uint16_t)(frag_offset << 3) + unsigned int req_size = uncomp_hdr_len + (uint16_t)(frag_offset << 3) + packetbuf_payload_len; if(req_size > sizeof(uip_buf)) { #if SICSLOWPAN_CONF_FRAG LOG_ERR( - "input: packet and fragment context %u dropped, minimum required IP_BUF size: %d+%d+%d=%d (current size: %u)\n", + "input: packet and fragment context %u dropped, minimum required IP_BUF size: %d+%d+%d=%u (current size: %u)\n", frag_context, uncomp_hdr_len, (uint16_t)(frag_offset << 3), packetbuf_payload_len, req_size, (unsigned)sizeof(uip_buf)); diff --git a/os/net/routing/rpl-lite/rpl-ext-header.c b/os/net/routing/rpl-lite/rpl-ext-header.c index 8c7d936a4fef585b6973d9eff30bdfb746a3b8e6..6657795419bac41ce504a35562d1d983cad6ccf7 100644 --- a/os/net/routing/rpl-lite/rpl-ext-header.c +++ b/os/net/routing/rpl-lite/rpl-ext-header.c @@ -166,8 +166,7 @@ rpl_ext_header_srh_update(void) static int count_matching_bytes(const void *p1, const void *p2, size_t n) { - int i = 0; - for(i = 0; i < n; i++) { + for(size_t i = 0; i < n; i++) { if(((uint8_t *)p1)[i] != ((uint8_t *)p2)[i]) { return i; } diff --git a/os/sys/process.h b/os/sys/process.h index 5cffdb526295b718ebe768c509d61012eb2ee5b0..73e9535b3bb94fc670e2ff532e9742744204f690 100644 --- a/os/sys/process.h +++ b/os/sys/process.h @@ -302,12 +302,12 @@ static PT_THREAD(process_thread_##name(struct pt *process_pt, \ #define PROCESS(name, strname) \ PROCESS_THREAD(name, ev, data); \ struct process name = { NULL, \ - process_thread_##name } + process_thread_##name, {0}, 0, 0 } #else #define PROCESS(name, strname) \ PROCESS_THREAD(name, ev, data); \ struct process name = { NULL, strname, \ - process_thread_##name } + process_thread_##name, {0}, 0, 0 } #endif /** @} */