From 488569289854dba3f6cf63dcbdc2629c44258c0f Mon Sep 17 00:00:00 2001 From: Thomas Huth Date: Fri, 9 Sep 2016 21:51:59 +0200 Subject: 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 Signed-off-by: Alexey Kardashevskiy --- slof/allocator.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'slof/allocator.c') 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 #include #include +#include #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; -- cgit v1.1