From 01442326b27cedf7cababfcdb42ffe4fa14d44ee Mon Sep 17 00:00:00 2001 From: adamdunkels Date: Sun, 8 Nov 2009 19:42:59 +0000 Subject: [PATCH] Made rimeaddr_t pointers const when they should be --- apps/shell/shell-download.c | 10 ++++++---- apps/shell/shell-netperf.c | 7 ++++--- apps/shell/shell-rime-debug.c | 6 +++--- apps/shell/shell-rime-neighbors.c | 4 ++-- apps/shell/shell-rime-sendcmd.c | 4 ++-- apps/shell/shell-rime-unicast.c | 4 ++-- apps/shell/shell-rime.c | 6 +++--- 7 files changed, 22 insertions(+), 19 deletions(-) diff --git a/apps/shell/shell-download.c b/apps/shell/shell-download.c index 48c1065be..5b5749d5e 100644 --- a/apps/shell/shell-download.c +++ b/apps/shell/shell-download.c @@ -28,7 +28,7 @@ * * This file is part of the Contiki operating system. * - * $Id: shell-download.c,v 1.2 2009/04/20 13:18:07 fros4943 Exp $ + * $Id: shell-download.c,v 1.3 2009/11/08 19:42:59 adamdunkels Exp $ */ /** @@ -186,7 +186,7 @@ PROCESS_THREAD(shell_download_process, ev, data) } /*---------------------------------------------------------------------------*/ static void -request_recv(struct runicast_conn *c, rimeaddr_t *from, uint8_t seqno) +request_recv(struct runicast_conn *c, const rimeaddr_t *from, uint8_t seqno) { const char *filename; uint8_t seq; @@ -225,13 +225,15 @@ request_recv(struct runicast_conn *c, rimeaddr_t *from, uint8_t seqno) } /*---------------------------------------------------------------------------*/ static void -request_sent(struct runicast_conn *c, rimeaddr_t *to, uint8_t retransmissions) +request_sent(struct runicast_conn *c, const rimeaddr_t *to, + uint8_t retransmissions) { process_poll(&shell_download_process); } /*---------------------------------------------------------------------------*/ static void -request_timedout(struct runicast_conn *c, rimeaddr_t *to, uint8_t retransmissions) +request_timedout(struct runicast_conn *c, const rimeaddr_t *to, + uint8_t retransmissions) { shell_output_str(&download_command, "download: request timed out", ""); downloading = 0; diff --git a/apps/shell/shell-netperf.c b/apps/shell/shell-netperf.c index d9667a88e..dcd659bb2 100644 --- a/apps/shell/shell-netperf.c +++ b/apps/shell/shell-netperf.c @@ -28,7 +28,7 @@ * * This file is part of the Contiki operating system. * - * $Id: shell-netperf.c,v 1.2 2009/11/04 07:48:18 adamdunkels Exp $ + * $Id: shell-netperf.c,v 1.3 2009/11/08 19:43:00 adamdunkels Exp $ */ /** @@ -117,7 +117,8 @@ static void memcpy_misaligned(void *dest, const void *source, int len) { int i; - u8_t *destptr, *sourceptr; + uint8_t *destptr; + const uint8_t *sourceptr; if(((int)dest & 1) == 1 || ((int)source & 1) == 1) { destptr = dest; @@ -316,7 +317,7 @@ process_incoming_packet(void) struct datapath_msg msg_copy; now = timesynch_time(); - memcpy_misaligned(&msg_copy, (u8_t *)msg, sizeof(msg_copy)); + memcpy_misaligned(&msg_copy, (uint8_t *)msg, sizeof(msg_copy)); stats.received++; stats.total_tx_latency += msg_copy.rx - msg_copy.tx; stats.total_rx_latency += now - msg_copy.rx; diff --git a/apps/shell/shell-rime-debug.c b/apps/shell/shell-rime-debug.c index 6466cd9c9..3dc101d15 100644 --- a/apps/shell/shell-rime-debug.c +++ b/apps/shell/shell-rime-debug.c @@ -28,7 +28,7 @@ * * This file is part of the Contiki operating system. * - * $Id: shell-rime-debug.c,v 1.3 2009/03/12 21:58:20 adamdunkels Exp $ + * $Id: shell-rime-debug.c,v 1.4 2009/11/08 19:43:00 adamdunkels Exp $ */ /** @@ -116,7 +116,7 @@ PROCESS_THREAD(shell_broadcast_process, ev, data) PROCESS_END(); } static void -recv_broadcast(struct broadcast_conn *c, rimeaddr_t *from) +recv_broadcast(struct broadcast_conn *c, const rimeaddr_t *from) { struct collect_msg *msg; rtimer_clock_t latency; @@ -188,7 +188,7 @@ PROCESS_THREAD(shell_unicast_process, ev, data) PROCESS_END(); } static void -recv_uc(struct unicast_conn *c, rimeaddr_t *from) +recv_uc(struct unicast_conn *c, const rimeaddr_t *from) { struct collect_msg *msg; rtimer_clock_t latency; diff --git a/apps/shell/shell-rime-neighbors.c b/apps/shell/shell-rime-neighbors.c index f1ba0f99c..90cd862e4 100644 --- a/apps/shell/shell-rime-neighbors.c +++ b/apps/shell/shell-rime-neighbors.c @@ -28,7 +28,7 @@ * * This file is part of the Contiki operating system. * - * $Id: shell-rime-neighbors.c,v 1.2 2009/10/18 11:42:06 adamdunkels Exp $ + * $Id: shell-rime-neighbors.c,v 1.3 2009/11/08 19:43:00 adamdunkels Exp $ */ /** @@ -52,7 +52,7 @@ static uint8_t listening_for_neighbors = 0; /*---------------------------------------------------------------------------*/ static void -received_announcement(struct announcement *a, rimeaddr_t *from, +received_announcement(struct announcement *a, const rimeaddr_t *from, uint16_t id, uint16_t value) { struct { diff --git a/apps/shell/shell-rime-sendcmd.c b/apps/shell/shell-rime-sendcmd.c index f203c1e3a..781771c22 100644 --- a/apps/shell/shell-rime-sendcmd.c +++ b/apps/shell/shell-rime-sendcmd.c @@ -28,7 +28,7 @@ * * This file is part of the Contiki operating system. * - * $Id: shell-rime-sendcmd.c,v 1.1 2009/04/16 14:33:47 fros4943 Exp $ + * $Id: shell-rime-sendcmd.c,v 1.2 2009/11/08 19:43:00 adamdunkels Exp $ */ #include "contiki.h" @@ -142,7 +142,7 @@ PROCESS_THREAD(shell_sendcmd_process, ev, data) } /*---------------------------------------------------------------------------*/ static void -recv_uc(struct unicast_conn *c, rimeaddr_t *from) +recv_uc(struct unicast_conn *c, const rimeaddr_t *from) { struct cmd_msg *msg; uint16_t crc; diff --git a/apps/shell/shell-rime-unicast.c b/apps/shell/shell-rime-unicast.c index f5ef1ddf1..c3da35289 100644 --- a/apps/shell/shell-rime-unicast.c +++ b/apps/shell/shell-rime-unicast.c @@ -28,7 +28,7 @@ * * This file is part of the Contiki operating system. * - * $Id: shell-rime-unicast.c,v 1.2 2009/09/09 21:06:51 adamdunkels Exp $ + * $Id: shell-rime-unicast.c,v 1.3 2009/11/08 19:43:00 adamdunkels Exp $ */ /** @@ -133,7 +133,7 @@ PROCESS_THREAD(shell_unicast_send_process, ev, data) } /*---------------------------------------------------------------------------*/ static void -recv_uc(struct unicast_conn *c, rimeaddr_t *from) +recv_uc(struct unicast_conn *c, const rimeaddr_t *from) { struct unicast_msg *msg; #define OUTPUT_BLOB_HDRSIZE 6 diff --git a/apps/shell/shell-rime.c b/apps/shell/shell-rime.c index 735eb7fb9..168e5e7bf 100644 --- a/apps/shell/shell-rime.c +++ b/apps/shell/shell-rime.c @@ -28,7 +28,7 @@ * * This file is part of the Contiki operating system. * - * $Id: shell-rime.c,v 1.14 2009/05/10 21:04:06 adamdunkels Exp $ + * $Id: shell-rime.c,v 1.15 2009/11/08 19:43:00 adamdunkels Exp $ */ /** @@ -419,8 +419,8 @@ send_collect(void *dummy) } /*---------------------------------------------------------------------------*/ static int -recv_netflood(struct netflood_conn *c, rimeaddr_t *from, - rimeaddr_t *originator, uint8_t seqno, uint8_t hops) +recv_netflood(struct netflood_conn *c, const rimeaddr_t *from, + const rimeaddr_t *originator, uint8_t seqno, uint8_t hops) { struct netflood_msg *msg;