chiark / gitweb /
use correct format types
authorThomas Hindoe Paaboel Andersen <phomes@gmail.com>
Wed, 10 Dec 2014 19:24:18 +0000 (20:24 +0100)
committerThomas Hindoe Paaboel Andersen <phomes@gmail.com>
Thu, 11 Dec 2014 20:47:06 +0000 (21:47 +0100)
src/libsystemd-network/test-dhcp-option.c
src/libudev/libudev-device.c
src/login/loginctl.c
src/udev/cdrom_id/cdrom_id.c
src/udev/collect/collect.c

index eac3844..46c8c27 100644 (file)
@@ -344,7 +344,7 @@ static void test_option_set(void)
 
         for (i = 0; i < 9; i++) {
                 if (verbose)
-                        printf("%2d: 0x%02x(0x%02x) (options)\n", i, result->options[i],
+                        printf("%2u: 0x%02x(0x%02x) (options)\n", i, result->options[i],
                                options[i]);
                 assert_se(result->options[i] == options[i]);
         }
@@ -363,7 +363,7 @@ static void test_option_set(void)
 
         for (i = 0; i < pos - 8; i++) {
                 if (verbose)
-                        printf("%2d: 0x%02x(0x%02x) (sname)\n", i, result->sname[i],
+                        printf("%2u: 0x%02x(0x%02x) (sname)\n", i, result->sname[i],
                                options[i + 9]);
                 assert_se(result->sname[i] == options[i + 9]);
         }
index 16ee1f4..825a0e1 100644 (file)
@@ -139,7 +139,7 @@ static int udev_device_set_ifindex(struct udev_device *udev_device, int ifindex)
         char num[32];
 
         udev_device->ifindex = ifindex;
-        snprintf(num, sizeof(num), "%u", ifindex);
+        snprintf(num, sizeof(num), "%d", ifindex);
         udev_device_add_property(udev_device, "IFINDEX", num);
         return 0;
 }
index 6505eb8..6881edb 100644 (file)
@@ -423,7 +423,7 @@ static int print_session_status_info(sd_bus *bus, const char *path, bool *new_li
                 printf("\t    Seat: %s", i.seat);
 
                 if (i.vtnr > 0)
-                        printf("; vc%i", i.vtnr);
+                        printf("; vc%u", i.vtnr);
 
                 printf("\n");
         }
index 48ceb65..8a41c4f 100644 (file)
@@ -1063,17 +1063,17 @@ work:
         if (cd_media_state != NULL)
                 printf("ID_CDROM_MEDIA_STATE=%s\n", cd_media_state);
         if (cd_media_session_next > 0)
-                printf("ID_CDROM_MEDIA_SESSION_NEXT=%d\n", cd_media_session_next);
+                printf("ID_CDROM_MEDIA_SESSION_NEXT=%u\n", cd_media_session_next);
         if (cd_media_session_count > 0)
-                printf("ID_CDROM_MEDIA_SESSION_COUNT=%d\n", cd_media_session_count);
+                printf("ID_CDROM_MEDIA_SESSION_COUNT=%u\n", cd_media_session_count);
         if (cd_media_session_count > 1 && cd_media_session_last_offset > 0)
                 printf("ID_CDROM_MEDIA_SESSION_LAST_OFFSET=%llu\n", cd_media_session_last_offset);
         if (cd_media_track_count > 0)
-                printf("ID_CDROM_MEDIA_TRACK_COUNT=%d\n", cd_media_track_count);
+                printf("ID_CDROM_MEDIA_TRACK_COUNT=%u\n", cd_media_track_count);
         if (cd_media_track_count_audio > 0)
-                printf("ID_CDROM_MEDIA_TRACK_COUNT_AUDIO=%d\n", cd_media_track_count_audio);
+                printf("ID_CDROM_MEDIA_TRACK_COUNT_AUDIO=%u\n", cd_media_track_count_audio);
         if (cd_media_track_count_data > 0)
-                printf("ID_CDROM_MEDIA_TRACK_COUNT_DATA=%d\n", cd_media_track_count_data);
+                printf("ID_CDROM_MEDIA_TRACK_COUNT_DATA=%u\n", cd_media_track_count_data);
 exit:
         if (fd >= 0)
                 close(fd);
index 90df360..16675fb 100644 (file)
@@ -153,7 +153,7 @@ static int checkout(int fd)
                         if (!ptr && word < (buf + len)) {
                                 bufsize = bufsize << 1;
                                 if (debug)
-                                        fprintf(stderr, "ID overflow, restarting with size %zi\n", bufsize);
+                                        fprintf(stderr, "ID overflow, restarting with size %zu\n", bufsize);
                                 free(buf);
                                 lseek(fd, 0, SEEK_SET);
                                 goto restart;