summaryrefslogtreecommitdiffstats
path: root/generic/tclInterp.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2019-07-10 05:51:56 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2019-07-10 05:51:56 (GMT)
commit6a4aafe17fbc322b30ef749f7321a6ae959dc396 (patch)
tree75ee68f89422b10ec42523bafa46fae061c6489d /generic/tclInterp.c
parent1f3c9596a6b416e667c32e43484991d7d0b9b4d7 (diff)
parenteb2cc1a749241d99c8e1f9df959b79a2fdbe8684 (diff)
downloadtcl-6a4aafe17fbc322b30ef749f7321a6ae959dc396.zip
tcl-6a4aafe17fbc322b30ef749f7321a6ae959dc396.tar.gz
tcl-6a4aafe17fbc322b30ef749f7321a6ae959dc396.tar.bz2
Merge 8.7, and continue implementation. Almost done
Diffstat (limited to 'generic/tclInterp.c')
-rw-r--r--generic/tclInterp.c72
1 files changed, 36 insertions, 36 deletions
diff --git a/generic/tclInterp.c b/generic/tclInterp.c
index e76e41e..097e4b2 100644
--- a/generic/tclInterp.c
+++ b/generic/tclInterp.c
@@ -336,7 +336,7 @@ Tcl_Init(
Tcl_Interp *interp) /* Interpreter to initialize. */
{
PkgName pkgName = {NULL, "Tcl"};
- PkgName **names = TclInitPkgFiles(interp);
+ PkgName **names = (PkgName **)TclInitPkgFiles(interp);
int result = TCL_ERROR;
pkgName.nextPtr = *names;
@@ -485,7 +485,7 @@ TclInterpInit(
Master *masterPtr;
Slave *slavePtr;
- interpInfoPtr = ckalloc(sizeof(InterpInfo));
+ interpInfoPtr = (InterpInfo *)ckalloc(sizeof(InterpInfo));
((Interp *) interp)->interpInfo = interpInfoPtr;
masterPtr = &interpInfoPtr->master;
@@ -1034,7 +1034,7 @@ NRInterpCmd(
resultPtr = Tcl_NewObj();
hPtr = Tcl_FirstHashEntry(&iiPtr->master.slaveTable, &hashSearch);
for ( ; hPtr != NULL; hPtr = Tcl_NextHashEntry(&hashSearch)) {
- string = Tcl_GetHashKey(&iiPtr->master.slaveTable, hPtr);
+ string = (char *)Tcl_GetHashKey(&iiPtr->master.slaveTable, hPtr);
Tcl_ListObjAppendElement(NULL, resultPtr,
Tcl_NewStringObj(string, -1));
}
@@ -1105,7 +1105,7 @@ NRInterpCmd(
NULL);
return TCL_ERROR;
}
- aliasPtr = Tcl_GetHashValue(hPtr);
+ aliasPtr = (Alias *)Tcl_GetHashValue(hPtr);
if (Tcl_GetInterpPath(interp, aliasPtr->targetInterp) != TCL_OK) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"target interpreter for alias \"%s\" in path \"%s\" is "
@@ -1294,7 +1294,7 @@ Tcl_GetAlias(
Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "ALIAS", aliasName, NULL);
return TCL_ERROR;
}
- aliasPtr = Tcl_GetHashValue(hPtr);
+ aliasPtr = (Alias *)Tcl_GetHashValue(hPtr);
objc = aliasPtr->objc;
objv = &aliasPtr->objPtr;
@@ -1356,7 +1356,7 @@ Tcl_GetAliasObj(
Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "ALIAS", aliasName, NULL);
return TCL_ERROR;
}
- aliasPtr = Tcl_GetHashValue(hPtr);
+ aliasPtr = (Alias *)Tcl_GetHashValue(hPtr);
objc = aliasPtr->objc;
objv = &aliasPtr->objPtr;
@@ -1425,7 +1425,7 @@ TclPreventAliasLoop(
* chain then we have a loop.
*/
- aliasPtr = cmdPtr->objClientData;
+ aliasPtr = (Alias *)cmdPtr->objClientData;
nextAliasPtr = aliasPtr;
while (1) {
Tcl_Obj *cmdNamePtr;
@@ -1474,7 +1474,7 @@ TclPreventAliasLoop(
&& aliasCmdPtr->objProc != TclLocalAliasObjCmd) {
return TCL_OK;
}
- nextAliasPtr = aliasCmdPtr->objClientData;
+ nextAliasPtr = (Alias *)aliasCmdPtr->objClientData;
}
/* NOTREACHED */
@@ -1517,7 +1517,7 @@ AliasCreate(
Tcl_Obj **prefv;
int isNew, i;
- aliasPtr = ckalloc(sizeof(Alias) + objc * sizeof(Tcl_Obj *));
+ aliasPtr = (Alias *)ckalloc(sizeof(Alias) + objc * sizeof(Tcl_Obj *));
aliasPtr->token = namePtr;
Tcl_IncrRefCount(aliasPtr->token);
aliasPtr->targetInterp = masterInterp;
@@ -1625,7 +1625,7 @@ AliasCreate(
* interp alias {} foo {} zop # Now recreate "foo"...
*/
- targetPtr = ckalloc(sizeof(Target));
+ targetPtr = (Target *)ckalloc(sizeof(Target));
targetPtr->slaveCmd = aliasPtr->slaveCmd;
targetPtr->slaveInterp = slaveInterp;
@@ -1686,7 +1686,7 @@ AliasDelete(
TclGetString(namePtr), NULL);
return TCL_ERROR;
}
- aliasPtr = Tcl_GetHashValue(hPtr);
+ aliasPtr = (Alias *)Tcl_GetHashValue(hPtr);
Tcl_DeleteCommandFromToken(slaveInterp, aliasPtr->slaveCmd);
return TCL_OK;
}
@@ -1731,7 +1731,7 @@ AliasDescribe(
if (hPtr == NULL) {
return TCL_OK;
}
- aliasPtr = Tcl_GetHashValue(hPtr);
+ aliasPtr = (Alias *)Tcl_GetHashValue(hPtr);
prefixPtr = Tcl_NewListObj(aliasPtr->objc, &aliasPtr->objPtr);
Tcl_SetObjResult(interp, prefixPtr);
return TCL_OK;
@@ -1768,7 +1768,7 @@ AliasList(
entryPtr = Tcl_FirstHashEntry(&slavePtr->aliasTable, &hashSearch);
for ( ; entryPtr != NULL; entryPtr = Tcl_NextHashEntry(&hashSearch)) {
- aliasPtr = Tcl_GetHashValue(entryPtr);
+ aliasPtr = (Alias *)Tcl_GetHashValue(entryPtr);
Tcl_ListObjAppendElement(NULL, resultPtr, aliasPtr->token);
}
Tcl_SetObjResult(interp, resultPtr);
@@ -1809,7 +1809,7 @@ AliasNRCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument vector. */
{
- Alias *aliasPtr = clientData;
+ Alias *aliasPtr = (Alias *)clientData;
int prefc, cmdc, i;
Tcl_Obj **prefv, **cmdv;
Tcl_Obj *listPtr;
@@ -1858,7 +1858,7 @@ TclAliasObjCmd(
Tcl_Obj *const objv[]) /* Argument vector. */
{
#define ALIAS_CMDV_PREALLOC 10
- Alias *aliasPtr = clientData;
+ Alias *aliasPtr = (Alias *)clientData;
Tcl_Interp *targetInterp = aliasPtr->targetInterp;
int result, prefc, cmdc, i;
Tcl_Obj **prefv, **cmdv;
@@ -1877,7 +1877,7 @@ TclAliasObjCmd(
if (cmdc <= ALIAS_CMDV_PREALLOC) {
cmdv = cmdArr;
} else {
- cmdv = TclStackAlloc(interp, cmdc * sizeof(Tcl_Obj *));
+ cmdv = (Tcl_Obj **)TclStackAlloc(interp, cmdc * sizeof(Tcl_Obj *));
}
memcpy(cmdv, prefv, prefc * sizeof(Tcl_Obj *));
@@ -1949,7 +1949,7 @@ TclLocalAliasObjCmd(
Tcl_Obj *const objv[]) /* Argument vector. */
{
#define ALIAS_CMDV_PREALLOC 10
- Alias *aliasPtr = clientData;
+ Alias *aliasPtr = (Alias *)clientData;
int result, prefc, cmdc, i;
Tcl_Obj **prefv, **cmdv;
Tcl_Obj *cmdArr[ALIAS_CMDV_PREALLOC];
@@ -1967,7 +1967,7 @@ TclLocalAliasObjCmd(
if (cmdc <= ALIAS_CMDV_PREALLOC) {
cmdv = cmdArr;
} else {
- cmdv = TclStackAlloc(interp, cmdc * sizeof(Tcl_Obj *));
+ cmdv = (Tcl_Obj **)TclStackAlloc(interp, cmdc * sizeof(Tcl_Obj *));
}
memcpy(cmdv, prefv, prefc * sizeof(Tcl_Obj *));
@@ -2030,7 +2030,7 @@ static void
AliasObjCmdDeleteProc(
ClientData clientData) /* The alias record for this alias. */
{
- Alias *aliasPtr = clientData;
+ Alias *aliasPtr = (Alias *)clientData;
Target *targetPtr;
int i;
Tcl_Obj **objv;
@@ -2206,7 +2206,7 @@ TclSetSlaveCancelFlags(
hPtr = Tcl_FirstHashEntry(&masterPtr->slaveTable, &hashSearch);
for ( ; hPtr != NULL; hPtr = Tcl_NextHashEntry(&hashSearch)) {
- slavePtr = Tcl_GetHashValue(hPtr);
+ slavePtr = (Slave *)Tcl_GetHashValue(hPtr);
iPtr = (Interp *) slavePtr->slaveInterp;
if (iPtr == NULL) {
@@ -2271,7 +2271,7 @@ Tcl_GetInterpPath(
return TCL_ERROR;
}
Tcl_ListObjAppendElement(NULL, Tcl_GetObjResult(askingInterp),
- Tcl_NewStringObj(Tcl_GetHashKey(&iiPtr->master.slaveTable,
+ Tcl_NewStringObj((const char *)Tcl_GetHashKey(&iiPtr->master.slaveTable,
iiPtr->slave.slaveEntryPtr), -1));
return TCL_OK;
}
@@ -2319,7 +2319,7 @@ GetInterp(
searchInterp = NULL;
break;
}
- slavePtr = Tcl_GetHashValue(hPtr);
+ slavePtr = (Slave *)Tcl_GetHashValue(hPtr);
searchInterp = slavePtr->slaveInterp;
if (searchInterp == NULL) {
break;
@@ -2545,7 +2545,7 @@ NRSlaveCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
- Tcl_Interp *slaveInterp = clientData;
+ Tcl_Interp *slaveInterp = (Tcl_Interp *)clientData;
int index;
static const char *const options[] = {
"alias", "aliases", "bgerror", "debug",
@@ -2748,7 +2748,7 @@ SlaveObjCmdDeleteProc(
ClientData clientData) /* The SlaveRecord for the command. */
{
Slave *slavePtr; /* Interim storage for Slave record. */
- Tcl_Interp *slaveInterp = clientData;
+ Tcl_Interp *slaveInterp = (Tcl_Interp *)clientData;
/* And for a slave interp. */
slavePtr = &((InterpInfo *) ((Interp *) slaveInterp)->interpInfo)->slave;
@@ -3088,7 +3088,7 @@ SlaveHidden(
hPtr != NULL;
hPtr = Tcl_NextHashEntry(&hSearch)) {
Tcl_ListObjAppendElement(NULL, listObjPtr,
- Tcl_NewStringObj(Tcl_GetHashKey(hTblPtr, hPtr), -1));
+ Tcl_NewStringObj((const char *)Tcl_GetHashKey(hTblPtr, hPtr), -1));
}
}
Tcl_SetObjResult(interp, listObjPtr);
@@ -3604,7 +3604,7 @@ Tcl_LimitAddHandler(
* Allocate a handler record.
*/
- handlerPtr = ckalloc(sizeof(LimitHandler));
+ handlerPtr = (LimitHandler *)ckalloc(sizeof(LimitHandler));
handlerPtr->flags = 0;
handlerPtr->handlerProc = handlerProc;
handlerPtr->clientData = clientData;
@@ -4061,8 +4061,8 @@ static void
TimeLimitCallback(
ClientData clientData)
{
- Tcl_Interp *interp = clientData;
- Interp *iPtr = clientData;
+ Tcl_Interp *interp = (Tcl_Interp *)clientData;
+ Interp *iPtr = (Interp *)clientData;
int code;
Tcl_Preserve(interp);
@@ -4205,7 +4205,7 @@ static void
DeleteScriptLimitCallback(
ClientData clientData)
{
- ScriptLimitCallback *limitCBPtr = clientData;
+ ScriptLimitCallback *limitCBPtr = (ScriptLimitCallback *)clientData;
Tcl_DecrRefCount(limitCBPtr->scriptObj);
if (limitCBPtr->entryPtr != NULL) {
@@ -4237,7 +4237,7 @@ CallScriptLimitCallback(
ClientData clientData,
Tcl_Interp *interp) /* Interpreter which failed the limit */
{
- ScriptLimitCallback *limitCBPtr = clientData;
+ ScriptLimitCallback *limitCBPtr = (ScriptLimitCallback *)clientData;
int code;
if (Tcl_InterpDeleted(limitCBPtr->interp)) {
@@ -4305,13 +4305,13 @@ SetScriptLimitCallback(
hashPtr = Tcl_CreateHashEntry(&iPtr->limit.callbacks, &key,
&isNew);
if (!isNew) {
- limitCBPtr = Tcl_GetHashValue(hashPtr);
+ limitCBPtr = (ScriptLimitCallback *)Tcl_GetHashValue(hashPtr);
limitCBPtr->entryPtr = NULL;
Tcl_LimitRemoveHandler(targetInterp, type, CallScriptLimitCallback,
limitCBPtr);
}
- limitCBPtr = ckalloc(sizeof(ScriptLimitCallback));
+ limitCBPtr = (ScriptLimitCallback *)ckalloc(sizeof(ScriptLimitCallback));
limitCBPtr->interp = interp;
limitCBPtr->scriptObj = scriptObj;
limitCBPtr->entryPtr = hashPtr;
@@ -4500,7 +4500,7 @@ SlaveCommandLimitCmd(
key.type = TCL_LIMIT_COMMANDS;
hPtr = Tcl_FindHashEntry(&iPtr->limit.callbacks, (char *) &key);
if (hPtr != NULL) {
- limitCBPtr = Tcl_GetHashValue(hPtr);
+ limitCBPtr = (ScriptLimitCallback *)Tcl_GetHashValue(hPtr);
if (limitCBPtr != NULL && limitCBPtr->scriptObj != NULL) {
Tcl_DictObjPut(NULL, dictPtr, Tcl_NewStringObj(options[0], -1),
limitCBPtr->scriptObj);
@@ -4542,7 +4542,7 @@ SlaveCommandLimitCmd(
key.type = TCL_LIMIT_COMMANDS;
hPtr = Tcl_FindHashEntry(&iPtr->limit.callbacks, (char *) &key);
if (hPtr != NULL) {
- limitCBPtr = Tcl_GetHashValue(hPtr);
+ limitCBPtr = (ScriptLimitCallback *)Tcl_GetHashValue(hPtr);
if (limitCBPtr != NULL && limitCBPtr->scriptObj != NULL) {
Tcl_SetObjResult(interp, limitCBPtr->scriptObj);
}
@@ -4688,7 +4688,7 @@ SlaveTimeLimitCmd(
key.type = TCL_LIMIT_TIME;
hPtr = Tcl_FindHashEntry(&iPtr->limit.callbacks, (char *) &key);
if (hPtr != NULL) {
- limitCBPtr = Tcl_GetHashValue(hPtr);
+ limitCBPtr = (ScriptLimitCallback *)Tcl_GetHashValue(hPtr);
if (limitCBPtr != NULL && limitCBPtr->scriptObj != NULL) {
Tcl_DictObjPut(NULL, dictPtr, Tcl_NewStringObj(options[0], -1),
limitCBPtr->scriptObj);
@@ -4736,7 +4736,7 @@ SlaveTimeLimitCmd(
key.type = TCL_LIMIT_TIME;
hPtr = Tcl_FindHashEntry(&iPtr->limit.callbacks, (char *) &key);
if (hPtr != NULL) {
- limitCBPtr = Tcl_GetHashValue(hPtr);
+ limitCBPtr = (ScriptLimitCallback *)Tcl_GetHashValue(hPtr);
if (limitCBPtr != NULL && limitCBPtr->scriptObj != NULL) {
Tcl_SetObjResult(interp, limitCBPtr->scriptObj);
}