Fix compiler warnings

This commit is contained in:
Adam Dunkels 2015-10-04 22:31:28 +02:00 committed by Simon Duquennoy
parent 5e1ce413af
commit c0de05f9a8
3 changed files with 6 additions and 6 deletions

View file

@ -129,7 +129,7 @@ PROCESS_THREAD(shell_netcmd_process, ev, data)
/* Terminate the string with a NUL character. */ /* Terminate the string with a NUL character. */
msg->netcmd[len] = 0; msg->netcmd[len] = 0;
msg->crc = crc16_data(msg->netcmd, len, 0); msg->crc = crc16_data((unsigned char *)msg->netcmd, len, 0);
printf("netcmd sending '%s'\n", msg->netcmd); printf("netcmd sending '%s'\n", msg->netcmd);
trickle_send(&trickle); trickle_send(&trickle);
} }
@ -157,7 +157,7 @@ recv_trickle(struct trickle_conn *c)
msg->netcmd[len] = 0; msg->netcmd[len] = 0;
memcpy(&crc, &msg->crc, sizeof(crc)); memcpy(&crc, &msg->crc, sizeof(crc));
if(crc == crc16_data(msg->netcmd, len, 0)) { if(crc == crc16_data((unsigned char *)msg->netcmd, len, 0)) {
/* Start the server process with the incoming command. */ /* Start the server process with the incoming command. */
process_start(&shell_netcmd_server_process, (void *)msg->netcmd); process_start(&shell_netcmd_server_process, (void *)msg->netcmd);
} }

View file

@ -133,7 +133,7 @@ PROCESS_THREAD(shell_sendcmd_process, ev, data)
/* Terminate the string with a NUL character. */ /* Terminate the string with a NUL character. */
msg->sendcmd[len] = 0; msg->sendcmd[len] = 0;
msg->crc = crc16_data(msg->sendcmd, len, 0); msg->crc = crc16_data((unsigned char *)msg->sendcmd, len, 0);
/* printf("sendcmd sending '%s'\n", msg->sendcmd);*/ /* printf("sendcmd sending '%s'\n", msg->sendcmd);*/
unicast_send(&uc, &addr); unicast_send(&uc, &addr);
@ -160,7 +160,7 @@ recv_uc(struct unicast_conn *c, const linkaddr_t *from)
msg->sendcmd[len] = 0; msg->sendcmd[len] = 0;
memcpy(&crc, &msg->crc, sizeof(crc)); memcpy(&crc, &msg->crc, sizeof(crc));
if(crc == crc16_data(msg->sendcmd, len, 0)) { if(crc == crc16_data((unsigned char *)msg->sendcmd, len, 0)) {
/* Start the server process with the incoming command. */ /* Start the server process with the incoming command. */
process_start(&shell_sendcmd_server_process, (void *)msg->sendcmd); process_start(&shell_sendcmd_server_process, (void *)msg->sendcmd);
} }

View file

@ -301,7 +301,7 @@ recv_collect(const linkaddr_t *originator, uint8_t seqno, uint8_t hops)
/* Copy the collect message header. */ /* Copy the collect message header. */
memcpy(&collect_msg, packetbuf_dataptr(), sizeof(collect_msg)); memcpy(&collect_msg, packetbuf_dataptr(), sizeof(collect_msg));
dataptr = ((struct collect_msg *)packetbuf_dataptr())->data; dataptr = (char *)((struct collect_msg *)packetbuf_dataptr())->data;
#if TIMESYNCH_CONF_ENABLED #if TIMESYNCH_CONF_ENABLED
latency = timesynch_time() - collect_msg.timestamp; latency = timesynch_time() - collect_msg.timestamp;
@ -321,7 +321,7 @@ recv_collect(const linkaddr_t *originator, uint8_t seqno, uint8_t hops)
if(packetbuf_datalen() >= COLLECT_MSG_HDRSIZE) { if(packetbuf_datalen() >= COLLECT_MSG_HDRSIZE) {
len = packetbuf_datalen() - COLLECT_MSG_HDRSIZE; len = packetbuf_datalen() - COLLECT_MSG_HDRSIZE;
if(collect_msg.crc == crc16_data(dataptr, len, 0)) { if(collect_msg.crc == crc16_data((unsigned char *)dataptr, len, 0)) {
msg.len = 5 + (packetbuf_datalen() - COLLECT_MSG_HDRSIZE) / 2; msg.len = 5 + (packetbuf_datalen() - COLLECT_MSG_HDRSIZE) / 2;
linkaddr_copy((linkaddr_t *)&msg.originator, originator); linkaddr_copy((linkaddr_t *)&msg.originator, originator);
msg.seqno = seqno; msg.seqno = seqno;