diff options
author | das <das> | 2007-08-27 06:46:32 (GMT) |
---|---|---|
committer | das <das> | 2007-08-27 06:46:32 (GMT) |
commit | df755e81a521c38045bdcd30af94708803a9bc3e (patch) | |
tree | eb3f064b85c32dcb73866e49b40038b14fa619ae /generic | |
parent | e49284b70f26fd21f2b9751427b43b076965d60c (diff) | |
download | tcl-df755e81a521c38045bdcd30af94708803a9bc3e.zip tcl-df755e81a521c38045bdcd30af94708803a9bc3e.tar.gz tcl-df755e81a521c38045bdcd30af94708803a9bc3e.tar.bz2 |
fix warnings about signed vs unsigned comparison (type of sizeof() is size_t i.e. unsigned!)
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tclExecute.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/generic/tclExecute.c b/generic/tclExecute.c index bb4c9a4..625a7a0 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.323 2007/08/25 03:23:17 kennykb Exp $ + * RCS: @(#) $Id: tclExecute.c,v 1.324 2007/08/27 06:46:32 das Exp $ */ #include "tclInt.h" @@ -5417,14 +5417,14 @@ TclExecuteByteCode( /* * Reduce small powers of 2 to shifts. */ - if (l2 < CHAR_BIT * sizeof(long) - 1) { + if ((unsigned long) l2 < CHAR_BIT * sizeof(long) - 1) { TRACE(("%s %s => ", O2S(valuePtr), O2S(value2Ptr))); TclNewLongObj(objResultPtr, (1L << l2)); TRACE(("%s\n", O2S(objResultPtr))); NEXT_INST_F(1, 2, 1); } #if !defined(TCL_WIDE_INT_IS_LONG) - if (l2 < CHAR_BIT * sizeof(Tcl_WideInt) - 1) { + if ((unsigned long) l2 < CHAR_BIT * sizeof(Tcl_WideInt) - 1) { TRACE(("%s %s => ", O2S(valuePtr), O2S(value2Ptr))); objResultPtr = Tcl_NewWideIntObj(((Tcl_WideInt) 1) << l2); @@ -5438,14 +5438,14 @@ TclExecuteByteCode( /* * Reduce small powers of 2 to shifts. */ - if (l2 < CHAR_BIT * sizeof(long) - 1) { + if ((unsigned long) l2 < CHAR_BIT * sizeof(long) - 1) { TRACE(("%s %s => ", O2S(valuePtr), O2S(value2Ptr))); TclNewLongObj(objResultPtr, signum * (1L << l2)); TRACE(("%s\n", O2S(objResultPtr))); NEXT_INST_F(1, 2, 1); } #if !defined(TCL_WIDE_INT_IS_LONG) - if (l2 < CHAR_BIT * sizeof(Tcl_WideInt) - 1) { + if ((unsigned long) l2 < CHAR_BIT * sizeof(Tcl_WideInt) - 1) { TRACE(("%s %s => ", O2S(valuePtr), O2S(value2Ptr))); objResultPtr = Tcl_NewWideIntObj(signum * @@ -5500,7 +5500,7 @@ TclExecuteByteCode( NEXT_INST_F(1, 1, 0); } if (l1 >= 3 - && l1 < (sizeof(Exp32Index) + && (unsigned long) l1 < (sizeof(Exp32Index) / sizeof(unsigned short)) - 1) { unsigned short base = Exp32Index[l1-3] + l2 - 9; if (base < Exp32Index[l1-2]) { @@ -5520,7 +5520,7 @@ TclExecuteByteCode( } } if (-l1 >= 3 - && -l1 < (sizeof(Exp32Index) + && (unsigned long)(-l1) < (sizeof(Exp32Index) / sizeof(unsigned short)) - 1) { unsigned short base = Exp32Index[-l1-3] + l2 - 9; if (base < Exp32Index[-l1-2]) { |