Source-Changes-HG archive

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

[src/trunk]: src/tests/lib/libpthread fix printf formats



details:   https://anonhg.NetBSD.org/src/rev/84cb57f6486d
branches:  trunk
changeset: 785757:84cb57f6486d
user:      christos <christos%NetBSD.org@localhost>
date:      Fri Mar 29 02:32:38 2013 +0000

description:
fix printf formats

diffstat:

 tests/lib/libpthread/t_condwait.c |  15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)

diffs (43 lines):

diff -r e03fd9062389 -r 84cb57f6486d tests/lib/libpthread/t_condwait.c
--- a/tests/lib/libpthread/t_condwait.c Fri Mar 29 02:30:18 2013 +0000
+++ b/tests/lib/libpthread/t_condwait.c Fri Mar 29 02:32:38 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: t_condwait.c,v 1.1 2013/03/28 18:50:01 christos Exp $ */
+/* $NetBSD: t_condwait.c,v 1.2 2013/03/29 02:32:38 christos Exp $ */
 
 /*
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -26,7 +26,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: t_condwait.c,v 1.1 2013/03/28 18:50:01 christos Exp $");
+__RCSID("$NetBSD: t_condwait.c,v 1.2 2013/03/29 02:32:38 christos Exp $");
 
 #include <errno.h>
 #include <pthread.h>
@@ -64,7 +64,8 @@
        to = ts;
 
        if (debug)
-               printf("started: %ld.%09ld sec\n", to.tv_sec, to.tv_nsec);
+               printf("started: %lld.%09ld sec\n", (long long)to.tv_sec,
+                   to.tv_nsec);
 
        ts.tv_sec += WAITTIME;  /* Timeout wait */
 
@@ -74,10 +75,10 @@
                ATF_REQUIRE_EQ(clock_gettime(clck, &te), 0);
                timespecsub(&te, &to, &to);
                if (debug) {
-                       printf("timeout: %ld.%09ld sec\n",
-                           te.tv_sec, te.tv_nsec);
-                       printf("elapsed: %ld.%09ld sec\n",
-                           to.tv_sec, to.tv_nsec);
+                       printf("timeout: %lld.%09ld sec\n",
+                           (long long)te.tv_sec, te.tv_nsec);
+                       printf("elapsed: %lld.%09ld sec\n",
+                           (long long)to.tv_sec, to.tv_nsec);
                }
                ATF_REQUIRE_EQ(to.tv_sec, WAITTIME);
                break;



Home | Main Index | Thread Index | Old Index