From d88e8edd1125904233061bdeb06ba3d0d78bce6b Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Tue, 6 Jul 2021 17:55:16 +0200 Subject: [PATCH] avoid shadowing arguments --- pipewire-alsa/alsa-plugins/ctl_pipewire.c | 10 +++++----- spa/plugins/alsa/alsa-acp-device.c | 14 +++++++------- spa/plugins/alsa/alsa-pcm-device.c | 6 +++--- spa/plugins/bluez5/bluez5-dbus.c | 6 +++--- spa/plugins/bluez5/bluez5-device.c | 10 +++++----- spa/plugins/jack/jack-device.c | 6 +++--- src/modules/module-protocol-pulse/collect.c | 6 +++--- src/modules/module-protocol-pulse/manager.c | 4 ++-- src/modules/module-protocol-pulse/server.c | 12 ++++++------ 9 files changed, 37 insertions(+), 37 deletions(-) diff --git a/pipewire-alsa/alsa-plugins/ctl_pipewire.c b/pipewire-alsa/alsa-plugins/ctl_pipewire.c index a5ef4bc0e..bc804e9b2 100644 --- a/pipewire-alsa/alsa-plugins/ctl_pipewire.c +++ b/pipewire-alsa/alsa-plugins/ctl_pipewire.c @@ -859,14 +859,14 @@ static void device_event_param(void *object, int seq, switch (id) { case SPA_PARAM_Route: { - uint32_t index, device; + uint32_t idx, device; enum spa_direction direction; struct spa_pod *props = NULL; struct global *ng; if (spa_pod_parse_object(param, SPA_TYPE_OBJECT_ParamRoute, NULL, - SPA_PARAM_ROUTE_index, SPA_POD_Int(&index), + SPA_PARAM_ROUTE_index, SPA_POD_Int(&idx), SPA_PARAM_ROUTE_direction, SPA_POD_Id(&direction), SPA_PARAM_ROUTE_device, SPA_POD_Int(&device), SPA_PARAM_ROUTE_props, SPA_POD_OPT_Pod(&props)) < 0) { @@ -874,13 +874,13 @@ static void device_event_param(void *object, int seq, return; } if (direction == SPA_DIRECTION_OUTPUT) - g->device.active_route_output = index; + g->device.active_route_output = idx; else - g->device.active_route_input = index; + g->device.active_route_input = idx; pw_log_debug("device %d: active %s route %d", g->id, direction == SPA_DIRECTION_OUTPUT ? "output" : "input", - index); + idx); ng = find_node_for_route(ctl, g->id, device); if (props && ng) diff --git a/spa/plugins/alsa/alsa-acp-device.c b/spa/plugins/alsa/alsa-acp-device.c index 58bd3af91..bba035fbf 100644 --- a/spa/plugins/alsa/alsa-acp-device.c +++ b/spa/plugins/alsa/alsa-acp-device.c @@ -634,28 +634,28 @@ static int impl_set_param(void *object, switch (id) { case SPA_PARAM_Profile: { - uint32_t id; + uint32_t idx; bool save = false; if (param == NULL) { - id = acp_card_find_best_profile_index(this->card, NULL); + idx = acp_card_find_best_profile_index(this->card, NULL); save = true; } else if ((res = spa_pod_parse_object(param, SPA_TYPE_OBJECT_ParamProfile, NULL, - SPA_PARAM_PROFILE_index, SPA_POD_Int(&id), + SPA_PARAM_PROFILE_index, SPA_POD_Int(&idx), SPA_PARAM_PROFILE_save, SPA_POD_OPT_Bool(&save))) < 0) { spa_log_warn(this->log, "can't parse profile"); spa_debug_pod(0, NULL, param); return res; } - acp_card_set_profile(this->card, id, save ? ACP_PROFILE_SAVE : 0); + acp_card_set_profile(this->card, idx, save ? ACP_PROFILE_SAVE : 0); emit_info(this, false); break; } case SPA_PARAM_Route: { - uint32_t id, device; + uint32_t idx, device; struct spa_pod *props = NULL; struct acp_device *dev; bool save = false; @@ -665,7 +665,7 @@ static int impl_set_param(void *object, if ((res = spa_pod_parse_object(param, SPA_TYPE_OBJECT_ParamRoute, NULL, - SPA_PARAM_ROUTE_index, SPA_POD_Int(&id), + SPA_PARAM_ROUTE_index, SPA_POD_Int(&idx), SPA_PARAM_ROUTE_device, SPA_POD_Int(&device), SPA_PARAM_ROUTE_props, SPA_POD_OPT_Pod(&props), SPA_PARAM_ROUTE_save, SPA_POD_OPT_Bool(&save))) < 0) { @@ -677,7 +677,7 @@ static int impl_set_param(void *object, return -EINVAL; dev = this->card->devices[device]; - acp_device_set_port(dev, id, save ? ACP_PORT_SAVE : 0); + acp_device_set_port(dev, idx, save ? ACP_PORT_SAVE : 0); if (props) apply_device_props(this, dev, props); emit_info(this, false); diff --git a/spa/plugins/alsa/alsa-pcm-device.c b/spa/plugins/alsa/alsa-pcm-device.c index dde4db4ba..e1d6b2a3b 100644 --- a/spa/plugins/alsa/alsa-pcm-device.c +++ b/spa/plugins/alsa/alsa-pcm-device.c @@ -457,17 +457,17 @@ static int impl_set_param(void *object, switch (id) { case SPA_PARAM_Profile: { - uint32_t id; + uint32_t idx; if ((res = spa_pod_parse_object(param, SPA_TYPE_OBJECT_ParamProfile, NULL, - SPA_PARAM_PROFILE_index, SPA_POD_Int(&id))) < 0) { + SPA_PARAM_PROFILE_index, SPA_POD_Int(&idx))) < 0) { spa_log_warn(this->log, "can't parse profile"); spa_debug_pod(0, NULL, param); return res; } - set_profile(this, id); + set_profile(this, idx); break; } default: diff --git a/spa/plugins/bluez5/bluez5-dbus.c b/spa/plugins/bluez5/bluez5-dbus.c index a8b39c3f6..eb9f82f96 100644 --- a/spa/plugins/bluez5/bluez5-dbus.c +++ b/spa/plugins/bluez5/bluez5-dbus.c @@ -2693,11 +2693,11 @@ static DBusHandlerResult endpoint_set_configuration(DBusConnection *conn, is_new = transport == NULL; if (is_new) { - char *path = strdup(transport_path); + char *tpath = strdup(transport_path); - transport = spa_bt_transport_create(monitor, path, 0); + transport = spa_bt_transport_create(monitor, tpath, 0); if (transport == NULL) { - free(path); + free(tpath); return DBUS_HANDLER_RESULT_NEED_MEMORY; } diff --git a/spa/plugins/bluez5/bluez5-device.c b/spa/plugins/bluez5/bluez5-device.c index 47041c0b3..b870e1f9c 100644 --- a/spa/plugins/bluez5/bluez5-device.c +++ b/spa/plugins/bluez5/bluez5-device.c @@ -1713,7 +1713,7 @@ static int impl_set_param(void *object, switch (id) { case SPA_PARAM_Profile: { - uint32_t id, next; + uint32_t idx, next; uint32_t profile; enum spa_bluetooth_audio_codec codec; @@ -1722,13 +1722,13 @@ static int impl_set_param(void *object, if ((res = spa_pod_parse_object(param, SPA_TYPE_OBJECT_ParamProfile, NULL, - SPA_PARAM_PROFILE_index, SPA_POD_Int(&id))) < 0) { + SPA_PARAM_PROFILE_index, SPA_POD_Int(&idx))) < 0) { spa_log_warn(this->log, "can't parse profile"); spa_debug_pod(0, NULL, param); return res; } - profile = get_profile_from_index(this, id, &next, &codec); + profile = get_profile_from_index(this, idx, &next, &codec); if (profile == SPA_ID_INVALID) return -EINVAL; @@ -1737,7 +1737,7 @@ static int impl_set_param(void *object, } case SPA_PARAM_Route: { - uint32_t id, device; + uint32_t idx, device; struct spa_pod *props = NULL; struct node *node; bool save = false; @@ -1747,7 +1747,7 @@ static int impl_set_param(void *object, if ((res = spa_pod_parse_object(param, SPA_TYPE_OBJECT_ParamRoute, NULL, - SPA_PARAM_ROUTE_index, SPA_POD_Int(&id), + SPA_PARAM_ROUTE_index, SPA_POD_Int(&idx), SPA_PARAM_ROUTE_device, SPA_POD_Int(&device), SPA_PARAM_ROUTE_props, SPA_POD_OPT_Pod(&props), SPA_PARAM_ROUTE_save, SPA_POD_OPT_Bool(&save))) < 0) { diff --git a/spa/plugins/jack/jack-device.c b/spa/plugins/jack/jack-device.c index d4e14d42f..fa4ccc2db 100644 --- a/spa/plugins/jack/jack-device.c +++ b/spa/plugins/jack/jack-device.c @@ -331,16 +331,16 @@ static int impl_set_param(void *object, switch (id) { case SPA_PARAM_Profile: { - uint32_t id; + uint32_t idx; if ((res = spa_pod_parse_object(param, SPA_TYPE_OBJECT_ParamProfile, NULL, - SPA_PARAM_PROFILE_index, SPA_POD_Int(&id))) < 0) { + SPA_PARAM_PROFILE_index, SPA_POD_Int(&idx))) < 0) { spa_log_warn(this->log, "can't parse profile"); spa_debug_pod(0, NULL, param); return res; } - activate_profile(this, id); + activate_profile(this, idx); break; } default: diff --git a/src/modules/module-protocol-pulse/collect.c b/src/modules/module-protocol-pulse/collect.c index 2fc3ef948..2ae92b5b4 100644 --- a/src/modules/module-protocol-pulse/collect.c +++ b/src/modules/module-protocol-pulse/collect.c @@ -238,7 +238,7 @@ void collect_device_info(struct pw_manager_object *device, struct pw_manager_obj if (card && !monitor) { spa_list_for_each(p, &card->param_list, link) { - uint32_t id, device; + uint32_t id, dev; struct spa_pod *props; if (p->id != SPA_PARAM_Route) @@ -247,10 +247,10 @@ void collect_device_info(struct pw_manager_object *device, struct pw_manager_obj if (spa_pod_parse_object(p->param, SPA_TYPE_OBJECT_ParamRoute, NULL, SPA_PARAM_ROUTE_index, SPA_POD_Int(&id), - SPA_PARAM_ROUTE_device, SPA_POD_Int(&device), + SPA_PARAM_ROUTE_device, SPA_POD_Int(&dev), SPA_PARAM_ROUTE_props, SPA_POD_OPT_Pod(&props)) < 0) continue; - if (device != dev_info->device) + if (dev != dev_info->device) continue; dev_info->active_port = id; if (props) { diff --git a/src/modules/module-protocol-pulse/manager.c b/src/modules/module-protocol-pulse/manager.c index 264eb59ab..c26f2bba6 100644 --- a/src/modules/module-protocol-pulse/manager.c +++ b/src/modules/module-protocol-pulse/manager.c @@ -375,10 +375,10 @@ static void device_event_param(void *object, int seq, return; if (id == SPA_PARAM_Route && !has_param(&o->this.param_list, p)) { - uint32_t id, device; + uint32_t idx, device; if (spa_pod_parse_object(param, SPA_TYPE_OBJECT_ParamRoute, NULL, - SPA_PARAM_ROUTE_index, SPA_POD_Int(&id), + SPA_PARAM_ROUTE_index, SPA_POD_Int(&idx), SPA_PARAM_ROUTE_device, SPA_POD_Int(&device)) < 0) return; diff --git a/src/modules/module-protocol-pulse/server.c b/src/modules/module-protocol-pulse/server.c index e54f8c037..6d849f512 100644 --- a/src/modules/module-protocol-pulse/server.c +++ b/src/modules/module-protocol-pulse/server.c @@ -305,9 +305,9 @@ on_client_data(void *data, int fd, uint32_t mask) client->need_flush = false; res = client_flush_messages(client); if (res >= 0) { - int mask = client->source->mask; - SPA_FLAG_CLEAR(mask, SPA_IO_OUT); - pw_loop_update_io(impl->loop, client->source, mask); + int m = client->source->mask; + SPA_FLAG_CLEAR(m, SPA_IO_OUT); + pw_loop_update_io(impl->loop, client->source, m); } else if (res != -EAGAIN && res != -EWOULDBLOCK) goto error; } @@ -361,9 +361,9 @@ on_connect(void *data, int fd, uint32_t mask) if (client_fd < 0) { if (errno == EMFILE || errno == ENFILE) { if (server->n_clients > 0) { - int mask = server->source->mask; - SPA_FLAG_CLEAR(mask, SPA_IO_IN); - pw_loop_update_io(impl->loop, server->source, mask); + int m = server->source->mask; + SPA_FLAG_CLEAR(m, SPA_IO_IN); + pw_loop_update_io(impl->loop, server->source, m); server->wait_clients++; } }