X-Git-Url: https://oss.titaniummirror.com/gitweb/?a=blobdiff_plain;f=tos%2Fsystem%2FQueueC.nc;h=ecf714aabed9f3c9221104001e4ce80cab0a74ab;hb=acc63f2712ddbccfcbbd1058b9d579d9ba166cd2;hp=92a14fc6fe169f8d7290db072b2e6eb983a8f8eb;hpb=246233eb970e1098c98561b507b0749c1b2bec73;p=tinyos-2.x.git diff --git a/tos/system/QueueC.nc b/tos/system/QueueC.nc index 92a14fc6..ecf714aa 100644 --- a/tos/system/QueueC.nc +++ b/tos/system/QueueC.nc @@ -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]; }