]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
libuuid: signedness/type fixes
authorMatthias Andree <matthias.andree@gmx.de>
Sat, 17 Aug 2019 11:16:02 +0000 (13:16 +0200)
committerTheodore Ts'o <tytso@mit.edu>
Sun, 18 Aug 2019 23:09:48 +0000 (19:09 -0400)
Signed-off-by: Matthias Andree <matthias.andree@gmx.de>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
lib/uuid/gen_uuid.c
lib/uuid/tst_uuid.c
lib/uuid/uuid_time.c

index 01983634256cf30ec6a0cda1fa1ace5a05144e51..89179b6eaa904c74b288d923d22ae52eab11b350 100644 (file)
@@ -408,8 +408,8 @@ try_again:
                rewind(state_f);
                len = fprintf(state_f,
                              "clock: %04x tv: %016lu %08lu adj: %08d\n",
-                             clock_seq, last.tv_sec, (long)last.tv_usec,
-                             adjustment);
+                             clock_seq, (unsigned long)last.tv_sec,
+                             (unsigned long)last.tv_usec, adjustment);
                fflush(state_f);
                if (ftruncate(state_fd, len) < 0) {
                        fprintf(state_f, "                   \n");
index 88d928fe939c4563f12937931d4dcd636718dd06..649bfbc0581528eb0476eaa05831a68cd037c021 100644 (file)
@@ -144,7 +144,8 @@ main(int argc ATTR((unused)) , char **argv ATTR((unused)))
        tv.tv_usec = 0;
        time_reg = uuid_time(buf, &tv);
        printf("UUID generated at %lu reports %lu (%ld.%ld)\n",
-              time_gen, time_reg, tv.tv_sec, (long)tv.tv_usec);
+              (unsigned long)time_gen, (unsigned long)time_reg,
+              (long)tv.tv_sec, (long)tv.tv_usec);
        /* allow 1s margin in case of rollover between sampling
         * the current time and when the UUID is generated. */
        if (time_reg > time_gen + 1) {
index 97fd33588276b0543278af2e4357ccd3ae661ea5..af837a2ca3739be62b03db8ab19b78046bfe2ba2 100644 (file)
@@ -165,7 +165,7 @@ main(int argc, char **argv)
                printf("Warning: not a time-based UUID, so UUID time "
                       "decoding will likely not work!\n");
        }
-       printf("UUID time is: (%ld, %ld): %s\n", tv.tv_sec, (long)tv.tv_usec,
+       printf("UUID time is: (%ld, %ld): %s\n", (long)tv.tv_sec, (long)tv.tv_usec,
               ctime(&time_reg));
 
        return 0;