diff options
| author | nijtmans@users.sourceforge.net <jan.nijtmans> | 2013-12-06 10:04:48 (GMT) |
|---|---|---|
| committer | nijtmans@users.sourceforge.net <jan.nijtmans> | 2013-12-06 10:04:48 (GMT) |
| commit | 7b6fb9f7b6ceacf99fb77cb16b52032f583c0101 (patch) | |
| tree | 7a79467744bdb6d50803807c7e67ac51cb487cea | |
| parent | 92f98c1af60ec6419b2b9b029ee28ebbaa167127 (diff) | |
| download | tcl-7b6fb9f7b6ceacf99fb77cb16b52032f583c0101.zip tcl-7b6fb9f7b6ceacf99fb77cb16b52032f583c0101.tar.gz tcl-7b6fb9f7b6ceacf99fb77cb16b52032f583c0101.tar.bz2 | |
Introducing a new union member in Tcl_Obj is not a good idea in a patch release, especially using "long".
Better allow iterNum and iterMax to grow to ssize_t (or size_t) in Tcl 9 (or 8.x, why not?).
Usage of "long" in public API causes interoperability problems between Cygwin64 and Win64 (probably no-one cares except me).
| -rw-r--r-- | generic/tcl.h | 4 | ||||
| -rw-r--r-- | generic/tclExecute.c | 10 |
2 files changed, 5 insertions, 9 deletions
diff --git a/generic/tcl.h b/generic/tcl.h index aab299e..4bf81cc 100644 --- a/generic/tcl.h +++ b/generic/tcl.h @@ -848,10 +848,6 @@ typedef struct Tcl_Obj { void *ptr; unsigned long value; } ptrAndLongRep; - struct { - long int1; - long int2; - } twoIntValue; } internalRep; } Tcl_Obj; diff --git a/generic/tclExecute.c b/generic/tclExecute.c index f496fe7..c3f5372 100644 --- a/generic/tclExecute.c +++ b/generic/tclExecute.c @@ -6237,8 +6237,8 @@ TEBCresume( */ TclNewObj(tmpPtr); - tmpPtr->internalRep.twoIntValue.int1 = 0; - tmpPtr->internalRep.twoIntValue.int2 = iterMax; + tmpPtr->internalRep.twoPtrValue.ptr1 = NULL; + tmpPtr->internalRep.twoPtrValue.ptr2 = INT2PTR(iterMax); PUSH_OBJECT(tmpPtr); /* iterCounts object */ /* @@ -6268,8 +6268,8 @@ TEBCresume( numLists = infoPtr->numLists; tmpPtr = OBJ_AT_DEPTH(1); - iterNum = tmpPtr->internalRep.twoIntValue.int1; - iterMax = tmpPtr->internalRep.twoIntValue.int2; + iterNum = INT2PTR(tmpPtr->internalRep.twoPtrValue.ptr1); + iterMax = INT2PTR(tmpPtr->internalRep.twoPtrValue.ptr2); /* * If some list still has a remaining list element iterate one more @@ -6281,7 +6281,7 @@ TEBCresume( * Set the variables and jump back to run the body */ - tmpPtr->internalRep.twoIntValue.int1 = iterNum + 1; + tmpPtr->internalRep.twoPtrValue.ptr1 = INT2PTR(iterNum + 1); listTmpDepth = numLists + 1; |
