chiark / gitweb /
Fix some format strings for enums, they are signed
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 22 Jan 2015 04:47:37 +0000 (23:47 -0500)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 22 Jan 2015 05:39:30 +0000 (00:39 -0500)
src/journal/journal-file.c
src/libsystemd/sd-bus/bus-control.c
src/libsystemd/sd-rtnl/rtnl-message.c
src/shared/util.h

index c1b54046f9af92eeeb8ebe60424fe4b789099df1..ec12e891a791a8d0b3b07f992b4bd21c350ef244 100644 (file)
@@ -323,7 +323,7 @@ static int journal_file_verify_header(JournalFile *f) {
                 } else if (state == STATE_ARCHIVED)
                         return -ESHUTDOWN;
                 else if (state != STATE_OFFLINE) {
-                        log_debug("Journal file %s has unknown state %u.", f->path, state);
+                        log_debug("Journal file %s has unknown state %i.", f->path, state);
                         return -EBUSY;
                 }
         }
@@ -2417,7 +2417,7 @@ void journal_file_dump(JournalFile *f) {
                         break;
 
                 default:
-                        printf("Type: unknown (%u)\n", o->object.type);
+                        printf("Type: unknown (%i)\n", o->object.type);
                         break;
                 }
 
index 5dd2307f535bbea9f3a17d53983998b70d5d3cf5..babfed8c2e66b643aa272c9336b7dcc18c6716d8 100644 (file)
@@ -1268,7 +1268,7 @@ int bus_add_match_internal_kernel(
                         if (c->type - BUS_MATCH_ARG < 3)
                                 name_change_arg[c->type - BUS_MATCH_ARG] = c->value_str;
 
-                        snprintf(buf, sizeof(buf), "arg%u", c->type - BUS_MATCH_ARG);
+                        snprintf(buf, sizeof(buf), "arg%i", c->type - BUS_MATCH_ARG);
                         bloom_add_pair(bloom, bus->bloom_size, bus->bloom_n_hash, buf, c->value_str);
                         using_bloom = true;
                         break;
@@ -1277,7 +1277,7 @@ int bus_add_match_internal_kernel(
                 case BUS_MATCH_ARG_PATH...BUS_MATCH_ARG_PATH_LAST: {
                         char buf[sizeof("arg")-1 + 2 + sizeof("-slash-prefix")];
 
-                        snprintf(buf, sizeof(buf), "arg%u-slash-prefix", c->type - BUS_MATCH_ARG_PATH);
+                        snprintf(buf, sizeof(buf), "arg%i-slash-prefix", c->type - BUS_MATCH_ARG_PATH);
                         bloom_add_pair(bloom, bus->bloom_size, bus->bloom_n_hash, buf, c->value_str);
                         using_bloom = true;
                         break;
@@ -1286,7 +1286,7 @@ int bus_add_match_internal_kernel(
                 case BUS_MATCH_ARG_NAMESPACE...BUS_MATCH_ARG_NAMESPACE_LAST: {
                         char buf[sizeof("arg")-1 + 2 + sizeof("-dot-prefix")];
 
-                        snprintf(buf, sizeof(buf), "arg%u-dot-prefix", c->type - BUS_MATCH_ARG_NAMESPACE);
+                        snprintf(buf, sizeof(buf), "arg%i-dot-prefix", c->type - BUS_MATCH_ARG_NAMESPACE);
                         bloom_add_pair(bloom, bus->bloom_size, bus->bloom_n_hash, buf, c->value_str);
                         using_bloom = true;
                         break;
index 06a7a4b83a7636bb19d53e6ddecc599e25c4550c..484613351d6d7de2c1267634e5d7fde8b83e311c 100644 (file)
@@ -1476,7 +1476,7 @@ int socket_read_message(sd_rtnl *rtnl) {
                 r = type_system_get_type(NULL, &nl_type, new_msg->nlmsg_type);
                 if (r < 0) {
                         if (r == -ENOTSUP)
-                                log_debug("sd-rtnl: ignored message with unknown type: %u",
+                                log_debug("sd-rtnl: ignored message with unknown type: %i",
                                           new_msg->nlmsg_type);
 
                         continue;
index fa16d5252431e4395e64010b760ec7157921902c..2d03ac8fd076a6854fc962e1f366a9d341a19bc5 100644 (file)
@@ -380,7 +380,7 @@ static inline uint32_t random_u32(void) {
                         if (!s)                                         \
                                 return log_oom();                       \
                 } else {                                                \
-                        r = asprintf(&s, "%u", i);                      \
+                        r = asprintf(&s, "%i", i);                      \
                         if (r < 0)                                      \
                                 return log_oom();                       \
                 }                                                       \