uxn

Varvara Ordinator, written in ANSI C(SDL2)
git clone https://git.eamoncaddigan.net/uxn.git
Log | Files | Refs | README | LICENSE

commit 01897219565591cdf0d2f9f4e6de3aee24516378
parent f1f1babd47ad7a69d7419698e22daf45eeb9b8e6
Author: Remko Tronçon <remko@el-tramo.be>
Date:   Mon, 30 Oct 2023 18:54:45 +0100

(uxn.c) Fix pointer wrapping issues

Diffstat:
Msrc/uxn.c | 12++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/uxn.c b/src/uxn.c @@ -17,12 +17,12 @@ WITH REGARD TO THIS SOFTWARE. [ L2 ][ N2 ][ T2 ] < */ -#define T *(s->dat + s->ptr - 1) -#define N *(s->dat + s->ptr - 2) -#define L *(s->dat + s->ptr - 3) -#define X *(s->dat + s->ptr - 4) -#define Y *(s->dat + s->ptr - 5) -#define Z *(s->dat + s->ptr - 6) +#define T *(s->dat + s->ptr) +#define N *(s->dat + (Uint8)(s->ptr - 1)) +#define L *(s->dat + (Uint8)(s->ptr - 2)) +#define X *(s->dat + (Uint8)(s->ptr - 3)) +#define Y *(s->dat + (Uint8)(s->ptr - 4)) +#define Z *(s->dat + (Uint8)(s->ptr - 5)) #define T2 (N << 8 | T) #define H2 (L << 8 | N) #define N2 (X << 8 | L)