Source-Changes-HG archive

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

[src/trunk]: src/lib/libperfuse Redo previous; remove all the casts I added,...



details:   https://anonhg.NetBSD.org/src/rev/3e87b31ed0d5
branches:  trunk
changeset: 772312:3e87b31ed0d5
user:      riz <riz%NetBSD.org@localhost>
date:      Thu Dec 29 04:25:49 2011 +0000

description:
Redo previous;  remove all the casts I added, and use PRI* macros instead.
(by popular demand - makes sense, too)

diffstat:

 lib/libperfuse/debug.c |  21 ++++++++++-----------
 1 files changed, 10 insertions(+), 11 deletions(-)

diffs (50 lines):

diff -r 47c4b51efd59 -r 3e87b31ed0d5 lib/libperfuse/debug.c
--- a/lib/libperfuse/debug.c    Thu Dec 29 01:40:32 2011 +0000
+++ b/lib/libperfuse/debug.c    Thu Dec 29 04:25:49 2011 +0000
@@ -1,4 +1,4 @@
-/*  $NetBSD: debug.c,v 1.7 2011/12/29 01:40:32 riz Exp $ */
+/*  $NetBSD: debug.c,v 1.8 2011/12/29 04:25:49 riz Exp $ */
 
 /*-
  *  Copyright (c) 2010 Emmanuel Dreyfus. All rights reserved.
@@ -159,9 +159,8 @@
        TAILQ_FOREACH(pt, &ps->ps_trace, pt_list) {
                const char *quote = pt->pt_path[0] != '\0' ? "\"" : "";
 
-               fprintf(fp, "%ju.%09jd %s %s%s%s %s ",  
-                       (intmax_t)pt->pt_start.tv_sec,
-                       (intmax_t)pt->pt_start.tv_nsec,
+               fprintf(fp, "%" PRIu64 ".%09ld %s %s%s%s %s ",  
+                       pt->pt_start.tv_sec, pt->pt_start.tv_nsec,
                        perfuse_opname(pt->pt_opcode),
                        quote, pt->pt_path, quote,
                        pt->pt_extra);
@@ -173,8 +172,8 @@
                        ts.tv_nsec = 0; /* delint */
                        timespecsub(&pt->pt_end, &pt->pt_start, &ts);
 
-                       fprintf(fp, "error = %d elapsed = %ju.%09lu ",
-                               pt->pt_error, (intmax_t)ts.tv_sec, ts.tv_nsec);
+                       fprintf(fp, "error = %d elapsed = %" PRIu64 ".%09lu ",
+                               pt->pt_error, ts.tv_sec, ts.tv_nsec);
 
                        count[pt->pt_opcode]++;
                        timespecadd(&ts_total[pt->pt_opcode],
@@ -207,12 +206,12 @@
                        min = 0;
                }
                        
-               fprintf(fp, "%s\t%d\t%jd.%09ld\t%jd.%09ld\t%jd.%09ld\t\n",
+               fprintf(fp, "%s\t%d\t%" PRId64 ".%09ld\t%" PRId64 
+                   ".%09ld\t%" PRId64 ".%09ld\t\n",
                        perfuse_opname(i), count[i],
-                       (intmax_t)min, ts_min[i].tv_nsec,
-                       (intmax_t)(avg / 1000000000L),
-                       (long)(avg % 1000000000L),
-                       (intmax_t)ts_max[i].tv_sec, ts_max[i].tv_nsec);
+                       min, ts_min[i].tv_nsec,
+                       (time_t)(avg / 1000000000L), (long)(avg % 1000000000L),
+                       ts_max[i].tv_sec, ts_max[i].tv_nsec);
        }       
        
        (void)fflush(fp);



Home | Main Index | Thread Index | Old Index