src/list.c

changeset 764
ccbdbd088455
parent 708
1caed6c9ba68
child 776
874cc78cdffd
     1.1 --- a/src/list.c	Mon Dec 18 16:14:07 2023 +0100
     1.2 +++ b/src/list.c	Mon Dec 18 18:22:53 2023 +0100
     1.3 @@ -115,12 +115,13 @@
     1.4      return ptr == NULL ? NULL : *ptr;
     1.5  }
     1.6  
     1.7 -static ssize_t cx_pl_find(
     1.8 -        struct cx_list_s const *list,
     1.9 -        void const *elem
    1.10 +static ssize_t cx_pl_find_remove(
    1.11 +        struct cx_list_s *list,
    1.12 +        void const *elem,
    1.13 +        bool remove
    1.14  ) {
    1.15      cx_pl_hack_cmpfunc(list);
    1.16 -    ssize_t ret = list->climpl->find(list, &elem);
    1.17 +    ssize_t ret = list->climpl->find_remove(list, &elem, remove);
    1.18      cx_pl_unhack_cmpfunc(list);
    1.19      return ret;
    1.20  }
    1.21 @@ -171,7 +172,7 @@
    1.22          cx_pl_clear,
    1.23          cx_pl_swap,
    1.24          cx_pl_at,
    1.25 -        cx_pl_find,
    1.26 +        cx_pl_find_remove,
    1.27          cx_pl_sort,
    1.28          cx_pl_compare,
    1.29          cx_pl_reverse,
    1.30 @@ -208,9 +209,10 @@
    1.31      return NULL;
    1.32  }
    1.33  
    1.34 -static ssize_t cx_emptyl_find(
    1.35 -        __attribute__((__unused__)) struct cx_list_s const *list,
    1.36 -        __attribute__((__unused__)) void const *elem
    1.37 +static ssize_t cx_emptyl_find_remove(
    1.38 +        __attribute__((__unused__)) struct cx_list_s *list,
    1.39 +        __attribute__((__unused__)) void const *elem,
    1.40 +        __attribute__((__unused__)) bool remove
    1.41  ) {
    1.42      return -1;
    1.43  }
    1.44 @@ -248,7 +250,7 @@
    1.45          cx_emptyl_noop,
    1.46          NULL,
    1.47          cx_emptyl_at,
    1.48 -        cx_emptyl_find,
    1.49 +        cx_emptyl_find_remove,
    1.50          cx_emptyl_noop,
    1.51          cx_emptyl_compare,
    1.52          cx_emptyl_noop,

mercurial