From c7ce034ec07757952eac4c78459f7b5e59c6f426 Mon Sep 17 00:00:00 2001 From: Olaf Bergmann Date: Fri, 3 Dec 2010 14:11:28 +0100 Subject: [PATCH] Renamed delete to delete_func to avoid nameclash when imported into C++ (thanks to Kai Hillmann for pointing this out) --- list.c | 8 ++++---- list.h | 4 ++-- subscribe.c | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/list.c b/list.c index 99c92d75..0b4acc11 100644 --- a/list.c +++ b/list.c @@ -61,8 +61,8 @@ coap_delete(coap_list_t *node) { if ( !node ) return 0; - if ( node->delete ) - node->delete( node->data ); + if ( node->delete_func ) + node->delete_func( node->data ); coap_free( node->data ); coap_free( node ); @@ -79,7 +79,7 @@ coap_delete_list(coap_list_t *queue) { } coap_list_t * -coap_new_listnode(void *data, void (*delete)(void *) ) { +coap_new_listnode(void *data, void (*delete_func)(void *) ) { coap_list_t *node = coap_malloc( sizeof(coap_list_t) ); if ( ! node ) { perror ("coap_new_listnode: malloc"); @@ -88,7 +88,7 @@ coap_new_listnode(void *data, void (*delete)(void *) ) { memset(node, 0, sizeof(coap_list_t)); node->data = data; - node->delete = delete; + node->delete_func = delete_func; return node; } diff --git a/list.h b/list.h index 2e39063d..26a3a972 100644 --- a/list.h +++ b/list.h @@ -28,7 +28,7 @@ struct coap_linkedlistnode { * Callback function that is called from coap_delete to release * additional memory allocated by data Set to NULL if you do not * need this. Note that data is free'd automatically. */ - void (*delete)(void *); + void (*delete_func)(void *); }; typedef struct coap_linkedlistnode coap_list_t; @@ -51,6 +51,6 @@ void coap_delete_list(coap_list_t *queue); * by data will be released by coap_delete() with the new node. Returns the * new list node. */ -coap_list_t *coap_new_listnode(void *data, void (*delete)(void *) ); +coap_list_t *coap_new_listnode(void *data, void (*delete_func)(void *) ); #endif /* _COAP_LIST_H_ */ diff --git a/subscribe.c b/subscribe.c index bb7a2e77..9c98f470 100644 --- a/subscribe.c +++ b/subscribe.c @@ -283,9 +283,9 @@ coap_new_subscription(coap_context_t *context, const coap_uri_t *resource, } coap_list_t * -coap_list_push_first(coap_list_t **list, void *data, void (*delete)(void *) ) { +coap_list_push_first(coap_list_t **list, void *data, void (*delete_func)(void *) ) { coap_list_t *node; - node = coap_new_listnode(data, delete); + node = coap_new_listnode(data, delete_func); if ( !node || !list ) return NULL;