diff --git a/src/api/api.c b/src/api/api.c index 386ed62cc..95ba8fbea 100644 --- a/src/api/api.c +++ b/src/api/api.c @@ -613,11 +613,11 @@ OWNED_FUNCTIONS_PTR_CLONE(z_publisher_t, z_owned_publisher_t, publisher, _z_owne void z_publisher_drop(z_owned_publisher_t *val) { z_undeclare_publisher(val); } z_put_options_t z_put_options_default(void) { - return (z_put_options_t){.encoding = z_encoding_default(), - .congestion_control = Z_CONGESTION_CONTROL_DEFAULT, - .priority = Z_PRIORITY_DEFAULT, + return (z_put_options_t) { + .encoding = z_encoding_default(), .congestion_control = Z_CONGESTION_CONTROL_DEFAULT, + .priority = Z_PRIORITY_DEFAULT, #if Z_FEATURE_ATTACHMENT == 1 - .attachment = z_attachment_null() + .attachment = z_attachment_null() #endif }; } @@ -715,9 +715,10 @@ int8_t z_undeclare_publisher(z_owned_publisher_t *pub) { } z_publisher_put_options_t z_publisher_put_options_default(void) { - return (z_publisher_put_options_t){.encoding = z_encoding_default(), + return (z_publisher_put_options_t) { + .encoding = z_encoding_default(), #if Z_FEATURE_ATTACHMENT == 1 - .attachment = z_attachment_null() + .attachment = z_attachment_null() #endif }; } @@ -781,13 +782,14 @@ z_owned_keyexpr_t z_publisher_keyexpr(z_publisher_t publisher) { OWNED_FUNCTIONS_PTR_INTERNAL(z_reply_t, z_owned_reply_t, reply, _z_reply_free, _z_owner_noop_copy) z_get_options_t z_get_options_default(void) { - return (z_get_options_t){.target = z_query_target_default(), - .consolidation = z_query_consolidation_default(), - .value = {.encoding = z_encoding_default(), .payload = _z_bytes_empty()}, + return (z_get_options_t) { + .target = z_query_target_default(), .consolidation = z_query_consolidation_default(), + .value = {.encoding = z_encoding_default(), .payload = _z_bytes_empty()}, #if Z_FEATURE_ATTACHMENT == 1 - // TODO:ATT.attachment = z_attachment_null() + // TODO:ATT.attachment = z_attachment_null() #endif - .timeout_ms = Z_GET_TIMEOUT_DEFAULT}; + .timeout_ms = Z_GET_TIMEOUT_DEFAULT + }; } typedef struct __z_reply_handler_wrapper_t { @@ -1088,7 +1090,7 @@ z_owned_keyexpr_t z_subscriber_keyexpr(z_subscriber_t sub) { /**************** Tasks ****************/ zp_task_read_options_t zp_task_read_options_default(void) { - return (zp_task_read_options_t){ + return (zp_task_read_options_t) { #if Z_FEATURE_MULTI_THREAD == 1 .task_attributes = NULL #else @@ -1121,7 +1123,7 @@ int8_t zp_stop_read_task(z_session_t zs) { } zp_task_lease_options_t zp_task_lease_options_default(void) { - return (zp_task_lease_options_t){ + return (zp_task_lease_options_t) { #if Z_FEATURE_MULTI_THREAD == 1 .task_attributes = NULL #else diff --git a/src/protocol/definitions/message.c b/src/protocol/definitions/message.c index a16717f1d..0fc391f62 100644 --- a/src/protocol/definitions/message.c +++ b/src/protocol/definitions/message.c @@ -31,7 +31,7 @@ _z_msg_query_reqexts_t _z_msg_query_required_extensions(const _z_msg_query_t *ms #if Z_FEATURE_ATTACHMENT == 1 z_attachment_t att = _z_encoded_as_attachment(&msg->_ext_attachment); #endif - return (_z_msg_query_reqexts_t){ + return (_z_msg_query_reqexts_t) { .body = msg->_ext_value.payload.start != NULL || msg->_ext_value.encoding.prefix != 0 || !_z_bytes_is_empty(&msg->_ext_value.encoding.suffix), .info = _z_id_check(msg->_ext_info._id) || msg->_ext_info._entity_id != 0 || msg->_ext_info._source_sn != 0, diff --git a/src/system/espidf/system.c b/src/system/espidf/system.c index 291bfec40..e6d3d018f 100644 --- a/src/system/espidf/system.c +++ b/src/system/espidf/system.c @@ -74,7 +74,8 @@ static z_task_attr_t z_default_task_attr = { }; /*------------------ Thread ------------------*/ -int8_t z_task_init(z_task_t *task, z_task_attr_t *attr, void *(*fun)(void *), void *arg) { +int8_t z_task_init(z_task_t *task, z_task_attr_t *arg_attr, void *(*fun)(void *), void *arg) { + z_task_attr_t *attr = arg_attr; z_task_arg *z_arg = (z_task_arg *)z_malloc(sizeof(z_task_arg)); if (z_arg == NULL) { return -1; @@ -82,7 +83,8 @@ int8_t z_task_init(z_task_t *task, z_task_attr_t *attr, void *(*fun)(void *), vo z_arg->fun = fun; z_arg->arg = arg; - z_arg->join_event = task->join_event = xEventGroupCreate(); + task->join_event = xEventGroupCreate(); + z_arg->join_event = task->join_event; if (attr == NULL) { attr = &z_default_task_attr; @@ -154,7 +156,6 @@ int z_sleep_ms(size_t time) { // This may compound, so this approach may make sleeps longer than expected. // This extra check tries to minimize the amount of extra time it might sleep. while (z_time_elapsed_ms(&start) < time) { - // z_sleep_us(1000); vTaskDelay(1 / portTICK_PERIOD_MS); }