chiark / gitweb /
consistently use "int" when retrieving "bool" from bus messages
authorKay Sievers <kay@vrfy.org>
Thu, 7 Nov 2013 01:03:10 +0000 (02:03 +0100)
committerKay Sievers <kay@vrfy.org>
Thu, 7 Nov 2013 01:05:57 +0000 (02:05 +0100)
src/hostname/hostnamed.c
src/libsystemd-bus/bus-message.c
src/libsystemd-bus/bus-util.c
src/locale/localed.c
src/timedate/timedated.c

index 0854bc4..35dccf8 100644 (file)
@@ -371,7 +371,7 @@ static int method_set_hostname(sd_bus *bus, sd_bus_message *m, void *userdata) {
         _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL;
         Context *c = userdata;
         const char *name;
-        unsigned interactive;
+        int interactive;
         char *h;
         int r;
 
@@ -421,7 +421,7 @@ static int method_set_static_hostname(sd_bus *bus, sd_bus_message *m, void *user
         _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL;
         Context *c = userdata;
         const char *name;
-        unsigned interactive;
+        int interactive;
         int r;
 
         r = sd_bus_message_read(m, "sb", &name, &interactive);
@@ -472,7 +472,7 @@ static int method_set_static_hostname(sd_bus *bus, sd_bus_message *m, void *user
 
 static int set_machine_info(Context *c, sd_bus *bus, sd_bus_message *m, int prop, sd_bus_message_handler_t cb) {
         _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL;
-        unsigned interactive;
+        int interactive;
         const char *name;
         int r;
 
index 67f7d58..9543ae3 100644 (file)
@@ -2669,7 +2669,7 @@ _public_ int sd_bus_message_read_basic(sd_bus_message *m, char type, void *p) {
 
                 case SD_BUS_TYPE_BOOLEAN:
                         if (p)
-                                *(unsigned*) p = !!*(uint32_t*) q;
+                                *(int*) p = !!*(uint32_t*) q;
                         break;
 
                 case SD_BUS_TYPE_INT16:
index 3bb1fb7..13ad444 100644 (file)
@@ -151,7 +151,7 @@ int bus_verify_polkit(
 #ifdef ENABLE_POLKIT
         else {
                 _cleanup_bus_message_unref_ sd_bus_message *reply = NULL;
-                unsigned authorized = false, challenge = false;
+                int authorized = false, challenge = false;
 
                 r = sd_bus_call_method(
                                 bus,
@@ -270,7 +270,7 @@ int bus_verify_polkit_async(
 #ifdef ENABLE_POLKIT
         q = hashmap_remove(*registry, m);
         if (q) {
-                unsigned authorized, challenge;
+                int authorized, challenge;
 
                 /* This is the second invocation of this function, and
                  * there's already a response from polkit, let's
index 61a3015..744d304 100644 (file)
@@ -908,7 +908,7 @@ static int method_set_vc_keyboard(sd_bus *bus, sd_bus_message *m, void *userdata
         Context *c = userdata;
         _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL;
         const char *keymap, *keymap_toggle;
-        unsigned convert, interactive;
+        int convert, interactive;
         int r;
 
         r = sd_bus_message_read(m, "ssbb", &keymap, &keymap_toggle, &convert, &interactive);
@@ -971,7 +971,7 @@ static int method_set_x11_keyboard(sd_bus *bus, sd_bus_message *m, void *userdat
         Context *c = userdata;
         _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL;
         const char *layout, *model, *variant, *options;
-        unsigned convert, interactive;
+        int convert, interactive;
         int r;
 
         r = sd_bus_message_read(m, "ssssbb", &layout, &model, &variant, &options, &convert, &interactive);
index f5d2201..163b276 100644 (file)
@@ -523,7 +523,7 @@ static int method_set_timezone(sd_bus *bus, sd_bus_message *m, void *userdata) {
         _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL;
         Context *c = userdata;
         const char *z;
-        unsigned interactive;
+        int interactive;
         char *t;
         int r;
 
@@ -587,7 +587,7 @@ static int method_set_timezone(sd_bus *bus, sd_bus_message *m, void *userdata) {
 
 static int method_set_local_rtc(sd_bus *bus, sd_bus_message *m, void *userdata) {
         _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL;
-        unsigned lrtc, fix_system, interactive;
+        int lrtc, fix_system, interactive;
         Context *c = userdata;
         struct timespec ts;
         int r;
@@ -671,7 +671,7 @@ static int method_set_local_rtc(sd_bus *bus, sd_bus_message *m, void *userdata)
 
 static int method_set_time(sd_bus *bus, sd_bus_message *m, void *userdata) {
         _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL;
-        unsigned relative, interactive;
+        int relative, interactive;
         Context *c = userdata;
         int64_t utc;
         struct timespec ts;
@@ -737,7 +737,7 @@ static int method_set_time(sd_bus *bus, sd_bus_message *m, void *userdata) {
 
 static int method_set_ntp(sd_bus *bus, sd_bus_message *m, void *userdata) {
         _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL;
-        unsigned ntp, interactive;
+        int ntp, interactive;
         Context *c = userdata;
         int r;
 
@@ -745,7 +745,7 @@ static int method_set_ntp(sd_bus *bus, sd_bus_message *m, void *userdata) {
         if (r < 0)
                 return sd_bus_reply_method_errno(bus, m, r, NULL);
 
-        if (ntp == c->use_ntp)
+        if ((bool)ntp == c->use_ntp)
                 return sd_bus_reply_method_return(bus, m, NULL);
 
         r = bus_verify_polkit_async(bus, &c->polkit_registry, m, "org.freedesktop.timedate1.set-ntp", interactive, &error, method_set_ntp, c);