avoid shadowing arguments
This commit is contained in:
parent
91f4e4d3c8
commit
d88e8edd11
|
@ -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)
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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++;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue