diff options
Diffstat (limited to 'ewah')
-rw-r--r-- | ewah/ewah_io.c | 4 | ||||
-rw-r--r-- | ewah/ewok.h | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/ewah/ewah_io.c b/ewah/ewah_io.c index f7f700ef51..1c2d7afd4c 100644 --- a/ewah/ewah_io.c +++ b/ewah/ewah_io.c @@ -110,9 +110,9 @@ int ewah_serialize(struct ewah_bitmap *self, int fd) return ewah_serialize_to(self, write_helper, (void *)(intptr_t)fd); } -int ewah_read_mmap(struct ewah_bitmap *self, void *map, size_t len) +int ewah_read_mmap(struct ewah_bitmap *self, const void *map, size_t len) { - uint8_t *ptr = map; + const uint8_t *ptr = map; size_t i; self->bit_size = get_be32(ptr); diff --git a/ewah/ewok.h b/ewah/ewok.h index 43adeb5c68..13c6e20412 100644 --- a/ewah/ewok.h +++ b/ewah/ewok.h @@ -47,7 +47,8 @@ static inline uint32_t ewah_bit_popcount64(uint64_t x) return (x * 0x0101010101010101ULL) >> 56; } -#ifdef __GNUC__ +/* __builtin_ctzll was not available until 3.4.0 */ +#if defined(__GNUC__) && (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR > 3)) #define ewah_bit_ctz64(x) __builtin_ctzll(x) #else static inline int ewah_bit_ctz64(uint64_t x) @@ -99,8 +100,7 @@ int ewah_serialize(struct ewah_bitmap *self, int fd); int ewah_serialize_native(struct ewah_bitmap *self, int fd); int ewah_deserialize(struct ewah_bitmap *self, int fd); -int ewah_read_mmap(struct ewah_bitmap *self, void *map, size_t len); -int ewah_read_mmap_native(struct ewah_bitmap *self, void *map, size_t len); +int ewah_read_mmap(struct ewah_bitmap *self, const void *map, size_t len); uint32_t ewah_checksum(struct ewah_bitmap *self); |