[Tinyos-2-commits] CVS: tinyos-2.x/tos/lib/tossim CpmModelC.nc, 1.3, 1.4 sim_gain.c, 1.5, 1.6

Phil Levis scipio at users.sourceforge.net
Sat Apr 21 00:02:53 PDT 2007


Update of /cvsroot/tinyos/tinyos-2.x/tos/lib/tossim
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv20059

Modified Files:
	CpmModelC.nc sim_gain.c 
Log Message:
Fix compilation warnings.


Index: CpmModelC.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/lib/tossim/CpmModelC.nc,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** CpmModelC.nc	13 Apr 2007 17:31:49 -0000	1.3
--- CpmModelC.nc	21 Apr 2007 07:02:50 -0000	1.4
***************
*** 326,338 ****
  
    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());
      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;
        sim_gain_put(other, msg, endTime, ack && (other == dest), power + sim_gain_value(sim_node(), other));
!       link = sim_gain_next(link);
      }
    }
--- 326,338 ----
  
    command void Model.putOnAirTo(int dest, message_t* msg, bool ack, sim_time_t endTime, double power) {
!     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 (neighborEntry != NULL) {
!       int other = neighborEntry->mote;
        sim_gain_put(other, msg, endTime, ack && (other == dest), power + sim_gain_value(sim_node(), other));
!       neighborEntry = sim_gain_next(neighborEntry);
      }
    }

Index: sim_gain.c
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/lib/tossim/sim_gain.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** sim_gain.c	11 Apr 2007 01:29:44 -0000	1.5
--- sim_gain.c	21 Apr 2007 07:02:50 -0000	1.6
***************
*** 12,16 ****
  
  gain_entry_t* sim_gain_allocate_link(int mote);
! void sim_gain_deallocate_link(gain_entry_t* link);
  
  gain_entry_t* sim_gain_first(int src) __attribute__ ((C, spontaneous)) {
--- 12,16 ----
  
  gain_entry_t* sim_gain_allocate_link(int mote);
! void sim_gain_deallocate_link(gain_entry_t* linkToDelete);
  
  gain_entry_t* sim_gain_first(int src) __attribute__ ((C, spontaneous)) {
***************
*** 21,26 ****
  }
  
! gain_entry_t* sim_gain_next(gain_entry_t* link) __attribute__ ((C, spontaneous)) {
!   return link->next;
  }
  
--- 21,26 ----
  }
  
! gain_entry_t* sim_gain_next(gain_entry_t* currentLink) __attribute__ ((C, spontaneous)) {
!   return currentLink->next;
  }
  
***************
*** 158,170 ****
  
  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;
  }
  
! void sim_gain_deallocate_link(gain_entry_t* link) __attribute__ ((C, spontaneous)) {
!   free(link);
  }
  
--- 158,170 ----
  
  gain_entry_t* sim_gain_allocate_link(int mote) {
!   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* linkToDelete) __attribute__ ((C, spontaneous)) {
!   free(linkToDelete);
  }
  



More information about the Tinyos-2-commits mailing list