From 034e99bf9e1621ec413a87ee5277e11210a03ee1 Mon Sep 17 00:00:00 2001 From: Thomas Schmucker Date: Thu, 29 Oct 2020 16:33:23 +0100 Subject: clang-format --- allocator.c | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/allocator.c b/allocator.c index c498bc7..6d13a17 100644 --- a/allocator.c +++ b/allocator.c @@ -1,6 +1,7 @@ -#include #include "allocator.h" +#include + /* Interface Code */ static void * default_allocate(struct its1_allocator *allocator, size_t n) @@ -17,7 +18,7 @@ default_deallocate(struct its1_allocator *allocator, void *ptr) } struct its1_allocator its1_default_allocator = { - .allocate = &default_allocate, + .allocate = &default_allocate, .deallocate = &default_deallocate }; @@ -27,7 +28,7 @@ struct its1_allocator its1_default_allocator = { void * its1_malloc(struct its1_allocator *allocator, size_t n) { - if (allocator == NULL) { + if ( allocator == NULL ) { allocator = &its1_default_allocator; } @@ -37,7 +38,7 @@ its1_malloc(struct its1_allocator *allocator, size_t n) void its1_free(struct its1_allocator *allocator, void *ptr) { - if (allocator == NULL) { + if ( allocator == NULL ) { allocator = &its1_default_allocator; } @@ -48,11 +49,11 @@ char * its1_strdup(struct its1_allocator *allocator, const char *str) { size_t n; - char *dest; + char * dest; - n = strlen(str) + 1; + n = strlen(str) + 1; dest = its1_malloc(allocator, n); - if (dest != NULL) { + if ( dest != NULL ) { memcpy(dest, str, n); } @@ -65,11 +66,14 @@ its1_malloc_zero(struct its1_allocator *allocator, size_t n) void *ptr; ptr = its1_malloc(allocator, n); - if (ptr != NULL) { + if ( ptr != NULL ) { memset(ptr, 0, n); } return ptr; } -int main() {} +int +main() +{ +} -- cgit v1.3