From 5fe3ea7ec0ade569cd429a3c22c7ac5337b56453 Mon Sep 17 00:00:00 2001 From: Oliver Sander <sander@igpm.rwth-aachen.de> Date: Mon, 10 Mar 2014 12:43:39 +0100 Subject: [PATCH] Move the definition of CEIL from the public header heaps.h into the .c files that use it The CEIL macro uses alignment information, which should not appear in installed headers. --- dom/lgm/lgm_parallel.c | 3 +++ dom/std/std_parallel.c | 2 ++ low/heaps.c | 1 + low/heaps.h | 2 -- np/algebra/ugblas.c | 3 +++ np/udm/udm.c | 2 ++ parallel/dddif/handler.c | 3 +++ 7 files changed, 14 insertions(+), 2 deletions(-) diff --git a/dom/lgm/lgm_parallel.c b/dom/lgm/lgm_parallel.c index c2e813994..9e3f24491 100644 --- a/dom/lgm/lgm_parallel.c +++ b/dom/lgm/lgm_parallel.c @@ -107,6 +107,9 @@ USING_UGDIM_NAMESPACE #endif #endif +#define CEIL(n) ((n)+((ALIGNMENT-((n)&(ALIGNMENT-1)))&(ALIGNMENT-1))) + + /****************************************************************************/ /* */ /* data structures used in this source file (exported data structures are */ diff --git a/dom/std/std_parallel.c b/dom/std/std_parallel.c index 2663600fd..7725e2acf 100644 --- a/dom/std/std_parallel.c +++ b/dom/std/std_parallel.c @@ -74,6 +74,8 @@ USING_UGDIM_NAMESPACE /* */ /****************************************************************************/ +#define CEIL(n) ((n)+((ALIGNMENT-((n)&(ALIGNMENT-1)))&(ALIGNMENT-1))) + /****************************************************************************/ /* */ /* data structures used in this source file (exported data structures are */ diff --git a/low/heaps.c b/low/heaps.c index 883cd1a62..7b58bb93d 100644 --- a/low/heaps.c +++ b/low/heaps.c @@ -62,6 +62,7 @@ USING_UG_NAMESPACE /****************************************************************************/ #define FLOOR(n) ((n)&ALIGNMASK) /* lower next multiple of four */ +#define CEIL(n) ((n)+((ALIGNMENT-((n)&(ALIGNMENT-1)))&(ALIGNMENT-1))) /* defines and macros for the virtual heap management */ diff --git a/low/heaps.h b/low/heaps.h index 5c8c44e0c..a6e6f599b 100644 --- a/low/heaps.h +++ b/low/heaps.h @@ -118,8 +118,6 @@ enum {HEAP_FULL = 1, /**< Return code if storage exhausted #define TOTUSED_IN_HEAP(vhm) ((vhm).TotalUsed) #define IS_BLOCK_DEFINED(vhm,id) (GetBlockDesc((VIRT_HEAP_MGMT*)vhm,id)!=NULL) -#define CEIL(n) ((n)+((ALIGNMENT-((n)&(ALIGNMENT-1)))&(ALIGNMENT-1))) - /* @} */ /****************************************************************************/ /* */ diff --git a/np/algebra/ugblas.c b/np/algebra/ugblas.c index d70a69d44..f1c5837de 100644 --- a/np/algebra/ugblas.c +++ b/np/algebra/ugblas.c @@ -139,6 +139,9 @@ USING_UG_NAMESPACES #endif /*@}*/ +#define CEIL(n) ((n)+((ALIGNMENT-((n)&(ALIGNMENT-1)))&(ALIGNMENT-1))) + + /****************************************************************************/ /* */ /* data structures used in this source file (exported data structures are */ diff --git a/np/udm/udm.c b/np/udm/udm.c index beb3cd2bc..5ae943512 100644 --- a/np/udm/udm.c +++ b/np/udm/udm.c @@ -74,6 +74,8 @@ USING_UG_NAMESPACES #define SWAP_VEC_DATA(v,pf,pt) {tmp = VVALUE(v,*pf); VVALUE(v,*pf) = VVALUE(v,*pt); VVALUE(v,*pt) = tmp;} #define SWAP_MAT_DATA(m,pf,pt) {tmp = MVALUE(m,*pf); MVALUE(m,*pf) = MVALUE(m,*pt); MVALUE(m,*pt) = tmp;} +#define CEIL(n) ((n)+((ALIGNMENT-((n)&(ALIGNMENT-1)))&(ALIGNMENT-1))) + /****************************************************************************/ /* */ /* data structures used in this source file (exported data structures are */ diff --git a/parallel/dddif/handler.c b/parallel/dddif/handler.c index 71229281a..4c673090c 100644 --- a/parallel/dddif/handler.c +++ b/parallel/dddif/handler.c @@ -82,6 +82,9 @@ USING_UG_NAMESPACES #define DEBUGNSONS(pe,f,m) #endif +#define CEIL(n) ((n)+((ALIGNMENT-((n)&(ALIGNMENT-1)))&(ALIGNMENT-1))) + + /****************************************************************************/ /* */ /* data structures used in this source file (exported data structures are */ -- GitLab