From 4b481bb407a681360de5ff064035e659f4c9a6ec Mon Sep 17 00:00:00 2001 From: Rafael Ravedutti Date: Tue, 23 Mar 2021 16:21:08 +0100 Subject: [PATCH] Fix macros for AoS Signed-off-by: Rafael Ravedutti --- src/includes/atom.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/includes/atom.h b/src/includes/atom.h index abc425e..e090936 100644 --- a/src/includes/atom.h +++ b/src/includes/atom.h @@ -37,15 +37,15 @@ extern void createAtom(Atom*, Parameter*); extern void growAtom(Atom*); #ifdef AOS -#define POS_DATA_LAYOUT "AoS" -#define atom_x(i) atom->x[i * 3 + 0] -#define atom_y(i) atom->x[i * 3 + 1] -#define atom_z(i) atom->x[i * 3 + 2] +#define POS_DATA_LAYOUT "AoS" +#define atom_x(i) atom->x[(i) * 3 + 0] +#define atom_y(i) atom->x[(i) * 3 + 1] +#define atom_z(i) atom->x[(i) * 3 + 2] #else -#define POS_DATA_LAYOUT "SoA" -#define atom_x(i) atom->x[i] -#define atom_y(i) atom->y[i] -#define atom_z(i) atom->z[i] +#define POS_DATA_LAYOUT "SoA" +#define atom_x(i) atom->x[i] +#define atom_y(i) atom->y[i] +#define atom_z(i) atom->z[i] #endif #endif