X-Git-Url: http://git.madism.org/?a=blobdiff_plain;f=lib%2Flist.c;h=0b852e07b63265198a44a53694b4e2edf6d47eca;hb=f65ae399906906f734398432691dbacf2c7bda9f;hp=8edcec2b52e45274bc15d99ecee805cddc86144b;hpb=7f7a0be369840b290248e5b0302beb447fa1b3cd;p=apps%2Fmadmutt.git diff --git a/lib/list.c b/lib/list.c index 8edcec2..0b852e0 100644 --- a/lib/list.c +++ b/lib/list.c @@ -7,21 +7,15 @@ * please see the file GPL in the top level source directory. */ -#include -#include - -#include -#include - +#include #include "list.h" - list2_t* list_new (void) { return p_new(list2_t, 1); } void list_del (list2_t** l, list_del_t* del) { - size_t i = 0; + ssize_t i = 0; if (!l || !*l) return; if (del) @@ -88,16 +82,16 @@ list2_t *list_cpy(list2_t *l) { return ret; } -list2_t* list_dup (list2_t* l, void* (*dup) (void*)) { +list2_t* list_dup (list2_t* l, void* (*dup_f) (void*)) { list2_t* ret = NULL; int i = 0; - if (list_empty(l) || !*dup) + if (list_empty(l) || !*dup_f) return (NULL); ret = list_new (); ret->length = l->length; ret->data = p_new(void*, l->length); for (i = 0; i < l->length; i++) - ret->data[i] = dup (l->data[i]); + ret->data[i] = dup_f (l->data[i]); return (ret); }