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

@ -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);