diff --git a/ccan/README b/ccan/README index 8b70b90f2..399d33655 100644 --- a/ccan/README +++ b/ccan/README @@ -1,3 +1,3 @@ CCAN imported from http://ccodearchive.net. -CCAN version: init-2481-gce4660aa +CCAN version: init-2483-g920ca95d diff --git a/ccan/ccan/bitmap/bitmap.c b/ccan/ccan/bitmap/bitmap.c index d812af6a2..d254b20e5 100644 --- a/ccan/ccan/bitmap/bitmap.c +++ b/ccan/ccan/bitmap/bitmap.c @@ -13,8 +13,8 @@ void bitmap_zero_range(bitmap *bitmap, unsigned long n, unsigned long m) { unsigned long an = BIT_ALIGN_UP(n); unsigned long am = BIT_ALIGN_DOWN(m); - bitmap_word headmask = -1ULL >> (n % BITMAP_WORD_BITS); - bitmap_word tailmask = ~(-1ULL >> (m % BITMAP_WORD_BITS)); + bitmap_word headmask = BITMAP_WORD_1 >> (n % BITMAP_WORD_BITS); + bitmap_word tailmask = ~(BITMAP_WORD_1 >> (m % BITMAP_WORD_BITS)); assert(m >= n); @@ -38,8 +38,8 @@ void bitmap_fill_range(bitmap *bitmap, unsigned long n, unsigned long m) { unsigned long an = BIT_ALIGN_UP(n); unsigned long am = BIT_ALIGN_DOWN(m); - bitmap_word headmask = -1ULL >> (n % BITMAP_WORD_BITS); - bitmap_word tailmask = ~(-1ULL >> (m % BITMAP_WORD_BITS)); + bitmap_word headmask = BITMAP_WORD_1 >> (n % BITMAP_WORD_BITS); + bitmap_word tailmask = ~(BITMAP_WORD_1 >> (m % BITMAP_WORD_BITS)); assert(m >= n); @@ -65,7 +65,7 @@ static int bitmap_clz(bitmap_word w) return __builtin_clzl(w); #else int lz = 0; - bitmap_word mask = 1UL << (BITMAP_WORD_BITS - 1); + bitmap_word mask = (bitmap_word)1 << (BITMAP_WORD_BITS - 1); while (!(w & mask)) { lz++; @@ -81,8 +81,8 @@ unsigned long bitmap_ffs(const bitmap *bitmap, { unsigned long an = BIT_ALIGN_UP(n); unsigned long am = BIT_ALIGN_DOWN(m); - bitmap_word headmask = -1ULL >> (n % BITMAP_WORD_BITS); - bitmap_word tailmask = ~(-1ULL >> (m % BITMAP_WORD_BITS)); + bitmap_word headmask = BITMAP_WORD_1 >> (n % BITMAP_WORD_BITS); + bitmap_word tailmask = ~(BITMAP_WORD_1 >> (m % BITMAP_WORD_BITS)); assert(m >= n); diff --git a/ccan/ccan/bitmap/bitmap.h b/ccan/ccan/bitmap/bitmap.h index 9e6c2bbc5..beeb1e953 100644 --- a/ccan/ccan/bitmap/bitmap.h +++ b/ccan/ccan/bitmap/bitmap.h @@ -15,6 +15,9 @@ typedef unsigned long bitmap_word; #define BITMAP_NWORDS(_n) \ (((_n) + BITMAP_WORD_BITS - 1) / BITMAP_WORD_BITS) +#define BITMAP_WORD_0 (0) +#define BITMAP_WORD_1 ((bitmap_word)-1UL) + /* * We wrap each word in a structure for type checking. */ diff --git a/ccan/tools/configurator/configurator.c b/ccan/tools/configurator/configurator.c index d676b8823..d99d4a003 100644 --- a/ccan/tools/configurator/configurator.c +++ b/ccan/tools/configurator/configurator.c @@ -431,7 +431,7 @@ static const struct test base_tests[] = { " return i + 1;\n" "}" }, { "HAVE_OPENMP", "#pragma omp and -fopenmp support", - "INSIDE_MAIN", NULL, NULL, + "INSIDE_MAIN|EXECUTE|MAY_NOT_COMPILE", NULL, NULL, "int i;\n" "#pragma omp parallel for\n" "for(i = 0; i < 0; i++) {};\n"