From: hno <> Date: Thu, 18 Oct 2001 01:46:43 +0000 (+0000) Subject: Some warning fixes X-Git-Tag: SQUID_3_0_PRE1~1344 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e016fecfd3c2e5b8a36b1f8227c0dec0d1b9343a;p=thirdparty%2Fsquid.git Some warning fixes --- diff --git a/lib/html_quote.c b/lib/html_quote.c index 1527394276..43c4aa6a66 100644 --- a/lib/html_quote.c +++ b/lib/html_quote.c @@ -1,5 +1,5 @@ /* - * $Id: html_quote.c,v 1.3 2001/01/12 00:37:12 wessels Exp $ + * $Id: html_quote.c,v 1.4 2001/10/17 19:46:43 hno Exp $ * * DEBUG: * AUTHOR: Robert Collins @@ -49,7 +49,7 @@ */ static struct { unsigned char code; - char *quote; + const char *quote; } htmlstandardentities[] = { @@ -98,7 +98,7 @@ html_quote(const char *string) buf = xcalloc(bufsize, 1); } for (src = string, dst = buf; *src; src++) { - char *escape = NULL; + const char *escape = NULL; const unsigned char ch = *src; /* Walk thru the list of HTML Entities that must be quoted to diff --git a/lib/rfc1123.c b/lib/rfc1123.c index f3d42364a0..54db1a70ae 100644 --- a/lib/rfc1123.c +++ b/lib/rfc1123.c @@ -1,6 +1,6 @@ /* - * $Id: rfc1123.c,v 1.28 2001/01/12 00:37:13 wessels Exp $ + * $Id: rfc1123.c,v 1.29 2001/10/17 19:46:43 hno Exp $ * * DEBUG: * AUTHOR: Harvest Derived @@ -74,7 +74,7 @@ static const char *const w_space = " \t\r\n"; static int make_month(const char *s); static int make_num(const char *s); -static char *month_names[12] = +static const char *month_names[12] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" diff --git a/lib/util.c b/lib/util.c index 96a50bd99e..c0a310edfa 100644 --- a/lib/util.c +++ b/lib/util.c @@ -1,6 +1,6 @@ /* - * $Id: util.c,v 1.81 2001/10/17 12:41:48 hno Exp $ + * $Id: util.c,v 1.82 2001/10/17 19:46:43 hno Exp $ * * DEBUG: * AUTHOR: Harvest Derived @@ -725,12 +725,14 @@ xpercent(double part, double whole) int xpercentInt(double part, double whole) { + double result; #if HAVE_RINT - return (int) rint(xpercent(part, whole)); + result = rint(xpercent(part, whole)); #else /* SCO 3.2v4.2 doesn't have rint() -- mauri@mbp.ee */ - return (int) floor(xpercent(part, whole) + 0.5); + result = floor(xpercent(part, whole) + 0.5); #endif + return (int) result; } /* somewhat safer division */ @@ -751,9 +753,9 @@ xitoa(int num) /* A default failure notifier when the main program hasn't installed any */ void -default_failure_notify(const char *msg) +default_failure_notify(const char *message) { - write(2, msg, strlen(msg)); + write(2, message, strlen(message)); write(2, "\n", 1); abort(); }