src/list.c

branch
docs/3.1
changeset 1164
148b7c7ccaf9
parent 1163
68ff0839bc6a
equal deleted inserted replaced
1148:8ff82697f2c3 1164:148b7c7ccaf9
126 ) { 126 ) {
127 void **ptr = list->climpl->at(list, index); 127 void **ptr = list->climpl->at(list, index);
128 return ptr == NULL ? NULL : *ptr; 128 return ptr == NULL ? NULL : *ptr;
129 } 129 }
130 130
131 static ssize_t cx_pl_find_remove( 131 static size_t cx_pl_find_remove(
132 struct cx_list_s *list, 132 struct cx_list_s *list,
133 const void *elem, 133 const void *elem,
134 bool remove 134 bool remove
135 ) { 135 ) {
136 cx_pl_hack_cmpfunc(list); 136 cx_pl_hack_cmpfunc(list);
137 ssize_t ret = list->climpl->find_remove(list, &elem, remove); 137 size_t ret = list->climpl->find_remove(list, &elem, remove);
138 cx_pl_unhack_cmpfunc(list); 138 cx_pl_unhack_cmpfunc(list);
139 return ret; 139 return ret;
140 } 140 }
141 141
142 static void cx_pl_sort(struct cx_list_s *list) { 142 static void cx_pl_sort(struct cx_list_s *list) {
205 cx_attr_unused size_t index 205 cx_attr_unused size_t index
206 ) { 206 ) {
207 return NULL; 207 return NULL;
208 } 208 }
209 209
210 static ssize_t cx_emptyl_find_remove( 210 static size_t cx_emptyl_find_remove(
211 cx_attr_unused struct cx_list_s *list, 211 cx_attr_unused struct cx_list_s *list,
212 cx_attr_unused const void *elem, 212 cx_attr_unused const void *elem,
213 cx_attr_unused bool remove 213 cx_attr_unused bool remove
214 ) { 214 ) {
215 return -1; 215 return 0;
216 } 216 }
217 217
218 static bool cx_emptyl_iter_valid(cx_attr_unused const void *iter) { 218 static bool cx_emptyl_iter_valid(cx_attr_unused const void *iter) {
219 return false; 219 return false;
220 } 220 }
247 cx_emptyl_noop, 247 cx_emptyl_noop,
248 cx_emptyl_iterator, 248 cx_emptyl_iterator,
249 }; 249 };
250 250
251 CxList cx_empty_list = { 251 CxList cx_empty_list = {
252 { 252 {
253 NULL, 253 NULL,
254 NULL, 254 NULL,
255 0, 255 0,
256 0, 256 0,
257 NULL, 257 NULL,
258 NULL, 258 NULL,
259 NULL, 259 NULL,
260 false 260 false,
261 }, 261 true,
262 &cx_empty_list_class, 262 },
263 NULL 263 &cx_empty_list_class,
264 NULL
264 }; 265 };
265 266
266 CxList *const cxEmptyList = &cx_empty_list; 267 CxList *const cxEmptyList = &cx_empty_list;
267 268
268 // </editor-fold> 269 // </editor-fold>

mercurial