From: Simon McVittie Date: Wed, 22 Jun 2011 15:05:18 +0000 (+0100) Subject: _dbus_list_insert_before: remove, unused X-Git-Tag: dbus-1.5.10~46 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=10143a9c965aa5e156d9be22b88772415f54cf55;p=thirdparty%2Fdbus.git _dbus_list_insert_before: remove, unused Bug: https://bugs.freedesktop.org/show_bug.cgi?id=39759 Signed-off-by: Simon McVittie Reviewed-by: Lennart Poettering --- diff --git a/dbus/dbus-list.c b/dbus/dbus-list.c index d4d74f693..f8f1c4a7a 100644 --- a/dbus/dbus-list.c +++ b/dbus/dbus-list.c @@ -325,37 +325,6 @@ _dbus_list_prepend_link (DBusList **list, link_before (list, *list, link); } -#ifdef DBUS_BUILD_TESTS -/** - * Inserts data into the list before the given existing link. - * - * @param list the list to modify - * @param before_this_link existing link to insert before, or #NULL to append - * @param data the value to insert - * @returns #TRUE on success, #FALSE if memory allocation fails - */ -dbus_bool_t -_dbus_list_insert_before (DBusList **list, - DBusList *before_this_link, - void *data) -{ - DBusList *link; - - if (before_this_link == NULL) - return _dbus_list_append (list, data); - else - { - link = alloc_link (data); - if (link == NULL) - return FALSE; - - link_before (list, before_this_link, link); - } - - return TRUE; -} -#endif /* DBUS_BUILD_TESTS */ - /** * Inserts data into the list after the given existing link. * @@ -1349,31 +1318,6 @@ _dbus_list_test (void) _dbus_list_clear (&list1); _dbus_list_clear (&list2); - - /* insert_before on empty list */ - _dbus_list_insert_before (&list1, NULL, - _DBUS_INT_TO_POINTER (0)); - verify_list (&list1); - - /* inserting before first element */ - _dbus_list_insert_before (&list1, list1, - _DBUS_INT_TO_POINTER (2)); - verify_list (&list1); - _dbus_assert (is_descending_sequence (&list1)); - - /* inserting in the middle */ - _dbus_list_insert_before (&list1, list1->next, - _DBUS_INT_TO_POINTER (1)); - verify_list (&list1); - _dbus_assert (is_descending_sequence (&list1)); - - /* using insert_before to append */ - _dbus_list_insert_before (&list1, NULL, - _DBUS_INT_TO_POINTER (-1)); - verify_list (&list1); - _dbus_assert (is_descending_sequence (&list1)); - - _dbus_list_clear (&list1); /* insert_after on empty list */ _dbus_list_insert_after (&list1, NULL,