diff options
author | David Robillard <d@drobilla.net> | 2024-11-15 08:53:26 -0500 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2024-11-15 08:53:26 -0500 |
commit | c79edf4df9909bdb1313e74bb9cc7c8ea7936dcb (patch) | |
tree | a9a6642536eeb5860ae6c1eaaa74ba523385d7c8 /test | |
parent | 336aad280221ce643255032e948acccc27e7204f (diff) | |
download | zix-c79edf4df9909bdb1313e74bb9cc7c8ea7936dcb.tar.gz zix-c79edf4df9909bdb1313e74bb9cc7c8ea7936dcb.tar.bz2 zix-c79edf4df9909bdb1313e74bb9cc7c8ea7936dcb.zip |
Update clang-format configuration
Diffstat (limited to 'test')
-rw-r--r-- | test/failing_allocator.c | 12 | ||||
-rw-r--r-- | test/test_btree.c | 3 | ||||
-rw-r--r-- | test/test_digest.c | 3 | ||||
-rw-r--r-- | test/test_hash.c | 27 | ||||
-rw-r--r-- | test/test_ring.c | 3 |
5 files changed, 16 insertions, 32 deletions
diff --git a/test/failing_allocator.c b/test/failing_allocator.c index 53a5216..6cffc7b 100644 --- a/test/failing_allocator.c +++ b/test/failing_allocator.c @@ -23,8 +23,7 @@ attempt(ZixFailingAllocator* const allocator) return true; } -ZIX_MALLOC_FUNC -static void* +ZIX_MALLOC_FUNC static void* zix_failing_malloc(ZixAllocator* const allocator, const size_t size) { ZixFailingAllocator* const state = (ZixFailingAllocator*)allocator; @@ -33,8 +32,7 @@ zix_failing_malloc(ZixAllocator* const allocator, const size_t size) return attempt(state) ? base->malloc(base, size) : NULL; } -ZIX_MALLOC_FUNC -static void* +ZIX_MALLOC_FUNC static void* zix_failing_calloc(ZixAllocator* const allocator, const size_t nmemb, const size_t size) @@ -66,8 +64,7 @@ zix_failing_free(ZixAllocator* const allocator, void* const ptr) base->free(base, ptr); } -ZIX_MALLOC_FUNC -static void* +ZIX_MALLOC_FUNC static void* zix_failing_aligned_alloc(ZixAllocator* const allocator, const size_t alignment, const size_t size) @@ -88,8 +85,7 @@ zix_failing_aligned_free(ZixAllocator* const allocator, void* const ptr) base->aligned_free(base, ptr); } -ZIX_CONST_FUNC -ZixFailingAllocator +ZIX_CONST_FUNC ZixFailingAllocator zix_failing_allocator(void) { ZixFailingAllocator failing_allocator = { diff --git a/test/test_btree.c b/test/test_btree.c index a3183c6..6269c4b 100644 --- a/test/test_btree.c +++ b/test/test_btree.c @@ -20,8 +20,7 @@ #include <stdio.h> #include <stdlib.h> -ZIX_PURE_FUNC -static int +ZIX_PURE_FUNC static int int_cmp(const void* a, const void* b, const void* ZIX_UNUSED(user_data)) { const uintptr_t ia = (uintptr_t)a; diff --git a/test/test_digest.c b/test/test_digest.c index 7228f86..7e7e77a 100644 --- a/test/test_digest.c +++ b/test/test_digest.c @@ -116,8 +116,7 @@ test_digest_aligned(void) } } -ZIX_PURE_FUNC -int +ZIX_PURE_FUNC int main(void) { test_digest32(); diff --git a/test/test_hash.c b/test/test_hash.c index 8ee6b82..07ec529 100644 --- a/test/test_hash.c +++ b/test/test_hash.c @@ -47,24 +47,21 @@ test_fail(TestState* const state, const char* fmt, ...) return EXIT_FAILURE; } -ZIX_PURE_FUNC -static const char* +ZIX_PURE_FUNC static const char* identity(const char* record) { return record; } /// Decent hash function using zix_digest (murmur2) -ZIX_PURE_FUNC -static size_t +ZIX_PURE_FUNC static size_t decent_string_hash(const char* const str) { return zix_digest(0U, str, strlen(str)); } /// Terrible hash function from K&R first edition -ZIX_PURE_FUNC -static size_t +ZIX_PURE_FUNC static size_t terrible_string_hash(const char* str) { size_t hash = 0U; @@ -77,8 +74,7 @@ terrible_string_hash(const char* str) return hash; } -ZIX_PURE_FUNC -static size_t +ZIX_PURE_FUNC static size_t string_hash_aligned(const char* const str) { size_t length = strlen(str); @@ -87,22 +83,19 @@ string_hash_aligned(const char* const str) return zix_digest_aligned(0U, str, length); } -ZIX_PURE_FUNC -static size_t +ZIX_PURE_FUNC static size_t string_hash32(const char* const str) { return (size_t)zix_digest32(0U, str, strlen(str)); } -ZIX_PURE_FUNC -static size_t +ZIX_PURE_FUNC static size_t string_hash64(const char* const str) { return (size_t)zix_digest64(0U, str, strlen(str)); } -ZIX_PURE_FUNC -static size_t +ZIX_PURE_FUNC static size_t string_hash32_aligned(const char* const str) { size_t length = strlen(str); @@ -113,8 +106,7 @@ string_hash32_aligned(const char* const str) #if UINTPTR_MAX >= UINT64_MAX -ZIX_PURE_FUNC -static size_t +ZIX_PURE_FUNC static size_t string_hash64_aligned(const char* const str) { size_t length = strlen(str); @@ -298,8 +290,7 @@ stress(ZixAllocator* const allocator, const size_t n_elems) } /// Identity hash function for numeric strings for explicitly hitting cases -ZIX_PURE_FUNC -static size_t +ZIX_PURE_FUNC static size_t identity_index_hash(const char* const str) { return strtoul(str, NULL, 10); diff --git a/test/test_ring.c b/test/test_ring.c index 06d50ee..156d867 100644 --- a/test/test_ring.c +++ b/test/test_ring.c @@ -34,8 +34,7 @@ gen_msg(int* const msg, int start) return start; } -ZIX_PURE_FUNC -static int +ZIX_PURE_FUNC static int cmp_msg(const int* const msg1, const int* const msg2) { for (unsigned i = 0U; i < MSG_SIZE; ++i) { |