From: serassio <> Date: Fri, 3 Jun 2005 21:00:55 +0000 (+0000) Subject: Use PRIu64 ISO C99 Standard printf() macro for 64 bit unsigned int X-Git-Tag: SQUID_3_0_PRE4~735 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e2b35d089fc2121adfd878c7479b1467f3e72b12;p=thirdparty%2Fsquid.git Use PRIu64 ISO C99 Standard printf() macro for 64 bit unsigned int instead of llu. This allow the correct formatting of 64 bit printf on some systems like native Windows. --- diff --git a/src/ProfStats.cc b/src/ProfStats.cc index da1fdbbca2..99643e8c13 100644 --- a/src/ProfStats.cc +++ b/src/ProfStats.cc @@ -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, diff --git a/src/squid.h b/src/squid.h index 644eadfd57..c6b9fafbab 100644 --- a/src/squid.h +++ b/src/squid.h @@ -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 */