summaryrefslogtreecommitdiffstats
path: root/generic/tclDictObj.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tclDictObj.c')
-rw-r--r--generic/tclDictObj.c72
1 files changed, 36 insertions, 36 deletions
diff --git a/generic/tclDictObj.c b/generic/tclDictObj.c
index 7862a0f..4b81565 100644
--- a/generic/tclDictObj.c
+++ b/generic/tclDictObj.c
@@ -179,7 +179,7 @@ const Tcl_ObjType tclDictType = {
do { \
const Tcl_ObjIntRep *irPtr; \
irPtr = TclFetchIntRep((objPtr), &tclDictType); \
- (dictRepPtr) = irPtr ? irPtr->twoPtrValue.ptr1 : NULL; \
+ (dictRepPtr) = irPtr ? (Dict *)irPtr->twoPtrValue.ptr1 : NULL; \
} while (0)
/*
@@ -243,10 +243,10 @@ AllocChainEntry(
Tcl_HashTable *tablePtr,
void *keyPtr)
{
- Tcl_Obj *objPtr = keyPtr;
+ Tcl_Obj *objPtr = (Tcl_Obj *)keyPtr;
ChainEntry *cPtr;
- cPtr = ckalloc(sizeof(ChainEntry));
+ cPtr = (ChainEntry *)ckalloc(sizeof(ChainEntry));
cPtr->entry.key.objPtr = objPtr;
Tcl_IncrRefCount(objPtr);
cPtr->entry.clientData = NULL;
@@ -279,7 +279,7 @@ DeleteChainTable(
ChainEntry *cPtr;
for (cPtr=dict->entryChainHead ; cPtr!=NULL ; cPtr=cPtr->nextPtr) {
- Tcl_Obj *valuePtr = Tcl_GetHashValue(&cPtr->entry);
+ Tcl_Obj *valuePtr = (Tcl_Obj *)Tcl_GetHashValue(&cPtr->entry);
TclDecrRefCount(valuePtr);
}
@@ -326,7 +326,7 @@ DeleteChainEntry(
if (cPtr == NULL) {
return 0;
} else {
- Tcl_Obj *valuePtr = Tcl_GetHashValue(&cPtr->entry);
+ Tcl_Obj *valuePtr = (Tcl_Obj *)Tcl_GetHashValue(&cPtr->entry);
TclDecrRefCount(valuePtr);
}
@@ -377,7 +377,7 @@ DupDictInternalRep(
Tcl_Obj *srcPtr,
Tcl_Obj *copyPtr)
{
- Dict *oldDict, *newDict = ckalloc(sizeof(Dict));
+ Dict *oldDict, *newDict = (Dict *)ckalloc(sizeof(Dict));
ChainEntry *cPtr;
DictGetIntRep(srcPtr, oldDict);
@@ -388,8 +388,8 @@ DupDictInternalRep(
InitChainTable(newDict);
for (cPtr=oldDict->entryChainHead ; cPtr!=NULL ; cPtr=cPtr->nextPtr) {
- Tcl_Obj *key = Tcl_GetHashKey(&oldDict->table, &cPtr->entry);
- Tcl_Obj *valuePtr = Tcl_GetHashValue(&cPtr->entry);
+ Tcl_Obj *key = (Tcl_Obj *)Tcl_GetHashKey(&oldDict->table, &cPtr->entry);
+ Tcl_Obj *valuePtr = (Tcl_Obj *)Tcl_GetHashValue(&cPtr->entry);
int n;
Tcl_HashEntry *hPtr = CreateChainEntry(newDict, key, &n);
@@ -536,7 +536,7 @@ UpdateStringOfDict(
if (numElems <= LOCAL_SIZE) {
flagPtr = localFlags;
} else {
- flagPtr = ckalloc(numElems);
+ flagPtr = (char *)ckalloc(numElems);
}
for (i=0,cPtr=dict->entryChainHead; i<numElems; i+=2,cPtr=cPtr->nextPtr) {
/*
@@ -545,7 +545,7 @@ UpdateStringOfDict(
*/
flagPtr[i] = ( i ? TCL_DONT_QUOTE_HASH : 0 );
- keyPtr = Tcl_GetHashKey(&dict->table, &cPtr->entry);
+ keyPtr = (Tcl_Obj *)Tcl_GetHashKey(&dict->table, &cPtr->entry);
elem = TclGetStringFromObj(keyPtr, &length);
bytesNeeded += TclScanElement(elem, length, flagPtr+i);
if (bytesNeeded < 0) {
@@ -553,7 +553,7 @@ UpdateStringOfDict(
}
flagPtr[i+1] = TCL_DONT_QUOTE_HASH;
- valuePtr = Tcl_GetHashValue(&cPtr->entry);
+ valuePtr = (Tcl_Obj *)Tcl_GetHashValue(&cPtr->entry);
elem = TclGetStringFromObj(valuePtr, &length);
bytesNeeded += TclScanElement(elem, length, flagPtr+i+1);
if (bytesNeeded < 0) {
@@ -573,13 +573,13 @@ UpdateStringOfDict(
TclOOM(dst, bytesNeeded);
for (i=0,cPtr=dict->entryChainHead; i<numElems; i+=2,cPtr=cPtr->nextPtr) {
flagPtr[i] |= ( i ? TCL_DONT_QUOTE_HASH : 0 );
- keyPtr = Tcl_GetHashKey(&dict->table, &cPtr->entry);
+ keyPtr = (Tcl_Obj *)Tcl_GetHashKey(&dict->table, &cPtr->entry);
elem = TclGetStringFromObj(keyPtr, &length);
dst += TclConvertElement(elem, length, dst, flagPtr[i]);
*dst++ = ' ';
flagPtr[i+1] |= TCL_DONT_QUOTE_HASH;
- valuePtr = Tcl_GetHashValue(&cPtr->entry);
+ valuePtr = (Tcl_Obj *)Tcl_GetHashValue(&cPtr->entry);
elem = TclGetStringFromObj(valuePtr, &length);
dst += TclConvertElement(elem, length, dst, flagPtr[i+1]);
*dst++ = ' ';
@@ -618,7 +618,7 @@ SetDictFromAny(
{
Tcl_HashEntry *hPtr;
int isNew;
- Dict *dict = ckalloc(sizeof(Dict));
+ Dict *dict = (Dict *)ckalloc(sizeof(Dict));
InitChainTable(dict);
@@ -643,7 +643,7 @@ SetDictFromAny(
/* Store key and value in the hash table we're building. */
hPtr = CreateChainEntry(dict, objv[i], &isNew);
if (!isNew) {
- Tcl_Obj *discardedValue = Tcl_GetHashValue(hPtr);
+ Tcl_Obj *discardedValue = (Tcl_Obj *)Tcl_GetHashValue(hPtr);
/*
* Not really a well-formed dictionary as there are duplicate
@@ -716,7 +716,7 @@ SetDictFromAny(
/* Store key and value in the hash table we're building. */
hPtr = CreateChainEntry(dict, keyPtr, &isNew);
if (!isNew) {
- Tcl_Obj *discardedValue = Tcl_GetHashValue(hPtr);
+ Tcl_Obj *discardedValue = (Tcl_Obj *)Tcl_GetHashValue(hPtr);
TclDecrRefCount(keyPtr);
TclDecrRefCount(discardedValue);
@@ -851,7 +851,7 @@ TclTraceDictPath(
Tcl_IncrRefCount(tmpObj);
Tcl_SetHashValue(hPtr, tmpObj);
} else {
- tmpObj = Tcl_GetHashValue(hPtr);
+ tmpObj = (Tcl_Obj *)Tcl_GetHashValue(hPtr);
DictGetIntRep(tmpObj, newDict);
@@ -972,7 +972,7 @@ Tcl_DictObjPut(
DictSetIntRep(dictPtr, dict);
Tcl_IncrRefCount(valuePtr);
if (!isNew) {
- Tcl_Obj *oldValuePtr = Tcl_GetHashValue(hPtr);
+ Tcl_Obj *oldValuePtr = (Tcl_Obj *)Tcl_GetHashValue(hPtr);
TclDecrRefCount(oldValuePtr);
}
@@ -1021,7 +1021,7 @@ Tcl_DictObjGet(
if (hPtr == NULL) {
*valuePtrPtr = NULL;
} else {
- *valuePtrPtr = Tcl_GetHashValue(hPtr);
+ *valuePtrPtr = (Tcl_Obj *)Tcl_GetHashValue(hPtr);
}
return TCL_OK;
}
@@ -1162,10 +1162,10 @@ Tcl_DictObjFirst(
searchPtr->next = cPtr->nextPtr;
dict->refCount++;
if (keyPtrPtr != NULL) {
- *keyPtrPtr = Tcl_GetHashKey(&dict->table, &cPtr->entry);
+ *keyPtrPtr = (Tcl_Obj *)Tcl_GetHashKey(&dict->table, &cPtr->entry);
}
if (valuePtrPtr != NULL) {
- *valuePtrPtr = Tcl_GetHashValue(&cPtr->entry);
+ *valuePtrPtr = (Tcl_Obj *)Tcl_GetHashValue(&cPtr->entry);
}
}
return TCL_OK;
@@ -1228,7 +1228,7 @@ Tcl_DictObjNext(
Tcl_Panic("concurrent dictionary modification and search");
}
- cPtr = searchPtr->next;
+ cPtr = (ChainEntry *)searchPtr->next;
if (cPtr == NULL) {
Tcl_DictObjDone(searchPtr);
*donePtr = 1;
@@ -1238,11 +1238,11 @@ Tcl_DictObjNext(
searchPtr->next = cPtr->nextPtr;
*donePtr = 0;
if (keyPtrPtr != NULL) {
- *keyPtrPtr = Tcl_GetHashKey(
+ *keyPtrPtr = (Tcl_Obj *)Tcl_GetHashKey(
&((Dict *)searchPtr->dictionaryPtr)->table, &cPtr->entry);
}
if (valuePtrPtr != NULL) {
- *valuePtrPtr = Tcl_GetHashValue(&cPtr->entry);
+ *valuePtrPtr = (Tcl_Obj *)Tcl_GetHashValue(&cPtr->entry);
}
}
@@ -1329,7 +1329,7 @@ Tcl_DictObjPutKeyList(
hPtr = CreateChainEntry(dict, keyv[keyc-1], &isNew);
Tcl_IncrRefCount(valuePtr);
if (!isNew) {
- Tcl_Obj *oldValuePtr = Tcl_GetHashValue(hPtr);
+ Tcl_Obj *oldValuePtr = (Tcl_Obj *)Tcl_GetHashValue(hPtr);
TclDecrRefCount(oldValuePtr);
}
@@ -1424,7 +1424,7 @@ Tcl_NewDictObj(void)
TclNewObj(dictPtr);
TclInvalidateStringRep(dictPtr);
- dict = ckalloc(sizeof(Dict));
+ dict = (Dict *)ckalloc(sizeof(Dict));
InitChainTable(dict);
dict->epoch = 1;
dict->chain = NULL;
@@ -2569,10 +2569,10 @@ DictForLoopCallback(
int result)
{
Interp *iPtr = (Interp *) interp;
- Tcl_DictSearch *searchPtr = data[0];
- Tcl_Obj *keyVarObj = data[1];
- Tcl_Obj *valueVarObj = data[2];
- Tcl_Obj *scriptObj = data[3];
+ Tcl_DictSearch *searchPtr = (Tcl_DictSearch *)data[0];
+ Tcl_Obj *keyVarObj = (Tcl_Obj *)data[1];
+ Tcl_Obj *valueVarObj = (Tcl_Obj *)data[2];
+ Tcl_Obj *scriptObj = (Tcl_Obj *)data[3];
Tcl_Obj *keyObj, *valueObj;
int done;
@@ -2773,7 +2773,7 @@ DictMapLoopCallback(
int result)
{
Interp *iPtr = (Interp *) interp;
- DictMapStorage *storagePtr = data[0];
+ DictMapStorage *storagePtr = (DictMapStorage *)data[0];
Tcl_Obj *keyObj, *valueObj;
int done;
@@ -3340,8 +3340,8 @@ FinalizeDictUpdate(
Tcl_Obj *dictPtr, *objPtr, **objv;
Tcl_InterpState state;
int i, objc;
- Tcl_Obj *varName = data[0];
- Tcl_Obj *argsObj = data[1];
+ Tcl_Obj *varName = (Tcl_Obj *)data[0];
+ Tcl_Obj *argsObj = (Tcl_Obj *)data[1];
/*
* ErrorInfo handling.
@@ -3491,9 +3491,9 @@ FinalizeDictWith(
Tcl_Obj **pathv;
int pathc;
Tcl_InterpState state;
- Tcl_Obj *varName = data[0];
- Tcl_Obj *keysPtr = data[1];
- Tcl_Obj *pathPtr = data[2];
+ Tcl_Obj *varName = (Tcl_Obj *)data[0];
+ Tcl_Obj *keysPtr = (Tcl_Obj *)data[1];
+ Tcl_Obj *pathPtr = (Tcl_Obj *)data[2];
Var *varPtr, *arrayPtr;
if (result == TCL_ERROR) {