Browse code

READN -> READNfrom

Török Edvin authored on 2010/03/06 22:58:35
Showing 1 changed files
... ...
@@ -257,11 +257,13 @@ static always_inline struct stack_entry *pop_stack(struct stack *stack,
257 257
     *(void**)&values[p] = x
258 258
 
259 259
 #define uint_type(n) uint##n##_t
260
-#define READN(x, n, p)\
261
-    CHECK_GT(func->numBytes, p+(n/8)-1);\
262
-    x = *(uint_type(n)*)&values[p];\
260
+#define READNfrom(maxBytes, from, x, n, p)\
261
+    CHECK_GT((maxBytes), (p)+(n/8)-1);\
262
+    x = *(uint_type(n)*)&(from)[(p)];\
263 263
     TRACE_R(x)
264 264
 
265
+#define READN(x, n, p) READNfrom(func->numBytes, values, x, n, p)
266
+
265 267
 #define READ1(x, p) READN(x, 8, p);\
266 268
     x = x&1
267 269
 #define READ8(x, p) READN(x, 8, p)