From f4a56ad45dfde7eaed31568624dc90c2ba707078 Mon Sep 17 00:00:00 2001 From: Dorinda Bassey Date: Tue, 21 Nov 2023 17:18:26 +0100 Subject: [PATCH] Fix some warnings added cleanup of unused variables and fix warning about missing initializers to resolve build warnings in pipewire-rs Signed-off-by: Dorinda Bassey --- spa/include/spa/buffer/alloc.h | 3 ++- spa/include/spa/graph/graph.h | 4 ++-- spa/include/spa/monitor/utils.h | 8 ++++---- spa/include/spa/node/utils.h | 10 +++++----- spa/include/spa/pod/filter.h | 4 ++-- spa/include/spa/support/log-impl.h | 4 ++-- spa/include/spa/utils/json.h | 6 +++--- 7 files changed, 20 insertions(+), 19 deletions(-) diff --git a/spa/include/spa/buffer/alloc.h b/spa/include/spa/buffer/alloc.h index 7329c9447..8b9e55e50 100644 --- a/spa/include/spa/buffer/alloc.h +++ b/spa/include/spa/buffer/alloc.h @@ -300,7 +300,8 @@ spa_buffer_alloc_array(uint32_t n_buffers, uint32_t flags, { struct spa_buffer **buffers; - struct spa_buffer_alloc_info info = { flags | SPA_BUFFER_ALLOC_FLAG_INLINE_ALL, }; + struct spa_buffer_alloc_info info = { flags | SPA_BUFFER_ALLOC_FLAG_INLINE_ALL, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; void *skel; spa_buffer_alloc_fill_info(&info, n_metas, metas, n_datas, datas, data_aligns); diff --git a/spa/include/spa/graph/graph.h b/spa/include/spa/graph/graph.h index bfcb9b3d1..39049183a 100644 --- a/spa/include/spa/graph/graph.h +++ b/spa/include/spa/graph/graph.h @@ -215,7 +215,7 @@ spa_graph_node_init(struct spa_graph_node *node, struct spa_graph_state *state) } -static inline int spa_graph_node_impl_sub_process(void *data, struct spa_graph_node *node) +static inline int spa_graph_node_impl_sub_process(void *data SPA_UNUSED, struct spa_graph_node *node) { struct spa_graph *graph = node->subgraph; spa_debug("node %p: sub process %p", node, graph); @@ -322,7 +322,7 @@ static inline int spa_graph_node_impl_process(void *data, struct spa_graph_node return state->status; } -static inline int spa_graph_node_impl_reuse_buffer(void *data, struct spa_graph_node *node, +static inline int spa_graph_node_impl_reuse_buffer(void *data, struct spa_graph_node *node SPA_UNUSED, uint32_t port_id, uint32_t buffer_id) { struct spa_node *n = (struct spa_node *)data; diff --git a/spa/include/spa/monitor/utils.h b/spa/include/spa/monitor/utils.h index fcea4ac6a..93f8f41b0 100644 --- a/spa/include/spa/monitor/utils.h +++ b/spa/include/spa/monitor/utils.h @@ -22,8 +22,8 @@ struct spa_result_device_params_data { struct spa_result_device_params data; }; -static inline void spa_result_func_device_params(void *data, int seq, int res, - uint32_t type, const void *result) +static inline void spa_result_func_device_params(void *data, int seq SPA_UNUSED, int res SPA_UNUSED, + uint32_t type SPA_UNUSED, const void *result) { struct spa_result_device_params_data *d = (struct spa_result_device_params_data *)data; @@ -42,8 +42,8 @@ static inline int spa_device_enum_params_sync(struct spa_device *device, struct spa_pod **param, struct spa_pod_builder *builder) { - struct spa_result_device_params_data data = { builder, }; - struct spa_hook listener = {{0}}; + struct spa_result_device_params_data data = { builder, {0}}; + struct spa_hook listener = {{0}, {0}, 0, 0}; static const struct spa_device_events device_events = { .version = SPA_VERSION_DEVICE_EVENTS, .info = NULL, diff --git a/spa/include/spa/node/utils.h b/spa/include/spa/node/utils.h index a88ef8959..01d249ab9 100644 --- a/spa/include/spa/node/utils.h +++ b/spa/include/spa/node/utils.h @@ -24,7 +24,7 @@ struct spa_result_node_params_data { }; static inline void spa_result_func_node_params(void *data, - int seq, int res, uint32_t type, const void *result) + int seq SPA_UNUSED, int res SPA_UNUSED, uint32_t type SPA_UNUSED, const void *result) { struct spa_result_node_params_data *d = (struct spa_result_node_params_data *) data; @@ -43,8 +43,8 @@ static inline int spa_node_enum_params_sync(struct spa_node *node, struct spa_pod **param, struct spa_pod_builder *builder) { - struct spa_result_node_params_data data = { builder, }; - struct spa_hook listener = {{0}}; + struct spa_result_node_params_data data = { builder, {0}}; + struct spa_hook listener = {{0}, {0}, 0, 0}; static const struct spa_node_events node_events = { .version = SPA_VERSION_NODE_EVENTS, .info = NULL, @@ -77,8 +77,8 @@ static inline int spa_node_port_enum_params_sync(struct spa_node *node, struct spa_pod **param, struct spa_pod_builder *builder) { - struct spa_result_node_params_data data = { builder, }; - struct spa_hook listener = {{0}}; + struct spa_result_node_params_data data = { builder, {0}}; + struct spa_hook listener = {{0}, {0}, 0, 0}; static const struct spa_node_events node_events = { .version = SPA_VERSION_NODE_EVENTS, .info = NULL, diff --git a/spa/include/spa/pod/filter.h b/spa/include/spa/pod/filter.h index 40e171093..3a682e1ac 100644 --- a/spa/include/spa/pod/filter.h +++ b/spa/include/spa/pod/filter.h @@ -78,7 +78,7 @@ static inline int spa_pod_choice_fix_default(struct spa_pod_choice *choice) } static inline int spa_pod_filter_flags_value(struct spa_pod_builder *b, - uint32_t type, const void *r1, const void *r2, uint32_t size) + uint32_t type, const void *r1, const void *r2, uint32_t size SPA_UNUSED) { switch (type) { case SPA_TYPE_Int: @@ -104,7 +104,7 @@ static inline int spa_pod_filter_flags_value(struct spa_pod_builder *b, } static inline int spa_pod_filter_is_step_of(uint32_t type, const void *r1, - const void *r2, uint32_t size) + const void *r2, uint32_t size SPA_UNUSED) { switch (type) { case SPA_TYPE_Int: diff --git a/spa/include/spa/support/log-impl.h b/spa/include/spa/support/log-impl.h index 0af62f643..214417fa5 100644 --- a/spa/include/spa/support/log-impl.h +++ b/spa/include/spa/support/log-impl.h @@ -19,7 +19,7 @@ extern "C" { * \{ */ -static inline SPA_PRINTF_FUNC(7, 0) void spa_log_impl_logtv(void *object, +static inline SPA_PRINTF_FUNC(7, 0) void spa_log_impl_logtv(void *object SPA_UNUSED, enum spa_log_level level, const struct spa_log_topic *topic, const char *file, @@ -88,7 +88,7 @@ static inline SPA_PRINTF_FUNC(6,7) void spa_log_impl_log(void *object, va_end(args); } -static inline void spa_log_impl_topic_init(void *object, struct spa_log_topic *topic) +static inline void spa_log_impl_topic_init(void *object SPA_UNUSED, struct spa_log_topic *topic SPA_UNUSED) { /* noop */ } diff --git a/spa/include/spa/utils/json.h b/spa/include/spa/utils/json.h index 376d4c875..c97e25371 100644 --- a/spa/include/spa/utils/json.h +++ b/spa/include/spa/utils/json.h @@ -38,13 +38,13 @@ struct spa_json { uint32_t depth; }; -#define SPA_JSON_INIT(data,size) ((struct spa_json) { (data), (data)+(size), }) +#define SPA_JSON_INIT(data,size) ((struct spa_json) { (data), (data)+(size), 0, 0, 0 }) static inline void spa_json_init(struct spa_json * iter, const char *data, size_t size) { *iter = SPA_JSON_INIT(data, size); } -#define SPA_JSON_ENTER(iter) ((struct spa_json) { (iter)->cur, (iter)->end, (iter), }) +#define SPA_JSON_ENTER(iter) ((struct spa_json) { (iter)->cur, (iter)->end, (iter), 0, 0 }) static inline void spa_json_enter(struct spa_json * iter, struct spa_json * sub) { @@ -181,7 +181,7 @@ static inline int spa_json_is_container(const char *val, int len) return len > 0 && (*val == '{' || *val == '['); } -static inline int spa_json_container_len(struct spa_json *iter, const char *value, int len) +static inline int spa_json_container_len(struct spa_json *iter, const char *value, int len SPA_UNUSED) { const char *val; struct spa_json sub;