]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/system/RoundRobinResourceQueueC.nc
Fix the issue with tos-deluge not timing out properly.
[tinyos-2.x.git] / tos / system / RoundRobinResourceQueueC.nc
index b6d5565beb1ccadf288f9d224fd6196a16a15e35..ca23c8a4040478e9afb5e8b4f110deb94e76b11e 100644 (file)
  
 #include "Resource.h"
  
-generic module RoundRobinResourceQueueC(uint8_t size) {
+generic module RoundRobinResourceQueueC(uint8_t size) @safe() {
   provides {
     interface Init;
     interface ResourceQueue as RoundRobinQueue;
   }
 }
 implementation {
-  enum {NO_ENTRY = 0xFF};
+  enum {
+    NO_ENTRY = 0xFF,
+    SIZE = size ? (size - 1) / 8 + 1 : 0
+  };
 
-  uint8_t resQ[(size-1)/8 + 1];
+  uint8_t resQ[SIZE];
   uint8_t last = 0;
 
   void clearEntry(uint8_t id) {