From 7618d83fb770bd73c6b568ec5d311165b86c5b7a Mon Sep 17 00:00:00 2001 From: Jean-Roland Date: Thu, 25 Apr 2024 11:27:51 +0200 Subject: [PATCH] fix: set attachment_drop as a private function --- include/zenoh-pico/protocol/core.h | 2 +- src/net/memory.c | 2 +- src/net/query.c | 2 +- src/protocol/core.c | 2 +- src/session/subscription.c | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/zenoh-pico/protocol/core.h b/include/zenoh-pico/protocol/core.h index 24f87c090..133c30acc 100644 --- a/include/zenoh-pico/protocol/core.h +++ b/include/zenoh-pico/protocol/core.h @@ -134,7 +134,7 @@ size_t _z_attachment_estimate_length(z_attachment_t att); /** * Drop an attachment that was decoded from a received message */ -void z_attachment_drop(z_attachment_t *att); +void _z_attachment_drop(z_attachment_t *att); #endif _z_timestamp_t _z_timestamp_duplicate(const _z_timestamp_t *tstamp); diff --git a/src/net/memory.c b/src/net/memory.c index 1a8df73ce..553d47999 100644 --- a/src/net/memory.c +++ b/src/net/memory.c @@ -37,7 +37,7 @@ void _z_sample_clear(_z_sample_t *sample) { _z_bytes_clear(&sample->encoding.schema); // FIXME: call the z_encoding_clear _z_timestamp_clear(&sample->timestamp); #if Z_FEATURE_ATTACHMENT == 1 - z_attachment_drop(&sample->attachment); + _z_attachment_drop(&sample->attachment); #endif } diff --git a/src/net/query.c b/src/net/query.c index 0ef6c2fcc..e2e73c7b4 100644 --- a/src/net/query.c +++ b/src/net/query.c @@ -28,7 +28,7 @@ void _z_query_clear(_z_query_t *q) { _z_keyexpr_clear(&q->_key); _z_value_clear(&q->_value); #if Z_FEATURE_ATTACHMENT == 1 - z_attachment_drop(&q->attachment); + _z_attachment_drop(&q->attachment); #endif } diff --git a/src/protocol/core.c b/src/protocol/core.c index debc1fda5..ada2c0c38 100644 --- a/src/protocol/core.c +++ b/src/protocol/core.c @@ -145,7 +145,7 @@ int8_t z_attachment_iterate(z_attachment_t this_, z_attachment_iter_body_t body, return this_.iteration_driver(this_.data, body, ctx); } -void z_attachment_drop(z_attachment_t *att) { +void _z_attachment_drop(z_attachment_t *att) { if (att->iteration_driver == _z_encoded_attachment_iteration_driver) { _z_bytes_clear((z_bytes_t *)att->data); z_free((z_bytes_t *)att->data); diff --git a/src/session/subscription.c b/src/session/subscription.c index ed9e55d92..bb7d3fb8a 100644 --- a/src/session/subscription.c +++ b/src/session/subscription.c @@ -192,7 +192,7 @@ int8_t _z_trigger_subscriptions(_z_session_t *zn, const _z_keyexpr_t keyexpr, co sub->in->val._callback(&s, sub->in->val._arg); xs = _z_subscription_rc_list_tail(xs); } - z_attachment_drop(&s.attachment); + _z_attachment_drop(&s.attachment); _z_keyexpr_clear(&key); _z_subscription_rc_list_free(&subs); } else {