X-Git-Url: https://oss.titaniummirror.com/gitweb/?a=blobdiff_plain;f=tos%2Fsystem%2FQueueC.nc;h=ecf714aabed9f3c9221104001e4ce80cab0a74ab;hb=e9bfab607e051bae6afb47b44892ce37541d1b44;hp=92a14fc6fe169f8d7290db072b2e6eb983a8f8eb;hpb=b21ba62c1963284eb820ad80adcde4a51afd3e6b;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]; }