From 08d7c1eb0bd82b0f1aa5b314d946fde160159f97 Mon Sep 17 00:00:00 2001 From: Kevin B Kenny Date: Wed, 17 Oct 2007 04:35:17 +0000 Subject: * generic/tclCompExpr.c: Moved a misplaced declaration that blocked compilation on VC++. * generic/tclExecute.c: Silenced several VC++ compiler warnings about converting 'long' to 'unsigned short'. --- ChangeLog | 7 +++++++ generic/tclCompExpr.c | 5 +++-- generic/tclExecute.c | 14 +++++++++----- 3 files changed, 19 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1656854..b365bab 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2007-10-17 Kevin B. Kenny + + * generic/tclCompExpr.c: Moved a misplaced declaration that blocked + compilation on VC++. + * generic/tclExecute.c: Silenced several VC++ compiler warnings about + converting 'long' to 'unsigned short'. + 2007-10-16 David Gravereaux * win/makefile.vc: removed old dependency cruft that is no longer diff --git a/generic/tclCompExpr.c b/generic/tclCompExpr.c index 36be6eb..a53a6f1 100644 --- a/generic/tclCompExpr.c +++ b/generic/tclCompExpr.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: tclCompExpr.c,v 1.87 2007/10/15 21:27:48 dgp Exp $ + * RCS: @(#) $Id: tclCompExpr.c,v 1.88 2007/10/17 04:35:18 kennykb Exp $ */ #include "tclInt.h" @@ -751,10 +751,11 @@ ParseExpr( && (lastStart[2] >= '0') && (lastStart[2] <= '9')) { const char *end = lastStart + 2; + Tcl_Obj* copy; while (isdigit(*end)) { end++; } - Tcl_Obj *copy = Tcl_NewStringObj(lastStart, + copy = Tcl_NewStringObj(lastStart, end - lastStart); if (TclCheckBadOctal(NULL, Tcl_GetString(copy))) { diff --git a/generic/tclExecute.c b/generic/tclExecute.c index 48f5e4b..af9ff99 100644 --- a/generic/tclExecute.c +++ b/generic/tclExecute.c @@ -13,7 +13,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.337 2007/09/17 10:40:08 dkf Exp $ + * RCS: @(#) $Id: tclExecute.c,v 1.338 2007/10/17 04:35:18 kennykb Exp $ */ #include "tclInt.h" @@ -5480,7 +5480,8 @@ TclExecuteByteCode( if (l1 >= 3 && (unsigned long) l1 < (sizeof(Exp32Index) / sizeof(unsigned short)) - 1) { - unsigned short base = Exp32Index[l1-3] + l2 - 9; + unsigned short base = Exp32Index[l1-3] + + (unsigned short) l2 - 9; if (base < Exp32Index[l1-2]) { /* * 32-bit number raised to intermediate power, @@ -5500,7 +5501,8 @@ TclExecuteByteCode( if (-l1 >= 3 && (unsigned long)(-l1) < (sizeof(Exp32Index) / sizeof(unsigned short)) - 1) { - unsigned short base = Exp32Index[-l1-3] + l2 - 9; + unsigned short base + = Exp32Index[-l1-3] + (unsigned short) l2 - 9; if (base < Exp32Index[-l1-2]) { long lResult = (oddExponent) ? -Exp32Value[base] : Exp32Value[base]; @@ -5624,7 +5626,8 @@ TclExecuteByteCode( if (w1 >= 3 && (Tcl_WideUInt) w1 < (sizeof(Exp64Index) / sizeof(unsigned short)) - 1) { - unsigned short base = Exp64Index[w1-3] + l2 - 17; + unsigned short base + = Exp64Index[w1-3] + (unsigned short) l2 - 17; if (base < Exp64Index[w1-2]) { /* * 64-bit number raised to intermediate power, @@ -5644,7 +5647,8 @@ TclExecuteByteCode( if (-w1 >= 3 && (Tcl_WideUInt) (-w1) < (sizeof(Exp64Index) / sizeof(unsigned short)) - 1) { - unsigned short base = Exp64Index[-w1-3] + l2 - 17; + unsigned short base + = Exp64Index[-w1-3] + (unsigned short) l2 - 17; if (base < Exp64Index[-w1-2]) { Tcl_WideInt wResult = (oddExponent) ? -Exp64Value[base] : Exp64Value[base]; -- cgit v0.12