diff --git a/src/pipewire/conf.c b/src/pipewire/conf.c index 50bb65980..70ebbd5d9 100644 --- a/src/pipewire/conf.c +++ b/src/pipewire/conf.c @@ -117,7 +117,7 @@ static int get_read_path(char *path, size_t size, const char *prefix, const char static int ensure_path(char *path, int size, const char *paths[]) { - int i, len, res, mode; + int i, len, mode; char *p = path; for (i = 0; paths[i] != NULL; i++) { @@ -134,14 +134,14 @@ static int ensure_path(char *path, int size, const char *paths[]) if (paths[i+1] == NULL) mode |= R_OK | W_OK; - if ((res = access(path, mode)) < 0) { + if (access(path, mode) < 0) { if (errno != ENOENT) return -errno; - if ((res = mkdir(path, 0700)) < 0) { + if (mkdir(path, 0700) < 0) { pw_log_info("Can't create directory %s: %m", path); return -errno; } - if ((res = access(path, mode)) < 0) + if (access(path, mode) < 0) return -errno; pw_log_info("created directory %s", path); diff --git a/src/pipewire/filter.c b/src/pipewire/filter.c index 9560ceb34..4137a9337 100644 --- a/src/pipewire/filter.c +++ b/src/pipewire/filter.c @@ -282,7 +282,7 @@ static struct port *alloc_port(struct filter *filter, int i; for (i = 0; i < MAX_PORTS; i++) { - if ((p = filter->ports[direction][i]) == NULL) + if ((filter->ports[direction][i]) == NULL) break; } if (i == MAX_PORTS) @@ -327,11 +327,10 @@ static inline int push_queue(struct port *port, struct queue *queue, struct buff static inline struct buffer *pop_queue(struct port *port, struct queue *queue) { - int32_t avail; uint32_t index, id; struct buffer *buffer; - if ((avail = spa_ringbuffer_get_read_index(&queue->ring, &index)) < 1) { + if (spa_ringbuffer_get_read_index(&queue->ring, &index) < 1) { errno = EPIPE; return NULL; } @@ -1436,7 +1435,6 @@ void *pw_filter_add_port(struct pw_filter *filter, struct filter *impl = SPA_CONTAINER_OF(filter, struct filter, this); struct port *p; const char *str; - int res; if (props == NULL) props = pw_properties_new(NULL, NULL); @@ -1461,7 +1459,7 @@ void *pw_filter_add_port(struct pw_filter *filter, add_control_dsp_port_params(impl, p); } /* then override with user provided if any */ - if ((res = update_params(impl, p, SPA_ID_INVALID, params, n_params)) < 0) + if (update_params(impl, p, SPA_ID_INVALID, params, n_params) < 0) goto error_free; p->change_mask_all = SPA_PORT_CHANGE_MASK_FLAGS | diff --git a/src/pipewire/impl-port.c b/src/pipewire/impl-port.c index 7b91da4bc..66763f6a0 100644 --- a/src/pipewire/impl-port.c +++ b/src/pipewire/impl-port.c @@ -922,7 +922,7 @@ int pw_impl_port_add(struct pw_impl_port *port, struct pw_impl_node *node) } pw_properties_set(port->properties, PW_KEY_PORT_DIRECTION, dir); - if ((str = pw_properties_get(port->properties, PW_KEY_PORT_NAME)) == NULL) { + if (pw_properties_get(port->properties, PW_KEY_PORT_NAME) == NULL) { if ((str = pw_properties_get(port->properties, PW_KEY_AUDIO_CHANNEL)) != NULL && !spa_streq(str, "UNK")) { pw_properties_setf(port->properties, PW_KEY_PORT_NAME, "%s_%s", dir, str); diff --git a/src/pipewire/pipewire.c b/src/pipewire/pipewire.c index b17c88245..15ce5fd6e 100644 --- a/src/pipewire/pipewire.c +++ b/src/pipewire/pipewire.c @@ -612,8 +612,7 @@ const char *pw_get_prgname(void) spa_memzero(prgname, sizeof(prgname)); #if defined(__linux__) || defined(__FreeBSD_kernel__) { - ssize_t len; - if ((len = readlink("/proc/self/exe", prgname, sizeof(prgname)-1)) > 0) + if (readlink("/proc/self/exe", prgname, sizeof(prgname)-1) > 0) return strrchr(prgname, '/') + 1; } #endif