]> oss.titaniummirror.com Git - tinyos-2.x.git/commitdiff
Fix compilation warnings.
authorscipio <scipio>
Sat, 21 Apr 2007 07:02:37 +0000 (07:02 +0000)
committerscipio <scipio>
Sat, 21 Apr 2007 07:02:37 +0000 (07:02 +0000)
tos/lib/net/ctp/CtpRoutingEngineP.nc
tos/lib/tossim/CpmModelC.nc
tos/lib/tossim/sim_gain.c

index 5c6faeb01ef3a4e360d0f4563f847cbd7abb882a..fb8aad78ff98ca9fba238a9c897b96cbd710185f 100644 (file)
@@ -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) {
index de73f0afc3379c09c9b847fbe788f13694a965b7..bfa4f60f9ba9098503e80d46167f0f071057420d 100644 (file)
@@ -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);
     }
   }
     
index d2f647d267ad5872a9cd5a24686601fffc0e2751..cb64571c6239479de778e67a079235725f4aef89 100644 (file)
@@ -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)) {