diff options
author | Rob Kendrick <rjek@netsurf-browser.org> | 2007-09-22 12:37:27 +0000 |
---|---|---|
committer | Rob Kendrick <rjek@netsurf-browser.org> | 2007-09-22 12:37:27 +0000 |
commit | 5d869cdffd2aad63209156935ea01c82fd7f7a69 (patch) | |
tree | 192b7d4ea28667b4c750993d2373faf77e3826c8 /test | |
parent | 08e48355841946cf804510a24ea1f8df72e23d2f (diff) | |
download | libdom-5d869cdffd2aad63209156935ea01c82fd7f7a69.tar.gz libdom-5d869cdffd2aad63209156935ea01c82fd7f7a69.tar.bz2 |
Use a typedef for the function pointers to comparison functions, add newline at end of file
svn path=/trunk/dom/; revision=3564
Diffstat (limited to 'test')
-rw-r--r-- | test/list.c | 6 | ||||
-rw-r--r-- | test/list.h | 4 |
2 files changed, 6 insertions, 4 deletions
diff --git a/test/list.c b/test/list.c index f94b408..2c742fa 100644 --- a/test/list.c +++ b/test/list.c @@ -58,8 +58,7 @@ void list_add(struct list* list, void* data) list->size++; } -bool list_contains(struct list* list, void* data, - int (*comparator)(const void* a, const void* b)) +bool list_contains(struct list* list, void* data, list_compare_func comparator) { struct list_elt* elt = list->head; while (elt != NULL) { @@ -72,7 +71,7 @@ bool list_contains(struct list* list, void* data, } bool list_contains_all(struct list* superList, struct list* subList, - int (*comparator)(const void* a, const void* b)) + list_compare_func comparator) { struct list_elt* elt = subList->head; while (elt != NULL) { @@ -83,3 +82,4 @@ bool list_contains_all(struct list* superList, struct list* subList, } return true; } + diff --git a/test/list.h b/test/list.h index 7b5bcc0..a0a6c6a 100644 --- a/test/list.h +++ b/test/list.h @@ -22,6 +22,8 @@ struct list { struct list* list_new(void); void list_destroy(struct list* list); +typedef int (*list_compare_func)(const void* a, const void* b); + /** * Add data to the tail of the list. */ @@ -37,6 +39,6 @@ bool list_contains(struct list* list, void* data, * Tests if superlist contains all elements in sublist. Order is not important. */ bool list_contains_all(struct list* superList, struct list* subList, - int (*comparator)(const void* a, const void* b)); + list_compare_func comparator); #endif |