Author: rjek
Date: Sat Sep 22 13:37:27 2007
New Revision: 3564
URL:
http://source.netsurf-browser.org?rev=3564&view=rev
Log:
Use a typedef for the function pointers to comparison functions, add newline at end of
file
Modified:
trunk/dom/test/list.c
trunk/dom/test/list.h
Modified: trunk/dom/test/list.c
URL:
http://source.netsurf-browser.org/trunk/dom/test/list.c?rev=3564&r1=3...
==============================================================================
--- trunk/dom/test/list.c (original)
+++ trunk/dom/test/list.c Sat Sep 22 13:37:27 2007
@@ -58,8 +58,7 @@
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_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 @@
}
return true;
}
+
Modified: trunk/dom/test/list.h
URL:
http://source.netsurf-browser.org/trunk/dom/test/list.h?rev=3564&r1=3...
==============================================================================
--- trunk/dom/test/list.h (original)
+++ trunk/dom/test/list.h Sat Sep 22 13:37:27 2007
@@ -22,6 +22,8 @@
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 @@
* 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