From 1074a7edd4a19b0debb5bbf5fe02ba157c3dc5c9 Mon Sep 17 00:00:00 2001 From: Kevin B Kenny Date: Wed, 11 May 2005 15:39:39 +0000 Subject: Added UCHAR's to ctype macros in tclStrToD.c --- ChangeLog | 7 +++++++ generic/tclStrToD.c | 12 ++++++------ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2b1e6bf..60d8cc7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2005-05-11 Kevin Kenny + + * 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 * 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; -- cgit v0.12