From 5a79ae9405bfc2b531b9a7c36855eb01f29b9cd2 Mon Sep 17 00:00:00 2001 From: schnetter Date: Sun, 18 Dec 2005 21:40:52 +0000 Subject: Do not use the topmost 2 bits in a CCTK_INT, since this leads to undefined behaviour in C. We could use more clever code and then use the second-topmost bit as well, omitting only 1 bit. git-svn-id: http://svn.cactuscode.org/arrangements/CactusNumerical/SpaceMask/trunk@54 a491c6a4-70bf-4b89-8b36-d6c0cb1f094e --- src/MaskUtils.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/MaskUtils.c b/src/MaskUtils.c index 2e9bf8e..1cb2eea 100644 --- a/src/MaskUtils.c +++ b/src/MaskUtils.c @@ -109,7 +109,11 @@ SpaceMask_get_free_bits(int nbits) n=1; new_bits = 0; j = 0; - for (i=0; i < (int) sizeof(CCTK_INT)*8 && j