From 4a72557e6b3a4b2594ca0a3b971d7f7acf59072a Mon Sep 17 00:00:00 2001 From: Andre Susano Pinto Date: Fri, 3 Jul 2009 17:10:54 +0000 Subject: Fixed memory aligns for 64bits --- source/blender/render/intern/include/rayobject.h | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'source/blender/render/intern/include/rayobject.h') diff --git a/source/blender/render/intern/include/rayobject.h b/source/blender/render/intern/include/rayobject.h index 3b77341f229..c611e2ceca2 100644 --- a/source/blender/render/intern/include/rayobject.h +++ b/source/blender/render/intern/include/rayobject.h @@ -102,14 +102,13 @@ typedef struct RayObjectAPI } RayObjectAPI; -//TODO use intptr_t -#define RayObject_align(o) ((RayObject*)(((int)o)&(~3))) -#define RayObject_unalignRayFace(o) ((RayObject*)(((int)o)|1)) -#define RayObject_unalignRayAPI(o) ((RayObject*)(((int)o)|2)) - -#define RayObject_isAligned(o) ((((int)o)&3) == 0) -#define RayObject_isRayFace(o) ((((int)o)&3) == 1) -#define RayObject_isRayAPI(o) ((((int)o)&3) == 2) +#define RayObject_align(o) ((RayObject*)(((intptr_t)o)&(~3))) +#define RayObject_unalignRayFace(o) ((RayObject*)(((intptr_t)o)|1)) +#define RayObject_unalignRayAPI(o) ((RayObject*)(((intptr_t)o)|2)) + +#define RayObject_isAligned(o) ((((intptr_t)o)&3) == 0) +#define RayObject_isRayFace(o) ((((intptr_t)o)&3) == 1) +#define RayObject_isRayAPI(o) ((((intptr_t)o)&3) == 2) /* * Extend min/max coords so that the rayobject is inside them -- cgit v1.2.3