fix some compiler warnings with clang

This commit is contained in:
Wim Taymans 2019-02-06 11:35:36 +01:00
parent 317f3b6be7
commit e4cac644d2
20 changed files with 67 additions and 46 deletions

View file

@ -51,6 +51,8 @@ enum spa_direction {
SPA_DIRECTION_OUTPUT = 1,
};
#define SPA_DIRECTION_REVERSE(d) ((d) ^ 1)
#define SPA_RECTANGLE(width,height) (struct spa_rectangle){ width, height }
struct spa_rectangle {
uint32_t width;

View file

@ -101,7 +101,7 @@ static inline void spa_hook_remove(struct spa_hook *hook)
({ \
struct spa_hook_list *list = l; \
struct spa_list *s = start ? (struct spa_list *)start : &list->list; \
struct spa_hook cursor = { 0 }, *ci; \
struct spa_hook cursor = { { 0} }, *ci; \
int count = 0; \
spa_list_cursor_start(cursor, s, link); \
spa_list_for_each_cursor(ci, cursor, &list->list, link) { \

View file

@ -1215,7 +1215,7 @@ impl_init(const struct spa_handle_factory *factory,
}
init_type(&this->type, this->map);
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

@ -299,7 +299,7 @@ impl_get_connection(struct spa_dbus *dbus,
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

@ -566,10 +566,12 @@ static void run_async_source(struct data *data)
int main(int argc, char *argv[])
{
struct data data = { 0 };
struct data data;
int res;
const char *str;
spa_zero(data);
data.use_buffer = true;
data.map = &default_map.map;

View file

@ -261,13 +261,15 @@ static void do_remove_source(struct spa_source *source)
int main(int argc, char *argv[])
{
struct data data = { 0 };
struct data data;
int res;
void *handle;
spa_handle_factory_enum_func_t enum_func;
uint32_t index;
const char *str;
spa_zero(data);
if (argc < 2) {
printf("usage: %s <plugin.so>\n", argv[0]);
return -1;

View file

@ -163,12 +163,14 @@ static void handle_monitor(struct data *data, struct spa_monitor *monitor)
int main(int argc, char *argv[])
{
struct data data = { 0 };
struct data data;
int res;
void *handle;
spa_handle_factory_enum_func_t enum_func;
uint32_t fidx;
spa_zero(data);
data.map = &default_map.map;
data.log = &default_log.log;
data.main_loop.version = SPA_VERSION_LOOP;