avoid some useless assignments

This commit is contained in:
Wim Taymans 2020-05-20 13:52:10 +02:00
parent 4f60dcadc6
commit eb93f259e0
7 changed files with 10 additions and 13 deletions

View file

@ -107,7 +107,6 @@ int main(int argc, char *argv[])
{ {
pthread_t reader_thread, writer_thread; pthread_t reader_thread, writer_thread;
struct timespec ts; struct timespec ts;
int s;
printf("starting ringbuffer stress test\n"); printf("starting ringbuffer stress test\n");
@ -133,9 +132,9 @@ int main(int argc, char *argv[])
ts.tv_sec += 2; ts.tv_sec += 2;
while ((s = sem_timedwait(&sem, &ts)) == -1 && errno == EINTR) while (sem_timedwait(&sem, &ts) == -1 && errno == EINTR)
continue; continue;
while ((s = sem_timedwait(&sem, &ts)) == -1 && errno == EINTR) while (sem_timedwait(&sem, &ts) == -1 && errno == EINTR)
continue; continue;
printf("read %u, written %u\n", rb.readindex, rb.writeindex); printf("read %u, written %u\n", rb.readindex, rb.writeindex);

View file

@ -296,7 +296,7 @@ static void dbus_device_object_info(void *data, uint32_t id,
return; return;
remove_object(impl, obj); remove_object(impl, obj);
} else if (obj == NULL) { } else if (obj == NULL) {
if ((obj = create_object(impl, id, info)) == NULL) if (create_object(impl, id, info) == NULL)
return; return;
} else { } else {
update_object(impl, obj, info); update_object(impl, obj, info);

View file

@ -411,7 +411,7 @@ static void bluez5_enum_object_info(void *data, uint32_t id,
return; return;
bluez5_remove_device(impl, device); bluez5_remove_device(impl, device);
} else if (device == NULL) { } else if (device == NULL) {
if ((device = bluez5_create_device(impl, id, info)) == NULL) if (bluez5_create_device(impl, id, info) == NULL)
return; return;
} else { } else {
bluez5_update_device(impl, device, info); bluez5_update_device(impl, device, info);

View file

@ -425,7 +425,7 @@ static void v4l2_udev_object_info(void *data, uint32_t id,
return; return;
v4l2_remove_device(impl, dev); v4l2_remove_device(impl, dev);
} else if (dev == NULL) { } else if (dev == NULL) {
if ((dev = v4l2_create_device(impl, id, info)) == NULL) if (v4l2_create_device(impl, id, info) == NULL)
return; return;
} else { } else {
v4l2_update_device(impl, dev, info); v4l2_update_device(impl, dev, info);

View file

@ -721,7 +721,7 @@ on_param_changed (void *data, uint32_t id,
const struct spa_pod *params[2]; const struct spa_pod *params[2];
struct spa_pod_builder b = { NULL }; struct spa_pod_builder b = { NULL };
uint8_t buffer[512]; uint8_t buffer[512];
uint32_t buffers = buffers = CLAMP (16, pwsrc->min_buffers, pwsrc->max_buffers); uint32_t buffers = CLAMP (16, pwsrc->min_buffers, pwsrc->max_buffers);
spa_pod_builder_init (&b, buffer, sizeof (buffer)); spa_pod_builder_init (&b, buffer, sizeof (buffer));
params[0] = spa_pod_builder_add_object (&b, params[0] = spa_pod_builder_add_object (&b,

View file

@ -223,12 +223,11 @@ struct pw_impl_node *pw_adapter_new(struct pw_context *context,
if ((str = pw_properties_get(props, PW_KEY_NODE_ID)) != NULL) if ((str = pw_properties_get(props, PW_KEY_NODE_ID)) != NULL)
pw_properties_set(props, PW_KEY_NODE_SESSION, str); pw_properties_set(props, PW_KEY_NODE_SESSION, str);
if ((str = pw_properties_get(props, "factory.mode")) == NULL) { if (pw_properties_get(props, "factory.mode") == NULL) {
if (direction == PW_DIRECTION_INPUT) { if (direction == PW_DIRECTION_INPUT)
str = "merge"; str = "merge";
} else { else
str = "split"; str = "split";
}
pw_properties_set(props, "factory.mode", str); pw_properties_set(props, "factory.mode", str);
} }

View file

@ -82,7 +82,6 @@ static void on_process(void *userdata, struct spa_io_position *position)
struct spa_data *d; struct spa_data *d;
struct spa_pod *pod; struct spa_pod *pod;
struct spa_pod_control *c; struct spa_pod_control *c;
uint8_t *p;
uint64_t frame; uint64_t frame;
frame = data->clock_time; frame = data->clock_time;
@ -95,7 +94,7 @@ static void on_process(void *userdata, struct spa_io_position *position)
buf = b->buffer; buf = b->buffer;
d = &buf->datas[0]; d = &buf->datas[0];
if ((p = d->data) == NULL) if (d->data == NULL)
return; return;
if ((pod = spa_pod_from_data(d->data, d->maxsize, d->chunk->offset, d->chunk->size)) == NULL) if ((pod = spa_pod_from_data(d->data, d->maxsize, d->chunk->offset, d->chunk->size)) == NULL)