diff options
author | dgp <dgp@users.sourceforge.net> | 2017-11-09 13:36:52 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2017-11-09 13:36:52 (GMT) |
commit | 1462dc4b664470a383b22c27f0a0cf7890f1d07e (patch) | |
tree | e03196b6be67938adde528ea7023c7b6715796ed /generic/tclDictObj.c | |
parent | 0a2f847ac9b495b90840b53ed408648a9fb32dc3 (diff) | |
parent | 78374f18a4199081db4462452b16c3e4193edc92 (diff) | |
download | tcl-1462dc4b664470a383b22c27f0a0cf7890f1d07e.zip tcl-1462dc4b664470a383b22c27f0a0cf7890f1d07e.tar.gz tcl-1462dc4b664470a383b22c27f0a0cf7890f1d07e.tar.bz2 |
merge 8.7
Diffstat (limited to 'generic/tclDictObj.c')
-rw-r--r-- | generic/tclDictObj.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/generic/tclDictObj.c b/generic/tclDictObj.c index b2cf916..9886e6a 100644 --- a/generic/tclDictObj.c +++ b/generic/tclDictObj.c @@ -142,7 +142,7 @@ typedef struct Dict { * the dictionary. Used for doing traversal of * the entries in the order that they are * created. */ - int epoch; /* Epoch counter */ + unsigned int epoch; /* Epoch counter */ size_t refCount; /* Reference counter (see above) */ Tcl_Obj *chain; /* Linked list used for invalidating the * string representations of updated nested @@ -400,7 +400,7 @@ DupDictInternalRep( * Initialise other fields. */ - newDict->epoch = 0; + newDict->epoch = 1; newDict->chain = NULL; newDict->refCount = 1; @@ -730,7 +730,7 @@ SetDictFromAny( * Tcl_GetStringFromObj, to use that old internalRep. */ - dict->epoch = 0; + dict->epoch = 1; dict->chain = NULL; dict->refCount = 1; DictSetIntRep(objPtr, dict); @@ -1151,7 +1151,7 @@ Tcl_DictObjFirst( cPtr = dict->entryChainHead; if (cPtr == NULL) { - searchPtr->epoch = -1; + searchPtr->epoch = 0; *donePtr = 1; } else { *donePtr = 0; @@ -1212,7 +1212,7 @@ Tcl_DictObjNext( * If the searh is done; we do no work. */ - if (searchPtr->epoch == -1) { + if (!searchPtr->epoch) { *donePtr = 1; return; } @@ -1269,8 +1269,8 @@ Tcl_DictObjDone( { Dict *dict; - if (searchPtr->epoch != -1) { - searchPtr->epoch = -1; + if (searchPtr->epoch) { + searchPtr->epoch = 0; dict = (Dict *) searchPtr->dictionaryPtr; if (dict->refCount-- <= 1) { DeleteDict(dict); @@ -1424,7 +1424,7 @@ Tcl_NewDictObj(void) TclInvalidateStringRep(dictPtr); dict = ckalloc(sizeof(Dict)); InitChainTable(dict); - dict->epoch = 0; + dict->epoch = 1; dict->chain = NULL; dict->refCount = 1; DictSetIntRep(dictPtr, dict); @@ -1472,7 +1472,7 @@ Tcl_DbNewDictObj( TclInvalidateStringRep(dictPtr); dict = ckalloc(sizeof(Dict)); InitChainTable(dict); - dict->epoch = 0; + dict->epoch = 1; dict->chain = NULL; dict->refCount = 1; DictSetIntRep(dictPtr, dict); |