From efe59244840c732a49b93ff7aa6c01cb56874954 Mon Sep 17 00:00:00 2001 From: dkf Date: Mon, 25 Feb 2002 10:36:32 +0000 Subject: Minor cleanup of compat functions to get rid of GCC warnings. --- ChangeLog | 5 +++++ compat/strtod.c | 8 ++++---- compat/strtol.c | 12 +++++++----- compat/strtoul.c | 4 ++-- 4 files changed, 18 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index 679c257..fac6c7e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2002-02-25 Donal K. Fellows + + * compat/strtoul.c, compat/strtol.c, compat/strtod.c: Added UCHAR, + CONST and #includes to clean up GCC output. + 2002-02-23 Don Porter * compat/strtoull.c (strtoull): diff --git a/compat/strtod.c b/compat/strtod.c index ad5b72e..a5f350f 100644 --- a/compat/strtod.c +++ b/compat/strtod.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: strtod.c,v 1.4 2001/11/23 01:26:34 das Exp $ + * RCS: @(#) $Id: strtod.c,v 1.5 2002/02/25 10:36:32 dkf Exp $ */ #include "tcl.h" @@ -110,7 +110,7 @@ strtod(string, endPtr) */ p = string; - while (isspace(*p)) { + while (isspace(UCHAR(*p))) { p += 1; } if (*p == '-') { @@ -208,11 +208,11 @@ strtod(string, endPtr) } expSign = FALSE; } - if (!isdigit(*p)) { + if (!isdigit(UCHAR(*p))) { p = pExp; goto done; } - while (isdigit(*p)) { + while (isdigit(UCHAR(*p))) { exp = exp * 10 + (*p - '0'); p += 1; } diff --git a/compat/strtol.c b/compat/strtol.c index c2f336b..f384f8a 100644 --- a/compat/strtol.c +++ b/compat/strtol.c @@ -9,10 +9,12 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: strtol.c,v 1.2 1998/09/14 18:39:45 stanton Exp $ + * RCS: @(#) $Id: strtol.c,v 1.3 2002/02/25 10:36:32 dkf Exp $ */ #include +#include "tclInt.h" +#include "tclPort.h" /* @@ -37,7 +39,7 @@ long int strtol(string, endPtr, base) - char *string; /* String of ASCII digits, possibly + CONST char *string; /* String of ASCII digits, possibly * preceded by white space. For bases * greater than 10, either lower- or * upper-case digits may be used. @@ -51,7 +53,7 @@ strtol(string, endPtr, base) * else means decimal. */ { - register char *p; + register CONST char *p; int result; /* @@ -59,7 +61,7 @@ strtol(string, endPtr, base) */ p = string; - while (isspace(*p)) { + while (isspace(UCHAR(*p))) { p += 1; } @@ -77,7 +79,7 @@ strtol(string, endPtr, base) result = strtoul(p, endPtr, base); } if ((result == 0) && (endPtr != 0) && (*endPtr == p)) { - *endPtr = string; + *endPtr = (char *) string; } return result; } diff --git a/compat/strtoul.c b/compat/strtoul.c index ddb1682..912e252 100644 --- a/compat/strtoul.c +++ b/compat/strtoul.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: strtoul.c,v 1.4 2002/02/24 02:53:25 dgp Exp $ + * RCS: @(#) $Id: strtoul.c,v 1.5 2002/02/25 10:36:32 dkf Exp $ */ #include "tclInt.h" @@ -80,7 +80,7 @@ strtoul(string, endPtr, base) */ p = string; - while (isspace(*p)) { + while (isspace(UCHAR(*p))) { p += 1; } if (*p == '-') { -- cgit v0.12