From dc67377a111b7dc04f2b35d9caea85786a4f743f Mon Sep 17 00:00:00 2001 From: laentropia Date: Tue, 26 May 2026 12:58:36 -0600 Subject: [PATCH] fix: formatting --- include/allocator.h | 8 ++++---- src/allocator.c | 36 ++++++++++++++++++------------------ src/main.c | 4 +++- 3 files changed, 25 insertions(+), 23 deletions(-) diff --git a/include/allocator.h b/include/allocator.h index 4228033..7e2b584 100644 --- a/include/allocator.h +++ b/include/allocator.h @@ -8,13 +8,13 @@ typedef struct Allocator Allocator; Allocator allocator_default(void); struct Allocator { - void *ctx; + void* ctx; - void *(*alloc)(void *ctx, size_t size); + void* (*alloc)(void* ctx, size_t size); - void *(*realloc)(void *ctx, void *ptr, size_t old_size, size_t new_size); + void* (*realloc)(void* ctx, void* ptr, size_t old_size, size_t new_size); - void (*free)(void *ctx, void *ptr, size_t size); + void (*free)(void* ctx, void* ptr, size_t size); }; #endif diff --git a/src/allocator.c b/src/allocator.c index 2b23cd7..39742b7 100644 --- a/src/allocator.c +++ b/src/allocator.c @@ -1,29 +1,29 @@ #include "allocator.h" #include -static void *stdlib_alloc(void *ctx, size_t size) { - (void)ctx; - return malloc(size); +static void* stdlib_alloc(void* ctx, size_t size) { + (void)ctx; + return malloc(size); } -static void *stdlib_realloc(void *ctx, void *ptr, size_t old_size, - size_t new_size) { - (void)ctx; - (void)old_size; - return realloc(ptr, new_size); +static void* +stdlib_realloc(void* ctx, void* ptr, size_t old_size, size_t new_size) { + (void)ctx; + (void)old_size; + return realloc(ptr, new_size); } -static void stdlib_free(void *ctx, void *ptr, size_t size) { - (void)ctx; - (void)size; - free(ptr); +static void stdlib_free(void* ctx, void* ptr, size_t size) { + (void)ctx; + (void)size; + free(ptr); } Allocator allocator_default(void) { - return (Allocator){ - .ctx = NULL, - .alloc = stdlib_alloc, - .realloc = stdlib_realloc, - .free = stdlib_free, - }; + return (Allocator){ + .ctx = NULL, + .alloc = stdlib_alloc, + .realloc = stdlib_realloc, + .free = stdlib_free, + }; } diff --git a/src/main.c b/src/main.c index 0b248e4..24acc10 100644 --- a/src/main.c +++ b/src/main.c @@ -1,3 +1,5 @@ #include -int main(void) { return EXIT_SUCCESS; } +int main(void) { + return EXIT_SUCCESS; +}