1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-20 03:30:27 +02:00

Fix parenthesizing of the `ROUND_UP' macro; factorize.

* libguile/_scm.h (ROUND_UP): New macro.

* libguile/continuations.c (ROUND_UP): Remove.

* libguile/control.c (ROUND_UP): Remove.

* libguile/foreign.c (ROUND_UP): Remove.
This commit is contained in:
Ludovic Courtès 2010-05-30 22:41:36 +02:00
parent fd449a2690
commit 1880c97df1
4 changed files with 4 additions and 5 deletions

View file

@ -118,6 +118,10 @@
#define max(A, B) ((A) >= (B) ? (A) : (B))
#endif
/* Return the first integer greater than or equal to LEN such that
LEN % ALIGN == 0. Return LEN if ALIGN is zero. */
#define ROUND_UP(len, align) \
((align) ? (((len) - 1UL) | ((align) - 1UL)) + 1UL : (len))
#if GUILE_USE_64_CALLS && defined(HAVE_STAT64)

View file

@ -71,7 +71,6 @@ static scm_t_bits tc16_continuation;
#define META_HEADER(meta) meta, 0, 0, 0, 0, 0, 0, 0
#endif
#define ROUND_UP(len,align) (((len-1)|(align-1))+1)
#define ALIGN_PTR(type,p,align) (type*)(ROUND_UP (((scm_t_bits)p), align))
#ifdef SCM_ALIGNED

View file

@ -79,7 +79,6 @@ scm_i_prompt_pop_abort_args_x (SCM prompt)
#define META_HEADER(meta) meta, 0, 0, 0, 0, 0, 0, 0
#endif
#define ROUND_UP(len,align) (((len-1)|(align-1))+1)
#define ALIGN_PTR(type,p,align) (type*)(ROUND_UP (((scm_t_bits)p), align))
#ifdef SCM_ALIGNED

View file

@ -431,9 +431,6 @@ scm_i_foreign_print (SCM foreign, SCM port, scm_print_state *pstate)
#define ROUND_UP(len,align) (align?(((len-1)|(align-1))+1):len)
SCM_DEFINE (scm_alignof, "alignof", 1, 0, 0, (SCM type),
"Return the alignment of @var{type}, in bytes.\n\n"
"@var{type} should be a valid C type, like @code{int}.\n"