]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
more fixes for assertions on HP-UX/GCC
authorwessels <>
Thu, 14 Jan 1999 04:55:23 +0000 (04:55 +0000)
committerwessels <>
Thu, 14 Jan 1999 04:55:23 +0000 (04:55 +0000)
src/StatHist.cc

index 9fae2f261faf6a94222928fe10eedc019eb1cd41..d81dd6bcf697595a11c74234a0dfbd29fb3e32a7 100644 (file)
@@ -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;