diff options
author | Miguel Sofer <miguel.sofer@gmail.com> | 2004-05-27 20:08:18 (GMT) |
---|---|---|
committer | Miguel Sofer <miguel.sofer@gmail.com> | 2004-05-27 20:08:18 (GMT) |
commit | 1586f3fc7d08ac5d3c07069a621630fdfad84cb2 (patch) | |
tree | e14b375e914e943789cdc0f02881aea9ae646e1e | |
parent | f0159bec481b8b56d7b70ae333acc455e5d6c3d3 (diff) | |
download | tcl-1586f3fc7d08ac5d3c07069a621630fdfad84cb2.zip tcl-1586f3fc7d08ac5d3c07069a621630fdfad84cb2.tar.gz tcl-1586f3fc7d08ac5d3c07069a621630fdfad84cb2.tar.bz2 |
* generic/tclExecute.c:
* generic/tclVar.c: using (ptrdiff_t) instead of (int) casting to
correct compiler warnings [Bug 961657], reported by Bob Techentin.
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | generic/tclExecute.c | 7 | ||||
-rw-r--r-- | generic/tclVar.c | 9 |
3 files changed, 15 insertions, 7 deletions
@@ -1,3 +1,9 @@ +2004-05-25 Miguel Sofer <msofer@users.sf.net> + + * generic/tclExecute.c: + * generic/tclVar.c: using (ptrdiff_t) instead of (int) casting to + correct compiler warnings [Bug 961657], reported by Bob Techentin. + 2004-05-27 Kevin B. Kenny <kennykb@acm.org> * tests/clock.test: Added a single test for the presence of %G diff --git a/generic/tclExecute.c b/generic/tclExecute.c index bff18c9..6b88e55 100644 --- a/generic/tclExecute.c +++ b/generic/tclExecute.c @@ -11,9 +11,10 @@ * 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.140 2004/05/25 00:07:54 hobbs Exp $ + * RCS: @(#) $Id: tclExecute.c,v 1.141 2004/05/27 20:08:20 msofer Exp $ */ +#include <stddef.h> #include "tclInt.h" #include "tclCompile.h" @@ -1545,7 +1546,7 @@ TclExecuteByteCode(interp, codePtr) objPtr = expandNestList; expandNestList = (Tcl_Obj *) objPtr->internalRep.twoPtrValue.ptr2; objc = tosPtr - eePtr->stackPtr - - (int) objPtr->internalRep.twoPtrValue.ptr1; + - (ptrdiff_t) objPtr->internalRep.twoPtrValue.ptr1; TclDecrRefCount(objPtr); } @@ -4824,7 +4825,7 @@ TclExecuteByteCode(interp, codePtr) */ processCatch: - while (tosPtr > (int) (eePtr->stackPtr[catchTop]) + eePtr->stackPtr) { + while (tosPtr > ((ptrdiff_t) (eePtr->stackPtr[catchTop])) + eePtr->stackPtr) { valuePtr = POP_OBJECT(); TclDecrRefCount(valuePtr); } diff --git a/generic/tclVar.c b/generic/tclVar.c index 2a88366..11d236a 100644 --- a/generic/tclVar.c +++ b/generic/tclVar.c @@ -15,9 +15,10 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclVar.c,v 1.84 2004/05/27 13:18:53 dkf Exp $ + * RCS: @(#) $Id: tclVar.c,v 1.85 2004/05/27 20:08:21 msofer Exp $ */ +#include <stddef.h> #include "tclInt.h" /* @@ -402,7 +403,7 @@ TclObjLookupVar(interp, part1Ptr, part2, flags, msg, createPart1, createPart2, if (typePtr == &tclLocalVarNameType) { Proc *procPtr = (Proc *) part1Ptr->internalRep.twoPtrValue.ptr1; - int localIndex = (int) part1Ptr->internalRep.twoPtrValue.ptr2; + ptrdiff_t localIndex = (ptrdiff_t) part1Ptr->internalRep.twoPtrValue.ptr2; int useLocal; useLocal = ((varFramePtr != NULL) && varFramePtr->isProcCallFrame @@ -555,7 +556,7 @@ TclObjLookupVar(interp, part1Ptr, part2, flags, msg, createPart1, createPart2, part1Ptr->typePtr = &tclLocalVarNameType; procPtr->refCount++; part1Ptr->internalRep.twoPtrValue.ptr1 = (VOID *) procPtr; - part1Ptr->internalRep.twoPtrValue.ptr2 = (VOID *) index; + part1Ptr->internalRep.twoPtrValue.ptr2 = (VOID *)(ptrdiff_t) index; #if ENABLE_NS_VARNAME_CACHING } else if (index > -3) { /* @@ -4611,7 +4612,7 @@ UpdateLocalVarName(objPtr) Tcl_Obj *objPtr; { Proc *procPtr = (Proc *) objPtr->internalRep.twoPtrValue.ptr1; - unsigned int index = (unsigned int) objPtr->internalRep.twoPtrValue.ptr2; + ptrdiff_t index = (ptrdiff_t) objPtr->internalRep.twoPtrValue.ptr2; CompiledLocal *localPtr = procPtr->firstLocalPtr; unsigned int nameLen; |