summaryrefslogtreecommitdiffstats
path: root/compat
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2002-02-25 10:36:32 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2002-02-25 10:36:32 (GMT)
commitefe59244840c732a49b93ff7aa6c01cb56874954 (patch)
tree51173dcf6440bab8a4aa0035be9c662f0cba4e8b /compat
parenta0211643722bd3be1a1b6a97595bfc96720edb98 (diff)
downloadtcl-efe59244840c732a49b93ff7aa6c01cb56874954.zip
tcl-efe59244840c732a49b93ff7aa6c01cb56874954.tar.gz
tcl-efe59244840c732a49b93ff7aa6c01cb56874954.tar.bz2
Minor cleanup of compat functions to get rid of GCC warnings.
Diffstat (limited to 'compat')
-rw-r--r--compat/strtod.c8
-rw-r--r--compat/strtol.c12
-rw-r--r--compat/strtoul.c4
3 files changed, 13 insertions, 11 deletions
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 == '-') {