removes unnecessary typedefs

Sun, 07 Feb 2021 21:29:51 +0100

author
Mike Becker <universe@uap-core.de>
date
Sun, 07 Feb 2021 21:29:51 +0100
changeset 405
44efaa54d63d
parent 404
86ebc3745e62
child 406
9cbea761fbf7

removes unnecessary typedefs

src/cx/allocator.h file | annotate | diff | comparison | revisions
src/cx/list.h file | annotate | diff | comparison | revisions
--- a/src/cx/allocator.h	Sun Feb 07 21:26:48 2021 +0100
+++ b/src/cx/allocator.h	Sun Feb 07 21:29:51 2021 +0100
@@ -31,19 +31,11 @@
 
 #include <stdlib.h>
 
-typedef void *(*cx_malloc_func)(void *data, size_t n);
-
-typedef void *(*cx_realloc_func)(void *data, void *mem, size_t n);
-
-typedef void *(*cx_calloc_func)(void *data, size_t nelem, size_t n);
-
-typedef void(*cx_free_func)(void *data, void *mem);
-
 typedef struct {
-    cx_malloc_func malloc;
-    cx_realloc_func realloc;
-    cx_calloc_func calloc;
-    cx_free_func free;
+    void *(*malloc)(void *data, size_t n);
+    void *(*realloc)(void *data, void *mem, size_t n);
+    void *(*calloc)(void *data, size_t nelem, size_t n);
+    void(*free)(void *data, void *mem);
 } cx_allocator_class;
 
 extern cx_allocator_class cx_default_allocator_class;
--- a/src/cx/list.h	Sun Feb 07 21:26:48 2021 +0100
+++ b/src/cx/list.h	Sun Feb 07 21:29:51 2021 +0100
@@ -43,22 +43,12 @@
     void *listdata;
 } cx_list;
 
-typedef int (*cx_list_add)(cx_list *list, void *elem);
-
-typedef int (*cx_list_insert)(cx_list *list, size_t index, void *elem);
-
-typedef void *(*cx_list_remove)(cx_list *list, size_t index);
-
-typedef size_t (*cx_list_find)(cx_list *list, void *elem);
-
-typedef void *(*cx_list_last)(cx_list *list);
-
 typedef struct {
-    cx_list_add add;
-    cx_list_insert insert;
-    cx_list_remove remove;
-    cx_list_find find;
-    cx_list_last last;
+    int (*add)(cx_list *list, void *elem);
+    int (*insert)(cx_list *list, size_t index, void *elem);
+    void *(*remove)(cx_list *list, size_t index);
+    size_t (*find)(cx_list *list, void *elem);
+    void *(*last)(cx_list *list);
 } cx_list_class;
 
 struct cx_list_s {

mercurial