Made rimeaddr_t pointers const when they should be

This commit is contained in:
adamdunkels 2009-11-08 19:42:59 +00:00
parent 56218aba3b
commit 01442326b2
7 changed files with 22 additions and 19 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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 {

View File

@ -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;

View File

@ -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

View File

@ -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;