Sun, 07 Feb 2021 21:29:51 +0100
removes unnecessary typedefs
src/cx/allocator.h | file | annotate | diff | comparison | revisions | |
src/cx/list.h | file | annotate | diff | comparison | revisions |
1.1 --- a/src/cx/allocator.h Sun Feb 07 21:26:48 2021 +0100 1.2 +++ b/src/cx/allocator.h Sun Feb 07 21:29:51 2021 +0100 1.3 @@ -31,19 +31,11 @@ 1.4 1.5 #include <stdlib.h> 1.6 1.7 -typedef void *(*cx_malloc_func)(void *data, size_t n); 1.8 - 1.9 -typedef void *(*cx_realloc_func)(void *data, void *mem, size_t n); 1.10 - 1.11 -typedef void *(*cx_calloc_func)(void *data, size_t nelem, size_t n); 1.12 - 1.13 -typedef void(*cx_free_func)(void *data, void *mem); 1.14 - 1.15 typedef struct { 1.16 - cx_malloc_func malloc; 1.17 - cx_realloc_func realloc; 1.18 - cx_calloc_func calloc; 1.19 - cx_free_func free; 1.20 + void *(*malloc)(void *data, size_t n); 1.21 + void *(*realloc)(void *data, void *mem, size_t n); 1.22 + void *(*calloc)(void *data, size_t nelem, size_t n); 1.23 + void(*free)(void *data, void *mem); 1.24 } cx_allocator_class; 1.25 1.26 extern cx_allocator_class cx_default_allocator_class;
2.1 --- a/src/cx/list.h Sun Feb 07 21:26:48 2021 +0100 2.2 +++ b/src/cx/list.h Sun Feb 07 21:29:51 2021 +0100 2.3 @@ -43,22 +43,12 @@ 2.4 void *listdata; 2.5 } cx_list; 2.6 2.7 -typedef int (*cx_list_add)(cx_list *list, void *elem); 2.8 - 2.9 -typedef int (*cx_list_insert)(cx_list *list, size_t index, void *elem); 2.10 - 2.11 -typedef void *(*cx_list_remove)(cx_list *list, size_t index); 2.12 - 2.13 -typedef size_t (*cx_list_find)(cx_list *list, void *elem); 2.14 - 2.15 -typedef void *(*cx_list_last)(cx_list *list); 2.16 - 2.17 typedef struct { 2.18 - cx_list_add add; 2.19 - cx_list_insert insert; 2.20 - cx_list_remove remove; 2.21 - cx_list_find find; 2.22 - cx_list_last last; 2.23 + int (*add)(cx_list *list, void *elem); 2.24 + int (*insert)(cx_list *list, size_t index, void *elem); 2.25 + void *(*remove)(cx_list *list, size_t index); 2.26 + size_t (*find)(cx_list *list, void *elem); 2.27 + void *(*last)(cx_list *list); 2.28 } cx_list_class; 2.29 2.30 struct cx_list_s {