diff options
author | Kevin B Kenny <kennykb@acm.org> | 2005-05-11 15:39:39 (GMT) |
---|---|---|
committer | Kevin B Kenny <kennykb@acm.org> | 2005-05-11 15:39:39 (GMT) |
commit | 1074a7edd4a19b0debb5bbf5fe02ba157c3dc5c9 (patch) | |
tree | 9129feba18528804f4803f0f67c7f5e6f19be14f | |
parent | 8bf46ba0a03990bad5d4491ab94fd3eaba6c43a6 (diff) | |
download | tcl-1074a7edd4a19b0debb5bbf5fe02ba157c3dc5c9.zip tcl-1074a7edd4a19b0debb5bbf5fe02ba157c3dc5c9.tar.gz tcl-1074a7edd4a19b0debb5bbf5fe02ba157c3dc5c9.tar.bz2 |
Added UCHAR's to ctype macros in tclStrToD.c
-rw-r--r-- | ChangeLog | 7 | ||||
-rwxr-xr-x | generic/tclStrToD.c | 12 |
2 files changed, 13 insertions, 6 deletions
@@ -1,3 +1,10 @@ +2005-05-11 Kevin Kenny <kennykb@acm.org> + + * generic/tclStrToD.c (TclStrToD, RefineResult, ParseNaN): + Changed the code to cast 'char' to UCHAR explicitly when + using ctype macros, to silence complaints from the Solaris + compiler. + 2005-05-10 Jeff Hobbs <jeffh@ActiveState.com> * unix/tclUnixFCmd.c: add lint attr to enum to satisfy strictly diff --git a/generic/tclStrToD.c b/generic/tclStrToD.c index feb0278..ab18ef7 100755 --- a/generic/tclStrToD.c +++ b/generic/tclStrToD.c @@ -15,7 +15,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclStrToD.c,v 1.3 2005/05/10 20:17:42 kennykb Exp $ + * RCS: @(#) $Id: tclStrToD.c,v 1.4 2005/05/11 15:39:50 kennykb Exp $ * *---------------------------------------------------------------------- */ @@ -241,7 +241,7 @@ TclStrToD( CONST char* s, if ( c == '.' && !seenDp ) { seenDp = 1; ++p; - } else if ( isdigit(c) ) { + } else if ( isdigit( UCHAR(c) ) ) { if ( c == '0' ) { if ( startOfSignificand != NULL ) { ++nTrailZero; @@ -292,7 +292,7 @@ TclStrToD( CONST char* s, CONST char* stringSave = p; ++p; c = *p; - if ( isdigit( c ) || c == '+' || c == '-' ) { + if ( isdigit( UCHAR( c ) ) || c == '+' || c == '-' ) { errno = 0; exponent = strtol( p, (char**)&p, 10 ); if ( errno == ERANGE ) { @@ -651,7 +651,7 @@ RefineResult( double approxResult, i = nSigDigs; for ( p = sigStart ; ; ++p ) { char c = *p; - if ( isdigit( c ) ) { + if ( isdigit( UCHAR( c ) ) ) { mp_mul_d( &twoMd, (unsigned) 10, &twoMd ); mp_add_d( &twoMd, (unsigned) (c - '0'), &twoMd ); --i; @@ -763,12 +763,12 @@ ParseNaN( int signum, /* Flag == 1 if minus sign has been ++p; for ( ; ; ) { c = *p++; - if ( isspace(c) ) { + if ( isspace( UCHAR(c) ) ) { continue; } else if ( c == ')' ) { *endPtr = p; break; - } else if ( isdigit(c) ) { + } else if ( isdigit( UCHAR(c) ) ) { c -= '0'; } else if ( c >= 'A' && c <= 'F' ) { c = c - 'A' + 10; |