[Tinyos-2-commits] CVS: tinyos-2.x/tos/system QueueC.nc,1.6,1.7

Phil Levis scipio at users.sourceforge.net
Thu Jun 25 11:37:26 PDT 2009


Update of /cvsroot/tinyos/tinyos-2.x/tos/system
In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv14386

Modified Files:
	QueueC.nc 
Log Message:
Remove modulo for inequality: does not require expensive op.


Index: QueueC.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/system/QueueC.nc,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** QueueC.nc	31 May 2008 20:27:07 -0000	1.6
--- QueueC.nc	25 Jun 2009 18:37:24 -0000	1.7
***************
*** 112,116 ****
    command queue_t Queue.element(uint8_t idx) {
      idx += head;
!     idx %= QUEUE_SIZE;
      return queue[idx];
    }  
--- 112,118 ----
    command queue_t Queue.element(uint8_t idx) {
      idx += head;
!     if (idx >= QUEUE_SIZE) {
!       idx -= QUEUE_SIZE;
!     }
      return queue[idx];
    }  



More information about the Tinyos-2-commits mailing list