diff options
-rw-r--r-- | generic/regc_locale.c | 38 | ||||
-rw-r--r-- | generic/tclExecute.c | 10 | ||||
-rw-r--r-- | generic/tclIOCmd.c | 4 | ||||
-rw-r--r-- | generic/tclListObj.c | 4 | ||||
-rw-r--r-- | generic/tclObj.c | 16 | ||||
-rw-r--r-- | generic/tclParseExpr.c | 4 | ||||
-rwxr-xr-x | generic/tclStrToD.c | 14 | ||||
-rw-r--r-- | generic/tclStringObj.c | 4 | ||||
-rw-r--r-- | unix/tclUnixPipe.c | 7 |
9 files changed, 51 insertions, 50 deletions
diff --git a/generic/regc_locale.c b/generic/regc_locale.c index 1b573d8..e6eb12a 100644 --- a/generic/regc_locale.c +++ b/generic/regc_locale.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: regc_locale.c,v 1.13 2006/04/12 14:13:30 dkf Exp $ + * RCS: @(#) $Id: regc_locale.c,v 1.14 2006/07/20 06:17:38 das Exp $ */ /* ASCII character-name table */ @@ -891,10 +891,10 @@ cclass( case CC_PRINT: cv = getcvec(v, NUM_PRINT_CHAR, NUM_PRINT_RANGE, 0); if (cv) { - for (i=0 ; i<NUM_PRINT_CHAR ; i++) { + for (i=0 ; (size_t)i<NUM_PRINT_CHAR ; i++) { addchr(cv, printCharTable[i]); } - for (i=0 ; i<NUM_PRINT_RANGE ; i++) { + for (i=0 ; (size_t)i<NUM_PRINT_RANGE ; i++) { addrange(cv, printRangeTable[i].start, printRangeTable[i].end); } @@ -903,14 +903,14 @@ cclass( case CC_ALNUM: cv = getcvec(v, NUM_ALPHA_CHAR, NUM_DIGIT_RANGE + NUM_ALPHA_RANGE, 0); if (cv) { - for (i=0 ; i<NUM_ALPHA_CHAR ; i++) { + for (i=0 ; (size_t)i<NUM_ALPHA_CHAR ; i++) { addchr(cv, alphaCharTable[i]); } - for (i=0 ; i<NUM_ALPHA_RANGE ; i++) { + for (i=0 ; (size_t)i<NUM_ALPHA_RANGE ; i++) { addrange(cv, alphaRangeTable[i].start, alphaRangeTable[i].end); } - for (i=0 ; i<NUM_DIGIT_RANGE ; i++) { + for (i=0 ; (size_t)i<NUM_DIGIT_RANGE ; i++) { addrange(cv, digitRangeTable[i].start, digitRangeTable[i].end); } @@ -919,11 +919,11 @@ cclass( case CC_ALPHA: cv = getcvec(v, NUM_ALPHA_CHAR, NUM_ALPHA_RANGE, 0); if (cv) { - for (i=0 ; i<NUM_ALPHA_RANGE ; i++) { + for (i=0 ; (size_t)i<NUM_ALPHA_RANGE ; i++) { addrange(cv, alphaRangeTable[i].start, alphaRangeTable[i].end); } - for (i=0 ; i<NUM_ALPHA_CHAR ; i++) { + for (i=0 ; (size_t)i<NUM_ALPHA_CHAR ; i++) { addchr(cv, alphaCharTable[i]); } } @@ -947,7 +947,7 @@ cclass( case CC_DIGIT: cv = getcvec(v, 0, NUM_DIGIT_RANGE, 0); if (cv) { - for (i=0 ; i<NUM_DIGIT_RANGE ; i++) { + for (i=0 ; (size_t)i<NUM_DIGIT_RANGE ; i++) { addrange(cv, digitRangeTable[i].start, digitRangeTable[i].end); } @@ -956,11 +956,11 @@ cclass( case CC_PUNCT: cv = getcvec(v, NUM_PUNCT_CHAR, NUM_PUNCT_RANGE, 0); if (cv) { - for (i=0 ; i<NUM_PUNCT_RANGE ; i++) { + for (i=0 ; (size_t)i<NUM_PUNCT_RANGE ; i++) { addrange(cv, punctRangeTable[i].start, punctRangeTable[i].end); } - for (i=0 ; i<NUM_PUNCT_CHAR ; i++) { + for (i=0 ; (size_t)i<NUM_PUNCT_CHAR ; i++) { addchr(cv, punctCharTable[i]); } } @@ -985,11 +985,11 @@ cclass( case CC_SPACE: cv = getcvec(v, NUM_SPACE_CHAR, NUM_SPACE_RANGE, 0); if (cv) { - for (i=0 ; i<NUM_SPACE_RANGE ; i++) { + for (i=0 ; (size_t)i<NUM_SPACE_RANGE ; i++) { addrange(cv, spaceRangeTable[i].start, spaceRangeTable[i].end); } - for (i=0 ; i<NUM_SPACE_CHAR ; i++) { + for (i=0 ; (size_t)i<NUM_SPACE_CHAR ; i++) { addchr(cv, spaceCharTable[i]); } } @@ -997,11 +997,11 @@ cclass( case CC_LOWER: cv = getcvec(v, NUM_LOWER_CHAR, NUM_LOWER_RANGE, 0); if (cv) { - for (i=0 ; i<NUM_LOWER_RANGE ; i++) { + for (i=0 ; (size_t)i<NUM_LOWER_RANGE ; i++) { addrange(cv, lowerRangeTable[i].start, lowerRangeTable[i].end); } - for (i=0 ; i<NUM_LOWER_CHAR ; i++) { + for (i=0 ; (size_t)i<NUM_LOWER_CHAR ; i++) { addchr(cv, lowerCharTable[i]); } } @@ -1009,11 +1009,11 @@ cclass( case CC_UPPER: cv = getcvec(v, NUM_UPPER_CHAR, NUM_UPPER_RANGE, 0); if (cv) { - for (i=0 ; i<NUM_UPPER_RANGE ; i++) { + for (i=0 ; (size_t)i<NUM_UPPER_RANGE ; i++) { addrange(cv, upperRangeTable[i].start, upperRangeTable[i].end); } - for (i=0 ; i<NUM_UPPER_CHAR ; i++) { + for (i=0 ; (size_t)i<NUM_UPPER_CHAR ; i++) { addchr(cv, upperCharTable[i]); } } @@ -1021,11 +1021,11 @@ cclass( case CC_GRAPH: cv = getcvec(v, NUM_GRAPH_CHAR, NUM_GRAPH_RANGE, 0); if (cv) { - for (i=0 ; i<NUM_GRAPH_RANGE ; i++) { + for (i=0 ; (size_t)i<NUM_GRAPH_RANGE ; i++) { addrange(cv, graphRangeTable[i].start, graphRangeTable[i].end); } - for (i=0 ; i<NUM_GRAPH_CHAR ; i++) { + for (i=0 ; (size_t)i<NUM_GRAPH_CHAR ; i++) { addchr(cv, graphCharTable[i]); } } diff --git a/generic/tclExecute.c b/generic/tclExecute.c index 917f0ac..96677f9 100644 --- a/generic/tclExecute.c +++ b/generic/tclExecute.c @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclExecute.c,v 1.237 2006/06/21 03:10:38 dgp Exp $ + * RCS: @(#) $Id: tclExecute.c,v 1.238 2006/07/20 06:17:38 das Exp $ */ #include "tclInt.h" @@ -3939,7 +3939,7 @@ TclExecuteByteCode( } /* Handle shifts within the native long range */ TRACE(("%s %s => ", O2S(valuePtr), O2S(value2Ptr))); - if ((type1 == TCL_NUMBER_LONG) && (shift < CHAR_BIT*sizeof(long)) + if ((type1 == TCL_NUMBER_LONG) && ((size_t)shift < CHAR_BIT*sizeof(long)) && (l1 = *((CONST long *)ptr1)) && !(((l1>0) ? l1 : ~l1) & -(1<<(CHAR_BIT*sizeof(long)-1-shift)))) { @@ -3951,7 +3951,7 @@ TclExecuteByteCode( /* Handle shifts within the native wide range */ TRACE(("%s %s => ", O2S(valuePtr), O2S(value2Ptr))); if ((type1 != TCL_NUMBER_BIG) - && (shift < CHAR_BIT*sizeof(Tcl_WideInt))) { + && ((size_t)shift < CHAR_BIT*sizeof(Tcl_WideInt))) { Tcl_WideInt w; TclGetWideIntFromObj(NULL, valuePtr, &w); @@ -4007,7 +4007,7 @@ TclExecuteByteCode( /* Handle shifts within the native long range */ if (type1 == TCL_NUMBER_LONG) { l1 = *((CONST long *)ptr1); - if (shift >= CHAR_BIT*sizeof(long)) { + if ((size_t)shift >= CHAR_BIT*sizeof(long)) { if (l1 >= (long)0) { objResultPtr = eePtr->constants[0]; } else { @@ -4023,7 +4023,7 @@ TclExecuteByteCode( /* Handle shifts within the native wide range */ if (type1 == TCL_NUMBER_WIDE) { Tcl_WideInt w = *((CONST Tcl_WideInt *)ptr1); - if (shift >= CHAR_BIT*sizeof(Tcl_WideInt)) { + if ((size_t)shift >= CHAR_BIT*sizeof(Tcl_WideInt)) { if (w >= (Tcl_WideInt)0) { objResultPtr = eePtr->constants[0]; } else { diff --git a/generic/tclIOCmd.c b/generic/tclIOCmd.c index 276ccf5..4b5974b 100644 --- a/generic/tclIOCmd.c +++ b/generic/tclIOCmd.c @@ -8,7 +8,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclIOCmd.c,v 1.33 2005/11/04 22:38:38 msofer Exp $ + * RCS: @(#) $Id: tclIOCmd.c,v 1.34 2006/07/20 06:17:39 das Exp $ */ #include "tclInt.h" @@ -852,7 +852,7 @@ Tcl_ExecObjCmd( argv = argStorage; argc = objc - skip; - if ((argc + 1) > sizeof(argv) / sizeof(argv[0])) { + if ((size_t)(argc + 1) > sizeof(argv) / sizeof(argv[0])) { argv = (CONST char **) ckalloc((unsigned)(argc + 1) * sizeof(char *)); } diff --git a/generic/tclListObj.c b/generic/tclListObj.c index 1bc0344..d4da0e8 100644 --- a/generic/tclListObj.c +++ b/generic/tclListObj.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclListObj.c,v 1.31 2005/12/13 22:43:18 kennykb Exp $ + * RCS: @(#) $Id: tclListObj.c,v 1.32 2006/07/20 06:17:39 das Exp $ */ #include "tclInt.h" @@ -90,7 +90,7 @@ NewListIntRep( * requires API changes to fix. */ - if (objc > INT_MAX/sizeof(Tcl_Obj *)) { + if ((size_t)objc > INT_MAX/sizeof(Tcl_Obj *)) { return NULL; } diff --git a/generic/tclObj.c b/generic/tclObj.c index 7d89f98..521a49b 100644 --- a/generic/tclObj.c +++ b/generic/tclObj.c @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclObj.c,v 1.108 2006/06/21 03:10:39 dgp Exp $ + * RCS: @(#) $Id: tclObj.c,v 1.109 2006/07/20 06:17:39 das Exp $ */ #include "tclInt.h" @@ -158,7 +158,7 @@ static Tcl_ThreadDataKey pendingObjDataKey; } #define UNPACK_BIGNUM(objPtr, bignum) \ - if ((objPtr)->internalRep.ptrAndLongRep.value == -1) { \ + if ((objPtr)->internalRep.ptrAndLongRep.value == (unsigned long)(-1)) { \ (bignum) = *((mp_int *) ((objPtr)->internalRep.ptrAndLongRep.ptr)); \ } else { \ (bignum).dp = (mp_digit*) (objPtr)->internalRep.ptrAndLongRep.ptr; \ @@ -2171,7 +2171,7 @@ Tcl_GetLongFromObj( mp_int big; UNPACK_BIGNUM(objPtr, big); - if (big.used <= (CHAR_BIT * sizeof(long) + DIGIT_BIT - 1) + if ((size_t)(big.used) <= (CHAR_BIT * sizeof(long) + DIGIT_BIT - 1) / DIGIT_BIT) { unsigned long value = 0, numBytes = sizeof(long); long scratch; @@ -2470,8 +2470,8 @@ Tcl_GetWideIntFromObj( mp_int big; UNPACK_BIGNUM(objPtr, big); - if (big.used <= (CHAR_BIT * sizeof(Tcl_WideInt) + DIGIT_BIT - 1) - / DIGIT_BIT) { + if ((size_t)(big.used) <= (CHAR_BIT * sizeof(Tcl_WideInt) + + DIGIT_BIT - 1) / DIGIT_BIT) { Tcl_WideUInt value = 0; unsigned long numBytes = sizeof(Tcl_WideInt); Tcl_WideInt scratch; @@ -2524,7 +2524,7 @@ FreeBignum( UNPACK_BIGNUM(objPtr, toFree); mp_clear(&toFree); - if (objPtr->internalRep.ptrAndLongRep.value < 0) { + if ((long)(objPtr->internalRep.ptrAndLongRep.value) < 0) { ckfree((char *)objPtr->internalRep.ptrAndLongRep.ptr); } } @@ -2871,7 +2871,7 @@ Tcl_SetBignumObj( if (Tcl_IsShared(objPtr)) { Tcl_Panic("Tcl_SetBignumObj called with shared object"); } - if (bignumValue->used + if ((size_t)(bignumValue->used) <= (CHAR_BIT * sizeof(long) + DIGIT_BIT - 1) / DIGIT_BIT) { unsigned long value = 0, numBytes = sizeof(long); long scratch; @@ -2895,7 +2895,7 @@ Tcl_SetBignumObj( } tooLargeForLong: #ifndef NO_WIDE_TYPE - if (bignumValue->used + if ((size_t)(bignumValue->used) <= (CHAR_BIT * sizeof(Tcl_WideInt) + DIGIT_BIT - 1) / DIGIT_BIT) { Tcl_WideUInt value = 0; unsigned long numBytes = sizeof(Tcl_WideInt); diff --git a/generic/tclParseExpr.c b/generic/tclParseExpr.c index 9cbc34f..4453f2b 100644 --- a/generic/tclParseExpr.c +++ b/generic/tclParseExpr.c @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclParseExpr.c,v 1.34 2006/07/05 20:42:15 dgp Exp $ + * RCS: @(#) $Id: tclParseExpr.c,v 1.35 2006/07/20 06:17:39 das Exp $ */ #define OLD_EXPR_PARSER 0 @@ -2107,7 +2107,7 @@ Tcl_ParseExpr( Tcl_Obj *msg = NULL; unsigned char precedence; CONST char *space, *operand, *end; - int scanned, size, limit = 25, code = TCL_OK; + int scanned = 0, size, limit = 25, code = TCL_OK; if (numBytes < 0) { numBytes = (start ? strlen(start) : 0); diff --git a/generic/tclStrToD.c b/generic/tclStrToD.c index 5b7993c..7d03c2b 100755 --- a/generic/tclStrToD.c +++ b/generic/tclStrToD.c @@ -14,7 +14,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.23 2006/06/21 03:10:39 dgp Exp $ + * RCS: @(#) $Id: tclStrToD.c,v 1.24 2006/07/20 06:17:39 das Exp $ * *---------------------------------------------------------------------- */ @@ -450,7 +450,7 @@ TclParseNumber( */ if ((octalSignificandWide != 0) - && ((shift >= CHAR_BIT*sizeof(Tcl_WideUInt)) + && (((size_t)shift >= CHAR_BIT*sizeof(Tcl_WideUInt)) || (octalSignificandWide > (~(Tcl_WideUInt)0 >> shift)))) { octalSignificandOverflow = 1; @@ -569,7 +569,7 @@ TclParseNumber( */ if (significandWide != 0 && - (shift >= CHAR_BIT*sizeof(Tcl_WideUInt) || + ((size_t)shift >= CHAR_BIT*sizeof(Tcl_WideUInt) || significandWide > (~(Tcl_WideUInt)0 >> shift))) { significandOverflow = 1; TclBNInitBignumFromWideUInt(&significandBig, @@ -609,7 +609,7 @@ TclParseNumber( */ if (significandWide != 0 && - (shift >= CHAR_BIT*sizeof(Tcl_WideUInt) || + ((size_t)shift >= CHAR_BIT*sizeof(Tcl_WideUInt) || significandWide > (~(Tcl_WideUInt)0 >> shift))) { significandOverflow = 1; TclBNInitBignumFromWideUInt(&significandBig, @@ -930,7 +930,7 @@ TclParseNumber( case BINARY: shift = numTrailZeros; if (!significandOverflow && significandWide != 0 && - (shift >= CHAR_BIT*sizeof(Tcl_WideUInt) || + ((size_t)shift >= CHAR_BIT*sizeof(Tcl_WideUInt) || significandWide > (MOST_BITS + signum) >> shift)) { significandOverflow = 1; TclBNInitBignumFromWideUInt(&significandBig, significandWide); @@ -951,7 +951,7 @@ TclParseNumber( shift = 4 * numTrailZeros; if (!significandOverflow && significandWide !=0 && - (shift >= CHAR_BIT*sizeof(Tcl_WideUInt) || + ((size_t)shift >= CHAR_BIT*sizeof(Tcl_WideUInt) || significandWide > (MOST_BITS + signum) >> shift)) { significandOverflow = 1; TclBNInitBignumFromWideUInt(&significandBig, significandWide); @@ -972,7 +972,7 @@ TclParseNumber( shift = 3 * numTrailZeros; if (!octalSignificandOverflow && octalSignificandWide != 0 && - (shift >= CHAR_BIT*sizeof(Tcl_WideUInt) || + ((size_t)shift >= CHAR_BIT*sizeof(Tcl_WideUInt) || octalSignificandWide > (MOST_BITS + signum) >> shift)) { octalSignificandOverflow = 1; TclBNInitBignumFromWideUInt(&octalSignificandBig, diff --git a/generic/tclStringObj.c b/generic/tclStringObj.c index d119176..953cacb 100644 --- a/generic/tclStringObj.c +++ b/generic/tclStringObj.c @@ -33,7 +33,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclStringObj.c,v 1.53 2006/03/23 14:24:57 dgp Exp $ */ + * RCS: @(#) $Id: tclStringObj.c,v 1.54 2006/07/20 06:17:39 das Exp $ */ #include "tclInt.h" #include "tommath.h" @@ -2145,7 +2145,7 @@ TclAppendFormattedObjs( int digitOffset; if (useBig) { - if (shift<CHAR_BIT*sizeof(Tcl_WideUInt)-DIGIT_BIT) { + if ((size_t)shift<CHAR_BIT*sizeof(Tcl_WideUInt)-DIGIT_BIT) { bits |= (((Tcl_WideUInt)big.dp[index++]) << shift); shift += DIGIT_BIT; } diff --git a/unix/tclUnixPipe.c b/unix/tclUnixPipe.c index dc8087d..8a20bcc 100644 --- a/unix/tclUnixPipe.c +++ b/unix/tclUnixPipe.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclUnixPipe.c,v 1.33 2006/03/27 18:08:51 andreas_kupries Exp $ + * RCS: @(#) $Id: tclUnixPipe.c,v 1.34 2006/07/20 06:17:39 das Exp $ */ #include "tclInt.h" @@ -395,7 +395,7 @@ TclpCreateProcess( * process. */ { TclFile errPipeIn, errPipeOut; - int joinThisError, count, status, fd; + int count, status, fd; char errSpace[200 + TCL_INTEGER_SPACE]; Tcl_DString *dsArray; char **newArgv; @@ -428,9 +428,10 @@ TclpCreateProcess( newArgv[i] = Tcl_UtfToExternalDString(NULL, argv[i], -1, &dsArray[i]); } - joinThisError = errorFile && (errorFile == outputFile); pid = fork(); if (pid == 0) { + int joinThisError = errorFile && (errorFile == outputFile); + fd = GetFd(errPipeOut); /* |