From 75fdaa45348f55d9721f35ba3be3cb73a470223a Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Fri, 3 Jan 2014 12:42:31 +0100 Subject: [PATCH] Clean up old-style function declarations split to multiple lines --- ucw/bitarray.h | 33 +++++++++++---------------------- ucw/conf-internal.h | 3 +-- ucw/ff-unicode.h | 12 ++++-------- ucw/mainloop.h | 3 +-- ucw/mempool.h | 3 +-- ucw/partmap.h | 6 ++---- ucw/semaphore.h | 12 ++++-------- 7 files changed, 24 insertions(+), 48 deletions(-) diff --git a/ucw/bitarray.h b/ucw/bitarray.h index daf8fa01..6ea0087b 100644 --- a/ucw/bitarray.h +++ b/ucw/bitarray.h @@ -19,28 +19,24 @@ typedef u32 *bitarray_t; // Must be initialized by bit_array_xmalloc(), bit_arra #define BIT_ARRAY_BYTES(n) (4*BIT_ARRAY_WORDS(n)) #define BIT_ARRAY(name,size) u32 name[BIT_ARRAY_WORDS(size)] -static inline bitarray_t -bit_array_xmalloc(uns n) +static inline bitarray_t bit_array_xmalloc(uns n) { return xmalloc(BIT_ARRAY_BYTES(n)); } bitarray_t bit_array_xrealloc(bitarray_t a, uns old_n, uns new_n); -static inline bitarray_t -bit_array_xmalloc_zero(uns n) +static inline bitarray_t bit_array_xmalloc_zero(uns n) { return xmalloc_zero(BIT_ARRAY_BYTES(n)); } -static inline void -bit_array_zero(bitarray_t a, uns n) +static inline void bit_array_zero(bitarray_t a, uns n) { bzero(a, BIT_ARRAY_BYTES(n)); } -static inline void -bit_array_set_all(bitarray_t a, uns n) +static inline void bit_array_set_all(bitarray_t a, uns n) { uns w = n / 32; memset(a, 255, w * 4); @@ -49,20 +45,17 @@ bit_array_set_all(bitarray_t a, uns n) a[w] = (1U << m) - 1; } -static inline void -bit_array_set(bitarray_t a, uns i) +static inline void bit_array_set(bitarray_t a, uns i) { a[i/32] |= (1 << (i%32)); } -static inline void -bit_array_clear(bitarray_t a, uns i) +static inline void bit_array_clear(bitarray_t a, uns i) { a[i/32] &= ~(1 << (i%32)); } -static inline void -bit_array_assign(bitarray_t a, uns i, uns x) +static inline void bit_array_assign(bitarray_t a, uns i, uns x) { if (x) bit_array_set(a, i); @@ -70,28 +63,24 @@ bit_array_assign(bitarray_t a, uns i, uns x) bit_array_clear(a, i); } -static inline uns -bit_array_isset(bitarray_t a, uns i) +static inline uns bit_array_isset(bitarray_t a, uns i) { return a[i/32] & (1 << (i%32)); } -static inline uns -bit_array_get(bitarray_t a, uns i) +static inline uns bit_array_get(bitarray_t a, uns i) { return !! bit_array_isset(a, i); } -static inline uns -bit_array_test_and_set(bitarray_t a, uns i) +static inline uns bit_array_test_and_set(bitarray_t a, uns i) { uns t = bit_array_isset(a, i); bit_array_set(a, i); return t; } -static inline uns -bit_array_test_and_clear(bitarray_t a, uns i) +static inline uns bit_array_test_and_clear(bitarray_t a, uns i) { uns t = bit_array_isset(a, i); bit_array_clear(a, i); diff --git a/ucw/conf-internal.h b/ucw/conf-internal.h index 67a96cf5..27b4a47d 100644 --- a/ucw/conf-internal.h +++ b/ucw/conf-internal.h @@ -60,8 +60,7 @@ struct cf_context { }; /* conf-ctxt.c */ -static inline struct cf_context * -cf_get_context(void) +static inline struct cf_context *cf_get_context(void) { struct cf_context *cc = ucwlib_thread_context()->cf_context; ASSERT(cc->is_active); diff --git a/ucw/ff-unicode.h b/ucw/ff-unicode.h index 024e54c8..fc510f6f 100644 --- a/ucw/ff-unicode.h +++ b/ucw/ff-unicode.h @@ -22,8 +22,7 @@ int bget_utf8_32_slow(struct fastbuf *b, uns repl); void bput_utf8_slow(struct fastbuf *b, uns u); void bput_utf8_32_slow(struct fastbuf *b, uns u); -static inline int -bget_utf8_repl(struct fastbuf *b, uns repl) +static inline int bget_utf8_repl(struct fastbuf *b, uns repl) { uns u; if (bavailr(b) >= 3) @@ -35,8 +34,7 @@ bget_utf8_repl(struct fastbuf *b, uns repl) return bget_utf8_slow(b, repl); } -static inline int -bget_utf8_32_repl(struct fastbuf *b, uns repl) +static inline int bget_utf8_32_repl(struct fastbuf *b, uns repl) { uns u; if (bavailr(b) >= 6) @@ -81,8 +79,7 @@ int bget_utf16_le_slow(struct fastbuf *b, uns repl); void bput_utf16_be_slow(struct fastbuf *b, uns u); void bput_utf16_le_slow(struct fastbuf *b, uns u); -static inline int -bget_utf16_be_repl(struct fastbuf *b, uns repl) +static inline int bget_utf16_be_repl(struct fastbuf *b, uns repl) { uns u; if (bavailr(b) >= 4) @@ -94,8 +91,7 @@ bget_utf16_be_repl(struct fastbuf *b, uns repl) return bget_utf16_be_slow(b, repl); } -static inline int -bget_utf16_le_repl(struct fastbuf *b, uns repl) +static inline int bget_utf16_le_repl(struct fastbuf *b, uns repl) { uns u; if (bavailr(b) >= 4) diff --git a/ucw/mainloop.h b/ucw/mainloop.h index 579876cc..9cc1b714 100644 --- a/ucw/mainloop.h +++ b/ucw/mainloop.h @@ -115,8 +115,7 @@ static inline void main_shut_down(void) **/ void main_debug_context(struct main_context *m); -static inline void -main_debug(void) +static inline void main_debug(void) { main_debug_context(main_current()); } diff --git a/ucw/mempool.h b/ucw/mempool.h index 350054e3..95dffd0e 100644 --- a/ucw/mempool.h +++ b/ucw/mempool.h @@ -170,8 +170,7 @@ void *mp_start_internal(struct mempool *pool, uns size) LIKE_MALLOC; void *mp_grow_internal(struct mempool *pool, uns size); void *mp_spread_internal(struct mempool *pool, void *p, uns size); -static inline uns -mp_idx(struct mempool *pool, void *ptr) +static inline uns mp_idx(struct mempool *pool, void *ptr) { return ptr == pool->last_big; } diff --git a/ucw/partmap.h b/ucw/partmap.h index 6831973a..3f57dbde 100644 --- a/ucw/partmap.h +++ b/ucw/partmap.h @@ -24,8 +24,7 @@ void partmap_close(struct partmap *p); ucw_off_t partmap_size(struct partmap *p); void partmap_load(struct partmap *p, ucw_off_t start, uns size); -static inline void * -partmap_map(struct partmap *p, ucw_off_t start, uns size UNUSED) +static inline void *partmap_map(struct partmap *p, ucw_off_t start, uns size UNUSED) { #ifndef CONFIG_UCW_PARTMAP_IS_MMAP if (unlikely(!p->start_map || start < p->start_off || (ucw_off_t) (start+size) > p->end_off)) @@ -34,8 +33,7 @@ partmap_map(struct partmap *p, ucw_off_t start, uns size UNUSED) return p->start_map + (start - p->start_off); } -static inline void * -partmap_map_forward(struct partmap *p, ucw_off_t start, uns size UNUSED) +static inline void *partmap_map_forward(struct partmap *p, ucw_off_t start, uns size UNUSED) { #ifndef CONFIG_UCW_PARTMAP_IS_MMAP if (unlikely((ucw_off_t) (start+size) > p->end_off)) diff --git a/ucw/semaphore.h b/ucw/semaphore.h index cd01512c..7b211f8e 100644 --- a/ucw/semaphore.h +++ b/ucw/semaphore.h @@ -23,8 +23,7 @@ /* In Darwin, sem_init() is unfortunately not implemented and the guide * recommends emulating it using sem_open(). */ -static inline sem_t * -sem_alloc(void) +static inline sem_t *sem_alloc(void) { char buf[TEMP_FILE_NAME_LEN]; int mode, retry = 10; @@ -39,16 +38,14 @@ sem_alloc(void) return sem; } -static inline void -sem_free(sem_t *sem) +static inline void sem_free(sem_t *sem) { sem_close(sem); } #else -static inline sem_t * -sem_alloc(void) +static inline sem_t *sem_alloc(void) { sem_t *sem = xmalloc(sizeof(sem_t)); int res = sem_init(sem, 0, 0); @@ -56,8 +53,7 @@ sem_alloc(void) return sem; } -static inline void -sem_free(sem_t *sem) +static inline void sem_free(sem_t *sem) { sem_destroy(sem); xfree(sem); -- 2.39.2