diff options
author | José Bollo <jose.bollo@iot.bzh> | 2016-03-16 16:05:28 +0100 |
---|---|---|
committer | José Bollo <jose.bollo@iot.bzh> | 2016-03-16 17:31:58 +0100 |
commit | 2c6fcae14552ab6e7addc82516617a135f86b5ca (patch) | |
tree | e6c8aff7b0fca5ef81c02bfb7c2d71ec6fc97046 /src/utils-jbus.c | |
parent | abfae2b6d73d7be40ffbff8e8429f71d82df90b5 (diff) |
cmake: improves error detection
Add detection of problem of cast.
The problems are corrected in the patch.
Change-Id: I8dc1e987531790860e390dea53ddf49d52339cb2
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
Diffstat (limited to 'src/utils-jbus.c')
-rw-r--r-- | src/utils-jbus.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/utils-jbus.c b/src/utils-jbus.c index 6d01b1e..9d6c1d5 100644 --- a/src/utils-jbus.c +++ b/src/utils-jbus.c @@ -86,7 +86,7 @@ struct jbus { char *name; int watchnr; int watchfd; - int watchflags; + short watchflags; }; /*********************** STATIC COMMON METHODS *****************/ @@ -407,12 +407,11 @@ static DBusHandlerResult incoming(DBusConnection *connection, DBusMessage *messa static void watchset(DBusWatch *watch, struct jbus *jbus) { unsigned int flags; - int wf, e; + short wf; flags = dbus_watch_get_flags(watch); - e = dbus_watch_get_enabled(watch); wf = jbus->watchflags; - if (e) { + if (dbus_watch_get_enabled(watch)) { if (flags & DBUS_WATCH_READABLE) wf |= POLLIN; if (flags & DBUS_WATCH_WRITABLE) @@ -721,7 +720,7 @@ int jbus_read_write_dispatch_multiple(struct jbus **jbuses, int njbuses, int tom errno = EINVAL; return -1; } - fds = alloca(njbuses * sizeof * fds); + fds = alloca((unsigned)njbuses * sizeof * fds); assert(fds != NULL); r = jbus_dispatch_multiple(jbuses, njbuses, maxcount); @@ -729,7 +728,7 @@ int jbus_read_write_dispatch_multiple(struct jbus **jbuses, int njbuses, int tom return r; n = jbus_fill_pollfds(jbuses, njbuses, fds); for(;;) { - s = poll(fds, n, toms); + s = poll(fds, (nfds_t)n, toms); if (s >= 0) break; if (errno != EINTR) |