summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2013-12-06 10:04:48 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2013-12-06 10:04:48 (GMT)
commit68864af6c2b0d93f8693c0f3447ffc7f8f92eb0e (patch)
tree7a79467744bdb6d50803807c7e67ac51cb487cea
parent7631cbda15c13ff69b665f0b71ad20c866c00624 (diff)
downloadtcl-68864af6c2b0d93f8693c0f3447ffc7f8f92eb0e.zip
tcl-68864af6c2b0d93f8693c0f3447ffc7f8f92eb0e.tar.gz
tcl-68864af6c2b0d93f8693c0f3447ffc7f8f92eb0e.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.h4
-rw-r--r--generic/tclExecute.c10
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;