diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2002-02-25 10:36:32 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2002-02-25 10:36:32 (GMT) |
commit | efe59244840c732a49b93ff7aa6c01cb56874954 (patch) | |
tree | 51173dcf6440bab8a4aa0035be9c662f0cba4e8b | |
parent | a0211643722bd3be1a1b6a97595bfc96720edb98 (diff) | |
download | tcl-efe59244840c732a49b93ff7aa6c01cb56874954.zip tcl-efe59244840c732a49b93ff7aa6c01cb56874954.tar.gz tcl-efe59244840c732a49b93ff7aa6c01cb56874954.tar.bz2 |
Minor cleanup of compat functions to get rid of GCC warnings.
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | compat/strtod.c | 8 | ||||
-rw-r--r-- | compat/strtol.c | 12 | ||||
-rw-r--r-- | compat/strtoul.c | 4 |
4 files changed, 18 insertions, 11 deletions
@@ -1,3 +1,8 @@ +2002-02-25 Donal K. Fellows <fellowsd@cs.man.ac.uk> + + * compat/strtoul.c, compat/strtol.c, compat/strtod.c: Added UCHAR, + CONST and #includes to clean up GCC output. + 2002-02-23 Don Porter <dgp@users.sourceforge.net> * 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 <ctype.h> +#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 == '-') { |