From: robertc <> Date: Fri, 17 Jan 2003 12:37:24 +0000 (+0000) Subject: create a math function specific file int.cc X-Git-Tag: SQUID_3_0_PRE1~456 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5f4918d310a65d7ed35682fd0778ff45834cc35e;p=thirdparty%2Fsquid.git create a math function specific file int.cc --- diff --git a/src/Makefile.am b/src/Makefile.am index 12ce03aa54..55d023cb15 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,7 +1,7 @@ # # Makefile for the Squid Object Cache server # -# $Id: Makefile.am,v 1.46 2003/01/17 05:17:07 robertc Exp $ +# $Id: Makefile.am,v 1.47 2003/01/17 05:37:24 robertc Exp $ # # Uncomment and customize the following to suit your needs: # @@ -179,6 +179,7 @@ squid_SOURCES = \ icp_v2.cc \ icp_v3.cc \ ident.cc \ + int.cc \ internal.cc \ ipc.cc \ ipcache.cc \ diff --git a/src/int.cc b/src/int.cc new file mode 100644 index 0000000000..17bdd1482a --- /dev/null +++ b/src/int.cc @@ -0,0 +1,44 @@ + +/* + * $Id: int.cc,v 1.1 2003/01/17 05:37:24 robertc Exp $ + * + * DEBUG: section 21 Integer functions + * AUTHOR: Harvest Derived + * + * SQUID Web Proxy Cache http://www.squid-cache.org/ + * ---------------------------------------------------------- + * + * Squid is the result of efforts by numerous individuals from + * the Internet community; see the CONTRIBUTORS file for full + * details. Many organizations have provided support for Squid's + * development; see the SPONSORS file for full details. Squid is + * Copyrighted (C) 2001 by the Regents of the University of + * California; see the COPYRIGHT file for full details. Squid + * incorporates software developed and/or copyrighted by other + * sources; see the CREDITS file for full details. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. + * + */ + +#include "squid.h" +int +isPowTen(int count) +{ + double x = log(count) / log(10.0); + if (0.0 != x - (double) (int) x) + return 0; + return 1; +} diff --git a/src/tools.cc b/src/tools.cc index 676403ab9c..96a9173342 100644 --- a/src/tools.cc +++ b/src/tools.cc @@ -1,6 +1,6 @@ /* - * $Id: tools.cc,v 1.227 2002/10/22 09:41:57 hno Exp $ + * $Id: tools.cc,v 1.228 2003/01/17 05:37:24 robertc Exp $ * * DEBUG: section 21 Misc Functions * AUTHOR: Harvest Derived @@ -933,20 +933,6 @@ stringHasCntl(const char *s) return 0; } -/* - * isPowTen returns true if its argument is an integer power of - * 10. Its used for logging of certain error messages that can - * occur often, but that we don't want to fill cache.log with. - */ -int -isPowTen(int count) -{ - double x = log(count) / log(10.0); - if (0.0 != x - (double) (int) x) - return 0; - return 1; -} - void parseEtcHosts(void) {