From: wessels <> Date: Thu, 14 Jan 1999 04:55:23 +0000 (+0000) Subject: more fixes for assertions on HP-UX/GCC X-Git-Tag: SQUID_3_0_PRE1~2410 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=853310e481f660434bca8a997f15f405ce9ac58e;p=thirdparty%2Fsquid.git more fixes for assertions on HP-UX/GCC --- diff --git a/src/StatHist.cc b/src/StatHist.cc index 9fae2f261f..d81dd6bcf6 100644 --- a/src/StatHist.cc +++ b/src/StatHist.cc @@ -1,6 +1,6 @@ /* - * $Id: StatHist.cc,v 1.21 1998/12/04 18:25:14 rousskov Exp $ + * $Id: StatHist.cc,v 1.22 1999/01/13 21:55:23 wessels Exp $ * * DEBUG: section 62 Generic Histogram * AUTHOR: Duane Wessels @@ -52,9 +52,15 @@ static void statHistInit(StatHist * H, int capacity, hbase_f * val_in, hbase_f * static int statHistBin(const StatHist * H, double v); static double statHistVal(const StatHist * H, int bin); static StatHistBinDumper statHistBinDumper; +#if !defined(_SQUID_HPUX_) || !defined(__GNUC__) + /* + * HP-UX and GCC (2.8?) give strange errors when these simple + * functions are static. + */ static hbase_f Log; static hbase_f Exp; static hbase_f Null; +#endif /* low level init, higher level functions has less params */ static void @@ -237,17 +243,25 @@ statHistDump(const StatHist * H, StoreEntry * sentry, StatHistBinDumper * bd) } /* log based histogram */ -static double +#if !defined(_SQUID_HPUX_) || !defined(__GNUC__) +static +#endif +double Log(double x) { assert((x + 1.0) >= 0.0); return log(x + 1.0); } -static double + +#if !defined(_SQUID_HPUX_) || !defined(__GNUC__) +static +#endif +double Exp(double x) { return exp(x) - 1.0; } + void statHistLogInit(StatHist * H, int capacity, double min, double max) { @@ -256,7 +270,10 @@ statHistLogInit(StatHist * H, int capacity, double min, double max) /* linear histogram for enums */ /* we want to be have [-1,last_enum+1] range to track out of range enums */ -static double +#if !defined(_SQUID_HPUX_) || !defined(__GNUC__) +static +#endif +double Null(double x) { return x;