]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/system/QueueC.nc
Merge TinyOS 2.1.1 into master.
[tinyos-2.x.git] / tos / system / QueueC.nc
index 92a14fc6fe169f8d7290db072b2e6eb983a8f8eb..ecf714aabed9f3c9221104001e4ce80cab0a74ab 100644 (file)
@@ -111,7 +111,9 @@ implementation {
   
   command queue_t Queue.element(uint8_t idx) {
     idx += head;
-    idx %= QUEUE_SIZE;
+    if (idx >= QUEUE_SIZE) {
+      idx -= QUEUE_SIZE;
+    }
     return queue[idx];
   }