Fix some -Wenum-conversion errors

Make pw_direction and spa_direction the same
Explicitly cast some enums or use the right enums
This commit is contained in:
Wim Taymans 2020-04-04 19:59:27 +02:00
parent 6937ec5e63
commit a5b0553328
6 changed files with 8 additions and 9 deletions

View file

@ -559,7 +559,7 @@ static void source_callback(struct source_data *d)
pa_source_info i;
pa_format_info ii[1];
pa_format_info *ip[1];
enum pa_sink_flags flags;
enum pa_source_flags flags;
flags = PA_SOURCE_LATENCY | PA_SOURCE_DYNAMIC_LATENCY |
PA_SOURCE_DECIBEL_VOLUME;

View file

@ -2259,7 +2259,7 @@ impl_init(const struct spa_handle_factory *factory,
return -EINVAL;
}
this->dbus_connection = spa_dbus_get_connection(this->dbus, DBUS_BUS_SYSTEM);
this->dbus_connection = spa_dbus_get_connection(this->dbus, SPA_DBUS_TYPE_SYSTEM);
if (this->dbus_connection == NULL) {
spa_log_error(this->log, "no dbus connection");
return -EIO;

View file

@ -294,7 +294,7 @@ impl_get_connection(void *object,
conn = calloc(1, sizeof(struct connection));
conn->this = impl_connection;
conn->impl = impl;
conn->conn = dbus_bus_get_private(type, &error);
conn->conn = dbus_bus_get_private((DBusBusType)type, &error);
if (conn->conn == NULL)
goto error;

View file

@ -1828,7 +1828,7 @@ int main(int argc, char *argv[])
impl.dbus = spa_support_find(support, n_support, SPA_TYPE_INTERFACE_DBus);
if (impl.dbus)
impl.this.dbus_connection = spa_dbus_get_connection(impl.dbus, DBUS_BUS_SESSION);
impl.this.dbus_connection = spa_dbus_get_connection(impl.dbus, SPA_DBUS_TYPE_SESSION);
if (impl.this.dbus_connection == NULL)
pw_log_warn("no dbus connection");
else

View file

@ -1434,7 +1434,7 @@ int pw_filter_set_error(struct pw_filter *filter,
if (filter->proxy)
pw_proxy_error(filter->proxy, res, value);
filter_set_state(filter, PW_STREAM_STATE_ERROR, value);
filter_set_state(filter, PW_FILTER_STATE_ERROR, value);
va_end(args);
free(value);
}

View file

@ -44,10 +44,9 @@ extern "C" {
struct pw_port;
/** \enum pw_direction The direction of a port \memberof pw_introspect */
enum pw_direction {
PW_DIRECTION_INPUT = SPA_DIRECTION_INPUT, /**< an input port direction */
PW_DIRECTION_OUTPUT = SPA_DIRECTION_OUTPUT /**< an output port direction */
};
#define pw_direction spa_direction
#define PW_DIRECTION_INPUT SPA_DIRECTION_INPUT
#define PW_DIRECTION_OUTPUT SPA_DIRECTION_OUTPUT
/** Convert a \ref pw_direction to a readable string \memberof pw_introspect */
const char * pw_direction_as_string(enum pw_direction direction);