Skip to content

Commit 735454c

Browse files
zsxOldes
authored andcommitted
ATRONIX: Fix macros
SERIES/QUAD_SKIP(s, i + 1) will be mistakenly expanded (cherry picked from commit 05801b5)
1 parent 1d215f5 commit 735454c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/include/sys-value.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ static REBCNT bit_sizes[4] = { 8, 16, 32, 64 };
401401
#define SERIES_FLAGS(s) ((s)->info)
402402
#define SERIES_WIDE(s) (((s)->info) & 0xff)
403403
#define SERIES_DATA(s) ((s)->data)
404-
#define SERIES_SKIP(s,i) (SERIES_DATA(s) + (SERIES_WIDE(s) * i))
404+
#define SERIES_SKIP(s,i) (SERIES_DATA(s) + (SERIES_WIDE(s) * (i)))
405405

406406
#define END_FLAG 0x80000000 // Indicates end of block as an index (from DO_NEXT)
407407

@@ -629,7 +629,7 @@ typedef struct Reb_Series_Ref
629629
//} REBIMI;
630630

631631
#define QUAD_HEAD(s) ((REBYTE *)((s)->data))
632-
#define QUAD_SKIP(s,n) (((REBYTE *)((s)->data))+(n * 4))
632+
#define QUAD_SKIP(s,n) (((REBYTE *)((s)->data))+((n) * 4))
633633
#define QUAD_TAIL(s) (((REBYTE *)((s)->data))+((s)->tail * 4))
634634
#define QUAD_LEN(s) (SERIES_TAIL(s))
635635

0 commit comments

Comments
 (0)