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 <dbassey@redhat.com>
This commit is contained in:
Dorinda Bassey 2023-11-21 17:18:26 +01:00 committed by Wim Taymans
parent e8c6c78982
commit f4a56ad45d
7 changed files with 20 additions and 19 deletions

View file

@ -300,7 +300,8 @@ spa_buffer_alloc_array(uint32_t n_buffers, uint32_t flags,
{ {
struct spa_buffer **buffers; 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; void *skel;
spa_buffer_alloc_fill_info(&info, n_metas, metas, n_datas, datas, data_aligns); spa_buffer_alloc_fill_info(&info, n_metas, metas, n_datas, datas, data_aligns);

View file

@ -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; struct spa_graph *graph = node->subgraph;
spa_debug("node %p: sub process %p", node, graph); 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; 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) uint32_t port_id, uint32_t buffer_id)
{ {
struct spa_node *n = (struct spa_node *)data; struct spa_node *n = (struct spa_node *)data;

View file

@ -22,8 +22,8 @@ struct spa_result_device_params_data {
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, static inline void spa_result_func_device_params(void *data, int seq SPA_UNUSED, int res SPA_UNUSED,
uint32_t type, const void *result) uint32_t type SPA_UNUSED, const void *result)
{ {
struct spa_result_device_params_data *d = struct spa_result_device_params_data *d =
(struct spa_result_device_params_data *)data; (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 **param,
struct spa_pod_builder *builder) struct spa_pod_builder *builder)
{ {
struct spa_result_device_params_data data = { builder, }; struct spa_result_device_params_data data = { builder, {0}};
struct spa_hook listener = {{0}}; struct spa_hook listener = {{0}, {0}, 0, 0};
static const struct spa_device_events device_events = { static const struct spa_device_events device_events = {
.version = SPA_VERSION_DEVICE_EVENTS, .version = SPA_VERSION_DEVICE_EVENTS,
.info = NULL, .info = NULL,

View file

@ -24,7 +24,7 @@ struct spa_result_node_params_data {
}; };
static inline void spa_result_func_node_params(void *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 *d =
(struct spa_result_node_params_data *) data; (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 **param,
struct spa_pod_builder *builder) struct spa_pod_builder *builder)
{ {
struct spa_result_node_params_data data = { builder, }; struct spa_result_node_params_data data = { builder, {0}};
struct spa_hook listener = {{0}}; struct spa_hook listener = {{0}, {0}, 0, 0};
static const struct spa_node_events node_events = { static const struct spa_node_events node_events = {
.version = SPA_VERSION_NODE_EVENTS, .version = SPA_VERSION_NODE_EVENTS,
.info = NULL, .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 **param,
struct spa_pod_builder *builder) struct spa_pod_builder *builder)
{ {
struct spa_result_node_params_data data = { builder, }; struct spa_result_node_params_data data = { builder, {0}};
struct spa_hook listener = {{0}}; struct spa_hook listener = {{0}, {0}, 0, 0};
static const struct spa_node_events node_events = { static const struct spa_node_events node_events = {
.version = SPA_VERSION_NODE_EVENTS, .version = SPA_VERSION_NODE_EVENTS,
.info = NULL, .info = NULL,

View file

@ -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, 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) { switch (type) {
case SPA_TYPE_Int: 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, 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) { switch (type) {
case SPA_TYPE_Int: case SPA_TYPE_Int:

View file

@ -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, enum spa_log_level level,
const struct spa_log_topic *topic, const struct spa_log_topic *topic,
const char *file, const char *file,
@ -88,7 +88,7 @@ static inline SPA_PRINTF_FUNC(6,7) void spa_log_impl_log(void *object,
va_end(args); 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 */ /* noop */
} }

View file

@ -38,13 +38,13 @@ struct spa_json {
uint32_t depth; 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) static inline void spa_json_init(struct spa_json * iter, const char *data, size_t size)
{ {
*iter = SPA_JSON_INIT(data, 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) 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 == '['); 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; const char *val;
struct spa_json sub; struct spa_json sub;