From e1211e6a945b24ffa6992a3f2a18779a8e0710fe Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Mon, 10 May 2021 11:58:29 +1000 Subject: [PATCH] tools: fix scan-build errors for unused variables All cases of value stored but never read --- src/tools/pw-cli.c | 1 - src/tools/pw-top.c | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/tools/pw-cli.c b/src/tools/pw-cli.c index f635ddd38..da89f7f4d 100644 --- a/src/tools/pw-cli.c +++ b/src/tools/pw-cli.c @@ -2093,7 +2093,6 @@ dump_properties(struct data *data, struct global *global, ind, item->key, item->value); extra = NULL; - id = -1; if (spa_streq(global->type, PW_TYPE_INTERFACE_Port) && spa_streq(item->key, PW_KEY_NODE_ID)) { id = atoi(item->value); if (id >= 0) diff --git a/src/tools/pw-top.c b/src/tools/pw-top.c index f38f1cc41..027ea7eaa 100644 --- a/src/tools/pw-top.c +++ b/src/tools/pw-top.c @@ -362,7 +362,6 @@ static void registry_event_global(void *data, uint32_t id, struct pw_proxy *proxy; if (spa_streq(type, PW_TYPE_INTERFACE_Node)) { - struct node *n; const char *str; if ((str = spa_dict_lookup(props, PW_KEY_NODE_NAME)) == NULL && @@ -370,7 +369,7 @@ static void registry_event_global(void *data, uint32_t id, str = spa_dict_lookup(props, PW_KEY_APP_NAME); } - if ((n = add_node(d, id, str)) == NULL) { + if (add_node(d, id, str) == NULL) { pw_log_warn("can add node %u: %m", id); } } else if (spa_streq(type, PW_TYPE_INTERFACE_Profiler)) {