Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/bin/sleep cast to intmax_t instead of long, since time_t is ...



details:   https://anonhg.NetBSD.org/src/rev/46db5def6b87
branches:  trunk
changeset: 447853:46db5def6b87
user:      christos <christos%NetBSD.org@localhost>
date:      Sun Jan 27 02:00:45 2019 +0000

description:
cast to intmax_t instead of long, since time_t is "long long"

diffstat:

 bin/sleep/sleep.c |  14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diffs (40 lines):

diff -r 248bca59da9b -r 46db5def6b87 bin/sleep/sleep.c
--- a/bin/sleep/sleep.c Sun Jan 27 01:51:50 2019 +0000
+++ b/bin/sleep/sleep.c Sun Jan 27 02:00:45 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sleep.c,v 1.28 2019/01/26 18:14:22 martin Exp $ */
+/* $NetBSD: sleep.c,v 1.29 2019/01/27 02:00:45 christos Exp $ */
 
 /*
  * Copyright (c) 1988, 1993, 1994
@@ -39,7 +39,7 @@
 #if 0
 static char sccsid[] = "@(#)sleep.c    8.3 (Berkeley) 4/2/94";
 #else
-__RCSID("$NetBSD: sleep.c,v 1.28 2019/01/26 18:14:22 martin Exp $");
+__RCSID("$NetBSD: sleep.c,v 1.29 2019/01/27 02:00:45 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -197,16 +197,16 @@
 {
        if (remain == 0)
                warnx("In the final moments of the original"
-                   " %ld%s second%s", (long)original, msg,
+                   " %jd%s second%s", (intmax_t)original, msg,
                    original == 1 && *msg == '\0' ? "" : "s");
        else if (remain < 2000)
-               warnx("Between %ld and %ld seconds left"
+               warnx("Between %jd and %jd seconds left"
                    " out of the original %g%s",
-                   (long)remain, (long)remain + 1, (double)original,
+                   (intmax_t)remain, (intmax_t)remain + 1, (double)original,
                    msg);
        else if ((original - remain) < 100000 && (original-remain) < original/8)
-               warnx("Have waited only %d seconds of the original %g",
-                       (int)(original - remain), (double)original);
+               warnx("Have waited only %jd seconds of the original %g",
+                       (intmax_t)(original - remain), (double)original);
        else
                warnx("Approximately %g seconds left out of the original %g",
                        (double)remain, (double)original);



Home | Main Index | Thread Index | Old Index