summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--generic/tclBasic.c60
-rw-r--r--generic/tclCmdIL.c6
-rw-r--r--generic/tclCmdMZ.c8
-rw-r--r--generic/tclCompExpr.c20
-rw-r--r--generic/tclCompile.c6
-rw-r--r--generic/tclDictObj.c4
-rw-r--r--generic/tclEvent.c76
-rw-r--r--generic/tclExecute.c2
-rw-r--r--generic/tclFileName.c2
-rw-r--r--generic/tclIOCmd.c2
-rw-r--r--generic/tclIndexObj.c16
-rw-r--r--generic/tclInt.h2
-rw-r--r--generic/tclInterp.c2
-rw-r--r--generic/tclNamesp.c10
-rw-r--r--generic/tclOOCall.c4
-rw-r--r--generic/tclOODefineCmds.c6
-rw-r--r--generic/tclOOMethod.c4
-rw-r--r--generic/tclParse.c6
-rw-r--r--generic/tclProc.c12
-rw-r--r--generic/tclRegexp.c8
-rw-r--r--generic/tclScan.c2
-rw-r--r--generic/tclTest.c65
-rw-r--r--generic/tclTestObj.c42
-rw-r--r--generic/tclTestProcBodyObj.c16
-rw-r--r--generic/tclThreadAlloc.c28
-rw-r--r--generic/tclThreadTest.c44
-rw-r--r--generic/tclTrace.c2
-rw-r--r--unix/tclEpollNotfy.c12
-rw-r--r--unix/tclKqueueNotfy.c12
-rw-r--r--unix/tclLoadDl.c2
-rw-r--r--unix/tclLoadDyld.c14
-rw-r--r--unix/tclLoadNext.c2
-rw-r--r--unix/tclLoadOSF.c2
-rw-r--r--unix/tclLoadShl.c2
-rw-r--r--unix/tclSelectNotfy.c2
-rw-r--r--unix/tclUnixChan.c90
-rw-r--r--unix/tclUnixCompat.c24
-rw-r--r--unix/tclUnixFCmd.c84
-rw-r--r--unix/tclUnixFile.c30
-rw-r--r--unix/tclUnixInit.c2
-rw-r--r--unix/tclUnixPipe.c54
-rw-r--r--unix/tclUnixSock.c90
-rw-r--r--unix/tclUnixTest.c2
-rw-r--r--unix/tclUnixThrd.c14
-rw-r--r--unix/tclUnixTime.c4
-rw-r--r--unix/tclXtNotify.c4
-rw-r--r--win/tclWinDde.c8
-rw-r--r--win/tclWinReg.c8
-rw-r--r--win/tclWinTest.c6
49 files changed, 461 insertions, 462 deletions
diff --git a/generic/tclBasic.c b/generic/tclBasic.c
index 9832807..616457d 100644
--- a/generic/tclBasic.c
+++ b/generic/tclBasic.c
@@ -453,24 +453,24 @@ typedef struct {
const char *name; /* Name of the function. The full name is
* "::tcl::mathfunc::<name>". */
Tcl_ObjCmdProc *objCmdProc; /* Function that evaluates the function */
- ClientData clientData; /* Client data for the function */
+ void *clientData; /* Client data for the function */
} BuiltinFuncDef;
static const BuiltinFuncDef BuiltinFuncTable[] = {
{ "abs", ExprAbsFunc, NULL },
- { "acos", ExprUnaryFunc, (ClientData) acos },
- { "asin", ExprUnaryFunc, (ClientData) asin },
- { "atan", ExprUnaryFunc, (ClientData) atan },
- { "atan2", ExprBinaryFunc, (ClientData) atan2 },
+ { "acos", ExprUnaryFunc, (void *) acos },
+ { "asin", ExprUnaryFunc, (void *) asin },
+ { "atan", ExprUnaryFunc, (void *) atan },
+ { "atan2", ExprBinaryFunc, (void *) atan2 },
{ "bool", ExprBoolFunc, NULL },
{ "ceil", ExprCeilFunc, NULL },
- { "cos", ExprUnaryFunc, (ClientData) cos },
- { "cosh", ExprUnaryFunc, (ClientData) cosh },
+ { "cos", ExprUnaryFunc, (void *) cos },
+ { "cosh", ExprUnaryFunc, (void *) cosh },
{ "double", ExprDoubleFunc, NULL },
{ "entier", ExprIntFunc, NULL },
- { "exp", ExprUnaryFunc, (ClientData) exp },
+ { "exp", ExprUnaryFunc, (void *) exp },
{ "floor", ExprFloorFunc, NULL },
- { "fmod", ExprBinaryFunc, (ClientData) fmod },
- { "hypot", ExprBinaryFunc, (ClientData) hypot },
+ { "fmod", ExprBinaryFunc, (void *) fmod },
+ { "hypot", ExprBinaryFunc, (void *) hypot },
{ "int", ExprIntFunc, NULL },
{ "isfinite", ExprIsFiniteFunc, NULL },
{ "isinf", ExprIsInfinityFunc, NULL },
@@ -479,19 +479,19 @@ static const BuiltinFuncDef BuiltinFuncTable[] = {
{ "isqrt", ExprIsqrtFunc, NULL },
{ "issubnormal", ExprIsSubnormalFunc, NULL, },
{ "isunordered", ExprIsUnorderedFunc, NULL, },
- { "log", ExprUnaryFunc, (ClientData) log },
- { "log10", ExprUnaryFunc, (ClientData) log10 },
+ { "log", ExprUnaryFunc, (void *) log },
+ { "log10", ExprUnaryFunc, (void *) log10 },
{ "max", ExprMaxFunc, NULL },
{ "min", ExprMinFunc, NULL },
- { "pow", ExprBinaryFunc, (ClientData) pow },
+ { "pow", ExprBinaryFunc, (void *) pow },
{ "rand", ExprRandFunc, NULL },
{ "round", ExprRoundFunc, NULL },
- { "sin", ExprUnaryFunc, (ClientData) sin },
- { "sinh", ExprUnaryFunc, (ClientData) sinh },
+ { "sin", ExprUnaryFunc, (void *) sin },
+ { "sinh", ExprUnaryFunc, (void *) sinh },
{ "sqrt", ExprSqrtFunc, NULL },
{ "srand", ExprSrandFunc, NULL },
- { "tan", ExprUnaryFunc, (ClientData) tan },
- { "tanh", ExprUnaryFunc, (ClientData) tanh },
+ { "tan", ExprUnaryFunc, (void *) tan },
+ { "tanh", ExprUnaryFunc, (void *) tanh },
{ "wide", ExprWideFunc, NULL },
{ NULL, NULL, NULL }
};
@@ -1330,7 +1330,7 @@ TclHideUnsafeCommands(
Tcl_GetString(Tcl_GetObjResult(interp)));
}
Tcl_CreateObjCommand(interp, TclGetString(cmdName),
- BadEnsembleSubcommand, (ClientData) unsafePtr, NULL);
+ BadEnsembleSubcommand, (void *)unsafePtr, NULL);
TclDecrRefCount(cmdName);
TclDecrRefCount(hideName);
} else {
@@ -2829,7 +2829,7 @@ TclInvokeStringCommand(
{
Command *cmdPtr = clientData;
int i, result;
- const char **argv =
+ const char **argv = (const char **)
TclStackAlloc(interp, (objc + 1) * sizeof(char *));
for (i = 0; i < objc; i++) {
@@ -2875,10 +2875,10 @@ TclInvokeObjectCommand(
int argc, /* Number of arguments. */
register const char **argv) /* Argument strings. */
{
- Command *cmdPtr = clientData;
+ Command *cmdPtr = ( Command *) clientData;
Tcl_Obj *objPtr;
int i, length, result;
- Tcl_Obj **objv =
+ Tcl_Obj **objv = (Tcl_Obj **)
TclStackAlloc(interp, (argc * sizeof(Tcl_Obj *)));
for (i = 0; i < argc; i++) {
@@ -3330,7 +3330,7 @@ Tcl_GetCommandName(
return "";
}
- return Tcl_GetHashKey(cmdPtr->hPtr->tablePtr, cmdPtr->hPtr);
+ return (const char *)Tcl_GetHashKey(cmdPtr->hPtr->tablePtr, cmdPtr->hPtr);
}
/*
@@ -3380,7 +3380,7 @@ Tcl_GetCommandFullName(
}
}
if (cmdPtr->hPtr != NULL) {
- name = Tcl_GetHashKey(cmdPtr->hPtr->tablePtr, cmdPtr->hPtr);
+ name = (char *)Tcl_GetHashKey(cmdPtr->hPtr->tablePtr, cmdPtr->hPtr);
Tcl_AppendToObj(objPtr, name, -1);
}
}
@@ -5064,7 +5064,7 @@ TEOV_NotFound(
Tcl_ListObjGetElements(NULL, currNsPtr->unknownHandlerPtr,
&handlerObjc, &handlerObjv);
newObjc = objc + handlerObjc;
- newObjv = TclStackAlloc(interp, sizeof(Tcl_Obj *) * newObjc);
+ newObjv = (Tcl_Obj **)TclStackAlloc(interp, sizeof(Tcl_Obj *) * newObjc);
/*
* Copy command prefix from unknown handler and add on the real command's
@@ -5431,12 +5431,12 @@ TclEvalEx(
* state has been allocated while evaluating
* the script, so that it can be freed
* properly if an error occurs. */
- Tcl_Parse *parsePtr = TclStackAlloc(interp, sizeof(Tcl_Parse));
- CmdFrame *eeFramePtr = TclStackAlloc(interp, sizeof(CmdFrame));
- Tcl_Obj **stackObjArray =
+ Tcl_Parse *parsePtr = (Tcl_Parse *)TclStackAlloc(interp, sizeof(Tcl_Parse));
+ CmdFrame *eeFramePtr = (CmdFrame *)TclStackAlloc(interp, sizeof(CmdFrame));
+ Tcl_Obj **stackObjArray = (Tcl_Obj **)
TclStackAlloc(interp, minObjs * sizeof(Tcl_Obj *));
- int *expandStack = TclStackAlloc(interp, minObjs * sizeof(int));
- int *linesStack = TclStackAlloc(interp, minObjs * sizeof(int));
+ int *expandStack = (int *)TclStackAlloc(interp, minObjs * sizeof(int));
+ int *linesStack = (int *)TclStackAlloc(interp, minObjs * sizeof(int));
/* TIP #280 Structures for tracking of command
* locations. */
int *clNext = NULL; /* Pointer for the tracking of invisible
@@ -6486,7 +6486,7 @@ TclNREvalObjEx(
* should be pushed, as needed by alias and ensemble redirections.
*/
- eoFramePtr = TclStackAlloc(interp, sizeof(CmdFrame));
+ eoFramePtr = (CmdFrame *)TclStackAlloc(interp, sizeof(CmdFrame));
eoFramePtr->nline = 0;
eoFramePtr->line = NULL;
diff --git a/generic/tclCmdIL.c b/generic/tclCmdIL.c
index cbb40c6..cd3cb79 100644
--- a/generic/tclCmdIL.c
+++ b/generic/tclCmdIL.c
@@ -1313,7 +1313,7 @@ TclInfoFrame(
* Execution of bytecode. Talk to the BC engine to fill out the frame.
*/
- CmdFrame *fPtr = TclStackAlloc(interp, sizeof(CmdFrame));
+ CmdFrame *fPtr = (CmdFrame *)TclStackAlloc(interp, sizeof(CmdFrame));
*fPtr = *framePtr;
@@ -3362,7 +3362,7 @@ Tcl_LsearchObjCmd(
sortInfo.indexv = &sortInfo.singleIndex;
break;
default:
- sortInfo.indexv =
+ sortInfo.indexv = (int *)
TclStackAlloc(interp, sizeof(int) * sortInfo.indexc);
allocatedIndexVector = 1; /* Cannot use indexc field, as it
* might be decreased by 1 later. */
@@ -4179,7 +4179,7 @@ Tcl_LsortObjCmd(
sortInfo.indexv = &sortInfo.singleIndex;
break;
default:
- sortInfo.indexv =
+ sortInfo.indexv = (int *)
TclStackAlloc(interp, sizeof(int) * sortInfo.indexc);
allocatedIndexVector = 1; /* Cannot use indexc field, as it
* might be decreased by 1 later. */
diff --git a/generic/tclCmdMZ.c b/generic/tclCmdMZ.c
index cdc1e28..58c5b5e 100644
--- a/generic/tclCmdMZ.c
+++ b/generic/tclCmdMZ.c
@@ -2037,7 +2037,7 @@ StringMapCmd(
* adapt this code...
*/
- mapElemv = TclStackAlloc(interp, sizeof(Tcl_Obj *) * mapElemc);
+ mapElemv = (Tcl_Obj **)TclStackAlloc(interp, sizeof(Tcl_Obj *) * mapElemc);
Tcl_DictObjFirst(interp, objv[objc-2], &search, mapElemv+0,
mapElemv+1, &done);
for (i=2 ; i<mapElemc ; i+=2) {
@@ -2148,10 +2148,10 @@ StringMapCmd(
* case.
*/
- mapStrings = TclStackAlloc(interp, mapElemc*2*sizeof(Tcl_UniChar *));
- mapLens = TclStackAlloc(interp, mapElemc * 2 * sizeof(int));
+ mapStrings = (Tcl_UniChar **)TclStackAlloc(interp, mapElemc*2*sizeof(Tcl_UniChar *));
+ mapLens = (int *)TclStackAlloc(interp, mapElemc * 2 * sizeof(int));
if (nocase) {
- u2lc = TclStackAlloc(interp, mapElemc * sizeof(int));
+ u2lc = (int *)TclStackAlloc(interp, mapElemc * sizeof(int));
}
for (index = 0; index < mapElemc; index++) {
mapStrings[index] = Tcl_GetUnicodeFromObj(mapElemv[index],
diff --git a/generic/tclCompExpr.c b/generic/tclCompExpr.c
index a6ac797..90549b0 100644
--- a/generic/tclCompExpr.c
+++ b/generic/tclCompExpr.c
@@ -919,7 +919,7 @@ ParseExpr(
break;
case SCRIPT: {
- Tcl_Parse *nestedPtr =
+ Tcl_Parse *nestedPtr = (Tcl_Parse *)
TclStackAlloc(interp, sizeof(Tcl_Parse));
tokenPtr = parsePtr->tokenPtr + parsePtr->numTokens;
@@ -1838,7 +1838,7 @@ Tcl_ParseExpr(
OpNode *opTree = NULL; /* Will point to the tree of operators. */
Tcl_Obj *litList = Tcl_NewObj(); /* List to hold the literals. */
Tcl_Obj *funcList = Tcl_NewObj(); /* List to hold the functon names. */
- Tcl_Parse *exprParsePtr = TclStackAlloc(interp, sizeof(Tcl_Parse));
+ Tcl_Parse *exprParsePtr = (Tcl_Parse *)TclStackAlloc(interp, sizeof(Tcl_Parse));
/* Holds the Tcl_Tokens of substitutions. */
if (numBytes < 0) {
@@ -2156,7 +2156,7 @@ TclCompileExpr(
OpNode *opTree = NULL; /* Will point to the tree of operators */
Tcl_Obj *litList = Tcl_NewObj(); /* List to hold the literals */
Tcl_Obj *funcList = Tcl_NewObj(); /* List to hold the functon names*/
- Tcl_Parse *parsePtr = TclStackAlloc(interp, sizeof(Tcl_Parse));
+ Tcl_Parse *parsePtr = (Tcl_Parse *)TclStackAlloc(interp, sizeof(Tcl_Parse));
/* Holds the Tcl_Tokens of substitutions */
int code = ParseExpr(interp, script, numBytes, &opTree, litList,
@@ -2226,7 +2226,7 @@ ExecConstantExprTree(
* bytecode, so there's no need to tend to TIP 280 issues.
*/
- envPtr = TclStackAlloc(interp, sizeof(CompileEnv));
+ envPtr = (CompileEnv *)TclStackAlloc(interp, sizeof(CompileEnv));
TclInitCompileEnv(interp, envPtr, NULL, 0, NULL, 0);
CompileExprTree(interp, nodes, index, litObjvPtr, NULL, NULL, envPtr,
0 /* optimize */);
@@ -2321,13 +2321,13 @@ CompileExprTree(
break;
}
case QUESTION:
- newJump = TclStackAlloc(interp, sizeof(JumpList));
+ newJump = (JumpList *)TclStackAlloc(interp, sizeof(JumpList));
newJump->next = jumpPtr;
jumpPtr = newJump;
TclEmitForwardJump(envPtr, TCL_FALSE_JUMP, &jumpPtr->jump);
break;
case COLON:
- newJump = TclStackAlloc(interp, sizeof(JumpList));
+ newJump = (JumpList *)TclStackAlloc(interp, sizeof(JumpList));
newJump->next = jumpPtr;
jumpPtr = newJump;
TclEmitForwardJump(envPtr, TCL_UNCONDITIONAL_JUMP,
@@ -2340,7 +2340,7 @@ CompileExprTree(
break;
case AND:
case OR:
- newJump = TclStackAlloc(interp, sizeof(JumpList));
+ newJump = (JumpList *)TclStackAlloc(interp, sizeof(JumpList));
newJump->next = jumpPtr;
jumpPtr = newJump;
TclEmitForwardJump(envPtr, (nodePtr->lexeme == AND)
@@ -2632,9 +2632,9 @@ TclSortingOpCmd(
Tcl_SetObjResult(interp, Tcl_NewBooleanObj(1));
} else {
TclOpCmdClientData *occdPtr = clientData;
- Tcl_Obj **litObjv = TclStackAlloc(interp,
+ Tcl_Obj **litObjv = (Tcl_Obj **)TclStackAlloc(interp,
2 * (objc-2) * sizeof(Tcl_Obj *));
- OpNode *nodes = TclStackAlloc(interp, 2 * (objc-2) * sizeof(OpNode));
+ OpNode *nodes = (OpNode *)TclStackAlloc(interp, 2 * (objc-2) * sizeof(OpNode));
unsigned char lexeme;
int i, lastAnd = 1;
Tcl_Obj *const *litObjPtrPtr = litObjv;
@@ -2761,7 +2761,7 @@ TclVariadicOpCmd(
return code;
} else {
Tcl_Obj *const *litObjv = objv + 1;
- OpNode *nodes = TclStackAlloc(interp, (objc-1) * sizeof(OpNode));
+ OpNode *nodes = (OpNode *)TclStackAlloc(interp, (objc-1) * sizeof(OpNode));
int i, lastOp = OT_LITERAL;
nodes[0].lexeme = START;
diff --git a/generic/tclCompile.c b/generic/tclCompile.c
index c10e3ee..6faa273 100644
--- a/generic/tclCompile.c
+++ b/generic/tclCompile.c
@@ -1148,7 +1148,7 @@ CleanupByteCode(
(char *) codePtr);
if (hePtr) {
- ReleaseCmdWordData(Tcl_GetHashValue(hePtr));
+ ReleaseCmdWordData((ExtCmdLoc *)Tcl_GetHashValue(hePtr));
Tcl_DeleteHashEntry(hePtr);
}
}
@@ -1554,7 +1554,7 @@ TclInitCompileEnv(
* ...) which may make change the type as well.
*/
- CmdFrame *ctxPtr = TclStackAlloc(interp, sizeof(CmdFrame));
+ CmdFrame *ctxPtr = (CmdFrame *)TclStackAlloc(interp, sizeof(CmdFrame));
int pc = 0;
*ctxPtr = *invoker;
@@ -2452,7 +2452,7 @@ TclCompileTokens(
if (numCL >= maxNumCL) {
maxNumCL *= 2;
- clPosition = ckrealloc(clPosition,
+ clPosition = (int *)ckrealloc(clPosition,
maxNumCL * sizeof(int));
}
clPosition[numCL] = clPos;
diff --git a/generic/tclDictObj.c b/generic/tclDictObj.c
index f3b0981..7862a0f 100644
--- a/generic/tclDictObj.c
+++ b/generic/tclDictObj.c
@@ -2499,7 +2499,7 @@ DictForNRCmd(
Tcl_SetErrorCode(interp, "TCL", "SYNTAX", "dict", "for", NULL);
return TCL_ERROR;
}
- searchPtr = TclStackAlloc(interp, sizeof(Tcl_DictSearch));
+ searchPtr = (Tcl_DictSearch *)TclStackAlloc(interp, sizeof(Tcl_DictSearch));
if (Tcl_DictObjFirst(interp, objv[2], searchPtr, &keyObj, &valueObj,
&done) != TCL_OK) {
TclStackFree(interp, searchPtr);
@@ -2693,7 +2693,7 @@ DictMapNRCmd(
Tcl_SetErrorCode(interp, "TCL", "SYNTAX", "dict", "map", NULL);
return TCL_ERROR;
}
- storagePtr = TclStackAlloc(interp, sizeof(DictMapStorage));
+ storagePtr = (DictMapStorage *)TclStackAlloc(interp, sizeof(DictMapStorage));
if (Tcl_DictObjFirst(interp, objv[2], &storagePtr->search, &keyObj,
&valueObj, &done) != TCL_OK) {
TclStackFree(interp, storagePtr);
diff --git a/generic/tclEvent.c b/generic/tclEvent.c
index 734f114..eedecf2 100644
--- a/generic/tclEvent.c
+++ b/generic/tclEvent.c
@@ -55,7 +55,7 @@ typedef struct {
typedef struct ExitHandler {
Tcl_ExitProc *proc; /* Function to call when process exits. */
- ClientData clientData; /* One word of information to pass to proc. */
+ void *clientData; /* One word of information to pass to proc. */
struct ExitHandler *nextPtr;/* Next in list of all exit handlers for this
* application, or NULL for end of list. */
} ExitHandler;
@@ -103,19 +103,19 @@ static Tcl_ThreadDataKey dataKey;
#if TCL_THREADS
typedef struct {
Tcl_ThreadCreateProc *proc; /* Main() function of the thread */
- ClientData clientData; /* The one argument to Main() */
+ void *clientData; /* The one argument to Main() */
} ThreadClientData;
-static Tcl_ThreadCreateType NewThreadProc(ClientData clientData);
+static Tcl_ThreadCreateType NewThreadProc(void *clientData);
#endif /* TCL_THREADS */
/*
* Prototypes for functions referenced only in this file:
*/
-static void BgErrorDeleteProc(ClientData clientData,
+static void BgErrorDeleteProc(void *clientData,
Tcl_Interp *interp);
-static void HandleBgErrors(ClientData clientData);
-static char * VwaitVarProc(ClientData clientData,
+static void HandleBgErrors(void *clientData);
+static char * VwaitVarProc(void *clientData,
Tcl_Interp *interp, const char *name1,
const char *name2, int flags);
static void InvokeExitHandlers(void);
@@ -163,7 +163,7 @@ Tcl_BackgroundException(
return;
}
- errPtr = ckalloc(sizeof(BgError));
+ errPtr = (BgError*)ckalloc(sizeof(BgError));
errPtr->errorMsg = Tcl_GetObjResult(interp);
Tcl_IncrRefCount(errPtr->errorMsg);
errPtr->returnOpts = Tcl_GetReturnOptions(interp, code);
@@ -171,7 +171,7 @@ Tcl_BackgroundException(
errPtr->nextPtr = NULL;
(void) TclGetBgErrorHandler(interp);
- assocPtr = Tcl_GetAssocData(interp, "tclBgError", NULL);
+ assocPtr = (ErrAssocData *)Tcl_GetAssocData(interp, "tclBgError", NULL);
if (assocPtr->firstBgPtr == NULL) {
assocPtr->firstBgPtr = errPtr;
Tcl_DoWhenIdle(HandleBgErrors, assocPtr);
@@ -201,9 +201,9 @@ Tcl_BackgroundException(
static void
HandleBgErrors(
- ClientData clientData) /* Pointer to ErrAssocData structure. */
+ void *clientData) /* Pointer to ErrAssocData structure. */
{
- ErrAssocData *assocPtr = clientData;
+ ErrAssocData *assocPtr = (ErrAssocData *)clientData;
Tcl_Interp *interp = assocPtr->interp;
BgError *errPtr;
@@ -230,7 +230,7 @@ HandleBgErrors(
errPtr = assocPtr->firstBgPtr;
Tcl_ListObjGetElements(NULL, copyObj, &prefixObjc, &prefixObjv);
- tempObjv = ckalloc((prefixObjc+2) * sizeof(Tcl_Obj *));
+ tempObjv = (Tcl_Obj**)ckalloc((prefixObjc+2) * sizeof(Tcl_Obj *));
memcpy(tempObjv, prefixObjv, prefixObjc*sizeof(Tcl_Obj *));
tempObjv[prefixObjc] = errPtr->errorMsg;
tempObjv[prefixObjc+1] = errPtr->returnOpts;
@@ -311,7 +311,7 @@ HandleBgErrors(
int
TclDefaultBgErrorHandlerObjCmd(
- ClientData dummy, /* Not used. */
+ void *dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
@@ -518,7 +518,7 @@ TclSetBgErrorHandler(
Tcl_Interp *interp,
Tcl_Obj *cmdPrefix)
{
- ErrAssocData *assocPtr = Tcl_GetAssocData(interp, "tclBgError", NULL);
+ ErrAssocData *assocPtr = (ErrAssocData *)Tcl_GetAssocData(interp, "tclBgError", NULL);
if (cmdPrefix == NULL) {
Tcl_Panic("TclSetBgErrorHandler: NULL cmdPrefix argument");
@@ -528,7 +528,7 @@ TclSetBgErrorHandler(
* First access: initialize.
*/
- assocPtr = ckalloc(sizeof(ErrAssocData));
+ assocPtr = (ErrAssocData*)ckalloc(sizeof(ErrAssocData));
assocPtr->interp = interp;
assocPtr->cmdPrefix = NULL;
assocPtr->firstBgPtr = NULL;
@@ -563,14 +563,14 @@ Tcl_Obj *
TclGetBgErrorHandler(
Tcl_Interp *interp)
{
- ErrAssocData *assocPtr = Tcl_GetAssocData(interp, "tclBgError", NULL);
+ ErrAssocData *assocPtr = (ErrAssocData *)Tcl_GetAssocData(interp, "tclBgError", NULL);
if (assocPtr == NULL) {
Tcl_Obj *bgerrorObj;
TclNewLiteralStringObj(bgerrorObj, "::tcl::Bgerror");
TclSetBgErrorHandler(interp, bgerrorObj);
- assocPtr = Tcl_GetAssocData(interp, "tclBgError", NULL);
+ assocPtr = (ErrAssocData *)Tcl_GetAssocData(interp, "tclBgError", NULL);
}
return assocPtr->cmdPrefix;
}
@@ -596,10 +596,10 @@ TclGetBgErrorHandler(
static void
BgErrorDeleteProc(
- ClientData clientData, /* Pointer to ErrAssocData structure. */
+ void *clientData, /* Pointer to ErrAssocData structure. */
Tcl_Interp *interp) /* Interpreter being deleted. */
{
- ErrAssocData *assocPtr = clientData;
+ ErrAssocData *assocPtr = (ErrAssocData *)clientData;
BgError *errPtr;
while (assocPtr->firstBgPtr != NULL) {
@@ -635,9 +635,9 @@ BgErrorDeleteProc(
void
Tcl_CreateExitHandler(
Tcl_ExitProc *proc, /* Function to invoke. */
- ClientData clientData) /* Arbitrary value to pass to proc. */
+ void *clientData) /* Arbitrary value to pass to proc. */
{
- ExitHandler *exitPtr = ckalloc(sizeof(ExitHandler));
+ ExitHandler *exitPtr = (ExitHandler*)ckalloc(sizeof(ExitHandler));
exitPtr->proc = proc;
exitPtr->clientData = clientData;
@@ -668,9 +668,9 @@ Tcl_CreateExitHandler(
void
TclCreateLateExitHandler(
Tcl_ExitProc *proc, /* Function to invoke. */
- ClientData clientData) /* Arbitrary value to pass to proc. */
+ void *clientData) /* Arbitrary value to pass to proc. */
{
- ExitHandler *exitPtr = ckalloc(sizeof(ExitHandler));
+ ExitHandler *exitPtr = (ExitHandler*)ckalloc(sizeof(ExitHandler));
exitPtr->proc = proc;
exitPtr->clientData = clientData;
@@ -701,7 +701,7 @@ TclCreateLateExitHandler(
void
Tcl_DeleteExitHandler(
Tcl_ExitProc *proc, /* Function that was previously registered. */
- ClientData clientData) /* Arbitrary value to pass to proc. */
+ void *clientData) /* Arbitrary value to pass to proc. */
{
ExitHandler *exitPtr, *prevPtr;
@@ -744,7 +744,7 @@ Tcl_DeleteExitHandler(
void
TclDeleteLateExitHandler(
Tcl_ExitProc *proc, /* Function that was previously registered. */
- ClientData clientData) /* Arbitrary value to pass to proc. */
+ void *clientData) /* Arbitrary value to pass to proc. */
{
ExitHandler *exitPtr, *prevPtr;
@@ -787,12 +787,12 @@ TclDeleteLateExitHandler(
void
Tcl_CreateThreadExitHandler(
Tcl_ExitProc *proc, /* Function to invoke. */
- ClientData clientData) /* Arbitrary value to pass to proc. */
+ void *clientData) /* Arbitrary value to pass to proc. */
{
ExitHandler *exitPtr;
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
- exitPtr = ckalloc(sizeof(ExitHandler));
+ exitPtr = (ExitHandler*)ckalloc(sizeof(ExitHandler));
exitPtr->proc = proc;
exitPtr->clientData = clientData;
exitPtr->nextPtr = tsdPtr->firstExitPtr;
@@ -820,7 +820,7 @@ Tcl_CreateThreadExitHandler(
void
Tcl_DeleteThreadExitHandler(
Tcl_ExitProc *proc, /* Function that was previously registered. */
- ClientData clientData) /* Arbitrary value to pass to proc. */
+ void *clientData) /* Arbitrary value to pass to proc. */
{
ExitHandler *exitPtr, *prevPtr;
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
@@ -1296,7 +1296,7 @@ FinalizeThread(
* initialized already.
*/
- tsdPtr = TclThreadDataKeyGet(&dataKey);
+ tsdPtr = (ThreadSpecificData*)TclThreadDataKeyGet(&dataKey);
if (tsdPtr != NULL) {
tsdPtr->inExit = 1;
@@ -1371,7 +1371,7 @@ TclInExit(void)
int
TclInThreadExit(void)
{
- ThreadSpecificData *tsdPtr = TclThreadDataKeyGet(&dataKey);
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)TclThreadDataKeyGet(&dataKey);
if (tsdPtr == NULL) {
return 0;
@@ -1399,7 +1399,7 @@ TclInThreadExit(void)
/* ARGSUSED */
int
Tcl_VwaitObjCmd(
- ClientData clientData, /* Not used. */
+ void *clientData, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
@@ -1463,13 +1463,13 @@ Tcl_VwaitObjCmd(
/* ARGSUSED */
static char *
VwaitVarProc(
- ClientData clientData, /* Pointer to integer to set to 1. */
+ void *clientData, /* Pointer to integer to set to 1. */
Tcl_Interp *interp, /* Interpreter containing variable. */
const char *name1, /* Name of variable. */
const char *name2, /* Second part of variable name. */
int flags) /* Information about what happened. */
{
- int *donePtr = clientData;
+ int *donePtr = (int *)clientData;
*donePtr = 1;
Tcl_UntraceVar(interp, name1, TCL_TRACE_WRITES|TCL_TRACE_UNSETS,
@@ -1497,7 +1497,7 @@ VwaitVarProc(
/* ARGSUSED */
int
Tcl_UpdateObjCmd(
- ClientData clientData, /* Not used. */
+ void *clientData, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
@@ -1565,10 +1565,10 @@ Tcl_UpdateObjCmd(
static Tcl_ThreadCreateType
NewThreadProc(
- ClientData clientData)
+ void *clientData)
{
- ThreadClientData *cdPtr = clientData;
- ClientData threadClientData;
+ ThreadClientData *cdPtr = (ThreadClientData *)clientData;
+ void *threadClientData;
Tcl_ThreadCreateProc *threadProc;
threadProc = cdPtr->proc;
@@ -1604,13 +1604,13 @@ int
Tcl_CreateThread(
Tcl_ThreadId *idPtr, /* Return, the ID of the thread */
Tcl_ThreadCreateProc *proc, /* Main() function of the thread */
- ClientData clientData, /* The one argument to Main() */
+ void *clientData, /* The one argument to Main() */
int stackSize, /* Size of stack for the new thread */
int flags) /* Flags controlling behaviour of the new
* thread. */
{
#if TCL_THREADS
- ThreadClientData *cdPtr = ckalloc(sizeof(ThreadClientData));
+ ThreadClientData *cdPtr = (ThreadClientData *)ckalloc(sizeof(ThreadClientData));
int result;
cdPtr->proc = proc;
diff --git a/generic/tclExecute.c b/generic/tclExecute.c
index 520c2ee..f47f8ea 100644
--- a/generic/tclExecute.c
+++ b/generic/tclExecute.c
@@ -1695,7 +1695,7 @@ TclCompileObj(
eclPtr = Tcl_GetHashValue(hePtr);
redo = 0;
- ctxCopyPtr = TclStackAlloc(interp, sizeof(CmdFrame));
+ ctxCopyPtr = (CmdFrame *)TclStackAlloc(interp, sizeof(CmdFrame));
*ctxCopyPtr = *invoker;
if (invoker->type == TCL_LOCATION_BC) {
diff --git a/generic/tclFileName.c b/generic/tclFileName.c
index 98ee37c..3ed16a4 100644
--- a/generic/tclFileName.c
+++ b/generic/tclFileName.c
@@ -1449,7 +1449,7 @@ Tcl_GlobObjCmd(
if (length <= 0) {
goto skipTypes;
}
- globTypes = TclStackAlloc(interp, sizeof(Tcl_GlobTypeData));
+ globTypes = (Tcl_GlobTypeData *)TclStackAlloc(interp, sizeof(Tcl_GlobTypeData));
globTypes->type = 0;
globTypes->perm = 0;
globTypes->macType = NULL;
diff --git a/generic/tclIOCmd.c b/generic/tclIOCmd.c
index 271fc57..5bf5949 100644
--- a/generic/tclIOCmd.c
+++ b/generic/tclIOCmd.c
@@ -952,7 +952,7 @@ Tcl_ExecObjCmd(
*/
argc = objc - skip;
- argv = TclStackAlloc(interp, (argc + 1) * sizeof(char *));
+ argv = (const char **)TclStackAlloc(interp, (argc + 1) * sizeof(char *));
/*
* Copy the string conversions of each (post option) object into the
diff --git a/generic/tclIndexObj.c b/generic/tclIndexObj.c
index 919db92..c7114ae 100644
--- a/generic/tclIndexObj.c
+++ b/generic/tclIndexObj.c
@@ -126,7 +126,7 @@ Tcl_GetIndexFromObj(
const Tcl_ObjIntRep *irPtr = TclFetchIntRep(objPtr, &indexType);
if (irPtr) {
- IndexRep *indexRep = irPtr->twoPtrValue.ptr1;
+ IndexRep *indexRep = (IndexRep *)irPtr->twoPtrValue.ptr1;
/*
* Here's hoping we don't get hit by unfortunate packing constraints
@@ -200,7 +200,7 @@ GetIndexFromObjList(
* Build a string table from the list.
*/
- tablePtr = ckalloc((objc + 1) * sizeof(char *));
+ tablePtr = (const char **)ckalloc((objc + 1) * sizeof(char *));
for (t = 0; t < objc; t++) {
if (objv[t] == objPtr) {
/*
@@ -284,7 +284,7 @@ Tcl_GetIndexFromObjStruct(
if (!(flags & INDEX_TEMP_TABLE)) {
irPtr = TclFetchIntRep(objPtr, &indexType);
if (irPtr) {
- indexRep = irPtr->twoPtrValue.ptr1;
+ indexRep = (IndexRep *)irPtr->twoPtrValue.ptr1;
if (indexRep->tablePtr==tablePtr && indexRep->offset==offset) {
*indexPtr = indexRep->index;
return TCL_OK;
@@ -308,7 +308,7 @@ Tcl_GetIndexFromObjStruct(
* - Several abbreviations (never allowed, but overridden by exact match)
*/
- for (entryPtr = tablePtr, idx = 0; *entryPtr != NULL;
+ for (entryPtr = (const char* const*)tablePtr, idx = 0; *entryPtr != NULL;
entryPtr = NEXT_ENTRY(entryPtr, offset), idx++) {
for (p1 = key, p2 = *entryPtr; *p1 == *p2; p1++, p2++) {
if (*p1 == '\0') {
@@ -352,7 +352,7 @@ Tcl_GetIndexFromObjStruct(
} else {
Tcl_ObjIntRep ir;
- indexRep = ckalloc(sizeof(IndexRep));
+ indexRep = (IndexRep*)ckalloc(sizeof(IndexRep));
ir.twoPtrValue.ptr1 = indexRep;
Tcl_StoreIntRep(objPtr, &indexType, &ir);
}
@@ -978,7 +978,7 @@ Tcl_WrongNumArgs(
len = TclScanElement(elementStr, elemLen, &flags);
if (MAY_QUOTE_WORD && len != elemLen) {
- char *quotedElementStr = TclStackAlloc(interp, len + 1);
+ char *quotedElementStr = (char *)TclStackAlloc(interp, len + 1);
len = TclConvertElement(elementStr, elemLen,
quotedElementStr, flags);
@@ -1029,7 +1029,7 @@ Tcl_WrongNumArgs(
len = TclScanElement(elementStr, elemLen, &flags);
if (MAY_QUOTE_WORD && len != elemLen) {
- char *quotedElementStr = TclStackAlloc(interp, len + 1);
+ char *quotedElementStr = (char *)TclStackAlloc(interp, len + 1);
len = TclConvertElement(elementStr, elemLen,
quotedElementStr, flags);
@@ -1319,7 +1319,7 @@ Tcl_ParseArgsObjv(
}
leftovers[nrem] = NULL;
*objcPtr = nrem++;
- *remObjv = ckrealloc(leftovers, nrem * sizeof(Tcl_Obj *));
+ *remObjv = (Tcl_Obj **)ckrealloc(leftovers, nrem * sizeof(Tcl_Obj *));
return TCL_OK;
/*
diff --git a/generic/tclInt.h b/generic/tclInt.h
index 27d7e6d..972996a 100644
--- a/generic/tclInt.h
+++ b/generic/tclInt.h
@@ -4350,7 +4350,7 @@ MODULE_SCOPE void TclpFreeAllocCache(void *);
(objPtr) = TclThreadAllocObj(); \
} else { \
(objPtr) = cachePtr->firstObjPtr; \
- cachePtr->firstObjPtr = (objPtr)->internalRep.twoPtrValue.ptr1; \
+ cachePtr->firstObjPtr = (Tcl_Obj *)(objPtr)->internalRep.twoPtrValue.ptr1; \
--cachePtr->numObjects; \
} \
} while (0)
diff --git a/generic/tclInterp.c b/generic/tclInterp.c
index 92c6159..e76e41e 100644
--- a/generic/tclInterp.c
+++ b/generic/tclInterp.c
@@ -1188,7 +1188,7 @@ Tcl_CreateAlias(
int i;
int result;
- objv = TclStackAlloc(slaveInterp, sizeof(Tcl_Obj *) * argc);
+ objv = (Tcl_Obj **)TclStackAlloc(slaveInterp, sizeof(Tcl_Obj *) * argc);
for (i = 0; i < argc; i++) {
objv[i] = Tcl_NewStringObj(argv[i], -1);
Tcl_IncrRefCount(objv[i]);
diff --git a/generic/tclNamesp.c b/generic/tclNamesp.c
index bbe357d..cde572f 100644
--- a/generic/tclNamesp.c
+++ b/generic/tclNamesp.c
@@ -1146,7 +1146,7 @@ TclTeardownNamespace(
while (nsPtr->cmdTable.numEntries > 0) {
int length = nsPtr->cmdTable.numEntries;
- Command **cmds = TclStackAlloc((Tcl_Interp *) iPtr,
+ Command **cmds = (Command **)TclStackAlloc((Tcl_Interp *) iPtr,
sizeof(Command *) * length);
i = 0;
@@ -1218,7 +1218,7 @@ TclTeardownNamespace(
#ifndef BREAK_NAMESPACE_COMPAT
while (nsPtr->childTable.numEntries > 0) {
int length = nsPtr->childTable.numEntries;
- Namespace **children = TclStackAlloc((Tcl_Interp *) iPtr,
+ Namespace **children = (Namespace **)TclStackAlloc((Tcl_Interp *) iPtr,
sizeof(Namespace *) * length);
i = 0;
@@ -1239,7 +1239,7 @@ TclTeardownNamespace(
if (nsPtr->childTablePtr != NULL) {
while (nsPtr->childTablePtr->numEntries > 0) {
int length = nsPtr->childTablePtr->numEntries;
- Namespace **children = TclStackAlloc((Tcl_Interp *) iPtr,
+ Namespace **children = (Namespace **)TclStackAlloc((Tcl_Interp *) iPtr,
sizeof(Namespace *) * length);
i = 0;
@@ -2764,7 +2764,7 @@ TclResetShadowedCmdRefs(
int found, i;
int trailFront = -1;
int trailSize = 5; /* Formerly NUM_TRAIL_ELEMS. */
- Namespace **trailPtr = TclStackAlloc(interp,
+ Namespace **trailPtr = (Namespace **)TclStackAlloc(interp,
trailSize * sizeof(Namespace *));
/*
@@ -4063,7 +4063,7 @@ NamespacePathCmd(
goto badNamespace;
}
if (nsObjc != 0) {
- namespaceList = TclStackAlloc(interp,
+ namespaceList = (Tcl_Namespace **)TclStackAlloc(interp,
sizeof(Tcl_Namespace *) * nsObjc);
for (i=0 ; i<nsObjc ; i++) {
diff --git a/generic/tclOOCall.c b/generic/tclOOCall.c
index c0d2e64..f2df67e 100644
--- a/generic/tclOOCall.c
+++ b/generic/tclOOCall.c
@@ -1369,7 +1369,7 @@ TclOOGetCallContext(
}
returnContext:
- contextPtr = TclStackAlloc(oPtr->fPtr->interp, sizeof(CallContext));
+ contextPtr = (CallContext *)TclStackAlloc(oPtr->fPtr->interp, sizeof(CallContext));
contextPtr->oPtr = oPtr;
/*
@@ -1819,7 +1819,7 @@ TclOORenderCallChain(
* method (or "object" if it is declared on the instance).
*/
- objv = TclStackAlloc(interp, callPtr->numChain * sizeof(Tcl_Obj *));
+ objv = (Tcl_Obj **)TclStackAlloc(interp, callPtr->numChain * sizeof(Tcl_Obj *));
for (i = 0 ; i < callPtr->numChain ; i++) {
struct MInvoke *miPtr = &callPtr->chain[i];
diff --git a/generic/tclOODefineCmds.c b/generic/tclOODefineCmds.c
index 6a00018..9ffdc27 100644
--- a/generic/tclOODefineCmds.c
+++ b/generic/tclOODefineCmds.c
@@ -738,7 +738,7 @@ TclOOUnknownDefinition(
* Got one match, and only one match!
*/
- Tcl_Obj **newObjv =
+ Tcl_Obj **newObjv = (Tcl_Obj **)
TclStackAlloc(interp, sizeof(Tcl_Obj*) * (objc - 1));
int result;
@@ -2461,7 +2461,7 @@ ClassMixinSet(
return TCL_ERROR;
}
- mixins = TclStackAlloc(interp, sizeof(Class *) * mixinc);
+ mixins = (Class **)TclStackAlloc(interp, sizeof(Class *) * mixinc);
for (i = 0; i < mixinc; i++) {
mixins[i] = GetClassInOuterContext(interp, mixinv[i],
@@ -2908,7 +2908,7 @@ ObjMixinSet(
return TCL_ERROR;
}
- mixins = TclStackAlloc(interp, sizeof(Class *) * mixinc);
+ mixins = (Class **)TclStackAlloc(interp, sizeof(Class *) * mixinc);
for (i = 0; i < mixinc; i++) {
mixins[i] = GetClassInOuterContext(interp, mixinv[i],
diff --git a/generic/tclOOMethod.c b/generic/tclOOMethod.c
index 32dd3c7..ed06a5c 100644
--- a/generic/tclOOMethod.c
+++ b/generic/tclOOMethod.c
@@ -692,7 +692,7 @@ InvokeProcedureMethod(
* Allocate the special frame data.
*/
- fdPtr = TclStackAlloc(interp, sizeof(PMFrameData));
+ fdPtr = (PMFrameData *)TclStackAlloc(interp, sizeof(PMFrameData));
/*
* Create a call frame for this method.
@@ -1620,7 +1620,7 @@ InitEnsembleRewrite(
* array of rewritten arguments. */
{
unsigned len = rewriteLength + objc - toRewrite;
- Tcl_Obj **argObjs = TclStackAlloc(interp, sizeof(Tcl_Obj *) * len);
+ Tcl_Obj **argObjs = (Tcl_Obj **)TclStackAlloc(interp, sizeof(Tcl_Obj *) * len);
memcpy(argObjs, rewriteObjs, rewriteLength * sizeof(Tcl_Obj *));
memcpy(argObjs + rewriteLength, objv + toRewrite,
diff --git a/generic/tclParse.c b/generic/tclParse.c
index 164905a..e4614a3 100644
--- a/generic/tclParse.c
+++ b/generic/tclParse.c
@@ -1131,7 +1131,7 @@ ParseTokens(
src++;
numBytes--;
- nestedPtr = TclStackAlloc(parsePtr->interp, sizeof(Tcl_Parse));
+ nestedPtr = (Tcl_Parse *)TclStackAlloc(parsePtr->interp, sizeof(Tcl_Parse));
while (1) {
const char *curEnd;
@@ -1519,7 +1519,7 @@ Tcl_ParseVar(
{
register Tcl_Obj *objPtr;
int code;
- Tcl_Parse *parsePtr = TclStackAlloc(interp, sizeof(Tcl_Parse));
+ Tcl_Parse *parsePtr = (Tcl_Parse *)TclStackAlloc(interp, sizeof(Tcl_Parse));
if (Tcl_ParseVarName(interp, start, -1, parsePtr, 0) != TCL_OK) {
TclStackFree(interp, parsePtr);
@@ -2000,7 +2000,7 @@ TclSubstParse(
Tcl_Token *tokenPtr;
const char *lastTerm = parsePtr->term;
- Tcl_Parse *nestedPtr =
+ Tcl_Parse *nestedPtr = (Tcl_Parse *)
TclStackAlloc(interp, sizeof(Tcl_Parse));
while (TCL_OK ==
diff --git a/generic/tclProc.c b/generic/tclProc.c
index afa00ee..8235902 100644
--- a/generic/tclProc.c
+++ b/generic/tclProc.c
@@ -232,7 +232,7 @@ Tcl_ProcObjCmd(
*/
if (iPtr->cmdFramePtr) {
- CmdFrame *contextPtr = TclStackAlloc(interp, sizeof(CmdFrame));
+ CmdFrame *contextPtr = (CmdFrame *)TclStackAlloc(interp, sizeof(CmdFrame));
*contextPtr = *iPtr->cmdFramePtr;
if (contextPtr->type == TCL_LOCATION_BC) {
@@ -1048,8 +1048,8 @@ ProcWrongNumArgs(
*/
numArgs = framePtr->procPtr->numArgs;
- desiredObjs = TclStackAlloc(interp,
- (int) sizeof(Tcl_Obj *) * (numArgs+1));
+ desiredObjs = (Tcl_Obj **)TclStackAlloc(interp,
+ sizeof(Tcl_Obj *) * (numArgs+1));
if (framePtr->isProcCallFrame & FRAME_IS_LAMBDA) {
desiredObjs[0] = Tcl_NewStringObj("lambdaExpr", -1);
@@ -1400,7 +1400,7 @@ InitArgsAndLocals(
* parameters.
*/
- varPtr = TclStackAlloc(interp, (int)(localCt * sizeof(Var)));
+ varPtr = (Var *)TclStackAlloc(interp, localCt * sizeof(Var));
framePtr->compiledLocals = varPtr;
framePtr->numCompiledLocals = localCt;
@@ -2475,7 +2475,7 @@ SetLambdaFromAny(
*/
if (iPtr->cmdFramePtr) {
- CmdFrame *contextPtr = TclStackAlloc(interp, sizeof(CmdFrame));
+ CmdFrame *contextPtr = (CmdFrame *)TclStackAlloc(interp, sizeof(CmdFrame));
*contextPtr = *iPtr->cmdFramePtr;
if (contextPtr->type == TCL_LOCATION_BC) {
@@ -2663,7 +2663,7 @@ TclNRApplyObjCmd(
return TCL_ERROR;
}
- extraPtr = TclStackAlloc(interp, sizeof(ApplyExtraData));
+ extraPtr = (ApplyExtraData *)TclStackAlloc(interp, sizeof(ApplyExtraData));
memset(&extraPtr->cmd, 0, sizeof(Command));
procPtr->cmdPtr = &extraPtr->cmd;
extraPtr->cmd.nsPtr = (Namespace *) nsPtr;
diff --git a/generic/tclRegexp.c b/generic/tclRegexp.c
index d3f7428..533a73d 100644
--- a/generic/tclRegexp.c
+++ b/generic/tclRegexp.c
@@ -122,7 +122,7 @@ const Tcl_ObjType tclRegexpType = {
do { \
const Tcl_ObjIntRep *irPtr; \
irPtr = TclFetchIntRep((objPtr), &tclRegexpType); \
- (rePtr) = irPtr ? irPtr->twoPtrValue.ptr1 : NULL; \
+ (rePtr) = irPtr ? (TclRegexp *)irPtr->twoPtrValue.ptr1 : NULL; \
} while (0)
@@ -916,7 +916,7 @@ CompileRegexp(
* This is a new expression, so compile it and add it to the cache.
*/
- regexpPtr = ckalloc(sizeof(TclRegexp));
+ regexpPtr = (TclRegexp*)ckalloc(sizeof(TclRegexp));
regexpPtr->objPtr = NULL;
regexpPtr->string = NULL;
regexpPtr->details.rm_extend.rm_so = -1;
@@ -971,7 +971,7 @@ CompileRegexp(
*/
regexpPtr->matches =
- ckalloc(sizeof(regmatch_t) * (regexpPtr->re.re_nsub + 1));
+ (regmatch_t*)ckalloc(sizeof(regmatch_t) * (regexpPtr->re.re_nsub + 1));
/*
* Initialize the refcount to one initially, since it is in the cache.
@@ -997,7 +997,7 @@ CompileRegexp(
tsdPtr->patLengths[i+1] = tsdPtr->patLengths[i];
tsdPtr->regexps[i+1] = tsdPtr->regexps[i];
}
- tsdPtr->patterns[0] = ckalloc(length + 1);
+ tsdPtr->patterns[0] = (char *)ckalloc(length + 1);
memcpy(tsdPtr->patterns[0], string, length + 1);
tsdPtr->patLengths[0] = length;
tsdPtr->regexps[0] = regexpPtr;
diff --git a/generic/tclScan.c b/generic/tclScan.c
index 74ec2da..2986860 100644
--- a/generic/tclScan.c
+++ b/generic/tclScan.c
@@ -260,7 +260,7 @@ ValidateFormat(
char *end;
Tcl_UniChar ch = 0;
int objIndex, xpgSize, nspace = numVars;
- int *nassign = TclStackAlloc(interp, nspace * sizeof(int));
+ int *nassign = (int *)TclStackAlloc(interp, nspace * sizeof(int));
char buf[TCL_UTF_MAX + 1] = "";
Tcl_Obj *errorMsg; /* Place to build an error messages. Note that
* these are messy operations because we do
diff --git a/generic/tclTest.c b/generic/tclTest.c
index 4eb8519..166334a 100644
--- a/generic/tclTest.c
+++ b/generic/tclTest.c
@@ -41,7 +41,6 @@
/*
* Declare external functions used in Windows tests.
*/
-
DLLEXPORT int Tcltest_Init(Tcl_Interp *interp);
DLLEXPORT int Tcltest_SafeInit(Tcl_Interp *interp);
@@ -228,7 +227,7 @@ static int TestasyncCmd(void *dummy,
static int TestbytestringObjCmd(void *clientData,
Tcl_Interp *interp, int objc,
Tcl_Obj *const objv[]);
-static int TestpurebytesobjObjCmd(ClientData clientData,
+static int TestpurebytesobjObjCmd(void *clientData,
Tcl_Interp *interp, int objc,
Tcl_Obj *const objv[]);
static int TeststringbytesObjCmd(void *clientData,
@@ -851,8 +850,8 @@ TestasyncCmd(
if (argc != 3) {
goto wrongNumArgs;
}
- asyncPtr = ckalloc(sizeof(TestAsyncHandler));
- asyncPtr->command = ckalloc(strlen(argv[2]) + 1);
+ asyncPtr = (TestAsyncHandler *)ckalloc(sizeof(TestAsyncHandler));
+ asyncPtr->command = (char *)ckalloc(strlen(argv[2]) + 1);
strcpy(asyncPtr->command, argv[2]);
Tcl_MutexLock(&asyncTestMutex);
asyncPtr->id = nextId;
@@ -1625,9 +1624,9 @@ TestdelCmd(
return TCL_ERROR;
}
- dPtr = ckalloc(sizeof(DelCmd));
+ dPtr = (DelCmd*)ckalloc(sizeof(DelCmd));
dPtr->interp = interp;
- dPtr->deleteCmd = ckalloc(strlen(argv[3]) + 1);
+ dPtr->deleteCmd = (char *)ckalloc(strlen(argv[3]) + 1);
strcpy(dPtr->deleteCmd, argv[3]);
Tcl_CreateCommand(slave, argv[2], DelCmdProc, dPtr,
@@ -1654,7 +1653,7 @@ static void
DelDeleteProc(
void *clientData) /* String command to evaluate. */
{
- DelCmd *dPtr = clientData;
+ DelCmd *dPtr = (DelCmd *) clientData;
Tcl_EvalEx(dPtr->interp, dPtr->deleteCmd, -1, 0);
Tcl_ResetResult(dPtr->interp);
@@ -1859,7 +1858,7 @@ TestdstringCmd(
} else if (strcmp(argv[2], "staticlarge") == 0) {
Tcl_AppendResult(interp, "first0 first1 first2 first3 first4 first5 first6 first7 first8 first9\nsecond0 second1 second2 second3 second4 second5 second6 second7 second8 second9\nthird0 third1 third2 third3 third4 third5 third6 third7 third8 third9\nfourth0 fourth1 fourth2 fourth3 fourth4 fourth5 fourth6 fourth7 fourth8 fourth9\nfifth0 fifth1 fifth2 fifth3 fifth4 fifth5 fifth6 fifth7 fifth8 fifth9\nsixth0 sixth1 sixth2 sixth3 sixth4 sixth5 sixth6 sixth7 sixth8 sixth9\nseventh0 seventh1 seventh2 seventh3 seventh4 seventh5 seventh6 seventh7 seventh8 seventh9\n", NULL);
} else if (strcmp(argv[2], "free") == 0) {
- char *s = ckalloc(100);
+ char *s = (char *)ckalloc(100);
strcpy(s, "This is a malloc-ed string");
Tcl_SetResult(interp, s, TCL_DYNAMIC);
} else if (strcmp(argv[2], "special") == 0) {
@@ -1911,9 +1910,9 @@ TestdstringCmd(
* Tcl_DStringGetResult handles freeProc's other than free.
*/
-static void SpecialFree(blockPtr)
- char *blockPtr; /* Block to free. */
-{
+static void SpecialFree(
+ char *blockPtr /* Block to free. */
+) {
ckfree(blockPtr - 16);
}
@@ -1965,15 +1964,15 @@ TestencodingObjCmd(
if (objc != 5) {
return TCL_ERROR;
}
- encodingPtr = ckalloc(sizeof(TclEncoding));
+ encodingPtr = (TclEncoding*)ckalloc(sizeof(TclEncoding));
encodingPtr->interp = interp;
string = Tcl_GetStringFromObj(objv[3], &length);
- encodingPtr->toUtfCmd = ckalloc(length + 1);
+ encodingPtr->toUtfCmd = (char *)ckalloc(length + 1);
memcpy(encodingPtr->toUtfCmd, string, length + 1);
string = Tcl_GetStringFromObj(objv[4], &length);
- encodingPtr->fromUtfCmd = ckalloc(length + 1);
+ encodingPtr->fromUtfCmd = (char *)ckalloc(length + 1);
memcpy(encodingPtr->fromUtfCmd, string, length + 1);
string = Tcl_GetStringFromObj(objv[2], &length);
@@ -2071,7 +2070,7 @@ static void
EncodingFreeProc(
void *clientData) /* ClientData associated with type. */
{
- TclEncoding *encodingPtr = clientData;
+ TclEncoding *encodingPtr = (TclEncoding *)clientData;
ckfree(encodingPtr->toUtfCmd);
ckfree(encodingPtr->fromUtfCmd);
@@ -2230,7 +2229,7 @@ TesteventObjCmd(
"position specifier", TCL_EXACT, &posIndex) != TCL_OK) {
return TCL_ERROR;
}
- ev = ckalloc(sizeof(TestEvent));
+ ev = (TestEvent *)ckalloc(sizeof(TestEvent));
ev->header.proc = TesteventProc;
ev->header.nextPtr = NULL;
ev->interp = interp;
@@ -3088,7 +3087,7 @@ TestlinkCmd(
if (strcmp(argv[5], "-") == 0) {
stringVar = NULL;
} else {
- stringVar = ckalloc(strlen(argv[5]) + 1);
+ stringVar = (char *)ckalloc(strlen(argv[5]) + 1);
strcpy(stringVar, argv[5]);
}
}
@@ -3195,7 +3194,7 @@ TestlinkCmd(
if (strcmp(argv[5], "-") == 0) {
stringVar = NULL;
} else {
- stringVar = ckalloc(strlen(argv[5]) + 1);
+ stringVar = (char *)ckalloc(strlen(argv[5]) + 1);
strcpy(stringVar, argv[5]);
}
Tcl_UpdateLinkedVar(interp, "string");
@@ -3304,7 +3303,7 @@ TestlinkCmd(
static int
TestlinkarrayCmd(
- ClientData dummy, /* Not used. */
+ void *dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
@@ -4253,7 +4252,7 @@ TestsetassocdataCmd(
return TCL_ERROR;
}
- buf = ckalloc(strlen(argv[2]) + 1);
+ buf = (char *)ckalloc(strlen(argv[2]) + 1);
strcpy(buf, argv[2]);
/*
@@ -4833,7 +4832,7 @@ GetTimesObjCmd(
fprintf(stderr, "alloc & free 100000 6 word items\n");
Tcl_GetTime(&start);
for (i = 0; i < 100000; i++) {
- objPtr = ckalloc(sizeof(Tcl_Obj));
+ objPtr = (Tcl_Obj *)ckalloc(sizeof(Tcl_Obj));
ckfree(objPtr);
}
Tcl_GetTime(&stop);
@@ -4842,10 +4841,10 @@ GetTimesObjCmd(
/* alloc 5000 times */
fprintf(stderr, "alloc 5000 6 word items\n");
- objv = ckalloc(5000 * sizeof(Tcl_Obj *));
+ objv = (Tcl_Obj **)ckalloc(5000 * sizeof(Tcl_Obj *));
Tcl_GetTime(&start);
for (i = 0; i < 5000; i++) {
- objv[i] = ckalloc(sizeof(Tcl_Obj));
+ objv[i] = (Tcl_Obj *)ckalloc(sizeof(Tcl_Obj));
}
Tcl_GetTime(&stop);
timePer = (stop.sec - start.sec)*1000000 + (stop.usec - start.usec);
@@ -5087,7 +5086,7 @@ TeststringbytesObjCmd(
static int
TestpurebytesobjObjCmd(
- ClientData unused, /* Not used. */
+ void *unused, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* The argument objects. */
@@ -5107,7 +5106,7 @@ TestpurebytesobjObjCmd(
if (objc == 2) {
const char *s = Tcl_GetString(objv[1]);
objPtr->length = objv[1]->length;
- objPtr->bytes = ckalloc(objPtr->length + 1);
+ objPtr->bytes = (char *)ckalloc(objPtr->length + 1);
memcpy(objPtr->bytes, s, objPtr->length);
objPtr->bytes[objPtr->length] = 0;
}
@@ -5300,7 +5299,7 @@ TestsaveresultCmd(
Tcl_AppendResult(interp, "append result", NULL);
break;
case RESULT_FREE: {
- char *buf = ckalloc(200);
+ char *buf = (char *)ckalloc(200);
strcpy(buf, "free result");
Tcl_SetResult(interp, buf, TCL_DYNAMIC);
@@ -5622,7 +5621,7 @@ TestChannelCmd(
/* Remember the channel in the pool of detached channels */
- det = ckalloc(sizeof(TestChannel));
+ det = (TestChannel *)ckalloc(sizeof(TestChannel));
det->chan = chan;
det->nextPtr = firstDetached;
firstDetached = det;
@@ -5814,7 +5813,7 @@ TestChannelCmd(
for (hPtr = Tcl_FirstHashEntry(hTblPtr, &hSearch);
hPtr != NULL;
hPtr = Tcl_NextHashEntry(&hSearch)) {
- Tcl_AppendElement(interp, Tcl_GetHashKey(hTblPtr, hPtr));
+ Tcl_AppendElement(interp, (char *)Tcl_GetHashKey(hTblPtr, hPtr));
}
return TCL_OK;
}
@@ -5855,7 +5854,7 @@ TestChannelCmd(
chanPtr = (Channel *) Tcl_GetHashValue(hPtr);
statePtr = chanPtr->state;
if (statePtr->flags & TCL_READABLE) {
- Tcl_AppendElement(interp, Tcl_GetHashKey(hTblPtr, hPtr));
+ Tcl_AppendElement(interp, (char *)Tcl_GetHashKey(hTblPtr, hPtr));
}
}
return TCL_OK;
@@ -5912,7 +5911,7 @@ TestChannelCmd(
chanPtr = (Channel *) Tcl_GetHashValue(hPtr);
statePtr = chanPtr->state;
if (statePtr->flags & TCL_WRITABLE) {
- Tcl_AppendElement(interp, Tcl_GetHashKey(hTblPtr, hPtr));
+ Tcl_AppendElement(interp, (char *)Tcl_GetHashKey(hTblPtr, hPtr));
}
}
return TCL_OK;
@@ -6020,7 +6019,7 @@ TestChannelEventCmd(
return TCL_ERROR;
}
- esPtr = ckalloc(sizeof(EventScriptRecord));
+ esPtr = (EventScriptRecord *)ckalloc(sizeof(EventScriptRecord));
esPtr->nextPtr = statePtr->scriptRecordPtr;
statePtr->scriptRecordPtr = esPtr;
@@ -6446,7 +6445,7 @@ TestReportFreeInternalRep(
}
}
-static ClientData
+static void *
TestReportDupInternalRep(
void *clientData)
{
@@ -7766,7 +7765,7 @@ InterpCompiledVarResolver(
Tcl_ResolvedVarInfo **rPtr)
{
if (*name == 'T') {
- MyResolvedVarInfo *resVarInfo = ckalloc(sizeof(MyResolvedVarInfo));
+ MyResolvedVarInfo *resVarInfo = (MyResolvedVarInfo *)ckalloc(sizeof(MyResolvedVarInfo));
resVarInfo->vInfo.fetchProc = MyCompiledVarFetch;
resVarInfo->vInfo.deleteProc = MyCompiledVarFree;
diff --git a/generic/tclTestObj.c b/generic/tclTestObj.c
index c9e4a6f..b427c9e 100644
--- a/generic/tclTestObj.c
+++ b/generic/tclTestObj.c
@@ -30,28 +30,28 @@ static int CheckIfVarUnset(Tcl_Interp *interp, Tcl_Obj **varPtr, int varIndex);
static int GetVariableIndex(Tcl_Interp *interp,
const char *string, int *indexPtr);
static void SetVarToObj(Tcl_Obj **varPtr, int varIndex, Tcl_Obj *objPtr);
-static int TestbignumobjCmd(ClientData dummy, Tcl_Interp *interp,
+static int TestbignumobjCmd(void *dummy, Tcl_Interp *interp,
int objc, Tcl_Obj *const objv[]);
-static int TestbooleanobjCmd(ClientData dummy,
+static int TestbooleanobjCmd(void *dummy,
Tcl_Interp *interp, int objc,
Tcl_Obj *const objv[]);
-static int TestdoubleobjCmd(ClientData dummy, Tcl_Interp *interp,
+static int TestdoubleobjCmd(void *dummy, Tcl_Interp *interp,
int objc, Tcl_Obj *const objv[]);
-static int TestindexobjCmd(ClientData dummy, Tcl_Interp *interp,
+static int TestindexobjCmd(void *dummy, Tcl_Interp *interp,
int objc, Tcl_Obj *const objv[]);
-static int TestintobjCmd(ClientData dummy, Tcl_Interp *interp,
+static int TestintobjCmd(void *dummy, Tcl_Interp *interp,
int objc, Tcl_Obj *const objv[]);
-static int TestlistobjCmd(ClientData dummy, Tcl_Interp *interp,
+static int TestlistobjCmd(void *dummy, Tcl_Interp *interp,
int objc, Tcl_Obj *const objv[]);
-static int TestobjCmd(ClientData dummy, Tcl_Interp *interp,
+static int TestobjCmd(void *dummy, Tcl_Interp *interp,
int objc, Tcl_Obj *const objv[]);
-static int TeststringobjCmd(ClientData dummy, Tcl_Interp *interp,
+static int TeststringobjCmd(void *dummy, Tcl_Interp *interp,
int objc, Tcl_Obj *const objv[]);
#define VARPTR_KEY "TCLOBJTEST_VARPTR"
#define NUMBER_OF_OBJECT_VARS 20
-static void VarPtrDeleteProc(ClientData clientData, Tcl_Interp *interp)
+static void VarPtrDeleteProc(void *clientData, Tcl_Interp *interp)
{
register int i;
Tcl_Obj **varPtr = (Tcl_Obj **) clientData;
@@ -146,7 +146,7 @@ TclObjTest_Init(
static int
TestbignumobjCmd(
- ClientData clientData, /* unused */
+ void *clientData, /* unused */
Tcl_Interp *interp, /* Tcl interpreter */
int objc, /* Argument count */
Tcl_Obj *const objv[]) /* Argument vector */
@@ -345,7 +345,7 @@ TestbignumobjCmd(
static int
TestbooleanobjCmd(
- ClientData clientData, /* Not used. */
+ void *clientData, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
@@ -445,7 +445,7 @@ TestbooleanobjCmd(
static int
TestdoubleobjCmd(
- ClientData clientData, /* Not used. */
+ void *clientData, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
@@ -563,7 +563,7 @@ TestdoubleobjCmd(
static int
TestindexobjCmd(
- ClientData clientData, /* Not used. */
+ void *clientData, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
@@ -594,7 +594,7 @@ TestindexobjCmd(
}
Tcl_GetIndexFromObj(NULL, objv[1], tablePtr, "token", 0, &index);
- indexRep = objv[1]->internalRep.twoPtrValue.ptr1;
+ indexRep = (struct IndexRep *)objv[1]->internalRep.twoPtrValue.ptr1;
indexRep->index = index2;
result = Tcl_GetIndexFromObj(NULL, objv[1],
tablePtr, "token", 0, &index);
@@ -616,7 +616,7 @@ TestindexobjCmd(
return TCL_ERROR;
}
- argv = ckalloc((objc-3) * sizeof(char *));
+ argv = (const char **)ckalloc((objc-3) * sizeof(char *));
for (i = 4; i < objc; i++) {
argv[i-4] = Tcl_GetString(objv[i]);
}
@@ -652,7 +652,7 @@ TestindexobjCmd(
static int
TestintobjCmd(
- ClientData clientData, /* Not used. */
+ void *clientData, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
@@ -856,7 +856,7 @@ TestintobjCmd(
static int
TestlistobjCmd(
- ClientData clientData, /* Not used */
+ void *clientData, /* Not used */
Tcl_Interp *interp, /* Tcl interpreter */
int objc, /* Number of arguments */
Tcl_Obj *const objv[]) /* Argument objects */
@@ -953,7 +953,7 @@ TestlistobjCmd(
static int
TestobjCmd(
- ClientData clientData, /* Not used. */
+ void *clientData, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
@@ -1165,7 +1165,7 @@ TestobjCmd(
static int
TeststringobjCmd(
- ClientData clientData, /* Not used. */
+ void *clientData, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
@@ -1283,7 +1283,7 @@ TeststringobjCmd(
if (varPtr[varIndex] != NULL) {
Tcl_ConvertToType(NULL, varPtr[varIndex],
Tcl_GetObjType("string"));
- strPtr = varPtr[varIndex]->internalRep.twoPtrValue.ptr1;
+ strPtr = (String *)varPtr[varIndex]->internalRep.twoPtrValue.ptr1;
length = (int) strPtr->allocated;
} else {
length = -1;
@@ -1337,7 +1337,7 @@ TeststringobjCmd(
if (varPtr[varIndex] != NULL) {
Tcl_ConvertToType(NULL, varPtr[varIndex],
Tcl_GetObjType("string"));
- strPtr = varPtr[varIndex]->internalRep.twoPtrValue.ptr1;
+ strPtr = (String *)varPtr[varIndex]->internalRep.twoPtrValue.ptr1;
length = strPtr->maxChars;
} else {
length = -1;
diff --git a/generic/tclTestProcBodyObj.c b/generic/tclTestProcBodyObj.c
index 913b253..59379de 100644
--- a/generic/tclTestProcBodyObj.c
+++ b/generic/tclTestProcBodyObj.c
@@ -45,13 +45,13 @@ typedef struct CmdTable {
* Declarations for functions defined in this file.
*/
-static int ProcBodyTestProcObjCmd(ClientData dummy,
+static int ProcBodyTestProcObjCmd(void *dummy,
Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]);
-static int ProcBodyTestCheckObjCmd(ClientData dummy,
+static int ProcBodyTestCheckObjCmd(void *dummy,
Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]);
static int ProcBodyTestInitInternal(Tcl_Interp *interp, int isSafe);
static int RegisterCommand(Tcl_Interp* interp,
- const char *namespace, const CmdTable *cmdTablePtr);
+ const char *namesp, const CmdTable *cmdTablePtr);
/*
* List of commands to create when the package is loaded; must go after the
@@ -139,7 +139,7 @@ static int
RegisterCommand(
Tcl_Interp* interp, /* the Tcl interpreter for which the operation
* is performed */
- const char *namespace, /* the namespace in which the command is
+ const char *namesp, /* the namespace in which the command is
* registered */
const CmdTable *cmdTablePtr)/* the command to register */
{
@@ -147,13 +147,13 @@ RegisterCommand(
if (cmdTablePtr->exportIt) {
sprintf(buf, "namespace eval %s { namespace export %s }",
- namespace, cmdTablePtr->cmdName);
+ namesp, cmdTablePtr->cmdName);
if (Tcl_EvalEx(interp, buf, -1, 0) != TCL_OK) {
return TCL_ERROR;
}
}
- sprintf(buf, "%s::%s", namespace, cmdTablePtr->cmdName);
+ sprintf(buf, "%s::%s", namesp, cmdTablePtr->cmdName);
Tcl_CreateObjCommand(interp, buf, cmdTablePtr->proc, 0, 0);
return TCL_OK;
}
@@ -228,7 +228,7 @@ ProcBodyTestInitInternal(
static int
ProcBodyTestProcObjCmd(
- ClientData dummy, /* context; not used */
+ void *dummy, /* context; not used */
Tcl_Interp *interp, /* the current interpreter */
int objc, /* argument count */
Tcl_Obj *const objv[]) /* arguments */
@@ -327,7 +327,7 @@ ProcBodyTestProcObjCmd(
static int
ProcBodyTestCheckObjCmd(
- ClientData dummy, /* context; not used */
+ void *dummy, /* context; not used */
Tcl_Interp *interp, /* the current interpreter */
int objc, /* argument count */
Tcl_Obj *const objv[]) /* arguments */
diff --git a/generic/tclThreadAlloc.c b/generic/tclThreadAlloc.c
index 3f1abc2..5849672 100644
--- a/generic/tclThreadAlloc.c
+++ b/generic/tclThreadAlloc.c
@@ -162,7 +162,7 @@ static __thread Cache *tcachePtr;
#else
# define GETCACHE(cachePtr) \
do { \
- (cachePtr) = TclpGetAllocCache(); \
+ (cachePtr) = (Cache*)TclpGetAllocCache(); \
if ((cachePtr) == NULL) { \
(cachePtr) = GetCache(); \
} \
@@ -209,9 +209,9 @@ GetCache(void)
* Get this thread's cache, allocating if necessary.
*/
- cachePtr = TclpGetAllocCache();
+ cachePtr = (Cache*)TclpGetAllocCache();
if (cachePtr == NULL) {
- cachePtr = TclpSysAlloc(sizeof(Cache), 0);
+ cachePtr = (Cache*)TclpSysAlloc(sizeof(Cache), 0);
if (cachePtr == NULL) {
Tcl_Panic("alloc: could not allocate new cache");
}
@@ -246,7 +246,7 @@ void
TclFreeAllocCache(
void *arg)
{
- Cache *cachePtr = arg;
+ Cache *cachePtr = (Cache*)arg;
Cache **nextPtrPtr;
register unsigned int bucket;
@@ -337,7 +337,7 @@ TclpAlloc(
#endif
if (size > MAXALLOC) {
bucket = NBUCKETS;
- blockPtr = TclpSysAlloc(size, 0);
+ blockPtr = (Block *)TclpSysAlloc(size, 0);
if (blockPtr != NULL) {
cachePtr->totalAssigned += reqSize;
}
@@ -491,7 +491,7 @@ TclpRealloc(
} else if (size > MAXALLOC) {
cachePtr->totalAssigned -= blockPtr->blockReqSize;
cachePtr->totalAssigned += reqSize;
- blockPtr = TclpSysRealloc(blockPtr, size);
+ blockPtr = (Block*)TclpSysRealloc(blockPtr, size);
if (blockPtr == NULL) {
return NULL;
}
@@ -510,7 +510,7 @@ TclpRealloc(
memcpy(newPtr, ptr, reqSize);
TclpFree(ptr);
}
- return newPtr;
+ return (char *)newPtr;
}
/*
@@ -563,7 +563,7 @@ TclThreadAllocObj(void)
Tcl_Obj *newObjsPtr;
cachePtr->numObjects = numMove = NOBJALLOC;
- newObjsPtr = TclpSysAlloc(sizeof(Tcl_Obj) * numMove, 0);
+ newObjsPtr = (Tcl_Obj *)TclpSysAlloc(sizeof(Tcl_Obj) * numMove, 0);
if (newObjsPtr == NULL) {
Tcl_Panic("alloc: could not allocate %d new objects", numMove);
}
@@ -582,7 +582,7 @@ TclThreadAllocObj(void)
*/
objPtr = cachePtr->firstObjPtr;
- cachePtr->firstObjPtr = objPtr->internalRep.twoPtrValue.ptr1;
+ cachePtr->firstObjPtr = (Tcl_Obj *)objPtr->internalRep.twoPtrValue.ptr1;
cachePtr->numObjects--;
return objPtr;
}
@@ -721,9 +721,9 @@ MoveObjs(
*/
while (--numMove) {
- objPtr = objPtr->internalRep.twoPtrValue.ptr1;
+ objPtr = (Tcl_Obj *)objPtr->internalRep.twoPtrValue.ptr1;
}
- fromPtr->firstObjPtr = objPtr->internalRep.twoPtrValue.ptr1;
+ fromPtr->firstObjPtr = (Tcl_Obj *)objPtr->internalRep.twoPtrValue.ptr1;
/*
* Move all objects as a block - they are already linked to each other, we
@@ -766,7 +766,7 @@ PutObjs(
} else {
do {
lastPtr = firstPtr;
- firstPtr = firstPtr->internalRep.twoPtrValue.ptr1;
+ firstPtr = (Tcl_Obj *)firstPtr->internalRep.twoPtrValue.ptr1;
} while (--keep > 0);
lastPtr->internalRep.twoPtrValue.ptr1 = NULL;
}
@@ -1032,7 +1032,7 @@ GetBlocks(
if (blockPtr == NULL) {
size = MAXALLOC;
- blockPtr = TclpSysAlloc(size, 0);
+ blockPtr = (Block*)TclpSysAlloc(size, 0);
if (blockPtr == NULL) {
return 0;
}
@@ -1147,7 +1147,7 @@ TclFinalizeThreadAlloc(void)
void
TclFinalizeThreadAllocThread(void)
{
- Cache *cachePtr = TclpGetAllocCache();
+ Cache *cachePtr = (Cache *)TclpGetAllocCache();
if (cachePtr != NULL) {
TclpFreeAllocCache(cachePtr);
}
diff --git a/generic/tclThreadTest.c b/generic/tclThreadTest.c
index e9b1107..48aa445 100644
--- a/generic/tclThreadTest.c
+++ b/generic/tclThreadTest.c
@@ -119,7 +119,7 @@ static char *errorProcString;
TCL_DECLARE_MUTEX(threadMutex)
-static int ThreadObjCmd(ClientData clientData,
+static int ThreadObjCmd(void *clientData,
Tcl_Interp *interp, int objc,
Tcl_Obj *const objv[]);
static int ThreadCreate(Tcl_Interp *interp, const char *script,
@@ -130,15 +130,15 @@ static int ThreadSend(Tcl_Interp *interp, Tcl_ThreadId id,
static int ThreadCancel(Tcl_Interp *interp, Tcl_ThreadId id,
const char *result, int flags);
-static Tcl_ThreadCreateType NewTestThread(ClientData clientData);
+static Tcl_ThreadCreateType NewTestThread(void *clientData);
static void ListRemove(ThreadSpecificData *tsdPtr);
static void ListUpdateInner(ThreadSpecificData *tsdPtr);
static int ThreadEventProc(Tcl_Event *evPtr, int mask);
static void ThreadErrorProc(Tcl_Interp *interp);
-static void ThreadFreeProc(ClientData clientData);
+static void ThreadFreeProc(void *clientData);
static int ThreadDeleteEvent(Tcl_Event *eventPtr,
- ClientData clientData);
-static void ThreadExitProc(ClientData clientData);
+ void *clientData);
+static void ThreadExitProc(void *clientData);
extern int Tcltest_Init(Tcl_Interp *interp);
/*
@@ -206,7 +206,7 @@ TclThread_Init(
/* ARGSUSED */
static int
ThreadObjCmd(
- ClientData dummy, /* Not used. */
+ void *dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
@@ -435,7 +435,7 @@ ThreadObjCmd(
ckfree(errorProcString);
}
proc = Tcl_GetString(objv[2]);
- errorProcString = ckalloc(strlen(proc) + 1);
+ errorProcString = (char *)ckalloc(strlen(proc) + 1);
strcpy(errorProcString, proc);
Tcl_MutexUnlock(&threadMutex);
return TCL_OK;
@@ -556,9 +556,9 @@ ThreadCreate(
Tcl_ThreadCreateType
NewTestThread(
- ClientData clientData)
+ void *clientData)
{
- ThreadCtrl *ctrlPtr = clientData;
+ ThreadCtrl *ctrlPtr = (ThreadCtrl *)clientData;
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
int result;
char *threadEvalScript;
@@ -595,7 +595,7 @@ NewTestThread(
* eval'ing, for the case that we exit during evaluation
*/
- threadEvalScript = ckalloc(strlen(ctrlPtr->script) + 1);
+ threadEvalScript = (char *)ckalloc(strlen(ctrlPtr->script) + 1);
strcpy(threadEvalScript, ctrlPtr->script);
Tcl_CreateThreadExitHandler(ThreadExitProc, threadEvalScript);
@@ -840,13 +840,13 @@ ThreadSend(
* Create the event for its event queue.
*/
- threadEventPtr = ckalloc(sizeof(ThreadEvent));
- threadEventPtr->script = ckalloc(strlen(script) + 1);
+ threadEventPtr = (ThreadEvent*)ckalloc(sizeof(ThreadEvent));
+ threadEventPtr->script = (char *)ckalloc(strlen(script) + 1);
strcpy(threadEventPtr->script, script);
if (!wait) {
resultPtr = threadEventPtr->resultPtr = NULL;
} else {
- resultPtr = ckalloc(sizeof(ThreadEventResult));
+ resultPtr = (ThreadEventResult *)ckalloc(sizeof(ThreadEventResult));
threadEventPtr->resultPtr = resultPtr;
/*
@@ -1042,14 +1042,14 @@ ThreadEventProc(
if (resultPtr) {
Tcl_MutexLock(&threadMutex);
resultPtr->code = code;
- resultPtr->result = ckalloc(strlen(result) + 1);
+ resultPtr->result = (char *)ckalloc(strlen(result) + 1);
strcpy(resultPtr->result, result);
if (errorCode != NULL) {
- resultPtr->errorCode = ckalloc(strlen(errorCode) + 1);
+ resultPtr->errorCode = (char *)ckalloc(strlen(errorCode) + 1);
strcpy(resultPtr->errorCode, errorCode);
}
if (errorInfo != NULL) {
- resultPtr->errorInfo = ckalloc(strlen(errorInfo) + 1);
+ resultPtr->errorInfo = (char *)ckalloc(strlen(errorInfo) + 1);
strcpy(resultPtr->errorInfo, errorInfo);
}
Tcl_ConditionNotify(&resultPtr->done);
@@ -1073,7 +1073,7 @@ ThreadEventProc(
* None.
*
* Side effects:
- * Clears up mem specified in ClientData
+ * Clears up mem specified in clientData
*
*------------------------------------------------------------------------
*/
@@ -1081,7 +1081,7 @@ ThreadEventProc(
/* ARGSUSED */
static void
ThreadFreeProc(
- ClientData clientData)
+ void *clientData)
{
if (clientData) {
ckfree(clientData);
@@ -1109,7 +1109,7 @@ ThreadFreeProc(
static int
ThreadDeleteEvent(
Tcl_Event *eventPtr, /* Really ThreadEvent */
- ClientData clientData) /* dummy */
+ void *clientData) /* dummy */
{
if (eventPtr->proc == ThreadEventProc) {
ckfree(((ThreadEvent *) eventPtr)->script);
@@ -1144,9 +1144,9 @@ ThreadDeleteEvent(
/* ARGSUSED */
static void
ThreadExitProc(
- ClientData clientData)
+ void *clientData)
{
- char *threadEvalScript = clientData;
+ char *threadEvalScript = (char *)clientData;
ThreadEventResult *resultPtr, *nextPtr;
Tcl_ThreadId self = Tcl_GetCurrentThread();
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
@@ -1199,7 +1199,7 @@ ThreadExitProc(
const char *msg = "target thread died";
- resultPtr->result = ckalloc(strlen(msg) + 1);
+ resultPtr->result = (char *)ckalloc(strlen(msg) + 1);
strcpy(resultPtr->result, msg);
resultPtr->code = TCL_ERROR;
Tcl_ConditionNotify(&resultPtr->done);
diff --git a/generic/tclTrace.c b/generic/tclTrace.c
index 1a6d459..36983f2 100644
--- a/generic/tclTrace.c
+++ b/generic/tclTrace.c
@@ -1689,7 +1689,7 @@ CallTraceFunction(
* Copy the command characters into a new string.
*/
- commandCopy = TclStackAlloc(interp, numChars + 1);
+ commandCopy = (char *)TclStackAlloc(interp, numChars + 1);
memcpy(commandCopy, command, numChars);
commandCopy[numChars] = '\0';
diff --git a/unix/tclEpollNotfy.c b/unix/tclEpollNotfy.c
index 4961ef5..c540c4e 100644
--- a/unix/tclEpollNotfy.c
+++ b/unix/tclEpollNotfy.c
@@ -238,7 +238,7 @@ PlatformEventsControl(
newEvent.events |= EPOLLOUT;
}
if (isNew) {
- newPedPtr = ckalloc(sizeof(*newPedPtr));
+ newPedPtr = (struct PlatformEventData *)ckalloc(sizeof(struct PlatformEventData));
newPedPtr->filePtr = filePtr;
newPedPtr->tsdPtr = tsdPtr;
filePtr->pedPtr = newPedPtr;
@@ -370,7 +370,7 @@ PlatformEventsInit(void)
if (errno) {
Tcl_Panic("Tcl_InitNotifier: %s", "could not create mutex");
}
- filePtr = ckalloc(sizeof(*filePtr));
+ filePtr = (FileHandler *)ckalloc(sizeof(FileHandler));
#ifdef HAVE_EVENTFD
tsdPtr->triggerEventFd = eventfd(0, EFD_CLOEXEC | EFD_NONBLOCK);
if (tsdPtr->triggerEventFd <= 0) {
@@ -391,7 +391,7 @@ PlatformEventsInit(void)
PlatformEventsControl(filePtr, tsdPtr, EPOLL_CTL_ADD, 1);
if (!tsdPtr->readyEvents) {
tsdPtr->maxReadyEvents = 512;
- tsdPtr->readyEvents = ckalloc(
+ tsdPtr->readyEvents = (struct epoll_event *)ckalloc(
tsdPtr->maxReadyEvents * sizeof(tsdPtr->readyEvents[0]));
}
LIST_INIT(&tsdPtr->firstReadyFileHandlerPtr);
@@ -550,7 +550,7 @@ Tcl_CreateFileHandler(
}
}
if (filePtr == NULL) {
- filePtr = ckalloc(sizeof(FileHandler));
+ filePtr = (FileHandler *)ckalloc(sizeof(FileHandler));
filePtr->fd = fd;
filePtr->readyMask = 0;
filePtr->nextPtr = tsdPtr->firstFileHandlerPtr;
@@ -733,7 +733,7 @@ Tcl_WaitForEvent(
*/
if (filePtr->readyMask == 0) {
- FileHandlerEvent *fileEvPtr =
+ FileHandlerEvent *fileEvPtr = (FileHandlerEvent *)
ckalloc(sizeof(FileHandlerEvent));
fileEvPtr->header.proc = FileHandlerEventProc;
@@ -810,7 +810,7 @@ Tcl_WaitForEvent(
*/
if (filePtr->readyMask == 0) {
- FileHandlerEvent *fileEvPtr =
+ FileHandlerEvent *fileEvPtr = (FileHandlerEvent *)
ckalloc(sizeof(FileHandlerEvent));
fileEvPtr->header.proc = FileHandlerEventProc;
diff --git a/unix/tclKqueueNotfy.c b/unix/tclKqueueNotfy.c
index 99d794e..e2ff4f4 100644
--- a/unix/tclKqueueNotfy.c
+++ b/unix/tclKqueueNotfy.c
@@ -222,7 +222,7 @@ PlatformEventsControl(
struct stat fdStat;
if (isNew) {
- newPedPtr = ckalloc(sizeof(*newPedPtr));
+ newPedPtr = (struct PlatformEventData *)ckalloc(sizeof(struct PlatformEventData));
newPedPtr->filePtr = filePtr;
newPedPtr->tsdPtr = tsdPtr;
filePtr->pedPtr = newPedPtr;
@@ -409,13 +409,13 @@ PlatformEventsInit(void)
} else if (fcntl(tsdPtr->eventsFd, F_SETFD, FD_CLOEXEC) == -1) {
Tcl_Panic("fcntl: %s", strerror(errno));
}
- filePtr = ckalloc(sizeof(*filePtr));
+ filePtr = (FileHandler *)ckalloc(sizeof(FileHandler));
filePtr->fd = tsdPtr->triggerPipe[0];
filePtr->mask = TCL_READABLE;
PlatformEventsControl(filePtr, tsdPtr, EV_ADD, 1);
if (!tsdPtr->readyEvents) {
tsdPtr->maxReadyEvents = 512;
- tsdPtr->readyEvents = ckalloc(
+ tsdPtr->readyEvents = (struct kevent *)ckalloc(
tsdPtr->maxReadyEvents * sizeof(tsdPtr->readyEvents[0]));
}
LIST_INIT(&tsdPtr->firstReadyFileHandlerPtr);
@@ -580,7 +580,7 @@ Tcl_CreateFileHandler(
}
}
if (filePtr == NULL) {
- filePtr = ckalloc(sizeof(FileHandler));
+ filePtr = (FileHandler *)ckalloc(sizeof(FileHandler));
filePtr->fd = fd;
filePtr->readyMask = 0;
filePtr->nextPtr = tsdPtr->firstFileHandlerPtr;
@@ -768,7 +768,7 @@ Tcl_WaitForEvent(
*/
if (filePtr->readyMask == 0) {
- FileHandlerEvent *fileEvPtr =
+ FileHandlerEvent *fileEvPtr = (FileHandlerEvent *)
ckalloc(sizeof(FileHandlerEvent));
fileEvPtr->header.proc = FileHandlerEventProc;
@@ -828,7 +828,7 @@ Tcl_WaitForEvent(
*/
if (filePtr->readyMask == 0) {
- FileHandlerEvent *fileEvPtr =
+ FileHandlerEvent *fileEvPtr = (FileHandlerEvent *)
ckalloc(sizeof(FileHandlerEvent));
fileEvPtr->header.proc = FileHandlerEventProc;
diff --git a/unix/tclLoadDl.c b/unix/tclLoadDl.c
index aec071c..6339044 100644
--- a/unix/tclLoadDl.c
+++ b/unix/tclLoadDl.c
@@ -131,7 +131,7 @@ TclpDlopen(
}
return TCL_ERROR;
}
- newHandle = ckalloc(sizeof(*newHandle));
+ newHandle = (Tcl_LoadHandle)ckalloc(sizeof(*newHandle));
newHandle->clientData = handle;
newHandle->findSymbolProcPtr = &FindSymbol;
newHandle->unloadFileProcPtr = &UnloadFile;
diff --git a/unix/tclLoadDyld.c b/unix/tclLoadDyld.c
index e998bf9..9ae8d85 100644
--- a/unix/tclLoadDyld.c
+++ b/unix/tclLoadDyld.c
@@ -258,7 +258,7 @@ TclpDlopen(
module = NSLinkModule(dyldObjFileImage, nativePath, nsflags);
NSDestroyObjectFileImage(dyldObjFileImage);
if (module) {
- modulePtr = ckalloc(sizeof(Tcl_DyldModuleHandle));
+ modulePtr = (Tcl_DyldModuleHandle *)ckalloc(sizeof(Tcl_DyldModuleHandle));
modulePtr->module = module;
modulePtr->nextPtr = NULL;
} else {
@@ -278,13 +278,13 @@ TclpDlopen(
|| dyldLibHeader || modulePtr
#endif /* TCL_DYLD_USE_NSMODULE */
) {
- dyldLoadHandle = ckalloc(sizeof(Tcl_DyldLoadHandle));
+ dyldLoadHandle = (Tcl_DyldModuleHandle *)ckalloc(sizeof(Tcl_DyldLoadHandle));
dyldLoadHandle->dlHandle = dlHandle;
#if TCL_DYLD_USE_NSMODULE || defined(TCL_LOAD_FROM_MEMORY)
dyldLoadHandle->dyldLibHeader = dyldLibHeader;
dyldLoadHandle->modulePtr = modulePtr;
#endif /* TCL_DYLD_USE_NSMODULE || TCL_LOAD_FROM_MEMORY */
- newHandle = ckalloc(sizeof(*newHandle));
+ newHandle = (Tcl_DyldModuleHandle *)ckalloc(sizeof(*newHandle));
newHandle->clientData = dyldLoadHandle;
newHandle->findSymbolProcPtr = &FindSymbol;
newHandle->unloadFileProcPtr = &UnloadFile;
@@ -381,7 +381,7 @@ FindSymbol(
modulePtr = modulePtr->nextPtr;
}
if (modulePtr == NULL) {
- modulePtr = ckalloc(sizeof(Tcl_DyldModuleHandle));
+ modulePtr = (Tcl_DyldModuleHandle *)ckalloc(sizeof(Tcl_DyldModuleHandle));
modulePtr->module = module;
modulePtr->nextPtr = dyldLoadHandle->modulePtr;
dyldLoadHandle->modulePtr = modulePtr;
@@ -693,14 +693,14 @@ TclpLoadMemory(
* Stash the module reference within the load handle we create and return.
*/
- modulePtr = ckalloc(sizeof(Tcl_DyldModuleHandle));
+ modulePtr = (Tcl_DyldModuleHandle *)ckalloc(sizeof(Tcl_DyldModuleHandle));
modulePtr->module = module;
modulePtr->nextPtr = NULL;
- dyldLoadHandle = ckalloc(sizeof(Tcl_DyldLoadHandle));
+ dyldLoadHandle = (Tcl_DyldModuleHandle *)ckalloc(sizeof(Tcl_DyldLoadHandle));
dyldLoadHandle->dlHandle = NULL;
dyldLoadHandle->dyldLibHeader = NULL;
dyldLoadHandle->modulePtr = modulePtr;
- newHandle = ckalloc(sizeof(*newHandle));
+ newHandle = (Tcl_LoadHandle)ckalloc(sizeof(*newHandle));
newHandle->clientData = dyldLoadHandle;
newHandle->findSymbolProcPtr = &FindSymbol;
newHandle->unloadFileProcPtr = &UnloadFile;
diff --git a/unix/tclLoadNext.c b/unix/tclLoadNext.c
index eb0affa..8c62784 100644
--- a/unix/tclLoadNext.c
+++ b/unix/tclLoadNext.c
@@ -101,7 +101,7 @@ TclpDlopen(
}
NXCloseMemory(errorStream, NX_FREEBUFFER);
- newHandle = ckalloc(sizeof(Tcl_LoadHandle));
+ newHandle = (Tcl_LoadHandle) ckalloc(sizeof(*newHandle));
newHandle->clientData = INT2PTR(1);
newHandle->findSymbolProcPtr = &FindSymbol;
newHandle->unloadFileProcPtr = &UnloadFile;
diff --git a/unix/tclLoadOSF.c b/unix/tclLoadOSF.c
index 377ed28..bbcaa66 100644
--- a/unix/tclLoadOSF.c
+++ b/unix/tclLoadOSF.c
@@ -128,7 +128,7 @@ TclpDlopen(
} else {
pkg++;
}
- newHandle = ckalloc(sizeof(*newHandle));
+ newHandle = (Tcl_LoadHandle)ckalloc(sizeof(*newHandle));
newHandle->clientData = pkg;
newHandle->findSymbolProcPtr = &FindSymbol;
newHandle->unloadFileProcPtr = &UnloadFile;
diff --git a/unix/tclLoadShl.c b/unix/tclLoadShl.c
index 4be3d7b..a92ddf5 100644
--- a/unix/tclLoadShl.c
+++ b/unix/tclLoadShl.c
@@ -97,7 +97,7 @@ TclpDlopen(
fileName, Tcl_PosixError(interp)));
return TCL_ERROR;
}
- newHandle = ckalloc(sizeof(*newHandle));
+ newHandle = (Tcl_LoadHandle)ckalloc(sizeof(*newHandle));
newHandle->clientData = handle;
newHandle->findSymbolProcPtr = &FindSymbol;
newHandle->unloadFileProcPtr = *unloadProcPtr = &UnloadFile;
diff --git a/unix/tclSelectNotfy.c b/unix/tclSelectNotfy.c
index a0dea57..38d6afd 100644
--- a/unix/tclSelectNotfy.c
+++ b/unix/tclSelectNotfy.c
@@ -464,7 +464,7 @@ Tcl_CreateFileHandler(
}
}
if (filePtr == NULL) {
- filePtr = ckalloc(sizeof(FileHandler));
+ filePtr = (FileHandler *)ckalloc(sizeof(FileHandler));
filePtr->fd = fd;
filePtr->readyMask = 0;
filePtr->nextPtr = tsdPtr->firstFileHandlerPtr;
diff --git a/unix/tclUnixChan.c b/unix/tclUnixChan.c
index be49c95..2c12bac 100644
--- a/unix/tclUnixChan.c
+++ b/unix/tclUnixChan.c
@@ -119,27 +119,27 @@ typedef struct {
* Static routines for this file:
*/
-static int FileBlockModeProc(ClientData instanceData, int mode);
-static int FileCloseProc(ClientData instanceData,
+static int FileBlockModeProc(void *instanceData, int mode);
+static int FileCloseProc(void *instanceData,
Tcl_Interp *interp);
-static int FileGetHandleProc(ClientData instanceData,
- int direction, ClientData *handlePtr);
-static int FileInputProc(ClientData instanceData, char *buf,
+static int FileGetHandleProc(void *instanceData,
+ int direction, void **handlePtr);
+static int FileInputProc(void *instanceData, char *buf,
int toRead, int *errorCode);
-static int FileOutputProc(ClientData instanceData,
+static int FileOutputProc(void *instanceData,
const char *buf, int toWrite, int *errorCode);
-static int FileSeekProc(ClientData instanceData, long offset,
+static int FileSeekProc(void *instanceData, long offset,
int mode, int *errorCode);
-static int FileTruncateProc(ClientData instanceData,
+static int FileTruncateProc(void *instanceData,
Tcl_WideInt length);
-static Tcl_WideInt FileWideSeekProc(ClientData instanceData,
+static Tcl_WideInt FileWideSeekProc(void *instanceData,
Tcl_WideInt offset, int mode, int *errorCode);
-static void FileWatchProc(ClientData instanceData, int mask);
+static void FileWatchProc(void *instanceData, int mask);
#ifdef SUPPORTS_TTY
-static int TtyCloseProc(ClientData instanceData,
+static int TtyCloseProc(void *instanceData,
Tcl_Interp *interp);
static void TtyGetAttributes(int fd, TtyAttrs *ttyPtr);
-static int TtyGetOptionProc(ClientData instanceData,
+static int TtyGetOptionProc(void *instanceData,
Tcl_Interp *interp, const char *optionName,
Tcl_DString *dsPtr);
static int TtyGetBaud(speed_t speed);
@@ -149,7 +149,7 @@ static void TtyModemStatusStr(int status, Tcl_DString *dsPtr);
static int TtyParseMode(Tcl_Interp *interp, const char *mode,
TtyAttrs *ttyPtr);
static void TtySetAttributes(int fd, TtyAttrs *ttyPtr);
-static int TtySetOptionProc(ClientData instanceData,
+static int TtySetOptionProc(void *instanceData,
Tcl_Interp *interp, const char *optionName,
const char *value);
#endif /* SUPPORTS_TTY */
@@ -225,11 +225,11 @@ static const Tcl_ChannelType ttyChannelType = {
/* ARGSUSED */
static int
FileBlockModeProc(
- ClientData instanceData, /* File state. */
+ void *instanceData, /* File state. */
int mode) /* The mode to set. Can be TCL_MODE_BLOCKING
* or TCL_MODE_NONBLOCKING. */
{
- FileState *fsPtr = instanceData;
+ FileState *fsPtr = (FileState *)instanceData;
if (TclUnixSetBlockingMode(fsPtr->fd, mode) < 0) {
return errno;
@@ -258,13 +258,13 @@ FileBlockModeProc(
static int
FileInputProc(
- ClientData instanceData, /* File state. */
+ void *instanceData, /* File state. */
char *buf, /* Where to store data read. */
int toRead, /* How much space is available in the
* buffer? */
int *errorCodePtr) /* Where to store error code. */
{
- FileState *fsPtr = instanceData;
+ FileState *fsPtr = (FileState *)instanceData;
int bytesRead; /* How many bytes were actually read from the
* input device? */
@@ -305,12 +305,12 @@ FileInputProc(
static int
FileOutputProc(
- ClientData instanceData, /* File state. */
+ void *instanceData, /* File state. */
const char *buf, /* The data buffer. */
int toWrite, /* How many bytes to write? */
int *errorCodePtr) /* Where to store error code. */
{
- FileState *fsPtr = instanceData;
+ FileState *fsPtr = (FileState *)instanceData;
int written;
*errorCodePtr = 0;
@@ -352,10 +352,10 @@ FileOutputProc(
static int
FileCloseProc(
- ClientData instanceData, /* File state. */
+ void *instanceData, /* File state. */
Tcl_Interp *interp) /* For error reporting - unused. */
{
- FileState *fsPtr = instanceData;
+ FileState *fsPtr = (FileState *)instanceData;
int errorCode = 0;
Tcl_DeleteFileHandler(fsPtr->fd);
@@ -377,10 +377,10 @@ FileCloseProc(
#ifdef SUPPORTS_TTY
static int
TtyCloseProc(
- ClientData instanceData,
+ void *instanceData,
Tcl_Interp *interp)
{
- TtyState *ttyPtr = instanceData;
+ TtyState *ttyPtr = (TtyState*)instanceData;
/*
* If we've been asked by the user to drain or flush, do so now.
@@ -435,13 +435,13 @@ TtyCloseProc(
static int
FileSeekProc(
- ClientData instanceData, /* File state. */
+ void *instanceData, /* File state. */
long offset, /* Offset to seek to. */
int mode, /* Relative to where should we seek? Can be
* one of SEEK_START, SEEK_SET or SEEK_END. */
int *errorCodePtr) /* To store error code. */
{
- FileState *fsPtr = instanceData;
+ FileState *fsPtr = (FileState *)instanceData;
Tcl_WideInt oldLoc, newLoc;
/*
@@ -496,13 +496,13 @@ FileSeekProc(
static Tcl_WideInt
FileWideSeekProc(
- ClientData instanceData, /* File state. */
+ void *instanceData, /* File state. */
Tcl_WideInt offset, /* Offset to seek to. */
int mode, /* Relative to where should we seek? Can be
* one of SEEK_START, SEEK_CUR or SEEK_END. */
int *errorCodePtr) /* To store error code. */
{
- FileState *fsPtr = instanceData;
+ FileState *fsPtr = (FileState *)instanceData;
Tcl_WideInt newLoc;
newLoc = TclOSseek(fsPtr->fd, (Tcl_SeekOffset) offset, mode);
@@ -530,12 +530,12 @@ FileWideSeekProc(
static void
FileWatchProc(
- ClientData instanceData, /* The file state. */
+ void *instanceData, /* The file state. */
int mask) /* Events of interest; an OR-ed combination of
* TCL_READABLE, TCL_WRITABLE and
* TCL_EXCEPTION. */
{
- FileState *fsPtr = instanceData;
+ FileState *fsPtr = (FileState *)instanceData;
/*
* Make sure we only register for events that are valid on this file. Note
@@ -572,11 +572,11 @@ FileWatchProc(
static int
FileGetHandleProc(
- ClientData instanceData, /* The file state. */
+ void *instanceData, /* The file state. */
int direction, /* TCL_READABLE or TCL_WRITABLE */
- ClientData *handlePtr) /* Where to store the handle. */
+ void **handlePtr) /* Where to store the handle. */
{
- FileState *fsPtr = instanceData;
+ FileState *fsPtr = (FileState *)instanceData;
if (direction & fsPtr->validMask) {
*handlePtr = INT2PTR(fsPtr->fd);
@@ -639,12 +639,12 @@ TtyModemStatusStr(
static int
TtySetOptionProc(
- ClientData instanceData, /* File state. */
+ void *instanceData, /* File state. */
Tcl_Interp *interp, /* For error reporting - can be NULL. */
const char *optionName, /* Which option to set? */
const char *value) /* New value for option. */
{
- TtyState *fsPtr = instanceData;
+ TtyState *fsPtr = (TtyState *)instanceData;
unsigned int len, vlen;
TtyAttrs tty;
int argc;
@@ -978,12 +978,12 @@ TtySetOptionProc(
static int
TtyGetOptionProc(
- ClientData instanceData, /* File state. */
+ void *instanceData, /* File state. */
Tcl_Interp *interp, /* For error reporting - can be NULL. */
const char *optionName, /* Option to get. */
Tcl_DString *dsPtr) /* Where to store value(s). */
{
- TtyState *fsPtr = instanceData;
+ TtyState *fsPtr = (TtyState *)instanceData;
unsigned int len;
char buf[3*TCL_INTEGER_SPACE + 16];
int valid = 0; /* Flag if valid option parsed. */
@@ -1652,7 +1652,7 @@ TclpOpenFileChannel(
return NULL;
}
- native = Tcl_FSGetNativePath(pathPtr);
+ native = (const char *)Tcl_FSGetNativePath(pathPtr);
if (native == NULL) {
if (interp != (Tcl_Interp *) NULL) {
Tcl_AppendResult(interp, "couldn't open \"",
@@ -1712,7 +1712,7 @@ TclpOpenFileChannel(
sprintf(channelName, "file%d", fd);
}
- fsPtr = ckalloc(sizeof(TtyState));
+ fsPtr = (TtyState *)ckalloc(sizeof(TtyState));
fsPtr->fileState.validMask = channelPermissions | TCL_EXCEPTION;
fsPtr->fileState.fd = fd;
#ifdef SUPPORTS_TTY
@@ -1763,7 +1763,7 @@ TclpOpenFileChannel(
Tcl_Channel
Tcl_MakeFileChannel(
- ClientData handle, /* OS level handle. */
+ void *handle, /* OS level handle. */
int mode) /* ORed combination of TCL_READABLE and
* TCL_WRITABLE to indicate file mode. */
{
@@ -1790,13 +1790,13 @@ Tcl_MakeFileChannel(
&& (sockaddrLen > 0)
&& (sockaddr.sa_family == AF_INET
|| sockaddr.sa_family == AF_INET6)) {
- return TclpMakeTcpClientChannelMode(INT2PTR(fd), mode);
+ return (Tcl_Channel)TclpMakeTcpClientChannelMode(INT2PTR(fd), mode);
} else {
channelTypePtr = &fileChannelType;
sprintf(channelName, "file%d", fd);
}
- fsPtr = ckalloc(sizeof(TtyState));
+ fsPtr = (TtyState *)ckalloc(sizeof(TtyState));
fsPtr->fileState.fd = fd;
fsPtr->fileState.validMask = mode | TCL_EXCEPTION;
fsPtr->fileState.channel = Tcl_CreateChannel(channelTypePtr, channelName,
@@ -1932,12 +1932,12 @@ Tcl_GetOpenFile(
* "forWriting". Ignored, we always check that
* the channel is open for the requested
* mode. */
- ClientData *filePtr) /* Store pointer to FILE structure here. */
+ void **filePtr) /* Store pointer to FILE structure here. */
{
Tcl_Channel chan;
int chanMode, fd;
const Tcl_ChannelType *chanTypePtr;
- ClientData data;
+ void *data;
FILE *f;
chan = Tcl_GetChannel(interp, chanID, &chanMode);
@@ -2022,10 +2022,10 @@ Tcl_GetOpenFile(
static int
FileTruncateProc(
- ClientData instanceData,
+ void *instanceData,
Tcl_WideInt length)
{
- FileState *fsPtr = instanceData;
+ FileState *fsPtr = (FileState *)instanceData;
int result;
#ifdef HAVE_TYPE_OFF64_T
diff --git a/unix/tclUnixCompat.c b/unix/tclUnixCompat.c
index aa25c6b..7da0f45 100644
--- a/unix/tclUnixCompat.c
+++ b/unix/tclUnixCompat.c
@@ -201,7 +201,7 @@ TclpGetPwNam(
if (tsdPtr->pbuflen < 1) {
tsdPtr->pbuflen = 1024;
}
- tsdPtr->pbuf = ckalloc(tsdPtr->pbuflen);
+ tsdPtr->pbuf = (char *)ckalloc(tsdPtr->pbuflen);
Tcl_CreateThreadExitHandler(FreePwBuf, NULL);
}
while (1) {
@@ -214,7 +214,7 @@ TclpGetPwNam(
return NULL;
}
tsdPtr->pbuflen *= 2;
- tsdPtr->pbuf = ckrealloc(tsdPtr->pbuf, tsdPtr->pbuflen);
+ tsdPtr->pbuf = (char *)ckrealloc(tsdPtr->pbuf, tsdPtr->pbuflen);
}
return (pwPtr != NULL ? &tsdPtr->pwd : NULL);
@@ -281,7 +281,7 @@ TclpGetPwUid(
if (tsdPtr->pbuflen < 1) {
tsdPtr->pbuflen = 1024;
}
- tsdPtr->pbuf = ckalloc(tsdPtr->pbuflen);
+ tsdPtr->pbuf = (char *)ckalloc(tsdPtr->pbuflen);
Tcl_CreateThreadExitHandler(FreePwBuf, NULL);
}
while (1) {
@@ -294,7 +294,7 @@ TclpGetPwUid(
return NULL;
}
tsdPtr->pbuflen *= 2;
- tsdPtr->pbuf = ckrealloc(tsdPtr->pbuf, tsdPtr->pbuflen);
+ tsdPtr->pbuf = (char *)ckrealloc(tsdPtr->pbuf, tsdPtr->pbuflen);
}
return (pwPtr != NULL ? &tsdPtr->pwd : NULL);
@@ -384,7 +384,7 @@ TclpGetGrNam(
if (tsdPtr->gbuflen < 1) {
tsdPtr->gbuflen = 1024;
}
- tsdPtr->gbuf = ckalloc(tsdPtr->gbuflen);
+ tsdPtr->gbuf = (char*)ckalloc(tsdPtr->gbuflen);
Tcl_CreateThreadExitHandler(FreeGrBuf, NULL);
}
while (1) {
@@ -397,7 +397,7 @@ TclpGetGrNam(
return NULL;
}
tsdPtr->gbuflen *= 2;
- tsdPtr->gbuf = ckrealloc(tsdPtr->gbuf, tsdPtr->gbuflen);
+ tsdPtr->gbuf = (char *)ckrealloc(tsdPtr->gbuf, tsdPtr->gbuflen);
}
return (grPtr != NULL ? &tsdPtr->grp : NULL);
@@ -464,7 +464,7 @@ TclpGetGrGid(
if (tsdPtr->gbuflen < 1) {
tsdPtr->gbuflen = 1024;
}
- tsdPtr->gbuf = ckalloc(tsdPtr->gbuflen);
+ tsdPtr->gbuf = (char*)ckalloc(tsdPtr->gbuflen);
Tcl_CreateThreadExitHandler(FreeGrBuf, NULL);
}
while (1) {
@@ -477,7 +477,7 @@ TclpGetGrGid(
return NULL;
}
tsdPtr->gbuflen *= 2;
- tsdPtr->gbuf = ckrealloc(tsdPtr->gbuf, tsdPtr->gbuflen);
+ tsdPtr->gbuf = (char *)ckrealloc(tsdPtr->gbuf, tsdPtr->gbuflen);
}
return (grPtr != NULL ? &tsdPtr->grp : NULL);
@@ -887,7 +887,7 @@ CopyArray(
int buflen) /* Size of buffer. */
{
int i, j, len = 0;
- char *p, **new;
+ char *p, **pp;
if (src == NULL) {
return 0;
@@ -903,7 +903,7 @@ CopyArray(
return -1;
}
- new = (char **) buf;
+ pp = (char **) buf;
p = buf + len;
for (j = 0; j < i; j++) {
@@ -914,10 +914,10 @@ CopyArray(
return -1;
}
memcpy(p, src[j], sz);
- new[j] = p;
+ pp[j] = p;
p = buf + len;
}
- new[j] = NULL;
+ pp[j] = NULL;
return len;
}
diff --git a/unix/tclUnixFCmd.c b/unix/tclUnixFCmd.c
index 3e1a5c2..17822f5 100644
--- a/unix/tclUnixFCmd.c
+++ b/unix/tclUnixFCmd.c
@@ -331,8 +331,8 @@ TclpObjRenameFile(
Tcl_Obj *srcPathPtr,
Tcl_Obj *destPathPtr)
{
- return DoRenameFile(Tcl_FSGetNativePath(srcPathPtr),
- Tcl_FSGetNativePath(destPathPtr));
+ return DoRenameFile((const char *)Tcl_FSGetNativePath(srcPathPtr),
+ (const char *)Tcl_FSGetNativePath(destPathPtr));
}
static int
@@ -447,14 +447,14 @@ TclpObjCopyFile(
Tcl_Obj *srcPathPtr,
Tcl_Obj *destPathPtr)
{
- const char *src = Tcl_FSGetNativePath(srcPathPtr);
+ const char *src = (const char *)Tcl_FSGetNativePath(srcPathPtr);
Tcl_StatBuf srcStatBuf;
if (TclOSlstat(src, &srcStatBuf) != 0) { /* INTL: Native. */
return TCL_ERROR;
}
- return DoCopyFile(src, Tcl_FSGetNativePath(destPathPtr), &srcStatBuf);
+ return DoCopyFile(src, (const char *)Tcl_FSGetNativePath(destPathPtr), &srcStatBuf);
}
static int
@@ -610,7 +610,7 @@ TclUnixCopyFile(
if (blockSize <= 0) {
blockSize = DEFAULT_COPY_BLOCK_SIZE;
}
- buffer = ckalloc(blockSize);
+ buffer = (char *)ckalloc(blockSize);
while (1) {
nread = (size_t) read(srcFd, buffer, blockSize);
if ((nread == (size_t) -1) || (nread == 0)) {
@@ -709,7 +709,7 @@ int
TclpObjCreateDirectory(
Tcl_Obj *pathPtr)
{
- return DoCreateDirectory(Tcl_FSGetNativePath(pathPtr));
+ return DoCreateDirectory((const char *)Tcl_FSGetNativePath(pathPtr));
}
static int
@@ -1528,7 +1528,7 @@ SetGroupAttribute(
gid = groupPtr->gr_gid;
}
- native = Tcl_FSGetNativePath(fileName);
+ native = (const char *)Tcl_FSGetNativePath(fileName);
result = chown(native, (uid_t) -1, (gid_t) gid); /* INTL: Native. */
if (result != 0) {
@@ -1594,7 +1594,7 @@ SetOwnerAttribute(
uid = pwPtr->pw_uid;
}
- native = Tcl_FSGetNativePath(fileName);
+ native = (const char *)Tcl_FSGetNativePath(fileName);
result = chown(native, (uid_t) uid, (gid_t) -1); /* INTL: Native. */
if (result != 0) {
@@ -1688,7 +1688,7 @@ SetPermissionsAttribute(
}
}
- native = Tcl_FSGetNativePath(fileName);
+ native = (const char *)Tcl_FSGetNativePath(fileName);
result = chmod(native, newMode); /* INTL: Native. */
if (result != 0) {
if (interp != NULL) {
@@ -2173,7 +2173,7 @@ TclUnixOpenTemporaryFile(
Tcl_Obj *extensionObj,
Tcl_Obj *resultingNameObj)
{
- Tcl_DString template, tmp;
+ Tcl_DString templ, tmp;
const char *string;
int fd;
@@ -2183,46 +2183,46 @@ TclUnixOpenTemporaryFile(
if (dirObj) {
string = TclGetString(dirObj);
- Tcl_UtfToExternalDString(NULL, string, dirObj->length, &template);
+ Tcl_UtfToExternalDString(NULL, string, dirObj->length, &templ);
} else {
- Tcl_DStringInit(&template);
- Tcl_DStringAppend(&template, DefaultTempDir(), -1); /* INTL: native */
+ Tcl_DStringInit(&templ);
+ Tcl_DStringAppend(&templ, DefaultTempDir(), -1); /* INTL: native */
}
- TclDStringAppendLiteral(&template, "/");
+ TclDStringAppendLiteral(&templ, "/");
if (basenameObj) {
string = TclGetString(basenameObj);
Tcl_UtfToExternalDString(NULL, string, basenameObj->length, &tmp);
- TclDStringAppendDString(&template, &tmp);
+ TclDStringAppendDString(&templ, &tmp);
Tcl_DStringFree(&tmp);
} else {
- TclDStringAppendLiteral(&template, "tcl");
+ TclDStringAppendLiteral(&templ, "tcl");
}
- TclDStringAppendLiteral(&template, "_XXXXXX");
+ TclDStringAppendLiteral(&templ, "_XXXXXX");
#ifdef HAVE_MKSTEMPS
if (extensionObj) {
string = TclGetString(extensionObj);
Tcl_UtfToExternalDString(NULL, string, extensionObj->length, &tmp);
- TclDStringAppendDString(&template, &tmp);
- fd = mkstemps(Tcl_DStringValue(&template), Tcl_DStringLength(&tmp));
+ TclDStringAppendDString(&templ, &tmp);
+ fd = mkstemps(Tcl_DStringValue(&templ), Tcl_DStringLength(&tmp));
Tcl_DStringFree(&tmp);
} else
#endif
{
- fd = mkstemp(Tcl_DStringValue(&template));
+ fd = mkstemp(Tcl_DStringValue(&templ));
}
if (fd == -1) {
- Tcl_DStringFree(&template);
+ Tcl_DStringFree(&templ);
return -1;
}
if (resultingNameObj) {
- Tcl_ExternalToUtfDString(NULL, Tcl_DStringValue(&template),
- Tcl_DStringLength(&template), &tmp);
+ Tcl_ExternalToUtfDString(NULL, Tcl_DStringValue(&templ),
+ Tcl_DStringLength(&templ), &tmp);
Tcl_SetStringObj(resultingNameObj, Tcl_DStringValue(&tmp),
Tcl_DStringLength(&tmp));
Tcl_DStringFree(&tmp);
@@ -2233,10 +2233,10 @@ TclUnixOpenTemporaryFile(
* this!
*/
- unlink(Tcl_DStringValue(&template));
+ unlink(Tcl_DStringValue(&templ));
errno = 0;
}
- Tcl_DStringFree(&template);
+ Tcl_DStringFree(&templ);
return fd;
}
@@ -2296,7 +2296,7 @@ TclpCreateTemporaryDirectory(
Tcl_Obj *dirObj,
Tcl_Obj *basenameObj)
{
- Tcl_DString template, tmp;
+ Tcl_DString templ, tmp;
const char *string;
#define DEFAULT_TEMP_DIR_PREFIX "tcl"
@@ -2308,37 +2308,37 @@ TclpCreateTemporaryDirectory(
if (dirObj) {
string = TclGetString(dirObj);
- Tcl_UtfToExternalDString(NULL, string, dirObj->length, &template);
+ Tcl_UtfToExternalDString(NULL, string, dirObj->length, &templ);
} else {
- Tcl_DStringInit(&template);
- Tcl_DStringAppend(&template, DefaultTempDir(), -1); /* INTL: native */
+ Tcl_DStringInit(&templ);
+ Tcl_DStringAppend(&templ, DefaultTempDir(), -1); /* INTL: native */
}
- if (Tcl_DStringValue(&template)[Tcl_DStringLength(&template) - 1] != '/') {
- TclDStringAppendLiteral(&template, "/");
+ if (Tcl_DStringValue(&templ)[Tcl_DStringLength(&templ) - 1] != '/') {
+ TclDStringAppendLiteral(&templ, "/");
}
if (basenameObj) {
string = TclGetString(basenameObj);
if (basenameObj->length) {
Tcl_UtfToExternalDString(NULL, string, basenameObj->length, &tmp);
- TclDStringAppendDString(&template, &tmp);
+ TclDStringAppendDString(&templ, &tmp);
Tcl_DStringFree(&tmp);
} else {
- TclDStringAppendLiteral(&template, DEFAULT_TEMP_DIR_PREFIX);
+ TclDStringAppendLiteral(&templ, DEFAULT_TEMP_DIR_PREFIX);
}
} else {
- TclDStringAppendLiteral(&template, DEFAULT_TEMP_DIR_PREFIX);
+ TclDStringAppendLiteral(&templ, DEFAULT_TEMP_DIR_PREFIX);
}
- TclDStringAppendLiteral(&template, "_XXXXXX");
+ TclDStringAppendLiteral(&templ, "_XXXXXX");
/*
* Make the temporary directory.
*/
- if (mkdtemp(Tcl_DStringValue(&template)) == NULL) {
- Tcl_DStringFree(&template);
+ if (mkdtemp(Tcl_DStringValue(&templ)) == NULL) {
+ Tcl_DStringFree(&templ);
return NULL;
}
@@ -2346,9 +2346,9 @@ TclpCreateTemporaryDirectory(
* The template has been updated. Tell the caller what it was.
*/
- Tcl_ExternalToUtfDString(NULL, Tcl_DStringValue(&template),
- Tcl_DStringLength(&template), &tmp);
- Tcl_DStringFree(&template);
+ Tcl_ExternalToUtfDString(NULL, Tcl_DStringValue(&templ),
+ Tcl_DStringLength(&templ), &tmp);
+ Tcl_DStringFree(&templ);
return TclDStringToObj(&tmp);
}
@@ -2370,11 +2370,11 @@ winPathFromObj(
Tcl_Obj *fileName)
{
int size;
- const char *native = Tcl_FSGetNativePath(fileName);
+ const char *native = (const char *)Tcl_FSGetNativePath(fileName);
WCHAR *winPath;
size = cygwin_conv_path(1, native, NULL, 0);
- winPath = ckalloc(size);
+ winPath = (WCHAR *)ckalloc(size);
cygwin_conv_path(1, native, winPath, size);
return winPath;
diff --git a/unix/tclUnixFile.c b/unix/tclUnixFile.c
index bf033d2..2f6baf6 100644
--- a/unix/tclUnixFile.c
+++ b/unix/tclUnixFile.c
@@ -249,9 +249,9 @@ TclpMatchInDirectory(
Tcl_Obj *tailPtr;
const char *nativeTail;
- native = Tcl_FSGetNativePath(pathPtr);
+ native = (const char *)Tcl_FSGetNativePath(pathPtr);
tailPtr = TclPathPart(interp, pathPtr, TCL_PATH_TAIL);
- nativeTail = Tcl_FSGetNativePath(tailPtr);
+ nativeTail = (const char *)Tcl_FSGetNativePath(tailPtr);
matchResult = NativeMatchType(interp, native, nativeTail, types);
if (matchResult == 1) {
Tcl_ListObjAppendElement(interp, resultPtr, pathPtr);
@@ -622,7 +622,7 @@ TclpObjAccess(
Tcl_Obj *pathPtr, /* Path of file to access */
int mode) /* Permission setting. */
{
- const char *path = Tcl_FSGetNativePath(pathPtr);
+ const char *path = (const char *)Tcl_FSGetNativePath(pathPtr);
if (path == NULL) {
return -1;
@@ -650,7 +650,7 @@ int
TclpObjChdir(
Tcl_Obj *pathPtr) /* Path to new working directory */
{
- const char *path = Tcl_FSGetNativePath(pathPtr);
+ const char *path = (const char *)Tcl_FSGetNativePath(pathPtr);
if (path == NULL) {
return -1;
@@ -679,7 +679,7 @@ TclpObjLstat(
Tcl_Obj *pathPtr, /* Path of file to stat */
Tcl_StatBuf *bufPtr) /* Filled with results of stat call. */
{
- return TclOSlstat(Tcl_FSGetNativePath(pathPtr), bufPtr);
+ return TclOSlstat((const char *)Tcl_FSGetNativePath(pathPtr), bufPtr);
}
/*
@@ -720,7 +720,7 @@ TclpGetNativeCwd(
#endif /* USEGETWD */
if ((clientData == NULL) || strcmp(buffer, (const char *) clientData)) {
- char *newCd = ckalloc(strlen(buffer) + 1);
+ char *newCd = (char*)ckalloc(strlen(buffer) + 1);
strcpy(newCd, buffer);
return newCd;
@@ -847,7 +847,7 @@ TclpObjStat(
Tcl_Obj *pathPtr, /* Path of file to stat */
Tcl_StatBuf *bufPtr) /* Filled with results of stat call. */
{
- const char *path = Tcl_FSGetNativePath(pathPtr);
+ const char *path = (const char *)Tcl_FSGetNativePath(pathPtr);
if (path == NULL) {
return -1;
@@ -864,7 +864,7 @@ TclpObjLink(
int linkAction)
{
if (toPtr != NULL) {
- const char *src = Tcl_FSGetNativePath(pathPtr);
+ const char *src = (const char *)Tcl_FSGetNativePath(pathPtr);
const char *target = NULL;
if (src == NULL) {
@@ -910,7 +910,7 @@ TclpObjLink(
Tcl_DecrRefCount(absPtr);
Tcl_DecrRefCount(dirPtr);
} else {
- target = Tcl_FSGetNativePath(toPtr);
+ target = (const char*)Tcl_FSGetNativePath(toPtr);
if (target == NULL) {
return NULL;
}
@@ -982,7 +982,7 @@ TclpObjLink(
}
Tcl_DecrRefCount(transPtr);
- length = readlink(Tcl_FSGetNativePath(pathPtr), link, sizeof(link));
+ length = readlink((const char *)Tcl_FSGetNativePath(pathPtr), link, sizeof(link));
if (length < 0) {
return NULL;
}
@@ -1116,7 +1116,7 @@ TclNativeCreateNativeRep(
return NULL;
}
Tcl_DecrRefCount(validPathPtr);
- nativePathPtr = ckalloc(len);
+ nativePathPtr = (char *)ckalloc(len);
memcpy(nativePathPtr, Tcl_DStringValue(&ds), len);
Tcl_DStringFree(&ds);
@@ -1157,7 +1157,7 @@ TclNativeDupInternalRep(
len = (strlen((const char*) clientData) + 1) * sizeof(char);
- copy = ckalloc(len);
+ copy = (char *)ckalloc(len);
memcpy(copy, clientData, len);
return copy;
}
@@ -1183,7 +1183,7 @@ TclpUtime(
Tcl_Obj *pathPtr, /* File to modify */
struct utimbuf *tval) /* New modification date structure */
{
- return utime(Tcl_FSGetNativePath(pathPtr), tval);
+ return utime((const char *)Tcl_FSGetNativePath(pathPtr), tval);
}
#ifdef __CYGWIN__
@@ -1194,7 +1194,7 @@ TclOSstat(
void *cygstat)
{
struct stat buf;
- Tcl_StatBuf *statBuf = cygstat;
+ Tcl_StatBuf *statBuf = (Tcl_StatBuf *)cygstat;
int result = stat(name, &buf);
statBuf->st_mode = buf.st_mode;
@@ -1217,7 +1217,7 @@ TclOSlstat(
void *cygstat)
{
struct stat buf;
- Tcl_StatBuf *statBuf = cygstat;
+ Tcl_StatBuf *statBuf = (Tcl_StatBuf *)cygstat;
int result = lstat(name, &buf);
statBuf->st_mode = buf.st_mode;
diff --git a/unix/tclUnixInit.c b/unix/tclUnixInit.c
index b6b66da..7406991 100644
--- a/unix/tclUnixInit.c
+++ b/unix/tclUnixInit.c
@@ -539,7 +539,7 @@ TclpInitLibraryPath(
*encodingPtr = Tcl_GetEncoding(NULL, NULL);
str = TclGetString(pathPtr);
*lengthPtr = pathPtr->length;
- *valuePtr = ckalloc(*lengthPtr + 1);
+ *valuePtr = (char *)ckalloc(*lengthPtr + 1);
memcpy(*valuePtr, str, *lengthPtr + 1);
Tcl_DecrRefCount(pathPtr);
}
diff --git a/unix/tclUnixPipe.c b/unix/tclUnixPipe.c
index 93faec8..bb01597 100644
--- a/unix/tclUnixPipe.c
+++ b/unix/tclUnixPipe.c
@@ -48,16 +48,16 @@ typedef struct {
* Declarations for local functions defined in this file:
*/
-static int PipeBlockModeProc(ClientData instanceData, int mode);
-static int PipeClose2Proc(ClientData instanceData,
+static int PipeBlockModeProc(void *instanceData, int mode);
+static int PipeClose2Proc(void *instanceData,
Tcl_Interp *interp, int flags);
-static int PipeGetHandleProc(ClientData instanceData,
- int direction, ClientData *handlePtr);
-static int PipeInputProc(ClientData instanceData, char *buf,
+static int PipeGetHandleProc(void *instanceData,
+ int direction, void **handlePtr);
+static int PipeInputProc(void *instanceData, char *buf,
int toRead, int *errorCode);
-static int PipeOutputProc(ClientData instanceData,
+static int PipeOutputProc(void *instanceData,
const char *buf, int toWrite, int *errorCode);
-static void PipeWatchProc(ClientData instanceData, int mask);
+static void PipeWatchProc(void *instanceData, int mask);
static void RestoreSignals(void);
static int SetupStdFile(TclFile file, int type);
@@ -107,7 +107,7 @@ TclpMakeFile(
Tcl_Channel channel, /* Channel to get file from. */
int direction) /* Either TCL_READABLE or TCL_WRITABLE. */
{
- ClientData data;
+ void *data;
if (Tcl_GetChannelHandle(channel, direction, &data) != TCL_OK) {
return NULL;
@@ -432,8 +432,8 @@ TclpCreateProcess(
* deallocated later
*/
- dsArray = TclStackAlloc(interp, argc * sizeof(Tcl_DString));
- newArgv = TclStackAlloc(interp, (argc+1) * sizeof(char *));
+ dsArray = (Tcl_DString *)TclStackAlloc(interp, argc * sizeof(Tcl_DString));
+ newArgv = (char **)TclStackAlloc(interp, (argc+1) * sizeof(char *));
newArgv[argc] = NULL;
for (i = 0; i < argc; i++) {
newArgv[i] = Tcl_UtfToExternalDString(NULL, argv[i], -1, &dsArray[i]);
@@ -744,7 +744,7 @@ TclpCreateCommandChannel(
{
char channelName[16 + TCL_INTEGER_SPACE];
int channelId;
- PipeState *statePtr = ckalloc(sizeof(PipeState));
+ PipeState *statePtr = (PipeState *)ckalloc(sizeof(PipeState));
int mode;
statePtr->inFile = readFile;
@@ -869,7 +869,7 @@ TclGetAndDetachPids(
return;
}
- pipePtr = Tcl_GetChannelInstanceData(chan);
+ pipePtr = (PipeState *)Tcl_GetChannelInstanceData(chan);
TclNewObj(pidsObj);
for (i = 0; i < pipePtr->numPids; i++) {
Tcl_ListObjAppendElement(NULL, pidsObj, Tcl_NewWideIntObj(
@@ -903,12 +903,12 @@ TclGetAndDetachPids(
/* ARGSUSED */
static int
PipeBlockModeProc(
- ClientData instanceData, /* Pipe state. */
+ void *instanceData, /* Pipe state. */
int mode) /* The mode to set. Can be one of
* TCL_MODE_BLOCKING or
* TCL_MODE_NONBLOCKING. */
{
- PipeState *psPtr = instanceData;
+ PipeState *psPtr = (PipeState *)instanceData;
if (psPtr->inFile
&& TclUnixSetBlockingMode(GetFd(psPtr->inFile), mode) < 0) {
@@ -943,11 +943,11 @@ PipeBlockModeProc(
static int
PipeClose2Proc(
- ClientData instanceData, /* The pipe to close. */
+ void *instanceData, /* The pipe to close. */
Tcl_Interp *interp, /* For error reporting. */
int flags) /* Flags that indicate which side to close. */
{
- PipeState *pipePtr = instanceData;
+ PipeState *pipePtr = (PipeState *)instanceData;
Tcl_Channel errChan;
int errorCode, result;
@@ -1038,13 +1038,13 @@ PipeClose2Proc(
static int
PipeInputProc(
- ClientData instanceData, /* Pipe state. */
+ void *instanceData, /* Pipe state. */
char *buf, /* Where to store data read. */
int toRead, /* How much space is available in the
* buffer? */
int *errorCodePtr) /* Where to store error code. */
{
- PipeState *psPtr = instanceData;
+ PipeState *psPtr = (PipeState *)instanceData;
int bytesRead; /* How many bytes were actually read from the
* input device? */
@@ -1089,12 +1089,12 @@ PipeInputProc(
static int
PipeOutputProc(
- ClientData instanceData, /* Pipe state. */
+ void *instanceData, /* Pipe state. */
const char *buf, /* The data buffer. */
int toWrite, /* How many bytes to write? */
int *errorCodePtr) /* Where to store error code. */
{
- PipeState *psPtr = instanceData;
+ PipeState *psPtr = (PipeState *)instanceData;
int written;
*errorCodePtr = 0;
@@ -1134,12 +1134,12 @@ PipeOutputProc(
static void
PipeWatchProc(
- ClientData instanceData, /* The pipe state. */
+ void *instanceData, /* The pipe state. */
int mask) /* Events of interest; an OR-ed combination of
* TCL_READABLE, TCL_WRITABLE and
* TCL_EXCEPTION. */
{
- PipeState *psPtr = instanceData;
+ PipeState *psPtr = (PipeState *)instanceData;
int newmask;
if (psPtr->inFile) {
@@ -1182,11 +1182,11 @@ PipeWatchProc(
static int
PipeGetHandleProc(
- ClientData instanceData, /* The pipe state. */
+ void *instanceData, /* The pipe state. */
int direction, /* TCL_READABLE or TCL_WRITABLE */
- ClientData *handlePtr) /* Where to store the handle. */
+ void **handlePtr) /* Where to store the handle. */
{
- PipeState *psPtr = instanceData;
+ PipeState *psPtr = (PipeState *)instanceData;
if (direction == TCL_READABLE && psPtr->inFile) {
*handlePtr = INT2PTR(GetFd(psPtr->inFile));
@@ -1252,7 +1252,7 @@ Tcl_WaitPid(
/* ARGSUSED */
int
Tcl_PidObjCmd(
- ClientData dummy, /* Not used. */
+ void *dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const *objv) /* Argument strings. */
@@ -1286,7 +1286,7 @@ Tcl_PidObjCmd(
* Extract the process IDs from the pipe structure.
*/
- pipePtr = Tcl_GetChannelInstanceData(chan);
+ pipePtr = (PipeState *)Tcl_GetChannelInstanceData(chan);
resultPtr = Tcl_NewObj();
for (i = 0; i < pipePtr->numPids; i++) {
Tcl_ListObjAppendElement(NULL, resultPtr,
diff --git a/unix/tclUnixSock.c b/unix/tclUnixSock.c
index 62e4756..c061a78 100644
--- a/unix/tclUnixSock.c
+++ b/unix/tclUnixSock.c
@@ -66,7 +66,7 @@ struct TcpState {
Tcl_TcpAcceptProc *acceptProc;
/* Proc to call on accept. */
- ClientData acceptProcData; /* The data for the accept proc. */
+ void *acceptProcData; /* The data for the accept proc. */
/*
* Only needed for client sockets
@@ -130,24 +130,24 @@ struct TcpState {
*/
static int TcpConnect(Tcl_Interp *interp, TcpState *state);
-static void TcpAccept(ClientData data, int mask);
-static int TcpBlockModeProc(ClientData data, int mode);
-static int TcpCloseProc(ClientData instanceData,
+static void TcpAccept(void *data, int mask);
+static int TcpBlockModeProc(void *data, int mode);
+static int TcpCloseProc(void *instanceData,
Tcl_Interp *interp);
-static int TcpClose2Proc(ClientData instanceData,
+static int TcpClose2Proc(void *instanceData,
Tcl_Interp *interp, int flags);
-static int TcpGetHandleProc(ClientData instanceData,
- int direction, ClientData *handlePtr);
-static int TcpGetOptionProc(ClientData instanceData,
+static int TcpGetHandleProc(void *instanceData,
+ int direction, void **handlePtr);
+static int TcpGetOptionProc(void *instanceData,
Tcl_Interp *interp, const char *optionName,
Tcl_DString *dsPtr);
-static int TcpInputProc(ClientData instanceData, char *buf,
+static int TcpInputProc(void *instanceData, char *buf,
int toRead, int *errorCode);
-static int TcpOutputProc(ClientData instanceData,
+static int TcpOutputProc(void *instanceData,
const char *buf, int toWrite, int *errorCode);
-static void TcpWatchProc(ClientData instanceData, int mask);
+static void TcpWatchProc(void *instanceData, int mask);
static int WaitForConnect(TcpState *statePtr, int *errorCodePtr);
-static void WrapNotify(ClientData clientData, int mask);
+static void WrapNotify(void *clientData, int mask);
/*
* This structure describes the channel type structure for TCP socket
@@ -239,7 +239,7 @@ InitializeHostName(
char *dot = strchr(u.nodename, '.');
if (dot != NULL) {
- char *node = ckalloc(dot - u.nodename + 1);
+ char *node = (char *)ckalloc(dot - u.nodename + 1);
memcpy(node, u.nodename, dot - u.nodename);
node[dot - u.nodename] = '\0';
@@ -283,11 +283,11 @@ InitializeHostName(
*encodingPtr = Tcl_GetEncoding(NULL, NULL);
if (native) {
*lengthPtr = strlen(native);
- *valuePtr = ckalloc(*lengthPtr + 1);
+ *valuePtr = (char *)ckalloc(*lengthPtr + 1);
memcpy(*valuePtr, native, *lengthPtr + 1);
} else {
*lengthPtr = 0;
- *valuePtr = ckalloc(1);
+ *valuePtr = (char *)ckalloc(1);
*valuePtr[0] = '\0';
}
}
@@ -381,12 +381,12 @@ TclpFinalizeSockets(void)
/* ARGSUSED */
static int
TcpBlockModeProc(
- ClientData instanceData, /* Socket state. */
+ void *instanceData, /* Socket state. */
int mode) /* The mode to set. Can be one of
* TCL_MODE_BLOCKING or
* TCL_MODE_NONBLOCKING. */
{
- TcpState *statePtr = instanceData;
+ TcpState *statePtr = (TcpState *)instanceData;
if (mode == TCL_MODE_BLOCKING) {
CLEAR_BITS(statePtr->flags, TCP_NONBLOCKING);
@@ -527,13 +527,13 @@ WaitForConnect(
/* ARGSUSED */
static int
TcpInputProc(
- ClientData instanceData, /* Socket state. */
+ void *instanceData, /* Socket state. */
char *buf, /* Where to store data read. */
int bufSize, /* How much space is available in the
* buffer? */
int *errorCodePtr) /* Where to store error code. */
{
- TcpState *statePtr = instanceData;
+ TcpState *statePtr = (TcpState *)instanceData;
int bytesRead;
*errorCodePtr = 0;
@@ -578,12 +578,12 @@ TcpInputProc(
static int
TcpOutputProc(
- ClientData instanceData, /* Socket state. */
+ void *instanceData, /* Socket state. */
const char *buf, /* The data buffer. */
int toWrite, /* How many bytes to write? */
int *errorCodePtr) /* Where to store error code. */
{
- TcpState *statePtr = instanceData;
+ TcpState *statePtr = (TcpState *)instanceData;
int written;
*errorCodePtr = 0;
@@ -620,10 +620,10 @@ TcpOutputProc(
/* ARGSUSED */
static int
TcpCloseProc(
- ClientData instanceData, /* The socket to close. */
+ void *instanceData, /* The socket to close. */
Tcl_Interp *interp) /* For error reporting - unused. */
{
- TcpState *statePtr = instanceData;
+ TcpState *statePtr = (TcpState *)instanceData;
int errorCode = 0;
TcpFdList *fds;
@@ -681,11 +681,11 @@ TcpCloseProc(
static int
TcpClose2Proc(
- ClientData instanceData, /* The socket to close. */
+ void *instanceData, /* The socket to close. */
Tcl_Interp *interp, /* For error reporting. */
int flags) /* Flags that indicate which side to close. */
{
- TcpState *statePtr = instanceData;
+ TcpState *statePtr = (TcpState *)instanceData;
int errorCode = 0;
int sd;
@@ -842,7 +842,7 @@ TcpHostPortList(
static int
TcpGetOptionProc(
- ClientData instanceData, /* Socket state. */
+ void *instanceData, /* Socket state. */
Tcl_Interp *interp, /* For error reporting - can be NULL. */
const char *optionName, /* Name of the option to retrieve the value
* for, or NULL to get all options and their
@@ -850,7 +850,7 @@ TcpGetOptionProc(
Tcl_DString *dsPtr) /* Where to store the computed value;
* initialized by caller. */
{
- TcpState *statePtr = instanceData;
+ TcpState *statePtr = (TcpState *)instanceData;
size_t len = 0;
WaitForConnect(statePtr, NULL);
@@ -1008,7 +1008,7 @@ TcpGetOptionProc(
static void
WrapNotify(
- ClientData clientData,
+ void *clientData,
int mask)
{
TcpState *statePtr = (TcpState *) clientData;
@@ -1037,12 +1037,12 @@ WrapNotify(
static void
TcpWatchProc(
- ClientData instanceData, /* The socket state. */
+ void *instanceData, /* The socket state. */
int mask) /* Events of interest; an OR-ed combination of
* TCL_READABLE, TCL_WRITABLE and
* TCL_EXCEPTION. */
{
- TcpState *statePtr = instanceData;
+ TcpState *statePtr = (TcpState *)instanceData;
if (statePtr->acceptProc != NULL) {
/*
@@ -1111,11 +1111,11 @@ TcpWatchProc(
/* ARGSUSED */
static int
TcpGetHandleProc(
- ClientData instanceData, /* The socket state. */
+ void *instanceData, /* The socket state. */
int direction, /* Not used. */
- ClientData *handlePtr) /* Where to store the handle. */
+ void **handlePtr) /* Where to store the handle. */
{
- TcpState *statePtr = instanceData;
+ TcpState *statePtr = (TcpState *)instanceData;
*handlePtr = INT2PTR(statePtr->fds.fd);
return TCL_OK;
@@ -1135,12 +1135,12 @@ TcpGetHandleProc(
static void
TcpAsyncCallback(
- ClientData clientData, /* The socket state. */
+ void *clientData, /* The socket state. */
int mask) /* Events of interest; an OR-ed combination of
* TCL_READABLE, TCL_WRITABLE and
* TCL_EXCEPTION. */
{
- TcpConnect(NULL, clientData);
+ TcpConnect(NULL, (TcpState *)clientData);
}
/*
@@ -1182,6 +1182,7 @@ TcpConnect(
int async_callback = GOT_BITS(statePtr->flags, TCP_ASYNC_PENDING);
int ret = -1, error = EHOSTUNREACH;
int async = GOT_BITS(statePtr->flags, TCP_ASYNC_CONNECT);
+ static const int reuseaddr = 1;
if (async_callback) {
goto reenter;
@@ -1192,7 +1193,6 @@ TcpConnect(
for (statePtr->myaddr = statePtr->myaddrlist;
statePtr->myaddr != NULL;
statePtr->myaddr = statePtr->myaddr->ai_next) {
- int reuseaddr = 1;
/*
* No need to try combinations of local and remote addresses of
@@ -1399,7 +1399,7 @@ Tcl_OpenTcpClient(
* Allocate a new TcpState for this socket.
*/
- statePtr = ckalloc(sizeof(TcpState));
+ statePtr = (TcpState *)ckalloc(sizeof(TcpState));
memset(statePtr, 0, sizeof(TcpState));
statePtr->flags = async ? TCP_ASYNC_CONNECT : 0;
statePtr->cachedBlocking = TCL_MODE_BLOCKING;
@@ -1446,7 +1446,7 @@ Tcl_OpenTcpClient(
Tcl_Channel
Tcl_MakeTcpClientChannel(
- ClientData sock) /* The socket to wrap up into a channel. */
+ void *sock) /* The socket to wrap up into a channel. */
{
return (Tcl_Channel) TclpMakeTcpClientChannelMode(sock,
TCL_READABLE | TCL_WRITABLE);
@@ -1478,7 +1478,7 @@ TclpMakeTcpClientChannelMode(
TcpState *statePtr;
char channelName[SOCK_CHAN_LENGTH];
- statePtr = ckalloc(sizeof(TcpState));
+ statePtr = (TcpState *)ckalloc(sizeof(TcpState));
memset(statePtr, 0, sizeof(TcpState));
statePtr->fds.fd = PTR2INT(sock);
statePtr->flags = 0;
@@ -1521,7 +1521,7 @@ Tcl_OpenTcpServerEx(
Tcl_TcpAcceptProc *acceptProc,
/* Callback for accepting connections from new
* clients. */
- ClientData acceptProcData) /* Data for the callback. */
+ void *acceptProcData) /* Data for the callback. */
{
int status = 0, sock = -1, optvalue, port, chosenport;
struct addrinfo *addrlist = NULL, *addrPtr; /* socket address */
@@ -1701,14 +1701,14 @@ Tcl_OpenTcpServerEx(
* Allocate a new TcpState for this socket.
*/
- statePtr = ckalloc(sizeof(TcpState));
+ statePtr = (TcpState *)ckalloc(sizeof(TcpState));
memset(statePtr, 0, sizeof(TcpState));
statePtr->acceptProc = acceptProc;
statePtr->acceptProcData = acceptProcData;
sprintf(channelName, SOCK_TEMPLATE, (long) statePtr);
newfds = &statePtr->fds;
} else {
- newfds = ckalloc(sizeof(TcpFdList));
+ newfds = (TcpFdList *)ckalloc(sizeof(TcpFdList));
memset(newfds, (int) 0, sizeof(TcpFdList));
fds->next = newfds;
}
@@ -1769,10 +1769,10 @@ Tcl_OpenTcpServerEx(
/* ARGSUSED */
static void
TcpAccept(
- ClientData data, /* Callback token. */
+ void *data, /* Callback token. */
int mask) /* Not used. */
{
- TcpFdList *fds = data; /* Client data of server socket. */
+ TcpFdList *fds = (TcpFdList *)data; /* Client data of server socket. */
int newsock; /* The new client socket */
TcpState *newSockState; /* State for new socket. */
address addr; /* The remote address */
@@ -1793,7 +1793,7 @@ TcpAccept(
(void) fcntl(newsock, F_SETFD, FD_CLOEXEC);
- newSockState = ckalloc(sizeof(TcpState));
+ newSockState = (TcpState *)ckalloc(sizeof(TcpState));
memset(newSockState, 0, sizeof(TcpState));
newSockState->flags = 0;
newSockState->fds.fd = newsock;
diff --git a/unix/tclUnixTest.c b/unix/tclUnixTest.c
index e59a0e3..eb91ba1 100644
--- a/unix/tclUnixTest.c
+++ b/unix/tclUnixTest.c
@@ -331,7 +331,7 @@ TestFileHandlerProc(
int mask) /* Indicates which events happened:
* TCL_READABLE or TCL_WRITABLE. */
{
- Pipe *pipePtr = clientData;
+ Pipe *pipePtr = (Pipe *)clientData;
if (mask & TCL_READABLE) {
pipePtr->readCount++;
diff --git a/unix/tclUnixThrd.c b/unix/tclUnixThrd.c
index 60340b0..30e19ca 100644
--- a/unix/tclUnixThrd.c
+++ b/unix/tclUnixThrd.c
@@ -577,7 +577,7 @@ Tcl_MutexLock(
* Double inside master lock check to avoid a race condition.
*/
- pmutexPtr = ckalloc(sizeof(PMutex));
+ pmutexPtr = (PMutex *)ckalloc(sizeof(PMutex));
PMutexInit(pmutexPtr);
*mutexPtr = (Tcl_Mutex) pmutexPtr;
TclRememberMutex(mutexPtr);
@@ -687,7 +687,7 @@ Tcl_ConditionWait(
*/
if (*condPtr == NULL) {
- pcondPtr = ckalloc(sizeof(pthread_cond_t));
+ pcondPtr = (pthread_cond_t *)ckalloc(sizeof(pthread_cond_t));
pthread_cond_init(pcondPtr, NULL);
*condPtr = (Tcl_Condition) pcondPtr;
TclRememberCondition(condPtr);
@@ -846,7 +846,7 @@ TclpNewAllocMutex(void)
AllocMutex *lockPtr;
register PMutex *plockPtr;
- lockPtr = malloc(sizeof(AllocMutex));
+ lockPtr = (AllocMutex *)malloc(sizeof(AllocMutex));
if (lockPtr == NULL) {
Tcl_Panic("could not allocate lock");
}
@@ -917,7 +917,7 @@ TclpThreadCreateKey(void)
{
pthread_key_t *ptkeyPtr;
- ptkeyPtr = TclpSysAlloc(sizeof(pthread_key_t), 0);
+ ptkeyPtr = (pthread_key_t *)TclpSysAlloc(sizeof(pthread_key_t), 0);
if (NULL == ptkeyPtr) {
Tcl_Panic("unable to allocate thread key!");
}
@@ -933,7 +933,7 @@ void
TclpThreadDeleteKey(
void *keyPtr)
{
- pthread_key_t *ptkeyPtr = keyPtr;
+ pthread_key_t *ptkeyPtr = (pthread_key_t *)keyPtr;
if (pthread_key_delete(*ptkeyPtr)) {
Tcl_Panic("unable to delete key!");
@@ -947,7 +947,7 @@ TclpThreadSetMasterTSD(
void *tsdKeyPtr,
void *ptr)
{
- pthread_key_t *ptkeyPtr = tsdKeyPtr;
+ pthread_key_t *ptkeyPtr = (pthread_key_t *)tsdKeyPtr;
if (pthread_setspecific(*ptkeyPtr, ptr)) {
Tcl_Panic("unable to set master TSD value");
@@ -958,7 +958,7 @@ void *
TclpThreadGetMasterTSD(
void *tsdKeyPtr)
{
- pthread_key_t *ptkeyPtr = tsdKeyPtr;
+ pthread_key_t *ptkeyPtr = (pthread_key_t*)tsdKeyPtr;
return pthread_getspecific(*ptkeyPtr);
}
diff --git a/unix/tclUnixTime.c b/unix/tclUnixTime.c
index 1d8b351..0bdadc7 100644
--- a/unix/tclUnixTime.c
+++ b/unix/tclUnixTime.c
@@ -59,7 +59,7 @@ static void NativeGetTime(Tcl_Time *timebuf,
Tcl_GetTimeProc *tclGetTimeProcPtr = NativeGetTime;
Tcl_ScaleTimeProc *tclScaleTimeProcPtr = NativeScaleTime;
-ClientData tclTimeClientData = NULL;
+void *tclTimeClientData = NULL;
/*
*----------------------------------------------------------------------
@@ -579,7 +579,7 @@ SetTZIfNecessary(void)
} else {
ckfree(lastTZ);
}
- lastTZ = ckalloc(strlen(newTZ) + 1);
+ lastTZ = (char *)ckalloc(strlen(newTZ) + 1);
strcpy(lastTZ, newTZ);
}
Tcl_MutexUnlock(&tmMutex);
diff --git a/unix/tclXtNotify.c b/unix/tclXtNotify.c
index 26db9f2..490b739 100644
--- a/unix/tclXtNotify.c
+++ b/unix/tclXtNotify.c
@@ -359,7 +359,7 @@ CreateFileHandler(
}
}
if (filePtr == NULL) {
- filePtr = ckalloc(sizeof(FileHandler));
+ filePtr = (FileHandler *)ckalloc(sizeof(FileHandler));
filePtr->fd = fd;
filePtr->read = 0;
filePtr->write = 0;
@@ -525,7 +525,7 @@ FileProc(
*/
filePtr->readyMask |= mask;
- fileEvPtr = ckalloc(sizeof(FileHandlerEvent));
+ fileEvPtr = (FileHandlerEvent *)ckalloc(sizeof(FileHandlerEvent));
fileEvPtr->header.proc = FileHandlerEventProc;
fileEvPtr->fd = filePtr->fd;
Tcl_QueueEvent((Tcl_Event *) fileEvPtr, TCL_QUEUE_TAIL);
diff --git a/win/tclWinDde.c b/win/tclWinDde.c
index 27ddfc8..06e7878 100644
--- a/win/tclWinDde.c
+++ b/win/tclWinDde.c
@@ -1472,7 +1472,7 @@ DdeObjCmd(
if (length == 0) {
serviceName = NULL;
} else if ((index != DDE_SERVERNAME) && (index != DDE_EVAL)) {
- ddeService = DdeCreateStringHandle(ddeInstance, (void *) serviceName,
+ ddeService = DdeCreateStringHandle(ddeInstance, serviceName,
CP_WINUNICODE);
}
@@ -1485,7 +1485,7 @@ DdeObjCmd(
if (length == 0) {
topicName = NULL;
} else {
- ddeTopic = DdeCreateStringHandle(ddeInstance, (void *) topicName,
+ ddeTopic = DdeCreateStringHandle(ddeInstance, topicName,
CP_WINUNICODE);
}
}
@@ -1592,7 +1592,7 @@ DdeObjCmd(
result = TCL_ERROR;
} else {
Tcl_Obj *returnObjPtr;
- ddeItem = DdeCreateStringHandle(ddeInstance, (void *) itemString,
+ ddeItem = DdeCreateStringHandle(ddeInstance, itemString,
CP_WINUNICODE);
if (ddeItem != NULL) {
ddeData = DdeClientTransaction(NULL, 0, hConv, ddeItem,
@@ -1669,7 +1669,7 @@ DdeObjCmd(
SetDdeError(interp);
result = TCL_ERROR;
} else {
- ddeItem = DdeCreateStringHandle(ddeInstance, (void *) itemString,
+ ddeItem = DdeCreateStringHandle(ddeInstance, itemString,
CP_WINUNICODE);
if (ddeItem != NULL) {
ddeData = DdeClientTransaction(dataString, (DWORD) length,
diff --git a/win/tclWinReg.c b/win/tclWinReg.c
index f93a553..5f131d3 100644
--- a/win/tclWinReg.c
+++ b/win/tclWinReg.c
@@ -215,7 +215,7 @@ Registry_Unload(
* Delete the originally registered command.
*/
- cmd = Tcl_GetAssocData(interp, REGISTRY_ASSOC_KEY, NULL);
+ cmd = (Tcl_Command)Tcl_GetAssocData(interp, REGISTRY_ASSOC_KEY, NULL);
if (cmd != NULL) {
Tcl_DeleteCommandFromToken(interp, cmd);
}
@@ -244,7 +244,7 @@ static void
DeleteCmd(
ClientData clientData)
{
- Tcl_Interp *interp = clientData;
+ Tcl_Interp *interp = (Tcl_Interp *)clientData;
Tcl_SetAssocData(interp, REGISTRY_ASSOC_KEY, NULL, NULL);
}
@@ -1168,7 +1168,7 @@ RecursiveDeleteKey(
HKEY hKey;
REGSAM saveMode = mode;
static int checkExProc = 0;
- static FARPROC regDeleteKeyExProc = NULL;
+ static LSTATUS (* regDeleteKeyExProc) (HKEY, LPCWSTR, REGSAM, DWORD) = (LSTATUS (*) (HKEY, LPCWSTR, REGSAM, DWORD)) NULL;
/*
* Do not allow NULL or empty key name.
@@ -1208,7 +1208,7 @@ RecursiveDeleteKey(
checkExProc = 1;
handle = GetModuleHandle(TEXT("ADVAPI32"));
- regDeleteKeyExProc = (FARPROC)
+ regDeleteKeyExProc = (LSTATUS (*) (HKEY, LPCWSTR, REGSAM, DWORD))
GetProcAddress(handle, "RegDeleteKeyExW");
}
if (mode && regDeleteKeyExProc) {
diff --git a/win/tclWinTest.c b/win/tclWinTest.c
index 40be3d5..1cff8e9 100644
--- a/win/tclWinTest.c
+++ b/win/tclWinTest.c
@@ -465,7 +465,7 @@ TestplatformChmod(
goto done;
}
- secDesc = ckalloc(secDescLen);
+ secDesc = (BYTE *)ckalloc(secDescLen);
if (!GetFileSecurityA(nativePath, infoBits,
(PSECURITY_DESCRIPTOR) secDesc, secDescLen, &secDescLen2)
|| (secDescLen < secDescLen2)) {
@@ -477,7 +477,7 @@ TestplatformChmod(
* Get the World SID.
*/
- userSid = ckalloc(GetSidLengthRequired((UCHAR) 1));
+ userSid = (SID *)ckalloc(GetSidLengthRequired((UCHAR) 1));
InitializeSid(userSid, &userSidAuthority, (BYTE) 1);
*(GetSidSubAuthority(userSid, 0)) = SECURITY_WORLD_RID;
@@ -503,7 +503,7 @@ TestplatformChmod(
newAclSize = ACLSize.AclBytesInUse + sizeof(ACCESS_DENIED_ACE)
+ GetLengthSid(userSid) - sizeof(DWORD);
- newAcl = ckalloc(newAclSize);
+ newAcl = (PACL) ckalloc(newAclSize);
/*
* Initialize the new ACL.