src/list.c

changeset 985
68754c7de906
parent 919
75da57d4634e
equal deleted inserted replaced
984:e8f354a25ac8 985:68754c7de906
210 210
211 // </editor-fold> 211 // </editor-fold>
212 212
213 // <editor-fold desc="empty list implementation"> 213 // <editor-fold desc="empty list implementation">
214 214
215 static void cx_emptyl_noop(__attribute__((__unused__)) CxList *list) { 215 static void cx_emptyl_noop(cx_attr_unused CxList *list) {
216 // this is a noop, but MUST be implemented 216 // this is a noop, but MUST be implemented
217 } 217 }
218 218
219 static void *cx_emptyl_at( 219 static void *cx_emptyl_at(
220 __attribute__((__unused__)) const struct cx_list_s *list, 220 cx_attr_unused const struct cx_list_s *list,
221 __attribute__((__unused__)) size_t index 221 cx_attr_unused size_t index
222 ) { 222 ) {
223 return NULL; 223 return NULL;
224 } 224 }
225 225
226 static ssize_t cx_emptyl_find_remove( 226 static ssize_t cx_emptyl_find_remove(
227 __attribute__((__unused__)) struct cx_list_s *list, 227 cx_attr_unused struct cx_list_s *list,
228 __attribute__((__unused__)) const void *elem, 228 cx_attr_unused const void *elem,
229 __attribute__((__unused__)) bool remove 229 cx_attr_unused bool remove
230 ) { 230 ) {
231 return -1; 231 return -1;
232 } 232 }
233 233
234 static bool cx_emptyl_iter_valid(__attribute__((__unused__)) const void *iter) { 234 static bool cx_emptyl_iter_valid(cx_attr_unused const void *iter) {
235 return false; 235 return false;
236 } 236 }
237 237
238 static CxIterator cx_emptyl_iterator( 238 static CxIterator cx_emptyl_iterator(
239 const struct cx_list_s *list, 239 const struct cx_list_s *list,
240 size_t index, 240 size_t index,
241 __attribute__((__unused__)) bool backwards 241 cx_attr_unused bool backwards
242 ) { 242 ) {
243 CxIterator iter = {0}; 243 CxIterator iter = {0};
244 iter.src_handle.c = list; 244 iter.src_handle.c = list;
245 iter.index = index; 245 iter.index = index;
246 iter.base.valid = cx_emptyl_iter_valid; 246 iter.base.valid = cx_emptyl_iter_valid;
415 memcpy(jp, tmp, elem_size); 415 memcpy(jp, tmp, elem_size);
416 416
417 free(tmp); 417 free(tmp);
418 418
419 return 0; 419 return 0;
420 }
421
422 void cxListDestroy(CxList *list) {
423 list->cl->destructor(list);
424 } 420 }
425 421
426 int cxListCompare( 422 int cxListCompare(
427 const CxList *list, 423 const CxList *list,
428 const CxList *other 424 const CxList *other

mercurial