From: scipio Date: Sat, 21 Apr 2007 07:02:37 +0000 (+0000) Subject: Fix compilation warnings. X-Git-Tag: tinyos/2.0.1~2 X-Git-Url: https://oss.titaniummirror.com/gitweb/?p=tinyos-2.x.git;a=commitdiff_plain;h=618c63a3bd6752cdd94d8511ffecaac79499283a Fix compilation warnings. --- diff --git a/tos/lib/net/ctp/CtpRoutingEngineP.nc b/tos/lib/net/ctp/CtpRoutingEngineP.nc index 5c6faeb0..fb8aad78 100644 --- a/tos/lib/net/ctp/CtpRoutingEngineP.nc +++ b/tos/lib/net/ctp/CtpRoutingEngineP.nc @@ -555,23 +555,23 @@ implementation { command void CtpInfo.triggerRouteUpdate() { // Random time in interval 64-127ms - uint16_t time = call Random.rand16(); - time &= 0x3f; - time += 64; + uint16_t beaconDelay = call Random.rand16(); + beaconDelay &= 0x3f; + beaconDelay += 64; if (call BeaconTimer.gett0() + call BeaconTimer.getdt() - - call BeaconTimer.getNow() >= time) { + call BeaconTimer.getNow() >= beaconDelay) { call BeaconTimer.stop(); - call BeaconTimer.startOneShot(time); + call BeaconTimer.startOneShot(beaconDelay); } } command void CtpInfo.triggerImmediateRouteUpdate() { // Random time in interval 4-11ms - uint16_t time = call Random.rand16(); - time &= 0x7; - time += 4; + uint16_t beaconDelay = call Random.rand16(); + beaconDelay &= 0x7; + beaconDelay += 4; call BeaconTimer.stop(); - call BeaconTimer.startOneShot(time); + call BeaconTimer.startOneShot(beaconDelay); } command void CtpInfo.setNeighborCongested(am_addr_t n, bool congested) { diff --git a/tos/lib/tossim/CpmModelC.nc b/tos/lib/tossim/CpmModelC.nc index de73f0af..bfa4f60f 100644 --- a/tos/lib/tossim/CpmModelC.nc +++ b/tos/lib/tossim/CpmModelC.nc @@ -325,15 +325,15 @@ implementation { } command void Model.putOnAirTo(int dest, message_t* msg, bool ack, sim_time_t endTime, double power) { - gain_entry_t* link = sim_gain_first(sim_node()); + gain_entry_t* neighborEntry = sim_gain_first(sim_node()); requestAck = ack; outgoing = msg; dbg("CpmModelC", "Node %i transmitting to %i, finishes at %llu.\n", sim_node(), dest, endTime); - while (link != NULL) { - int other = link->mote; + while (neighborEntry != NULL) { + int other = neighborEntry->mote; sim_gain_put(other, msg, endTime, ack && (other == dest), power + sim_gain_value(sim_node(), other)); - link = sim_gain_next(link); + neighborEntry = sim_gain_next(neighborEntry); } } diff --git a/tos/lib/tossim/sim_gain.c b/tos/lib/tossim/sim_gain.c index d2f647d2..cb64571c 100644 --- a/tos/lib/tossim/sim_gain.c +++ b/tos/lib/tossim/sim_gain.c @@ -11,7 +11,7 @@ sim_gain_noise_t localNoise[TOSSIM_MAX_NODES + 1]; double sensitivity = 4.0; gain_entry_t* sim_gain_allocate_link(int mote); -void sim_gain_deallocate_link(gain_entry_t* link); +void sim_gain_deallocate_link(gain_entry_t* linkToDelete); gain_entry_t* sim_gain_first(int src) __attribute__ ((C, spontaneous)) { if (src > TOSSIM_MAX_NODES) { @@ -20,8 +20,8 @@ gain_entry_t* sim_gain_first(int src) __attribute__ ((C, spontaneous)) { return connectivity[src]; } -gain_entry_t* sim_gain_next(gain_entry_t* link) __attribute__ ((C, spontaneous)) { - return link->next; +gain_entry_t* sim_gain_next(gain_entry_t* currentLink) __attribute__ ((C, spontaneous)) { + return currentLink->next; } void sim_gain_add(int src, int dest, double gain) __attribute__ ((C, spontaneous)) { @@ -157,15 +157,15 @@ double sim_gain_sample_noise(int node) __attribute__ ((C, spontaneous)) { } gain_entry_t* sim_gain_allocate_link(int mote) { - gain_entry_t* link = (gain_entry_t*)malloc(sizeof(gain_entry_t)); - link->next = NULL; - link->mote = mote; - link->gain = -10000000.0; - return link; + gain_entry_t* newLink = (gain_entry_t*)malloc(sizeof(gain_entry_t)); + newLink->next = NULL; + newLink->mote = mote; + newLink->gain = -10000000.0; + return newLink; } -void sim_gain_deallocate_link(gain_entry_t* link) __attribute__ ((C, spontaneous)) { - free(link); +void sim_gain_deallocate_link(gain_entry_t* linkToDelete) __attribute__ ((C, spontaneous)) { + free(linkToDelete); } void sim_gain_set_sensitivity(double s) __attribute__ ((C, spontaneous)) {