]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Use PRIu64 ISO C99 Standard printf() macro for 64 bit unsigned int
authorserassio <>
Fri, 3 Jun 2005 21:00:55 +0000 (21:00 +0000)
committerserassio <>
Fri, 3 Jun 2005 21:00:55 +0000 (21:00 +0000)
instead of llu. This allow the correct formatting of 64 bit printf
on some systems like native Windows.

src/ProfStats.cc
src/squid.h

index da1fdbbca2ece9aadeed852d30c93ab03f959714..99643e8c1305e03286aab4dff3fd9a1bab464e8a 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: ProfStats.cc,v 1.5 2003/03/10 04:56:36 robertc Exp $
+ * $Id: ProfStats.cc,v 1.6 2005/06/03 15:00:55 serassio Exp $
  *
  * DEBUG: section 81     CPU Profiling Routines
  * AUTHOR: Andres Kroonmaa
@@ -111,7 +111,7 @@ static void
 xprof_show_item(StoreEntry * sentry, const char *name, xprof_stats_data * hist)
 {
     storeAppendPrintf(sentry,
-                      "%s\t %llu\t %llu\t %llu\t %llu\t %llu\t %.2f\t %6.3f\t\n",
+                      "%s\t %" PRIu64 "\t %" PRIu64 "\t %" PRIu64 "\t %" PRIu64 "\t %" PRIu64 "\t %.2f\t %6.3f\t\n",
                       name,
                       hist->count,
                       hist->summ,
@@ -141,7 +141,7 @@ xprof_summary_item(StoreEntry * sentry, char const *descr, TimersArray * list)
 
     storeAppendPrintf(sentry, "\n%s:", descr);
 
-    storeAppendPrintf(sentry, " (Cumulated time: %llu, %.2f sec)\n",
+    storeAppendPrintf(sentry, " (Cumulated time: %" PRIu64 ", %.2f sec)\n",
                       show->delta,
                       time_frame
                      );
@@ -236,7 +236,7 @@ xprof_summary(StoreEntry * sentry)
                       "  (CPU times are in arbitrary units, most probably in CPU clock ticks)\n");
     storeAppendPrintf(sentry,
                       "Probe Name\t Event Count\t last Interval \t Avg Interval \t since squid start \t (since system boot) \n");
-    storeAppendPrintf(sentry, "Total\t %lu\t %llu \t %llu \t %llu \t %llu\n",
+    storeAppendPrintf(sentry, "Total\t %lu\t %" PRIu64 " \t %" PRIu64 " \t %" PRIu64 " \t %" PRIu64 "\n",
                       (long unsigned) xprof_events,
                       xprof_delta,
                       xprof_average_delta,
index 644eadfd57011bc437b4aca89f7e455038773095..c6b9fafbabf91e7d6449ff1d9c9f75fb45b92528 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: squid.h,v 1.245 2005/01/06 13:16:39 serassio Exp $
+ * $Id: squid.h,v 1.246 2005/06/03 15:00:55 serassio Exp $
  *
  * AUTHOR: Duane Wessels
  *
@@ -468,4 +468,12 @@ void free(V x) { fatal("Do not use ::free()"); }
 #define IPPROTO_TCP 0
 #endif
 
+#ifndef PRIu64 /* ISO C99 Standard printf() macro for 64 bit unsigned int */
+#ifdef _SQUID_MSWIN_ /* Windows native port using MSVCRT */
+#define PRIu64 "I64u"
+#else
+#define PRIu64 "llu"
+#endif /* _SQUID_MSWIN_ */
+#endif /* PRIu64 */
+
 #endif /* SQUID_H */