diff options
author | Thomas Huth <thuth@redhat.com> | 2016-09-09 21:51:59 +0200 |
---|---|---|
committer | Alexey Kardashevskiy <aik@ozlabs.ru> | 2016-09-14 17:50:39 +1000 |
commit | 488569289854dba3f6cf63dcbdc2629c44258c0f (patch) | |
tree | 7993007f81eb5f025ee4f429afe9a68d0e9cb370 /slof/allocator.c | |
parent | b3fde41bc75269df2e30a7dfc0645ca239eb2786 (diff) | |
download | SLOF-488569289854dba3f6cf63dcbdc2629c44258c0f.zip SLOF-488569289854dba3f6cf63dcbdc2629c44258c0f.tar.gz SLOF-488569289854dba3f6cf63dcbdc2629c44258c0f.tar.bz2 |
paflof: Use CFLAGS from make.rules instead of completely redefining them
It's cumbersome to change the CFLAGS in multiple places in case they
have to be changed. So let's use the global CFLAGS from make.rules
for building Paflof, too. Since the global rules use some additional
compiler warning flags, fix the now occuring compiler warnings in
the Paflof code, too (mostly about missing or wrong prototypes).
Signed-off-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Diffstat (limited to 'slof/allocator.c')
-rw-r--r-- | slof/allocator.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/slof/allocator.c b/slof/allocator.c index 279b50b..e8f8858 100644 --- a/slof/allocator.c +++ b/slof/allocator.c @@ -17,6 +17,7 @@ #include <stdlib.h> #include <stdbool.h> #include <helpers.h> +#include <allocator.h> #undef DEBUG //#define DEBUG @@ -45,17 +46,17 @@ struct bitmap { #define BM_WORD_MODULO(n) (n % BM_WORD_BITS) #define BM_NUM_BITS(reqsize, bsize) ((reqsize / bsize) + (reqsize % bsize? 1 : 0)) -void bm_clear_bit(unsigned long *bmw, int n) +static void bm_clear_bit(unsigned long *bmw, int n) { BM_WORD(bmw, n) &= ~BIT(BM_WORD_MODULO(n)); } -void bm_set_bit(unsigned long *bmw, int n) +static void bm_set_bit(unsigned long *bmw, int n) { BM_WORD(bmw, n) |= BIT(BM_WORD_MODULO(n)); } -bool bm_test_bit(unsigned long *bmw, int n) +static bool bm_test_bit(unsigned long *bmw, int n) { #ifdef DEBUG //printf("BMW %x, bitpos %d, value %d\n", &BM_WORD(bmw, n), n, !!(BM_WORD(bmw, n) & BIT(BM_WORD_MODULO(n)))); @@ -64,7 +65,7 @@ bool bm_test_bit(unsigned long *bmw, int n) } /* Improvement: can use FFS routines to get faster results */ -int bm_find_bits(struct bitmap *bm, unsigned int n_bits) +static int bm_find_bits(struct bitmap *bm, unsigned int n_bits) { unsigned int i, j, total_bits; int found = -1; |