mirror of
https://github.com/obgm/libcoap.git
synced 2026-11-16 21:14:55 +03:00
Renamed delete to delete_func to avoid nameclash when imported into C++
(thanks to Kai Hillmann for pointing this out)
This commit is contained in:
1 parent
d9f8b5dbb8
commit
c7ce034ec0
3 files changed
+8
-8
No files matched your search
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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_ */
|
||||
+2
-2
@@ -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;
|
||||
|
||||
|
||||
Reference in new issue
Block a user