summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2020-02-28 12:46:42 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2020-02-28 12:46:42 (GMT)
commit4af90e27e5e22978b56d6cb5d0d1ecd90af0f48f (patch)
treed5db4ca8a1fecbd63d9e72730fad2f404367daff
parent63994a73e3f641451b26f48f697b6a069863751c (diff)
parent52e543c5691a60c3ef802fecf1ae08e7efcf19b7 (diff)
downloadtcl-4af90e27e5e22978b56d6cb5d0d1ecd90af0f48f.zip
tcl-4af90e27e5e22978b56d6cb5d0d1ecd90af0f48f.tar.gz
tcl-4af90e27e5e22978b56d6cb5d0d1ecd90af0f48f.tar.bz2
Merge 8.7
-rw-r--r--.travis.yml26
-rw-r--r--compat/zlib/contrib/minizip/crypt.h1
-rw-r--r--generic/tcl.h2
-rw-r--r--generic/tclAssembly.c4
-rw-r--r--generic/tclBasic.c364
-rw-r--r--generic/tclBinary.c60
-rw-r--r--generic/tclCkalloc.c2
-rw-r--r--generic/tclClock.c58
-rw-r--r--generic/tclCmdAH.c140
-rw-r--r--generic/tclCmdIL.c105
-rw-r--r--generic/tclCmdMZ.c86
-rw-r--r--generic/tclCompCmds.c84
-rw-r--r--generic/tclCompCmdsGR.c47
-rw-r--r--generic/tclCompCmdsSZ.c129
-rw-r--r--generic/tclCompExpr.c32
-rw-r--r--generic/tclCompile.c64
-rw-r--r--generic/tclConfig.c15
-rw-r--r--generic/tclDate.c5
-rw-r--r--generic/tclDecls.h6
-rw-r--r--generic/tclDictObj.c140
-rw-r--r--generic/tclDisassemble.c14
-rw-r--r--generic/tclEncoding.c75
-rw-r--r--generic/tclEnsemble.c61
-rw-r--r--generic/tclEnv.c23
-rw-r--r--generic/tclEvent.c85
-rw-r--r--generic/tclExecute.c61
-rw-r--r--generic/tclFCmd.c27
-rw-r--r--generic/tclFileName.c10
-rw-r--r--generic/tclGetDate.y5
-rw-r--r--generic/tclHash.c25
-rw-r--r--generic/tclHistory.c9
-rw-r--r--generic/tclIO.c63
-rw-r--r--generic/tclIOCmd.c62
-rw-r--r--generic/tclIOGT.c30
-rw-r--r--generic/tclIORChan.c77
-rw-r--r--generic/tclIORTrans.c65
-rw-r--r--generic/tclIOUtil.c28
-rw-r--r--generic/tclIndexObj.c38
-rw-r--r--generic/tclInt.h27
-rw-r--r--generic/tclInterp.c74
-rw-r--r--generic/tclLink.c41
-rw-r--r--generic/tclListObj.c24
-rw-r--r--generic/tclLiteral.c14
-rw-r--r--generic/tclLoad.c35
-rw-r--r--generic/tclMain.c5
-rw-r--r--generic/tclNamesp.c141
-rw-r--r--generic/tclNotify.c2
-rw-r--r--generic/tclOO.c80
-rw-r--r--generic/tclOOBasic.c67
-rw-r--r--generic/tclOOCall.c63
-rw-r--r--generic/tclOODefineCmds.c126
-rw-r--r--generic/tclOOInfo.c97
-rw-r--r--generic/tclOOInt.h6
-rw-r--r--generic/tclOOMethod.c93
-rw-r--r--generic/tclObj.c86
-rw-r--r--generic/tclOptimize.c6
-rw-r--r--generic/tclParse.c10
-rw-r--r--generic/tclPathObj.c23
-rw-r--r--generic/tclPipe.c4
-rw-r--r--generic/tclPkg.c108
-rw-r--r--generic/tclPreserve.c8
-rw-r--r--generic/tclProc.c58
-rw-r--r--generic/tclProcess.c13
-rw-r--r--generic/tclRegexp.c11
-rw-r--r--generic/tclResolve.c6
-rw-r--r--generic/tclResult.c8
-rw-r--r--generic/tclScan.c21
-rw-r--r--generic/tclStrToD.c23
-rw-r--r--generic/tclStringObj.c23
-rw-r--r--generic/tclTest.c355
-rw-r--r--generic/tclTestObj.c51
-rw-r--r--generic/tclTestProcBodyObj.c10
-rw-r--r--generic/tclThread.c2
-rw-r--r--generic/tclThreadAlloc.c34
-rw-r--r--generic/tclThreadJoin.c2
-rw-r--r--generic/tclThreadStorage.c16
-rw-r--r--generic/tclThreadTest.c48
-rw-r--r--generic/tclTimer.c38
-rw-r--r--generic/tclTomMathDecls.h7
-rw-r--r--generic/tclTrace.c62
-rw-r--r--generic/tclUtil.c42
-rw-r--r--generic/tclVar.c94
-rw-r--r--generic/tclZipfs.c138
-rw-r--r--generic/tclZlib.c53
-rw-r--r--macosx/tclMacOSXBundle.c5
-rw-r--r--macosx/tclMacOSXFCmd.c4
-rw-r--r--macosx/tclMacOSXNotify.c16
-rwxr-xr-xunix/configure2
-rw-r--r--unix/tcl.m416
-rw-r--r--unix/tclEpollNotfy.c18
-rw-r--r--unix/tclKqueueNotfy.c12
-rw-r--r--unix/tclLoadDl.c31
-rw-r--r--unix/tclLoadDyld.c44
-rw-r--r--unix/tclLoadNext.c2
-rw-r--r--unix/tclLoadOSF.c2
-rw-r--r--unix/tclLoadShl.c2
-rw-r--r--unix/tclSelectNotfy.c49
-rw-r--r--unix/tclUnixChan.c96
-rw-r--r--unix/tclUnixCompat.c26
-rw-r--r--unix/tclUnixFCmd.c120
-rw-r--r--unix/tclUnixFile.c35
-rw-r--r--unix/tclUnixInit.c12
-rw-r--r--unix/tclUnixNotfy.c4
-rw-r--r--unix/tclUnixPipe.c57
-rw-r--r--unix/tclUnixPort.h6
-rw-r--r--unix/tclUnixSock.c101
-rw-r--r--unix/tclUnixTest.c28
-rw-r--r--unix/tclUnixThrd.c14
-rw-r--r--unix/tclUnixTime.c7
-rw-r--r--unix/tclXtNotify.c4
-rwxr-xr-xwin/configure2
-rw-r--r--win/tcl.m44
-rw-r--r--win/tclAppInit.c6
-rw-r--r--win/tclWin32Dll.c10
-rw-r--r--win/tclWinChan.c39
-rw-r--r--win/tclWinConsole.c48
-rw-r--r--win/tclWinDde.c2
-rw-r--r--win/tclWinFCmd.c23
-rw-r--r--win/tclWinFile.c40
-rw-r--r--win/tclWinInit.c8
-rw-r--r--win/tclWinLoad.c16
-rw-r--r--win/tclWinPipe.c28
-rw-r--r--win/tclWinReg.c2
-rw-r--r--win/tclWinSerial.c27
-rw-r--r--win/tclWinSock.c83
-rw-r--r--win/tclWinTest.c18
-rw-r--r--win/tclWinThrd.c14
-rw-r--r--win/tclWinTime.c15
128 files changed, 3309 insertions, 2172 deletions
diff --git a/.travis.yml b/.travis.yml
index ec3471f..d10fc23 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -38,6 +38,14 @@ matrix:
env:
- BUILD_DIR=unix
- CFGOPT="--enable-symbols"
+# C++ build.
+ - name: "Linux/G++/Shared"
+ os: linux
+ dist: bionic
+ compiler: g++
+ env:
+ - BUILD_DIR=unix
+ - CFGOPT="CC=g++ CFLAGS=-Dregister=dont+use+register"
# Older versions of GCC...
- name: "Linux/GCC 7/Shared"
os: linux
@@ -315,6 +323,15 @@ matrix:
- BUILD_DIR=win
- CFGOPT="--enable-64bit CFLAGS=-DTCL_NO_DEPRECATED=1"
before_install: *makepreinst
+ - name: "Windows/G++/Shared"
+ os: windows
+ compiler: g++
+ env:
+ - BUILD_DIR=win
+ - CFGOPT="CC=g++ --enable-64bit"
+ before_install: *makepreinst
+ script:
+ - make all tcltest
- name: "Windows/GCC/Static"
os: windows
compiler: gcc
@@ -350,6 +367,15 @@ matrix:
- BUILD_DIR=win
- CFGOPT="CFLAGS=-DTCL_NO_DEPRECATED=1"
before_install: *makepreinst
+ - name: "Windows/G++-x86/Shared"
+ os: windows
+ compiler: g++
+ env:
+ - BUILD_DIR=win
+ - CFGOPT="CC=g++"
+ before_install: *makepreinst
+ script:
+ - make all tcltest
- name: "Windows/GCC-x86/Static"
os: windows
compiler: gcc
diff --git a/compat/zlib/contrib/minizip/crypt.h b/compat/zlib/contrib/minizip/crypt.h
index 2c3044b..62dcf77 100644
--- a/compat/zlib/contrib/minizip/crypt.h
+++ b/compat/zlib/contrib/minizip/crypt.h
@@ -43,6 +43,7 @@ static int decrypt_byte(unsigned long* pkeys, const z_crc_t* pcrc_32_tab)
unsigned temp; /* POTENTIAL BUG: temp*(temp^1) may overflow in an
* unpredictable manner on 16-bit systems; not a problem
* with any known compiler so far, though */
+ (void)pcrc_32_tab;
temp = ((unsigned)(*(pkeys+2)) & 0xffff) | 2;
return (int)(((temp * (temp ^ 1)) >> 8) & 0xff);
diff --git a/generic/tcl.h b/generic/tcl.h
index a98470b..5b7df45 100644
--- a/generic/tcl.h
+++ b/generic/tcl.h
@@ -265,7 +265,7 @@ typedef void *ClientData;
*/
#if !defined(TCL_WIDE_INT_TYPE)&&!defined(TCL_WIDE_INT_IS_LONG)
-# if defined(_WIN32)
+# if defined(_MSC_VER) || defined(_WIN32)
# define TCL_WIDE_INT_TYPE __int64
# define TCL_LL_MODIFIER "I64"
# if defined(_WIN64)
diff --git a/generic/tclAssembly.c b/generic/tclAssembly.c
index 7d28f8d..19216c9 100644
--- a/generic/tclAssembly.c
+++ b/generic/tclAssembly.c
@@ -770,7 +770,7 @@ BBEmitInst1or4(
int
Tcl_AssembleObjCmd(
- ClientData dummy, /* Not used. */
+ ClientData clientData, /* clientData */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
@@ -780,7 +780,7 @@ Tcl_AssembleObjCmd(
* because there needs to be one in place to execute bytecode.
*/
- return Tcl_NRCallObjProc(interp, TclNRAssembleObjCmd, dummy, objc, objv);
+ return Tcl_NRCallObjProc(interp, TclNRAssembleObjCmd, clientData, objc, objv);
}
int
diff --git a/generic/tclBasic.c b/generic/tclBasic.c
index 106a01a..bc33e35 100644
--- a/generic/tclBasic.c
+++ b/generic/tclBasic.c
@@ -94,7 +94,7 @@ typedef struct {
char *result; /* The script cancellation result or NULL for
* a default result. */
size_t length; /* Length of the above error message. */
- ClientData clientData; /* Ignored */
+ ClientData clientData; /* Not used. */
int flags; /* Additional flags */
} CancelInfo;
static Tcl_HashTable cancelTable;
@@ -434,24 +434,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 */
+ double (*fn)(double x); /* Real function pointer */
} 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, acos },
+ { "asin", ExprUnaryFunc, asin },
+ { "atan", ExprUnaryFunc, atan },
+ { "atan2", ExprBinaryFunc, (double (*)(double))(void *)(double (*)(double, double)) atan2},
{ "bool", ExprBoolFunc, NULL },
{ "ceil", ExprCeilFunc, NULL },
- { "cos", ExprUnaryFunc, (ClientData) cos },
- { "cosh", ExprUnaryFunc, (ClientData) cosh },
+ { "cos", ExprUnaryFunc, cos },
+ { "cosh", ExprUnaryFunc, cosh },
{ "double", ExprDoubleFunc, NULL },
{ "entier", ExprIntFunc, NULL },
- { "exp", ExprUnaryFunc, (ClientData) exp },
+ { "exp", ExprUnaryFunc, exp },
{ "floor", ExprFloorFunc, NULL },
- { "fmod", ExprBinaryFunc, (ClientData) fmod },
- { "hypot", ExprBinaryFunc, (ClientData) hypot },
+ { "fmod", ExprBinaryFunc, (double (*)(double))(void *)(double (*)(double, double)) fmod},
+ { "hypot", ExprBinaryFunc, (double (*)(double))(void *)(double (*)(double, double)) hypot},
{ "int", ExprIntFunc, NULL },
{ "isfinite", ExprIsFiniteFunc, NULL },
{ "isinf", ExprIsInfinityFunc, NULL },
@@ -460,19 +460,19 @@ static const BuiltinFuncDef BuiltinFuncTable[] = {
{ "isqrt", ExprIsqrtFunc, NULL },
{ "issubnormal", ExprIsSubnormalFunc, NULL, },
{ "isunordered", ExprIsUnorderedFunc, NULL, },
- { "log", ExprUnaryFunc, (ClientData) log },
- { "log10", ExprUnaryFunc, (ClientData) log10 },
+ { "log", ExprUnaryFunc, log },
+ { "log10", ExprUnaryFunc, log10 },
{ "max", ExprMaxFunc, NULL },
{ "min", ExprMinFunc, NULL },
- { "pow", ExprBinaryFunc, (ClientData) pow },
+ { "pow", ExprBinaryFunc, (double (*)(double))(void *)(double (*)(double, double)) pow},
{ "rand", ExprRandFunc, NULL },
{ "round", ExprRoundFunc, NULL },
- { "sin", ExprUnaryFunc, (ClientData) sin },
- { "sinh", ExprUnaryFunc, (ClientData) sinh },
+ { "sin", ExprUnaryFunc, sin },
+ { "sinh", ExprUnaryFunc, sinh },
{ "sqrt", ExprSqrtFunc, NULL },
{ "srand", ExprSrandFunc, NULL },
- { "tan", ExprUnaryFunc, (ClientData) tan },
- { "tanh", ExprUnaryFunc, (ClientData) tanh },
+ { "tan", ExprUnaryFunc, tan },
+ { "tanh", ExprUnaryFunc, tanh },
{ "wide", ExprWideFunc, NULL },
{ NULL, NULL, NULL }
};
@@ -679,7 +679,7 @@ Tcl_CreateInterp(void)
* object type table and other object management code.
*/
- iPtr = Tcl_Alloc(sizeof(Interp));
+ iPtr = (Interp *)Tcl_Alloc(sizeof(Interp));
interp = (Tcl_Interp *) iPtr;
iPtr->legacyResult = NULL;
@@ -708,10 +708,10 @@ Tcl_CreateInterp(void)
*/
iPtr->cmdFramePtr = NULL;
- iPtr->linePBodyPtr = Tcl_Alloc(sizeof(Tcl_HashTable));
- iPtr->lineBCPtr = Tcl_Alloc(sizeof(Tcl_HashTable));
- iPtr->lineLAPtr = Tcl_Alloc(sizeof(Tcl_HashTable));
- iPtr->lineLABCPtr = Tcl_Alloc(sizeof(Tcl_HashTable));
+ iPtr->linePBodyPtr = (Tcl_HashTable *)Tcl_Alloc(sizeof(Tcl_HashTable));
+ iPtr->lineBCPtr = (Tcl_HashTable *)Tcl_Alloc(sizeof(Tcl_HashTable));
+ iPtr->lineLAPtr = (Tcl_HashTable *)Tcl_Alloc(sizeof(Tcl_HashTable));
+ iPtr->lineLABCPtr = (Tcl_HashTable *)Tcl_Alloc(sizeof(Tcl_HashTable));
Tcl_InitHashTable(iPtr->linePBodyPtr, TCL_ONE_WORD_KEYS);
Tcl_InitHashTable(iPtr->lineBCPtr, TCL_ONE_WORD_KEYS);
Tcl_InitHashTable(iPtr->lineLAPtr, TCL_ONE_WORD_KEYS);
@@ -805,7 +805,7 @@ Tcl_CreateInterp(void)
*/
/* This is needed to satisfy GCC 3.3's strict aliasing rules */
- framePtr = Tcl_Alloc(sizeof(CallFrame));
+ framePtr = (CallFrame *)Tcl_Alloc(sizeof(CallFrame));
(void) Tcl_PushCallFrame(interp, (Tcl_CallFrame *) framePtr,
(Tcl_Namespace *) iPtr->globalNsPtr, /*isProcCallFrame*/ 0);
framePtr->objc = 0;
@@ -835,7 +835,7 @@ Tcl_CreateInterp(void)
iPtr->asyncCancelMsg = Tcl_NewObj();
- cancelInfo = Tcl_Alloc(sizeof(CancelInfo));
+ cancelInfo = (CancelInfo *)Tcl_Alloc(sizeof(CancelInfo));
cancelInfo->interp = interp;
iPtr->asyncCancel = Tcl_AsyncCreate(CancelEvalProc, cancelInfo);
@@ -899,7 +899,7 @@ Tcl_CreateInterp(void)
*/
#if TCL_THREADS && defined(USE_THREAD_ALLOC)
- iPtr->allocCache = TclpGetAllocCache();
+ iPtr->allocCache = (AllocCache *)TclpGetAllocCache();
#else
iPtr->allocCache = NULL;
#endif
@@ -928,7 +928,7 @@ Tcl_CreateInterp(void)
hPtr = Tcl_CreateHashEntry(&iPtr->globalNsPtr->cmdTable,
cmdInfoPtr->name, &isNew);
if (isNew) {
- cmdPtr = Tcl_Alloc(sizeof(Command));
+ cmdPtr = (Command *)Tcl_Alloc(sizeof(Command));
cmdPtr->hPtr = hPtr;
cmdPtr->nsPtr = iPtr->globalNsPtr;
cmdPtr->refCount = 1;
@@ -1042,7 +1042,7 @@ Tcl_CreateInterp(void)
builtinFuncPtr++) {
strcpy(mathFuncName+MATH_FUNC_PREFIX_LEN, builtinFuncPtr->name);
Tcl_CreateObjCommand(interp, mathFuncName,
- builtinFuncPtr->objCmdProc, builtinFuncPtr->clientData, NULL);
+ builtinFuncPtr->objCmdProc, (void *)builtinFuncPtr->fn, NULL);
Tcl_Export(interp, nsPtr, builtinFuncPtr->name, 0);
}
@@ -1058,7 +1058,7 @@ Tcl_CreateInterp(void)
#define MATH_OP_PREFIX_LEN 15 /* == strlen("::tcl::mathop::") */
memcpy(mathFuncName, "::tcl::mathop::", MATH_OP_PREFIX_LEN);
for (opcmdInfoPtr=mathOpCmds ; opcmdInfoPtr->name!=NULL ; opcmdInfoPtr++){
- TclOpCmdClientData *occdPtr = Tcl_Alloc(sizeof(TclOpCmdClientData));
+ TclOpCmdClientData *occdPtr = (TclOpCmdClientData *)Tcl_Alloc(sizeof(TclOpCmdClientData));
occdPtr->op = opcmdInfoPtr->name;
occdPtr->i.numArgs = opcmdInfoPtr->i.numArgs;
@@ -1166,7 +1166,7 @@ static void
DeleteOpCmdClientData(
ClientData clientData)
{
- TclOpCmdClientData *occdPtr = clientData;
+ TclOpCmdClientData *occdPtr = (TclOpCmdClientData *)clientData;
Tcl_Free(occdPtr);
}
@@ -1217,7 +1217,7 @@ TclGetCommandTypeName(
Tcl_Command command)
{
Command *cmdPtr = (Command *) command;
- void *procPtr = cmdPtr->objProc;
+ Tcl_ObjCmdProc *procPtr = cmdPtr->objProc;
const char *name = "native";
if (procPtr == NULL) {
@@ -1289,7 +1289,7 @@ TclHideUnsafeCommands(
Tcl_GetStringResult(interp));
}
Tcl_CreateObjCommand(interp, TclGetString(cmdName),
- BadEnsembleSubcommand, (ClientData) unsafePtr, NULL);
+ BadEnsembleSubcommand, (void *)unsafePtr, NULL);
TclDecrRefCount(cmdName);
TclDecrRefCount(hideName);
} else {
@@ -1334,7 +1334,9 @@ BadEnsembleSubcommand(
int objc,
Tcl_Obj *const objv[])
{
- const UnsafeEnsembleInfo *infoPtr = clientData;
+ const UnsafeEnsembleInfo *infoPtr = (const UnsafeEnsembleInfo *)clientData;
+ (void)objc;
+ (void)objv;
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"not allowed to invoke subcommand %s of %s",
@@ -1374,17 +1376,17 @@ Tcl_CallWhenDeleted(
Interp *iPtr = (Interp *) interp;
static Tcl_ThreadDataKey assocDataCounterKey;
int *assocDataCounterPtr =
- Tcl_GetThreadData(&assocDataCounterKey, sizeof(int));
+ (int *)Tcl_GetThreadData(&assocDataCounterKey, sizeof(int));
int isNew;
char buffer[32 + TCL_INTEGER_SPACE];
- AssocData *dPtr = Tcl_Alloc(sizeof(AssocData));
+ AssocData *dPtr = (AssocData *)Tcl_Alloc(sizeof(AssocData));
Tcl_HashEntry *hPtr;
sprintf(buffer, "Assoc Data Key #%d", *assocDataCounterPtr);
(*assocDataCounterPtr)++;
if (iPtr->assocData == NULL) {
- iPtr->assocData = Tcl_Alloc(sizeof(Tcl_HashTable));
+ iPtr->assocData = (Tcl_HashTable *)Tcl_Alloc(sizeof(Tcl_HashTable));
Tcl_InitHashTable(iPtr->assocData, TCL_STRING_KEYS);
}
hPtr = Tcl_CreateHashEntry(iPtr->assocData, buffer, &isNew);
@@ -1431,7 +1433,7 @@ Tcl_DontCallWhenDeleted(
}
for (hPtr = Tcl_FirstHashEntry(hTablePtr, &hSearch); hPtr != NULL;
hPtr = Tcl_NextHashEntry(&hSearch)) {
- dPtr = Tcl_GetHashValue(hPtr);
+ dPtr = (AssocData *)Tcl_GetHashValue(hPtr);
if ((dPtr->proc == proc) && (dPtr->clientData == clientData)) {
Tcl_Free(dPtr);
Tcl_DeleteHashEntry(hPtr);
@@ -1473,14 +1475,14 @@ Tcl_SetAssocData(
int isNew;
if (iPtr->assocData == NULL) {
- iPtr->assocData = Tcl_Alloc(sizeof(Tcl_HashTable));
+ iPtr->assocData = (Tcl_HashTable *)Tcl_Alloc(sizeof(Tcl_HashTable));
Tcl_InitHashTable(iPtr->assocData, TCL_STRING_KEYS);
}
hPtr = Tcl_CreateHashEntry(iPtr->assocData, name, &isNew);
if (isNew == 0) {
- dPtr = Tcl_GetHashValue(hPtr);
+ dPtr = (AssocData *)Tcl_GetHashValue(hPtr);
} else {
- dPtr = Tcl_Alloc(sizeof(AssocData));
+ dPtr = (AssocData *)Tcl_Alloc(sizeof(AssocData));
}
dPtr->proc = proc;
dPtr->clientData = clientData;
@@ -1521,7 +1523,7 @@ Tcl_DeleteAssocData(
if (hPtr == NULL) {
return;
}
- dPtr = Tcl_GetHashValue(hPtr);
+ dPtr = (AssocData *)Tcl_GetHashValue(hPtr);
if (dPtr->proc != NULL) {
dPtr->proc(dPtr->clientData, interp);
}
@@ -1566,7 +1568,7 @@ Tcl_GetAssocData(
if (hPtr == NULL) {
return NULL;
}
- dPtr = Tcl_GetHashValue(hPtr);
+ dPtr = (AssocData *)Tcl_GetHashValue(hPtr);
if (procPtr != NULL) {
*procPtr = dPtr->proc;
}
@@ -1717,7 +1719,7 @@ DeleteInterpProc(
Tcl_MutexLock(&cancelLock);
hPtr = Tcl_FindHashEntry(&cancelTable, (char *) iPtr);
if (hPtr != NULL) {
- CancelInfo *cancelInfo = Tcl_GetHashValue(hPtr);
+ CancelInfo *cancelInfo = (CancelInfo *)Tcl_GetHashValue(hPtr);
if (cancelInfo != NULL) {
if (cancelInfo->result != NULL) {
@@ -1775,7 +1777,7 @@ DeleteInterpProc(
hPtr = Tcl_FirstHashEntry(hTablePtr, &search);
for (; hPtr != NULL; hPtr = Tcl_NextHashEntry(&search)) {
- Tcl_DeleteCommandFromToken(interp, Tcl_GetHashValue(hPtr));
+ Tcl_DeleteCommandFromToken(interp, (Tcl_Command)Tcl_GetHashValue(hPtr));
}
Tcl_DeleteHashTable(hTablePtr);
Tcl_Free(hTablePtr);
@@ -1794,7 +1796,7 @@ DeleteInterpProc(
for (hPtr = Tcl_FirstHashEntry(hTablePtr, &search);
hPtr != NULL;
hPtr = Tcl_FirstHashEntry(hTablePtr, &search)) {
- dPtr = Tcl_GetHashValue(hPtr);
+ dPtr = (AssocData *)Tcl_GetHashValue(hPtr);
Tcl_DeleteHashEntry(hPtr);
if (dPtr->proc != NULL) {
dPtr->proc(dPtr->clientData, interp);
@@ -1881,7 +1883,7 @@ DeleteInterpProc(
for (hPtr = Tcl_FirstHashEntry(iPtr->linePBodyPtr, &search);
hPtr != NULL;
hPtr = Tcl_NextHashEntry(&search)) {
- CmdFrame *cfPtr = Tcl_GetHashValue(hPtr);
+ CmdFrame *cfPtr = (CmdFrame *)Tcl_GetHashValue(hPtr);
Proc *procPtr = (Proc *) Tcl_GetHashKey(iPtr->linePBodyPtr, hPtr);
procPtr->iPtr = NULL;
@@ -1905,7 +1907,7 @@ DeleteInterpProc(
for (hPtr = Tcl_FirstHashEntry(iPtr->lineBCPtr, &search);
hPtr != NULL;
hPtr = Tcl_NextHashEntry(&search)) {
- ExtCmdLoc *eclPtr = Tcl_GetHashValue(hPtr);
+ ExtCmdLoc *eclPtr = (ExtCmdLoc *)Tcl_GetHashValue(hPtr);
if (eclPtr->type == TCL_LOCATION_SOURCE) {
Tcl_DecrRefCount(eclPtr->path);
@@ -2069,7 +2071,7 @@ Tcl_HideCommand(
hiddenCmdTablePtr = iPtr->hiddenCmdTablePtr;
if (hiddenCmdTablePtr == NULL) {
- hiddenCmdTablePtr = Tcl_Alloc(sizeof(Tcl_HashTable));
+ hiddenCmdTablePtr = (Tcl_HashTable *)Tcl_Alloc(sizeof(Tcl_HashTable));
Tcl_InitHashTable(hiddenCmdTablePtr, TCL_STRING_KEYS);
iPtr->hiddenCmdTablePtr = hiddenCmdTablePtr;
}
@@ -2209,7 +2211,7 @@ Tcl_ExposeCommand(
hiddenCmdToken, NULL);
return TCL_ERROR;
}
- cmdPtr = Tcl_GetHashValue(hPtr);
+ cmdPtr = (Command *)Tcl_GetHashValue(hPtr);
/*
* Check that we have a true global namespace command (enforced by
@@ -2405,7 +2407,7 @@ Tcl_CreateCommand(
* An existing command conflicts. Try to delete it...
*/
- cmdPtr = Tcl_GetHashValue(hPtr);
+ cmdPtr = (Command *)Tcl_GetHashValue(hPtr);
/*
* Be careful to preserve any existing import links so we can restore
@@ -2460,7 +2462,7 @@ Tcl_CreateCommand(
TclInvalidateNsCmdLookup(nsPtr);
TclInvalidateNsPath(nsPtr);
}
- cmdPtr = Tcl_Alloc(sizeof(Command));
+ cmdPtr = (Command *)Tcl_Alloc(sizeof(Command));
Tcl_SetHashValue(hPtr, cmdPtr);
cmdPtr->hPtr = hPtr;
cmdPtr->nsPtr = nsPtr;
@@ -2487,7 +2489,7 @@ Tcl_CreateCommand(
cmdPtr->importRefPtr = oldRefPtr;
while (oldRefPtr != NULL) {
Command *refCmdPtr = oldRefPtr->importedCmdPtr;
- dataPtr = refCmdPtr->objClientData;
+ dataPtr = (ImportedCmdData *)refCmdPtr->objClientData;
dataPtr->realCmdPtr = cmdPtr;
oldRefPtr = oldRefPtr->nextPtr;
}
@@ -2623,7 +2625,7 @@ TclCreateObjCommandInNs(
* An existing command conflicts. Try to delete it...
*/
- cmdPtr = Tcl_GetHashValue(hPtr);
+ cmdPtr = (Command *)Tcl_GetHashValue(hPtr);
/*
* Command already exists; delete it. Be careful to preserve any
@@ -2687,7 +2689,7 @@ TclCreateObjCommandInNs(
TclInvalidateNsCmdLookup(nsPtr);
TclInvalidateNsPath(nsPtr);
}
- cmdPtr = Tcl_Alloc(sizeof(Command));
+ cmdPtr = (Command *)Tcl_Alloc(sizeof(Command));
Tcl_SetHashValue(hPtr, cmdPtr);
cmdPtr->hPtr = hPtr;
cmdPtr->nsPtr = nsPtr;
@@ -2715,7 +2717,7 @@ TclCreateObjCommandInNs(
while (oldRefPtr != NULL) {
Command *refCmdPtr = oldRefPtr->importedCmdPtr;
- dataPtr = refCmdPtr->objClientData;
+ dataPtr = (ImportedCmdData*)refCmdPtr->objClientData;
dataPtr->realCmdPtr = cmdPtr;
oldRefPtr = oldRefPtr->nextPtr;
}
@@ -2760,9 +2762,9 @@ TclInvokeStringCommand(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
- Command *cmdPtr = clientData;
+ Command *cmdPtr = (Command *)clientData;
int i, result;
- const char **argv =
+ const char **argv = (const char **)
TclStackAlloc(interp, (objc + 1) * sizeof(char *));
for (i = 0; i < objc; i++) {
@@ -2808,10 +2810,10 @@ TclInvokeObjectCommand(
int argc, /* Number of arguments. */
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++) {
@@ -3239,12 +3241,13 @@ Tcl_GetCommandInfoFromToken(
const char *
Tcl_GetCommandName(
- Tcl_Interp *interp, /* Interpreter containing the command. */
+ Tcl_Interp *dummy, /* Not used. */
Tcl_Command command) /* Token for command returned by a previous
* call to Tcl_CreateCommand. The command must
* not have been deleted. */
{
Command *cmdPtr = (Command *) command;
+ (void)dummy;
if ((cmdPtr == NULL) || (cmdPtr->hPtr == NULL)) {
/*
@@ -3256,7 +3259,7 @@ Tcl_GetCommandName(
return "";
}
- return Tcl_GetHashKey(cmdPtr->hPtr->tablePtr, cmdPtr->hPtr);
+ return (const char *)Tcl_GetHashKey(cmdPtr->hPtr->tablePtr, cmdPtr->hPtr);
}
/*
@@ -3306,7 +3309,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);
}
}
@@ -3687,11 +3690,12 @@ CallCommandTraces(
static int
CancelEvalProc(
ClientData clientData, /* Interp to cancel the script in progress. */
- Tcl_Interp *interp, /* Ignored */
+ Tcl_Interp *dummy, /* Not used. */
int code) /* Current return code from command. */
{
- CancelInfo *cancelInfo = clientData;
+ CancelInfo *cancelInfo = (CancelInfo *)clientData;
Interp *iPtr;
+ (void)dummy;
if (cancelInfo != NULL) {
Tcl_MutexLock(&cancelLock);
@@ -4043,7 +4047,7 @@ Tcl_CancelEval(
goto done;
}
- cancelInfo = Tcl_GetHashValue(hPtr);
+ cancelInfo = (CancelInfo *)Tcl_GetHashValue(hPtr);
/*
* Populate information needed by the interpreter thread to fulfill the
@@ -4055,7 +4059,7 @@ Tcl_CancelEval(
if (resultObjPtr != NULL) {
result = TclGetStringFromObj(resultObjPtr, &cancelInfo->length);
- cancelInfo->result = Tcl_Realloc(cancelInfo->result,cancelInfo->length);
+ cancelInfo->result = (char *)Tcl_Realloc(cancelInfo->result,cancelInfo->length);
memcpy(cancelInfo->result, result, cancelInfo->length);
TclDecrRefCount(resultObjPtr); /* Discard their result object. */
} else {
@@ -4175,13 +4179,14 @@ EvalObjvCore(
Tcl_Interp *interp,
int result)
{
- Command *cmdPtr = NULL, *preCmdPtr = data[0];
+ Command *cmdPtr = NULL, *preCmdPtr = (Command *)data[0];
int flags = PTR2INT(data[1]);
int objc = PTR2INT(data[2]);
- Tcl_Obj **objv = data[3];
+ Tcl_Obj **objv = (Tcl_Obj **)data[3];
Interp *iPtr = (Interp *) interp;
Namespace *lookupNsPtr = NULL;
int enterTracesDone = 0;
+ (void)result;
/*
* Push records for task to be done on return, in INVERSE order. First, if
@@ -4335,11 +4340,12 @@ Dispatch(
Tcl_Interp *interp,
int result)
{
- Tcl_ObjCmdProc *objProc = data[0];
+ Tcl_ObjCmdProc *objProc = (Tcl_ObjCmdProc *)data[0];
ClientData clientData = data[1];
int objc = PTR2INT(data[2]);
- Tcl_Obj **objv = data[3];
+ Tcl_Obj **objv = (Tcl_Obj **)data[3];
Interp *iPtr = (Interp *) interp;
+ (void)result;
#ifdef USE_DTRACE
if (TCL_DTRACE_CMD_ARGS_ENABLED()) {
@@ -4499,7 +4505,7 @@ TEOV_RestoreVarFrame(
Tcl_Interp *interp,
int result)
{
- ((Interp *) interp)->varFramePtr = data[0];
+ ((Interp *) interp)->varFramePtr = (CallFrame *)data[0];
return result;
}
@@ -4543,7 +4549,7 @@ TEOV_Error(
const char *cmdString;
size_t cmdLen;
int objc = PTR2INT(data[0]);
- Tcl_Obj **objv = data[1];
+ Tcl_Obj **objv = (Tcl_Obj **)data[1];
if ((result == TCL_ERROR) && !(iPtr->flags & ERR_ALREADY_LOGGED)) {
/*
@@ -4605,7 +4611,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
@@ -4666,8 +4672,8 @@ TEOV_NotFoundCallback(
{
Interp *iPtr = (Interp *) interp;
int objc = PTR2INT(data[0]);
- Tcl_Obj **objv = data[1];
- Namespace *savedNsPtr = data[2];
+ Tcl_Obj **objv = (Tcl_Obj **)data[1];
+ Namespace *savedNsPtr = (Namespace *)data[2];
int i;
@@ -4747,9 +4753,9 @@ TEOV_RunLeaveTraces(
Interp *iPtr = (Interp *) interp;
int traceCode = TCL_OK;
int objc = PTR2INT(data[0]);
- Tcl_Obj *commandPtr = data[1];
- Command *cmdPtr = data[2];
- Tcl_Obj **objv = data[3];
+ Tcl_Obj *commandPtr = (Tcl_Obj *)data[1];
+ Command *cmdPtr = (Command *)data[2];
+ Tcl_Obj **objv = (Tcl_Obj **)data[3];
size_t length;
const char *command = TclGetStringFromObj(commandPtr, &length);
@@ -4923,12 +4929,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
@@ -5064,9 +5070,9 @@ TclEvalEx(
*/
if (numWords > minObjs) {
- expand = Tcl_Alloc(numWords * sizeof(int));
- objvSpace = Tcl_Alloc(numWords * sizeof(Tcl_Obj *));
- lineSpace = Tcl_Alloc(numWords * sizeof(int));
+ expand = (int *)Tcl_Alloc(numWords * sizeof(int));
+ objvSpace = (Tcl_Obj **)Tcl_Alloc(numWords * sizeof(Tcl_Obj *));
+ lineSpace = (int *)Tcl_Alloc(numWords * sizeof(int));
}
expandRequested = 0;
objv = objvSpace;
@@ -5152,8 +5158,8 @@ TclEvalEx(
if ((numWords > minObjs) || (objectsNeeded > minObjs)) {
objv = objvSpace =
- Tcl_Alloc(objectsNeeded * sizeof(Tcl_Obj *));
- lines = lineSpace = Tcl_Alloc(objectsNeeded * sizeof(int));
+ (Tcl_Obj **)Tcl_Alloc(objectsNeeded * sizeof(Tcl_Obj *));
+ lines = lineSpace = (int *)Tcl_Alloc(objectsNeeded * sizeof(int));
}
objectsUsed = 0;
@@ -5474,7 +5480,7 @@ TclArgumentEnter(
* and initialize references.
*/
- cfwPtr = Tcl_Alloc(sizeof(CFWord));
+ cfwPtr = (CFWord *)Tcl_Alloc(sizeof(CFWord));
cfwPtr->framePtr = cfPtr;
cfwPtr->word = i;
cfwPtr->refCount = 1;
@@ -5485,7 +5491,7 @@ TclArgumentEnter(
* relevant. Just remember the reference to prevent early removal.
*/
- cfwPtr = Tcl_GetHashValue(hPtr);
+ cfwPtr = (CFWord *)Tcl_GetHashValue(hPtr);
cfwPtr->refCount++;
}
}
@@ -5528,7 +5534,7 @@ TclArgumentRelease(
if (!hPtr) {
continue;
}
- cfwPtr = Tcl_GetHashValue(hPtr);
+ cfwPtr = (CFWord *)Tcl_GetHashValue(hPtr);
if (cfwPtr->refCount-- > 1) {
continue;
@@ -5580,7 +5586,7 @@ TclArgumentBCEnter(
if (!hePtr) {
return;
}
- eclPtr = Tcl_GetHashValue(hePtr);
+ eclPtr = (ExtCmdLoc *)Tcl_GetHashValue(hePtr);
ePtr = &eclPtr->loc[cmd];
/*
@@ -5613,10 +5619,10 @@ TclArgumentBCEnter(
for (word = 1; word < objc; word++) {
if (ePtr->line[word] >= 0) {
- int isnew;
+ int isNew;
Tcl_HashEntry *hPtr = Tcl_CreateHashEntry(iPtr->lineLABCPtr,
- objv[word], &isnew);
- CFWordBC *cfwPtr = Tcl_Alloc(sizeof(CFWordBC));
+ objv[word], &isNew);
+ CFWordBC *cfwPtr = (CFWordBC *)Tcl_Alloc(sizeof(CFWordBC));
cfwPtr->framePtr = cfPtr;
cfwPtr->obj = objv[word];
@@ -5625,7 +5631,7 @@ TclArgumentBCEnter(
cfwPtr->nextPtr = lastPtr;
lastPtr = cfwPtr;
- if (isnew) {
+ if (isNew) {
/*
* The word is not on the stack yet, remember the current
* location and initialize references.
@@ -5640,7 +5646,7 @@ TclArgumentBCEnter(
* information in the new structure.
*/
- cfwPtr->prevPtr = Tcl_GetHashValue(hPtr);
+ cfwPtr->prevPtr = (CFWordBC *)Tcl_GetHashValue(hPtr);
}
Tcl_SetHashValue(hPtr, cfwPtr);
@@ -5682,7 +5688,7 @@ TclArgumentBCRelease(
CFWordBC *nextPtr = cfwPtr->nextPtr;
Tcl_HashEntry *hPtr =
Tcl_FindHashEntry(iPtr->lineLABCPtr, (char *) cfwPtr->obj);
- CFWordBC *xPtr = Tcl_GetHashValue(hPtr);
+ CFWordBC *xPtr = (CFWordBC *)Tcl_GetHashValue(hPtr);
if (xPtr != cfwPtr) {
Tcl_Panic("TclArgumentBC Enter/Release Mismatch");
@@ -5748,7 +5754,7 @@ TclArgumentGet(
hPtr = Tcl_FindHashEntry(iPtr->lineLAPtr, (char *) obj);
if (hPtr) {
- CFWord *cfwPtr = Tcl_GetHashValue(hPtr);
+ CFWord *cfwPtr = (CFWord *)Tcl_GetHashValue(hPtr);
*wordPtr = cfwPtr->word;
*cfPtrPtr = cfwPtr->framePtr;
@@ -5762,7 +5768,7 @@ TclArgumentGet(
hPtr = Tcl_FindHashEntry(iPtr->lineLABCPtr, (char *) obj);
if (hPtr) {
- CFWordBC *cfwPtr = Tcl_GetHashValue(hPtr);
+ CFWordBC *cfwPtr = (CFWordBC *)Tcl_GetHashValue(hPtr);
framePtr = cfwPtr->framePtr;
framePtr->data.tebc.pc = (char *) (((ByteCode *)
@@ -5901,7 +5907,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;
@@ -6010,8 +6016,8 @@ TEOEx_ByteCodeCallback(
int result)
{
Interp *iPtr = (Interp *) interp;
- CallFrame *savedVarFramePtr = data[0];
- Tcl_Obj *objPtr = data[1];
+ CallFrame *savedVarFramePtr = (CallFrame *)data[0];
+ Tcl_Obj *objPtr = (Tcl_Obj *)data[1];
int allowExceptions = PTR2INT(data[2]);
if (iPtr->numLevels == 0) {
@@ -6056,9 +6062,9 @@ TEOEx_ListCallback(
int result)
{
Interp *iPtr = (Interp *) interp;
- Tcl_Obj *listPtr = data[0];
- CmdFrame *eoFramePtr = data[1];
- Tcl_Obj *objPtr = data[2];
+ Tcl_Obj *listPtr = (Tcl_Obj *)data[0];
+ CmdFrame *eoFramePtr = (CmdFrame *)data[1];
+ Tcl_Obj *objPtr = (Tcl_Obj *)data[2];
/*
* Remove the cmdFrame
@@ -6428,7 +6434,7 @@ TclObjInvoke(
int
TclNRInvoke(
- ClientData clientData,
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
@@ -6438,6 +6444,7 @@ TclNRInvoke(
const char *cmdName; /* Name of the command from objv[0]. */
Tcl_HashEntry *hPtr = NULL;
Command *cmdPtr;
+ (void)dummy;
cmdName = TclGetString(objv[0]);
hTblPtr = iPtr->hiddenCmdTablePtr;
@@ -6451,7 +6458,7 @@ TclNRInvoke(
NULL);
return TCL_ERROR;
}
- cmdPtr = Tcl_GetHashValue(hPtr);
+ cmdPtr = (Command *)Tcl_GetHashValue(hPtr);
/*
* Avoid the exception-handling brain damage when numLevels == 0
@@ -6471,11 +6478,13 @@ TclNRInvoke(
static int
NRPostInvoke(
- ClientData clientData[],
+ ClientData dummy[], /* Not used. */
Tcl_Interp *interp,
int result)
{
Interp *iPtr = (Interp *)interp;
+ (void)dummy;
+
iPtr->numLevels--;
return result;
}
@@ -6757,7 +6766,7 @@ Tcl_GetVersion(
static int
ExprCeilFunc(
- ClientData clientData, /* Ignored */
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* The interpreter in which to execute the
* function. */
int objc, /* Actual parameter count. */
@@ -6766,6 +6775,7 @@ ExprCeilFunc(
int code;
double d;
mp_int big;
+ (void)dummy;
if (objc != 2) {
MathFuncWrongNumArgs(interp, 2, objc, objv);
@@ -6797,7 +6807,7 @@ ExprCeilFunc(
static int
ExprFloorFunc(
- ClientData clientData, /* Ignored */
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* The interpreter in which to execute the
* function. */
int objc, /* Actual parameter count. */
@@ -6806,6 +6816,7 @@ ExprFloorFunc(
int code;
double d;
mp_int big;
+ (void)dummy;
if (objc != 2) {
MathFuncWrongNumArgs(interp, 2, objc, objv);
@@ -6837,7 +6848,7 @@ ExprFloorFunc(
static int
ExprIsqrtFunc(
- ClientData clientData, /* Ignored */
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* The interpreter in which to execute. */
int objc, /* Actual parameter count. */
Tcl_Obj *const *objv) /* Actual parameter list. */
@@ -6849,6 +6860,7 @@ ExprIsqrtFunc(
mp_int big;
int exact = 0; /* Flag ==1 if the argument can be represented
* in a double as an exact integer. */
+ (void)dummy;
/*
* Check syntax.
@@ -6943,7 +6955,7 @@ ExprIsqrtFunc(
static int
ExprSqrtFunc(
- ClientData clientData, /* Ignored */
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* The interpreter in which to execute the
* function. */
int objc, /* Actual parameter count. */
@@ -6952,6 +6964,7 @@ ExprSqrtFunc(
int code;
double d;
mp_int big;
+ (void)dummy;
if (objc != 2) {
MathFuncWrongNumArgs(interp, 2, objc, objv);
@@ -7111,7 +7124,7 @@ ExprBinaryFunc(
static int
ExprAbsFunc(
- ClientData clientData, /* Ignored. */
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* The interpreter in which to execute the
* function. */
int objc, /* Actual parameter count. */
@@ -7120,6 +7133,7 @@ ExprAbsFunc(
ClientData ptr;
int type;
mp_int big;
+ (void)dummy;
if (objc != 2) {
MathFuncWrongNumArgs(interp, 2, objc, objv);
@@ -7210,13 +7224,14 @@ ExprAbsFunc(
static int
ExprBoolFunc(
- ClientData clientData, /* Ignored. */
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* The interpreter in which to execute the
* function. */
int objc, /* Actual parameter count. */
Tcl_Obj *const *objv) /* Actual parameter vector. */
{
int value;
+ (void)dummy;
if (objc != 2) {
MathFuncWrongNumArgs(interp, 2, objc, objv);
@@ -7231,13 +7246,14 @@ ExprBoolFunc(
static int
ExprDoubleFunc(
- ClientData clientData, /* Ignored. */
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* The interpreter in which to execute the
* function. */
int objc, /* Actual parameter count. */
Tcl_Obj *const *objv) /* Actual parameter vector. */
{
double dResult;
+ (void)dummy;
if (objc != 2) {
MathFuncWrongNumArgs(interp, 2, objc, objv);
@@ -7258,7 +7274,7 @@ ExprDoubleFunc(
static int
ExprIntFunc(
- ClientData clientData, /* Ignored. */
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* The interpreter in which to execute the
* function. */
int objc, /* Actual parameter count. */
@@ -7267,6 +7283,7 @@ ExprIntFunc(
double d;
int type;
ClientData ptr;
+ (void)dummy;
if (objc != 2) {
MathFuncWrongNumArgs(interp, 2, objc, objv);
@@ -7314,13 +7331,14 @@ ExprIntFunc(
static int
ExprWideFunc(
- ClientData clientData, /* Ignored. */
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* The interpreter in which to execute the
* function. */
int objc, /* Actual parameter count. */
Tcl_Obj *const *objv) /* Actual parameter vector. */
{
Tcl_WideInt wResult;
+ (void)dummy;
if (ExprIntFunc(NULL, interp, objc, objv) != TCL_OK) {
return TCL_ERROR;
@@ -7335,7 +7353,7 @@ ExprWideFunc(
*/
static int
ExprMaxMinFunc(
- ClientData clientData, /* Ignored. */
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* The interpreter in which to execute the
* function. */
int objc, /* Actual parameter count. */
@@ -7346,6 +7364,7 @@ ExprMaxMinFunc(
double d;
int type, i;
ClientData ptr;
+ (void)dummy;
if (objc < 2) {
MathFuncWrongNumArgs(interp, 2, objc, objv);
@@ -7375,29 +7394,31 @@ ExprMaxMinFunc(
static int
ExprMaxFunc(
- ClientData clientData, /* Ignored. */
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* The interpreter in which to execute the
* function. */
int objc, /* Actual parameter count. */
Tcl_Obj *const *objv) /* Actual parameter vector. */
{
- return ExprMaxMinFunc(clientData, interp, objc, objv, MP_GT);
+ (void)dummy;
+ return ExprMaxMinFunc(NULL, interp, objc, objv, MP_GT);
}
static int
ExprMinFunc(
- ClientData clientData, /* Ignored. */
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* The interpreter in which to execute the
* function. */
int objc, /* Actual parameter count. */
Tcl_Obj *const *objv) /* Actual parameter vector. */
{
- return ExprMaxMinFunc(clientData, interp, objc, objv, MP_LT);
+ (void)dummy;
+ return ExprMaxMinFunc(NULL, interp, objc, objv, MP_LT);
}
static int
ExprRandFunc(
- ClientData clientData, /* Ignored. */
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* The interpreter in which to execute the
* function. */
int objc, /* Actual parameter count. */
@@ -7408,6 +7429,7 @@ ExprRandFunc(
long tmp; /* Algorithm assumes at least 32 bits. Only
* long guarantees that. See below. */
Tcl_Obj *oResult;
+ (void)dummy;
if (objc != 1) {
MathFuncWrongNumArgs(interp, 1, objc, objv);
@@ -7490,7 +7512,7 @@ ExprRandFunc(
static int
ExprRoundFunc(
- ClientData clientData, /* Ignored. */
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* The interpreter in which to execute the
* function. */
int objc, /* Actual parameter count. */
@@ -7499,6 +7521,7 @@ ExprRoundFunc(
double d;
ClientData ptr;
int type;
+ (void)dummy;
if (objc != 2) {
MathFuncWrongNumArgs(interp, 2, objc, objv);
@@ -7569,7 +7592,7 @@ ExprRoundFunc(
static int
ExprSrandFunc(
- ClientData clientData, /* Ignored. */
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* The interpreter in which to execute the
* function. */
int objc, /* Actual parameter count. */
@@ -7577,6 +7600,7 @@ ExprSrandFunc(
{
Interp *iPtr = (Interp *) interp;
Tcl_WideInt w = 0; /* Initialized to avoid compiler warning. */
+ (void)dummy;
/*
* Convert argument and use it to reset the seed.
@@ -7608,7 +7632,7 @@ ExprSrandFunc(
* will always succeed.
*/
- return ExprRandFunc(clientData, interp, 1, objv);
+ return ExprRandFunc(NULL, interp, 1, objv);
}
/*
@@ -7758,7 +7782,7 @@ ClassifyDouble(
static int
ExprIsFiniteFunc(
- ClientData ignored,
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* The interpreter in which to execute the
* function. */
int objc, /* Actual parameter count */
@@ -7767,6 +7791,7 @@ ExprIsFiniteFunc(
double d;
ClientData ptr;
int type, result = 0;
+ (void)dummy;
if (objc != 2) {
MathFuncWrongNumArgs(interp, 2, objc, objv);
@@ -7789,7 +7814,7 @@ ExprIsFiniteFunc(
static int
ExprIsInfinityFunc(
- ClientData ignored,
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* The interpreter in which to execute the
* function. */
int objc, /* Actual parameter count */
@@ -7798,6 +7823,7 @@ ExprIsInfinityFunc(
double d;
ClientData ptr;
int type, result = 0;
+ (void)dummy;
if (objc != 2) {
MathFuncWrongNumArgs(interp, 2, objc, objv);
@@ -7819,7 +7845,7 @@ ExprIsInfinityFunc(
static int
ExprIsNaNFunc(
- ClientData ignored,
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* The interpreter in which to execute the
* function. */
int objc, /* Actual parameter count */
@@ -7828,6 +7854,7 @@ ExprIsNaNFunc(
double d;
ClientData ptr;
int type, result = 1;
+ (void)dummy;
if (objc != 2) {
MathFuncWrongNumArgs(interp, 2, objc, objv);
@@ -7849,7 +7876,7 @@ ExprIsNaNFunc(
static int
ExprIsNormalFunc(
- ClientData ignored,
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* The interpreter in which to execute the
* function. */
int objc, /* Actual parameter count */
@@ -7858,6 +7885,7 @@ ExprIsNormalFunc(
double d;
ClientData ptr;
int type, result = 0;
+ (void)dummy;
if (objc != 2) {
MathFuncWrongNumArgs(interp, 2, objc, objv);
@@ -7879,7 +7907,7 @@ ExprIsNormalFunc(
static int
ExprIsSubnormalFunc(
- ClientData ignored,
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* The interpreter in which to execute the
* function. */
int objc, /* Actual parameter count */
@@ -7888,6 +7916,7 @@ ExprIsSubnormalFunc(
double d;
ClientData ptr;
int type, result = 0;
+ (void)dummy;
if (objc != 2) {
MathFuncWrongNumArgs(interp, 2, objc, objv);
@@ -7909,7 +7938,7 @@ ExprIsSubnormalFunc(
static int
ExprIsUnorderedFunc(
- ClientData ignored,
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* The interpreter in which to execute the
* function. */
int objc, /* Actual parameter count */
@@ -7918,6 +7947,7 @@ ExprIsUnorderedFunc(
double d;
ClientData ptr;
int type, result = 0;
+ (void)dummy;
if (objc != 3) {
MathFuncWrongNumArgs(interp, 3, objc, objv);
@@ -7950,7 +7980,7 @@ ExprIsUnorderedFunc(
static int
FloatClassifyObjCmd(
- ClientData ignored,
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* The interpreter in which to execute the
* function. */
int objc, /* Actual parameter count */
@@ -7960,6 +7990,7 @@ FloatClassifyObjCmd(
Tcl_Obj *objPtr;
ClientData ptr;
int type;
+ (void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "floatValue");
@@ -8064,6 +8095,9 @@ DTraceObjCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
+ (void)dummy;
+ (void)interp;
+
if (TCL_DTRACE_TCL_PROBE_ENABLED()) {
char *a[10];
int i = 0;
@@ -8443,12 +8477,13 @@ TclSetTailcall(
int
TclNRTailcallObjCmd(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
{
Interp *iPtr = (Interp *) interp;
+ (void)dummy;
if (objc < 1) {
Tcl_WrongNumArgs(interp, 1, objv, "?command? ?arg ...?");
@@ -8513,7 +8548,7 @@ TclNRTailcallEval(
int result)
{
Interp *iPtr = (Interp *) interp;
- Tcl_Obj *listPtr = data[0], *nsObjPtr;
+ Tcl_Obj *listPtr = (Tcl_Obj *)data[0], *nsObjPtr;
Tcl_Namespace *nsPtr;
int objc;
Tcl_Obj **objv;
@@ -8548,10 +8583,12 @@ TclNRTailcallEval(
int
TclNRReleaseValues(
ClientData data[],
- Tcl_Interp *interp,
+ Tcl_Interp *dummy,
int result)
{
int i = 0;
+ (void)dummy;
+
while (i < 4) {
if (data[i]) {
Tcl_DecrRefCount((Tcl_Obj *) data[i]);
@@ -8635,7 +8672,7 @@ TclNRYieldObjCmd(
int
TclNRYieldToObjCmd(
- ClientData clientData,
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
@@ -8643,6 +8680,7 @@ TclNRYieldToObjCmd(
CoroutineData *corPtr = iPtr->execEnvPtr->corPtr;
Tcl_Obj *listPtr, *nsObjPtr;
Tcl_Namespace *nsPtr = TclGetCurrentNamespace(interp);
+ (void)dummy;
if (objc < 2) {
Tcl_WrongNumArgs(interp, 1, objv, "command ?arg ...?");
@@ -8691,7 +8729,8 @@ RewindCoroutineCallback(
Tcl_Interp *interp,
int result)
{
- return Tcl_RestoreInterpState(interp, data[0]);
+ (void)result;
+ return Tcl_RestoreInterpState(interp, (Tcl_InterpState)data[0]);
}
static int
@@ -8716,7 +8755,7 @@ static void
DeleteCoroutine(
ClientData clientData)
{
- CoroutineData *corPtr = clientData;
+ CoroutineData *corPtr = (CoroutineData *)clientData;
Tcl_Interp *interp = corPtr->eePtr->interp;
NRE_callback *rootPtr = TOP_CB(interp);
@@ -8731,7 +8770,7 @@ NRCoroutineCallerCallback(
Tcl_Interp *interp,
int result)
{
- CoroutineData *corPtr = data[0];
+ CoroutineData *corPtr = (CoroutineData *)data[0];
Command *cmdPtr = corPtr->cmdPtr;
/*
@@ -8777,7 +8816,7 @@ NRCoroutineExitCallback(
Tcl_Interp *interp,
int result)
{
- CoroutineData *corPtr = data[0];
+ CoroutineData *corPtr = (CoroutineData *)data[0];
Command *cmdPtr = corPtr->cmdPtr;
/*
@@ -8842,10 +8881,11 @@ TclNRCoroutineActivateCallback(
Tcl_Interp *interp,
int result)
{
- CoroutineData *corPtr = data[0];
+ CoroutineData *corPtr = (CoroutineData *)data[0];
int type = PTR2INT(data[1]);
int numLevels, unused;
int *stackLevel = &unused;
+ (void)result;
if (!corPtr->stackLevel) {
/*
@@ -8923,7 +8963,8 @@ TclNREvalList(
{
int objc;
Tcl_Obj **objv;
- Tcl_Obj *listPtr = data[0];
+ Tcl_Obj *listPtr = (Tcl_Obj *)data[0];
+ (void)result;
Tcl_IncrRefCount(listPtr);
@@ -8945,13 +8986,14 @@ TclNREvalList(
static int
CoroTypeObjCmd(
- ClientData clientData,
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
{
Command *cmdPtr;
CoroutineData *corPtr;
+ (void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "coroName");
@@ -8976,7 +9018,7 @@ CoroTypeObjCmd(
* future.
*/
- corPtr = cmdPtr->objClientData;
+ corPtr = (CoroutineData *)cmdPtr->objClientData;
if (!COR_IS_SUSPENDED(corPtr)) {
Tcl_SetObjResult(interp, Tcl_NewStringObj("active", -1));
return TCL_OK;
@@ -9030,18 +9072,19 @@ GetCoroutineFromObj(
TclGetString(objPtr), NULL);
return NULL;
}
- return cmdPtr->objClientData;
+ return (CoroutineData *)cmdPtr->objClientData;
}
static int
TclNRCoroInjectObjCmd(
- ClientData clientData,
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
{
CoroutineData *corPtr;
ExecEnv *savedEEPtr = iPtr->execEnvPtr;
+ (void)dummy;
/*
* Usage more or less like tailcall:
@@ -9080,7 +9123,7 @@ TclNRCoroInjectObjCmd(
static int
TclNRCoroProbeObjCmd(
- ClientData clientData,
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
@@ -9089,6 +9132,7 @@ TclNRCoroProbeObjCmd(
ExecEnv *savedEEPtr = iPtr->execEnvPtr;
int numLevels, unused;
int *stackLevel = &unused;
+ (void)dummy;
/*
* Usage more or less like tailcall:
@@ -9181,12 +9225,13 @@ InjectHandler(
Tcl_Interp *interp,
int result)
{
- CoroutineData *corPtr = data[0];
- Tcl_Obj *listPtr = data[1];
+ CoroutineData *corPtr = (CoroutineData *)data[0];
+ Tcl_Obj *listPtr = (Tcl_Obj *)data[1];
int nargs = PTR2INT(data[2]);
ClientData isProbe = data[3];
int objc;
Tcl_Obj **objv;
+ (void)result;
if (!isProbe) {
/*
@@ -9227,8 +9272,8 @@ InjectHandlerPostCall(
Tcl_Interp *interp,
int result)
{
- CoroutineData *corPtr = data[0];
- Tcl_Obj *listPtr = data[1];
+ CoroutineData *corPtr = (CoroutineData *)data[0];
+ Tcl_Obj *listPtr = (Tcl_Obj *)data[1];
int nargs = PTR2INT(data[2]);
ClientData isProbe = data[3];
int numLevels;
@@ -9273,13 +9318,14 @@ InjectHandlerPostCall(
static int
NRInjectObjCmd(
- ClientData clientData,
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
{
CoroutineData *corPtr;
ExecEnv *savedEEPtr = iPtr->execEnvPtr;
+ (void)dummy;
/*
* Usage more or less like tailcall:
@@ -9323,7 +9369,7 @@ TclNRInterpCoroutine(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
- CoroutineData *corPtr = clientData;
+ CoroutineData *corPtr = (CoroutineData *)clientData;
if (!COR_IS_SUSPENDED(corPtr)) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
@@ -9393,6 +9439,7 @@ TclNRCoroutineObjCmd(
Namespace *nsPtr, *altNsPtr, *cxtNsPtr,
*inNsPtr = (Namespace *)TclGetCurrentNamespace(interp);
Namespace *lookupNsPtr = iPtr->varFramePtr->nsPtr;
+ (void)dummy;
if (objc < 3) {
Tcl_WrongNumArgs(interp, 1, objv, "name cmd ?arg ...?");
@@ -9423,7 +9470,7 @@ TclNRCoroutineObjCmd(
* struct and create the corresponding command.
*/
- corPtr = Tcl_Alloc(sizeof(CoroutineData));
+ corPtr = (CoroutineData *)Tcl_Alloc(sizeof(CoroutineData));
cmdPtr = (Command *) TclNRCreateCommandInNs(interp, simpleName,
(Tcl_Namespace *)nsPtr, /*objProc*/ NULL, TclNRInterpCoroutine,
@@ -9445,7 +9492,7 @@ TclNRCoroutineObjCmd(
Tcl_HashSearch hSearch;
Tcl_HashEntry *hePtr;
- corPtr->lineLABCPtr = Tcl_Alloc(sizeof(Tcl_HashTable));
+ corPtr->lineLABCPtr = (Tcl_HashTable *)Tcl_Alloc(sizeof(Tcl_HashTable));
Tcl_InitHashTable(corPtr->lineLABCPtr, TCL_ONE_WORD_KEYS);
for (hePtr = Tcl_FirstHashEntry(iPtr->lineLABCPtr,&hSearch);
@@ -9515,12 +9562,13 @@ TclNRCoroutineObjCmd(
int
TclInfoCoroutineCmd(
- ClientData dummy,
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
{
CoroutineData *corPtr = iPtr->execEnvPtr->corPtr;
+ (void)dummy;
if (objc != 1) {
Tcl_WrongNumArgs(interp, 1, objv, NULL);
diff --git a/generic/tclBinary.c b/generic/tclBinary.c
index 6ed7f3e..3a8275b 100644
--- a/generic/tclBinary.c
+++ b/generic/tclBinary.c
@@ -368,6 +368,8 @@ Tcl_DbNewByteArrayObj(
Tcl_SetByteArrayObj(objPtr, bytes, length);
return objPtr;
#else /* if not TCL_MEM_DEBUG */
+ (void)file;
+ (void)line;
return Tcl_NewByteArrayObj(bytes, length);
#endif /* TCL_MEM_DEBUG */
}
@@ -406,7 +408,7 @@ Tcl_SetByteArrayObj(
}
TclInvalidateStringRep(objPtr);
- byteArrayPtr = Tcl_Alloc(BYTEARRAY_SIZE(length));
+ byteArrayPtr = (ByteArray *)Tcl_Alloc(BYTEARRAY_SIZE(length));
byteArrayPtr->used = length;
byteArrayPtr->allocated = length;
@@ -511,7 +513,7 @@ Tcl_SetByteArrayLength(
byteArrayPtr = GET_BYTEARRAY(irPtr);
if (length > byteArrayPtr->allocated) {
- byteArrayPtr = Tcl_Realloc(byteArrayPtr, BYTEARRAY_SIZE(length));
+ byteArrayPtr = (ByteArray *)Tcl_Realloc(byteArrayPtr, BYTEARRAY_SIZE(length));
byteArrayPtr->allocated = length;
SET_BYTEARRAY(irPtr, byteArrayPtr);
}
@@ -538,7 +540,7 @@ Tcl_SetByteArrayLength(
static int
SetByteArrayFromAny(
- Tcl_Interp *interp, /* Not used. */
+ Tcl_Interp *dummy, /* Not used. */
Tcl_Obj *objPtr) /* The object to convert to type ByteArray. */
{
size_t length;
@@ -548,6 +550,7 @@ SetByteArrayFromAny(
Tcl_UniChar ch = 0;
ByteArray *byteArrayPtr;
Tcl_ObjIntRep ir;
+ (void)dummy;
if (TclHasIntRep(objPtr, &properByteArrayType)) {
return TCL_OK;
@@ -559,7 +562,7 @@ SetByteArrayFromAny(
src = TclGetStringFromObj(objPtr, &length);
srcEnd = src + length;
- byteArrayPtr = Tcl_Alloc(BYTEARRAY_SIZE(length));
+ byteArrayPtr = (ByteArray *)Tcl_Alloc(BYTEARRAY_SIZE(length));
for (dst = byteArrayPtr->bytes; src < srcEnd; ) {
src += TclUtfToUniChar(src, &ch);
improper = improper || (ch > 255);
@@ -635,7 +638,7 @@ DupByteArrayInternalRep(
srcArrayPtr = GET_BYTEARRAY(TclFetchIntRep(srcPtr, &tclByteArrayType));
length = srcArrayPtr->used;
- copyArrayPtr = Tcl_Alloc(BYTEARRAY_SIZE(length));
+ copyArrayPtr = (ByteArray *)Tcl_Alloc(BYTEARRAY_SIZE(length));
copyArrayPtr->used = length;
copyArrayPtr->allocated = length;
memcpy(copyArrayPtr->bytes, srcArrayPtr->bytes, length);
@@ -656,7 +659,7 @@ DupProperByteArrayInternalRep(
srcArrayPtr = GET_BYTEARRAY(TclFetchIntRep(srcPtr, &properByteArrayType));
length = srcArrayPtr->used;
- copyArrayPtr = Tcl_Alloc(BYTEARRAY_SIZE(length));
+ copyArrayPtr = (ByteArray *)Tcl_Alloc(BYTEARRAY_SIZE(length));
copyArrayPtr->used = length;
copyArrayPtr->allocated = length;
memcpy(copyArrayPtr->bytes, srcArrayPtr->bytes, length);
@@ -794,7 +797,7 @@ TclAppendBytesToByteArray(
*/
attempt = 2 * needed;
- ptr = Tcl_AttemptRealloc(byteArrayPtr, BYTEARRAY_SIZE(attempt));
+ ptr = (ByteArray *)Tcl_AttemptRealloc(byteArrayPtr, BYTEARRAY_SIZE(attempt));
}
if (ptr == NULL) {
/*
@@ -806,7 +809,7 @@ TclAppendBytesToByteArray(
size_t growth = (extra > limit) ? limit : extra;
attempt = needed + growth;
- ptr = Tcl_AttemptRealloc(byteArrayPtr, BYTEARRAY_SIZE(attempt));
+ ptr = (ByteArray *)Tcl_AttemptRealloc(byteArrayPtr, BYTEARRAY_SIZE(attempt));
}
if (ptr == NULL) {
/*
@@ -814,7 +817,7 @@ TclAppendBytesToByteArray(
*/
attempt = needed;
- ptr = Tcl_Realloc(byteArrayPtr, BYTEARRAY_SIZE(attempt));
+ ptr = (ByteArray *)Tcl_Realloc(byteArrayPtr, BYTEARRAY_SIZE(attempt));
}
byteArrayPtr = ptr;
byteArrayPtr->allocated = attempt;
@@ -898,6 +901,7 @@ BinaryFormatCmd(
const char *errorValue, *str;
int offset, size;
size_t length;
+ (void)dummy;
if (objc < 2) {
Tcl_WrongNumArgs(interp, 1, objv, "formatString ?arg ...?");
@@ -1399,13 +1403,13 @@ BinaryScanCmd(
unsigned char *buffer; /* Start of result buffer. */
const char *errorString;
const char *str;
- int offset, size;
+ int offset, size, i;
size_t length = 0;
- int i;
Tcl_Obj *valuePtr, *elementPtr;
Tcl_HashTable numberCacheHash;
Tcl_HashTable *numberCachePtr;
+ (void)dummy;
if (objc < 3) {
Tcl_WrongNumArgs(interp, 1, objv,
@@ -1933,8 +1937,8 @@ CopyNumber(
memcpy(to, from, length);
break;
case 1: {
- const unsigned char *fromPtr = from;
- unsigned char *toPtr = to;
+ const unsigned char *fromPtr = (const unsigned char *)from;
+ unsigned char *toPtr = (unsigned char *)to;
switch (length) {
case 4:
@@ -1957,8 +1961,8 @@ CopyNumber(
break;
}
case 2: {
- const unsigned char *fromPtr = from;
- unsigned char *toPtr = to;
+ const unsigned char *fromPtr = (const unsigned char *)from;
+ unsigned char *toPtr = (unsigned char *)to;
toPtr[0] = fromPtr[4];
toPtr[1] = fromPtr[5];
@@ -1971,8 +1975,8 @@ CopyNumber(
break;
}
case 3: {
- const unsigned char *fromPtr = from;
- unsigned char *toPtr = to;
+ const unsigned char *fromPtr = (const unsigned char *)from;
+ unsigned char *toPtr = (unsigned char *)to;
toPtr[0] = fromPtr[3];
toPtr[1] = fromPtr[2];
@@ -2281,7 +2285,7 @@ ScanNumber(
hPtr = Tcl_CreateHashEntry(tablePtr, INT2PTR(value), &isNew);
if (!isNew) {
- return Tcl_GetHashValue(hPtr);
+ return (Tcl_Obj *)Tcl_GetHashValue(hPtr);
}
if (tablePtr->numEntries <= BINARY_SCAN_MAX_CACHE) {
Tcl_Obj *objPtr = Tcl_NewWideIntObj(value);
@@ -2404,7 +2408,7 @@ DeleteScanNumberCache(
hEntry = Tcl_FirstHashEntry(numberCachePtr, &search);
while (hEntry != NULL) {
- Tcl_Obj *value = Tcl_GetHashValue(hEntry);
+ Tcl_Obj *value = (Tcl_Obj *)Tcl_GetHashValue(hEntry);
if (value != NULL) {
Tcl_DecrRefCount(value);
@@ -2450,7 +2454,7 @@ DeleteScanNumberCache(
static int
BinaryEncodeHex(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
@@ -2459,6 +2463,7 @@ BinaryEncodeHex(
unsigned char *data = NULL;
unsigned char *cursor = NULL;
size_t offset = 0, count = 0;
+ (void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "data");
@@ -2494,7 +2499,7 @@ BinaryEncodeHex(
static int
BinaryDecodeHex(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
@@ -2506,6 +2511,7 @@ BinaryDecodeHex(
size_t count = 0;
enum {OPT_STRICT };
static const char *const optStrings[] = { "-strict", NULL };
+ (void)dummy;
if (objc < 2 || objc > 3) {
Tcl_WrongNumArgs(interp, 1, objv, "?options? data");
@@ -2614,7 +2620,7 @@ BinaryDecodeHex(
static int
BinaryEncode64(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
@@ -2628,6 +2634,7 @@ BinaryEncode64(
size_t offset, count = 0;
enum { OPT_MAXLEN, OPT_WRAPCHAR };
static const char *const optStrings[] = { "-maxlen", "-wrapchar", NULL };
+ (void)dummy;
if (objc < 2 || objc % 2 != 0) {
Tcl_WrongNumArgs(interp, 1, objv,
@@ -2721,7 +2728,7 @@ BinaryEncode64(
static int
BinaryEncodeUu(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
@@ -2735,6 +2742,7 @@ BinaryEncodeUu(
size_t j, offset, count = 0, wrapcharlen = sizeof(SingleNewline);
enum { OPT_MAXLEN, OPT_WRAPCHAR };
static const char *const optStrings[] = { "-maxlen", "-wrapchar", NULL };
+ (void)dummy;
if (objc < 2 || objc % 2 != 0) {
Tcl_WrongNumArgs(interp, 1, objv,
@@ -2838,7 +2846,7 @@ BinaryEncodeUu(
static int
BinaryDecodeUu(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
@@ -2851,6 +2859,7 @@ BinaryDecodeUu(
unsigned char c;
enum { OPT_STRICT };
static const char *const optStrings[] = { "-strict", NULL };
+ (void)dummy;
if (objc < 2 || objc > 3) {
Tcl_WrongNumArgs(interp, 1, objv, "?options? data");
@@ -3002,7 +3011,7 @@ BinaryDecodeUu(
static int
BinaryDecode64(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
@@ -3016,6 +3025,7 @@ BinaryDecode64(
size_t count = 0;
enum { OPT_STRICT };
static const char *const optStrings[] = { "-strict", NULL };
+ (void)dummy;
if (objc < 2 || objc > 3) {
Tcl_WrongNumArgs(interp, 1, objv, "?options? data");
diff --git a/generic/tclCkalloc.c b/generic/tclCkalloc.c
index 2dc66c7..0397c83 100644
--- a/generic/tclCkalloc.c
+++ b/generic/tclCkalloc.c
@@ -1088,7 +1088,7 @@ Tcl_Realloc(
void *ptr,
size_t size)
{
- char *result;
+ void *result;
result = TclpRealloc(ptr, size);
diff --git a/generic/tclClock.c b/generic/tclClock.c
index b3196cd..e15de77 100644
--- a/generic/tclClock.c
+++ b/generic/tclClock.c
@@ -109,7 +109,7 @@ typedef struct {
* Greenwich */
Tcl_Obj *tzName; /* Time zone name */
int julianDay; /* Julian Day Number in local time zone */
- enum {BCE=1, CE=0} era; /* Era */
+ int isBce; /* 1 if BCE */
int gregorian; /* Flag == 1 if the date is Gregorian */
int year; /* Year of the era */
int dayOfYear; /* Day of the year (1 January == 1) */
@@ -275,9 +275,9 @@ TclClockInit(
* Create the client data, which is a refcounted literal pool.
*/
- data = Tcl_Alloc(sizeof(ClockClientData));
+ data = (ClockClientData *)Tcl_Alloc(sizeof(ClockClientData));
data->refCount = 0;
- data->literals = Tcl_Alloc(LIT__END * sizeof(Tcl_Obj*));
+ data->literals = (Tcl_Obj **)Tcl_Alloc(LIT__END * sizeof(Tcl_Obj*));
for (i = 0; i < LIT__END; ++i) {
data->literals[i] = Tcl_NewStringObj(literals[i], -1);
Tcl_IncrRefCount(data->literals[i]);
@@ -336,7 +336,7 @@ ClockConvertlocaltoutcObjCmd(
int objc, /* Parameter count */
Tcl_Obj *const *objv) /* Parameter vector */
{
- ClockClientData *data = clientData;
+ ClockClientData *data = (ClockClientData *)clientData;
Tcl_Obj *const *lit = data->literals;
Tcl_Obj *secondsObj;
Tcl_Obj *dict;
@@ -430,7 +430,7 @@ ClockGetdatefieldsObjCmd(
{
TclDateFields fields;
Tcl_Obj *dict;
- ClockClientData *data = clientData;
+ ClockClientData *data = (ClockClientData *)clientData;
Tcl_Obj *const *lit = data->literals;
int changeover;
@@ -494,7 +494,7 @@ ClockGetdatefieldsObjCmd(
Tcl_DictObjPut(NULL, dict, lit[LIT_GREGORIAN],
Tcl_NewWideIntObj(fields.gregorian));
Tcl_DictObjPut(NULL, dict, lit[LIT_ERA],
- lit[fields.era ? LIT_BCE : LIT_CE]);
+ lit[fields.isBce ? LIT_BCE : LIT_CE]);
Tcl_DictObjPut(NULL, dict, lit[LIT_YEAR],
Tcl_NewWideIntObj(fields.year));
Tcl_DictObjPut(NULL, dict, lit[LIT_DAYOFYEAR],
@@ -584,12 +584,12 @@ ClockGetjuliandayfromerayearmonthdayObjCmd(
{
TclDateFields fields;
Tcl_Obj *dict;
- ClockClientData *data = clientData;
+ ClockClientData *data = (ClockClientData *)clientData;
Tcl_Obj *const *lit = data->literals;
int changeover;
int copied = 0;
int status;
- int era = 0;
+ int isBce = 0;
/*
* Check params.
@@ -600,7 +600,7 @@ ClockGetjuliandayfromerayearmonthdayObjCmd(
return TCL_ERROR;
}
dict = objv[1];
- if (FetchEraField(interp, dict, lit[LIT_ERA], &era) != TCL_OK
+ if (FetchEraField(interp, dict, lit[LIT_ERA], &isBce) != TCL_OK
|| FetchIntField(interp, dict, lit[LIT_YEAR], &fields.year)
!= TCL_OK
|| FetchIntField(interp, dict, lit[LIT_MONTH], &fields.month)
@@ -610,7 +610,7 @@ ClockGetjuliandayfromerayearmonthdayObjCmd(
|| TclGetIntFromObj(interp, objv[2], &changeover) != TCL_OK) {
return TCL_ERROR;
}
- fields.era = era;
+ fields.isBce = isBce;
/*
* Get Julian day.
@@ -668,12 +668,12 @@ ClockGetjuliandayfromerayearweekdayObjCmd(
{
TclDateFields fields;
Tcl_Obj *dict;
- ClockClientData *data = clientData;
+ ClockClientData *data = (ClockClientData *)clientData;
Tcl_Obj *const *lit = data->literals;
int changeover;
int copied = 0;
int status;
- int era = 0;
+ int isBce = 0;
/*
* Check params.
@@ -684,7 +684,7 @@ ClockGetjuliandayfromerayearweekdayObjCmd(
return TCL_ERROR;
}
dict = objv[1];
- if (FetchEraField(interp, dict, lit[LIT_ERA], &era) != TCL_OK
+ if (FetchEraField(interp, dict, lit[LIT_ERA], &isBce) != TCL_OK
|| FetchIntField(interp, dict, lit[LIT_ISO8601YEAR],
&fields.iso8601Year) != TCL_OK
|| FetchIntField(interp, dict, lit[LIT_ISO8601WEEK],
@@ -694,7 +694,7 @@ ClockGetjuliandayfromerayearweekdayObjCmd(
|| TclGetIntFromObj(interp, objv[2], &changeover) != TCL_OK) {
return TCL_ERROR;
}
- fields.era = era;
+ fields.isBce = isBce;
/*
* Get Julian day.
@@ -1079,7 +1079,7 @@ ConvertUTCToLocalUsingC(
* Fill in the date in 'fields' and use it to derive Julian Day.
*/
- fields->era = CE;
+ fields->isBce = 0;
fields->year = timeVal->tm_year + 1900;
fields->month = timeVal->tm_mon + 1;
fields->dayOfMonth = timeVal->tm_mday;
@@ -1217,7 +1217,7 @@ GetYearWeekDay(
temp.julianDay = fields->julianDay - 3;
GetGregorianEraYearDay(&temp, changeover);
- if (temp.era == BCE) {
+ if (temp.isBce) {
temp.iso8601Year = temp.year - 1;
} else {
temp.iso8601Year = temp.year + 1;
@@ -1233,7 +1233,7 @@ GetYearWeekDay(
*/
if (fields->julianDay < temp.julianDay) {
- if (temp.era == BCE) {
+ if (temp.isBce) {
temp.iso8601Year += 1;
} else {
temp.iso8601Year -= 1;
@@ -1359,10 +1359,10 @@ GetGregorianEraYearDay(
*/
if (year <= 0) {
- fields->era = BCE;
+ fields->isBce = 1;
fields->year = 1 - year;
} else {
- fields->era = CE;
+ fields->isBce = 0;
fields->year = year;
}
fields->dayOfYear = day + 1;
@@ -1430,7 +1430,7 @@ GetJulianDayFromEraYearWeekDay(
* Find January 4 in the ISO8601 year, which will always be in week 1.
*/
- firstWeek.era = fields->era;
+ firstWeek.isBce = fields->isBce;
firstWeek.year = fields->iso8601Year;
firstWeek.month = 1;
firstWeek.dayOfMonth = 4;
@@ -1474,7 +1474,7 @@ GetJulianDayFromEraYearMonthDay(
{
int year, ym1, month, mm1, q, r, ym1o4, ym1o100, ym1o400;
- if (fields->era == BCE) {
+ if (fields->isBce) {
year = 1 - fields->year;
} else {
year = fields->year;
@@ -1502,10 +1502,10 @@ GetJulianDayFromEraYearMonthDay(
fields->gregorian = 1;
if (year < 1) {
- fields->era = BCE;
+ fields->isBce = 1;
fields->year = 1-year;
} else {
- fields->era = CE;
+ fields->isBce = 0;
fields->year = year;
}
@@ -1580,7 +1580,7 @@ IsGregorianLeapYear(
{
int year = fields->year;
- if (fields->era == BCE) {
+ if (fields->isBce) {
year = 1 - year;
}
if (year%4 != 0) {
@@ -1693,7 +1693,7 @@ ThreadSafeLocalTime(
* Get a thread-local buffer to hold the returned time.
*/
- struct tm *tmPtr = Tcl_GetThreadData(&tmKey, sizeof(struct tm));
+ struct tm *tmPtr = (struct tm *)Tcl_GetThreadData(&tmKey, sizeof(struct tm));
#ifdef HAVE_LOCALTIME_R
localtime_r(timePtr, tmPtr);
#else
@@ -1879,7 +1879,7 @@ ClockParseformatargsObjCmd(
int objc, /* Parameter count */
Tcl_Obj *const objv[]) /* Parameter vector */
{
- ClockClientData *dataPtr = clientData;
+ ClockClientData *dataPtr = (ClockClientData *)clientData;
Tcl_Obj **litPtr = dataPtr->literals;
Tcl_Obj *results[3]; /* Format, locale and timezone */
#define formatObj results[0]
@@ -2029,7 +2029,7 @@ ClockSecondsObjCmd(
static void
TzsetIfNecessary(void)
{
- static char* tzWas = INT2PTR(-1); /* Previous value of TZ, protected by
+ static char* tzWas = (char *)INT2PTR(-1); /* Previous value of TZ, protected by
* clockMutex. */
const char *tzIsNow; /* Current value of TZ */
@@ -2041,7 +2041,7 @@ TzsetIfNecessary(void)
if (tzWas != NULL && tzWas != INT2PTR(-1)) {
Tcl_Free(tzWas);
}
- tzWas = Tcl_Alloc(strlen(tzIsNow) + 1);
+ tzWas = (char *)Tcl_Alloc(strlen(tzIsNow) + 1);
strcpy(tzWas, tzIsNow);
} else if (tzIsNow == NULL && tzWas != NULL) {
tzset();
@@ -2069,7 +2069,7 @@ static void
ClockDeleteCmdProc(
ClientData clientData) /* Opaque pointer to the client data */
{
- ClockClientData *data = clientData;
+ ClockClientData *data = (ClockClientData *)clientData;
int i;
if (data->refCount-- <= 1) {
diff --git a/generic/tclCmdAH.c b/generic/tclCmdAH.c
index 41f8fd9..e350228 100644
--- a/generic/tclCmdAH.c
+++ b/generic/tclCmdAH.c
@@ -135,6 +135,8 @@ Tcl_BreakObjCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
+ (void)dummy;
+
if (objc != 1) {
Tcl_WrongNumArgs(interp, 1, objv, NULL);
return TCL_ERROR;
@@ -180,6 +182,7 @@ TclNRCatchObjCmd(
Tcl_Obj *varNamePtr = NULL;
Tcl_Obj *optionVarNamePtr = NULL;
Interp *iPtr = (Interp *) interp;
+ (void)dummy;
if ((objc < 2) || (objc > 4)) {
Tcl_WrongNumArgs(interp, 1, objv,
@@ -212,8 +215,8 @@ CatchObjCmdCallback(
{
Interp *iPtr = (Interp *) interp;
int objc = PTR2INT(data[0]);
- Tcl_Obj *varNamePtr = data[1];
- Tcl_Obj *optionVarNamePtr = data[2];
+ Tcl_Obj *varNamePtr = (Tcl_Obj *)data[1];
+ Tcl_Obj *optionVarNamePtr = (Tcl_Obj *)data[2];
int rewind = iPtr->execEnvPtr->rewind;
/*
@@ -275,6 +278,7 @@ Tcl_CdObjCmd(
{
Tcl_Obj *dir;
int result;
+ (void)dummy;
if (objc > 2) {
Tcl_WrongNumArgs(interp, 1, objv, "?dirName?");
@@ -329,6 +333,8 @@ Tcl_ConcatObjCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
+ (void)dummy;
+
if (objc >= 2) {
Tcl_SetObjResult(interp, Tcl_ConcatObj(objc-1, objv+1));
}
@@ -364,6 +370,8 @@ Tcl_ContinueObjCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
+ (void)dummy;
+
if (objc != 1) {
Tcl_WrongNumArgs(interp, 1, objv, NULL);
return TCL_ERROR;
@@ -429,6 +437,7 @@ EncodingConvertfromObjCmd(
Tcl_Encoding encoding; /* Encoding to use */
size_t length = 0; /* Length of the byte array being converted */
const char *bytesPtr; /* Pointer to the first byte of the array */
+ (void)dummy;
if (objc == 2) {
encoding = Tcl_GetEncoding(interp, NULL);
@@ -491,6 +500,7 @@ EncodingConverttoObjCmd(
Tcl_Encoding encoding; /* Encoding to use */
size_t length; /* Length of the string being converted */
const char *stringPtr; /* Pointer to the first byte of the string */
+ (void)dummy;
/* TODO - ADJUST OBJ INDICES WHEN ENSEMBLIFYING THIS */
@@ -551,6 +561,7 @@ EncodingDirsObjCmd(
Tcl_Obj *const objv[]) /* Argument objects. */
{
Tcl_Obj *dirListObj;
+ (void)dummy;
if (objc > 2) {
Tcl_WrongNumArgs(interp, 1, objv, "?dirList?");
@@ -588,11 +599,14 @@ EncodingDirsObjCmd(
*/
int
-EncodingNamesObjCmd(ClientData dummy, /* Unused */
+EncodingNamesObjCmd(
+ ClientData dummy, /* Not used. */
Tcl_Interp* interp, /* Tcl interpreter */
int objc, /* Number of command line args */
Tcl_Obj* const objv[]) /* Vector of command line args */
{
+ (void)dummy;
+
if (objc > 1) {
Tcl_WrongNumArgs(interp, 1, objv, NULL);
return TCL_ERROR;
@@ -618,11 +632,14 @@ EncodingNamesObjCmd(ClientData dummy, /* Unused */
*/
int
-EncodingSystemObjCmd(ClientData dummy, /* Unused */
+EncodingSystemObjCmd(
+ ClientData dummy, /* Not used. */
Tcl_Interp* interp, /* Tcl interpreter */
int objc, /* Number of command line args */
Tcl_Obj* const objv[]) /* Vector of command line args */
{
+ (void)dummy;
+
if (objc > 2) {
Tcl_WrongNumArgs(interp, 1, objv, "?encoding?");
return TCL_ERROR;
@@ -662,6 +679,7 @@ Tcl_ErrorObjCmd(
Tcl_Obj *const objv[]) /* Argument objects. */
{
Tcl_Obj *options, *optName;
+ (void)dummy;
if ((objc < 2) || (objc > 4)) {
Tcl_WrongNumArgs(interp, 1, objv, "message ?errorInfo? ?errorCode?");
@@ -706,10 +724,12 @@ Tcl_ErrorObjCmd(
/* ARGSUSED */
static int
EvalCmdErrMsg(
- ClientData data[],
+ ClientData dummy[],
Tcl_Interp *interp,
int result)
{
+ (void)dummy;
+
if (result == TCL_ERROR) {
Tcl_AppendObjToErrorInfo(interp, Tcl_ObjPrintf(
"\n (\"eval\" body line %d)", Tcl_GetErrorLine(interp)));
@@ -738,6 +758,7 @@ TclNREvalObjCmd(
Interp *iPtr = (Interp *) interp;
CmdFrame *invoker = NULL;
int word = 0;
+ (void)dummy;
if (objc < 2) {
Tcl_WrongNumArgs(interp, 1, objv, "arg ?arg ...?");
@@ -795,6 +816,7 @@ Tcl_ExitObjCmd(
Tcl_Obj *const objv[]) /* Argument objects. */
{
Tcl_WideInt value;
+ (void)dummy;
if ((objc != 1) && (objc != 2)) {
Tcl_WrongNumArgs(interp, 1, objv, "?returnCode?");
@@ -854,6 +876,7 @@ TclNRExprObjCmd(
Tcl_Obj *const objv[]) /* Argument objects. */
{
Tcl_Obj *resultPtr, *objPtr;
+ (void)dummy;
if (objc < 2) {
Tcl_WrongNumArgs(interp, 1, objv, "arg ?arg ...?");
@@ -879,8 +902,8 @@ ExprCallback(
Tcl_Interp *interp,
int result)
{
- Tcl_Obj *resultPtr = data[0];
- Tcl_Obj *objPtr = data[1];
+ Tcl_Obj *resultPtr = (Tcl_Obj *)data[0];
+ Tcl_Obj *objPtr = (Tcl_Obj *)data[1];
if (objPtr != NULL) {
Tcl_DecrRefCount(objPtr);
@@ -984,13 +1007,14 @@ TclInitFileCmd(
static int
FileAttrAccessTimeCmd(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
{
Tcl_StatBuf buf;
struct utimbuf tval;
+ (void)dummy;
if (objc < 2 || objc > 3) {
Tcl_WrongNumArgs(interp, 1, objv, "name ?time?");
@@ -1066,13 +1090,14 @@ FileAttrAccessTimeCmd(
static int
FileAttrModifyTimeCmd(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
{
Tcl_StatBuf buf;
struct utimbuf tval;
+ (void)dummy;
if (objc < 2 || objc > 3) {
Tcl_WrongNumArgs(interp, 1, objv, "name ?time?");
@@ -1145,12 +1170,13 @@ FileAttrModifyTimeCmd(
static int
FileAttrLinkStatCmd(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
{
Tcl_StatBuf buf;
+ (void)dummy;
if (objc != 3) {
Tcl_WrongNumArgs(interp, 1, objv, "name varName");
@@ -1181,12 +1207,13 @@ FileAttrLinkStatCmd(
static int
FileAttrStatCmd(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
{
Tcl_StatBuf buf;
+ (void)dummy;
if (objc != 3) {
Tcl_WrongNumArgs(interp, 1, objv, "name varName");
@@ -1217,12 +1244,13 @@ FileAttrStatCmd(
static int
FileAttrTypeCmd(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
{
Tcl_StatBuf buf;
+ (void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "name");
@@ -1255,12 +1283,13 @@ FileAttrTypeCmd(
static int
FileAttrSizeCmd(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
{
Tcl_StatBuf buf;
+ (void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "name");
@@ -1292,13 +1321,14 @@ FileAttrSizeCmd(
static int
FileAttrIsDirectoryCmd(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
{
Tcl_StatBuf buf;
int value = 0;
+ (void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "name");
@@ -1330,11 +1360,13 @@ FileAttrIsDirectoryCmd(
static int
FileAttrIsExecutableCmd(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
{
+ (void)dummy;
+
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "name");
return TCL_ERROR;
@@ -1361,11 +1393,13 @@ FileAttrIsExecutableCmd(
static int
FileAttrIsExistingCmd(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
{
+ (void)dummy;
+
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "name");
return TCL_ERROR;
@@ -1392,13 +1426,14 @@ FileAttrIsExistingCmd(
static int
FileAttrIsFileCmd(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
{
Tcl_StatBuf buf;
int value = 0;
+ (void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "name");
@@ -1430,7 +1465,7 @@ FileAttrIsFileCmd(
static int
FileAttrIsOwnedCmd(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
@@ -1442,6 +1477,7 @@ FileAttrIsOwnedCmd(
Tcl_StatBuf buf;
#endif
int value = 0;
+ (void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "name");
@@ -1477,11 +1513,13 @@ FileAttrIsOwnedCmd(
static int
FileAttrIsReadableCmd(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
{
+ (void)dummy;
+
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "name");
return TCL_ERROR;
@@ -1508,11 +1546,13 @@ FileAttrIsReadableCmd(
static int
FileAttrIsWritableCmd(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
{
+ (void)dummy;
+
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "name");
return TCL_ERROR;
@@ -1539,12 +1579,13 @@ FileAttrIsWritableCmd(
static int
PathDirNameCmd(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
{
Tcl_Obj *dirPtr;
+ (void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "name");
@@ -1578,12 +1619,13 @@ PathDirNameCmd(
static int
PathExtensionCmd(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
{
Tcl_Obj *dirPtr;
+ (void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "name");
@@ -1617,12 +1659,13 @@ PathExtensionCmd(
static int
PathRootNameCmd(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
{
Tcl_Obj *dirPtr;
+ (void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "name");
@@ -1656,12 +1699,13 @@ PathRootNameCmd(
static int
PathTailCmd(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
{
Tcl_Obj *dirPtr;
+ (void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "name");
@@ -1695,12 +1739,13 @@ PathTailCmd(
static int
PathFilesystemCmd(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
{
Tcl_Obj *fsInfo;
+ (void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "name");
@@ -1736,11 +1781,13 @@ PathFilesystemCmd(
static int
PathJoinCmd(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
{
+ (void)dummy;
+
if (objc < 2) {
Tcl_WrongNumArgs(interp, 1, objv, "name ?name ...?");
return TCL_ERROR;
@@ -1768,12 +1815,13 @@ PathJoinCmd(
static int
PathNativeNameCmd(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
{
Tcl_DString ds;
+ (void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "name");
@@ -1805,12 +1853,13 @@ PathNativeNameCmd(
static int
PathNormalizeCmd(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
{
Tcl_Obj *fileName;
+ (void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "name");
@@ -1843,12 +1892,13 @@ PathNormalizeCmd(
static int
PathSplitCmd(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
{
Tcl_Obj *res;
+ (void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "name");
@@ -1886,12 +1936,13 @@ PathSplitCmd(
static int
PathTypeCmd(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
{
Tcl_Obj *typeName;
+ (void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "name");
@@ -1934,11 +1985,13 @@ PathTypeCmd(
static int
FilesystemSeparatorCmd(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
{
+ (void)dummy;
+
if (objc < 1 || objc > 2) {
Tcl_WrongNumArgs(interp, 1, objv, "?name?");
return TCL_ERROR;
@@ -1989,11 +2042,13 @@ FilesystemSeparatorCmd(
static int
FilesystemVolumesCmd(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
{
+ (void)dummy;
+
if (objc != 1) {
Tcl_WrongNumArgs(interp, 1, objv, NULL);
return TCL_ERROR;
@@ -2267,6 +2322,7 @@ TclNRForObjCmd(
{
Interp *iPtr = (Interp *) interp;
ForIterData *iterPtr;
+ (void)dummy;
if (objc != 5) {
Tcl_WrongNumArgs(interp, 1, objv, "start test next command");
@@ -2295,7 +2351,7 @@ ForSetupCallback(
Tcl_Interp *interp,
int result)
{
- ForIterData *iterPtr = data[0];
+ ForIterData *iterPtr = (ForIterData *)data[0];
if (result != TCL_OK) {
if (result == TCL_ERROR) {
@@ -2314,7 +2370,7 @@ TclNRForIterCallback(
Tcl_Interp *interp,
int result)
{
- ForIterData *iterPtr = data[0];
+ ForIterData *iterPtr = (ForIterData *)data[0];
Tcl_Obj *boolObj;
switch (result) {
@@ -2350,8 +2406,8 @@ ForCondCallback(
int result)
{
Interp *iPtr = (Interp *) interp;
- ForIterData *iterPtr = data[0];
- Tcl_Obj *boolObj = data[1];
+ ForIterData *iterPtr = (ForIterData *)data[0];
+ Tcl_Obj *boolObj = (Tcl_Obj *)data[1];
int value;
if (result != TCL_OK) {
@@ -2388,7 +2444,7 @@ ForNextCallback(
int result)
{
Interp *iPtr = (Interp *) interp;
- ForIterData *iterPtr = data[0];
+ ForIterData *iterPtr = (ForIterData *)data[0];
Tcl_Obj *next = iterPtr->next;
if ((result == TCL_OK) || (result == TCL_CONTINUE)) {
@@ -2412,7 +2468,7 @@ ForPostNextCallback(
Tcl_Interp *interp,
int result)
{
- ForIterData *iterPtr = data[0];
+ ForIterData *iterPtr = (ForIterData *)data[0];
if ((result != TCL_BREAK) && (result != TCL_OK)) {
if (result == TCL_ERROR) {
@@ -2460,6 +2516,8 @@ TclNRForeachCmd(
int objc,
Tcl_Obj *const objv[])
{
+ (void)dummy;
+
return EachloopCmd(interp, TCL_EACH_KEEP_NONE, objc, objv);
}
@@ -2480,6 +2538,7 @@ TclNRLmapCmd(
int objc,
Tcl_Obj *const objv[])
{
+ (void)dummy;
return EachloopCmd(interp, TCL_EACH_COLLECT, objc, objv);
}
@@ -2517,7 +2576,7 @@ EachloopCmd(
* allocation for better performance.
*/
- statePtr = TclStackAlloc(interp,
+ statePtr = (struct ForeachState *)TclStackAlloc(interp,
sizeof(struct ForeachState) + 3 * numLists * sizeof(int)
+ 2 * numLists * (sizeof(Tcl_Obj **) + sizeof(Tcl_Obj *)));
memset(statePtr, 0,
@@ -2618,7 +2677,7 @@ ForeachLoopStep(
Tcl_Interp *interp,
int result)
{
- struct ForeachState *statePtr = data[0];
+ struct ForeachState *statePtr = (struct ForeachState *)data[0];
/*
* Process the result code from this run of the [foreach] body. Note that
@@ -2769,6 +2828,7 @@ Tcl_FormatObjCmd(
Tcl_Obj *const objv[]) /* Argument objects. */
{
Tcl_Obj *resultPtr; /* Where result is stored finally. */
+ (void)dummy;
if (objc < 2) {
Tcl_WrongNumArgs(interp, 1, objv, "formatString ?arg ...?");
diff --git a/generic/tclCmdIL.c b/generic/tclCmdIL.c
index 0386be7..101067a 100644
--- a/generic/tclCmdIL.c
+++ b/generic/tclCmdIL.c
@@ -222,6 +222,7 @@ TclNRIfObjCmd(
Tcl_Obj *const objv[]) /* Argument objects. */
{
Tcl_Obj *boolObj;
+ (void)dummy;
if (objc <= 1) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
@@ -251,9 +252,9 @@ IfConditionCallback(
{
Interp *iPtr = (Interp *) interp;
int objc = PTR2INT(data[0]);
- Tcl_Obj *const *objv = data[1];
+ Tcl_Obj *const *objv = (Tcl_Obj *const *)data[1];
int i = PTR2INT(data[2]);
- Tcl_Obj *boolObj = data[3];
+ Tcl_Obj *boolObj = (Tcl_Obj *)data[3];
int value, thenScriptIndex = 0;
const char *clause;
@@ -395,6 +396,7 @@ Tcl_IncrObjCmd(
Tcl_Obj *const objv[]) /* Argument objects. */
{
Tcl_Obj *newValuePtr, *incrPtr;
+ (void)dummy;
if ((objc != 2) && (objc != 3)) {
Tcl_WrongNumArgs(interp, 1, objv, "varName ?increment?");
@@ -480,6 +482,7 @@ InfoArgsCmd(
Proc *procPtr;
CompiledLocal *localPtr;
Tcl_Obj *listObjPtr;
+ (void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "procname");
@@ -542,6 +545,7 @@ InfoBodyCmd(
const char *name, *bytes;
Proc *procPtr;
size_t numBytes;
+ (void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "procname");
@@ -600,6 +604,7 @@ InfoCmdCountCmd(
Tcl_Obj *const objv[]) /* Argument objects. */
{
Interp *iPtr = (Interp *) interp;
+ (void)dummy;
if (objc != 1) {
Tcl_WrongNumArgs(interp, 1, objv, NULL);
@@ -652,6 +657,7 @@ InfoCommandsCmd(
int specificNsInPattern = 0;/* Init. to avoid compiler warning. */
Tcl_Command cmd;
size_t i;
+ (void)dummy;
/*
* Get the pattern and find the "effective namespace" in which to list
@@ -711,11 +717,11 @@ InfoCommandsCmd(
entryPtr = Tcl_FindHashEntry(&nsPtr->cmdTable, simplePattern);
if (entryPtr != NULL) {
if (specificNsInPattern) {
- cmd = Tcl_GetHashValue(entryPtr);
+ cmd = (Tcl_Command)Tcl_GetHashValue(entryPtr);
elemObjPtr = Tcl_NewObj();
Tcl_GetCommandFullName(interp, cmd, elemObjPtr);
} else {
- cmdName = Tcl_GetHashKey(&nsPtr->cmdTable, entryPtr);
+ cmdName = (const char *)Tcl_GetHashKey(&nsPtr->cmdTable, entryPtr);
elemObjPtr = Tcl_NewStringObj(cmdName, -1);
}
Tcl_ListObjAppendElement(interp, listPtr, elemObjPtr);
@@ -742,7 +748,7 @@ InfoCommandsCmd(
entryPtr = Tcl_FindHashEntry(tablePtr, simplePattern);
}
if (entryPtr != NULL) {
- cmdName = Tcl_GetHashKey(tablePtr, entryPtr);
+ cmdName = (const char *)Tcl_GetHashKey(tablePtr, entryPtr);
Tcl_ListObjAppendElement(interp, listPtr,
Tcl_NewStringObj(cmdName, -1));
Tcl_SetObjResult(interp, listPtr);
@@ -758,11 +764,11 @@ InfoCommandsCmd(
entryPtr = Tcl_FirstHashEntry(&nsPtr->cmdTable, &search);
while (entryPtr != NULL) {
- cmdName = Tcl_GetHashKey(&nsPtr->cmdTable, entryPtr);
+ cmdName = (const char *)Tcl_GetHashKey(&nsPtr->cmdTable, entryPtr);
if ((simplePattern == NULL)
|| Tcl_StringMatch(cmdName, simplePattern)) {
if (specificNsInPattern) {
- cmd = Tcl_GetHashValue(entryPtr);
+ cmd = (Tcl_Command)Tcl_GetHashValue(entryPtr);
elemObjPtr = Tcl_NewObj();
Tcl_GetCommandFullName(interp, cmd, elemObjPtr);
} else {
@@ -784,7 +790,7 @@ InfoCommandsCmd(
if ((nsPtr != globalNsPtr) && !specificNsInPattern) {
entryPtr = Tcl_FirstHashEntry(&globalNsPtr->cmdTable, &search);
while (entryPtr != NULL) {
- cmdName = Tcl_GetHashKey(&globalNsPtr->cmdTable, entryPtr);
+ cmdName = (const char *)Tcl_GetHashKey(&globalNsPtr->cmdTable, entryPtr);
if ((simplePattern == NULL)
|| Tcl_StringMatch(cmdName, simplePattern)) {
if (Tcl_FindHashEntry(&nsPtr->cmdTable,cmdName) == NULL) {
@@ -815,7 +821,7 @@ InfoCommandsCmd(
entryPtr = Tcl_FirstHashEntry(&nsPtr->cmdTable, &search);
while (entryPtr != NULL) {
- cmdName = Tcl_GetHashKey(&nsPtr->cmdTable, entryPtr);
+ cmdName = (const char *)Tcl_GetHashKey(&nsPtr->cmdTable, entryPtr);
if ((simplePattern == NULL)
|| Tcl_StringMatch(cmdName, simplePattern)) {
elemObjPtr = Tcl_NewStringObj(cmdName, -1);
@@ -841,7 +847,7 @@ InfoCommandsCmd(
}
entryPtr = Tcl_FirstHashEntry(&pathNsPtr->cmdTable, &search);
while (entryPtr != NULL) {
- cmdName = Tcl_GetHashKey(&pathNsPtr->cmdTable, entryPtr);
+ cmdName = (const char *)Tcl_GetHashKey(&pathNsPtr->cmdTable, entryPtr);
if ((simplePattern == NULL)
|| Tcl_StringMatch(cmdName, simplePattern)) {
elemObjPtr = Tcl_NewStringObj(cmdName, -1);
@@ -868,7 +874,7 @@ InfoCommandsCmd(
if (!foundGlobal) {
entryPtr = Tcl_FirstHashEntry(&globalNsPtr->cmdTable, &search);
while (entryPtr != NULL) {
- cmdName = Tcl_GetHashKey(&globalNsPtr->cmdTable, entryPtr);
+ cmdName = (const char *)Tcl_GetHashKey(&globalNsPtr->cmdTable, entryPtr);
if ((simplePattern == NULL)
|| Tcl_StringMatch(cmdName, simplePattern)) {
elemObjPtr = Tcl_NewStringObj(cmdName, -1);
@@ -918,6 +924,8 @@ InfoCompleteCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
+ (void)dummy;
+
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "command");
return TCL_ERROR;
@@ -960,6 +968,7 @@ InfoDefaultCmd(
Proc *procPtr;
CompiledLocal *localPtr;
Tcl_Obj *valueObjPtr;
+ (void)dummy;
if (objc != 4) {
Tcl_WrongNumArgs(interp, 1, objv, "procname arg varname");
@@ -1039,6 +1048,7 @@ InfoErrorStackCmd(
{
Tcl_Interp *target;
Interp *iPtr;
+ (void)dummy;
if ((objc != 1) && (objc != 2)) {
Tcl_WrongNumArgs(interp, 1, objv, "?interp?");
@@ -1088,6 +1098,7 @@ TclInfoExistsCmd(
{
const char *varName;
Var *varPtr;
+ (void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "varName");
@@ -1136,6 +1147,7 @@ InfoFrameCmd(
CmdFrame *framePtr, **cmdFramePtrPtr = &iPtr->cmdFramePtr;
CoroutineData *corPtr = iPtr->execEnvPtr->corPtr;
int topLevel = 0;
+ (void)dummy;
if (objc > 2) {
Tcl_WrongNumArgs(interp, 1, objv, "?number?");
@@ -1313,7 +1325,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;
@@ -1395,7 +1407,7 @@ TclInfoFrame(
procNameObj);
ADD_PAIR("proc", procNameObj);
} else if (procPtr->cmdPtr->clientData) {
- ExtraFrameInfo *efiPtr = procPtr->cmdPtr->clientData;
+ ExtraFrameInfo *efiPtr = (ExtraFrameInfo *)procPtr->cmdPtr->clientData;
size_t i;
/*
@@ -1409,7 +1421,7 @@ TclInfoFrame(
lv[lc++] =
efiPtr->fields[i].proc(efiPtr->fields[i].clientData);
} else {
- lv[lc++] = efiPtr->fields[i].clientData;
+ lv[lc++] = (Tcl_Obj *)efiPtr->fields[i].clientData;
}
}
}
@@ -1473,6 +1485,7 @@ InfoFunctionsCmd(
{
Tcl_Obj *script;
int code;
+ (void)dummy;
if (objc > 2) {
Tcl_WrongNumArgs(interp, 1, objv, "?pattern?");
@@ -1537,6 +1550,7 @@ InfoHostnameCmd(
Tcl_Obj *const objv[]) /* Argument objects. */
{
const char *name;
+ (void)dummy;
if (objc != 1) {
Tcl_WrongNumArgs(interp, 1, objv, NULL);
@@ -1583,6 +1597,7 @@ InfoLevelCmd(
Tcl_Obj *const objv[]) /* Argument objects. */
{
Interp *iPtr = (Interp *) interp;
+ (void)dummy;
if (objc == 1) { /* Just "info level" */
Tcl_SetObjResult(interp, Tcl_NewWideIntObj(iPtr->varFramePtr->level));
@@ -1657,6 +1672,7 @@ InfoLibraryCmd(
Tcl_Obj *const objv[]) /* Argument objects. */
{
const char *libDirName;
+ (void)dummy;
if (objc != 1) {
Tcl_WrongNumArgs(interp, 1, objv, NULL);
@@ -1704,6 +1720,7 @@ InfoLoadedCmd(
Tcl_Obj *const objv[]) /* Argument objects. */
{
const char *interpName, *packageName;
+ (void)dummy;
if (objc > 3) {
Tcl_WrongNumArgs(interp, 1, objv, "?interp? ?packageName?");
@@ -1751,6 +1768,8 @@ InfoNameOfExecutableCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
+ (void)dummy;
+
if (objc != 1) {
Tcl_WrongNumArgs(interp, 1, objv, NULL);
return TCL_ERROR;
@@ -1788,6 +1807,7 @@ InfoPatchLevelCmd(
Tcl_Obj *const objv[]) /* Argument objects. */
{
const char *patchlevel;
+ (void)dummy;
if (objc != 1) {
Tcl_WrongNumArgs(interp, 1, objv, NULL);
@@ -1846,6 +1866,7 @@ InfoProcsCmd(
Tcl_HashEntry *entryPtr;
Tcl_HashSearch search;
Command *cmdPtr, *realCmdPtr;
+ (void)dummy;
/*
* Get the pattern and find the "effective namespace" in which to list
@@ -1895,7 +1916,7 @@ InfoProcsCmd(
if (simplePattern != NULL && TclMatchIsTrivial(simplePattern)) {
entryPtr = Tcl_FindHashEntry(&nsPtr->cmdTable, simplePattern);
if (entryPtr != NULL) {
- cmdPtr = Tcl_GetHashValue(entryPtr);
+ cmdPtr = (Command *)Tcl_GetHashValue(entryPtr);
if (!TclIsProc(cmdPtr)) {
realCmdPtr = (Command *)
@@ -1920,10 +1941,10 @@ InfoProcsCmd(
{
entryPtr = Tcl_FirstHashEntry(&nsPtr->cmdTable, &search);
while (entryPtr != NULL) {
- cmdName = Tcl_GetHashKey(&nsPtr->cmdTable, entryPtr);
+ cmdName = (const char *)Tcl_GetHashKey(&nsPtr->cmdTable, entryPtr);
if ((simplePattern == NULL)
|| Tcl_StringMatch(cmdName, simplePattern)) {
- cmdPtr = Tcl_GetHashValue(entryPtr);
+ cmdPtr = (Command *)Tcl_GetHashValue(entryPtr);
if (!TclIsProc(cmdPtr)) {
realCmdPtr = (Command *)
@@ -1966,11 +1987,11 @@ InfoProcsCmd(
if ((nsPtr != globalNsPtr) && !specificNsInPattern) {
entryPtr = Tcl_FirstHashEntry(&globalNsPtr->cmdTable, &search);
while (entryPtr != NULL) {
- cmdName = Tcl_GetHashKey(&globalNsPtr->cmdTable, entryPtr);
+ cmdName = (const char *)Tcl_GetHashKey(&globalNsPtr->cmdTable, entryPtr);
if ((simplePattern == NULL)
|| Tcl_StringMatch(cmdName, simplePattern)) {
if (Tcl_FindHashEntry(&nsPtr->cmdTable,cmdName) == NULL) {
- cmdPtr = Tcl_GetHashValue(entryPtr);
+ cmdPtr = (Command *)Tcl_GetHashValue(entryPtr);
realCmdPtr = (Command *) TclGetOriginalCommand(
(Tcl_Command) cmdPtr);
@@ -2022,6 +2043,8 @@ InfoScriptCmd(
Tcl_Obj *const objv[]) /* Argument objects. */
{
Interp *iPtr = (Interp *) interp;
+ (void)dummy;
+
if ((objc != 1) && (objc != 2)) {
Tcl_WrongNumArgs(interp, 1, objv, "?filename?");
return TCL_ERROR;
@@ -2068,6 +2091,8 @@ InfoSharedlibCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
+ (void)dummy;
+
if (objc != 1) {
Tcl_WrongNumArgs(interp, 1, objv, NULL);
return TCL_ERROR;
@@ -2107,6 +2132,7 @@ InfoTclVersionCmd(
Tcl_Obj *const objv[]) /* Argument objects. */
{
Tcl_Obj *version;
+ (void)dummy;
if (objc != 1) {
Tcl_WrongNumArgs(interp, 1, objv, NULL);
@@ -2150,6 +2176,7 @@ InfoCmdTypeCmd(
Tcl_Obj *const objv[]) /* Argument objects. */
{
Tcl_Command command;
+ (void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "commandName");
@@ -2203,6 +2230,7 @@ Tcl_JoinObjCmd(
size_t length;
int listLen;
Tcl_Obj *resObjPtr = NULL, *joinObjPtr, **elemPtrs;
+ (void)dummy;
if ((objc < 2) || (objc > 3)) {
Tcl_WrongNumArgs(interp, 1, objv, "list ?joinString?");
@@ -2290,6 +2318,7 @@ Tcl_LassignObjCmd(
Tcl_Obj **listObjv; /* The contents of the list. */
int listObjc; /* The length of the list. */
int code = TCL_OK;
+ (void)dummy;
if (objc < 2) {
Tcl_WrongNumArgs(interp, 1, objv, "list ?varName ...?");
@@ -2360,8 +2389,8 @@ Tcl_LindexObjCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
-
Tcl_Obj *elemPtr; /* Pointer to the element being extracted. */
+ (void)dummy;
if (objc < 2) {
Tcl_WrongNumArgs(interp, 1, objv, "list ?index ...?");
@@ -2422,6 +2451,7 @@ Tcl_LinsertObjCmd(
Tcl_Obj *listPtr;
size_t index;
int len, result;
+ (void)dummy;
if (objc < 3) {
Tcl_WrongNumArgs(interp, 1, objv, "list index ?element ...?");
@@ -2503,6 +2533,7 @@ Tcl_ListObjCmd(
Tcl_Obj *const objv[])
/* The argument objects. */
{
+ (void)dummy;
/*
* If there are no list elements, the result is an empty object.
* Otherwise set the interpreter's result object to be a list object.
@@ -2540,6 +2571,7 @@ Tcl_LlengthObjCmd(
/* Argument objects. */
{
int listLen, result;
+ (void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "list");
@@ -2579,7 +2611,7 @@ Tcl_LlengthObjCmd(
int
Tcl_LpopObjCmd(
- ClientData notUsed, /* Not used. */
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[])
@@ -2588,6 +2620,7 @@ Tcl_LpopObjCmd(
int listLen, result;
Tcl_Obj *elemPtr, *stored;
Tcl_Obj *listPtr, **elemPtrs;
+ (void)dummy;
if (objc < 2) {
Tcl_WrongNumArgs(interp, 1, objv, "listvar ?index?");
@@ -2672,7 +2705,7 @@ Tcl_LpopObjCmd(
int
Tcl_LrangeObjCmd(
- ClientData notUsed, /* Not used. */
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[])
@@ -2680,6 +2713,7 @@ Tcl_LrangeObjCmd(
{
int listLen, result;
size_t first, last;
+ (void)dummy;
if (objc != 4) {
Tcl_WrongNumArgs(interp, 1, objv, "list first last");
@@ -2741,7 +2775,7 @@ LremoveIndexCompare(
int
Tcl_LremoveObjCmd(
- ClientData notUsed, /* Not used. */
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
@@ -2749,6 +2783,7 @@ Tcl_LremoveObjCmd(
int i, idxc, listLen, prevIdx, first, num;
size_t *idxv;
Tcl_Obj *listObj;
+ (void)dummy;
/*
* Parse the arguments.
@@ -2769,7 +2804,7 @@ Tcl_LremoveObjCmd(
Tcl_SetObjResult(interp, listObj);
return TCL_OK;
}
- idxv = Tcl_Alloc((objc - 2) * sizeof(size_t));
+ idxv = (size_t *)Tcl_Alloc((objc - 2) * sizeof(size_t));
for (i = 2; i < objc; i++) {
if (TclGetIntForIndexM(interp, objv[i], /*endValue*/ listLen - 1,
&idxv[i - 2]) != TCL_OK) {
@@ -2868,6 +2903,7 @@ Tcl_LrepeatObjCmd(
{
int elementCount, i, totalElems;
Tcl_Obj *listPtr, **dataArray = NULL;
+ (void)dummy;
/*
* Check arguments for legality:
@@ -2977,6 +3013,7 @@ Tcl_LreplaceObjCmd(
Tcl_Obj *listPtr;
size_t first, last;
int listLen, numToDelete, result;
+ (void)dummy;
if (objc < 4) {
Tcl_WrongNumArgs(interp, 1, objv,
@@ -3070,13 +3107,14 @@ Tcl_LreplaceObjCmd(
int
Tcl_LreverseObjCmd(
- ClientData clientData, /* Not used. */
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument values. */
{
Tcl_Obj **elemv;
int elemc, i, j;
+ (void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "list");
@@ -3149,7 +3187,7 @@ Tcl_LreverseObjCmd(
int
Tcl_LsearchObjCmd(
- ClientData clientData, /* Not used. */
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument values. */
@@ -3187,6 +3225,7 @@ Tcl_LsearchObjCmd(
EXACT, GLOB, REGEXP, SORTED
};
enum modes mode;
+ (void)dummy;
mode = GLOB;
dataType = ASCII;
@@ -3367,7 +3406,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. */
@@ -3902,13 +3941,14 @@ Tcl_LsearchObjCmd(
int
Tcl_LsetObjCmd(
- ClientData clientData, /* Not used. */
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument values. */
{
Tcl_Obj *listPtr; /* Pointer to the list being altered. */
Tcl_Obj *finalValuePtr; /* Value finally assigned to the variable. */
+ (void)dummy;
/*
* Check parameter count.
@@ -3987,7 +4027,7 @@ Tcl_LsetObjCmd(
int
Tcl_LsortObjCmd(
- ClientData clientData, /* Not used. */
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument values. */
@@ -4019,6 +4059,7 @@ Tcl_LsortObjCmd(
LSORT_INCREASING, LSORT_INDEX, LSORT_INDICES, LSORT_INTEGER,
LSORT_NOCASE, LSORT_REAL, LSORT_STRIDE, LSORT_UNIQUE
};
+ (void)dummy;
if (objc < 2) {
Tcl_WrongNumArgs(interp, 1, objv, "?-option value ...? list");
@@ -4188,7 +4229,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. */
@@ -4328,9 +4369,9 @@ Tcl_LsortObjCmd(
elmArrSize = length * sizeof(SortElement);
if (elmArrSize <= MAXCALLOC) {
- elementArray = Tcl_Alloc(elmArrSize);
+ elementArray = (SortElement *)Tcl_Alloc(elmArrSize);
} else {
- elementArray = malloc(elmArrSize);
+ elementArray = (SortElement *)malloc(elmArrSize);
}
if (!elementArray) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
diff --git a/generic/tclCmdMZ.c b/generic/tclCmdMZ.c
index 847cdaa..393b578 100644
--- a/generic/tclCmdMZ.c
+++ b/generic/tclCmdMZ.c
@@ -88,6 +88,7 @@ Tcl_PwdObjCmd(
Tcl_Obj *const objv[]) /* Argument objects. */
{
Tcl_Obj *retVal;
+ (void)dummy;
if (objc != 1) {
Tcl_WrongNumArgs(interp, 1, objv, NULL);
@@ -142,6 +143,7 @@ Tcl_RegexpObjCmd(
REGEXP_EXPANDED,REGEXP_LINE, REGEXP_LINESTOP,REGEXP_LINEANCHOR,
REGEXP_NOCASE, REGEXP_START, REGEXP_LAST
};
+ (void)dummy;
indices = 0;
about = 0;
@@ -505,6 +507,7 @@ Tcl_RegsubObjCmd(
REGSUB_LINESTOP, REGSUB_LINEANCHOR, REGSUB_NOCASE, REGSUB_START,
REGSUB_LAST
};
+ (void)dummy;
cflags = TCL_REG_ADVANCED;
all = 0;
@@ -779,7 +782,7 @@ Tcl_RegsubObjCmd(
Tcl_ListObjGetElements(interp, subPtr, &numParts, &parts);
numArgs = numParts + info.nsubs + 1;
- args = Tcl_Alloc(sizeof(Tcl_Obj*) * numArgs);
+ args = (Tcl_Obj **)Tcl_Alloc(sizeof(Tcl_Obj*) * numArgs);
memcpy(args, parts, sizeof(Tcl_Obj*) * numParts);
for (idx = 0 ; idx <= info.nsubs ; idx++) {
@@ -1003,12 +1006,13 @@ Tcl_RegsubObjCmd(
int
Tcl_RenameObjCmd(
- ClientData dummy, /* Arbitrary value passed to the command. */
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
const char *oldName, *newName;
+ (void)dummy;
if (objc != 3) {
Tcl_WrongNumArgs(interp, 1, objv, "oldName newName");
@@ -1054,6 +1058,7 @@ Tcl_ReturnObjCmd(
int explicitResult = (0 == (objc % 2));
int numOptionWords = objc - 1 - explicitResult;
+ (void)dummy;
if (TCL_ERROR == TclMergeReturnOptions(interp, numOptionWords, objv+1,
&returnOpts, &code, &level)) {
@@ -1106,6 +1111,7 @@ TclNRSourceObjCmd(
int result;
void **pkgFiles = NULL;
void *names = NULL;
+ (void)dummy;
if (objc < 2 || objc > 4) {
Tcl_WrongNumArgs(interp, 1, objv, "?-encoding name? fileName");
@@ -1137,7 +1143,7 @@ TclNRSourceObjCmd(
"option", TCL_EXACT, &index)) {
return TCL_ERROR;
}
- pkgFiles = Tcl_GetAssocData(interp, "tclPkgFiles", NULL);
+ pkgFiles = (void **)Tcl_GetAssocData(interp, "tclPkgFiles", NULL);
/* Make sure that during the following TclNREvalFile no filenames
* are recorded for inclusion in the "package files" command */
names = *pkgFiles;
@@ -1182,6 +1188,7 @@ Tcl_SplitObjCmd(
const char *end;
size_t splitCharLen, stringLen;
Tcl_Obj *listPtr, *objPtr;
+ (void)dummy;
if (objc == 2) {
splitChars = " \n\t\r";
@@ -1244,14 +1251,14 @@ Tcl_SplitObjCmd(
Tcl_SetHashValue(hPtr, objPtr);
} else {
- objPtr = Tcl_GetHashValue(hPtr);
+ objPtr = (Tcl_Obj *)Tcl_GetHashValue(hPtr);
}
Tcl_ListObjAppendElement(NULL, listPtr, objPtr);
}
Tcl_DeleteHashTable(&charReuseTable);
} else if (splitCharLen == 1) {
- char *p;
+ const char *p;
/*
* Handle the special case of splitting on a single character. This is
@@ -1324,6 +1331,7 @@ StringFirstCmd(
Tcl_Obj *const objv[]) /* Argument objects. */
{
size_t start = TCL_INDEX_START;
+ (void)dummy;
if (objc < 3 || objc > 4) {
Tcl_WrongNumArgs(interp, 1, objv,
@@ -1369,6 +1377,7 @@ StringLastCmd(
Tcl_Obj *const objv[]) /* Argument objects. */
{
size_t last = TCL_INDEX_END;
+ (void)dummy;
if (objc < 3 || objc > 4) {
Tcl_WrongNumArgs(interp, 1, objv,
@@ -1414,6 +1423,7 @@ StringIndexCmd(
Tcl_Obj *const objv[]) /* Argument objects. */
{
size_t index, end;
+ (void)dummy;
if (objc != 3) {
Tcl_WrongNumArgs(interp, 1, objv, "string charIndex");
@@ -1486,6 +1496,7 @@ StringInsertCmd(
size_t length; /* String length */
size_t index; /* Insert index */
Tcl_Obj *outObj; /* Output object */
+ (void)dummy;
if (objc != 4) {
Tcl_WrongNumArgs(interp, 1, objv, "string index insertString");
@@ -1571,6 +1582,7 @@ StringIsCmd(
enum isOptions {
OPT_STRICT, OPT_FAILIDX
};
+ (void)dummy;
if (objc < 3 || objc > 6) {
Tcl_WrongNumArgs(interp, 1, objv,
@@ -1986,6 +1998,7 @@ StringMapCmd(
Tcl_Obj **mapElemv, *sourceObj, *resultPtr;
Tcl_UniChar *ustring1, *ustring2, *p, *end;
int (*strCmpFn)(const Tcl_UniChar*, const Tcl_UniChar*, size_t);
+ (void)dummy;
if (objc < 3 || objc > 4) {
Tcl_WrongNumArgs(interp, 1, objv, "?-nocase? charMap string");
@@ -2040,7 +2053,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 (index=2 ; index<mapElemc ; index+=2) {
@@ -2155,10 +2168,10 @@ StringMapCmd(
* case.
*/
- mapStrings = TclStackAlloc(interp, mapElemc*sizeof(Tcl_UniChar *)*2);
- mapLens = TclStackAlloc(interp, mapElemc * sizeof(size_t) * 2);
+ mapStrings = (Tcl_UniChar **)TclStackAlloc(interp, mapElemc*sizeof(Tcl_UniChar *)*2);
+ mapLens = (size_t *)TclStackAlloc(interp, mapElemc * sizeof(size_t) * 2);
if (nocase) {
- u2lc = TclStackAlloc(interp, mapElemc * sizeof(int));
+ u2lc = (int *)TclStackAlloc(interp, mapElemc * sizeof(int));
}
for (index = 0; index < mapElemc; index++) {
mapStrings[index] = TclGetUnicodeFromObj(mapElemv[index],
@@ -2257,6 +2270,7 @@ StringMatchCmd(
Tcl_Obj *const objv[]) /* Argument objects. */
{
int nocase = 0;
+ (void)dummy;
if (objc < 3 || objc > 4) {
Tcl_WrongNumArgs(interp, 1, objv, "?-nocase? pattern string");
@@ -2309,6 +2323,7 @@ StringRangeCmd(
Tcl_Obj *const objv[]) /* Argument objects. */
{
size_t first, last, end;
+ (void)dummy;
if (objc != 4) {
Tcl_WrongNumArgs(interp, 1, objv, "string first last");
@@ -2366,6 +2381,7 @@ StringReptCmd(
{
int count;
Tcl_Obj *resultPtr;
+ (void)dummy;
if (objc != 3) {
Tcl_WrongNumArgs(interp, 1, objv, "string count");
@@ -2421,6 +2437,7 @@ StringRplcCmd(
Tcl_Obj *const objv[]) /* Argument objects. */
{
size_t first, last, end;
+ (void)dummy;
if (objc < 4 || objc > 5) {
Tcl_WrongNumArgs(interp, 1, objv, "string first last ?string?");
@@ -2494,6 +2511,8 @@ StringRevCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
+ (void)dummy;
+
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "string");
return TCL_ERROR;
@@ -2532,6 +2551,7 @@ StringStartCmd(
Tcl_UniChar ch = 0;
const char *p, *string;
size_t numChars, length, cur, index;
+ (void)dummy;
if (objc != 3) {
Tcl_WrongNumArgs(interp, 1, objv, "string index");
@@ -2593,6 +2613,7 @@ StringEndCmd(
Tcl_UniChar ch = 0;
const char *p, *end, *string;
size_t length, numChars, cur, index;
+ (void)dummy;
if (objc != 3) {
Tcl_WrongNumArgs(interp, 1, objv, "string index");
@@ -2661,6 +2682,7 @@ StringEqualCmd(
const char *string2;
int i, match, nocase = 0, reqlength = -1;
size_t length;
+ (void)dummy;
if (objc < 3 || objc > 6) {
str_cmp_args:
@@ -2735,6 +2757,7 @@ StringCmpCmd(
*/
int match, nocase, reqlength, status;
+ (void)dummy;
status = TclStringCmpOpts(interp, objc, objv, &nocase, &reqlength);
if (status != TCL_OK) {
@@ -2818,6 +2841,7 @@ StringCatCmd(
Tcl_Obj *const objv[]) /* Argument objects. */
{
Tcl_Obj *objResultPtr;
+ (void)dummy;
if (objc < 2) {
/*
@@ -2864,6 +2888,7 @@ StringBytesCmd(
Tcl_Obj *const objv[]) /* Argument objects. */
{
size_t length;
+ (void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "string");
@@ -2900,6 +2925,8 @@ StringLenCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
+ (void)dummy;
+
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "string");
return TCL_ERROR;
@@ -2937,6 +2964,7 @@ StringLowerCmd(
size_t length1, length2;
const char *string1;
char *string2;
+ (void)dummy;
if (objc < 2 || objc > 4) {
Tcl_WrongNumArgs(interp, 1, objv, "string ?first? ?last?");
@@ -3022,6 +3050,7 @@ StringUpperCmd(
size_t length1, length2;
const char *string1;
char *string2;
+ (void)dummy;
if (objc < 2 || objc > 4) {
Tcl_WrongNumArgs(interp, 1, objv, "string ?first? ?last?");
@@ -3107,6 +3136,7 @@ StringTitleCmd(
size_t length1, length2;
const char *string1;
char *string2;
+ (void)dummy;
if (objc < 2 || objc > 4) {
Tcl_WrongNumArgs(interp, 1, objv, "string ?first? ?last?");
@@ -3191,6 +3221,7 @@ StringTrimCmd(
{
const char *string1, *string2;
size_t triml, trimr, length1, length2;
+ (void)dummy;
if (objc == 3) {
string2 = TclGetStringFromObj(objv[2], &length2);
@@ -3239,6 +3270,7 @@ StringTrimLCmd(
const char *string1, *string2;
int trim;
size_t length1, length2;
+ (void)dummy;
if (objc == 3) {
string2 = TclGetStringFromObj(objv[2], &length2);
@@ -3286,6 +3318,7 @@ StringTrimRCmd(
const char *string1, *string2;
int trim;
size_t length1, length2;
+ (void)dummy;
if (objc == 3) {
string2 = TclGetStringFromObj(objv[2], &length2);
@@ -3438,6 +3471,7 @@ TclNRSubstObjCmd(
Tcl_Obj *const objv[]) /* Argument objects. */
{
int flags;
+ (void)dummy;
if (objc < 2) {
Tcl_WrongNumArgs(interp, 1, objv,
@@ -3513,6 +3547,7 @@ TclNRSwitchObjCmd(
};
typedef int (*strCmpFn_t)(const char *, const char *);
strCmpFn_t strCmpFn = TclUtfCmp;
+ (void)dummy;
mode = OPT_EXACT;
foundmode = 0;
@@ -3863,7 +3898,7 @@ TclNRSwitchObjCmd(
*/
matchFound:
- ctxPtr = TclStackAlloc(interp, sizeof(CmdFrame));
+ ctxPtr = (CmdFrame *)TclStackAlloc(interp, sizeof(CmdFrame));
*ctxPtr = *iPtr->cmdFramePtr;
if (splitObjs) {
@@ -3893,7 +3928,7 @@ TclNRSwitchObjCmd(
if (ctxPtr->type == TCL_LOCATION_SOURCE && ctxPtr->line[bidx] >= 0) {
int bline = ctxPtr->line[bidx];
- ctxPtr->line = Tcl_Alloc(objc * sizeof(int));
+ ctxPtr->line = (int *)Tcl_Alloc(objc * sizeof(int));
ctxPtr->nline = objc;
TclListLines(blist, bline, objc, ctxPtr->line, objv);
} else {
@@ -3907,7 +3942,7 @@ TclNRSwitchObjCmd(
int k;
- ctxPtr->line = Tcl_Alloc(objc * sizeof(int));
+ ctxPtr->line = (int *)Tcl_Alloc(objc * sizeof(int));
ctxPtr->nline = objc;
for (k=0; k < objc; k++) {
ctxPtr->line[k] = -1;
@@ -3947,9 +3982,9 @@ SwitchPostProc(
/* Unpack the preserved data */
int splitObjs = PTR2INT(data[0]);
- CmdFrame *ctxPtr = data[1];
+ CmdFrame *ctxPtr = (CmdFrame *)data[1];
int pc = PTR2INT(data[2]);
- const char *pattern = data[3];
+ const char *pattern = (const char *)data[3];
size_t patternLength = strlen(pattern);
/*
@@ -4011,6 +4046,7 @@ Tcl_ThrowObjCmd(
{
Tcl_Obj *options;
int len;
+ (void)dummy;
if (objc != 3) {
Tcl_WrongNumArgs(interp, 1, objv, "type message");
@@ -4081,6 +4117,7 @@ Tcl_TimeObjCmd(
#else
Tcl_WideInt start, stop;
#endif
+ (void)dummy;
if (objc == 2) {
count = 1;
@@ -4199,6 +4236,7 @@ Tcl_TimeRateObjCmd(
};
NRE_callback *rootPtr;
ByteCode *codePtr = NULL;
+ (void)dummy;
for (i = 1; i < objc - 1; i++) {
int index;
@@ -4730,6 +4768,7 @@ TclNRTryObjCmd(
enum Handlers {
TryFinally, TryOn, TryTrap
};
+ (void)clientData;
/*
* Parse the arguments. The handlers are passed to subsequent callbacks as
@@ -4923,9 +4962,9 @@ TryPostBody(
int i, dummy, code, objc;
int numHandlers = 0;
- handlersObj = data[0];
- finallyObj = data[1];
- objv = data[2];
+ handlersObj = (Tcl_Obj *)data[0];
+ finallyObj = (Tcl_Obj *)data[1];
+ objv = (Tcl_Obj **)data[2];
objc = PTR2INT(data[3]);
cmdObj = objv[0];
@@ -5138,9 +5177,9 @@ TryPostHandler(
Tcl_Obj *finallyObj;
int finally;
- objv = data[0];
- options = data[1];
- handlerKindObj = data[2];
+ objv = (Tcl_Obj **)data[0];
+ options = (Tcl_Obj *)data[1];
+ handlerKindObj = (Tcl_Obj *)data[2];
finally = PTR2INT(data[3]);
cmdObj = objv[0];
@@ -5222,9 +5261,9 @@ TryPostFinal(
{
Tcl_Obj *resultObj, *options, *cmdObj;
- resultObj = data[0];
- options = data[1];
- cmdObj = data[2];
+ resultObj = (Tcl_Obj *)data[0];
+ options = (Tcl_Obj *)data[1];
+ cmdObj = (Tcl_Obj *)data[2];
/*
* If the result wasn't OK, we need to adjust the result options.
@@ -5299,6 +5338,7 @@ TclNRWhileObjCmd(
Tcl_Obj *const objv[]) /* Argument objects. */
{
ForIterData *iterPtr;
+ (void)dummy;
if (objc != 3) {
Tcl_WrongNumArgs(interp, 1, objv, "test command");
diff --git a/generic/tclCompCmds.c b/generic/tclCompCmds.c
index 4c5bba5..9605d01 100644
--- a/generic/tclCompCmds.c
+++ b/generic/tclCompCmds.c
@@ -267,6 +267,7 @@ TclCompileArrayExistsCmd(
DefineLineInformation; /* TIP #280 */
Tcl_Token *tokenPtr;
int isScalar, localIndex;
+ (void)cmdPtr;
if (parsePtr->numWords != 2) {
return TCL_ERROR;
@@ -403,9 +404,9 @@ TclCompileArraySetCmd(
keyVar = AnonymousLocal(envPtr);
valVar = AnonymousLocal(envPtr);
- infoPtr = Tcl_Alloc(sizeof(ForeachInfo));
+ infoPtr = (ForeachInfo *)Tcl_Alloc(sizeof(ForeachInfo));
infoPtr->numLists = 1;
- infoPtr->varLists[0] = Tcl_Alloc(sizeof(ForeachVarList) + sizeof(int));
+ infoPtr->varLists[0] = (ForeachVarList *)Tcl_Alloc(sizeof(ForeachVarList) + sizeof(int));
infoPtr->varLists[0]->numVars = 2;
infoPtr->varLists[0]->varIndexes[0] = keyVar;
infoPtr->varLists[0]->varIndexes[1] = valVar;
@@ -522,7 +523,7 @@ TclCompileArrayUnsetCmd(
int
TclCompileBreakCmd(
- Tcl_Interp *interp, /* Used for error reporting. */
+ Tcl_Interp *dummy, /* Used for error reporting. */
Tcl_Parse *parsePtr, /* Points to a parse structure for the command
* created by Tcl_ParseCommand. */
Command *cmdPtr, /* Points to defintion of command being
@@ -531,6 +532,8 @@ TclCompileBreakCmd(
{
ExceptionRange *rangePtr;
ExceptionAux *auxPtr;
+ (void)dummy;
+ (void)cmdPtr;
if (parsePtr->numWords != 1) {
return TCL_ERROR;
@@ -592,6 +595,7 @@ TclCompileCatchCmd(
int resultIndex, optsIndex, range, dropScript = 0;
DefineLineInformation; /* TIP #280 */
int depth = TclGetStackDepth(envPtr);
+ (void)cmdPtr;
/*
* If syntax does not match what we expect for [catch], do not compile.
@@ -765,7 +769,7 @@ TclCompileCatchCmd(
int
TclCompileClockClicksCmd(
- Tcl_Interp* interp, /* Tcl interpreter */
+ Tcl_Interp* dummy, /* Tcl interpreter */
Tcl_Parse *parsePtr, /* Points to a parse structure for the command
* created by Tcl_ParseCommand. */
Command *cmdPtr, /* Points to defintion of command being
@@ -773,6 +777,8 @@ TclCompileClockClicksCmd(
CompileEnv *envPtr) /* Holds resulting instructions. */
{
Tcl_Token* tokenPtr;
+ (void)dummy;
+ (void)cmdPtr;
switch (parsePtr->numWords) {
case 1:
@@ -829,13 +835,15 @@ TclCompileClockClicksCmd(
int
TclCompileClockReadingCmd(
- Tcl_Interp* interp, /* Tcl interpreter */
+ Tcl_Interp* dummy, /* Tcl interpreter */
Tcl_Parse *parsePtr, /* Points to a parse structure for the command
* created by Tcl_ParseCommand. */
Command *cmdPtr, /* Points to defintion of command being
* compiled. */
CompileEnv *envPtr) /* Holds resulting instructions. */
{
+ (void)dummy;
+
if (parsePtr->numWords != 1) {
return TCL_ERROR;
}
@@ -876,6 +884,7 @@ TclCompileConcatCmd(
Tcl_Obj *objPtr, *listObj;
Tcl_Token *tokenPtr;
int i;
+ (void)cmdPtr;
/* TODO: Consider compiling expansion case. */
if (parsePtr->numWords == 1) {
@@ -953,7 +962,7 @@ TclCompileConcatCmd(
int
TclCompileContinueCmd(
- Tcl_Interp *interp, /* Used for error reporting. */
+ Tcl_Interp *dummy, /* Used for error reporting. */
Tcl_Parse *parsePtr, /* Points to a parse structure for the command
* created by Tcl_ParseCommand. */
Command *cmdPtr, /* Points to defintion of command being
@@ -962,6 +971,8 @@ TclCompileContinueCmd(
{
ExceptionRange *rangePtr;
ExceptionAux *auxPtr;
+ (void)dummy;
+ (void)cmdPtr;
/*
* There should be no argument after the "continue".
@@ -1027,6 +1038,7 @@ TclCompileDictSetCmd(
int i, dictVarIndex;
DefineLineInformation; /* TIP #280 */
Tcl_Token *varTokenPtr;
+ (void)cmdPtr;
/*
* There must be at least one argument after the command.
@@ -1153,6 +1165,7 @@ TclCompileDictGetCmd(
Tcl_Token *tokenPtr;
int i;
DefineLineInformation; /* TIP #280 */
+ (void)cmdPtr;
/*
* There must be at least two arguments after the command (the single-arg
@@ -1190,6 +1203,7 @@ TclCompileDictGetWithDefaultCmd(
Tcl_Token *tokenPtr;
int i;
DefineLineInformation; /* TIP #280 */
+ (void)cmdPtr;
/*
* There must be at least three arguments after the command.
@@ -1222,6 +1236,7 @@ TclCompileDictExistsCmd(
Tcl_Token *tokenPtr;
int i;
DefineLineInformation; /* TIP #280 */
+ (void)cmdPtr;
/*
* There must be at least two arguments after the command (the single-arg
@@ -1814,9 +1829,9 @@ TclCompileDictUpdateCmd(
* that are to be used.
*/
- duiPtr = Tcl_Alloc(sizeof(DictUpdateInfo) + sizeof(int) * (numVars - 1));
+ duiPtr = (DictUpdateInfo *)Tcl_Alloc(sizeof(DictUpdateInfo) + sizeof(int) * (numVars - 1));
duiPtr->length = numVars;
- keyTokenPtrs = TclStackAlloc(interp, sizeof(Tcl_Token *) * numVars);
+ keyTokenPtrs = (Tcl_Token **)TclStackAlloc(interp, sizeof(Tcl_Token *) * numVars);
tokenPtr = TokenAfter(dictVarTokenPtr);
for (i=0 ; i<numVars ; i++) {
@@ -2293,11 +2308,11 @@ DupDictUpdateInfo(
ClientData clientData)
{
DictUpdateInfo *dui1Ptr, *dui2Ptr;
- unsigned len;
+ size_t len;
- dui1Ptr = clientData;
+ dui1Ptr = (DictUpdateInfo *)clientData;
len = sizeof(DictUpdateInfo) + sizeof(int) * (dui1Ptr->length - 1);
- dui2Ptr = Tcl_Alloc(len);
+ dui2Ptr = (DictUpdateInfo *)Tcl_Alloc(len);
memcpy(dui2Ptr, dui1Ptr, len);
return dui2Ptr;
}
@@ -2316,8 +2331,10 @@ PrintDictUpdateInfo(
ByteCode *codePtr,
unsigned int pcOffset)
{
- DictUpdateInfo *duiPtr = clientData;
+ DictUpdateInfo *duiPtr = (DictUpdateInfo *)clientData;
size_t i;
+ (void)codePtr;
+ (void)pcOffset;
for (i=0 ; i<duiPtr->length ; i++) {
if (i) {
@@ -2334,9 +2351,11 @@ DisassembleDictUpdateInfo(
ByteCode *codePtr,
unsigned int pcOffset)
{
- DictUpdateInfo *duiPtr = clientData;
+ DictUpdateInfo *duiPtr = (DictUpdateInfo *)clientData;
size_t i;
Tcl_Obj *variables = Tcl_NewObj();
+ (void)codePtr;
+ (void)pcOffset;
for (i=0 ; i<duiPtr->length ; i++) {
Tcl_ListObjAppendElement(NULL, variables,
@@ -2379,6 +2398,7 @@ TclCompileErrorCmd(
Tcl_Token *tokenPtr;
DefineLineInformation; /* TIP #280 */
+ (void)cmdPtr;
if (parsePtr->numWords < 2 || parsePtr->numWords > 4) {
return TCL_ERROR;
@@ -2448,6 +2468,7 @@ TclCompileExprCmd(
CompileEnv *envPtr) /* Holds resulting instructions. */
{
Tcl_Token *firstWordPtr;
+ (void)cmdPtr;
if (parsePtr->numWords == 1) {
return TCL_ERROR;
@@ -2497,6 +2518,7 @@ TclCompileForCmd(
int bodyCodeOffset, nextCodeOffset, jumpDist;
int bodyRange, nextRange;
DefineLineInformation; /* TIP #280 */
+ (void)cmdPtr;
if (parsePtr->numWords != 5) {
return TCL_ERROR;
@@ -2715,6 +2737,7 @@ CompileEachloopCmd(
int numWords, numLists, i, j, code = TCL_OK;
Tcl_Obj *varListObj = NULL;
DefineLineInformation; /* TIP #280 */
+ (void)cmdPtr;
/*
* If the foreach command isn't in a procedure, don't compile it inline:
@@ -2750,7 +2773,7 @@ CompileEachloopCmd(
*/
numLists = (numWords - 2)/2;
- infoPtr = Tcl_Alloc(sizeof(ForeachInfo)
+ infoPtr = (ForeachInfo *)Tcl_Alloc(sizeof(ForeachInfo)
+ (numLists - 1) * sizeof(ForeachVarList *));
infoPtr->numLists = 0; /* Count this up as we go */
@@ -2784,7 +2807,7 @@ CompileEachloopCmd(
goto done;
}
- varListPtr = Tcl_Alloc(sizeof(ForeachVarList)
+ varListPtr = (ForeachVarList *)Tcl_Alloc(sizeof(ForeachVarList)
+ (numVars - 1) * sizeof(int));
varListPtr->numVars = numVars;
infoPtr->varLists[i/2] = varListPtr;
@@ -2917,12 +2940,12 @@ DupForeachInfo(
ClientData clientData) /* The foreach command's compilation auxiliary
* data to duplicate. */
{
- ForeachInfo *srcPtr = clientData;
+ ForeachInfo *srcPtr = (ForeachInfo *)clientData;
ForeachInfo *dupPtr;
ForeachVarList *srcListPtr, *dupListPtr;
int numVars, i, j, numLists = srcPtr->numLists;
- dupPtr = Tcl_Alloc(sizeof(ForeachInfo)
+ dupPtr = (ForeachInfo *)Tcl_Alloc(sizeof(ForeachInfo)
+ numLists * sizeof(ForeachVarList *));
dupPtr->numLists = numLists;
dupPtr->firstValueTemp = srcPtr->firstValueTemp;
@@ -2931,7 +2954,7 @@ DupForeachInfo(
for (i = 0; i < numLists; i++) {
srcListPtr = srcPtr->varLists[i];
numVars = srcListPtr->numVars;
- dupListPtr = Tcl_Alloc(sizeof(ForeachVarList)
+ dupListPtr = (ForeachVarList *)Tcl_Alloc(sizeof(ForeachVarList)
+ numVars * sizeof(int));
dupListPtr->numVars = numVars;
for (j = 0; j < numVars; j++) {
@@ -2966,7 +2989,7 @@ FreeForeachInfo(
ClientData clientData) /* The foreach command's compilation auxiliary
* data to free. */
{
- ForeachInfo *infoPtr = clientData;
+ ForeachInfo *infoPtr = (ForeachInfo *)clientData;
ForeachVarList *listPtr;
int numLists = infoPtr->numLists;
int i;
@@ -3002,9 +3025,11 @@ PrintForeachInfo(
ByteCode *codePtr,
unsigned int pcOffset)
{
- ForeachInfo *infoPtr = clientData;
+ ForeachInfo *infoPtr = (ForeachInfo *)clientData;
ForeachVarList *varsPtr;
int i, j;
+ (void)codePtr;
+ (void)pcOffset;
Tcl_AppendToObj(appendObj, "data=[", -1);
@@ -3042,9 +3067,11 @@ PrintNewForeachInfo(
ByteCode *codePtr,
unsigned int pcOffset)
{
- ForeachInfo *infoPtr = clientData;
+ ForeachInfo *infoPtr = (ForeachInfo *)clientData;
ForeachVarList *varsPtr;
int i, j;
+ (void)codePtr;
+ (void)pcOffset;
Tcl_AppendPrintfToObj(appendObj, "jumpOffset=%+d, vars=",
infoPtr->loopCtTemp);
@@ -3072,10 +3099,12 @@ DisassembleForeachInfo(
ByteCode *codePtr,
unsigned int pcOffset)
{
- ForeachInfo *infoPtr = clientData;
+ ForeachInfo *infoPtr = (ForeachInfo *)clientData;
ForeachVarList *varsPtr;
int i, j;
Tcl_Obj *objPtr, *innerPtr;
+ (void)codePtr;
+ (void)pcOffset;
/*
* Data stores.
@@ -3119,10 +3148,12 @@ DisassembleNewForeachInfo(
ByteCode *codePtr,
unsigned int pcOffset)
{
- ForeachInfo *infoPtr = clientData;
+ ForeachInfo *infoPtr = (ForeachInfo *)clientData;
ForeachVarList *varsPtr;
int i, j;
Tcl_Obj *objPtr, *innerPtr;
+ (void)codePtr;
+ (void)pcOffset;
/*
* Jump offset.
@@ -3182,6 +3213,7 @@ TclCompileFormatCmd(
const char *bytes, *start;
int i, j;
size_t len;
+ (void)cmdPtr;
/*
* Don't handle any guaranteed-error cases.
@@ -3204,7 +3236,7 @@ TclCompileFormatCmd(
return TCL_ERROR;
}
- objv = Tcl_Alloc((parsePtr->numWords-2) * sizeof(Tcl_Obj *));
+ objv = (Tcl_Obj **)Tcl_Alloc((parsePtr->numWords-2) * sizeof(Tcl_Obj *));
for (i=0 ; i+2 < parsePtr->numWords ; i++) {
tokenPtr = TokenAfter(tokenPtr);
objv[i] = Tcl_NewObj();
@@ -3499,7 +3531,7 @@ TclPushVarName(
* assemble the corresponding token.
*/
- elemTokenPtr = TclStackAlloc(interp, sizeof(Tcl_Token));
+ elemTokenPtr = (Tcl_Token *)TclStackAlloc(interp, sizeof(Tcl_Token));
allocedTokens = 1;
elemTokenPtr->type = TCL_TOKEN_TEXT;
elemTokenPtr->start = elName;
@@ -3554,7 +3586,7 @@ TclPushVarName(
* token.
*/
- elemTokenPtr = TclStackAlloc(interp, n * sizeof(Tcl_Token));
+ elemTokenPtr = (Tcl_Token *)TclStackAlloc(interp, n * sizeof(Tcl_Token));
allocedTokens = 1;
elemTokenPtr->type = TCL_TOKEN_TEXT;
elemTokenPtr->start = elName;
diff --git a/generic/tclCompCmdsGR.c b/generic/tclCompCmdsGR.c
index c3684e0..7f0595f 100644
--- a/generic/tclCompCmdsGR.c
+++ b/generic/tclCompCmdsGR.c
@@ -93,6 +93,7 @@ TclCompileGlobalCmd(
Tcl_Token *varTokenPtr;
int localIndex, numWords, i;
DefineLineInformation; /* TIP #280 */
+ (void)cmdPtr;
/* TODO: Consider support for compiling expanded args. */
numWords = parsePtr->numWords;
@@ -189,6 +190,7 @@ TclCompileIfCmd(
int boolVal; /* Value of static condition. */
int compileScripts = 1;
DefineLineInformation; /* TIP #280 */
+ (void)cmdPtr;
/*
* Only compile the "if" command if all arguments are simple words, in
@@ -479,6 +481,7 @@ TclCompileIncrCmd(
Tcl_Token *varTokenPtr, *incrTokenPtr;
int isScalar, localIndex, haveImmValue, immValue;
DefineLineInformation; /* TIP #280 */
+ (void)cmdPtr;
if ((parsePtr->numWords != 2) && (parsePtr->numWords != 3)) {
return TCL_ERROR;
@@ -641,13 +644,15 @@ TclCompileInfoCommandsCmd(
int
TclCompileInfoCoroutineCmd(
- Tcl_Interp *interp, /* Used for error reporting. */
+ Tcl_Interp *dummy, /* Used for error reporting. */
Tcl_Parse *parsePtr, /* Points to a parse structure for the command
* created by Tcl_ParseCommand. */
Command *cmdPtr, /* Points to defintion of command being
* compiled. */
CompileEnv *envPtr) /* Holds resulting instructions. */
{
+ (void)dummy;
+ (void)cmdPtr;
/*
* Only compile [info coroutine] without arguments.
*/
@@ -676,6 +681,7 @@ TclCompileInfoExistsCmd(
Tcl_Token *tokenPtr;
int isScalar, localIndex;
DefineLineInformation; /* TIP #280 */
+ (void)cmdPtr;
if (parsePtr->numWords != 2) {
return TCL_ERROR;
@@ -722,6 +728,7 @@ TclCompileInfoLevelCmd(
* compiled. */
CompileEnv *envPtr) /* Holds resulting instructions. */
{
+ (void)cmdPtr;
/*
* Only compile [info level] without arguments or with a single argument.
*/
@@ -759,6 +766,7 @@ TclCompileInfoObjectClassCmd(
{
DefineLineInformation; /* TIP #280 */
Tcl_Token *tokenPtr = TokenAfter(parsePtr->tokenPtr);
+ (void)cmdPtr;
if (parsePtr->numWords != 2) {
return TCL_ERROR;
@@ -779,6 +787,7 @@ TclCompileInfoObjectIsACmd(
{
DefineLineInformation; /* TIP #280 */
Tcl_Token *tokenPtr = TokenAfter(parsePtr->tokenPtr);
+ (void)cmdPtr;
/*
* We only handle [info object isa object <somevalue>]. The first three
@@ -815,6 +824,7 @@ TclCompileInfoObjectNamespaceCmd(
{
DefineLineInformation; /* TIP #280 */
Tcl_Token *tokenPtr = TokenAfter(parsePtr->tokenPtr);
+ (void)cmdPtr;
if (parsePtr->numWords != 2) {
return TCL_ERROR;
@@ -854,6 +864,7 @@ TclCompileLappendCmd(
Tcl_Token *varTokenPtr, *valueTokenPtr;
int isScalar, localIndex, numWords, i;
DefineLineInformation; /* TIP #280 */
+ (void)cmdPtr;
/* TODO: Consider support for compiling expanded args. */
numWords = parsePtr->numWords;
@@ -970,6 +981,7 @@ TclCompileLassignCmd(
Tcl_Token *tokenPtr;
int isScalar, localIndex, numWords, idx;
DefineLineInformation; /* TIP #280 */
+ (void)cmdPtr;
numWords = parsePtr->numWords;
@@ -1074,6 +1086,7 @@ TclCompileLindexCmd(
Tcl_Token *idxTokenPtr, *valTokenPtr;
int i, idx, numWords = parsePtr->numWords;
DefineLineInformation; /* TIP #280 */
+ (void)cmdPtr;
/*
* Quit if too few args.
@@ -1166,6 +1179,7 @@ TclCompileListCmd(
Tcl_Token *valueTokenPtr;
int i, numWords, concat, build;
Tcl_Obj *listObj, *objPtr;
+ (void)cmdPtr;
if (parsePtr->numWords == 1) {
/*
@@ -1278,6 +1292,7 @@ TclCompileLlengthCmd(
{
Tcl_Token *varTokenPtr;
DefineLineInformation; /* TIP #280 */
+ (void)cmdPtr;
if (parsePtr->numWords != 2) {
return TCL_ERROR;
@@ -1312,6 +1327,7 @@ TclCompileLrangeCmd(
Tcl_Token *tokenPtr, *listTokenPtr;
DefineLineInformation; /* TIP #280 */
int idx1, idx2;
+ (void)cmdPtr;
if (parsePtr->numWords != 4) {
return TCL_ERROR;
@@ -1373,6 +1389,7 @@ TclCompileLinsertCmd(
Tcl_Token *tokenPtr, *listTokenPtr;
DefineLineInformation; /* TIP #280 */
int idx, i;
+ (void)cmdPtr;
if (parsePtr->numWords < 3) {
return TCL_ERROR;
@@ -1477,6 +1494,7 @@ TclCompileLreplaceCmd(
DefineLineInformation; /* TIP #280 */
int idx1, idx2, i;
int emptyPrefix=1, suffixStart = 0;
+ (void)cmdPtr;
if (parsePtr->numWords < 4) {
return TCL_ERROR;
@@ -1645,6 +1663,7 @@ TclCompileLsetCmd(
int isScalar; /* Flag == 1 if scalar, 0 if array. */
int i;
DefineLineInformation; /* TIP #280 */
+ (void)cmdPtr;
/*
* Check argument count.
@@ -1777,13 +1796,15 @@ TclCompileLsetCmd(
int
TclCompileNamespaceCurrentCmd(
- Tcl_Interp *interp, /* Used for error reporting. */
+ Tcl_Interp *dummy, /* Used for error reporting. */
Tcl_Parse *parsePtr, /* Points to a parse structure for the command
* created by Tcl_ParseCommand. */
Command *cmdPtr, /* Points to defintion of command being
* compiled. */
CompileEnv *envPtr) /* Holds resulting instructions. */
{
+ (void)dummy;
+ (void)cmdPtr;
/*
* Only compile [namespace current] without arguments.
*/
@@ -1811,6 +1832,7 @@ TclCompileNamespaceCodeCmd(
{
Tcl_Token *tokenPtr;
DefineLineInformation; /* TIP #280 */
+ (void)cmdPtr;
if (parsePtr->numWords != 2) {
return TCL_ERROR;
@@ -1861,6 +1883,7 @@ TclCompileNamespaceOriginCmd(
{
Tcl_Token *tokenPtr;
DefineLineInformation; /* TIP #280 */
+ (void)cmdPtr;
if (parsePtr->numWords != 2) {
return TCL_ERROR;
@@ -1884,6 +1907,7 @@ TclCompileNamespaceQualifiersCmd(
Tcl_Token *tokenPtr = TokenAfter(parsePtr->tokenPtr);
DefineLineInformation; /* TIP #280 */
int off;
+ (void)cmdPtr;
if (parsePtr->numWords != 2) {
return TCL_ERROR;
@@ -1920,6 +1944,7 @@ TclCompileNamespaceTailCmd(
Tcl_Token *tokenPtr = TokenAfter(parsePtr->tokenPtr);
DefineLineInformation; /* TIP #280 */
JumpFixup jumpFixup;
+ (void)cmdPtr;
if (parsePtr->numWords != 2) {
return TCL_ERROR;
@@ -1957,6 +1982,7 @@ TclCompileNamespaceUpvarCmd(
Tcl_Token *tokenPtr, *otherTokenPtr, *localTokenPtr;
int localIndex, numWords, i;
DefineLineInformation; /* TIP #280 */
+ (void)cmdPtr;
if (envPtr->procPtr == NULL) {
return TCL_ERROR;
@@ -2018,6 +2044,7 @@ TclCompileNamespaceWhichCmd(
DefineLineInformation; /* TIP #280 */
Tcl_Token *tokenPtr, *opt;
int idx;
+ (void)cmdPtr;
if (parsePtr->numWords < 2 || parsePtr->numWords > 3) {
return TCL_ERROR;
@@ -2085,6 +2112,7 @@ TclCompileRegexpCmd(
int i, nocase, exact, sawLast, simple;
const char *str;
DefineLineInformation; /* TIP #280 */
+ (void)cmdPtr;
/*
* We are only interested in compiling simple regexp cases. Currently
@@ -2272,6 +2300,7 @@ TclCompileRegsubCmd(
const char *bytes;
int exact, quantified, result = TCL_ERROR;
size_t len;
+ (void)cmdPtr;
if (parsePtr->numWords < 5 || parsePtr->numWords > 6) {
return TCL_ERROR;
@@ -2432,6 +2461,7 @@ TclCompileReturnCmd(
Tcl_Obj *returnOpts, **objv;
Tcl_Token *wordTokenPtr = TokenAfter(parsePtr->tokenPtr);
DefineLineInformation; /* TIP #280 */
+ (void)cmdPtr;
/*
* Check for special case which can always be compiled:
@@ -2458,7 +2488,7 @@ TclCompileReturnCmd(
* Allocate some working space.
*/
- objv = TclStackAlloc(interp, numOptionWords * sizeof(Tcl_Obj *));
+ objv = (Tcl_Obj **)TclStackAlloc(interp, numOptionWords * sizeof(Tcl_Obj *));
/*
* Scan through the return options. If any are unknown at compile time,
@@ -2677,6 +2707,7 @@ TclCompileUpvarCmd(
int localIndex, numWords, i;
DefineLineInformation; /* TIP #280 */
Tcl_Obj *objPtr;
+ (void)cmdPtr;
if (envPtr->procPtr == NULL) {
return TCL_ERROR;
@@ -2783,6 +2814,7 @@ TclCompileVariableCmd(
Tcl_Token *varTokenPtr, *valueTokenPtr;
int localIndex, numWords, i;
DefineLineInformation; /* TIP #280 */
+ (void)cmdPtr;
numWords = parsePtr->numWords;
if (numWords < 2) {
@@ -2858,7 +2890,7 @@ TclCompileVariableCmd(
static int
IndexTailVarIfKnown(
- Tcl_Interp *interp,
+ Tcl_Interp *dummy,
Tcl_Token *varTokenPtr, /* Token representing the variable name */
CompileEnv *envPtr) /* Holds resulting instructions. */
{
@@ -2868,6 +2900,7 @@ IndexTailVarIfKnown(
size_t len;
Tcl_Token *lastTokenPtr;
int full, localIndex;
+ (void)dummy;
/*
* Determine if the tail is (a) known at compile time, and (b) not an
@@ -2958,6 +2991,7 @@ TclCompileObjectNextCmd(
DefineLineInformation; /* TIP #280 */
Tcl_Token *tokenPtr = parsePtr->tokenPtr;
int i;
+ (void)cmdPtr;
if (parsePtr->numWords > 255) {
return TCL_ERROR;
@@ -2983,6 +3017,7 @@ TclCompileObjectNextToCmd(
DefineLineInformation; /* TIP #280 */
Tcl_Token *tokenPtr = parsePtr->tokenPtr;
int i;
+ (void)cmdPtr;
if (parsePtr->numWords < 2 || parsePtr->numWords > 255) {
return TCL_ERROR;
@@ -2998,13 +3033,15 @@ TclCompileObjectNextToCmd(
int
TclCompileObjectSelfCmd(
- Tcl_Interp *interp, /* Used for error reporting. */
+ Tcl_Interp *dummy, /* Used for error reporting. */
Tcl_Parse *parsePtr, /* Points to a parse structure for the command
* created by Tcl_ParseCommand. */
Command *cmdPtr, /* Points to defintion of command being
* compiled. */
CompileEnv *envPtr) /* Holds resulting instructions. */
{
+ (void)dummy;
+ (void)cmdPtr;
/*
* We only handle [self] and [self object] (which is the same operation).
* These are the only very common operations on [self] for which
diff --git a/generic/tclCompCmdsSZ.c b/generic/tclCompCmdsSZ.c
index eda991b..9731280 100644
--- a/generic/tclCompCmdsSZ.c
+++ b/generic/tclCompCmdsSZ.c
@@ -45,13 +45,12 @@ static int CompileUnaryOpCmd(Tcl_Interp *interp,
CompileEnv *envPtr);
static void IssueSwitchChainedTests(Tcl_Interp *interp,
CompileEnv *envPtr, int mode, int noCase,
- int valueIndex, int numWords,
- Tcl_Token **bodyToken, int *bodyLines,
- int **bodyNext);
-static void IssueSwitchJumpTable(Tcl_Interp *interp,
- CompileEnv *envPtr, int valueIndex,
int numWords, Tcl_Token **bodyToken,
- int *bodyLines, int **bodyContLines);
+ int *bodyLines, int **bodyNext);
+static void IssueSwitchJumpTable(Tcl_Interp *interp,
+ CompileEnv *envPtr, int numWords,
+ Tcl_Token **bodyToken, int *bodyLines,
+ int **bodyContLines);
static int IssueTryClausesInstructions(Tcl_Interp *interp,
CompileEnv *envPtr, Tcl_Token *bodyToken,
int numHandlers, int *matchCodes,
@@ -138,6 +137,7 @@ TclCompileSetCmd(
Tcl_Token *varTokenPtr, *valueTokenPtr;
int isAssignment, isScalar, localIndex, numWords;
DefineLineInformation; /* TIP #280 */
+ (void)cmdPtr;
numWords = parsePtr->numWords;
if ((numWords != 2) && (numWords != 3)) {
@@ -233,6 +233,7 @@ TclCompileStringCatCmd(
Tcl_Token *wordTokenPtr;
Tcl_Obj *obj, *folded;
DefineLineInformation; /* TIP #280 */
+ (void)cmdPtr;
/* Trivial case, no arg */
@@ -303,6 +304,7 @@ TclCompileStringCmpCmd(
{
DefineLineInformation; /* TIP #280 */
Tcl_Token *tokenPtr;
+ (void)cmdPtr;
/*
* We don't support any flags; the bytecode isn't that sophisticated.
@@ -335,6 +337,7 @@ TclCompileStringEqualCmd(
{
DefineLineInformation; /* TIP #280 */
Tcl_Token *tokenPtr;
+ (void)cmdPtr;
/*
* We don't support any flags; the bytecode isn't that sophisticated.
@@ -367,6 +370,7 @@ TclCompileStringFirstCmd(
{
DefineLineInformation; /* TIP #280 */
Tcl_Token *tokenPtr;
+ (void)cmdPtr;
/*
* We don't support any flags; the bytecode isn't that sophisticated.
@@ -399,6 +403,7 @@ TclCompileStringLastCmd(
{
DefineLineInformation; /* TIP #280 */
Tcl_Token *tokenPtr;
+ (void)cmdPtr;
/*
* We don't support any flags; the bytecode isn't that sophisticated.
@@ -431,6 +436,7 @@ TclCompileStringIndexCmd(
{
DefineLineInformation; /* TIP #280 */
Tcl_Token *tokenPtr;
+ (void)cmdPtr;
if (parsePtr->numWords != 3) {
return TCL_ERROR;
@@ -460,6 +466,7 @@ TclCompileStringInsertCmd(
Tcl_Token *tokenPtr;
DefineLineInformation; /* TIP #280 */
int idx;
+ (void)cmdPtr;
if (parsePtr->numWords != 4) {
return TCL_ERROR;
@@ -887,6 +894,7 @@ TclCompileStringLenCmd(
DefineLineInformation; /* TIP #280 */
Tcl_Token *tokenPtr;
Tcl_Obj *objPtr;
+ (void)cmdPtr;
if (parsePtr->numWords != 2) {
return TCL_ERROR;
@@ -991,6 +999,7 @@ TclCompileStringRangeCmd(
DefineLineInformation; /* TIP #280 */
Tcl_Token *stringTokenPtr, *fromTokenPtr, *toTokenPtr;
int idx1, idx2;
+ (void)cmdPtr;
if (parsePtr->numWords != 4) {
return TCL_ERROR;
@@ -1067,6 +1076,7 @@ TclCompileStringReplaceCmd(
Tcl_Token *tokenPtr, *valueTokenPtr;
DefineLineInformation; /* TIP #280 */
int first, last;
+ (void)cmdPtr;
if (parsePtr->numWords < 4 || parsePtr->numWords > 5) {
return TCL_ERROR;
@@ -1265,6 +1275,7 @@ TclCompileStringTrimLCmd(
{
DefineLineInformation; /* TIP #280 */
Tcl_Token *tokenPtr;
+ (void)cmdPtr;
if (parsePtr->numWords != 2 && parsePtr->numWords != 3) {
return TCL_ERROR;
@@ -1293,6 +1304,7 @@ TclCompileStringTrimRCmd(
{
DefineLineInformation; /* TIP #280 */
Tcl_Token *tokenPtr;
+ (void)cmdPtr;
if (parsePtr->numWords != 2 && parsePtr->numWords != 3) {
return TCL_ERROR;
@@ -1321,6 +1333,7 @@ TclCompileStringTrimCmd(
{
DefineLineInformation; /* TIP #280 */
Tcl_Token *tokenPtr;
+ (void)cmdPtr;
if (parsePtr->numWords != 2 && parsePtr->numWords != 3) {
return TCL_ERROR;
@@ -1475,12 +1488,13 @@ TclCompileSubstCmd(
Tcl_Token *wordTokenPtr = TokenAfter(parsePtr->tokenPtr);
int code = TCL_ERROR;
DefineLineInformation; /* TIP #280 */
+ (void)cmdPtr;
if (numArgs == 0) {
return TCL_ERROR;
}
- objv = TclStackAlloc(interp, /*numArgs*/ numOpts * sizeof(Tcl_Obj *));
+ objv = (Tcl_Obj **)TclStackAlloc(interp, /*numArgs*/ numOpts * sizeof(Tcl_Obj *));
for (objc = 0; objc < /*numArgs*/ numOpts; objc++) {
objv[objc] = Tcl_NewObj();
@@ -1821,6 +1835,7 @@ TclCompileSwitchCmd(
int result = TCL_ERROR;
DefineLineInformation; /* TIP #280 */
int *clNext = envPtr->clNext;
+ (void)cmdPtr;
/*
* Only handle the following versions:
@@ -1975,10 +1990,10 @@ TclCompileSwitchCmd(
if (maxLen < 2) {
return TCL_ERROR;
}
- bodyTokenArray = Tcl_Alloc(sizeof(Tcl_Token) * maxLen);
- bodyToken = Tcl_Alloc(sizeof(Tcl_Token *) * maxLen);
- bodyLines = Tcl_Alloc(sizeof(int) * maxLen);
- bodyContLines = Tcl_Alloc(sizeof(int*) * maxLen);
+ bodyTokenArray = (Tcl_Token *)Tcl_Alloc(sizeof(Tcl_Token) * maxLen);
+ bodyToken = (Tcl_Token **)Tcl_Alloc(sizeof(Tcl_Token *) * maxLen);
+ bodyLines = (int *)Tcl_Alloc(sizeof(int) * maxLen);
+ bodyContLines = (int **)Tcl_Alloc(sizeof(int*) * maxLen);
bline = mapPtr->loc[eclIndex].line[valueIndex+1];
numWords = 0;
@@ -2037,9 +2052,9 @@ TclCompileSwitchCmd(
* Multi-word definition of patterns & actions.
*/
- bodyToken = Tcl_Alloc(sizeof(Tcl_Token *) * numWords);
- bodyLines = Tcl_Alloc(sizeof(int) * numWords);
- bodyContLines = Tcl_Alloc(sizeof(int*) * numWords);
+ bodyToken = (Tcl_Token **)Tcl_Alloc(sizeof(Tcl_Token *) * numWords);
+ bodyLines = (int *)Tcl_Alloc(sizeof(int) * numWords);
+ bodyContLines = (int **)Tcl_Alloc(sizeof(int*) * numWords);
bodyTokenArray = NULL;
for (i=0 ; i<numWords ; i++) {
/*
@@ -2085,10 +2100,10 @@ TclCompileSwitchCmd(
CompileWord(envPtr, valueTokenPtr, interp, valueIndex);
if (mode == Switch_Exact) {
- IssueSwitchJumpTable(interp, envPtr, valueIndex, numWords, bodyToken,
+ IssueSwitchJumpTable(interp, envPtr, numWords, bodyToken,
bodyLines, bodyContLines);
} else {
- IssueSwitchChainedTests(interp, envPtr, mode, noCase, valueIndex,
+ IssueSwitchChainedTests(interp, envPtr, mode, noCase,
numWords, bodyToken, bodyLines, bodyContLines);
}
result = TCL_OK;
@@ -2129,7 +2144,6 @@ IssueSwitchChainedTests(
CompileEnv *envPtr, /* Holds resulting instructions. */
int mode, /* Exact, Glob or Regexp */
int noCase, /* Case-insensitivity flag. */
- int valueIndex, /* The value to match against. */
int numBodyTokens, /* Number of tokens describing things the
* switch can match against and bodies to
* execute when the match succeeds. */
@@ -2159,8 +2173,8 @@ IssueSwitchChainedTests(
contFixIndex = -1;
contFixCount = 0;
- fixupArray = TclStackAlloc(interp, sizeof(JumpFixup) * numBodyTokens);
- fixupTargetArray = TclStackAlloc(interp, sizeof(int) * numBodyTokens);
+ fixupArray = (JumpFixup *)TclStackAlloc(interp, sizeof(JumpFixup) * numBodyTokens);
+ fixupTargetArray = (unsigned int *)TclStackAlloc(interp, sizeof(int) * numBodyTokens);
memset(fixupTargetArray, 0, numBodyTokens * sizeof(int));
fixupCount = 0;
foundDefault = 0;
@@ -2378,7 +2392,6 @@ static void
IssueSwitchJumpTable(
Tcl_Interp *interp, /* Context for compiling script bodies. */
CompileEnv *envPtr, /* Holds resulting instructions. */
- int valueIndex, /* The value to match against. */
int numBodyTokens, /* Number of tokens describing things the
* switch can match against and bodies to
* execute when the match succeeds. */
@@ -2403,10 +2416,10 @@ IssueSwitchJumpTable(
* Start by allocating the jump table itself, plus some workspace.
*/
- jtPtr = Tcl_Alloc(sizeof(JumptableInfo));
+ jtPtr = (JumptableInfo *)Tcl_Alloc(sizeof(JumptableInfo));
Tcl_InitHashTable(&jtPtr->hashTable, TCL_STRING_KEYS);
infoIndex = TclCreateAuxData(jtPtr, &tclJumptableInfoType, envPtr);
- finalFixups = TclStackAlloc(interp, sizeof(int) * (numBodyTokens/2));
+ finalFixups = (int *)TclStackAlloc(interp, sizeof(int) * (numBodyTokens/2));
foundDefault = 0;
mustGenerate = 1;
@@ -2574,8 +2587,8 @@ static ClientData
DupJumptableInfo(
ClientData clientData)
{
- JumptableInfo *jtPtr = clientData;
- JumptableInfo *newJtPtr = Tcl_Alloc(sizeof(JumptableInfo));
+ JumptableInfo *jtPtr = (JumptableInfo *)clientData;
+ JumptableInfo *newJtPtr = (JumptableInfo *)Tcl_Alloc(sizeof(JumptableInfo));
Tcl_HashEntry *hPtr, *newHPtr;
Tcl_HashSearch search;
int isNew;
@@ -2594,7 +2607,7 @@ static void
FreeJumptableInfo(
ClientData clientData)
{
- JumptableInfo *jtPtr = clientData;
+ JumptableInfo *jtPtr = (JumptableInfo *)clientData;
Tcl_DeleteHashTable(&jtPtr->hashTable);
Tcl_Free(jtPtr);
@@ -2607,15 +2620,16 @@ PrintJumptableInfo(
ByteCode *codePtr,
unsigned int pcOffset)
{
- JumptableInfo *jtPtr = clientData;
+ JumptableInfo *jtPtr = (JumptableInfo *)clientData;
Tcl_HashEntry *hPtr;
Tcl_HashSearch search;
const char *keyPtr;
int offset, i = 0;
+ (void)codePtr;
hPtr = Tcl_FirstHashEntry(&jtPtr->hashTable, &search);
for (; hPtr ; hPtr = Tcl_NextHashEntry(&search)) {
- keyPtr = Tcl_GetHashKey(&jtPtr->hashTable, hPtr);
+ keyPtr = (const char *)Tcl_GetHashKey(&jtPtr->hashTable, hPtr);
offset = PTR2INT(Tcl_GetHashValue(hPtr));
if (i++) {
@@ -2636,16 +2650,18 @@ DisassembleJumptableInfo(
ByteCode *codePtr,
unsigned int pcOffset)
{
- JumptableInfo *jtPtr = clientData;
+ JumptableInfo *jtPtr = (JumptableInfo *)clientData;
Tcl_Obj *mapping = Tcl_NewObj();
Tcl_HashEntry *hPtr;
Tcl_HashSearch search;
const char *keyPtr;
int offset;
+ (void)codePtr;
+ (void)pcOffset;
hPtr = Tcl_FirstHashEntry(&jtPtr->hashTable, &search);
for (; hPtr ; hPtr = Tcl_NextHashEntry(&search)) {
- keyPtr = Tcl_GetHashKey(&jtPtr->hashTable, hPtr);
+ keyPtr = (const char *)Tcl_GetHashKey(&jtPtr->hashTable, hPtr);
offset = PTR2INT(Tcl_GetHashValue(hPtr));
Tcl_DictObjPut(NULL, mapping, Tcl_NewStringObj(keyPtr, -1),
Tcl_NewIntObj(offset));
@@ -2683,6 +2699,7 @@ TclCompileTailcallCmd(
DefineLineInformation; /* TIP #280 */
Tcl_Token *tokenPtr = parsePtr->tokenPtr;
int i;
+ (void)cmdPtr;
if (parsePtr->numWords < 2 || parsePtr->numWords > 256
|| envPtr->procPtr == NULL) {
@@ -2732,6 +2749,7 @@ TclCompileThrowCmd(
Tcl_Token *codeToken, *msgToken;
Tcl_Obj *objPtr;
int codeKnown, codeIsList, codeIsValid, len;
+ (void)cmdPtr;
if (numWords != 3) {
return TCL_ERROR;
@@ -2837,6 +2855,7 @@ TclCompileTryCmd(
Tcl_Obj **matchClauses = NULL;
int *matchCodes=NULL, *resultVarIndices=NULL, *optionVarIndices=NULL;
int i;
+ (void)cmdPtr;
if (numWords < 2) {
return TCL_ERROR;
@@ -2864,12 +2883,12 @@ TclCompileTryCmd(
numHandlers = numWords >> 2;
numWords -= numHandlers * 4;
if (numHandlers > 0) {
- handlerTokens = TclStackAlloc(interp, sizeof(Tcl_Token*)*numHandlers);
- matchClauses = TclStackAlloc(interp, sizeof(Tcl_Obj *) * numHandlers);
+ handlerTokens = (Tcl_Token**)TclStackAlloc(interp, sizeof(Tcl_Token*)*numHandlers);
+ matchClauses = (Tcl_Obj **)TclStackAlloc(interp, sizeof(Tcl_Obj *) * numHandlers);
memset(matchClauses, 0, sizeof(Tcl_Obj *) * numHandlers);
- matchCodes = TclStackAlloc(interp, sizeof(int) * numHandlers);
- resultVarIndices = TclStackAlloc(interp, sizeof(int) * numHandlers);
- optionVarIndices = TclStackAlloc(interp, sizeof(int) * numHandlers);
+ matchCodes = (int *)TclStackAlloc(interp, sizeof(int) * numHandlers);
+ resultVarIndices = (int *)TclStackAlloc(interp, sizeof(int) * numHandlers);
+ optionVarIndices = (int *)TclStackAlloc(interp, sizeof(int) * numHandlers);
for (i=0 ; i<numHandlers ; i++) {
Tcl_Obj *tmpObj, **objv;
@@ -3131,9 +3150,9 @@ IssueTryClausesInstructions(
* Slight overallocation, but reduces size of this function.
*/
- addrsToFix = TclStackAlloc(interp, sizeof(int)*numHandlers);
- forwardsToFix = TclStackAlloc(interp, sizeof(int)*numHandlers);
- noError = TclStackAlloc(interp, sizeof(int)*numHandlers);
+ addrsToFix = (int *)TclStackAlloc(interp, sizeof(int)*numHandlers);
+ forwardsToFix = (int *)TclStackAlloc(interp, sizeof(int)*numHandlers);
+ noError = (int *)TclStackAlloc(interp, sizeof(int)*numHandlers);
for (i=0 ; i<numHandlers ; i++) {
noError[i] = -1;
@@ -3343,8 +3362,8 @@ IssueTryClausesFinallyInstructions(
* Slight overallocation, but reduces size of this function.
*/
- addrsToFix = TclStackAlloc(interp, sizeof(int)*numHandlers);
- forwardsToFix = TclStackAlloc(interp, sizeof(int)*numHandlers);
+ addrsToFix = (int *)TclStackAlloc(interp, sizeof(int)*numHandlers);
+ forwardsToFix = (int *)TclStackAlloc(interp, sizeof(int)*numHandlers);
for (i=0 ; i<numHandlers ; i++) {
int noTrapError, trapError;
@@ -3646,6 +3665,7 @@ TclCompileUnsetCmd(
Tcl_Token *varTokenPtr;
int isScalar, localIndex, flags = 1, i, varCount = 0, haveFlags = 0;
DefineLineInformation; /* TIP #280 */
+ (void)cmdPtr;
/* TODO: Consider support for compiling expanded args. */
@@ -3788,6 +3808,7 @@ TclCompileWhileCmd(
* infinite loop. */
Tcl_Obj *boolObj;
DefineLineInformation; /* TIP #280 */
+ (void)cmdPtr;
if (parsePtr->numWords != 3) {
return TCL_ERROR;
@@ -3959,6 +3980,8 @@ TclCompileYieldCmd(
* compiled. */
CompileEnv *envPtr) /* Holds resulting instructions. */
{
+ (void)cmdPtr;
+
if (parsePtr->numWords < 1 || parsePtr->numWords > 2) {
return TCL_ERROR;
}
@@ -4005,6 +4028,7 @@ TclCompileYieldToCmd(
DefineLineInformation; /* TIP #280 */
Tcl_Token *tokenPtr = TokenAfter(parsePtr->tokenPtr);
int i;
+ (void)cmdPtr;
if (parsePtr->numWords < 2) {
return TCL_ERROR;
@@ -4252,6 +4276,7 @@ TclCompileInvertOpCmd(
* compiled. */
CompileEnv *envPtr)
{
+ (void)cmdPtr;
return CompileUnaryOpCmd(interp, parsePtr, INST_BITNOT, envPtr);
}
@@ -4263,6 +4288,7 @@ TclCompileNotOpCmd(
* compiled. */
CompileEnv *envPtr)
{
+ (void)cmdPtr;
return CompileUnaryOpCmd(interp, parsePtr, INST_LNOT, envPtr);
}
@@ -4274,6 +4300,7 @@ TclCompileAddOpCmd(
* compiled. */
CompileEnv *envPtr)
{
+ (void)cmdPtr;
return CompileAssociativeBinaryOpCmd(interp, parsePtr, "0", INST_ADD,
envPtr);
}
@@ -4286,6 +4313,7 @@ TclCompileMulOpCmd(
* compiled. */
CompileEnv *envPtr)
{
+ (void)cmdPtr;
return CompileAssociativeBinaryOpCmd(interp, parsePtr, "1", INST_MULT,
envPtr);
}
@@ -4298,6 +4326,7 @@ TclCompileAndOpCmd(
* compiled. */
CompileEnv *envPtr)
{
+ (void)cmdPtr;
return CompileAssociativeBinaryOpCmd(interp, parsePtr, "-1", INST_BITAND,
envPtr);
}
@@ -4310,6 +4339,7 @@ TclCompileOrOpCmd(
* compiled. */
CompileEnv *envPtr)
{
+ (void)cmdPtr;
return CompileAssociativeBinaryOpCmd(interp, parsePtr, "0", INST_BITOR,
envPtr);
}
@@ -4322,6 +4352,7 @@ TclCompileXorOpCmd(
* compiled. */
CompileEnv *envPtr)
{
+ (void)cmdPtr;
return CompileAssociativeBinaryOpCmd(interp, parsePtr, "0", INST_BITXOR,
envPtr);
}
@@ -4342,6 +4373,7 @@ TclCompilePowOpCmd(
Tcl_Token *tokenPtr = parsePtr->tokenPtr;
DefineLineInformation; /* TIP #280 */
int words;
+ (void)cmdPtr;
for (words=1 ; words<parsePtr->numWords ; words++) {
tokenPtr = TokenAfter(tokenPtr);
@@ -4365,6 +4397,7 @@ TclCompileLshiftOpCmd(
* compiled. */
CompileEnv *envPtr)
{
+ (void)cmdPtr;
return CompileStrictlyBinaryOpCmd(interp, parsePtr, INST_LSHIFT, envPtr);
}
@@ -4376,6 +4409,7 @@ TclCompileRshiftOpCmd(
* compiled. */
CompileEnv *envPtr)
{
+ (void)cmdPtr;
return CompileStrictlyBinaryOpCmd(interp, parsePtr, INST_RSHIFT, envPtr);
}
@@ -4387,6 +4421,7 @@ TclCompileModOpCmd(
* compiled. */
CompileEnv *envPtr)
{
+ (void)cmdPtr;
return CompileStrictlyBinaryOpCmd(interp, parsePtr, INST_MOD, envPtr);
}
@@ -4398,6 +4433,7 @@ TclCompileNeqOpCmd(
* compiled. */
CompileEnv *envPtr)
{
+ (void)cmdPtr;
return CompileStrictlyBinaryOpCmd(interp, parsePtr, INST_NEQ, envPtr);
}
@@ -4409,6 +4445,7 @@ TclCompileStrneqOpCmd(
* compiled. */
CompileEnv *envPtr)
{
+ (void)cmdPtr;
return CompileStrictlyBinaryOpCmd(interp, parsePtr, INST_STR_NEQ, envPtr);
}
@@ -4420,6 +4457,7 @@ TclCompileInOpCmd(
* compiled. */
CompileEnv *envPtr)
{
+ (void)cmdPtr;
return CompileStrictlyBinaryOpCmd(interp, parsePtr, INST_LIST_IN, envPtr);
}
@@ -4431,6 +4469,7 @@ TclCompileNiOpCmd(
* compiled. */
CompileEnv *envPtr)
{
+ (void)cmdPtr;
return CompileStrictlyBinaryOpCmd(interp, parsePtr, INST_LIST_NOT_IN,
envPtr);
}
@@ -4443,6 +4482,7 @@ TclCompileLessOpCmd(
* compiled. */
CompileEnv *envPtr)
{
+ (void)cmdPtr;
return CompileComparisonOpCmd(interp, parsePtr, INST_LT, envPtr);
}
@@ -4454,6 +4494,7 @@ TclCompileLeqOpCmd(
* compiled. */
CompileEnv *envPtr)
{
+ (void)cmdPtr;
return CompileComparisonOpCmd(interp, parsePtr, INST_LE, envPtr);
}
@@ -4465,6 +4506,7 @@ TclCompileGreaterOpCmd(
* compiled. */
CompileEnv *envPtr)
{
+ (void)cmdPtr;
return CompileComparisonOpCmd(interp, parsePtr, INST_GT, envPtr);
}
@@ -4476,6 +4518,7 @@ TclCompileGeqOpCmd(
* compiled. */
CompileEnv *envPtr)
{
+ (void)cmdPtr;
return CompileComparisonOpCmd(interp, parsePtr, INST_GE, envPtr);
}
@@ -4487,6 +4530,7 @@ TclCompileEqOpCmd(
* compiled. */
CompileEnv *envPtr)
{
+ (void)cmdPtr;
return CompileComparisonOpCmd(interp, parsePtr, INST_EQ, envPtr);
}
@@ -4498,6 +4542,7 @@ TclCompileStreqOpCmd(
* compiled. */
CompileEnv *envPtr)
{
+ (void)cmdPtr;
return CompileComparisonOpCmd(interp, parsePtr, INST_STR_EQ, envPtr);
}
@@ -4509,6 +4554,7 @@ TclCompileStrLtOpCmd(
* compiled. */
CompileEnv *envPtr)
{
+ (void)cmdPtr;
return CompileComparisonOpCmd(interp, parsePtr, INST_STR_LT, envPtr);
}
@@ -4520,6 +4566,7 @@ TclCompileStrLeOpCmd(
* compiled. */
CompileEnv *envPtr)
{
+ (void)cmdPtr;
return CompileComparisonOpCmd(interp, parsePtr, INST_STR_LE, envPtr);
}
@@ -4531,6 +4578,7 @@ TclCompileStrGtOpCmd(
* compiled. */
CompileEnv *envPtr)
{
+ (void)cmdPtr;
return CompileComparisonOpCmd(interp, parsePtr, INST_STR_GT, envPtr);
}
@@ -4542,6 +4590,7 @@ TclCompileStrGeOpCmd(
* compiled. */
CompileEnv *envPtr)
{
+ (void)cmdPtr;
return CompileComparisonOpCmd(interp, parsePtr, INST_STR_GE, envPtr);
}
@@ -4556,6 +4605,7 @@ TclCompileMinusOpCmd(
Tcl_Token *tokenPtr = parsePtr->tokenPtr;
DefineLineInformation; /* TIP #280 */
int words;
+ (void)cmdPtr;
/* TODO: Consider support for compiling expanded args. */
if (parsePtr->numWords == 1) {
@@ -4602,6 +4652,7 @@ TclCompileDivOpCmd(
Tcl_Token *tokenPtr = parsePtr->tokenPtr;
DefineLineInformation; /* TIP #280 */
int words;
+ (void)cmdPtr;
/* TODO: Consider support for compiling expanded args. */
if (parsePtr->numWords == 1) {
diff --git a/generic/tclCompExpr.c b/generic/tclCompExpr.c
index 4cbabbf..73b2ab3 100644
--- a/generic/tclCompExpr.c
+++ b/generic/tclCompExpr.c
@@ -631,7 +631,7 @@ ParseExpr(
TclParseInit(interp, start, numBytes, parsePtr);
- nodes = Tcl_AttemptAlloc(nodesAvailable * sizeof(OpNode));
+ nodes = (OpNode *)Tcl_AttemptAlloc(nodesAvailable * sizeof(OpNode));
if (nodes == NULL) {
TclNewLiteralStringObj(msg, "not enough memory to parse expression");
errCode = "NOMEM";
@@ -675,7 +675,7 @@ ParseExpr(
do {
if (size <= UINT_MAX/sizeof(OpNode)) {
- newPtr = Tcl_AttemptRealloc(nodes, size * sizeof(OpNode));
+ newPtr = (OpNode *)Tcl_AttemptRealloc(nodes, size * sizeof(OpNode));
}
} while ((newPtr == NULL)
&& ((size -= (size - nodesUsed) / 2) > nodesUsed));
@@ -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 == TCL_AUTO_LENGTH) {
@@ -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)
@@ -2573,7 +2573,7 @@ TclSingleOpCmd(
int objc,
Tcl_Obj *const objv[])
{
- TclOpCmdClientData *occdPtr = clientData;
+ TclOpCmdClientData *occdPtr = (TclOpCmdClientData *)clientData;
unsigned char lexeme;
OpNode nodes[2];
Tcl_Obj *const *litObjv = objv + 1;
@@ -2631,10 +2631,10 @@ TclSortingOpCmd(
if (objc < 3) {
Tcl_SetObjResult(interp, Tcl_NewBooleanObj(1));
} else {
- TclOpCmdClientData *occdPtr = clientData;
- Tcl_Obj **litObjv = TclStackAlloc(interp,
+ TclOpCmdClientData *occdPtr = (TclOpCmdClientData *)clientData;
+ 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;
@@ -2706,7 +2706,7 @@ TclVariadicOpCmd(
int objc,
Tcl_Obj *const objv[])
{
- TclOpCmdClientData *occdPtr = clientData;
+ TclOpCmdClientData *occdPtr = (TclOpCmdClientData *)clientData;
unsigned char lexeme;
int code;
@@ -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;
@@ -2825,7 +2825,7 @@ TclNoIdentOpCmd(
int objc,
Tcl_Obj *const objv[])
{
- TclOpCmdClientData *occdPtr = clientData;
+ TclOpCmdClientData *occdPtr = (TclOpCmdClientData *)clientData;
if (objc < 2) {
Tcl_WrongNumArgs(interp, 1, objv, occdPtr->expected);
diff --git a/generic/tclCompile.c b/generic/tclCompile.c
index 35546c3..92c2261 100644
--- a/generic/tclCompile.c
+++ b/generic/tclCompile.c
@@ -946,6 +946,8 @@ DupByteCodeInternalRep(
Tcl_Obj *srcPtr, /* Object with internal rep to copy. */
Tcl_Obj *copyPtr) /* Object with internal rep to set. */
{
+ (void)srcPtr;
+ (void)copyPtr;
return;
}
@@ -1129,7 +1131,7 @@ CleanupByteCode(
(char *) codePtr);
if (hePtr) {
- ReleaseCmdWordData(Tcl_GetHashValue(hePtr));
+ ReleaseCmdWordData((ExtCmdLoc *)Tcl_GetHashValue(hePtr));
Tcl_DeleteHashEntry(hePtr);
}
}
@@ -1155,11 +1157,12 @@ CleanupByteCode(
static int
IsCompactibleCompileEnv(
- Tcl_Interp *interp,
+ Tcl_Interp *dummy,
CompileEnv *envPtr)
{
unsigned char *pc;
int size;
+ (void)dummy;
/*
* Special: procedures in the '::tcl' namespace (or its children) are
@@ -1479,7 +1482,7 @@ TclInitCompileEnv(
* non-compiling evaluator
*/
- envPtr->extCmdMapPtr = Tcl_Alloc(sizeof(ExtCmdLoc));
+ envPtr->extCmdMapPtr = (ExtCmdLoc *)Tcl_Alloc(sizeof(ExtCmdLoc));
envPtr->extCmdMapPtr->loc = NULL;
envPtr->extCmdMapPtr->nloc = 0;
envPtr->extCmdMapPtr->nuloc = 0;
@@ -1535,7 +1538,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;
@@ -2169,7 +2172,7 @@ TclCompileScript(
* many nested compilations (body enclosed in body) can cause abnormal
* program termination with a stack overflow exception, bug [fec0c17d39].
*/
- Tcl_Parse *parsePtr = Tcl_Alloc(sizeof(Tcl_Parse));
+ Tcl_Parse *parsePtr = (Tcl_Parse *)Tcl_Alloc(sizeof(Tcl_Parse));
do {
const char *next;
@@ -2428,7 +2431,7 @@ TclCompileTokens(
if (isLiteral) {
maxNumCL = NUM_STATIC_POS;
- clPosition = Tcl_Alloc(maxNumCL * sizeof(int));
+ clPosition = (int *)Tcl_Alloc(maxNumCL * sizeof(int));
}
adjust = 0;
@@ -2469,7 +2472,7 @@ TclCompileTokens(
if (numCL >= maxNumCL) {
maxNumCL *= 2;
- clPosition = Tcl_Realloc(clPosition,
+ clPosition = (int *)Tcl_Realloc(clPosition,
maxNumCL * sizeof(int));
}
clPosition[numCL] = clPos;
@@ -2726,6 +2729,7 @@ TclCompileNoOp(
{
Tcl_Token *tokenPtr;
int i;
+ (void)cmdPtr;
tokenPtr = parsePtr->tokenPtr;
for (i = 1; i < parsePtr->numWords; i++) {
@@ -2843,7 +2847,7 @@ TclInitByteCode(
namespacePtr = envPtr->iPtr->globalNsPtr;
}
- p = Tcl_Alloc(structureSize);
+ p = (unsigned char *)Tcl_Alloc(structureSize);
codePtr = (ByteCode *) p;
codePtr->interpHandle = TclHandlePreserve(iPtr->handle);
codePtr->compileEpoch = iPtr->compileEpoch;
@@ -3055,7 +3059,7 @@ TclFindCompiledLocal(
if (create || (name == NULL)) {
localVar = procPtr->numCompiledLocals;
- localPtr = Tcl_Alloc(offsetof(CompiledLocal, name) + nameBytes + 1);
+ localPtr = (CompiledLocal *)Tcl_Alloc(offsetof(CompiledLocal, name) + nameBytes + 1);
if (procPtr->firstLocalPtr == NULL) {
procPtr->firstLocalPtr = procPtr->lastLocalPtr = localPtr;
} else {
@@ -3105,7 +3109,7 @@ TclExpandCodeArray(
void *envArgPtr) /* Points to the CompileEnv whose code array
* must be enlarged. */
{
- CompileEnv *envPtr = envArgPtr;
+ CompileEnv *envPtr = (CompileEnv *)envArgPtr;
/* The CompileEnv containing the code array to
* be doubled in size. */
@@ -3119,14 +3123,14 @@ TclExpandCodeArray(
size_t newBytes = 2 * (envPtr->codeEnd - envPtr->codeStart);
if (envPtr->mallocedCodeArray) {
- envPtr->codeStart = Tcl_Realloc(envPtr->codeStart, newBytes);
+ envPtr->codeStart = (unsigned char *)Tcl_Realloc(envPtr->codeStart, newBytes);
} else {
/*
* envPtr->codeStart isn't a Tcl_Alloc'd pointer, so we must code a
* Tcl_Realloc equivalent for ourselves.
*/
- unsigned char *newPtr = Tcl_Alloc(newBytes);
+ unsigned char *newPtr = (unsigned char *)Tcl_Alloc(newBytes);
memcpy(newPtr, envPtr->codeStart, currBytes);
envPtr->codeStart = newPtr;
@@ -3186,14 +3190,14 @@ EnterCmdStartData(
size_t newBytes = newElems * sizeof(CmdLocation);
if (envPtr->mallocedCmdMap) {
- envPtr->cmdMapPtr = Tcl_Realloc(envPtr->cmdMapPtr, newBytes);
+ envPtr->cmdMapPtr = (CmdLocation *)Tcl_Realloc(envPtr->cmdMapPtr, newBytes);
} else {
/*
* envPtr->cmdMapPtr isn't a Tcl_Alloc'd pointer, so we must code a
* Tcl_Realloc equivalent for ourselves.
*/
- CmdLocation *newPtr = Tcl_Alloc(newBytes);
+ CmdLocation *newPtr = (CmdLocation *)Tcl_Alloc(newBytes);
memcpy(newPtr, envPtr->cmdMapPtr, currBytes);
envPtr->cmdMapPtr = newPtr;
@@ -3311,16 +3315,16 @@ EnterCmdWordData(
size_t newElems = (currElems ? 2*currElems : 1);
size_t newBytes = newElems * sizeof(ECL);
- eclPtr->loc = Tcl_Realloc(eclPtr->loc, newBytes);
+ eclPtr->loc = (ECL *)Tcl_Realloc(eclPtr->loc, newBytes);
eclPtr->nloc = newElems;
}
ePtr = &eclPtr->loc[eclPtr->nuloc];
ePtr->srcOffset = srcOffset;
- ePtr->line = Tcl_Alloc(numWords * sizeof(int));
- ePtr->next = Tcl_Alloc(numWords * sizeof(int *));
+ ePtr->line = (int *)Tcl_Alloc(numWords * sizeof(int));
+ ePtr->next = (int **)Tcl_Alloc(numWords * sizeof(int *));
ePtr->nline = numWords;
- wwlines = Tcl_Alloc(numWords * sizeof(int));
+ wwlines = (int *)Tcl_Alloc(numWords * sizeof(int));
last = cmd;
wordLine = line;
@@ -3389,17 +3393,17 @@ TclCreateExceptRange(
if (envPtr->mallocedExceptArray) {
envPtr->exceptArrayPtr =
- Tcl_Realloc(envPtr->exceptArrayPtr, newBytes);
+ (ExceptionRange *)Tcl_Realloc(envPtr->exceptArrayPtr, newBytes);
envPtr->exceptAuxArrayPtr =
- Tcl_Realloc(envPtr->exceptAuxArrayPtr, newBytes2);
+ (ExceptionAux *)Tcl_Realloc(envPtr->exceptAuxArrayPtr, newBytes2);
} else {
/*
* envPtr->exceptArrayPtr isn't a Tcl_Alloc'd pointer, so we must
* code a Tcl_Realloc equivalent for ourselves.
*/
- ExceptionRange *newPtr = Tcl_Alloc(newBytes);
- ExceptionAux *newPtr2 = Tcl_Alloc(newBytes2);
+ ExceptionRange *newPtr = (ExceptionRange *)Tcl_Alloc(newBytes);
+ ExceptionAux *newPtr2 = (ExceptionAux *)Tcl_Alloc(newBytes2);
memcpy(newPtr, envPtr->exceptArrayPtr, currBytes);
memcpy(newPtr2, envPtr->exceptAuxArrayPtr, currBytes2);
@@ -3502,11 +3506,11 @@ TclAddLoopBreakFixup(
auxPtr->allocBreakTargets *= 2;
auxPtr->allocBreakTargets += 2;
if (auxPtr->breakTargets) {
- auxPtr->breakTargets = Tcl_Realloc(auxPtr->breakTargets,
+ auxPtr->breakTargets = (unsigned int *)Tcl_Realloc(auxPtr->breakTargets,
sizeof(int) * auxPtr->allocBreakTargets);
} else {
auxPtr->breakTargets =
- Tcl_Alloc(sizeof(int) * auxPtr->allocBreakTargets);
+ (unsigned int *)Tcl_Alloc(sizeof(int) * auxPtr->allocBreakTargets);
}
}
auxPtr->breakTargets[auxPtr->numBreakTargets - 1] = CurrentOffset(envPtr);
@@ -3528,11 +3532,11 @@ TclAddLoopContinueFixup(
auxPtr->allocContinueTargets *= 2;
auxPtr->allocContinueTargets += 2;
if (auxPtr->continueTargets) {
- auxPtr->continueTargets = Tcl_Realloc(auxPtr->continueTargets,
+ auxPtr->continueTargets = (unsigned int *)Tcl_Realloc(auxPtr->continueTargets,
sizeof(int) * auxPtr->allocContinueTargets);
} else {
auxPtr->continueTargets =
- Tcl_Alloc(sizeof(int) * auxPtr->allocContinueTargets);
+ (unsigned int *)Tcl_Alloc(sizeof(int) * auxPtr->allocContinueTargets);
}
}
auxPtr->continueTargets[auxPtr->numContinueTargets - 1] =
@@ -3755,14 +3759,14 @@ TclCreateAuxData(
if (envPtr->mallocedAuxDataArray) {
envPtr->auxDataArrayPtr =
- Tcl_Realloc(envPtr->auxDataArrayPtr, newBytes);
+ (AuxData *)Tcl_Realloc(envPtr->auxDataArrayPtr, newBytes);
} else {
/*
* envPtr->auxDataArrayPtr isn't a Tcl_Alloc'd pointer, so we must
* code a Tcl_Realloc equivalent for ourselves.
*/
- AuxData *newPtr = Tcl_Alloc(newBytes);
+ AuxData *newPtr = (AuxData *)Tcl_Alloc(newBytes);
memcpy(newPtr, envPtr->auxDataArrayPtr, currBytes);
envPtr->auxDataArrayPtr = newPtr;
@@ -3844,14 +3848,14 @@ TclExpandJumpFixupArray(
size_t newBytes = newElems * sizeof(JumpFixup);
if (fixupArrayPtr->mallocedArray) {
- fixupArrayPtr->fixup = Tcl_Realloc(fixupArrayPtr->fixup, newBytes);
+ fixupArrayPtr->fixup = (JumpFixup *)Tcl_Realloc(fixupArrayPtr->fixup, newBytes);
} else {
/*
* fixupArrayPtr->fixup isn't a Tcl_Alloc'd pointer, so we must code a
* Tcl_Realloc equivalent for ourselves.
*/
- JumpFixup *newPtr = Tcl_Alloc(newBytes);
+ JumpFixup *newPtr = (JumpFixup *)Tcl_Alloc(newBytes);
memcpy(newPtr, fixupArrayPtr->fixup, currBytes);
fixupArrayPtr->fixup = newPtr;
diff --git a/generic/tclConfig.c b/generic/tclConfig.c
index 8393b9c..3e55897 100644
--- a/generic/tclConfig.c
+++ b/generic/tclConfig.c
@@ -79,11 +79,11 @@ Tcl_RegisterConfig(
Tcl_Obj *pDB, *pkgDict;
Tcl_DString cmdName;
const Tcl_Config *cfg;
- QCCD *cdPtr = Tcl_Alloc(sizeof(QCCD));
+ QCCD *cdPtr = (QCCD *)Tcl_Alloc(sizeof(QCCD));
cdPtr->interp = interp;
if (valEncoding) {
- cdPtr->encoding = Tcl_Alloc(strlen(valEncoding)+1);
+ cdPtr->encoding = (char *)Tcl_Alloc(strlen(valEncoding)+1);
strcpy(cdPtr->encoding, valEncoding);
} else {
cdPtr->encoding = NULL;
@@ -199,7 +199,7 @@ QueryConfigObjCmd(
int objc,
struct Tcl_Obj *const *objv)
{
- QCCD *cdPtr = clientData;
+ QCCD *cdPtr = (QCCD *)clientData;
Tcl_Obj *pkgName = cdPtr->pkg;
Tcl_Obj *pDB, *pkgDict, *val, *listPtr;
size_t n = 0;
@@ -327,7 +327,7 @@ static void
QueryConfigDelete(
ClientData clientData)
{
- QCCD *cdPtr = clientData;
+ QCCD *cdPtr = (QCCD *)clientData;
Tcl_Obj *pkgName = cdPtr->pkg;
Tcl_Obj *pDB = GetConfigDict(cdPtr->interp);
@@ -360,7 +360,7 @@ static Tcl_Obj *
GetConfigDict(
Tcl_Interp *interp)
{
- Tcl_Obj *pDB = Tcl_GetAssocData(interp, ASSOC_KEY, NULL);
+ Tcl_Obj *pDB = (Tcl_Obj *)Tcl_GetAssocData(interp, ASSOC_KEY, NULL);
if (pDB == NULL) {
pDB = Tcl_NewDictObj();
@@ -393,9 +393,10 @@ GetConfigDict(
static void
ConfigDictDeleteProc(
ClientData clientData, /* Pointer to Tcl_Obj. */
- Tcl_Interp *interp) /* Interpreter being deleted. */
+ Tcl_Interp *dummy) /* Interpreter being deleted. */
{
- Tcl_Obj *pDB = clientData;
+ Tcl_Obj *pDB = (Tcl_Obj *)clientData;
+ (void)dummy;
Tcl_DecrRefCount(pDB);
}
diff --git a/generic/tclDate.c b/generic/tclDate.c
index 2ffa93d..3efddd1 100644
--- a/generic/tclDate.c
+++ b/generic/tclDate.c
@@ -2744,7 +2744,7 @@ TclDatelex(
int
TclClockOldscanObjCmd(
- void *clientData, /* Unused */
+ void *dummy, /* Unused */
Tcl_Interp *interp, /* Tcl interpreter */
int objc, /* Count of paraneters */
Tcl_Obj *const *objv) /* Parameters */
@@ -2754,6 +2754,7 @@ TclClockOldscanObjCmd(
DateInfo dateInfo;
DateInfo* info = &dateInfo;
int status;
+ (void)dummy;
if (objc != 5) {
Tcl_WrongNumArgs(interp, 1, objv,
@@ -2858,7 +2859,7 @@ TclClockOldscanObjCmd(
if (yyHaveTime) {
Tcl_ListObjAppendElement(interp, result, Tcl_NewIntObj(
- ToSeconds(yyHour, yyMinutes, yySeconds, yyMeridian)));
+ ToSeconds(yyHour, yyMinutes, yySeconds, (MERIDIAN)yyMeridian)));
} else {
Tcl_ListObjAppendElement(interp, result, Tcl_NewObj());
}
diff --git a/generic/tclDecls.h b/generic/tclDecls.h
index bb8176f..ba18baf 100644
--- a/generic/tclDecls.h
+++ b/generic/tclDecls.h
@@ -3789,14 +3789,14 @@ extern const TclStubs *tclStubsPtr;
Tcl_DecrRefCount(*(statePtr))
#define Tcl_SetResult(interp, result, freeProc) \
do { \
- char *__result = result; \
+ const char *__result = result; \
Tcl_FreeProc *__freeProc = freeProc; \
Tcl_SetObjResult(interp, Tcl_NewStringObj(__result, -1)); \
if (__result != NULL && __freeProc != NULL && __freeProc != TCL_VOLATILE) { \
if (__freeProc == TCL_DYNAMIC) { \
- Tcl_Free(__result); \
+ Tcl_Free((char *)__result); \
} else { \
- (*__freeProc)(__result); \
+ (*__freeProc)((char *)__result); \
} \
} \
} while(0)
diff --git a/generic/tclDictObj.c b/generic/tclDictObj.c
index 544a6aa..8aa3c1f 100644
--- a/generic/tclDictObj.c
+++ b/generic/tclDictObj.c
@@ -179,7 +179,7 @@ const Tcl_ObjType tclDictType = {
do { \
const Tcl_ObjIntRep *irPtr; \
irPtr = TclFetchIntRep((objPtr), &tclDictType); \
- (dictRepPtr) = irPtr ? irPtr->twoPtrValue.ptr1 : NULL; \
+ (dictRepPtr) = irPtr ? (Dict *)irPtr->twoPtrValue.ptr1 : NULL; \
} while (0)
/*
@@ -245,8 +245,9 @@ AllocChainEntry(
{
Tcl_Obj *objPtr = (Tcl_Obj *)keyPtr;
ChainEntry *cPtr;
+ (void)tablePtr;
- cPtr = Tcl_Alloc(sizeof(ChainEntry));
+ cPtr = (ChainEntry *)Tcl_Alloc(sizeof(ChainEntry));
cPtr->entry.key.objPtr = objPtr;
Tcl_IncrRefCount(objPtr);
Tcl_SetHashValue(&cPtr->entry, NULL);
@@ -279,7 +280,7 @@ DeleteChainTable(
ChainEntry *cPtr;
for (cPtr=dict->entryChainHead ; cPtr!=NULL ; cPtr=cPtr->nextPtr) {
- Tcl_Obj *valuePtr = Tcl_GetHashValue(&cPtr->entry);
+ Tcl_Obj *valuePtr = (Tcl_Obj *)Tcl_GetHashValue(&cPtr->entry);
TclDecrRefCount(valuePtr);
}
@@ -326,7 +327,7 @@ DeleteChainEntry(
if (cPtr == NULL) {
return 0;
} else {
- Tcl_Obj *valuePtr = Tcl_GetHashValue(&cPtr->entry);
+ Tcl_Obj *valuePtr = (Tcl_Obj *)Tcl_GetHashValue(&cPtr->entry);
TclDecrRefCount(valuePtr);
}
@@ -377,7 +378,7 @@ DupDictInternalRep(
Tcl_Obj *srcPtr,
Tcl_Obj *copyPtr)
{
- Dict *oldDict, *newDict = Tcl_Alloc(sizeof(Dict));
+ Dict *oldDict, *newDict = (Dict *)Tcl_Alloc(sizeof(Dict));
ChainEntry *cPtr;
DictGetIntRep(srcPtr, oldDict);
@@ -388,8 +389,8 @@ DupDictInternalRep(
InitChainTable(newDict);
for (cPtr=oldDict->entryChainHead ; cPtr!=NULL ; cPtr=cPtr->nextPtr) {
- Tcl_Obj *key = Tcl_GetHashKey(&oldDict->table, &cPtr->entry);
- Tcl_Obj *valuePtr = Tcl_GetHashValue(&cPtr->entry);
+ Tcl_Obj *key = (Tcl_Obj *)Tcl_GetHashKey(&oldDict->table, &cPtr->entry);
+ Tcl_Obj *valuePtr = (Tcl_Obj *)Tcl_GetHashValue(&cPtr->entry);
int n;
Tcl_HashEntry *hPtr = CreateChainEntry(newDict, key, &n);
@@ -536,7 +537,7 @@ UpdateStringOfDict(
if (numElems <= LOCAL_SIZE) {
flagPtr = localFlags;
} else {
- flagPtr = Tcl_Alloc(numElems);
+ flagPtr = (char *)Tcl_Alloc(numElems);
}
for (i=0,cPtr=dict->entryChainHead; i<numElems; i+=2,cPtr=cPtr->nextPtr) {
/*
@@ -545,11 +546,11 @@ UpdateStringOfDict(
*/
flagPtr[i] = ( i ? TCL_DONT_QUOTE_HASH : 0 );
- keyPtr = Tcl_GetHashKey(&dict->table, &cPtr->entry);
+ keyPtr = (Tcl_Obj *)Tcl_GetHashKey(&dict->table, &cPtr->entry);
elem = TclGetStringFromObj(keyPtr, &length);
bytesNeeded += TclScanElement(elem, length, flagPtr+i);
flagPtr[i+1] = TCL_DONT_QUOTE_HASH;
- valuePtr = Tcl_GetHashValue(&cPtr->entry);
+ valuePtr = (Tcl_Obj *)Tcl_GetHashValue(&cPtr->entry);
elem = TclGetStringFromObj(valuePtr, &length);
bytesNeeded += TclScanElement(elem, length, flagPtr+i+1);
}
@@ -563,13 +564,13 @@ UpdateStringOfDict(
TclOOM(dst, bytesNeeded);
for (i=0,cPtr=dict->entryChainHead; i<numElems; i+=2,cPtr=cPtr->nextPtr) {
flagPtr[i] |= ( i ? TCL_DONT_QUOTE_HASH : 0 );
- keyPtr = Tcl_GetHashKey(&dict->table, &cPtr->entry);
+ keyPtr = (Tcl_Obj *)Tcl_GetHashKey(&dict->table, &cPtr->entry);
elem = TclGetStringFromObj(keyPtr, &length);
dst += TclConvertElement(elem, length, dst, flagPtr[i]);
*dst++ = ' ';
flagPtr[i+1] |= TCL_DONT_QUOTE_HASH;
- valuePtr = Tcl_GetHashValue(&cPtr->entry);
+ valuePtr = (Tcl_Obj *)Tcl_GetHashValue(&cPtr->entry);
elem = TclGetStringFromObj(valuePtr, &length);
dst += TclConvertElement(elem, length, dst, flagPtr[i+1]);
*dst++ = ' ';
@@ -608,7 +609,7 @@ SetDictFromAny(
{
Tcl_HashEntry *hPtr;
int isNew;
- Dict *dict = Tcl_Alloc(sizeof(Dict));
+ Dict *dict = (Dict *)Tcl_Alloc(sizeof(Dict));
InitChainTable(dict);
@@ -633,7 +634,7 @@ SetDictFromAny(
/* Store key and value in the hash table we're building. */
hPtr = CreateChainEntry(dict, objv[i], &isNew);
if (!isNew) {
- Tcl_Obj *discardedValue = Tcl_GetHashValue(hPtr);
+ Tcl_Obj *discardedValue = (Tcl_Obj *)Tcl_GetHashValue(hPtr);
/*
* Not really a well-formed dictionary as there are duplicate
@@ -707,7 +708,7 @@ SetDictFromAny(
/* Store key and value in the hash table we're building. */
hPtr = CreateChainEntry(dict, keyPtr, &isNew);
if (!isNew) {
- Tcl_Obj *discardedValue = Tcl_GetHashValue(hPtr);
+ Tcl_Obj *discardedValue = (Tcl_Obj *)Tcl_GetHashValue(hPtr);
TclDecrRefCount(keyPtr);
TclDecrRefCount(discardedValue);
@@ -842,7 +843,7 @@ TclTraceDictPath(
Tcl_IncrRefCount(tmpObj);
Tcl_SetHashValue(hPtr, tmpObj);
} else {
- tmpObj = Tcl_GetHashValue(hPtr);
+ tmpObj = (Tcl_Obj *)Tcl_GetHashValue(hPtr);
DictGetIntRep(tmpObj, newDict);
@@ -963,7 +964,7 @@ Tcl_DictObjPut(
DictSetIntRep(dictPtr, dict);
Tcl_IncrRefCount(valuePtr);
if (!isNew) {
- Tcl_Obj *oldValuePtr = Tcl_GetHashValue(hPtr);
+ Tcl_Obj *oldValuePtr = (Tcl_Obj *)Tcl_GetHashValue(hPtr);
TclDecrRefCount(oldValuePtr);
}
@@ -1012,7 +1013,7 @@ Tcl_DictObjGet(
if (hPtr == NULL) {
*valuePtrPtr = NULL;
} else {
- *valuePtrPtr = Tcl_GetHashValue(hPtr);
+ *valuePtrPtr = (Tcl_Obj *)Tcl_GetHashValue(hPtr);
}
return TCL_OK;
}
@@ -1153,10 +1154,10 @@ Tcl_DictObjFirst(
searchPtr->next = cPtr->nextPtr;
dict->refCount++;
if (keyPtrPtr != NULL) {
- *keyPtrPtr = Tcl_GetHashKey(&dict->table, &cPtr->entry);
+ *keyPtrPtr = (Tcl_Obj *)Tcl_GetHashKey(&dict->table, &cPtr->entry);
}
if (valuePtrPtr != NULL) {
- *valuePtrPtr = Tcl_GetHashValue(&cPtr->entry);
+ *valuePtrPtr = (Tcl_Obj *)Tcl_GetHashValue(&cPtr->entry);
}
}
return TCL_OK;
@@ -1219,7 +1220,7 @@ Tcl_DictObjNext(
Tcl_Panic("concurrent dictionary modification and search");
}
- cPtr = searchPtr->next;
+ cPtr = (ChainEntry *)searchPtr->next;
if (cPtr == NULL) {
Tcl_DictObjDone(searchPtr);
*donePtr = 1;
@@ -1229,11 +1230,11 @@ Tcl_DictObjNext(
searchPtr->next = cPtr->nextPtr;
*donePtr = 0;
if (keyPtrPtr != NULL) {
- *keyPtrPtr = Tcl_GetHashKey(
+ *keyPtrPtr = (Tcl_Obj *)Tcl_GetHashKey(
&((Dict *)searchPtr->dictionaryPtr)->table, &cPtr->entry);
}
if (valuePtrPtr != NULL) {
- *valuePtrPtr = Tcl_GetHashValue(&cPtr->entry);
+ *valuePtrPtr = (Tcl_Obj *)Tcl_GetHashValue(&cPtr->entry);
}
}
@@ -1320,7 +1321,7 @@ Tcl_DictObjPutKeyList(
hPtr = CreateChainEntry(dict, keyv[keyc-1], &isNew);
Tcl_IncrRefCount(valuePtr);
if (!isNew) {
- Tcl_Obj *oldValuePtr = Tcl_GetHashValue(hPtr);
+ Tcl_Obj *oldValuePtr = (Tcl_Obj *)Tcl_GetHashValue(hPtr);
TclDecrRefCount(oldValuePtr);
}
@@ -1415,7 +1416,7 @@ Tcl_NewDictObj(void)
TclNewObj(dictPtr);
TclInvalidateStringRep(dictPtr);
- dict = Tcl_Alloc(sizeof(Dict));
+ dict = (Dict *)Tcl_Alloc(sizeof(Dict));
InitChainTable(dict);
dict->epoch = 1;
dict->chain = NULL;
@@ -1463,7 +1464,7 @@ Tcl_DbNewDictObj(
TclDbNewObj(dictPtr, file, line);
TclInvalidateStringRep(dictPtr);
- dict = Tcl_Alloc(sizeof(Dict));
+ dict = (Dict *)Tcl_Alloc(sizeof(Dict));
InitChainTable(dict);
dict->epoch = 1;
dict->chain = NULL;
@@ -1471,6 +1472,8 @@ Tcl_DbNewDictObj(
DictSetIntRep(dictPtr, dict);
return dictPtr;
#else /* !TCL_MEM_DEBUG */
+ (void)file;
+ (void)line;
return Tcl_NewDictObj();
#endif
}
@@ -1497,13 +1500,14 @@ Tcl_DbNewDictObj(
static int
DictCreateCmd(
- ClientData dummy,
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp,
int objc,
Tcl_Obj *const *objv)
{
Tcl_Obj *dictObj;
int i;
+ (void)dummy;
/*
* Must have an even number of arguments; note that number of preceding
@@ -1547,13 +1551,14 @@ DictCreateCmd(
static int
DictGetCmd(
- ClientData dummy,
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp,
int objc,
Tcl_Obj *const *objv)
{
Tcl_Obj *dictPtr, *valuePtr = NULL;
int result;
+ (void)dummy;
if (objc < 2) {
Tcl_WrongNumArgs(interp, 1, objv, "dictionary ?key ...?");
@@ -1640,7 +1645,7 @@ DictGetCmd(
static int
DictGetDefCmd(
- ClientData dummy,
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp,
int objc,
Tcl_Obj *const *objv)
@@ -1648,6 +1653,7 @@ DictGetDefCmd(
Tcl_Obj *dictPtr, *keyPtr, *valuePtr, *defaultPtr;
Tcl_Obj *const *keyPath;
int numKeys;
+ (void)dummy;
if (objc < 4) {
Tcl_WrongNumArgs(interp, 1, objv, "dictionary ?key ...? key default");
@@ -1705,13 +1711,14 @@ DictGetDefCmd(
static int
DictReplaceCmd(
- ClientData dummy,
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp,
int objc,
Tcl_Obj *const *objv)
{
Tcl_Obj *dictPtr;
int i;
+ (void)dummy;
if ((objc < 2) || (objc & 1)) {
Tcl_WrongNumArgs(interp, 1, objv, "dictionary ?key value ...?");
@@ -1753,13 +1760,14 @@ DictReplaceCmd(
static int
DictRemoveCmd(
- ClientData dummy,
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp,
int objc,
Tcl_Obj *const *objv)
{
Tcl_Obj *dictPtr;
int i;
+ (void)dummy;
if (objc < 2) {
Tcl_WrongNumArgs(interp, 1, objv, "dictionary ?key ...?");
@@ -1801,7 +1809,7 @@ DictRemoveCmd(
static int
DictMergeCmd(
- ClientData dummy,
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp,
int objc,
Tcl_Obj *const *objv)
@@ -1810,6 +1818,7 @@ DictMergeCmd(
int allocatedDict = 0;
int i, done;
Tcl_DictSearch search;
+ (void)dummy;
if (objc == 1) {
/*
@@ -1888,13 +1897,14 @@ DictMergeCmd(
static int
DictKeysCmd(
- ClientData dummy,
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp,
int objc,
Tcl_Obj *const *objv)
{
Tcl_Obj *listPtr;
const char *pattern = NULL;
+ (void)dummy;
if (objc!=2 && objc!=3) {
Tcl_WrongNumArgs(interp, 1, objv, "dictionary ?pattern?");
@@ -1967,7 +1977,7 @@ DictKeysCmd(
static int
DictValuesCmd(
- ClientData dummy,
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp,
int objc,
Tcl_Obj *const *objv)
@@ -1976,6 +1986,7 @@ DictValuesCmd(
Tcl_DictSearch search;
int done;
const char *pattern;
+ (void)dummy;
if (objc!=2 && objc!=3) {
Tcl_WrongNumArgs(interp, 1, objv, "dictionary ?pattern?");
@@ -2027,12 +2038,13 @@ DictValuesCmd(
static int
DictSizeCmd(
- ClientData dummy,
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp,
int objc,
Tcl_Obj *const *objv)
{
int result, size;
+ (void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "dictionary");
@@ -2065,12 +2077,13 @@ DictSizeCmd(
static int
DictExistsCmd(
- ClientData dummy,
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp,
int objc,
Tcl_Obj *const *objv)
{
Tcl_Obj *dictPtr, *valuePtr;
+ (void)dummy;
if (objc < 3) {
Tcl_WrongNumArgs(interp, 1, objv, "dictionary key ?key ...?");
@@ -2107,13 +2120,14 @@ DictExistsCmd(
static int
DictInfoCmd(
- ClientData dummy,
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp,
int objc,
Tcl_Obj *const *objv)
{
Dict *dict;
char *statsStr;
+ (void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "dictionary");
@@ -2151,13 +2165,14 @@ DictInfoCmd(
static int
DictIncrCmd(
- ClientData dummy,
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp,
int objc,
Tcl_Obj *const *objv)
{
int code = TCL_OK;
Tcl_Obj *dictPtr, *valuePtr = NULL;
+ (void)dummy;
if (objc < 3 || objc > 4) {
Tcl_WrongNumArgs(interp, 1, objv, "dictVarName key ?increment?");
@@ -2271,13 +2286,14 @@ DictIncrCmd(
static int
DictLappendCmd(
- ClientData dummy,
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp,
int objc,
Tcl_Obj *const *objv)
{
Tcl_Obj *dictPtr, *valuePtr, *resultPtr;
int i, allocatedDict = 0, allocatedValue = 0;
+ (void)dummy;
if (objc < 3) {
Tcl_WrongNumArgs(interp, 1, objv, "dictVarName key ?value ...?");
@@ -2358,13 +2374,14 @@ DictLappendCmd(
static int
DictAppendCmd(
- ClientData dummy,
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp,
int objc,
Tcl_Obj *const *objv)
{
Tcl_Obj *dictPtr, *valuePtr, *resultPtr;
int allocatedDict = 0;
+ (void)dummy;
if (objc < 3) {
Tcl_WrongNumArgs(interp, 1, objv, "dictVarName key ?value ...?");
@@ -2460,7 +2477,7 @@ DictAppendCmd(
static int
DictForNRCmd(
- ClientData dummy,
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp,
int objc,
Tcl_Obj *const *objv)
@@ -2470,6 +2487,7 @@ DictForNRCmd(
Tcl_Obj **varv, *keyObj, *valueObj;
Tcl_DictSearch *searchPtr;
int varc, done;
+ (void)dummy;
if (objc != 4) {
Tcl_WrongNumArgs(interp, 1, objv,
@@ -2490,7 +2508,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);
@@ -2560,10 +2578,10 @@ DictForLoopCallback(
int result)
{
Interp *iPtr = (Interp *) interp;
- Tcl_DictSearch *searchPtr = data[0];
- Tcl_Obj *keyVarObj = data[1];
- Tcl_Obj *valueVarObj = data[2];
- Tcl_Obj *scriptObj = data[3];
+ Tcl_DictSearch *searchPtr = (Tcl_DictSearch *)data[0];
+ Tcl_Obj *keyVarObj = (Tcl_Obj *)data[1];
+ Tcl_Obj *valueVarObj = (Tcl_Obj *)data[2];
+ Tcl_Obj *scriptObj = (Tcl_Obj *)data[3];
Tcl_Obj *keyObj, *valueObj;
int done;
@@ -2655,7 +2673,7 @@ DictForLoopCallback(
static int
DictMapNRCmd(
- ClientData dummy,
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp,
int objc,
Tcl_Obj *const *objv)
@@ -2664,6 +2682,7 @@ DictMapNRCmd(
Tcl_Obj **varv, *keyObj, *valueObj;
DictMapStorage *storagePtr;
int varc, done;
+ (void)dummy;
if (objc != 4) {
Tcl_WrongNumArgs(interp, 1, objv,
@@ -2684,7 +2703,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);
@@ -2764,7 +2783,7 @@ DictMapLoopCallback(
int result)
{
Interp *iPtr = (Interp *) interp;
- DictMapStorage *storagePtr = data[0];
+ DictMapStorage *storagePtr = (DictMapStorage *)data[0];
Tcl_Obj *keyObj, *valueObj;
int done;
@@ -2867,13 +2886,14 @@ DictMapLoopCallback(
static int
DictSetCmd(
- ClientData dummy,
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp,
int objc,
Tcl_Obj *const *objv)
{
Tcl_Obj *dictPtr, *resultPtr;
int result, allocatedDict = 0;
+ (void)dummy;
if (objc < 4) {
Tcl_WrongNumArgs(interp, 1, objv, "dictVarName key ?key ...? value");
@@ -2927,13 +2947,14 @@ DictSetCmd(
static int
DictUnsetCmd(
- ClientData dummy,
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp,
int objc,
Tcl_Obj *const *objv)
{
Tcl_Obj *dictPtr, *resultPtr;
int result, allocatedDict = 0;
+ (void)dummy;
if (objc < 3) {
Tcl_WrongNumArgs(interp, 1, objv, "dictVarName key ?key ...?");
@@ -2986,7 +3007,7 @@ DictUnsetCmd(
static int
DictFilterCmd(
- ClientData dummy,
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp,
int objc,
Tcl_Obj *const *objv)
@@ -3003,6 +3024,7 @@ DictFilterCmd(
Tcl_DictSearch search;
int index, varc, done, result, satisfied;
const char *pattern;
+ (void)dummy;
if (objc < 3) {
Tcl_WrongNumArgs(interp, 1, objv, "dictionary filterType ?arg ...?");
@@ -3279,6 +3301,7 @@ DictUpdateCmd(
Interp *iPtr = (Interp *) interp;
Tcl_Obj *dictPtr, *objPtr;
int i, dummy;
+ (void)clientData;
if (objc < 5 || !(objc & 1)) {
Tcl_WrongNumArgs(interp, 1, objv,
@@ -3332,8 +3355,8 @@ FinalizeDictUpdate(
Tcl_Obj *dictPtr, *objPtr, **objv;
Tcl_InterpState state;
int i, objc;
- Tcl_Obj *varName = data[0];
- Tcl_Obj *argsObj = data[1];
+ Tcl_Obj *varName = (Tcl_Obj *)data[0];
+ Tcl_Obj *argsObj = (Tcl_Obj *)data[1];
/*
* ErrorInfo handling.
@@ -3429,13 +3452,14 @@ FinalizeDictUpdate(
static int
DictWithCmd(
- ClientData dummy,
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp,
int objc,
Tcl_Obj *const *objv)
{
Interp *iPtr = (Interp *) interp;
Tcl_Obj *dictPtr, *keysPtr, *pathPtr;
+ (void)dummy;
if (objc < 3) {
Tcl_WrongNumArgs(interp, 1, objv, "dictVarName ?key ...? script");
@@ -3483,9 +3507,9 @@ FinalizeDictWith(
Tcl_Obj **pathv;
int pathc;
Tcl_InterpState state;
- Tcl_Obj *varName = data[0];
- Tcl_Obj *keysPtr = data[1];
- Tcl_Obj *pathPtr = data[2];
+ Tcl_Obj *varName = (Tcl_Obj *)data[0];
+ Tcl_Obj *keysPtr = (Tcl_Obj *)data[1];
+ Tcl_Obj *pathPtr = (Tcl_Obj *)data[2];
Var *varPtr, *arrayPtr;
if (result == TCL_ERROR) {
diff --git a/generic/tclDisassemble.c b/generic/tclDisassemble.c
index a774ed2..b756e7f 100644
--- a/generic/tclDisassemble.c
+++ b/generic/tclDisassemble.c
@@ -23,8 +23,7 @@
static Tcl_Obj * DisassembleByteCodeAsDicts(Tcl_Interp *interp,
Tcl_Obj *objPtr);
-static Tcl_Obj * DisassembleByteCodeObj(Tcl_Interp *interp,
- Tcl_Obj *objPtr);
+static Tcl_Obj * DisassembleByteCodeObj(Tcl_Obj *objPtr);
static int FormatInstruction(ByteCode *codePtr,
const unsigned char *pc, Tcl_Obj *bufferObj);
static void GetLocationInformation(Proc *procPtr,
@@ -135,7 +134,7 @@ TclPrintByteCodeObj(
Tcl_Interp *interp, /* Used only for getting location info. */
Tcl_Obj *objPtr) /* The bytecode object to disassemble. */
{
- Tcl_Obj *bufPtr = DisassembleByteCodeObj(interp, objPtr);
+ Tcl_Obj *bufPtr = DisassembleByteCodeObj(objPtr);
fprintf(stdout, "\n%s", TclGetString(bufPtr));
Tcl_DecrRefCount(bufPtr);
@@ -251,7 +250,6 @@ TclPrintSource(
static Tcl_Obj *
DisassembleByteCodeObj(
- Tcl_Interp *interp,
Tcl_Obj *objPtr) /* The bytecode object to disassemble. */
{
ByteCode *codePtr;
@@ -951,8 +949,7 @@ PrintSourceToObj(
static Tcl_Obj *
DisassembleByteCodeAsDicts(
- Tcl_Interp *interp, /* Used for looking up the CmdFrame for the
- * procedure, if one exists. */
+ Tcl_Interp *dummy, /* Not used. */
Tcl_Obj *objPtr) /* The bytecode-holding value to take apart */
{
ByteCode *codePtr;
@@ -961,6 +958,7 @@ DisassembleByteCodeAsDicts(
unsigned char *pc, *opnd, *codeOffPtr, *codeLenPtr, *srcOffPtr, *srcLenPtr;
int codeOffset, codeLength, sourceOffset, sourceLength;
int i, val, line;
+ (void)dummy;
ByteCodeGetIntRep(objPtr, &tclByteCodeType, codePtr);
@@ -1576,7 +1574,7 @@ Tcl_DisassembleObjCmd(
TclGetString(objv[3]), NULL);
return TCL_ERROR;
}
- procPtr = TclOOGetProcFromMethod(Tcl_GetHashValue(hPtr));
+ procPtr = TclOOGetProcFromMethod((Method *)Tcl_GetHashValue(hPtr));
if (procPtr == NULL) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"body not available for this kind of method", -1));
@@ -1626,7 +1624,7 @@ Tcl_DisassembleObjCmd(
DisassembleByteCodeAsDicts(interp, codeObjPtr));
} else {
Tcl_SetObjResult(interp,
- DisassembleByteCodeObj(interp, codeObjPtr));
+ DisassembleByteCodeObj(codeObjPtr));
}
return TCL_OK;
}
diff --git a/generic/tclEncoding.c b/generic/tclEncoding.c
index bda075a..ff327e0 100644
--- a/generic/tclEncoding.c
+++ b/generic/tclEncoding.c
@@ -296,7 +296,7 @@ static const Tcl_ObjType encodingType = {
do { \
const Tcl_ObjIntRep *irPtr; \
irPtr = TclFetchIntRep ((objPtr), &encodingType); \
- (encoding) = irPtr ? irPtr->twoPtrValue.ptr1 : NULL; \
+ (encoding) = irPtr ? (Tcl_Encoding)irPtr->twoPtrValue.ptr1 : NULL; \
} while (0)
@@ -643,14 +643,14 @@ TclInitEncodingSubsystem(void)
* code to duplicate the structure of a table encoding here.
*/
- dataPtr = Tcl_Alloc(sizeof(TableEncodingData));
+ dataPtr = (TableEncodingData *)Tcl_Alloc(sizeof(TableEncodingData));
memset(dataPtr, 0, sizeof(TableEncodingData));
dataPtr->fallback = '?';
size = 256*(sizeof(unsigned short *) + sizeof(unsigned short));
- dataPtr->toUnicode = Tcl_Alloc(size);
+ dataPtr->toUnicode = (unsigned short **)Tcl_Alloc(size);
memset(dataPtr->toUnicode, 0, size);
- dataPtr->fromUnicode = Tcl_Alloc(size);
+ dataPtr->fromUnicode = (unsigned short **)Tcl_Alloc(size);
memset(dataPtr->fromUnicode, 0, size);
dataPtr->toUnicode[0] = (unsigned short *) (dataPtr->toUnicode + 256);
@@ -716,7 +716,7 @@ TclFinalizeEncodingSubsystem(void)
* cleaned up.
*/
- FreeEncoding(Tcl_GetHashValue(hPtr));
+ FreeEncoding((Tcl_Encoding)Tcl_GetHashValue(hPtr));
hPtr = Tcl_FirstHashEntry(&encodingTable, &search);
}
@@ -763,7 +763,7 @@ Tcl_GetEncoding(
hPtr = Tcl_FindHashEntry(&encodingTable, name);
if (hPtr != NULL) {
- encodingPtr = Tcl_GetHashValue(hPtr);
+ encodingPtr = (Encoding *)Tcl_GetHashValue(hPtr);
encodingPtr->refCount++;
Tcl_MutexUnlock(&encodingMutex);
return (Tcl_Encoding) encodingPtr;
@@ -908,7 +908,7 @@ Tcl_GetEncodingNames(
Tcl_MutexLock(&encodingMutex);
for (hPtr = Tcl_FirstHashEntry(&encodingTable, &search); hPtr != NULL;
hPtr = Tcl_NextHashEntry(&search)) {
- Encoding *encodingPtr = Tcl_GetHashValue(hPtr);
+ Encoding *encodingPtr = (Encoding *)Tcl_GetHashValue(hPtr);
Tcl_CreateHashEntry(&table,
Tcl_NewStringObj(encodingPtr->name, -1), &dummy);
@@ -1025,7 +1025,7 @@ Tcl_CreateEncoding(
const Tcl_EncodingType *typePtr)
/* The encoding type. */
{
- Encoding *encodingPtr = Tcl_Alloc(sizeof(Encoding));
+ Encoding *encodingPtr = (Encoding *)Tcl_Alloc(sizeof(Encoding));
encodingPtr->name = NULL;
encodingPtr->toUtfProc = typePtr->toUtfProc;
encodingPtr->fromUtfProc = typePtr->fromUtfProc;
@@ -1053,11 +1053,11 @@ Tcl_CreateEncoding(
* reference goes away.
*/
- Encoding *replaceMe = Tcl_GetHashValue(hPtr);
+ Encoding *replaceMe = (Encoding *)Tcl_GetHashValue(hPtr);
replaceMe->hPtr = NULL;
}
- name = Tcl_Alloc(strlen(typePtr->encodingName) + 1);
+ name = (char *)Tcl_Alloc(strlen(typePtr->encodingName) + 1);
encodingPtr->name = strcpy(name, typePtr->encodingName);
encodingPtr->hPtr = hPtr;
Tcl_SetHashValue(hPtr, encodingPtr);
@@ -1163,7 +1163,7 @@ Tcl_ExternalToUtfDString(
int
Tcl_ExternalToUtf(
- Tcl_Interp *interp, /* Interp for error return, if not NULL. */
+ Tcl_Interp *dummy, /* Interp for error return, if not NULL. */
Tcl_Encoding encoding, /* The encoding for the source string, or NULL
* for the default system encoding. */
const char *src, /* Source string in specified encoding. */
@@ -1197,6 +1197,7 @@ Tcl_ExternalToUtf(
int charLimited = (flags & TCL_ENCODING_CHAR_LIMIT) && dstCharsPtr;
int maxChars = INT_MAX;
Tcl_EncodingState state;
+ (void)dummy;
if (encoding == NULL) {
encoding = systemEncoding;
@@ -1355,7 +1356,7 @@ Tcl_UtfToExternalDString(
int
Tcl_UtfToExternal(
- Tcl_Interp *interp, /* Interp for error return, if not NULL. */
+ Tcl_Interp *dummy, /* Interp for error return, if not NULL. */
Tcl_Encoding encoding, /* The encoding for the converted string, or
* NULL for the default system encoding. */
const char *src, /* Source string in UTF-8. */
@@ -1386,6 +1387,7 @@ Tcl_UtfToExternal(
const Encoding *encodingPtr;
int result, srcRead, dstWrote, dstChars;
Tcl_EncodingState state;
+ (void)dummy;
if (encoding == NULL) {
encoding = systemEncoding;
@@ -1726,7 +1728,7 @@ LoadTableEncoding(
#undef PAGESIZE
#define PAGESIZE (256 * sizeof(unsigned short))
- dataPtr = Tcl_Alloc(sizeof(TableEncodingData));
+ dataPtr = (TableEncodingData *)Tcl_Alloc(sizeof(TableEncodingData));
memset(dataPtr, 0, sizeof(TableEncodingData));
dataPtr->fallback = fallback;
@@ -1738,7 +1740,7 @@ LoadTableEncoding(
*/
size = 256 * sizeof(unsigned short *) + numPages * PAGESIZE;
- dataPtr->toUnicode = Tcl_Alloc(size);
+ dataPtr->toUnicode = (unsigned short **)Tcl_Alloc(size);
memset(dataPtr->toUnicode, 0, size);
pageMemPtr = (unsigned short *) (dataPtr->toUnicode + 256);
@@ -1799,7 +1801,7 @@ LoadTableEncoding(
}
}
size = 256 * sizeof(unsigned short *) + numPages * PAGESIZE;
- dataPtr->fromUnicode = Tcl_Alloc(size);
+ dataPtr->fromUnicode = (unsigned short **)Tcl_Alloc(size);
memset(dataPtr->fromUnicode, 0, size);
pageMemPtr = (unsigned short *) (dataPtr->fromUnicode + 256);
@@ -1831,8 +1833,8 @@ LoadTableEncoding(
*/
if (dataPtr->fromUnicode[0] != NULL) {
- if (dataPtr->fromUnicode[0]['\\'] == '\0') {
- dataPtr->fromUnicode[0]['\\'] = '\\';
+ if (dataPtr->fromUnicode[0][(int)'\\'] == '\0') {
+ dataPtr->fromUnicode[0][(int)'\\'] = '\\';
}
}
}
@@ -2037,7 +2039,7 @@ LoadEscapeEncoding(
size = sizeof(EscapeEncodingData) - sizeof(EscapeSubTable)
+ Tcl_DStringLength(&escapeData);
- dataPtr = Tcl_Alloc(size);
+ dataPtr = (EscapeEncodingData *)Tcl_Alloc(size);
dataPtr->initLen = strlen(init);
memcpy(dataPtr->init, init, dataPtr->initLen + 1);
dataPtr->finalLen = strlen(final);
@@ -2116,6 +2118,8 @@ BinaryProc(
* output buffer. */
{
int result;
+ (void)clientData;
+ (void)statePtr;
result = TCL_OK;
dstLen -= TCL_UTF_MAX - 1;
@@ -2287,6 +2291,7 @@ UtfToUtfProc(
const char *dstStart, *dstEnd;
int result, numChars, charLimit = INT_MAX;
Tcl_UniChar *chPtr = (Tcl_UniChar *) statePtr;
+ (void)clientData;
if (flags & TCL_ENCODING_START) {
*statePtr = 0;
@@ -2418,6 +2423,7 @@ Utf16ToUtfProc(
const char *dstEnd, *dstStart;
int result, numChars, charLimit = INT_MAX;
unsigned short ch;
+ (void)statePtr;
if (flags & TCL_ENCODING_CHAR_LIMIT) {
charLimit = *dstCharsPtr;
@@ -2639,6 +2645,7 @@ UtfToUcs2Proc(
int len;
#endif
Tcl_UniChar ch = 0;
+ (void)statePtr;
srcStart = src;
srcEnd = src + srcLen;
@@ -2748,7 +2755,8 @@ TableToUtfProc(
Tcl_UniChar ch = 0;
const unsigned short *const *toUnicode;
const unsigned short *pageZero;
- TableEncodingData *dataPtr = clientData;
+ TableEncodingData *dataPtr = (TableEncodingData *)clientData;
+ (void)statePtr;
if (flags & TCL_ENCODING_CHAR_LIMIT) {
charLimit = *dstCharsPtr;
@@ -2859,8 +2867,9 @@ TableFromUtfProc(
const char *dstStart, *dstEnd, *prefixBytes;
Tcl_UniChar ch = 0;
int result, len, word, numChars;
- TableEncodingData *dataPtr = clientData;
+ TableEncodingData *dataPtr = (TableEncodingData *)clientData;
const unsigned short *const *fromUnicode;
+ (void)statePtr;
result = TCL_OK;
@@ -2983,6 +2992,8 @@ Iso88591ToUtfProc(
const char *srcStart, *srcEnd;
const char *dstEnd, *dstStart;
int result, numChars, charLimit = INT_MAX;
+ (void)clientData;
+ (void)statePtr;
if (flags & TCL_ENCODING_CHAR_LIMIT) {
charLimit = *dstCharsPtr;
@@ -3066,10 +3077,10 @@ Iso88591FromUtfProc(
{
const char *srcStart, *srcEnd, *srcClose;
const char *dstStart, *dstEnd;
- int result, numChars;
+ int result = TCL_OK, numChars;
Tcl_UniChar ch = 0;
-
- result = TCL_OK;
+ (void)clientData;
+ (void)statePtr;
srcStart = src;
srcEnd = src + srcLen;
@@ -3154,7 +3165,7 @@ TableFreeProc(
ClientData clientData) /* TableEncodingData that specifies
* encoding. */
{
- TableEncodingData *dataPtr = clientData;
+ TableEncodingData *dataPtr = (TableEncodingData *)clientData;
/*
* Make sure we aren't freeing twice on shutdown. [Bug 219314]
@@ -3212,7 +3223,7 @@ EscapeToUtfProc(
* correspond to the bytes stored in the
* output buffer. */
{
- EscapeEncodingData *dataPtr = clientData;
+ EscapeEncodingData *dataPtr = (EscapeEncodingData *)clientData;
const char *prefixBytes, *tablePrefixBytes, *srcStart, *srcEnd;
const unsigned short *const *tableToUnicode;
const Encoding *encodingPtr;
@@ -3348,7 +3359,7 @@ EscapeToUtfProc(
TableEncodingData *tableDataPtr;
encodingPtr = GetTableEncoding(dataPtr, state);
- tableDataPtr = encodingPtr->clientData;
+ tableDataPtr = (TableEncodingData *)encodingPtr->clientData;
tablePrefixBytes = tableDataPtr->prefixBytes;
tableToUnicode = (const unsigned short *const*)
tableDataPtr->toUnicode;
@@ -3426,7 +3437,7 @@ EscapeFromUtfProc(
* correspond to the bytes stored in the
* output buffer. */
{
- EscapeEncodingData *dataPtr = clientData;
+ EscapeEncodingData *dataPtr = (EscapeEncodingData *)clientData;
const Encoding *encodingPtr;
const char *srcStart, *srcEnd, *srcClose;
const char *dstStart, *dstEnd;
@@ -3467,7 +3478,7 @@ EscapeFromUtfProc(
}
encodingPtr = GetTableEncoding(dataPtr, state);
- tableDataPtr = encodingPtr->clientData;
+ tableDataPtr = (const TableEncodingData *)encodingPtr->clientData;
tablePrefixBytes = tableDataPtr->prefixBytes;
tableFromUnicode = (const unsigned short *const *)
tableDataPtr->fromUnicode;
@@ -3495,7 +3506,7 @@ EscapeFromUtfProc(
oldState = state;
for (state = 0; state < dataPtr->numSubTables; state++) {
encodingPtr = GetTableEncoding(dataPtr, state);
- tableDataPtr = encodingPtr->clientData;
+ tableDataPtr = (const TableEncodingData *)encodingPtr->clientData;
word = tableDataPtr->fromUnicode[(ch >> 8)][ch & 0xff];
if (word != 0) {
break;
@@ -3509,7 +3520,7 @@ EscapeFromUtfProc(
break;
}
encodingPtr = GetTableEncoding(dataPtr, state);
- tableDataPtr = encodingPtr->clientData;
+ tableDataPtr = (const TableEncodingData *)encodingPtr->clientData;
word = tableDataPtr->fallback;
}
@@ -3614,7 +3625,7 @@ EscapeFreeProc(
ClientData clientData) /* EscapeEncodingData that specifies
* encoding. */
{
- EscapeEncodingData *dataPtr = clientData;
+ EscapeEncodingData *dataPtr = (EscapeEncodingData *)clientData;
EscapeSubTable *subTablePtr;
int i;
@@ -3777,7 +3788,7 @@ InitializeEncodingSearchPath(
((Encoding *)(*encodingPtr))->refCount++;
}
bytes = TclGetStringFromObj(searchPathObj, lengthPtr);
- *valuePtr = Tcl_Alloc(*lengthPtr + 1);
+ *valuePtr = (char *)Tcl_Alloc(*lengthPtr + 1);
memcpy(*valuePtr, bytes, *lengthPtr + 1);
Tcl_DecrRefCount(searchPathObj);
}
diff --git a/generic/tclEnsemble.c b/generic/tclEnsemble.c
index 78ac26b..2bdd7ca 100644
--- a/generic/tclEnsemble.c
+++ b/generic/tclEnsemble.c
@@ -96,7 +96,7 @@ static const Tcl_ObjType ensembleCmdType = {
do { \
const Tcl_ObjIntRep *irPtr; \
irPtr = TclFetchIntRep((objPtr), &ensembleCmdType); \
- (ecRepPtr) = irPtr ? irPtr->twoPtrValue.ptr1 : NULL; \
+ (ecRepPtr) = irPtr ? (EnsembleCmdRep *)irPtr->twoPtrValue.ptr1 : NULL; \
} while (0)
/*
@@ -151,7 +151,7 @@ NewNsObj(
int
TclNamespaceEnsembleCmd(
- ClientData dummy,
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
@@ -164,6 +164,7 @@ TclNamespaceEnsembleCmd(
Tcl_Obj *listObj;
const char *simpleName;
int index, done;
+ (void)dummy;
if (nsPtr == NULL || nsPtr->flags & NS_DYING) {
if (!Tcl_InterpDeleted(interp)) {
@@ -675,7 +676,7 @@ TclCreateEnsembleInNs(
EnsembleConfig *ensemblePtr;
Tcl_Command token;
- ensemblePtr = Tcl_Alloc(sizeof(EnsembleConfig));
+ ensemblePtr = (EnsembleConfig *)Tcl_Alloc(sizeof(EnsembleConfig));
token = TclNRCreateCommandInNs(interp, name,
(Tcl_Namespace *) nameNsPtr, TclEnsembleImplementationCmd,
NsEnsembleImplementationCmdNR, ensemblePtr, DeleteEnsembleConfig);
@@ -798,7 +799,7 @@ Tcl_SetEnsembleSubcommandList(
}
}
- ensemblePtr = cmdPtr->objClientData;
+ ensemblePtr = (EnsembleConfig *)cmdPtr->objClientData;
oldList = ensemblePtr->subcmdList;
ensemblePtr->subcmdList = subcmdList;
if (subcmdList != NULL) {
@@ -874,7 +875,7 @@ Tcl_SetEnsembleParameterList(
}
}
- ensemblePtr = cmdPtr->objClientData;
+ ensemblePtr = (EnsembleConfig *)cmdPtr->objClientData;
oldList = ensemblePtr->parameterList;
ensemblePtr->parameterList = paramList;
if (paramList != NULL) {
@@ -974,7 +975,7 @@ Tcl_SetEnsembleMappingDict(
}
}
- ensemblePtr = cmdPtr->objClientData;
+ ensemblePtr = (EnsembleConfig *)cmdPtr->objClientData;
oldDict = ensemblePtr->subcommandDict;
ensemblePtr->subcommandDict = mapDict;
if (mapDict != NULL) {
@@ -1049,7 +1050,7 @@ Tcl_SetEnsembleUnknownHandler(
}
}
- ensemblePtr = cmdPtr->objClientData;
+ ensemblePtr = (EnsembleConfig *)cmdPtr->objClientData;
oldList = ensemblePtr->unknownHandler;
ensemblePtr->unknownHandler = unknownList;
if (unknownList != NULL) {
@@ -1105,7 +1106,7 @@ Tcl_SetEnsembleFlags(
return TCL_ERROR;
}
- ensemblePtr = cmdPtr->objClientData;
+ ensemblePtr = (EnsembleConfig *)cmdPtr->objClientData;
wasCompiled = ensemblePtr->flags & ENSEMBLE_COMPILE;
/*
@@ -1183,7 +1184,7 @@ Tcl_GetEnsembleSubcommandList(
return TCL_ERROR;
}
- ensemblePtr = cmdPtr->objClientData;
+ ensemblePtr = (EnsembleConfig *)cmdPtr->objClientData;
*subcmdListPtr = ensemblePtr->subcmdList;
return TCL_OK;
}
@@ -1225,7 +1226,7 @@ Tcl_GetEnsembleParameterList(
return TCL_ERROR;
}
- ensemblePtr = cmdPtr->objClientData;
+ ensemblePtr = (EnsembleConfig *)cmdPtr->objClientData;
*paramListPtr = ensemblePtr->parameterList;
return TCL_OK;
}
@@ -1267,7 +1268,7 @@ Tcl_GetEnsembleMappingDict(
return TCL_ERROR;
}
- ensemblePtr = cmdPtr->objClientData;
+ ensemblePtr = (EnsembleConfig *)cmdPtr->objClientData;
*mapDictPtr = ensemblePtr->subcommandDict;
return TCL_OK;
}
@@ -1308,7 +1309,7 @@ Tcl_GetEnsembleUnknownHandler(
return TCL_ERROR;
}
- ensemblePtr = cmdPtr->objClientData;
+ ensemblePtr = (EnsembleConfig *)cmdPtr->objClientData;
*unknownListPtr = ensemblePtr->unknownHandler;
return TCL_OK;
}
@@ -1349,7 +1350,7 @@ Tcl_GetEnsembleFlags(
return TCL_ERROR;
}
- ensemblePtr = cmdPtr->objClientData;
+ ensemblePtr = (EnsembleConfig *)cmdPtr->objClientData;
*flagsPtr = ensemblePtr->flags;
return TCL_OK;
}
@@ -1390,7 +1391,7 @@ Tcl_GetEnsembleNamespace(
return TCL_ERROR;
}
- ensemblePtr = cmdPtr->objClientData;
+ ensemblePtr = (EnsembleConfig *)cmdPtr->objClientData;
*namespacePtrPtr = (Tcl_Namespace *) ensemblePtr->nsPtr;
return TCL_OK;
}
@@ -1690,7 +1691,7 @@ NsEnsembleImplementationCmdNR(
int objc,
Tcl_Obj *const objv[])
{
- EnsembleConfig *ensemblePtr = clientData;
+ EnsembleConfig *ensemblePtr = (EnsembleConfig *)clientData;
/* The ensemble itself. */
Tcl_Obj *prefixObj; /* An object containing the prefix words of
* the command that implements the
@@ -1763,7 +1764,7 @@ NsEnsembleImplementationCmdNR(
if (ensembleCmd) {
if (ensembleCmd->epoch == ensemblePtr->epoch &&
ensembleCmd->token == (Command *)ensemblePtr->token) {
- prefixObj = Tcl_GetHashValue(ensembleCmd->hPtr);
+ prefixObj = (Tcl_Obj *)Tcl_GetHashValue(ensembleCmd->hPtr);
Tcl_IncrRefCount(prefixObj);
if (ensembleCmd->fix) {
TclSpellFix(interp, objv, objc, subIdx, subObj, ensembleCmd->fix);
@@ -1866,7 +1867,7 @@ NsEnsembleImplementationCmdNR(
TclSpellFix(interp, objv, objc, subIdx, subObj, fix);
}
- prefixObj = Tcl_GetHashValue(hPtr);
+ prefixObj = (Tcl_Obj *)Tcl_GetHashValue(hPtr);
Tcl_IncrRefCount(prefixObj);
runResultingSubcommand:
@@ -1987,10 +1988,11 @@ NsEnsembleImplementationCmdNR(
int
TclClearRootEnsemble(
- ClientData data[],
+ ClientData dummy[],
Tcl_Interp *interp,
int result)
{
+ (void)dummy;
TclResetRewriteEnsemble(interp, 1);
return result;
}
@@ -2094,11 +2096,12 @@ TclResetRewriteEnsemble(
static int
FreeER(
ClientData data[],
- Tcl_Interp *interp,
+ Tcl_Interp *dummy,
int result)
{
Tcl_Obj **tmp = (Tcl_Obj **) data[0];
Tcl_Obj **store = (Tcl_Obj **) data[1];
+ (void)dummy;
Tcl_Free(store);
Tcl_Free(tmp);
@@ -2176,9 +2179,9 @@ TclSpellFix(
if (search[0] == NULL) {
store = (Tcl_Obj **) search[2];
} else {
- Tcl_Obj **tmp = Tcl_Alloc(3 * sizeof(Tcl_Obj *));
+ Tcl_Obj **tmp = (Tcl_Obj **)Tcl_Alloc(3 * sizeof(Tcl_Obj *));
- store = Tcl_Alloc(size * sizeof(Tcl_Obj *));
+ store = (Tcl_Obj **)Tcl_Alloc(size * sizeof(Tcl_Obj *));
memcpy(store, iPtr->ensembleRewrite.sourceObjs,
size * sizeof(Tcl_Obj *));
@@ -2418,7 +2421,7 @@ MakeCachedEnsembleCommand(
* our own.
*/
- ensembleCmd = Tcl_Alloc(sizeof(EnsembleCmdRep));
+ ensembleCmd = (EnsembleCmdRep *)Tcl_Alloc(sizeof(EnsembleCmdRep));
ECRSetIntRep(objPtr, ensembleCmd);
}
@@ -2467,7 +2470,7 @@ ClearTable(
Tcl_HashEntry *hPtr = Tcl_FirstHashEntry(hash, &search);
while (hPtr != NULL) {
- Tcl_Obj *prefixObj = Tcl_GetHashValue(hPtr);
+ Tcl_Obj *prefixObj = (Tcl_Obj *)Tcl_GetHashValue(hPtr);
Tcl_DecrRefCount(prefixObj);
hPtr = Tcl_NextHashEntry(&search);
}
@@ -2480,7 +2483,7 @@ static void
DeleteEnsembleConfig(
ClientData clientData)
{
- EnsembleConfig *ensemblePtr = clientData;
+ EnsembleConfig *ensemblePtr = (EnsembleConfig *)clientData;
Namespace *nsPtr = ensemblePtr->nsPtr;
/*
@@ -2692,7 +2695,7 @@ BuildEnsembleConfig(
hPtr = Tcl_FirstHashEntry(&ensemblePtr->nsPtr->cmdTable, &search);
for (; hPtr!= NULL ; hPtr=Tcl_NextHashEntry(&search)) {
char *nsCmdName = /* Name of command in namespace. */
- Tcl_GetHashKey(&ensemblePtr->nsPtr->cmdTable, hPtr);
+ (char *)Tcl_GetHashKey(&ensemblePtr->nsPtr->cmdTable, hPtr);
for (i=0 ; i<ensemblePtr->nsPtr->numExportPatterns ; i++) {
if (Tcl_StringMatch(nsCmdName,
@@ -2741,7 +2744,7 @@ BuildEnsembleConfig(
*/
ensemblePtr->subcommandArrayPtr =
- Tcl_Alloc(sizeof(char *) * hash->numEntries);
+ (char **)Tcl_Alloc(sizeof(char *) * hash->numEntries);
/*
* Fill array from both ends as this makes us less likely to end up with
@@ -2765,12 +2768,12 @@ BuildEnsembleConfig(
j = hash->numEntries;
hPtr = Tcl_FirstHashEntry(hash, &search);
while (hPtr != NULL) {
- ensemblePtr->subcommandArrayPtr[i++] = Tcl_GetHashKey(hash, hPtr);
+ ensemblePtr->subcommandArrayPtr[i++] = (char *)Tcl_GetHashKey(hash, hPtr);
hPtr = Tcl_NextHashEntry(&search);
if (hPtr == NULL) {
break;
}
- ensemblePtr->subcommandArrayPtr[--j] = Tcl_GetHashKey(hash, hPtr);
+ ensemblePtr->subcommandArrayPtr[--j] = (char *)Tcl_GetHashKey(hash, hPtr);
hPtr = Tcl_NextHashEntry(&search);
}
if (hash->numEntries > 1) {
@@ -2862,7 +2865,7 @@ DupEnsembleCmdRep(
Tcl_Obj *copyPtr)
{
EnsembleCmdRep *ensembleCmd;
- EnsembleCmdRep *ensembleCopy = Tcl_Alloc(sizeof(EnsembleCmdRep));
+ EnsembleCmdRep *ensembleCopy = (EnsembleCmdRep *)Tcl_Alloc(sizeof(EnsembleCmdRep));
ECRGetIntRep(objPtr, ensembleCmd);
ECRSetIntRep(copyPtr, ensembleCopy);
diff --git a/generic/tclEnv.c b/generic/tclEnv.c
index eb62ca3..30589c2 100644
--- a/generic/tclEnv.c
+++ b/generic/tclEnv.c
@@ -123,7 +123,7 @@ TclSetupEnv(
char *p2;
p1 = Tcl_ExternalToUtfDString(NULL, environ[i], -1, &envString);
- p2 = strchr(p1, '=');
+ p2 = (char *)strchr(p1, '=');
if (p2 == NULL) {
/*
* This condition seem to happen occasionally under some
@@ -172,7 +172,7 @@ TclSetupEnv(
for (hPtr=Tcl_FirstHashEntry(&namesHash, &search); hPtr!=NULL;
hPtr=Tcl_NextHashEntry(&search)) {
- Tcl_Obj *elemName = Tcl_GetHashValue(hPtr);
+ Tcl_Obj *elemName = (Tcl_Obj *)Tcl_GetHashValue(hPtr);
TclObjUnsetVar2(interp, varNamePtr, elemName, TCL_GLOBAL_ONLY);
}
@@ -239,7 +239,7 @@ TclSetEnv(
*/
if ((env.ourEnviron != environ) || (length+2 > env.ourEnvironSize)) {
- char **newEnviron = Tcl_Alloc((length + 5) * sizeof(char *));
+ char **newEnviron = (char **)Tcl_Alloc((length + 5) * sizeof(char *));
memcpy(newEnviron, environ, length * sizeof(char *));
if ((env.ourEnvironSize != 0) && (env.ourEnviron != NULL)) {
@@ -283,7 +283,7 @@ TclSetEnv(
*/
valueLength = strlen(value);
- p = Tcl_Alloc(nameLength + valueLength + 2);
+ p = (char *)Tcl_Alloc(nameLength + valueLength + 2);
memcpy(p, name, nameLength);
p[nameLength] = '=';
memcpy(p+nameLength+1, value, valueLength+1);
@@ -293,7 +293,7 @@ TclSetEnv(
* Copy the native string to heap memory.
*/
- p = Tcl_Realloc(p, Tcl_DStringLength(&envString) + 1);
+ p = (char *)Tcl_Realloc(p, Tcl_DStringLength(&envString) + 1);
memcpy(p, p2, Tcl_DStringLength(&envString) + 1);
Tcl_DStringFree(&envString);
@@ -379,7 +379,7 @@ Tcl_PutEnv(
*/
name = Tcl_ExternalToUtfDString(NULL, assignment, -1, &nameString);
- value = strchr(name, '=');
+ value = (char *)strchr(name, '=');
if ((value != NULL) && (value != name)) {
value[0] = '\0';
@@ -453,18 +453,18 @@ TclUnsetEnv(
*/
#if defined(_WIN32)
- string = Tcl_Alloc(length + 2);
+ string = (char *)Tcl_Alloc(length + 2);
memcpy(string, name, length);
string[length] = '=';
string[length+1] = '\0';
#else
- string = Tcl_Alloc(length + 1);
+ string = (char *)Tcl_Alloc(length + 1);
memcpy(string, name, length);
string[length] = '\0';
#endif /* _WIN32 */
Tcl_UtfToExternalDString(NULL, string, -1, &envString);
- string = Tcl_Realloc(string, Tcl_DStringLength(&envString) + 1);
+ string = (char *)Tcl_Realloc(string, Tcl_DStringLength(&envString) + 1);
memcpy(string, Tcl_DStringValue(&envString),
Tcl_DStringLength(&envString)+1);
Tcl_DStringFree(&envString);
@@ -578,7 +578,7 @@ TclGetEnv(
/* ARGSUSED */
static char *
EnvTraceProc(
- ClientData clientData, /* Not used. */
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* Interpreter whose "env" variable is being
* modified. */
const char *name1, /* Better be "env". */
@@ -586,6 +586,7 @@ EnvTraceProc(
* whole array is being deleted (UTF-8). */
int flags) /* Indicates what's happening. */
{
+ (void)dummy;
/*
* For array traces, let TclSetupEnv do all the work.
*/
@@ -700,7 +701,7 @@ ReplaceString(
const int growth = 5;
- env.cache = Tcl_Realloc(env.cache,
+ env.cache = (char **)Tcl_Realloc(env.cache,
(env.cacheSize + growth) * sizeof(char *));
env.cache[env.cacheSize] = newStr;
(void) memset(env.cache+env.cacheSize+1, 0,
diff --git a/generic/tclEvent.c b/generic/tclEvent.c
index 03ab642..d7c9004 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);
@@ -152,7 +152,7 @@ Tcl_BackgroundException(
return;
}
- errPtr = Tcl_Alloc(sizeof(BgError));
+ errPtr = (BgError*)Tcl_Alloc(sizeof(BgError));
errPtr->errorMsg = Tcl_GetObjResult(interp);
Tcl_IncrRefCount(errPtr->errorMsg);
errPtr->returnOpts = Tcl_GetReturnOptions(interp, code);
@@ -160,7 +160,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);
@@ -190,9 +190,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;
@@ -219,7 +219,7 @@ HandleBgErrors(
errPtr = assocPtr->firstBgPtr;
Tcl_ListObjGetElements(NULL, copyObj, &prefixObjc, &prefixObjv);
- tempObjv = Tcl_Alloc((prefixObjc+2) * sizeof(Tcl_Obj *));
+ tempObjv = (Tcl_Obj**)Tcl_Alloc((prefixObjc+2) * sizeof(Tcl_Obj *));
memcpy(tempObjv, prefixObjv, prefixObjc*sizeof(Tcl_Obj *));
tempObjv[prefixObjc] = errPtr->errorMsg;
tempObjv[prefixObjc+1] = errPtr->returnOpts;
@@ -300,7 +300,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. */
@@ -309,6 +309,7 @@ TclDefaultBgErrorHandlerObjCmd(
Tcl_Obj *tempObjv[2];
int result, code, level;
Tcl_InterpState saved;
+ (void)dummy;
if (objc != 3) {
Tcl_WrongNumArgs(interp, 1, objv, "msg options");
@@ -507,7 +508,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");
@@ -517,7 +518,7 @@ TclSetBgErrorHandler(
* First access: initialize.
*/
- assocPtr = Tcl_Alloc(sizeof(ErrAssocData));
+ assocPtr = (ErrAssocData*)Tcl_Alloc(sizeof(ErrAssocData));
assocPtr->interp = interp;
assocPtr->cmdPrefix = NULL;
assocPtr->firstBgPtr = NULL;
@@ -552,14 +553,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;
}
@@ -585,11 +586,12 @@ TclGetBgErrorHandler(
static void
BgErrorDeleteProc(
- ClientData clientData, /* Pointer to ErrAssocData structure. */
- Tcl_Interp *interp) /* Interpreter being deleted. */
+ void *clientData, /* Pointer to ErrAssocData structure. */
+ Tcl_Interp *dummy) /* Interpreter being deleted. */
{
- ErrAssocData *assocPtr = clientData;
+ ErrAssocData *assocPtr = (ErrAssocData *)clientData;
BgError *errPtr;
+ (void)dummy;
while (assocPtr->firstBgPtr != NULL) {
errPtr = assocPtr->firstBgPtr;
@@ -624,9 +626,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 = Tcl_Alloc(sizeof(ExitHandler));
+ ExitHandler *exitPtr = (ExitHandler*)Tcl_Alloc(sizeof(ExitHandler));
exitPtr->proc = proc;
exitPtr->clientData = clientData;
@@ -657,9 +659,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 = Tcl_Alloc(sizeof(ExitHandler));
+ ExitHandler *exitPtr = (ExitHandler*)Tcl_Alloc(sizeof(ExitHandler));
exitPtr->proc = proc;
exitPtr->clientData = clientData;
@@ -690,7 +692,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;
@@ -733,7 +735,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;
@@ -776,12 +778,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 = Tcl_Alloc(sizeof(ExitHandler));
+ exitPtr = (ExitHandler*)Tcl_Alloc(sizeof(ExitHandler));
exitPtr->proc = proc;
exitPtr->clientData = clientData;
exitPtr->nextPtr = tsdPtr->firstExitPtr;
@@ -809,7 +811,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);
@@ -1285,7 +1287,7 @@ FinalizeThread(
* initialized already.
*/
- tsdPtr = TclThreadDataKeyGet(&dataKey);
+ tsdPtr = (ThreadSpecificData*)TclThreadDataKeyGet(&dataKey);
if (tsdPtr != NULL) {
tsdPtr->inExit = 1;
@@ -1360,7 +1362,7 @@ TclInExit(void)
int
TclInThreadExit(void)
{
- ThreadSpecificData *tsdPtr = TclThreadDataKeyGet(&dataKey);
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)TclThreadDataKeyGet(&dataKey);
if (tsdPtr == NULL) {
return 0;
@@ -1388,13 +1390,14 @@ TclInThreadExit(void)
/* ARGSUSED */
int
Tcl_VwaitObjCmd(
- ClientData clientData, /* Not used. */
+ void *dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
int done, foundEvent;
const char *nameString;
+ (void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "name");
@@ -1452,16 +1455,17 @@ 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;
+ (void)flags;
*donePtr = 1;
- Tcl_UntraceVar(interp, name1, TCL_TRACE_WRITES|TCL_TRACE_UNSETS,
+ Tcl_UntraceVar2(interp, name1, name2, TCL_TRACE_WRITES|TCL_TRACE_UNSETS,
VwaitVarProc, clientData);
return NULL;
}
@@ -1486,7 +1490,7 @@ VwaitVarProc(
/* ARGSUSED */
int
Tcl_UpdateObjCmd(
- ClientData clientData, /* Not used. */
+ void *dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
@@ -1495,6 +1499,7 @@ Tcl_UpdateObjCmd(
int flags = 0; /* Initialized to avoid compiler warning. */
static const char *const updateOptions[] = {"idletasks", NULL};
enum updateOptions {OPT_IDLETASKS};
+ (void)dummy;
if (objc == 1) {
flags = TCL_ALL_EVENTS|TCL_DONT_WAIT;
@@ -1554,10 +1559,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;
@@ -1593,13 +1598,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() */
size_t stackSize, /* Size of stack for the new thread */
int flags) /* Flags controlling behaviour of the new
* thread. */
{
#if TCL_THREADS
- ThreadClientData *cdPtr = Tcl_Alloc(sizeof(ThreadClientData));
+ ThreadClientData *cdPtr = (ThreadClientData *)Tcl_Alloc(sizeof(ThreadClientData));
int result;
cdPtr->proc = proc;
diff --git a/generic/tclExecute.c b/generic/tclExecute.c
index 793f3fd..ceca20a 100644
--- a/generic/tclExecute.c
+++ b/generic/tclExecute.c
@@ -144,7 +144,7 @@ typedef struct {
#define POP_TAUX_OBJ() \
do { \
tmpPtr = auxObjList; \
- auxObjList = tmpPtr->internalRep.twoPtrValue.ptr1; \
+ auxObjList = (Tcl_Obj *)tmpPtr->internalRep.twoPtrValue.ptr1; \
Tcl_DecrRefCount(tmpPtr); \
} while (0)
@@ -711,11 +711,11 @@ ReleaseDictIterator(
* that we were holding.
*/
- searchPtr = irPtr->twoPtrValue.ptr1;
+ searchPtr = (Tcl_DictSearch *)irPtr->twoPtrValue.ptr1;
Tcl_DictObjDone(searchPtr);
Tcl_Free(searchPtr);
- dictPtr = irPtr->twoPtrValue.ptr2;
+ dictPtr = (Tcl_Obj *)irPtr->twoPtrValue.ptr2;
TclDecrRefCount(dictPtr);
}
@@ -788,8 +788,8 @@ TclCreateExecEnv(
size_t size) /* The initial stack size, in number of words
* [sizeof(Tcl_Obj*)] */
{
- ExecEnv *eePtr = Tcl_Alloc(sizeof(ExecEnv));
- ExecStack *esPtr = Tcl_Alloc(sizeof(ExecStack)
+ ExecEnv *eePtr = (ExecEnv *)Tcl_Alloc(sizeof(ExecEnv));
+ ExecStack *esPtr = (ExecStack *)Tcl_Alloc(sizeof(ExecStack)
+ (size-1) * sizeof(Tcl_Obj *));
eePtr->execStackPtr = esPtr;
@@ -1058,7 +1058,7 @@ GrowEvaluationStack(
newBytes = sizeof(ExecStack) + (newElems-1) * sizeof(Tcl_Obj *);
oldPtr = esPtr;
- esPtr = Tcl_Alloc(newBytes);
+ esPtr = (ExecStack *)Tcl_Alloc(newBytes);
oldPtr->nextPtr = esPtr;
esPtr->prevPtr = oldPtr;
@@ -1303,8 +1303,9 @@ CopyCallback(
Tcl_Interp *dummy,
int result)
{
- Tcl_Obj **resultPtrPtr = data[0];
- Tcl_Obj *resultPtr = data[1];
+ Tcl_Obj **resultPtrPtr = (Tcl_Obj **)data[0];
+ Tcl_Obj *resultPtr = (Tcl_Obj *)data[1];
+ (void)dummy;
(void)dummy;
if (result == TCL_OK) {
@@ -1362,8 +1363,8 @@ ExprObjCallback(
Tcl_Interp *interp,
int result)
{
- Tcl_InterpState state = data[0];
- Tcl_Obj *resultPtr = data[1];
+ Tcl_InterpState state = (Tcl_InterpState)data[0];
+ Tcl_Obj *resultPtr = (Tcl_Obj *)data[1];
if (result == TCL_OK) {
TclSetDuplicateObj(resultPtr, Tcl_GetObjResult(interp));
@@ -1652,9 +1653,9 @@ TclCompileObj(
return codePtr;
}
- eclPtr = Tcl_GetHashValue(hePtr);
+ eclPtr = (ExtCmdLoc *)Tcl_GetHashValue(hePtr);
redo = 0;
- ctxCopyPtr = TclStackAlloc(interp, sizeof(CmdFrame));
+ ctxCopyPtr = (CmdFrame *)TclStackAlloc(interp, sizeof(CmdFrame));
*ctxCopyPtr = *invoker;
if (invoker->type == TCL_LOCATION_BC) {
@@ -2009,7 +2010,7 @@ TEBCresume(
* used too frequently
*/
- TEBCdata *TD = data[0];
+ TEBCdata *TD = (TEBCdata *)data[0];
#define auxObjList (TD->auxObjList)
#define catchTop (TD->catchTop)
#define codePtr (TD->codePtr)
@@ -2021,7 +2022,7 @@ TEBCresume(
Tcl_Obj **tosPtr; /* Cached pointer to top of evaluation
* stack. */
- const unsigned char *pc = data[1];
+ const unsigned char *pc = (const unsigned char *)data[1];
/* The current program counter. */
unsigned char inst; /* The currently running instruction */
@@ -4336,7 +4337,7 @@ TEBCresume(
CACHE_STACK_INFO();
goto gotError;
}
- contextPtr = framePtr->clientData;
+ contextPtr = (CallContext *)framePtr->clientData;
/*
* Call out to get the name; it's expensive to compute but cached.
@@ -4364,7 +4365,7 @@ TEBCresume(
CACHE_STACK_INFO();
goto gotError;
}
- contextPtr = framePtr->clientData;
+ contextPtr = (CallContext *)framePtr->clientData;
oPtr = (Object *) Tcl_GetObjectFromObj(interp, valuePtr);
if (oPtr == NULL) {
@@ -4463,7 +4464,7 @@ TEBCresume(
CACHE_STACK_INFO();
goto gotError;
}
- contextPtr = framePtr->clientData;
+ contextPtr = (CallContext *)framePtr->clientData;
newDepth = contextPtr->index + 1;
if (newDepth >= contextPtr->callPtr->numChain) {
@@ -6217,7 +6218,7 @@ TEBCresume(
*/
opnd = TclGetUInt4AtPtr(pc+1);
- infoPtr = codePtr->auxDataArrayPtr[opnd].clientData;
+ infoPtr = (ForeachInfo *)codePtr->auxDataArrayPtr[opnd].clientData;
numLists = infoPtr->numLists;
TRACE(("%u => ", opnd));
@@ -6285,7 +6286,7 @@ TEBCresume(
*/
tmpPtr = OBJ_AT_TOS;
- infoPtr = tmpPtr->internalRep.twoPtrValue.ptr1;
+ infoPtr = (ForeachInfo *)tmpPtr->internalRep.twoPtrValue.ptr1;
numLists = infoPtr->numLists;
TRACE(("=> "));
@@ -6369,7 +6370,7 @@ TEBCresume(
case INST_FOREACH_END:
/* THIS INSTRUCTION IS ONLY CALLED AS A BREAK TARGET */
tmpPtr = OBJ_AT_TOS;
- infoPtr = tmpPtr->internalRep.twoPtrValue.ptr1;
+ infoPtr = (ForeachInfo *)tmpPtr->internalRep.twoPtrValue.ptr1;
numLists = infoPtr->numLists;
TRACE(("=> loop terminated\n"));
NEXT_INST_V(1, numLists+2, 0);
@@ -6386,7 +6387,7 @@ TEBCresume(
*/
tmpPtr = OBJ_AT_DEPTH(1);
- infoPtr = tmpPtr->internalRep.twoPtrValue.ptr1;
+ infoPtr = (ForeachInfo *)tmpPtr->internalRep.twoPtrValue.ptr1;
numLists = infoPtr->numLists;
TRACE_APPEND(("=> appending to list at depth %d\n", 3 + numLists));
@@ -6833,7 +6834,7 @@ TEBCresume(
opnd = TclGetUInt4AtPtr(pc+1);
TRACE(("%u => ", opnd));
dictPtr = POP_OBJECT();
- searchPtr = Tcl_Alloc(sizeof(Tcl_DictSearch));
+ searchPtr = (Tcl_DictSearch *)Tcl_Alloc(sizeof(Tcl_DictSearch));
if (Tcl_DictObjFirst(interp, dictPtr, searchPtr, &keyPtr,
&valuePtr, &done) != TCL_OK) {
@@ -6875,7 +6876,7 @@ TEBCresume(
if (statePtr &&
(irPtr = TclFetchIntRep(statePtr, &dictIteratorType))) {
- searchPtr = irPtr->twoPtrValue.ptr1;
+ searchPtr = (Tcl_DictSearch *)irPtr->twoPtrValue.ptr1;
Tcl_DictObjNext(searchPtr, &keyPtr, &valuePtr, &done);
} else {
Tcl_Panic("mis-issued dictNext!");
@@ -6907,7 +6908,7 @@ TEBCresume(
opnd2 = TclGetUInt4AtPtr(pc+5);
TRACE(("%u => ", opnd));
varPtr = LOCAL(opnd);
- duiPtr = codePtr->auxDataArrayPtr[opnd2].clientData;
+ duiPtr = (DictUpdateInfo *)codePtr->auxDataArrayPtr[opnd2].clientData;
while (TclIsVarLink(varPtr)) {
varPtr = varPtr->value.linkPtr;
}
@@ -6967,7 +6968,7 @@ TEBCresume(
opnd2 = TclGetUInt4AtPtr(pc+5);
TRACE(("%u => ", opnd));
varPtr = LOCAL(opnd);
- duiPtr = codePtr->auxDataArrayPtr[opnd2].clientData;
+ duiPtr = (DictUpdateInfo *)codePtr->auxDataArrayPtr[opnd2].clientData;
while (TclIsVarLink(varPtr)) {
varPtr = varPtr->value.linkPtr;
}
@@ -7510,13 +7511,13 @@ FinalizeOONext(
int result)
{
Interp *iPtr = (Interp *) interp;
- CallContext *contextPtr = data[1];
+ CallContext *contextPtr = (CallContext *)data[1];
/*
* Reset the variable lookup frame.
*/
- iPtr->varFramePtr = data[0];
+ iPtr->varFramePtr = (CallFrame *)data[0];
/*
* Restore the call chain context index as we've finished the inner invoke
@@ -7536,13 +7537,13 @@ FinalizeOONextFilter(
int result)
{
Interp *iPtr = (Interp *) interp;
- CallContext *contextPtr = data[1];
+ CallContext *contextPtr = (CallContext *)data[1];
/*
* Reset the variable lookup frame.
*/
- iPtr->varFramePtr = data[0];
+ iPtr->varFramePtr = (CallFrame *)data[0];
/*
* Restore the call chain context index as we've finished the inner invoke
@@ -8905,7 +8906,7 @@ TclGetSrcInfoForPc(
}
srcOffset = cfPtr->cmd - codePtr->source;
- eclPtr = Tcl_GetHashValue(hePtr);
+ eclPtr = (ExtCmdLoc *)Tcl_GetHashValue(hePtr);
for (i=0; i < eclPtr->nuloc; i++) {
if (eclPtr->loc[i].srcOffset == srcOffset) {
diff --git a/generic/tclFCmd.c b/generic/tclFCmd.c
index 264711d..2f7771c 100644
--- a/generic/tclFCmd.c
+++ b/generic/tclFCmd.c
@@ -47,12 +47,13 @@ static int FileForceOption(Tcl_Interp *interp,
int
TclFileRenameCmd(
- ClientData clientData, /* Unused */
+ ClientData dummy, /* Unused */
Tcl_Interp *interp, /* Interp for error reporting or recursive
* calls in the case of a tricky rename. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument strings passed to Tcl_FileCmd. */
{
+ (void)dummy;
return FileCopyRename(interp, objc, objv, 0);
}
@@ -76,12 +77,13 @@ TclFileRenameCmd(
int
TclFileCopyCmd(
- ClientData clientData, /* Unused */
+ ClientData dummy, /* Unused */
Tcl_Interp *interp, /* Used for error reporting or recursive calls
* in the case of a tricky copy. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument strings passed to Tcl_FileCmd. */
{
+ (void)dummy;
return FileCopyRename(interp, objc, objv, 1);
}
@@ -214,7 +216,7 @@ FileCopyRename(
int
TclFileMakeDirsCmd(
- ClientData clientData, /* Unused */
+ ClientData dummy, /* Unused */
Tcl_Interp *interp, /* Used for error reporting. */
int objc, /* Number of arguments */
Tcl_Obj *const objv[]) /* Argument strings passed to Tcl_FileCmd. */
@@ -224,6 +226,7 @@ TclFileMakeDirsCmd(
Tcl_Obj *split = NULL;
Tcl_Obj *target = NULL;
Tcl_StatBuf statBuf;
+ (void)dummy;
result = TCL_OK;
for (i = 1; i < objc; i++) {
@@ -338,7 +341,7 @@ TclFileMakeDirsCmd(
int
TclFileDeleteCmd(
- ClientData clientData, /* Unused */
+ ClientData dummy, /* Unused */
Tcl_Interp *interp, /* Used for error reporting */
int objc, /* Number of arguments */
Tcl_Obj *const objv[]) /* Argument strings passed to Tcl_FileCmd. */
@@ -346,6 +349,7 @@ TclFileDeleteCmd(
int i, force, result;
Tcl_Obj *errfile;
Tcl_Obj *errorBuffer = NULL;
+ (void)dummy;
i = FileForceOption(interp, objc - 1, objv + 1, &force);
if (i < 0) {
@@ -946,7 +950,7 @@ FileBasename(
int
TclFileAttrsCmd(
- ClientData clientData, /* Unused */
+ ClientData dummy, /* Unused */
Tcl_Interp *interp, /* The interpreter for error reporting. */
int objc, /* Number of command line arguments. */
Tcl_Obj *const objv[]) /* The command line objects. */
@@ -957,6 +961,7 @@ TclFileAttrsCmd(
Tcl_Obj *objStrings = NULL;
int numObjStrings = -1;
Tcl_Obj *filePtr;
+ (void)dummy;
if (objc < 2) {
Tcl_WrongNumArgs(interp, 1, objv, "name ?-option value ...?");
@@ -1162,13 +1167,14 @@ TclFileAttrsCmd(
int
TclFileLinkCmd(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
{
Tcl_Obj *contents;
int index;
+ (void)dummy;
if (objc < 2 || objc > 4) {
Tcl_WrongNumArgs(interp, 1, objv, "?-linktype? linkname ?target?");
@@ -1313,12 +1319,13 @@ TclFileLinkCmd(
int
TclFileReadLinkCmd(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
{
Tcl_Obj *contents;
+ (void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "name");
@@ -1364,7 +1371,7 @@ TclFileReadLinkCmd(
int
TclFileTemporaryCmd(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
@@ -1378,6 +1385,7 @@ TclFileTemporaryCmd(
/* Pieces of template. Each piece is NULL if
* it is omitted. The platform temporary file
* engine might ignore some pieces. */
+ (void)dummy;
if (objc < 1 || objc > 3) {
Tcl_WrongNumArgs(interp, 1, objv, "?nameVar? ?template?");
@@ -1523,7 +1531,7 @@ TclFileTemporaryCmd(
int
TclFileTempDirCmd(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
@@ -1534,6 +1542,7 @@ TclFileTempDirCmd(
/* Pieces of template. Each piece is NULL if
* it is omitted. The platform temporary file
* engine might ignore some pieces. */
+ (void)dummy;
if (objc < 1 || objc > 2) {
Tcl_WrongNumArgs(interp, 1, objv, "?template?");
diff --git a/generic/tclFileName.c b/generic/tclFileName.c
index 9ecb631..a72c4b6 100644
--- a/generic/tclFileName.c
+++ b/generic/tclFileName.c
@@ -587,7 +587,7 @@ Tcl_SplitPath(
* plus the argv pointers and the terminating NULL pointer.
*/
- *argvPtr = Tcl_Alloc((((*argcPtr) + 1) * sizeof(char *)) + size);
+ *argvPtr = (const char **)Tcl_Alloc((((*argcPtr) + 1) * sizeof(char *)) + size);
/*
* Position p after the last argv pointer and copy the contents of the
@@ -821,7 +821,7 @@ Tcl_FSJoinToPath(
return TclJoinPath(2, pair, 0);
} else {
int elemc = objc + 1;
- Tcl_Obj *ret, **elemv = Tcl_Alloc(elemc*sizeof(Tcl_Obj *));
+ Tcl_Obj *ret, **elemv = (Tcl_Obj**)Tcl_Alloc(elemc*sizeof(Tcl_Obj *));
elemv[0] = pathPtr;
memcpy(elemv+1, objv, objc*sizeof(Tcl_Obj *));
@@ -1243,6 +1243,7 @@ Tcl_GlobObjCmd(
};
enum pathDirOptions {PATH_NONE = -1 , PATH_GENERAL = 0, PATH_DIR = 1};
Tcl_GlobTypeData *globTypes = NULL;
+ (void)dummy;
globFlags = 0;
join = 0;
@@ -1451,7 +1452,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;
@@ -2525,7 +2526,7 @@ DoGlob(
Tcl_StatBuf *
Tcl_AllocStatBuf(void)
{
- return Tcl_Alloc(sizeof(Tcl_StatBuf));
+ return (Tcl_StatBuf *)Tcl_Alloc(sizeof(Tcl_StatBuf));
}
/*
@@ -2643,6 +2644,7 @@ Tcl_GetBlockSizeFromStat(
#ifdef HAVE_STRUCT_STAT_ST_BLKSIZE
return statPtr->st_blksize;
#else
+ (void)statPtr;
/*
* Not a great guess, but will do...
*/
diff --git a/generic/tclGetDate.y b/generic/tclGetDate.y
index 9e1bd44..d5e7320 100644
--- a/generic/tclGetDate.y
+++ b/generic/tclGetDate.y
@@ -960,7 +960,7 @@ TclDatelex(
int
TclClockOldscanObjCmd(
- void *clientData, /* Unused */
+ void *dummy, /* Unused */
Tcl_Interp *interp, /* Tcl interpreter */
int objc, /* Count of paraneters */
Tcl_Obj *const *objv) /* Parameters */
@@ -970,6 +970,7 @@ TclClockOldscanObjCmd(
DateInfo dateInfo;
DateInfo* info = &dateInfo;
int status;
+ (void)dummy;
if (objc != 5) {
Tcl_WrongNumArgs(interp, 1, objv,
@@ -1074,7 +1075,7 @@ TclClockOldscanObjCmd(
if (yyHaveTime) {
Tcl_ListObjAppendElement(interp, result, Tcl_NewIntObj(
- ToSeconds(yyHour, yyMinutes, yySeconds, yyMeridian)));
+ ToSeconds(yyHour, yyMinutes, yySeconds, (MERIDIAN)yyMeridian)));
} else {
Tcl_ListObjAppendElement(interp, result, Tcl_NewObj());
}
diff --git a/generic/tclHash.c b/generic/tclHash.c
index af4316a..5a90dda 100644
--- a/generic/tclHash.c
+++ b/generic/tclHash.c
@@ -321,7 +321,7 @@ CreateHashEntry(
if (typePtr->allocEntryProc) {
hPtr = typePtr->allocEntryProc(tablePtr, (void *) key);
} else {
- hPtr = Tcl_Alloc(sizeof(Tcl_HashEntry));
+ hPtr = (Tcl_HashEntry *)Tcl_Alloc(sizeof(Tcl_HashEntry));
hPtr->key.oneWordValue = (char *) key;
Tcl_SetHashValue(hPtr, NULL);
}
@@ -621,7 +621,7 @@ Tcl_HashStats(
* Print out the histogram and a few other pieces of information.
*/
- result = Tcl_Alloc((NUM_COUNTERS * 60) + 300);
+ result = (char *)Tcl_Alloc((NUM_COUNTERS * 60) + 300);
sprintf(result, "%" TCL_Z_MODIFIER "u entries in table, %" TCL_Z_MODIFIER "u buckets\n",
tablePtr->numEntries, tablePtr->numBuckets);
p = result + strlen(result);
@@ -670,7 +670,7 @@ AllocArrayEntry(
if (size < sizeof(Tcl_HashEntry)) {
size = sizeof(Tcl_HashEntry);
}
- hPtr = Tcl_Alloc(size);
+ hPtr = (Tcl_HashEntry *)Tcl_Alloc(size);
for (iPtr1 = array, iPtr2 = hPtr->key.words;
count > 0; count--, iPtr1++, iPtr2++) {
@@ -703,7 +703,7 @@ CompareArrayKeys(
void *keyPtr, /* New key to compare. */
Tcl_HashEntry *hPtr) /* Existing key to compare. */
{
- const int *iPtr1 = keyPtr;
+ const int *iPtr1 = (const int *)keyPtr;
const int *iPtr2 = hPtr->key.words;
Tcl_HashTable *tablePtr = hPtr->tablePtr;
int count;
@@ -777,12 +777,13 @@ AllocStringEntry(
const char *string = (const char *) keyPtr;
Tcl_HashEntry *hPtr;
size_t size, allocsize;
+ (void)tablePtr;
allocsize = size = strlen(string) + 1;
if (size < sizeof(hPtr->key)) {
allocsize = sizeof(hPtr->key);
}
- hPtr = Tcl_Alloc(offsetof(Tcl_HashEntry, key) + allocsize);
+ hPtr = (Tcl_HashEntry *)Tcl_Alloc(offsetof(Tcl_HashEntry, key) + allocsize);
memset(hPtr, 0, sizeof(Tcl_HashEntry) + allocsize - sizeof(hPtr->key));
memcpy(hPtr->key.string, string, size);
Tcl_SetHashValue(hPtr, NULL);
@@ -811,7 +812,7 @@ CompareStringKeys(
void *keyPtr, /* New key to compare. */
Tcl_HashEntry *hPtr) /* Existing key to compare. */
{
- return !strcmp(keyPtr, hPtr->key.string);
+ return !strcmp((char *)keyPtr, hPtr->key.string);
}
/*
@@ -836,9 +837,10 @@ HashStringKey(
Tcl_HashTable *tablePtr, /* Hash table. */
void *keyPtr) /* Key from which to compute hash value. */
{
- const char *string = keyPtr;
+ const char *string = (const char *)keyPtr;
TCL_HASH_TYPE result;
char c;
+ (void)tablePtr;
/*
* I tried a zillion different hash functions and asked many other people
@@ -903,6 +905,8 @@ BogusFind(
Tcl_HashTable *tablePtr, /* Table in which to lookup entry. */
const char *key) /* Key to use to find matching entry. */
{
+ (void)tablePtr;
+ (void)key;
Tcl_Panic("called %s on deleted table", "Tcl_FindHashEntry");
return NULL;
}
@@ -933,6 +937,9 @@ BogusCreate(
int *newPtr) /* Store info here telling whether a new entry
* was created. */
{
+ (void)tablePtr;
+ (void)key;
+ (void)newPtr;
Tcl_Panic("called %s on deleted table", "Tcl_CreateHashEntry");
return NULL;
}
@@ -989,11 +996,11 @@ RebuildTable(
tablePtr->numBuckets *= 4;
if (typePtr->flags & TCL_HASH_KEY_SYSTEM_HASH) {
- tablePtr->buckets = TclpSysAlloc(
+ tablePtr->buckets = (Tcl_HashEntry **)TclpSysAlloc(
tablePtr->numBuckets * sizeof(Tcl_HashEntry *));
} else {
tablePtr->buckets =
- Tcl_Alloc(tablePtr->numBuckets * sizeof(Tcl_HashEntry *));
+ (Tcl_HashEntry **)Tcl_Alloc(tablePtr->numBuckets * sizeof(Tcl_HashEntry *));
}
for (count = tablePtr->numBuckets, newChainPtr = tablePtr->buckets;
count > 0; count--, newChainPtr++) {
diff --git a/generic/tclHistory.c b/generic/tclHistory.c
index 40ef86b..af54d0c 100644
--- a/generic/tclHistory.c
+++ b/generic/tclHistory.c
@@ -123,14 +123,14 @@ Tcl_RecordAndEvalObj(
int result, call = 1;
Tcl_CmdInfo info;
HistoryObjs *histObjsPtr =
- Tcl_GetAssocData(interp, HISTORY_OBJS_KEY, NULL);
+ (HistoryObjs *)Tcl_GetAssocData(interp, HISTORY_OBJS_KEY, NULL);
/*
* Create the references to the [::history add] command if necessary.
*/
if (histObjsPtr == NULL) {
- histObjsPtr = Tcl_Alloc(sizeof(HistoryObjs));
+ histObjsPtr = (HistoryObjs *)Tcl_Alloc(sizeof(HistoryObjs));
TclNewLiteralStringObj(histObjsPtr->historyObj, "::history");
TclNewLiteralStringObj(histObjsPtr->addObj, "add");
Tcl_IncrRefCount(histObjsPtr->historyObj);
@@ -204,9 +204,10 @@ Tcl_RecordAndEvalObj(
static void
DeleteHistoryObjs(
ClientData clientData,
- Tcl_Interp *interp)
+ Tcl_Interp *dummy)
{
- HistoryObjs *histObjsPtr = clientData;
+ HistoryObjs *histObjsPtr = (HistoryObjs *)clientData;
+ (void)dummy;
TclDecrRefCount(histObjsPtr->historyObj);
TclDecrRefCount(histObjsPtr->addObj);
diff --git a/generic/tclIO.c b/generic/tclIO.c
index 9276c92..9230fd3 100644
--- a/generic/tclIO.c
+++ b/generic/tclIO.c
@@ -348,7 +348,7 @@ static const Tcl_ObjType chanObjType = {
do { \
const Tcl_ObjIntRep *irPtr; \
irPtr = TclFetchIntRep((objPtr), &chanObjType); \
- (resPtr) = irPtr ? irPtr->twoPtrValue.ptr1 : NULL; \
+ (resPtr) = irPtr ? (ResolvedChanName *)irPtr->twoPtrValue.ptr1 : NULL; \
} while (0)
#define BUSY_STATE(st, fl) \
@@ -857,7 +857,7 @@ Tcl_CreateCloseHandler(
ChannelState *statePtr = ((Channel *) chan)->state;
CloseCallback *cbPtr;
- cbPtr = Tcl_Alloc(sizeof(CloseCallback));
+ cbPtr = (CloseCallback *)Tcl_Alloc(sizeof(CloseCallback));
cbPtr->proc = proc;
cbPtr->clientData = clientData;
@@ -936,9 +936,9 @@ GetChannelTable(
Tcl_HashTable *hTblPtr; /* Hash table of channels. */
Tcl_Channel stdinChan, stdoutChan, stderrChan;
- hTblPtr = Tcl_GetAssocData(interp, "tclIO", NULL);
+ hTblPtr = (Tcl_HashTable *)Tcl_GetAssocData(interp, "tclIO", NULL);
if (hTblPtr == NULL) {
- hTblPtr = Tcl_Alloc(sizeof(Tcl_HashTable));
+ hTblPtr = (Tcl_HashTable *)Tcl_Alloc(sizeof(Tcl_HashTable));
Tcl_InitHashTable(hTblPtr, TCL_STRING_KEYS);
Tcl_SetAssocData(interp, "tclIO",
(Tcl_InterpDeleteProc *) DeleteChannelTable, hTblPtr);
@@ -1006,10 +1006,10 @@ DeleteChannelTable(
* refcount reaches zero.
*/
- hTblPtr = clientData;
+ hTblPtr = (Tcl_HashTable *)clientData;
for (hPtr = Tcl_FirstHashEntry(hTblPtr, &hSearch); hPtr != NULL;
hPtr = Tcl_FirstHashEntry(hTblPtr, &hSearch)) {
- chanPtr = Tcl_GetHashValue(hPtr);
+ chanPtr = (Channel *)Tcl_GetHashValue(hPtr);
statePtr = chanPtr->state;
/*
@@ -1376,7 +1376,7 @@ DetachChannel(
statePtr = chanPtr->state;
if (interp != NULL) {
- hTblPtr = Tcl_GetAssocData(interp, "tclIO", NULL);
+ hTblPtr = (Tcl_HashTable *)Tcl_GetAssocData(interp, "tclIO", NULL);
if (hTblPtr == NULL) {
return TCL_ERROR;
}
@@ -1479,7 +1479,7 @@ Tcl_GetChannel(
* compensate where necessary to retrieve the topmost channel again.
*/
- chanPtr = Tcl_GetHashValue(hPtr);
+ chanPtr = (Channel *)Tcl_GetHashValue(hPtr);
chanPtr = chanPtr->state->bottomChanPtr;
if (modePtr != NULL) {
*modePtr = chanPtr->state->flags & (TCL_READABLE|TCL_WRITABLE);
@@ -1523,6 +1523,7 @@ TclGetChannelFromObj(
ChannelState *statePtr;
ResolvedChanName *resPtr = NULL;
Tcl_Channel chan;
+ (void)flags;
if (interp == NULL) {
return TCL_ERROR;
@@ -1646,8 +1647,8 @@ Tcl_CreateChannel(
* assignments to 0/NULL below.
*/
- chanPtr = Tcl_Alloc(sizeof(Channel));
- statePtr = Tcl_Alloc(sizeof(ChannelState));
+ chanPtr = (Channel *)Tcl_Alloc(sizeof(Channel));
+ statePtr = (ChannelState *)Tcl_Alloc(sizeof(ChannelState));
chanPtr->state = statePtr;
chanPtr->instanceData = instanceData;
@@ -1666,10 +1667,10 @@ Tcl_CreateChannel(
* later.
*/
- tmp = Tcl_Alloc((len < 7) ? 7 : len);
+ tmp = (char *)Tcl_Alloc((len < 7) ? 7 : len);
strcpy(tmp, chanName);
} else {
- tmp = Tcl_Alloc(7);
+ tmp = (char *)Tcl_Alloc(7);
tmp[0] = '\0';
}
statePtr->channelName = tmp;
@@ -1942,7 +1943,7 @@ Tcl_StackChannel(
statePtr->inQueueTail = NULL;
}
- chanPtr = Tcl_Alloc(sizeof(Channel));
+ chanPtr = (Channel *)Tcl_Alloc(sizeof(Channel));
/*
* Save some of the current state into the new structure, reinitialize the
@@ -2471,7 +2472,7 @@ AllocChannelBuffer(
int n;
n = length + CHANNELBUFFER_HEADER_SIZE + BUFFER_PADDING + BUFFER_PADDING;
- bufPtr = Tcl_Alloc(n);
+ bufPtr = (ChannelBuffer *)Tcl_Alloc(n);
bufPtr->nextAdded = BUFFER_PADDING;
bufPtr->nextRemoved = BUFFER_PADDING;
bufPtr->bufLength = length + BUFFER_PADDING;
@@ -4299,7 +4300,7 @@ Write(
if (GotFlag(statePtr, CHANNEL_LINEBUFFERED)
|| (statePtr->outputTranslation != TCL_TRANSLATE_LF)) {
- nextNewLine = memchr(src, '\n', srcLen);
+ nextNewLine = (char *)memchr(src, '\n', srcLen);
}
while (srcLen + saved + endEncoding > 0) {
@@ -4397,7 +4398,7 @@ Write(
total += dstWrote;
dst += dstWrote;
dstLen -= dstWrote;
- nextNewLine = memchr(src, '\n', srcLen);
+ nextNewLine = (char *)memchr(src, '\n', srcLen);
needNlFlush = 1;
}
@@ -5201,6 +5202,7 @@ FreeBinaryEncoding(
ClientData dummy) /* Not used */
{
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
+ (void)dummy;
if (tsdPtr->binaryEncoding != NULL) {
Tcl_FreeEncoding(tsdPtr->binaryEncoding);
@@ -6507,7 +6509,7 @@ TranslateInputEOL(
* created by the presence of the input eof char.
*/
- if ((eof = memchr(srcStart, inEofChar, srcLen))) {
+ if ((eof = (const char *)memchr(srcStart, inEofChar, srcLen))) {
srcLen = eof - srcStart;
}
}
@@ -6522,7 +6524,7 @@ TranslateInputEOL(
char *dst = dstStart;
char *dstEnd = dstStart + srcLen;
- while ((dst = memchr(dst, '\r', dstEnd - dst))) {
+ while ((dst = (char *)memchr(dst, '\r', dstEnd - dst))) {
*dst++ = '\n';
}
}
@@ -6533,7 +6535,7 @@ TranslateInputEOL(
char *dst = dstStart;
int lesser = (dstLen < srcLen) ? dstLen : srcLen;
- while ((crFound = memchr(src, '\r', lesser))) {
+ while ((crFound = (const char *)memchr(src, '\r', lesser))) {
int numBytes = crFound - src;
memmove(dst, src, numBytes);
@@ -6573,7 +6575,7 @@ TranslateInputEOL(
ResetFlag(statePtr, INPUT_SAW_CR);
}
lesser = (dstLen < srcLen) ? dstLen : srcLen;
- while ((crFound = memchr(src, '\r', lesser))) {
+ while ((crFound = (const char *)memchr(src, '\r', lesser))) {
int numBytes = crFound - src;
memmove(dst, src, numBytes);
@@ -8545,7 +8547,7 @@ static void
ChannelTimerProc(
ClientData clientData)
{
- Channel *chanPtr = clientData;
+ Channel *chanPtr = (Channel *)clientData;
ChannelState *statePtr = chanPtr->state;
/* State info for channel */
@@ -8633,7 +8635,7 @@ Tcl_CreateChannelHandler(
}
}
if (chPtr == NULL) {
- chPtr = Tcl_Alloc(sizeof(ChannelHandler));
+ chPtr = (ChannelHandler *)Tcl_Alloc(sizeof(ChannelHandler));
chPtr->mask = 0;
chPtr->proc = proc;
chPtr->clientData = clientData;
@@ -8845,7 +8847,7 @@ CreateScriptRecord(
makeCH = (esPtr == NULL);
if (makeCH) {
- esPtr = Tcl_Alloc(sizeof(EventScriptRecord));
+ esPtr = (EventScriptRecord *)Tcl_Alloc(sizeof(EventScriptRecord));
}
/*
@@ -8901,7 +8903,7 @@ TclChannelEventScriptInvoker(
* in. */
int result; /* Result of call to eval script. */
- esPtr = clientData;
+ esPtr = (EventScriptRecord *)clientData;
chanPtr = esPtr->chanPtr;
mask = esPtr->mask;
interp = esPtr->interp;
@@ -8956,7 +8958,7 @@ TclChannelEventScriptInvoker(
/* ARGSUSED */
int
Tcl_FileEventObjCmd(
- ClientData clientData, /* Not used. */
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* Interpreter in which the channel for which
* to create the handler is found. */
int objc, /* Number of arguments. */
@@ -8970,6 +8972,7 @@ Tcl_FileEventObjCmd(
int mask;
static const char *const modeOptions[] = {"readable", "writable", NULL};
static const int maskArray[] = {TCL_READABLE, TCL_WRITABLE};
+ (void)dummy;
if ((objc != 3) && (objc != 4)) {
Tcl_WrongNumArgs(interp, 1, objv, "channelId event ?script?");
@@ -9055,7 +9058,7 @@ ZeroTransferTimerProc(
/* calling CopyData with mask==0 still implies immediate invocation of the
* -command callback, and completion of the fcopy.
*/
- CopyData(clientData, 0);
+ CopyData((CopyState *)clientData, 0);
}
/*
@@ -9161,7 +9164,7 @@ TclCopyChannel(
* completed.
*/
- csPtr = Tcl_Alloc(sizeof(CopyState) + !moveBytes * inStatePtr->bufSize);
+ csPtr = (CopyState *)Tcl_Alloc(sizeof(CopyState) + !moveBytes * inStatePtr->bufSize);
csPtr->bufSize = !moveBytes * inStatePtr->bufSize;
csPtr->readPtr = inPtr;
csPtr->writePtr = outPtr;
@@ -10018,7 +10021,7 @@ CopyEventProc(
ClientData clientData,
int mask)
{
- (void) CopyData(clientData, mask);
+ (void) CopyData((CopyState *)clientData, mask);
}
/*
@@ -10351,7 +10354,7 @@ Tcl_IsChannelRegistered(
chanPtr = ((Channel *) chan)->state->bottomChanPtr;
statePtr = chanPtr->state;
- hTblPtr = Tcl_GetAssocData(interp, "tclIO", NULL);
+ hTblPtr = (Tcl_HashTable *)Tcl_GetAssocData(interp, "tclIO", NULL);
if (hTblPtr == NULL) {
return 0;
}
@@ -11025,7 +11028,7 @@ FixLevelCode(
lcn += 2;
}
- lvn = Tcl_Alloc(lcn * sizeof(Tcl_Obj *));
+ lvn = (Tcl_Obj **)Tcl_Alloc(lcn * sizeof(Tcl_Obj *));
/*
* New level/code information is spliced into the first occurence of
diff --git a/generic/tclIOCmd.c b/generic/tclIOCmd.c
index 342c730..2e492b8 100644
--- a/generic/tclIOCmd.c
+++ b/generic/tclIOCmd.c
@@ -71,9 +71,10 @@ static void UnregisterTcpServerInterpCleanupProc(
static void
FinalizeIOCmdTSD(
- ClientData clientData) /* Not used. */
+ ClientData dummy) /* Not used. */
{
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
+ (void)dummy;
if (tsdPtr->stdoutObjPtr != NULL) {
Tcl_DecrRefCount(tsdPtr->stdoutObjPtr);
@@ -113,6 +114,7 @@ Tcl_PutsObjCmd(
int newline; /* Add a newline at end? */
int result; /* Result of puts operation. */
int mode; /* Mode in which channel is opened. */
+ (void)dummy;
switch (objc) {
case 2: /* [puts $x] */
@@ -224,6 +226,7 @@ Tcl_FlushObjCmd(
Tcl_Obj *chanObjPtr;
Tcl_Channel chan; /* The channel to flush on. */
int mode;
+ (void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "channelId");
@@ -291,6 +294,7 @@ Tcl_GetsObjCmd(
int mode; /* Mode in which channel is opened. */
Tcl_Obj *linePtr, *chanObjPtr;
int code = TCL_OK;
+ (void)dummy;
if ((objc != 2) && (objc != 3)) {
Tcl_WrongNumArgs(interp, 1, objv, "channelId ?varName?");
@@ -377,6 +381,7 @@ Tcl_ReadObjCmd(
int charactersRead; /* How many characters were read? */
int mode; /* Mode in which channel is opened. */
Tcl_Obj *resultPtr, *chanObjPtr;
+ (void)dummy;
if ((objc != 2) && (objc != 3)) {
Interp *iPtr;
@@ -496,7 +501,7 @@ Tcl_ReadObjCmd(
/* ARGSUSED */
int
Tcl_SeekObjCmd(
- ClientData clientData, /* Not used. */
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
@@ -510,6 +515,7 @@ Tcl_SeekObjCmd(
"start", "current", "end", NULL
};
static const int modeArray[] = {SEEK_SET, SEEK_CUR, SEEK_END};
+ (void)dummy;
if ((objc != 3) && (objc != 4)) {
Tcl_WrongNumArgs(interp, 1, objv, "channelId offset ?origin?");
@@ -572,7 +578,7 @@ Tcl_SeekObjCmd(
/* ARGSUSED */
int
Tcl_TellObjCmd(
- ClientData clientData, /* Not used. */
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
@@ -580,6 +586,7 @@ Tcl_TellObjCmd(
Tcl_Channel chan; /* The channel to tell on. */
Tcl_WideInt newLoc;
int code;
+ (void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "channelId");
@@ -635,7 +642,7 @@ Tcl_TellObjCmd(
/* ARGSUSED */
int
Tcl_CloseObjCmd(
- ClientData clientData, /* Not used. */
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
@@ -645,6 +652,7 @@ Tcl_CloseObjCmd(
"read", "write", NULL
};
static const int dirArray[] = {TCL_CLOSE_READ, TCL_CLOSE_WRITE};
+ (void)dummy;
if ((objc != 2) && (objc != 3)) {
Tcl_WrongNumArgs(interp, 1, objv, "channelId ?direction?");
@@ -744,7 +752,7 @@ Tcl_CloseObjCmd(
/* ARGSUSED */
int
Tcl_FconfigureObjCmd(
- ClientData clientData, /* Not used. */
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
@@ -752,6 +760,7 @@ Tcl_FconfigureObjCmd(
const char *optionName, *valueName;
Tcl_Channel chan; /* The channel to set a mode on. */
int i; /* Iterate over arg-value pairs. */
+ (void)dummy;
if ((objc < 2) || (((objc % 2) == 1) && (objc != 3))) {
Tcl_WrongNumArgs(interp, 1, objv, "channelId ?-option value ...?");
@@ -820,12 +829,13 @@ Tcl_FconfigureObjCmd(
/* ARGSUSED */
int
Tcl_EofObjCmd(
- ClientData unused, /* Not used. */
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
Tcl_Channel chan;
+ (void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "channelId");
@@ -878,6 +888,7 @@ Tcl_ExecObjCmd(
enum options {
EXEC_IGNORESTDERR, EXEC_KEEPNEWLINE, EXEC_LAST
};
+ (void)dummy;
/*
* Check for any leading option arguments.
@@ -925,7 +936,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
@@ -1028,13 +1039,14 @@ Tcl_ExecObjCmd(
/* ARGSUSED */
int
Tcl_FblockedObjCmd(
- ClientData unused, /* Not used. */
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
Tcl_Channel chan;
int mode;
+ (void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "channelId");
@@ -1075,7 +1087,7 @@ Tcl_FblockedObjCmd(
/* ARGSUSED */
int
Tcl_OpenObjCmd(
- ClientData notUsed, /* Not used. */
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
@@ -1083,6 +1095,7 @@ Tcl_OpenObjCmd(
int pipeline, prot;
const char *modeString, *what;
Tcl_Channel chan;
+ (void)dummy;
if ((objc < 2) || (objc > 4)) {
Tcl_WrongNumArgs(interp, 1, objv, "fileName ?access? ?permissions?");
@@ -1201,15 +1214,16 @@ static void
TcpAcceptCallbacksDeleteProc(
ClientData clientData, /* Data which was passed when the assocdata
* was registered. */
- Tcl_Interp *interp) /* Interpreter being deleted - not used. */
+ Tcl_Interp *dummy) /* Interpreter being deleted - not used. */
{
- Tcl_HashTable *hTblPtr = clientData;
+ Tcl_HashTable *hTblPtr = (Tcl_HashTable *)clientData;
Tcl_HashEntry *hPtr;
Tcl_HashSearch hSearch;
+ (void)dummy;
for (hPtr = Tcl_FirstHashEntry(hTblPtr, &hSearch);
hPtr != NULL; hPtr = Tcl_NextHashEntry(&hSearch)) {
- AcceptCallback *acceptCallbackPtr = Tcl_GetHashValue(hPtr);
+ AcceptCallback *acceptCallbackPtr = (AcceptCallback *)Tcl_GetHashValue(hPtr);
acceptCallbackPtr->interp = NULL;
}
@@ -1251,10 +1265,10 @@ RegisterTcpServerInterpCleanup(
Tcl_HashEntry *hPtr; /* Entry for this record. */
int isNew; /* Is the entry new? */
- hTblPtr = Tcl_GetAssocData(interp, "tclTCPAcceptCallbacks", NULL);
+ hTblPtr = (Tcl_HashTable *)Tcl_GetAssocData(interp, "tclTCPAcceptCallbacks", NULL);
if (hTblPtr == NULL) {
- hTblPtr = Tcl_Alloc(sizeof(Tcl_HashTable));
+ hTblPtr = (Tcl_HashTable *)Tcl_Alloc(sizeof(Tcl_HashTable));
Tcl_InitHashTable(hTblPtr, TCL_ONE_WORD_KEYS);
Tcl_SetAssocData(interp, "tclTCPAcceptCallbacks",
TcpAcceptCallbacksDeleteProc, hTblPtr);
@@ -1297,7 +1311,7 @@ UnregisterTcpServerInterpCleanupProc(
Tcl_HashTable *hTblPtr;
Tcl_HashEntry *hPtr;
- hTblPtr = Tcl_GetAssocData(interp, "tclTCPAcceptCallbacks", NULL);
+ hTblPtr = (Tcl_HashTable *)Tcl_GetAssocData(interp, "tclTCPAcceptCallbacks", NULL);
if (hTblPtr == NULL) {
return;
}
@@ -1335,7 +1349,7 @@ AcceptCallbackProc(
char *address, /* Address of client that was accepted. */
int port) /* Port of client that was accepted. */
{
- AcceptCallback *acceptCallbackPtr = callbackData;
+ AcceptCallback *acceptCallbackPtr = (AcceptCallback *)callbackData;
/*
* Check if the callback is still valid; the interpreter may have gone
@@ -1421,7 +1435,7 @@ TcpServerCloseProc(
ClientData callbackData) /* The data passed in the call to
* Tcl_CreateCloseHandler. */
{
- AcceptCallback *acceptCallbackPtr = callbackData;
+ AcceptCallback *acceptCallbackPtr = (AcceptCallback *)callbackData;
/* The actual data. */
if (acceptCallbackPtr->interp != NULL) {
@@ -1451,7 +1465,7 @@ TcpServerCloseProc(
int
Tcl_SocketObjCmd(
- ClientData notUsed, /* Not used. */
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
@@ -1470,6 +1484,7 @@ Tcl_SocketObjCmd(
const char *host, *port, *myaddr = NULL;
Tcl_Obj *script = NULL;
Tcl_Channel chan;
+ (void)dummy;
if (TclpHasSockets(interp) != TCL_OK) {
return TCL_ERROR;
@@ -1625,7 +1640,7 @@ Tcl_SocketObjCmd(
port = TclGetString(objv[a]);
if (server) {
- AcceptCallback *acceptCallbackPtr = Tcl_Alloc(sizeof(AcceptCallback));
+ AcceptCallback *acceptCallbackPtr = (AcceptCallback *)Tcl_Alloc(sizeof(AcceptCallback));
Tcl_IncrRefCount(script);
acceptCallbackPtr->script = script;
@@ -1704,6 +1719,7 @@ Tcl_FcopyObjCmd(
Tcl_Obj *cmdPtr;
static const char *const switches[] = { "-size", "-command", NULL };
enum { FcopySize, FcopyCommand };
+ (void)dummy;
if ((objc < 3) || (objc > 7) || (objc == 4) || (objc == 6)) {
Tcl_WrongNumArgs(interp, 1, objv,
@@ -1789,7 +1805,7 @@ Tcl_FcopyObjCmd(
/* ARGSUSED */
static int
ChanPendingObjCmd(
- ClientData unused, /* Not used. */
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
@@ -1798,6 +1814,7 @@ ChanPendingObjCmd(
int index, mode;
static const char *const options[] = {"input", "output", NULL};
enum options {PENDING_INPUT, PENDING_OUTPUT};
+ (void)dummy;
if (objc != 3) {
Tcl_WrongNumArgs(interp, 1, objv, "mode channelId");
@@ -1858,6 +1875,7 @@ ChanTruncateObjCmd(
{
Tcl_Channel chan;
Tcl_WideInt length;
+ (void)dummy;
if ((objc < 2) || (objc > 3)) {
Tcl_WrongNumArgs(interp, 1, objv, "channelId ?length?");
@@ -1932,6 +1950,7 @@ ChanPipeObjCmd(
Tcl_Channel rchan, wchan;
const char *channelNames[2];
Tcl_Obj *resultPtr;
+ (void)dummy;
if (objc != 1) {
Tcl_WrongNumArgs(interp, 1, objv, "");
@@ -1975,11 +1994,12 @@ ChanPipeObjCmd(
int
TclChannelNamesCmd(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
{
+ (void)dummy;
if (objc < 1 || objc > 2) {
Tcl_WrongNumArgs(interp, 1, objv, "?pattern?");
return TCL_ERROR;
diff --git a/generic/tclIOGT.c b/generic/tclIOGT.c
index 9cda58c..5f0f55e 100644
--- a/generic/tclIOGT.c
+++ b/generic/tclIOGT.c
@@ -287,7 +287,7 @@ TclChannelTransform(
* regime of the underlying channel and to use the same for us too.
*/
- dataPtr = Tcl_Alloc(sizeof(TransformChannelData));
+ dataPtr = (TransformChannelData *)Tcl_Alloc(sizeof(TransformChannelData));
dataPtr->refCount = 1;
Tcl_DStringInit(&ds);
@@ -503,7 +503,7 @@ TransformBlockModeProc(
ClientData instanceData, /* State of transformation. */
int mode) /* New blocking mode. */
{
- TransformChannelData *dataPtr = instanceData;
+ TransformChannelData *dataPtr = (TransformChannelData *)instanceData;
if (mode == TCL_MODE_NONBLOCKING) {
dataPtr->flags |= CHANNEL_ASYNC;
@@ -535,7 +535,7 @@ TransformCloseProc(
ClientData instanceData,
Tcl_Interp *interp)
{
- TransformChannelData *dataPtr = instanceData;
+ TransformChannelData *dataPtr = (TransformChannelData *)instanceData;
/*
* Important: In this procedure 'dataPtr->self' already points to the
@@ -616,7 +616,7 @@ TransformInputProc(
int toRead,
int *errorCodePtr)
{
- TransformChannelData *dataPtr = instanceData;
+ TransformChannelData *dataPtr = (TransformChannelData *)instanceData;
int gotBytes, read, copied;
Tcl_Channel downChan;
@@ -783,7 +783,7 @@ TransformOutputProc(
int toWrite,
int *errorCodePtr)
{
- TransformChannelData *dataPtr = instanceData;
+ TransformChannelData *dataPtr = (TransformChannelData *)instanceData;
/*
* Should assert(dataPtr->mode & TCL_WRITABLE);
@@ -835,7 +835,7 @@ TransformSeekProc(
int mode, /* How to move. */
int *errorCodePtr) /* Location of error flag. */
{
- TransformChannelData *dataPtr = instanceData;
+ TransformChannelData *dataPtr = (TransformChannelData *)instanceData;
Tcl_Channel parent = Tcl_GetStackedChannel(dataPtr->self);
const Tcl_ChannelType *parentType = Tcl_GetChannelType(parent);
Tcl_DriverSeekProc *parentSeekProc = Tcl_ChannelSeekProc(parentType);
@@ -902,7 +902,7 @@ TransformWideSeekProc(
int mode, /* How to move. */
int *errorCodePtr) /* Location of error flag. */
{
- TransformChannelData *dataPtr = instanceData;
+ TransformChannelData *dataPtr = (TransformChannelData *)instanceData;
Tcl_Channel parent = Tcl_GetStackedChannel(dataPtr->self);
const Tcl_ChannelType *parentType = Tcl_GetChannelType(parent);
Tcl_DriverSeekProc *parentSeekProc = Tcl_ChannelSeekProc(parentType);
@@ -994,7 +994,7 @@ TransformSetOptionProc(
const char *optionName,
const char *value)
{
- TransformChannelData *dataPtr = instanceData;
+ TransformChannelData *dataPtr = (TransformChannelData *)instanceData;
Tcl_Channel downChan = Tcl_GetStackedChannel(dataPtr->self);
Tcl_DriverSetOptionProc *setOptionProc;
@@ -1032,7 +1032,7 @@ TransformGetOptionProc(
const char *optionName,
Tcl_DString *dsPtr)
{
- TransformChannelData *dataPtr = instanceData;
+ TransformChannelData *dataPtr = (TransformChannelData *)instanceData;
Tcl_Channel downChan = Tcl_GetStackedChannel(dataPtr->self);
Tcl_DriverGetOptionProc *getOptionProc;
@@ -1078,7 +1078,7 @@ TransformWatchProc(
ClientData instanceData, /* Channel to watch. */
int mask) /* Events of interest. */
{
- TransformChannelData *dataPtr = instanceData;
+ TransformChannelData *dataPtr = (TransformChannelData *)instanceData;
Tcl_Channel downChan;
/*
@@ -1157,7 +1157,7 @@ TransformGetFileHandleProc(
int direction, /* Direction of interest. */
ClientData *handlePtr) /* Place to store the handle into. */
{
- TransformChannelData *dataPtr = instanceData;
+ TransformChannelData *dataPtr = (TransformChannelData *)instanceData;
/*
* Return the handle belonging to parent channel. IOW, pass the request
@@ -1191,7 +1191,7 @@ TransformNotifyProc(
* transformation. */
int mask) /* The mask of occuring events. */
{
- TransformChannelData *dataPtr = clientData;
+ TransformChannelData *dataPtr = (TransformChannelData *)clientData;
/*
* An event occured in the underlying channel. This transformation doesn't
@@ -1234,7 +1234,7 @@ static void
TransformChannelHandlerTimer(
ClientData clientData) /* Transformation to query. */
{
- TransformChannelData *dataPtr = clientData;
+ TransformChannelData *dataPtr = (TransformChannelData *)clientData;
dataPtr->timer = NULL;
if (!(dataPtr->watchMask&TCL_READABLE) || ResultEmpty(&dataPtr->result)) {
@@ -1416,10 +1416,10 @@ ResultAdd(
if (r->allocated == 0) {
r->allocated = toWrite + INCREMENT;
- r->buf = Tcl_Alloc(r->allocated);
+ r->buf = (unsigned char *)Tcl_Alloc(r->allocated);
} else {
r->allocated += toWrite + INCREMENT;
- r->buf = Tcl_Realloc(r->buf, r->allocated);
+ r->buf = (unsigned char *)Tcl_Realloc(r->buf, r->allocated);
}
}
diff --git a/generic/tclIORChan.c b/generic/tclIORChan.c
index c9bfe53..a460090 100644
--- a/generic/tclIORChan.c
+++ b/generic/tclIORChan.c
@@ -492,7 +492,7 @@ static const char *msg_dstlost = "-code 1 -level 0 -errorcode NONE -errorinfo
int
TclChanCreateObjCmd(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const *objv)
@@ -518,6 +518,7 @@ TclChanCreateObjCmd(
* this interp. */
Tcl_HashEntry *hPtr; /* Entry in the above map */
int isNew; /* Placeholder. */
+ (void)dummy;
/*
* Syntax: chan create MODE CMDPREFIX
@@ -681,7 +682,7 @@ TclChanCreateObjCmd(
* as the actual channel type.
*/
- Tcl_ChannelType *clonePtr = Tcl_Alloc(sizeof(Tcl_ChannelType));
+ Tcl_ChannelType *clonePtr = (Tcl_ChannelType *)Tcl_Alloc(sizeof(Tcl_ChannelType));
memcpy(clonePtr, &tclRChannelType, sizeof(Tcl_ChannelType));
@@ -781,6 +782,7 @@ ReflectEventRun(
*/
ReflectEvent *e = (ReflectEvent *) ev;
+ (void)flags;
Tcl_NotifyChannel(e->rcPtr->chan, e->events);
return 1;
@@ -809,7 +811,7 @@ ReflectEventDelete(
int
TclChanPostEventObjCmd(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const *objv)
@@ -838,6 +840,7 @@ TclChanPostEventObjCmd(
ReflectedChannelMap *rcmPtr;/* Map of reflected channels with handlers in
* this interp. */
Tcl_HashEntry *hPtr; /* Entry in the above map */
+ (void)dummy;
/*
* Number of arguments...
@@ -882,7 +885,7 @@ TclChanPostEventObjCmd(
* have gone seriously haywire.
*/
- chan = Tcl_GetHashValue(hPtr);
+ chan = (Tcl_Channel)Tcl_GetHashValue(hPtr);
chanTypePtr = Tcl_GetChannelType(chan);
/*
@@ -898,7 +901,7 @@ TclChanPostEventObjCmd(
Tcl_Panic("TclChanPostEventObjCmd: channel is not a reflected channel");
}
- rcPtr = Tcl_GetChannelInstanceData(chan);
+ rcPtr = (ReflectedChannel *)Tcl_GetChannelInstanceData(chan);
if (rcPtr->interp != interp) {
Tcl_Panic("TclChanPostEventObjCmd: postevent accepted for call from outside interpreter");
@@ -945,7 +948,7 @@ TclChanPostEventObjCmd(
}
#if TCL_THREADS
} else {
- ReflectEvent *ev = Tcl_Alloc(sizeof(ReflectEvent));
+ ReflectEvent *ev = (ReflectEvent *)Tcl_Alloc(sizeof(ReflectEvent));
ev->header.proc = ReflectEventRun;
ev->events = events;
@@ -994,7 +997,7 @@ static void
TimerRunRead(
ClientData clientData)
{
- ReflectedChannel *rcPtr = clientData;
+ ReflectedChannel *rcPtr = (ReflectedChannel *)clientData;
rcPtr->readTimer = NULL;
Tcl_NotifyChannel(rcPtr->chan, TCL_READABLE);
}
@@ -1003,7 +1006,7 @@ static void
TimerRunWrite(
ClientData clientData)
{
- ReflectedChannel *rcPtr = clientData;
+ ReflectedChannel *rcPtr = (ReflectedChannel *)clientData;
rcPtr->writeTimer = NULL;
Tcl_NotifyChannel(rcPtr->chan, TCL_WRITABLE);
}
@@ -1152,7 +1155,7 @@ ReflectClose(
ClientData clientData,
Tcl_Interp *interp)
{
- ReflectedChannel *rcPtr = clientData;
+ ReflectedChannel *rcPtr = (ReflectedChannel *)clientData;
int result; /* Result code for 'close' */
Tcl_Obj *resObj; /* Result data for 'close' */
ReflectedChannelMap *rcmPtr;/* Map of reflected channels with handlers in
@@ -1309,7 +1312,7 @@ ReflectInput(
int toRead,
int *errorCodePtr)
{
- ReflectedChannel *rcPtr = clientData;
+ ReflectedChannel *rcPtr = (ReflectedChannel *)clientData;
Tcl_Obj *toReadObj;
size_t bytec = 0; /* Number of returned bytes */
unsigned char *bytev; /* Array of returned bytes */
@@ -1416,7 +1419,7 @@ ReflectOutput(
int toWrite,
int *errorCodePtr)
{
- ReflectedChannel *rcPtr = clientData;
+ ReflectedChannel *rcPtr = (ReflectedChannel *)clientData;
Tcl_Obj *bufObj;
Tcl_Obj *resObj; /* Result data for 'write' */
int written;
@@ -1545,7 +1548,7 @@ ReflectSeekWide(
int seekMode,
int *errorCodePtr)
{
- ReflectedChannel *rcPtr = clientData;
+ ReflectedChannel *rcPtr = (ReflectedChannel *)clientData;
Tcl_Obj *offObj, *baseObj;
Tcl_Obj *resObj; /* Result for 'seek' */
Tcl_WideInt newLoc;
@@ -1654,7 +1657,7 @@ ReflectWatch(
ClientData clientData,
int mask)
{
- ReflectedChannel *rcPtr = clientData;
+ ReflectedChannel *rcPtr = (ReflectedChannel *)clientData;
Tcl_Obj *maskObj;
/*
@@ -1726,7 +1729,7 @@ ReflectBlock(
ClientData clientData,
int nonblocking)
{
- ReflectedChannel *rcPtr = clientData;
+ ReflectedChannel *rcPtr = (ReflectedChannel *)clientData;
Tcl_Obj *blockObj;
int errorNum; /* EINVAL or EOK (success). */
Tcl_Obj *resObj; /* Result data for 'blocking' */
@@ -1793,7 +1796,7 @@ ReflectThread(
ClientData clientData,
int action)
{
- ReflectedChannel *rcPtr = clientData;
+ ReflectedChannel *rcPtr = (ReflectedChannel *)clientData;
switch (action) {
case TCL_CHANNEL_THREAD_INSERT:
@@ -1832,7 +1835,7 @@ ReflectSetOption(
const char *optionName, /* Name of requested option */
const char *newValue) /* The new value */
{
- ReflectedChannel *rcPtr = clientData;
+ ReflectedChannel *rcPtr = (ReflectedChannel *)clientData;
Tcl_Obj *optionObj, *valueObj;
int result; /* Result code for 'configure' */
Tcl_Obj *resObj; /* Result data for 'configure' */
@@ -1909,7 +1912,7 @@ ReflectGetOption(
* The bypass functions are not required.
*/
- ReflectedChannel *rcPtr = clientData;
+ ReflectedChannel *rcPtr = (ReflectedChannel *)clientData;
Tcl_Obj *optionObj;
Tcl_Obj *resObj; /* Result data for 'configure' */
int listc, result = TCL_OK;
@@ -1922,7 +1925,7 @@ ReflectGetOption(
#if TCL_THREADS
if (rcPtr->thread != Tcl_GetCurrentThread()) {
- int opcode;
+ ForwardedOperation opcode;
ForwardParam p;
p.getOpt.name = optionName;
@@ -2174,9 +2177,9 @@ NewReflectedChannel(
Tcl_Obj *handleObj)
{
ReflectedChannel *rcPtr;
- MethodName mn = METH_BLOCKING;
+ int mn = 0;
- rcPtr = Tcl_Alloc(sizeof(ReflectedChannel));
+ rcPtr = (ReflectedChannel *)Tcl_Alloc(sizeof(ReflectedChannel));
/* rcPtr->chan: Assigned by caller. Dummy data here. */
@@ -2195,7 +2198,7 @@ NewReflectedChannel(
rcPtr->cmd = TclListObjCopy(NULL, cmdpfxObj);
Tcl_IncrRefCount(rcPtr->cmd);
rcPtr->methods = Tcl_NewListObj(METH_WRITE + 1, NULL);
- while (mn <= METH_WRITE) {
+ while (mn <= (int)METH_WRITE) {
Tcl_ListObjAppendElement(NULL, rcPtr->methods,
Tcl_NewStringObj(methodNames[mn++], -1));
}
@@ -2496,10 +2499,10 @@ static ReflectedChannelMap *
GetReflectedChannelMap(
Tcl_Interp *interp)
{
- ReflectedChannelMap *rcmPtr = Tcl_GetAssocData(interp, RCMKEY, NULL);
+ ReflectedChannelMap *rcmPtr = (ReflectedChannelMap *)Tcl_GetAssocData(interp, RCMKEY, NULL);
if (rcmPtr == NULL) {
- rcmPtr = Tcl_Alloc(sizeof(ReflectedChannelMap));
+ rcmPtr = (ReflectedChannelMap *)Tcl_Alloc(sizeof(ReflectedChannelMap));
Tcl_InitHashTable(&rcmPtr->map, TCL_STRING_KEYS);
Tcl_SetAssocData(interp, RCMKEY,
(Tcl_InterpDeleteProc *) DeleteReflectedChannelMap, rcmPtr);
@@ -2554,7 +2557,7 @@ DeleteReflectedChannelMap(
ClientData clientData, /* The per-interpreter data structure. */
Tcl_Interp *interp) /* The interpreter being deleted. */
{
- ReflectedChannelMap *rcmPtr = clientData;
+ ReflectedChannelMap *rcmPtr = (ReflectedChannelMap *)clientData;
/* The map */
Tcl_HashSearch hSearch; /* Search variable. */
Tcl_HashEntry *hPtr; /* Search variable. */
@@ -2581,8 +2584,8 @@ DeleteReflectedChannelMap(
for (hPtr = Tcl_FirstHashEntry(&rcmPtr->map, &hSearch);
hPtr != NULL;
hPtr = Tcl_FirstHashEntry(&rcmPtr->map, &hSearch)) {
- chan = Tcl_GetHashValue(hPtr);
- rcPtr = Tcl_GetChannelInstanceData(chan);
+ chan = (Tcl_Channel)Tcl_GetHashValue(hPtr);
+ rcPtr = (ReflectedChannel *)Tcl_GetChannelInstanceData(chan);
MarkDead(rcPtr);
Tcl_DeleteHashEntry(hPtr);
@@ -2659,8 +2662,8 @@ DeleteReflectedChannelMap(
for (hPtr = Tcl_FirstHashEntry(&rcmPtr->map, &hSearch);
hPtr != NULL;
hPtr = Tcl_NextHashEntry(&hSearch)) {
- chan = Tcl_GetHashValue(hPtr);
- rcPtr = Tcl_GetChannelInstanceData(chan);
+ chan = (Tcl_Channel)Tcl_GetHashValue(hPtr);
+ rcPtr = (ReflectedChannel *)Tcl_GetChannelInstanceData(chan);
if (rcPtr->interp != interp) {
/*
@@ -2700,7 +2703,7 @@ GetThreadReflectedChannelMap(void)
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
if (!tsdPtr->rcmPtr) {
- tsdPtr->rcmPtr = Tcl_Alloc(sizeof(ReflectedChannelMap));
+ tsdPtr->rcmPtr = (ReflectedChannelMap *)Tcl_Alloc(sizeof(ReflectedChannelMap));
Tcl_InitHashTable(&tsdPtr->rcmPtr->map, TCL_STRING_KEYS);
Tcl_CreateThreadExitHandler(DeleteThreadReflectedChannelMap, NULL);
}
@@ -2728,13 +2731,14 @@ GetThreadReflectedChannelMap(void)
static void
DeleteThreadReflectedChannelMap(
- ClientData clientData) /* The per-thread data structure. */
+ ClientData dummy) /* The per-thread data structure. */
{
Tcl_HashSearch hSearch; /* Search variable. */
Tcl_HashEntry *hPtr; /* Search variable. */
Tcl_ThreadId self = Tcl_GetCurrentThread();
ReflectedChannelMap *rcmPtr; /* The map */
ForwardingResult *resultPtr;
+ (void)dummy;
/*
* The origin thread for one or more reflected channels is gone.
@@ -2817,8 +2821,8 @@ DeleteThreadReflectedChannelMap(
for (hPtr = Tcl_FirstHashEntry(&rcmPtr->map, &hSearch);
hPtr != NULL;
hPtr = Tcl_FirstHashEntry(&rcmPtr->map, &hSearch)) {
- Tcl_Channel chan = Tcl_GetHashValue(hPtr);
- ReflectedChannel *rcPtr = Tcl_GetChannelInstanceData(chan);
+ Tcl_Channel chan = (Tcl_Channel)Tcl_GetHashValue(hPtr);
+ ReflectedChannel *rcPtr = (ReflectedChannel *)Tcl_GetChannelInstanceData(chan);
MarkDead(rcPtr);
Tcl_DeleteHashEntry(hPtr);
@@ -2863,8 +2867,8 @@ ForwardOpToHandlerThread(
* Create and initialize the event and data structures.
*/
- evPtr = Tcl_Alloc(sizeof(ForwardingEvent));
- resultPtr = Tcl_Alloc(sizeof(ForwardingResult));
+ evPtr = (ForwardingEvent *)Tcl_Alloc(sizeof(ForwardingEvent));
+ resultPtr = (ForwardingResult *)Tcl_Alloc(sizeof(ForwardingResult));
evPtr->event.proc = ForwardProc;
evPtr->resultPtr = resultPtr;
@@ -2981,6 +2985,7 @@ ForwardProc(
ReflectedChannelMap *rcmPtr;/* Map of reflected channels with handlers in
* this interp. */
Tcl_HashEntry *hPtr; /* Entry in the above map */
+ (void)mask;
/*
* Ignore the event if no one is waiting for its result anymore.
@@ -3241,7 +3246,7 @@ ForwardProc(
* Odd number of elements is wrong. [x].
*/
- char *buf = Tcl_Alloc(200);
+ char *buf = (char *)Tcl_Alloc(200);
sprintf(buf,
"{Expected list with even number of elements, got %d %s instead}",
listc, (listc == 1 ? "element" : "elements"));
@@ -3298,7 +3303,7 @@ static void
SrcExitProc(
ClientData clientData)
{
- ForwardingEvent *evPtr = clientData;
+ ForwardingEvent *evPtr = (ForwardingEvent *)clientData;
ForwardingResult *resultPtr;
ForwardParam *paramPtr;
diff --git a/generic/tclIORTrans.c b/generic/tclIORTrans.c
index ec18767..0a68518 100644
--- a/generic/tclIORTrans.c
+++ b/generic/tclIORTrans.c
@@ -497,7 +497,7 @@ static int TransformLimit(ReflectedTransform *rtPtr,
int
TclChanPushObjCmd(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const *objv)
@@ -524,6 +524,7 @@ TclChanPushObjCmd(
* in this interp. */
Tcl_HashEntry *hPtr; /* Entry in the above map */
int isNew; /* Placeholder. */
+ (void)dummy;
/*
* Syntax: chan push CHANNEL CMDPREFIX
@@ -742,7 +743,7 @@ TclChanPushObjCmd(
int
TclChanPopObjCmd(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const *objv)
@@ -760,6 +761,7 @@ TclChanPopObjCmd(
const char *chanId; /* Tcl level channel handle */
Tcl_Channel chan; /* Channel associated to the handle */
int mode; /* Channel r/w mode */
+ (void)dummy;
/*
* Number of arguments...
@@ -881,7 +883,7 @@ ReflectClose(
ClientData clientData,
Tcl_Interp *interp)
{
- ReflectedTransform *rtPtr = clientData;
+ ReflectedTransform *rtPtr = (ReflectedTransform *)clientData;
int errorCode, errorCodeSet = 0;
int result = TCL_OK; /* Result code for 'close' */
Tcl_Obj *resObj; /* Result data for 'close' */
@@ -1057,7 +1059,7 @@ ReflectInput(
int toRead,
int *errorCodePtr)
{
- ReflectedTransform *rtPtr = clientData;
+ ReflectedTransform *rtPtr = (ReflectedTransform *)clientData;
int gotBytes, copied, readBytes;
Tcl_Obj *bufObj;
@@ -1250,7 +1252,7 @@ ReflectOutput(
int toWrite,
int *errorCodePtr)
{
- ReflectedTransform *rtPtr = clientData;
+ ReflectedTransform *rtPtr = (ReflectedTransform *)clientData;
/*
* The following check can be done before thread redirection, because we
@@ -1323,7 +1325,7 @@ ReflectSeekWide(
int seekMode,
int *errorCodePtr)
{
- ReflectedTransform *rtPtr = clientData;
+ ReflectedTransform *rtPtr = (ReflectedTransform *)clientData;
Channel *parent = (Channel *) rtPtr->parent;
Tcl_WideInt curPos; /* Position on the device. */
@@ -1442,7 +1444,7 @@ ReflectWatch(
ClientData clientData,
int mask)
{
- ReflectedTransform *rtPtr = clientData;
+ ReflectedTransform *rtPtr = (ReflectedTransform *)clientData;
Tcl_DriverWatchProc *watchProc;
watchProc = Tcl_ChannelWatchProc(Tcl_GetChannelType(rtPtr->parent));
@@ -1493,7 +1495,7 @@ ReflectBlock(
ClientData clientData,
int nonblocking)
{
- ReflectedTransform *rtPtr = clientData;
+ ReflectedTransform *rtPtr = (ReflectedTransform *)clientData;
/*
* Transformations simply record the blocking mode in their C level
@@ -1528,7 +1530,7 @@ ReflectSetOption(
const char *optionName, /* Name of requested option */
const char *newValue) /* The new value */
{
- ReflectedTransform *rtPtr = clientData;
+ ReflectedTransform *rtPtr = (ReflectedTransform *)clientData;
/*
* Transformations have no options. Thus the call is passed down unchanged
@@ -1570,7 +1572,7 @@ ReflectGetOption(
const char *optionName, /* Name of reuqested option */
Tcl_DString *dsPtr) /* String to place the result into */
{
- ReflectedTransform *rtPtr = clientData;
+ ReflectedTransform *rtPtr = (ReflectedTransform *)clientData;
/*
* Transformations have no options. Thus the call is passed down unchanged
@@ -1618,7 +1620,7 @@ ReflectHandle(
int direction,
ClientData *handlePtr)
{
- ReflectedTransform *rtPtr = clientData;
+ ReflectedTransform *rtPtr = (ReflectedTransform *)clientData;
/*
* Transformations have no handle of their own. As such we simply query
@@ -1653,7 +1655,7 @@ ReflectNotify(
ClientData clientData,
int mask)
{
- ReflectedTransform *rtPtr = clientData;
+ ReflectedTransform *rtPtr = (ReflectedTransform *)clientData;
/*
* An event occured in the underlying channel.
@@ -1753,8 +1755,9 @@ NewReflectedTransform(
int listc;
Tcl_Obj **listv;
int i;
+ (void)mode;
- rtPtr = Tcl_Alloc(sizeof(ReflectedTransform));
+ rtPtr = (ReflectedTransform *)Tcl_Alloc(sizeof(ReflectedTransform));
/* rtPtr->chan: Assigned by caller. Dummy data here. */
/* rtPtr->methods: Assigned by caller. Dummy data here. */
@@ -1801,7 +1804,7 @@ NewReflectedTransform(
*/
rtPtr->argc = listc + 2;
- rtPtr->argv = Tcl_Alloc(sizeof(Tcl_Obj *) * (listc+4));
+ rtPtr->argv = (Tcl_Obj **)Tcl_Alloc(sizeof(Tcl_Obj *) * (listc+4));
/*
* Duplicate object references.
@@ -2106,10 +2109,10 @@ static ReflectedTransformMap *
GetReflectedTransformMap(
Tcl_Interp *interp)
{
- ReflectedTransformMap *rtmPtr = Tcl_GetAssocData(interp, RTMKEY, NULL);
+ ReflectedTransformMap *rtmPtr = (ReflectedTransformMap *)Tcl_GetAssocData(interp, RTMKEY, NULL);
if (rtmPtr == NULL) {
- rtmPtr = Tcl_Alloc(sizeof(ReflectedTransformMap));
+ rtmPtr = (ReflectedTransformMap *)Tcl_Alloc(sizeof(ReflectedTransformMap));
Tcl_InitHashTable(&rtmPtr->map, TCL_STRING_KEYS);
Tcl_SetAssocData(interp, RTMKEY,
(Tcl_InterpDeleteProc *) DeleteReflectedTransformMap, rtmPtr);
@@ -2164,11 +2167,11 @@ DeleteReflectedTransformMap(
* this interp.
*/
- rtmPtr = clientData;
+ rtmPtr = (ReflectedTransformMap *)clientData;
for (hPtr = Tcl_FirstHashEntry(&rtmPtr->map, &hSearch);
hPtr != NULL;
hPtr = Tcl_FirstHashEntry(&rtmPtr->map, &hSearch)) {
- rtPtr = Tcl_GetHashValue(hPtr);
+ rtPtr = (ReflectedTransform *)Tcl_GetHashValue(hPtr);
rtPtr->dead = 1;
Tcl_DeleteHashEntry(hPtr);
@@ -2192,7 +2195,7 @@ DeleteReflectedTransformMap(
for (hPtr = Tcl_FirstHashEntry(&rtmPtr->map, &hSearch);
hPtr != NULL;
hPtr = Tcl_NextHashEntry(&hSearch)) {
- rtPtr = Tcl_GetHashValue(hPtr);
+ rtPtr = (ReflectedTransform *)Tcl_GetHashValue(hPtr);
if (rtPtr->interp != interp) {
/*
@@ -2272,7 +2275,7 @@ GetThreadReflectedTransformMap(void)
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
if (!tsdPtr->rtmPtr) {
- tsdPtr->rtmPtr = Tcl_Alloc(sizeof(ReflectedTransformMap));
+ tsdPtr->rtmPtr = (ReflectedTransformMap *)Tcl_Alloc(sizeof(ReflectedTransformMap));
Tcl_InitHashTable(&tsdPtr->rtmPtr->map, TCL_STRING_KEYS);
Tcl_CreateThreadExitHandler(DeleteThreadReflectedTransformMap, NULL);
}
@@ -2300,13 +2303,14 @@ GetThreadReflectedTransformMap(void)
static void
DeleteThreadReflectedTransformMap(
- ClientData clientData) /* The per-thread data structure. */
+ ClientData dummy) /* The per-thread data structure. */
{
Tcl_HashSearch hSearch; /* Search variable. */
Tcl_HashEntry *hPtr; /* Search variable. */
Tcl_ThreadId self = Tcl_GetCurrentThread();
ReflectedTransformMap *rtmPtr; /* The map */
ForwardingResult *resultPtr;
+ (void)dummy;
/*
* The origin thread for one or more reflected channels is gone.
@@ -2324,7 +2328,7 @@ DeleteThreadReflectedTransformMap(
for (hPtr = Tcl_FirstHashEntry(&rtmPtr->map, &hSearch);
hPtr != NULL;
hPtr = Tcl_FirstHashEntry(&rtmPtr->map, &hSearch)) {
- ReflectedTransform *rtPtr = Tcl_GetHashValue(hPtr);
+ ReflectedTransform *rtPtr = (ReflectedTransform *)Tcl_GetHashValue(hPtr);
rtPtr->dead = 1;
FreeReflectedTransformArgs(rtPtr);
@@ -2407,8 +2411,8 @@ ForwardOpToOwnerThread(
* Create and initialize the event and data structures.
*/
- evPtr = Tcl_Alloc(sizeof(ForwardingEvent));
- resultPtr = Tcl_Alloc(sizeof(ForwardingResult));
+ evPtr = (ForwardingEvent *)Tcl_Alloc(sizeof(ForwardingEvent));
+ resultPtr = (ForwardingResult *)Tcl_Alloc(sizeof(ForwardingResult));
evPtr->event.proc = ForwardProc;
evPtr->resultPtr = resultPtr;
@@ -2519,6 +2523,7 @@ ForwardProc(
/* Map of reflected channels with handlers in
* this interp. */
Tcl_HashEntry *hPtr; /* Entry in the above map */
+ (void)mask;
/*
* Ignore the event if no one is waiting for its result anymore.
@@ -2601,7 +2606,7 @@ ForwardProc(
paramPtr->transform.size = bytec;
if (bytec > 0) {
- paramPtr->transform.buf = Tcl_Alloc(bytec);
+ paramPtr->transform.buf = (char *)Tcl_Alloc(bytec);
memcpy(paramPtr->transform.buf, bytev, bytec);
} else {
paramPtr->transform.buf = NULL;
@@ -2635,7 +2640,7 @@ ForwardProc(
paramPtr->transform.size = bytec;
if (bytec > 0) {
- paramPtr->transform.buf = Tcl_Alloc(bytec);
+ paramPtr->transform.buf = (char *)Tcl_Alloc(bytec);
memcpy(paramPtr->transform.buf, bytev, bytec);
} else {
paramPtr->transform.buf = NULL;
@@ -2664,7 +2669,7 @@ ForwardProc(
paramPtr->transform.size = bytec;
if (bytec > 0) {
- paramPtr->transform.buf = Tcl_Alloc(bytec);
+ paramPtr->transform.buf = (char *)Tcl_Alloc(bytec);
memcpy(paramPtr->transform.buf, bytev, bytec);
} else {
paramPtr->transform.buf = NULL;
@@ -2691,7 +2696,7 @@ ForwardProc(
paramPtr->transform.size = bytec;
if (bytec > 0) {
- paramPtr->transform.buf = Tcl_Alloc(bytec);
+ paramPtr->transform.buf = (char *)Tcl_Alloc(bytec);
memcpy(paramPtr->transform.buf, bytev, bytec);
} else {
paramPtr->transform.buf = NULL;
@@ -2751,7 +2756,7 @@ static void
SrcExitProc(
ClientData clientData)
{
- ForwardingEvent *evPtr = clientData;
+ ForwardingEvent *evPtr = (ForwardingEvent *)clientData;
ForwardingResult *resultPtr;
ForwardParam *paramPtr;
@@ -2891,7 +2896,7 @@ static void
TimerRun(
ClientData clientData)
{
- ReflectedTransform *rtPtr = clientData;
+ ReflectedTransform *rtPtr = (ReflectedTransform *)clientData;
rtPtr->timer = NULL;
Tcl_NotifyChannel(rtPtr->chan, TCL_READABLE);
diff --git a/generic/tclIOUtil.c b/generic/tclIOUtil.c
index d8ba787..5c0ce0b 100644
--- a/generic/tclIOUtil.c
+++ b/generic/tclIOUtil.c
@@ -82,7 +82,6 @@ static void Disclaim(void);
static void * DivertFindSymbol(Tcl_Interp *interp,
Tcl_LoadHandle loadHandle, const char *symbol);
static void DivertUnloadFile(Tcl_LoadHandle loadHandle);
-
/*
* Functions that provide native filesystem support. They are private and
@@ -417,7 +416,7 @@ static void
FsThrExitProc(
ClientData cd)
{
- ThreadSpecificData *tsdPtr = cd;
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)cd;
FilesystemRecord *fsRecPtr = NULL, *tmpFsRecPtr = NULL;
/*
@@ -579,7 +578,7 @@ FsRecacheFilesystemList(void)
list = NULL;
fsRecPtr = tmpFsRecPtr;
while (fsRecPtr != NULL) {
- tmpFsRecPtr = Tcl_Alloc(sizeof(FilesystemRecord));
+ tmpFsRecPtr = (FilesystemRecord *)Tcl_Alloc(sizeof(FilesystemRecord));
*tmpFsRecPtr = *fsRecPtr;
tmpFsRecPtr->nextPtr = list;
tmpFsRecPtr->prevPtr = NULL;
@@ -853,7 +852,7 @@ Tcl_FSRegister(
return TCL_ERROR;
}
- newFilesystemPtr = Tcl_Alloc(sizeof(FilesystemRecord));
+ newFilesystemPtr = (FilesystemRecord *)Tcl_Alloc(sizeof(FilesystemRecord));
newFilesystemPtr->clientData = clientData;
newFilesystemPtr->fsPtr = fsPtr;
@@ -1934,9 +1933,9 @@ EvalFileCallback(
int result)
{
Interp *iPtr = (Interp *) interp;
- Tcl_Obj *oldScriptFile = data[0];
- Tcl_Obj *pathPtr = data[1];
- Tcl_Obj *objPtr = data[2];
+ Tcl_Obj *oldScriptFile = (Tcl_Obj *)data[0];
+ Tcl_Obj *pathPtr = (Tcl_Obj *)data[1];
+ Tcl_Obj *objPtr = (Tcl_Obj *)data[2];
/*
* Restore the original iPtr->scriptFile value, but because the value may
@@ -2319,6 +2318,8 @@ NativeFileAttrStrings(
Tcl_Obj *pathPtr,
Tcl_Obj **objPtrRef)
{
+ (void)pathPtr;
+ (void)objPtrRef;
return tclpFileAttrStrings;
}
@@ -3027,6 +3028,7 @@ Tcl_FSLoadFile(
const char *symbols[3];
void *procPtrs[2];
int res;
+ (void)unloadProcPtr;
symbols[0] = sym1;
symbols[1] = sym2;
@@ -3102,6 +3104,7 @@ skipUnlink(
#ifdef hpux
+ (void)shlibFile;
return 1;
#else
char *skipstr = getenv("TCL_TEMPLOAD_NO_UNLINK");
@@ -3110,7 +3113,9 @@ skipUnlink(
return atoi(skipstr);
}
-#ifdef TCL_TEMPLOAD_NO_UNLINK
+#ifndef TCL_TEMPLOAD_NO_UNLINK
+ (void)shlibFile;
+#else
/* At built time TCL_TEMPLOAD_NO_UNLINK can be set manually to control whether
* this automatic overriding of unlink is included.
*/
@@ -3246,7 +3251,7 @@ Tcl_LoadFile(
Tcl_Close(interp, data);
goto mustCopyToTempAnyway;
}
- ret = Tcl_Read(data, buffer, size);
+ ret = Tcl_Read(data, (char *)buffer, size);
Tcl_Close(interp, data);
ret = TclpLoadMemory(interp, buffer, size, ret, handlePtr,
&unloadProcPtr, flags);
@@ -3361,7 +3366,7 @@ Tcl_LoadFile(
* Divert the unloading in order to unload and cleanup the temporary file.
*/
- tvdlPtr = Tcl_Alloc(sizeof(FsDivertLoad));
+ tvdlPtr = (FsDivertLoad *)Tcl_Alloc(sizeof(FsDivertLoad));
/*
* Remember three pieces of information in order to clean up the diverted
@@ -3402,7 +3407,7 @@ Tcl_LoadFile(
copyToPtr = NULL;
- divertedLoadHandle = Tcl_Alloc(sizeof(struct Tcl_LoadHandle_));
+ divertedLoadHandle = (Tcl_LoadHandle)Tcl_Alloc(sizeof(struct Tcl_LoadHandle_));
divertedLoadHandle->clientData = tvdlPtr;
divertedLoadHandle->findSymbolProcPtr = DivertFindSymbol;
divertedLoadHandle->unloadFileProcPtr = DivertUnloadFile;
@@ -4685,6 +4690,7 @@ NativeFilesystemSeparator(
Tcl_Obj *pathPtr)
{
const char *separator = NULL; /* lint */
+ (void)pathPtr;
switch (tclPlatform) {
case TCL_PLATFORM_UNIX:
diff --git a/generic/tclIndexObj.c b/generic/tclIndexObj.c
index 4d3e7db..6a49b62 100644
--- a/generic/tclIndexObj.c
+++ b/generic/tclIndexObj.c
@@ -131,7 +131,7 @@ GetIndexFromObjList(
* Build a string table from the list.
*/
- tablePtr = Tcl_Alloc((objc + 1) * sizeof(char *));
+ tablePtr = (const char **)Tcl_Alloc((objc + 1) * sizeof(char *));
for (t = 0; t < objc; t++) {
if (objv[t] == objPtr) {
/*
@@ -215,7 +215,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;
@@ -239,7 +239,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') {
@@ -279,11 +279,11 @@ Tcl_GetIndexFromObjStruct(
if (!(flags & INDEX_TEMP_TABLE)) {
irPtr = TclFetchIntRep(objPtr, &indexType);
if (irPtr) {
- indexRep = irPtr->twoPtrValue.ptr1;
+ indexRep = (IndexRep *)irPtr->twoPtrValue.ptr1;
} else {
Tcl_ObjIntRep ir;
- indexRep = Tcl_Alloc(sizeof(IndexRep));
+ indexRep = (IndexRep*)Tcl_Alloc(sizeof(IndexRep));
ir.twoPtrValue.ptr1 = indexRep;
Tcl_StoreIntRep(objPtr, &indexType, &ir);
}
@@ -304,7 +304,7 @@ Tcl_GetIndexFromObjStruct(
int count = 0;
TclNewObj(resultPtr);
- entryPtr = tablePtr;
+ entryPtr = (const char* const *)tablePtr;
while ((*entryPtr != NULL) && !**entryPtr) {
entryPtr = NEXT_ENTRY(entryPtr, offset);
}
@@ -359,6 +359,7 @@ SetIndexFromAny(
Tcl_Interp *interp, /* Used for error reporting if not NULL. */
Tcl_Obj *objPtr) /* The object to convert. */
{
+ (void)objPtr;
if (interp) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"can't convert value to index except via Tcl_GetIndexFromObj API",
@@ -388,7 +389,7 @@ static void
UpdateStringOfIndex(
Tcl_Obj *objPtr)
{
- IndexRep *indexRep = TclFetchIntRep(objPtr, &indexType)->twoPtrValue.ptr1;
+ IndexRep *indexRep = (IndexRep *)TclFetchIntRep(objPtr, &indexType)->twoPtrValue.ptr1;
const char *indexStr = EXPAND_OF(indexRep);
Tcl_InitStringRep(objPtr, indexStr, strlen(indexStr));
@@ -418,7 +419,7 @@ DupIndex(
Tcl_Obj *dupPtr)
{
Tcl_ObjIntRep ir;
- IndexRep *dupIndexRep = Tcl_Alloc(sizeof(IndexRep));
+ IndexRep *dupIndexRep = (IndexRep *)Tcl_Alloc(sizeof(IndexRep));
memcpy(dupIndexRep, TclFetchIntRep(srcPtr, &indexType)->twoPtrValue.ptr1,
sizeof(IndexRep));
@@ -505,7 +506,7 @@ TclInitPrefixCmd(
static int
PrefixMatchObjCmd(
- ClientData clientData, /* Not used. */
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
@@ -521,6 +522,7 @@ PrefixMatchObjCmd(
enum matchOptions {
PRFMATCH_ERROR, PRFMATCH_EXACT, PRFMATCH_MESSAGE
};
+ (void)dummy;
if (objc < 3) {
Tcl_WrongNumArgs(interp, 1, objv, "?options? table string");
@@ -629,7 +631,7 @@ PrefixMatchObjCmd(
static int
PrefixAllObjCmd(
- ClientData clientData, /* Not used. */
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
@@ -638,6 +640,7 @@ PrefixAllObjCmd(
size_t length, elemLength;
const char *string, *elemString;
Tcl_Obj **tableObjv, *resultPtr;
+ (void)dummy;
if (objc != 3) {
Tcl_WrongNumArgs(interp, 1, objv, "table string");
@@ -687,7 +690,7 @@ PrefixAllObjCmd(
static int
PrefixLongestObjCmd(
- ClientData clientData, /* Not used. */
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
@@ -696,6 +699,7 @@ PrefixLongestObjCmd(
size_t i, length, elemLength, resultLength;
const char *string, *elemString, *resultString;
Tcl_Obj **tableObjv;
+ (void)dummy;
if (objc != 3) {
Tcl_WrongNumArgs(interp, 1, objv, "table string");
@@ -878,7 +882,7 @@ Tcl_WrongNumArgs(
const Tcl_ObjIntRep *irPtr;
if ((irPtr = TclFetchIntRep(origObjv[i], &indexType))) {
- IndexRep *indexRep = irPtr->twoPtrValue.ptr1;
+ IndexRep *indexRep = (IndexRep *)irPtr->twoPtrValue.ptr1;
elementStr = EXPAND_OF(indexRep);
elemLen = strlen(elementStr);
@@ -889,7 +893,7 @@ Tcl_WrongNumArgs(
len = TclScanElement(elementStr, elemLen, &flags);
if (len != elemLen) {
- char *quotedElementStr = TclStackAlloc(interp, len + 1);
+ char *quotedElementStr = (char *)TclStackAlloc(interp, len + 1);
len = TclConvertElement(elementStr, elemLen,
quotedElementStr, flags);
@@ -925,7 +929,7 @@ Tcl_WrongNumArgs(
const Tcl_ObjIntRep *irPtr;
if ((irPtr = TclFetchIntRep(objv[i], &indexType))) {
- IndexRep *indexRep = irPtr->twoPtrValue.ptr1;
+ IndexRep *indexRep = (IndexRep *)irPtr->twoPtrValue.ptr1;
Tcl_AppendStringsToObj(objPtr, EXPAND_OF(indexRep), NULL);
} else {
@@ -938,7 +942,7 @@ Tcl_WrongNumArgs(
len = TclScanElement(elementStr, elemLen, &flags);
if (len != elemLen) {
- char *quotedElementStr = TclStackAlloc(interp, len + 1);
+ char *quotedElementStr = (char *)TclStackAlloc(interp, len + 1);
len = TclConvertElement(elementStr, elemLen,
quotedElementStr, flags);
@@ -1040,7 +1044,7 @@ Tcl_ParseArgsObjv(
*/
nrem = 1;
- leftovers = Tcl_Alloc((1 + *objcPtr) * sizeof(Tcl_Obj *));
+ leftovers = (Tcl_Obj **)Tcl_Alloc((1 + *objcPtr) * sizeof(Tcl_Obj *));
leftovers[0] = objv[0];
} else {
nrem = 0;
@@ -1224,7 +1228,7 @@ Tcl_ParseArgsObjv(
}
leftovers[nrem] = NULL;
*objcPtr = nrem++;
- *remObjv = Tcl_Realloc(leftovers, nrem * sizeof(Tcl_Obj *));
+ *remObjv = (Tcl_Obj **)Tcl_Realloc(leftovers, nrem * sizeof(Tcl_Obj *));
return TCL_OK;
/*
diff --git a/generic/tclInt.h b/generic/tclInt.h
index 72ec2b2..4eb929a 100644
--- a/generic/tclInt.h
+++ b/generic/tclInt.h
@@ -4262,7 +4262,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)
@@ -4362,7 +4362,7 @@ MODULE_SCOPE void TclDbInitNewObj(Tcl_Obj *objPtr, const char *file,
(objPtr)->bytes = &tclEmptyString; \
(objPtr)->length = 0; \
} else { \
- (objPtr)->bytes = Tcl_Alloc((len) + 1); \
+ (objPtr)->bytes = (char *)Tcl_Alloc((len) + 1); \
memcpy((objPtr)->bytes, (bytePtr) ? (bytePtr) : &tclEmptyString, (len)); \
(objPtr)->bytes[len] = '\0'; \
(objPtr)->length = (len); \
@@ -4452,6 +4452,21 @@ MODULE_SCOPE void TclDbInitNewObj(Tcl_Obj *objPtr, const char *file,
}
/*
+ * These form part of the native filesystem support. They are needed here
+ * because we have a few native filesystem functions (which are the same for
+ * win/unix) in this file.
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+MODULE_SCOPE const char *const tclpFileAttrStrings[];
+MODULE_SCOPE const TclFileAttrProcs tclpFileAttrProcs[];
+#ifdef __cplusplus
+}
+#endif
+
+/*
*----------------------------------------------------------------
* Macro used by the Tcl core to test whether an object has a
* string representation (or is a 'pure' internal value).
@@ -4481,7 +4496,7 @@ MODULE_SCOPE void TclDbInitNewObj(Tcl_Obj *objPtr, const char *file,
if (bignumPayload == -1) { \
(bignum) = *((mp_int *) bignumObj->internalRep.twoPtrValue.ptr1); \
} else { \
- (bignum).dp = bignumObj->internalRep.twoPtrValue.ptr1; \
+ (bignum).dp = (mp_digit *)bignumObj->internalRep.twoPtrValue.ptr1; \
(bignum).sign = bignumPayload >> 30; \
(bignum).alloc = (bignumPayload >> 15) & 0x7fff; \
(bignum).used = bignumPayload & 0x7fff; \
@@ -4918,8 +4933,8 @@ MODULE_SCOPE Tcl_PackageInitProc Procbodytest_SafeInit;
Tcl_Obj *_objPtr; \
TCL_CT_ASSERT((nbytes)<=sizeof(Tcl_Obj)); \
TclIncrObjsAllocated(); \
- TclAllocObjStorageEx((interp), _objPtr); \
- memPtr = (void *)_objPtr; \
+ TclAllocObjStorageEx((interp), (_objPtr)); \
+ *(void **)&memPtr = (void *) (_objPtr); \
} while (0)
#define TclSmallFreeEx(interp, memPtr) \
@@ -4934,7 +4949,7 @@ MODULE_SCOPE Tcl_PackageInitProc Procbodytest_SafeInit;
Tcl_Obj *_objPtr; \
TCL_CT_ASSERT((nbytes)<=sizeof(Tcl_Obj)); \
TclNewObj(_objPtr); \
- memPtr = (void *)_objPtr; \
+ *(void **)memPtr = (void *) _objPtr; \
} while (0)
#define TclSmallFreeEx(interp, memPtr) \
diff --git a/generic/tclInterp.c b/generic/tclInterp.c
index 71c27a9..52fc627 100644
--- a/generic/tclInterp.c
+++ b/generic/tclInterp.c
@@ -336,7 +336,7 @@ Tcl_Init(
Tcl_Interp *interp) /* Interpreter to initialize. */
{
PkgName pkgName = {NULL, "Tcl"};
- PkgName **names = TclInitPkgFiles(interp);
+ PkgName **names = (PkgName **)TclInitPkgFiles(interp);
int result = TCL_ERROR;
pkgName.nextPtr = *names;
@@ -485,7 +485,7 @@ TclInterpInit(
Master *masterPtr;
Slave *slavePtr;
- interpInfoPtr = Tcl_Alloc(sizeof(InterpInfo));
+ interpInfoPtr = (InterpInfo *)Tcl_Alloc(sizeof(InterpInfo));
((Interp *) interp)->interpInfo = interpInfoPtr;
masterPtr = &interpInfoPtr->master;
@@ -1037,7 +1037,7 @@ NRInterpCmd(
resultPtr = Tcl_NewObj();
hPtr = Tcl_FirstHashEntry(&iiPtr->master.slaveTable, &hashSearch);
for ( ; hPtr != NULL; hPtr = Tcl_NextHashEntry(&hashSearch)) {
- string = Tcl_GetHashKey(&iiPtr->master.slaveTable, hPtr);
+ string = (char *)Tcl_GetHashKey(&iiPtr->master.slaveTable, hPtr);
Tcl_ListObjAppendElement(NULL, resultPtr,
Tcl_NewStringObj(string, -1));
}
@@ -1108,7 +1108,7 @@ NRInterpCmd(
NULL);
return TCL_ERROR;
}
- aliasPtr = Tcl_GetHashValue(hPtr);
+ aliasPtr = (Alias *)Tcl_GetHashValue(hPtr);
if (Tcl_GetInterpPath(interp, aliasPtr->targetInterp) != TCL_OK) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"target interpreter for alias \"%s\" in path \"%s\" is "
@@ -1191,7 +1191,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]);
@@ -1297,7 +1297,7 @@ Tcl_GetAlias(
Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "ALIAS", aliasName, NULL);
return TCL_ERROR;
}
- aliasPtr = Tcl_GetHashValue(hPtr);
+ aliasPtr = (Alias *)Tcl_GetHashValue(hPtr);
objc = aliasPtr->objc;
objv = &aliasPtr->objPtr;
@@ -1359,7 +1359,7 @@ Tcl_GetAliasObj(
Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "ALIAS", aliasName, NULL);
return TCL_ERROR;
}
- aliasPtr = Tcl_GetHashValue(hPtr);
+ aliasPtr = (Alias *)Tcl_GetHashValue(hPtr);
objc = aliasPtr->objc;
objv = &aliasPtr->objPtr;
@@ -1428,7 +1428,7 @@ TclPreventAliasLoop(
* chain then we have a loop.
*/
- aliasPtr = cmdPtr->objClientData;
+ aliasPtr = (Alias *)cmdPtr->objClientData;
nextAliasPtr = aliasPtr;
while (1) {
Tcl_Obj *cmdNamePtr;
@@ -1477,7 +1477,7 @@ TclPreventAliasLoop(
&& aliasCmdPtr->objProc != TclLocalAliasObjCmd) {
return TCL_OK;
}
- nextAliasPtr = aliasCmdPtr->objClientData;
+ nextAliasPtr = (Alias *)aliasCmdPtr->objClientData;
}
/* NOTREACHED */
@@ -1520,7 +1520,7 @@ AliasCreate(
Tcl_Obj **prefv;
int isNew, i;
- aliasPtr = Tcl_Alloc(sizeof(Alias) + objc * sizeof(Tcl_Obj *));
+ aliasPtr = (Alias *)Tcl_Alloc(sizeof(Alias) + objc * sizeof(Tcl_Obj *));
aliasPtr->token = namePtr;
Tcl_IncrRefCount(aliasPtr->token);
aliasPtr->targetInterp = masterInterp;
@@ -1628,7 +1628,7 @@ AliasCreate(
* interp alias {} foo {} zop # Now recreate "foo"...
*/
- targetPtr = Tcl_Alloc(sizeof(Target));
+ targetPtr = (Target *)Tcl_Alloc(sizeof(Target));
targetPtr->slaveCmd = aliasPtr->slaveCmd;
targetPtr->slaveInterp = slaveInterp;
@@ -1689,7 +1689,7 @@ AliasDelete(
TclGetString(namePtr), NULL);
return TCL_ERROR;
}
- aliasPtr = Tcl_GetHashValue(hPtr);
+ aliasPtr = (Alias *)Tcl_GetHashValue(hPtr);
Tcl_DeleteCommandFromToken(slaveInterp, aliasPtr->slaveCmd);
return TCL_OK;
}
@@ -1734,7 +1734,7 @@ AliasDescribe(
if (hPtr == NULL) {
return TCL_OK;
}
- aliasPtr = Tcl_GetHashValue(hPtr);
+ aliasPtr = (Alias *)Tcl_GetHashValue(hPtr);
prefixPtr = Tcl_NewListObj(aliasPtr->objc, &aliasPtr->objPtr);
Tcl_SetObjResult(interp, prefixPtr);
return TCL_OK;
@@ -1771,7 +1771,7 @@ AliasList(
entryPtr = Tcl_FirstHashEntry(&slavePtr->aliasTable, &hashSearch);
for ( ; entryPtr != NULL; entryPtr = Tcl_NextHashEntry(&hashSearch)) {
- aliasPtr = Tcl_GetHashValue(entryPtr);
+ aliasPtr = (Alias *)Tcl_GetHashValue(entryPtr);
Tcl_ListObjAppendElement(NULL, resultPtr, aliasPtr->token);
}
Tcl_SetObjResult(interp, resultPtr);
@@ -1812,7 +1812,7 @@ AliasNRCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument vector. */
{
- Alias *aliasPtr = clientData;
+ Alias *aliasPtr = (Alias *)clientData;
int prefc, cmdc, i;
Tcl_Obj **prefv, **cmdv;
Tcl_Obj *listPtr;
@@ -1861,7 +1861,7 @@ TclAliasObjCmd(
Tcl_Obj *const objv[]) /* Argument vector. */
{
#define ALIAS_CMDV_PREALLOC 10
- Alias *aliasPtr = clientData;
+ Alias *aliasPtr = (Alias *)clientData;
Tcl_Interp *targetInterp = aliasPtr->targetInterp;
int result, prefc, cmdc, i;
Tcl_Obj **prefv, **cmdv;
@@ -1880,7 +1880,7 @@ TclAliasObjCmd(
if (cmdc <= ALIAS_CMDV_PREALLOC) {
cmdv = cmdArr;
} else {
- cmdv = TclStackAlloc(interp, cmdc * sizeof(Tcl_Obj *));
+ cmdv = (Tcl_Obj **)TclStackAlloc(interp, cmdc * sizeof(Tcl_Obj *));
}
memcpy(cmdv, prefv, prefc * sizeof(Tcl_Obj *));
@@ -1952,7 +1952,7 @@ TclLocalAliasObjCmd(
Tcl_Obj *const objv[]) /* Argument vector. */
{
#define ALIAS_CMDV_PREALLOC 10
- Alias *aliasPtr = clientData;
+ Alias *aliasPtr = (Alias *)clientData;
int result, prefc, cmdc, i;
Tcl_Obj **prefv, **cmdv;
Tcl_Obj *cmdArr[ALIAS_CMDV_PREALLOC];
@@ -1970,7 +1970,7 @@ TclLocalAliasObjCmd(
if (cmdc <= ALIAS_CMDV_PREALLOC) {
cmdv = cmdArr;
} else {
- cmdv = TclStackAlloc(interp, cmdc * sizeof(Tcl_Obj *));
+ cmdv = (Tcl_Obj **)TclStackAlloc(interp, cmdc * sizeof(Tcl_Obj *));
}
memcpy(cmdv, prefv, prefc * sizeof(Tcl_Obj *));
@@ -2033,7 +2033,7 @@ static void
AliasObjCmdDeleteProc(
ClientData clientData) /* The alias record for this alias. */
{
- Alias *aliasPtr = clientData;
+ Alias *aliasPtr = (Alias *)clientData;
Target *targetPtr;
int i;
Tcl_Obj **objv;
@@ -2209,7 +2209,7 @@ TclSetSlaveCancelFlags(
hPtr = Tcl_FirstHashEntry(&masterPtr->slaveTable, &hashSearch);
for ( ; hPtr != NULL; hPtr = Tcl_NextHashEntry(&hashSearch)) {
- slavePtr = Tcl_GetHashValue(hPtr);
+ slavePtr = (Slave *)Tcl_GetHashValue(hPtr);
iPtr = (Interp *) slavePtr->slaveInterp;
if (iPtr == NULL) {
@@ -2274,7 +2274,7 @@ Tcl_GetInterpPath(
return TCL_ERROR;
}
Tcl_ListObjAppendElement(NULL, Tcl_GetObjResult(askingInterp),
- Tcl_NewStringObj(Tcl_GetHashKey(&iiPtr->master.slaveTable,
+ Tcl_NewStringObj((const char *)Tcl_GetHashKey(&iiPtr->master.slaveTable,
iiPtr->slave.slaveEntryPtr), -1));
return TCL_OK;
}
@@ -2322,7 +2322,7 @@ GetInterp(
searchInterp = NULL;
break;
}
- slavePtr = Tcl_GetHashValue(hPtr);
+ slavePtr = (Slave *)Tcl_GetHashValue(hPtr);
searchInterp = slavePtr->slaveInterp;
if (searchInterp == NULL) {
break;
@@ -2548,7 +2548,7 @@ NRSlaveCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
- Tcl_Interp *slaveInterp = clientData;
+ Tcl_Interp *slaveInterp = (Tcl_Interp *)clientData;
int index;
static const char *const options[] = {
"alias", "aliases", "bgerror", "debug",
@@ -2752,7 +2752,7 @@ SlaveObjCmdDeleteProc(
ClientData clientData) /* The SlaveRecord for the command. */
{
Slave *slavePtr; /* Interim storage for Slave record. */
- Tcl_Interp *slaveInterp = clientData;
+ Tcl_Interp *slaveInterp = (Tcl_Interp *)clientData;
/* And for a slave interp. */
slavePtr = &((InterpInfo *) ((Interp *) slaveInterp)->interpInfo)->slave;
@@ -3092,7 +3092,7 @@ SlaveHidden(
hPtr != NULL;
hPtr = Tcl_NextHashEntry(&hSearch)) {
Tcl_ListObjAppendElement(NULL, listObjPtr,
- Tcl_NewStringObj(Tcl_GetHashKey(hTblPtr, hPtr), -1));
+ Tcl_NewStringObj((const char *)Tcl_GetHashKey(hTblPtr, hPtr), -1));
}
}
Tcl_SetObjResult(interp, listObjPtr);
@@ -3608,7 +3608,7 @@ Tcl_LimitAddHandler(
* Allocate a handler record.
*/
- handlerPtr = Tcl_Alloc(sizeof(LimitHandler));
+ handlerPtr = (LimitHandler *)Tcl_Alloc(sizeof(LimitHandler));
handlerPtr->flags = 0;
handlerPtr->handlerProc = handlerProc;
handlerPtr->clientData = clientData;
@@ -4065,8 +4065,8 @@ static void
TimeLimitCallback(
ClientData clientData)
{
- Tcl_Interp *interp = clientData;
- Interp *iPtr = clientData;
+ Tcl_Interp *interp = (Tcl_Interp *)clientData;
+ Interp *iPtr = (Interp *)clientData;
int code;
Tcl_Preserve(interp);
@@ -4209,7 +4209,7 @@ static void
DeleteScriptLimitCallback(
ClientData clientData)
{
- ScriptLimitCallback *limitCBPtr = clientData;
+ ScriptLimitCallback *limitCBPtr = (ScriptLimitCallback *)clientData;
Tcl_DecrRefCount(limitCBPtr->scriptObj);
if (limitCBPtr->entryPtr != NULL) {
@@ -4241,7 +4241,7 @@ CallScriptLimitCallback(
ClientData clientData,
Tcl_Interp *dummy) /* Interpreter which failed the limit */
{
- ScriptLimitCallback *limitCBPtr = clientData;
+ ScriptLimitCallback *limitCBPtr = (ScriptLimitCallback *)clientData;
int code;
(void)dummy;
@@ -4310,13 +4310,13 @@ SetScriptLimitCallback(
hashPtr = Tcl_CreateHashEntry(&iPtr->limit.callbacks, &key,
&isNew);
if (!isNew) {
- limitCBPtr = Tcl_GetHashValue(hashPtr);
+ limitCBPtr = (ScriptLimitCallback *)Tcl_GetHashValue(hashPtr);
limitCBPtr->entryPtr = NULL;
Tcl_LimitRemoveHandler(targetInterp, type, CallScriptLimitCallback,
limitCBPtr);
}
- limitCBPtr = Tcl_Alloc(sizeof(ScriptLimitCallback));
+ limitCBPtr = (ScriptLimitCallback *)Tcl_Alloc(sizeof(ScriptLimitCallback));
limitCBPtr->interp = interp;
limitCBPtr->scriptObj = scriptObj;
limitCBPtr->entryPtr = hashPtr;
@@ -4505,7 +4505,7 @@ SlaveCommandLimitCmd(
key.type = TCL_LIMIT_COMMANDS;
hPtr = Tcl_FindHashEntry(&iPtr->limit.callbacks, (char *) &key);
if (hPtr != NULL) {
- limitCBPtr = Tcl_GetHashValue(hPtr);
+ limitCBPtr = (ScriptLimitCallback *)Tcl_GetHashValue(hPtr);
if (limitCBPtr != NULL && limitCBPtr->scriptObj != NULL) {
Tcl_DictObjPut(NULL, dictPtr, Tcl_NewStringObj(options[0], -1),
limitCBPtr->scriptObj);
@@ -4547,7 +4547,7 @@ SlaveCommandLimitCmd(
key.type = TCL_LIMIT_COMMANDS;
hPtr = Tcl_FindHashEntry(&iPtr->limit.callbacks, (char *) &key);
if (hPtr != NULL) {
- limitCBPtr = Tcl_GetHashValue(hPtr);
+ limitCBPtr = (ScriptLimitCallback *)Tcl_GetHashValue(hPtr);
if (limitCBPtr != NULL && limitCBPtr->scriptObj != NULL) {
Tcl_SetObjResult(interp, limitCBPtr->scriptObj);
}
@@ -4694,7 +4694,7 @@ SlaveTimeLimitCmd(
key.type = TCL_LIMIT_TIME;
hPtr = Tcl_FindHashEntry(&iPtr->limit.callbacks, (char *) &key);
if (hPtr != NULL) {
- limitCBPtr = Tcl_GetHashValue(hPtr);
+ limitCBPtr = (ScriptLimitCallback *)Tcl_GetHashValue(hPtr);
if (limitCBPtr != NULL && limitCBPtr->scriptObj != NULL) {
Tcl_DictObjPut(NULL, dictPtr, Tcl_NewStringObj(options[0], -1),
limitCBPtr->scriptObj);
@@ -4742,7 +4742,7 @@ SlaveTimeLimitCmd(
key.type = TCL_LIMIT_TIME;
hPtr = Tcl_FindHashEntry(&iPtr->limit.callbacks, (char *) &key);
if (hPtr != NULL) {
- limitCBPtr = Tcl_GetHashValue(hPtr);
+ limitCBPtr = (ScriptLimitCallback *)Tcl_GetHashValue(hPtr);
if (limitCBPtr != NULL && limitCBPtr->scriptObj != NULL) {
Tcl_SetObjResult(interp, limitCBPtr->scriptObj);
}
diff --git a/generic/tclLink.c b/generic/tclLink.c
index 01dc5cb..6be0de1 100644
--- a/generic/tclLink.c
+++ b/generic/tclLink.c
@@ -171,7 +171,7 @@ Tcl_LinkVar(
return TCL_ERROR;
}
- linkPtr = Tcl_Alloc(sizeof(Link));
+ linkPtr = (Link *)Tcl_Alloc(sizeof(Link));
linkPtr->interp = interp;
linkPtr->nsPtr = NULL;
linkPtr->varName = Tcl_NewStringObj(varName, -1);
@@ -259,7 +259,7 @@ Tcl_LinkArray(
return TCL_ERROR;
}
- linkPtr = Tcl_Alloc(sizeof(Link));
+ linkPtr = (Link *)Tcl_Alloc(sizeof(Link));
linkPtr->type = type & ~TCL_LINK_READ_ONLY;
#if !defined(TCL_NO_DEPRECATED) && (defined(TCL_WIDE_INT_IS_LONG) \
|| defined(_WIN32) || defined(__CYGWIN__))
@@ -535,7 +535,7 @@ GetUWide(
*widePtr = *((const Tcl_WideInt *) clientData);
return (*widePtr < 0);
} else if (type == TCL_NUMBER_BIG) {
- mp_int *numPtr = clientData;
+ mp_int *numPtr = (mp_int *)clientData;
Tcl_WideUInt value = 0;
union {
Tcl_WideUInt value;
@@ -628,11 +628,12 @@ IsSpecial(
static int
SetInvalidRealFromAny(
- Tcl_Interp *interp,
+ Tcl_Interp *dummy,
Tcl_Obj *objPtr)
{
size_t length;
const char *str, *endPtr;
+ (void)dummy;
str = TclGetStringFromObj(objPtr, &length);
if ((length == 1) && (str[0] == '.')) {
@@ -750,7 +751,7 @@ LinkTraceProc(
const char *name2, /* Second part of variable name. */
int flags) /* Miscellaneous additional information. */
{
- Link *linkPtr = clientData;
+ Link *linkPtr = (Link *)clientData;
int changed;
size_t valueLength = 0;
const char *value;
@@ -763,6 +764,8 @@ LinkTraceProc(
int objc;
Tcl_Obj **objv;
int i;
+ (void)name1;
+ (void)name2;
/*
* If the variable is being unset, then just re-create it (with a trace)
@@ -897,7 +900,7 @@ LinkTraceProc(
value = TclGetStringFromObj(valueObj, &valueLength);
pp = (char **) linkPtr->addr;
- *pp = Tcl_Realloc(*pp, ++valueLength);
+ *pp = (char *)Tcl_Realloc(*pp, ++valueLength);
memcpy(*pp, value, valueLength);
return NULL;
@@ -1291,7 +1294,7 @@ ObjValue(
case TCL_LINK_INT:
if (linkPtr->flags & LINK_ALLOC_LAST) {
memcpy(linkPtr->lastValue.aryPtr, linkPtr->addr, linkPtr->bytes);
- objv = Tcl_Alloc(linkPtr->numElems * sizeof(Tcl_Obj *));
+ objv = (Tcl_Obj **)Tcl_Alloc(linkPtr->numElems * sizeof(Tcl_Obj *));
for (i=0; i < linkPtr->numElems; i++) {
objv[i] = Tcl_NewIntObj(linkPtr->lastValue.iPtr[i]);
}
@@ -1304,7 +1307,7 @@ ObjValue(
case TCL_LINK_WIDE_INT:
if (linkPtr->flags & LINK_ALLOC_LAST) {
memcpy(linkPtr->lastValue.aryPtr, linkPtr->addr, linkPtr->bytes);
- objv = Tcl_Alloc(linkPtr->numElems * sizeof(Tcl_Obj *));
+ objv = (Tcl_Obj **)Tcl_Alloc(linkPtr->numElems * sizeof(Tcl_Obj *));
for (i=0; i < linkPtr->numElems; i++) {
objv[i] = Tcl_NewWideIntObj(linkPtr->lastValue.wPtr[i]);
}
@@ -1317,7 +1320,7 @@ ObjValue(
case TCL_LINK_DOUBLE:
if (linkPtr->flags & LINK_ALLOC_LAST) {
memcpy(linkPtr->lastValue.aryPtr, linkPtr->addr, linkPtr->bytes);
- objv = Tcl_Alloc(linkPtr->numElems * sizeof(Tcl_Obj *));
+ objv = (Tcl_Obj **)Tcl_Alloc(linkPtr->numElems * sizeof(Tcl_Obj *));
for (i=0; i < linkPtr->numElems; i++) {
objv[i] = Tcl_NewDoubleObj(linkPtr->lastValue.dPtr[i]);
}
@@ -1330,7 +1333,7 @@ ObjValue(
case TCL_LINK_BOOLEAN:
if (linkPtr->flags & LINK_ALLOC_LAST) {
memcpy(linkPtr->lastValue.aryPtr, linkPtr->addr, linkPtr->bytes);
- objv = Tcl_Alloc(linkPtr->numElems * sizeof(Tcl_Obj *));
+ objv = (Tcl_Obj **)Tcl_Alloc(linkPtr->numElems * sizeof(Tcl_Obj *));
for (i=0; i < linkPtr->numElems; i++) {
objv[i] = Tcl_NewBooleanObj(linkPtr->lastValue.iPtr[i] != 0);
}
@@ -1343,7 +1346,7 @@ ObjValue(
case TCL_LINK_CHAR:
if (linkPtr->flags & LINK_ALLOC_LAST) {
memcpy(linkPtr->lastValue.aryPtr, linkPtr->addr, linkPtr->bytes);
- objv = Tcl_Alloc(linkPtr->numElems * sizeof(Tcl_Obj *));
+ objv = (Tcl_Obj **)Tcl_Alloc(linkPtr->numElems * sizeof(Tcl_Obj *));
for (i=0; i < linkPtr->numElems; i++) {
objv[i] = Tcl_NewIntObj(linkPtr->lastValue.cPtr[i]);
}
@@ -1356,7 +1359,7 @@ ObjValue(
case TCL_LINK_UCHAR:
if (linkPtr->flags & LINK_ALLOC_LAST) {
memcpy(linkPtr->lastValue.aryPtr, linkPtr->addr, linkPtr->bytes);
- objv = Tcl_Alloc(linkPtr->numElems * sizeof(Tcl_Obj *));
+ objv = (Tcl_Obj **)Tcl_Alloc(linkPtr->numElems * sizeof(Tcl_Obj *));
for (i=0; i < linkPtr->numElems; i++) {
objv[i] = Tcl_NewIntObj(linkPtr->lastValue.ucPtr[i]);
}
@@ -1369,7 +1372,7 @@ ObjValue(
case TCL_LINK_SHORT:
if (linkPtr->flags & LINK_ALLOC_LAST) {
memcpy(linkPtr->lastValue.aryPtr, linkPtr->addr, linkPtr->bytes);
- objv = Tcl_Alloc(linkPtr->numElems * sizeof(Tcl_Obj *));
+ objv = (Tcl_Obj **)Tcl_Alloc(linkPtr->numElems * sizeof(Tcl_Obj *));
for (i=0; i < linkPtr->numElems; i++) {
objv[i] = Tcl_NewIntObj(linkPtr->lastValue.sPtr[i]);
}
@@ -1382,7 +1385,7 @@ ObjValue(
case TCL_LINK_USHORT:
if (linkPtr->flags & LINK_ALLOC_LAST) {
memcpy(linkPtr->lastValue.aryPtr, linkPtr->addr, linkPtr->bytes);
- objv = Tcl_Alloc(linkPtr->numElems * sizeof(Tcl_Obj *));
+ objv = (Tcl_Obj **)Tcl_Alloc(linkPtr->numElems * sizeof(Tcl_Obj *));
for (i=0; i < linkPtr->numElems; i++) {
objv[i] = Tcl_NewIntObj(linkPtr->lastValue.usPtr[i]);
}
@@ -1395,7 +1398,7 @@ ObjValue(
case TCL_LINK_UINT:
if (linkPtr->flags & LINK_ALLOC_LAST) {
memcpy(linkPtr->lastValue.aryPtr, linkPtr->addr, linkPtr->bytes);
- objv = Tcl_Alloc(linkPtr->numElems * sizeof(Tcl_Obj *));
+ objv = (Tcl_Obj **)Tcl_Alloc(linkPtr->numElems * sizeof(Tcl_Obj *));
for (i=0; i < linkPtr->numElems; i++) {
objv[i] = Tcl_NewWideIntObj(linkPtr->lastValue.uiPtr[i]);
}
@@ -1409,7 +1412,7 @@ ObjValue(
case TCL_LINK_LONG:
if (linkPtr->flags & LINK_ALLOC_LAST) {
memcpy(linkPtr->lastValue.aryPtr, linkPtr->addr, linkPtr->bytes);
- objv = Tcl_Alloc(linkPtr->numElems * sizeof(Tcl_Obj *));
+ objv = (Tcl_Obj **)Tcl_Alloc(linkPtr->numElems * sizeof(Tcl_Obj *));
for (i=0; i < linkPtr->numElems; i++) {
objv[i] = Tcl_NewWideIntObj(linkPtr->lastValue.lPtr[i]);
}
@@ -1422,7 +1425,7 @@ ObjValue(
case TCL_LINK_ULONG:
if (linkPtr->flags & LINK_ALLOC_LAST) {
memcpy(linkPtr->lastValue.aryPtr, linkPtr->addr, linkPtr->bytes);
- objv = Tcl_Alloc(linkPtr->numElems * sizeof(Tcl_Obj *));
+ objv = (Tcl_Obj **)Tcl_Alloc(linkPtr->numElems * sizeof(Tcl_Obj *));
for (i=0; i < linkPtr->numElems; i++) {
objv[i] = Tcl_NewWideIntObj(linkPtr->lastValue.ulPtr[i]);
}
@@ -1436,7 +1439,7 @@ ObjValue(
case TCL_LINK_FLOAT:
if (linkPtr->flags & LINK_ALLOC_LAST) {
memcpy(linkPtr->lastValue.aryPtr, linkPtr->addr, linkPtr->bytes);
- objv = Tcl_Alloc(linkPtr->numElems * sizeof(Tcl_Obj *));
+ objv = (Tcl_Obj **)Tcl_Alloc(linkPtr->numElems * sizeof(Tcl_Obj *));
for (i=0; i < linkPtr->numElems; i++) {
objv[i] = Tcl_NewDoubleObj(linkPtr->lastValue.fPtr[i]);
}
@@ -1449,7 +1452,7 @@ ObjValue(
case TCL_LINK_WIDE_UINT:
if (linkPtr->flags & LINK_ALLOC_LAST) {
memcpy(linkPtr->lastValue.aryPtr, linkPtr->addr, linkPtr->bytes);
- objv = Tcl_Alloc(linkPtr->numElems * sizeof(Tcl_Obj *));
+ objv = (Tcl_Obj **)Tcl_Alloc(linkPtr->numElems * sizeof(Tcl_Obj *));
for (i=0; i < linkPtr->numElems; i++) {
objv[i] = Tcl_NewWideIntObj((Tcl_WideInt)
linkPtr->lastValue.uwPtr[i]);
diff --git a/generic/tclListObj.c b/generic/tclListObj.c
index d983a46..647d80d 100644
--- a/generic/tclListObj.c
+++ b/generic/tclListObj.c
@@ -62,7 +62,7 @@ const Tcl_ObjType tclListType = {
do { \
const Tcl_ObjIntRep *irPtr; \
irPtr = TclFetchIntRep((objPtr), &tclListType); \
- (listRepPtr) = irPtr ? irPtr->twoPtrValue.ptr1 : NULL; \
+ (listRepPtr) = irPtr ? (List *)irPtr->twoPtrValue.ptr1 : NULL; \
} while (0)
#define ListResetIntRep(objPtr, listRepPtr) \
@@ -124,7 +124,7 @@ NewListIntRep(
return NULL;
}
- listRepPtr = Tcl_AttemptAlloc(LIST_SIZE(objc));
+ listRepPtr = (List *)Tcl_AttemptAlloc(LIST_SIZE(objc));
if (listRepPtr == NULL) {
if (p) {
Tcl_Panic("list creation failed: unable to alloc %" TCL_Z_MODIFIER "u bytes",
@@ -314,6 +314,8 @@ Tcl_DbNewListObj(
int line) /* Line number in the source file; used for
* debugging. */
{
+ (void)file;
+ (void)line;
return Tcl_NewListObj(objc, objv);
}
#endif /* TCL_MEM_DEBUG */
@@ -697,18 +699,18 @@ Tcl_ListObjAppendElement(
attempt = 2 * numRequired;
if (attempt <= LIST_MAX) {
- newPtr = Tcl_AttemptRealloc(listRepPtr, LIST_SIZE(attempt));
+ newPtr = (List *)Tcl_AttemptRealloc(listRepPtr, LIST_SIZE(attempt));
}
if (newPtr == NULL) {
attempt = numRequired + 1 + TCL_MIN_ELEMENT_GROWTH;
if (attempt > LIST_MAX) {
attempt = LIST_MAX;
}
- newPtr = Tcl_AttemptRealloc(listRepPtr, LIST_SIZE(attempt));
+ newPtr = (List *)Tcl_AttemptRealloc(listRepPtr, LIST_SIZE(attempt));
}
if (newPtr == NULL) {
attempt = numRequired;
- newPtr = Tcl_AttemptRealloc(listRepPtr, LIST_SIZE(attempt));
+ newPtr = (List *)Tcl_AttemptRealloc(listRepPtr, LIST_SIZE(attempt));
}
if (newPtr) {
listRepPtr = newPtr;
@@ -1034,18 +1036,18 @@ Tcl_ListObjReplace(
List *newPtr = NULL;
int attempt = 2 * numRequired;
if (attempt <= LIST_MAX) {
- newPtr = Tcl_AttemptRealloc(listRepPtr, LIST_SIZE(attempt));
+ newPtr = (List *)Tcl_AttemptRealloc(listRepPtr, LIST_SIZE(attempt));
}
if (newPtr == NULL) {
attempt = numRequired + 1 + TCL_MIN_ELEMENT_GROWTH;
if (attempt > LIST_MAX) {
attempt = LIST_MAX;
}
- newPtr = Tcl_AttemptRealloc(listRepPtr, LIST_SIZE(attempt));
+ newPtr = (List *)Tcl_AttemptRealloc(listRepPtr, LIST_SIZE(attempt));
}
if (newPtr == NULL) {
attempt = numRequired;
- newPtr = Tcl_AttemptRealloc(listRepPtr, LIST_SIZE(attempt));
+ newPtr = (List *)Tcl_AttemptRealloc(listRepPtr, LIST_SIZE(attempt));
}
if (newPtr) {
listRepPtr = newPtr;
@@ -1662,8 +1664,8 @@ TclLsetFlat(
*/
irPtr = TclFetchIntRep(objPtr, &tclListType);
- listRepPtr = irPtr->twoPtrValue.ptr1;
- chainPtr = irPtr->twoPtrValue.ptr2;
+ listRepPtr = (List *)irPtr->twoPtrValue.ptr1;
+ chainPtr = (Tcl_Obj *)irPtr->twoPtrValue.ptr2;
if (result == TCL_OK) {
@@ -2158,7 +2160,7 @@ UpdateStringOfList(
* We know numElems <= LIST_MAX, so this is safe.
*/
- flagPtr = Tcl_Alloc(numElems);
+ flagPtr = (char *)Tcl_Alloc(numElems);
}
elemPtrs = &listRepPtr->elements;
for (i = 0; i < numElems; i++) {
diff --git a/generic/tclLiteral.c b/generic/tclLiteral.c
index b7745bc..f3297aa 100644
--- a/generic/tclLiteral.c
+++ b/generic/tclLiteral.c
@@ -114,6 +114,8 @@ TclDeleteLiteralTable(
#ifdef TCL_COMPILE_DEBUG
TclVerifyGlobalLiteralTable((Interp *) interp);
+#else
+ (void)interp;
#endif /*TCL_COMPILE_DEBUG*/
/*
@@ -276,7 +278,7 @@ TclCreateLiteral(
}
#endif
- globalPtr = Tcl_Alloc(sizeof(LiteralEntry));
+ globalPtr = (LiteralEntry *)Tcl_Alloc(sizeof(LiteralEntry));
globalPtr->objPtr = objPtr;
Tcl_IncrRefCount(objPtr);
globalPtr->refCount = 1;
@@ -401,7 +403,7 @@ TclRegisterLiteral(
* the literal should not be shared accross
* namespaces. */
{
- CompileEnv *envPtr = ePtr;
+ CompileEnv *envPtr = (CompileEnv *)ePtr;
Interp *iPtr = envPtr->iPtr;
LiteralTable *localTablePtr = &envPtr->localLitTable;
LiteralEntry *globalPtr, *localPtr;
@@ -756,14 +758,14 @@ ExpandLocalLiteralArray(
}
if (envPtr->mallocedLiteralArray) {
- newArrayPtr = Tcl_Realloc(currArrayPtr, newSize);
+ newArrayPtr = (LiteralEntry *)Tcl_Realloc(currArrayPtr, newSize);
} else {
/*
* envPtr->literalArrayPtr isn't a Tcl_Alloc'd pointer, so we must
* code a Tcl_Realloc equivalent for ourselves.
*/
- newArrayPtr = Tcl_Alloc(newSize);
+ newArrayPtr = (LiteralEntry *)Tcl_Alloc(newSize);
memcpy(newArrayPtr, currArrayPtr, currBytes);
envPtr->mallocedLiteralArray = 1;
}
@@ -988,7 +990,7 @@ RebuildLiteralTable(
}
tablePtr->numBuckets *= 4;
- tablePtr->buckets = Tcl_Alloc(tablePtr->numBuckets * sizeof(LiteralEntry*));
+ tablePtr->buckets = (LiteralEntry **)Tcl_Alloc(tablePtr->numBuckets * sizeof(LiteralEntry*));
for (count=tablePtr->numBuckets, newChainPtr=tablePtr->buckets;
count>0 ; count--, newChainPtr++) {
*newChainPtr = NULL;
@@ -1124,7 +1126,7 @@ TclLiteralStats(
* Print out the histogram and a few other pieces of information.
*/
- result = Tcl_Alloc(NUM_COUNTERS*60 + 300);
+ result = (char *)Tcl_Alloc(NUM_COUNTERS*60 + 300);
sprintf(result, "%" TCL_Z_MODIFIER "u entries in table, %" TCL_Z_MODIFIER "u buckets\n",
tablePtr->numEntries, tablePtr->numBuckets);
p = result + strlen(result);
diff --git a/generic/tclLoad.c b/generic/tclLoad.c
index 67388e8..bc02a2e 100644
--- a/generic/tclLoad.c
+++ b/generic/tclLoad.c
@@ -140,6 +140,7 @@ Tcl_LoadObjCmd(
enum options {
LOAD_GLOBAL, LOAD_LAZY, LOAD_LAST
};
+ (void)dummy;
while (objc > 2) {
if (TclGetString(objv[1])[0] != '-') {
@@ -271,7 +272,7 @@ Tcl_LoadObjCmd(
*/
if (pkgPtr != NULL) {
- ipFirstPtr = Tcl_GetAssocData(target, "tclLoad", NULL);
+ ipFirstPtr = (InterpPackage *)Tcl_GetAssocData(target, "tclLoad", NULL);
for (ipPtr = ipFirstPtr; ipPtr != NULL; ipPtr = ipPtr->nextPtr) {
if (ipPtr->pkgPtr == pkgPtr) {
code = TCL_OK;
@@ -401,12 +402,12 @@ Tcl_LoadObjCmd(
* Create a new record to describe this package.
*/
- pkgPtr = Tcl_Alloc(sizeof(LoadedPackage));
+ pkgPtr = (LoadedPackage *)Tcl_Alloc(sizeof(LoadedPackage));
len = strlen(fullFileName) + 1;
- pkgPtr->fileName = Tcl_Alloc(len);
+ pkgPtr->fileName = (char *)Tcl_Alloc(len);
memcpy(pkgPtr->fileName, fullFileName, len);
len = Tcl_DStringLength(&pkgName) + 1;
- pkgPtr->packageName = Tcl_Alloc(len);
+ pkgPtr->packageName = (char *)Tcl_Alloc(len);
memcpy(pkgPtr->packageName, Tcl_DStringValue(&pkgName), len);
pkgPtr->loadHandle = loadHandle;
pkgPtr->initProc = initProc;
@@ -505,8 +506,8 @@ Tcl_LoadObjCmd(
* static packages at the head of the linked list!
*/
- ipFirstPtr = Tcl_GetAssocData(target, "tclLoad", NULL);
- ipPtr = Tcl_Alloc(sizeof(InterpPackage));
+ ipFirstPtr = (InterpPackage *)Tcl_GetAssocData(target, "tclLoad", NULL);
+ ipPtr = (InterpPackage *)Tcl_Alloc(sizeof(InterpPackage));
ipPtr->pkgPtr = pkgPtr;
ipPtr->nextPtr = ipFirstPtr;
Tcl_SetAssocData(target, "tclLoad", LoadCleanupProc, ipPtr);
@@ -560,6 +561,7 @@ Tcl_UnloadObjCmd(
enum options {
UNLOAD_NOCOMPLAIN, UNLOAD_KEEPLIB, UNLOAD_LAST
};
+ (void)dummy;
for (i = 1; i < objc; i++) {
if (Tcl_GetIndexFromObj(interp, objv[i], options, "option", 0,
@@ -718,7 +720,7 @@ Tcl_UnloadObjCmd(
code = TCL_ERROR;
if (pkgPtr != NULL) {
- ipFirstPtr = Tcl_GetAssocData(target, "tclLoad", NULL);
+ ipFirstPtr = (InterpPackage *)Tcl_GetAssocData(target, "tclLoad", NULL);
for (ipPtr = ipFirstPtr; ipPtr != NULL; ipPtr = ipPtr->nextPtr) {
if (ipPtr->pkgPtr == pkgPtr) {
code = TCL_OK;
@@ -873,7 +875,7 @@ Tcl_UnloadObjCmd(
* Remove this library from the interpreter's library cache.
*/
- ipFirstPtr = Tcl_GetAssocData(target, "tclLoad", NULL);
+ ipFirstPtr = (InterpPackage *)Tcl_GetAssocData(target, "tclLoad", NULL);
ipPtr = ipFirstPtr;
if (ipPtr->pkgPtr == defaultPtr) {
ipFirstPtr = ipFirstPtr->nextPtr;
@@ -980,10 +982,10 @@ Tcl_StaticPackage(
*/
if (pkgPtr == NULL) {
- pkgPtr = Tcl_Alloc(sizeof(LoadedPackage));
- pkgPtr->fileName = Tcl_Alloc(1);
+ pkgPtr = (LoadedPackage *)Tcl_Alloc(sizeof(LoadedPackage));
+ pkgPtr->fileName = (char *)Tcl_Alloc(1);
pkgPtr->fileName[0] = 0;
- pkgPtr->packageName = Tcl_Alloc(strlen(pkgName) + 1);
+ pkgPtr->packageName = (char *)Tcl_Alloc(strlen(pkgName) + 1);
strcpy(pkgPtr->packageName, pkgName);
pkgPtr->loadHandle = NULL;
pkgPtr->initProc = initProc;
@@ -1001,7 +1003,7 @@ Tcl_StaticPackage(
* it's already loaded.
*/
- ipFirstPtr = Tcl_GetAssocData(interp, "tclLoad", NULL);
+ ipFirstPtr = (InterpPackage *)Tcl_GetAssocData(interp, "tclLoad", NULL);
for (ipPtr = ipFirstPtr; ipPtr != NULL; ipPtr = ipPtr->nextPtr) {
if (ipPtr->pkgPtr == pkgPtr) {
return;
@@ -1013,7 +1015,7 @@ Tcl_StaticPackage(
* loaded.
*/
- ipPtr = Tcl_Alloc(sizeof(InterpPackage));
+ ipPtr = (InterpPackage *)Tcl_Alloc(sizeof(InterpPackage));
ipPtr->pkgPtr = pkgPtr;
ipPtr->nextPtr = ipFirstPtr;
Tcl_SetAssocData(interp, "tclLoad", LoadCleanupProc, ipPtr);
@@ -1089,7 +1091,7 @@ TclGetLoadedPackagesEx(
if (target == NULL) {
return TCL_ERROR;
}
- ipPtr = Tcl_GetAssocData(target, "tclLoad", NULL);
+ ipPtr = (InterpPackage *)Tcl_GetAssocData(target, "tclLoad", NULL);
/*
* Return information about all of the available packages.
@@ -1150,11 +1152,12 @@ static void
LoadCleanupProc(
ClientData clientData, /* Pointer to first InterpPackage structure
* for interp. */
- Tcl_Interp *interp) /* Interpreter that is being deleted. */
+ Tcl_Interp *dummy) /* Interpreter that is being deleted. */
{
InterpPackage *ipPtr, *nextPtr;
+ (void)dummy;
- ipPtr = clientData;
+ ipPtr = (InterpPackage *)clientData;
while (ipPtr != NULL) {
nextPtr = ipPtr->nextPtr;
Tcl_Free(ipPtr);
diff --git a/generic/tclMain.c b/generic/tclMain.c
index 84c0638..16e2159 100644
--- a/generic/tclMain.c
+++ b/generic/tclMain.c
@@ -739,10 +739,11 @@ StdinProc(
{
int code;
size_t length;
- InteractiveState *isPtr = clientData;
+ InteractiveState *isPtr = (InteractiveState *)clientData;
Tcl_Channel chan = isPtr->input;
Tcl_Obj *commandPtr = isPtr->commandPtr;
Tcl_Interp *interp = isPtr->interp;
+ (void)mask;
if (Tcl_IsShared(commandPtr)) {
Tcl_DecrRefCount(commandPtr);
@@ -911,7 +912,7 @@ static void
FreeMainInterp(
ClientData clientData)
{
- Tcl_Interp *interp = clientData;
+ Tcl_Interp *interp = (Tcl_Interp *)clientData;
/*if (TclInExit()) return;*/
diff --git a/generic/tclNamesp.c b/generic/tclNamesp.c
index 79bc52e..95ef4ad 100644
--- a/generic/tclNamesp.c
+++ b/generic/tclNamesp.c
@@ -166,7 +166,7 @@ static const Tcl_ObjType nsNameType = {
do { \
const Tcl_ObjIntRep *irPtr; \
irPtr = TclFetchIntRep((objPtr), &nsNameType); \
- (nnPtr) = irPtr ? irPtr->twoPtrValue.ptr1 : NULL; \
+ (nnPtr) = irPtr ? (ResolvedNsName *)irPtr->twoPtrValue.ptr1 : NULL; \
} while (0)
/*
@@ -479,7 +479,7 @@ TclPushStackFrame(
* treated as references to namespace
* variables. */
{
- *framePtrPtr = TclStackAlloc(interp, sizeof(CallFrame));
+ *framePtrPtr = (Tcl_CallFrame *)TclStackAlloc(interp, sizeof(CallFrame));
return Tcl_PushCallFrame(interp, *framePtrPtr, namespacePtr,
isProcCallFrame);
}
@@ -513,12 +513,16 @@ TclPopStackFrame(
static char *
EstablishErrorCodeTraces(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
const char *name1,
const char *name2,
int flags)
{
+ (void)dummy;
+ (void)name1;
+ (void)name2;
+ (void)flags;
Tcl_TraceVar2(interp, "errorCode", NULL, TCL_GLOBAL_ONLY|TCL_TRACE_READS,
ErrorCodeRead, NULL);
Tcl_TraceVar2(interp, "errorCode", NULL, TCL_GLOBAL_ONLY|TCL_TRACE_UNSETS,
@@ -545,13 +549,17 @@ EstablishErrorCodeTraces(
static char *
ErrorCodeRead(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
const char *name1,
const char *name2,
int flags)
{
Interp *iPtr = (Interp *) interp;
+ (void)dummy;
+ (void)name1;
+ (void)name2;
+ (void)flags;
if (Tcl_InterpDeleted(interp) || !(iPtr->flags & ERR_LEGACY_COPY)) {
return NULL;
@@ -587,12 +595,17 @@ ErrorCodeRead(
static char *
EstablishErrorInfoTraces(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
const char *name1,
const char *name2,
int flags)
{
+ (void)dummy;
+ (void)name1;
+ (void)name2;
+ (void)flags;
+
Tcl_TraceVar2(interp, "errorInfo", NULL, TCL_GLOBAL_ONLY|TCL_TRACE_READS,
ErrorInfoRead, NULL);
Tcl_TraceVar2(interp, "errorInfo", NULL, TCL_GLOBAL_ONLY|TCL_TRACE_UNSETS,
@@ -619,13 +632,17 @@ EstablishErrorInfoTraces(
static char *
ErrorInfoRead(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
const char *name1,
const char *name2,
int flags)
{
Interp *iPtr = (Interp *) interp;
+ (void)dummy;
+ (void)name1;
+ (void)name2;
+ (void)flags;
if (Tcl_InterpDeleted(interp) || !(iPtr->flags & ERR_LEGACY_COPY)) {
return NULL;
@@ -785,9 +802,9 @@ Tcl_CreateNamespace(
*/
doCreate:
- nsPtr = Tcl_Alloc(sizeof(Namespace));
+ nsPtr = (Namespace *)Tcl_Alloc(sizeof(Namespace));
nameLen = strlen(simpleName) + 1;
- nsPtr->name = Tcl_Alloc(nameLen);
+ nsPtr->name = (char *)Tcl_Alloc(nameLen);
memcpy(nsPtr->name, simpleName, nameLen);
nsPtr->fullName = NULL; /* Set below. */
nsPtr->clientData = clientData;
@@ -875,7 +892,7 @@ Tcl_CreateNamespace(
name = Tcl_DStringValue(namePtr);
nameLen = Tcl_DStringLength(namePtr);
- nsPtr->fullName = Tcl_Alloc(nameLen + 1);
+ nsPtr->fullName = (char *)Tcl_Alloc(nameLen + 1);
memcpy(nsPtr->fullName, name, nameLen + 1);
Tcl_DStringFree(&buffer1);
@@ -967,7 +984,7 @@ Tcl_DeleteNamespace(
for (entryPtr = Tcl_FirstHashEntry(&nsPtr->cmdTable, &search);
entryPtr != NULL;) {
- cmdPtr = Tcl_GetHashValue(entryPtr);
+ cmdPtr = (Command *)Tcl_GetHashValue(entryPtr);
if (cmdPtr->nreProc == TclNRInterpCoroutine) {
Tcl_DeleteCommandFromToken((Tcl_Interp *) iPtr,
(Tcl_Command) cmdPtr);
@@ -1146,14 +1163,14 @@ TclTeardownNamespace(
while (nsPtr->cmdTable.numEntries > 0) {
size_t length = nsPtr->cmdTable.numEntries;
- Command **cmds = TclStackAlloc((Tcl_Interp *) iPtr,
+ Command **cmds = (Command **)TclStackAlloc((Tcl_Interp *) iPtr,
sizeof(Command *) * length);
i = 0;
for (entryPtr = Tcl_FirstHashEntry(&nsPtr->cmdTable, &search);
entryPtr != NULL;
entryPtr = Tcl_NextHashEntry(&search)) {
- cmds[i] = Tcl_GetHashValue(entryPtr);
+ cmds[i] = (Command *)Tcl_GetHashValue(entryPtr);
cmds[i]->refCount++;
i++;
}
@@ -1218,14 +1235,14 @@ TclTeardownNamespace(
#ifndef BREAK_NAMESPACE_COMPAT
while (nsPtr->childTable.numEntries > 0) {
size_t length = nsPtr->childTable.numEntries;
- Namespace **children = TclStackAlloc((Tcl_Interp *) iPtr,
+ Namespace **children = (Namespace **)TclStackAlloc((Tcl_Interp *) iPtr,
sizeof(Namespace *) * length);
i = 0;
for (entryPtr = Tcl_FirstHashEntry(&nsPtr->childTable, &search);
entryPtr != NULL;
entryPtr = Tcl_NextHashEntry(&search)) {
- children[i] = Tcl_GetHashValue(entryPtr);
+ children[i] = (Namespace *)Tcl_GetHashValue(entryPtr);
children[i]->refCount++;
i++;
}
@@ -1239,7 +1256,7 @@ TclTeardownNamespace(
if (nsPtr->childTablePtr != NULL) {
while (nsPtr->childTablePtr->numEntries > 0) {
size_t length = nsPtr->childTablePtr->numEntries;
- Namespace **children = TclStackAlloc((Tcl_Interp *) iPtr,
+ Namespace **children = (Namespace **)TclStackAlloc((Tcl_Interp *) iPtr,
sizeof(Namespace *) * length);
i = 0;
@@ -1459,7 +1476,7 @@ Tcl_Export(
if (neededElems > nsPtr->maxExportPatterns) {
nsPtr->maxExportPatterns = nsPtr->maxExportPatterns ?
2 * nsPtr->maxExportPatterns : INIT_EXPORT_PATTERNS;
- nsPtr->exportArrayPtr = Tcl_Realloc(nsPtr->exportArrayPtr,
+ nsPtr->exportArrayPtr = (char **)Tcl_Realloc(nsPtr->exportArrayPtr,
sizeof(char *) * nsPtr->maxExportPatterns);
}
@@ -1468,7 +1485,7 @@ Tcl_Export(
*/
len = strlen(pattern);
- patternCpy = Tcl_Alloc(len + 1);
+ patternCpy = (char *)Tcl_Alloc(len + 1);
memcpy(patternCpy, pattern, len + 1);
nsPtr->exportArrayPtr[nsPtr->numExportPatterns] = patternCpy;
@@ -1680,7 +1697,7 @@ Tcl_Import(
}
for (hPtr = Tcl_FirstHashEntry(&importNsPtr->cmdTable, &search);
(hPtr != NULL); hPtr = Tcl_NextHashEntry(&search)) {
- char *cmdName = Tcl_GetHashKey(&importNsPtr->cmdTable, hPtr);
+ char *cmdName = (char *)Tcl_GetHashKey(&importNsPtr->cmdTable, hPtr);
if (Tcl_StringMatch(cmdName, simplePattern) &&
DoImport(interp, nsPtr, hPtr, cmdName, pattern, importNsPtr,
@@ -1767,13 +1784,13 @@ DoImport(
* namespace would create a cycle of imported command references.
*/
- cmdPtr = Tcl_GetHashValue(hPtr);
+ cmdPtr = (Command *)Tcl_GetHashValue(hPtr);
if (found != NULL && cmdPtr->deleteProc == DeleteImportedCmd) {
- Command *overwrite = Tcl_GetHashValue(found);
+ Command *overwrite = (Command *)Tcl_GetHashValue(found);
Command *linkCmd = cmdPtr;
while (linkCmd->deleteProc == DeleteImportedCmd) {
- dataPtr = linkCmd->objClientData;
+ dataPtr = (ImportedCmdData *)linkCmd->objClientData;
linkCmd = dataPtr->realCmdPtr;
if (overwrite == linkCmd) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
@@ -1787,7 +1804,7 @@ DoImport(
}
}
- dataPtr = Tcl_Alloc(sizeof(ImportedCmdData));
+ dataPtr = (ImportedCmdData *)Tcl_Alloc(sizeof(ImportedCmdData));
importedCmd = Tcl_NRCreateCommand(interp, Tcl_DStringValue(&ds),
TclInvokeImportedCmd, InvokeImportedNRCmd, dataPtr,
DeleteImportedCmd);
@@ -1801,15 +1818,15 @@ DoImport(
* and add it to the import ref list in the "real" command.
*/
- refPtr = Tcl_Alloc(sizeof(ImportRef));
+ refPtr = (ImportRef *)Tcl_Alloc(sizeof(ImportRef));
refPtr->importedCmdPtr = (Command *) importedCmd;
refPtr->nextPtr = cmdPtr->importRefPtr;
cmdPtr->importRefPtr = refPtr;
} else {
- Command *overwrite = Tcl_GetHashValue(found);
+ Command *overwrite = (Command *)Tcl_GetHashValue(found);
if (overwrite->deleteProc == DeleteImportedCmd) {
- ImportedCmdData *dataPtr = overwrite->objClientData;
+ ImportedCmdData *dataPtr = (ImportedCmdData *)overwrite->objClientData;
if (dataPtr->realCmdPtr == Tcl_GetHashValue(hPtr)) {
/*
@@ -1903,7 +1920,7 @@ Tcl_ForgetImport(
if (TclMatchIsTrivial(simplePattern)) {
hPtr = Tcl_FindHashEntry(&nsPtr->cmdTable, simplePattern);
if (hPtr != NULL) {
- Command *cmdPtr = Tcl_GetHashValue(hPtr);
+ Command *cmdPtr = (Command *)Tcl_GetHashValue(hPtr);
if (cmdPtr && (cmdPtr->deleteProc == DeleteImportedCmd)) {
Tcl_DeleteCommandFromToken(interp, (Tcl_Command) cmdPtr);
@@ -1913,12 +1930,12 @@ Tcl_ForgetImport(
}
for (hPtr = Tcl_FirstHashEntry(&nsPtr->cmdTable, &search);
(hPtr != NULL); hPtr = Tcl_NextHashEntry(&search)) {
- Command *cmdPtr = Tcl_GetHashValue(hPtr);
+ Command *cmdPtr = (Command *)Tcl_GetHashValue(hPtr);
if (cmdPtr->deleteProc != DeleteImportedCmd) {
continue;
}
- cmdName = Tcl_GetHashKey(&nsPtr->cmdTable, hPtr);
+ cmdName = (char *)Tcl_GetHashKey(&nsPtr->cmdTable, hPtr);
if (Tcl_StringMatch(cmdName, simplePattern)) {
Tcl_DeleteCommandFromToken(interp, (Tcl_Command) cmdPtr);
}
@@ -1933,7 +1950,7 @@ Tcl_ForgetImport(
for (hPtr = Tcl_FirstHashEntry(&nsPtr->cmdTable, &search); (hPtr != NULL);
hPtr = Tcl_NextHashEntry(&search)) {
Tcl_CmdInfo info;
- Tcl_Command token = Tcl_GetHashValue(hPtr);
+ Tcl_Command token = (Tcl_Command)Tcl_GetHashValue(hPtr);
Tcl_Command origin = TclGetOriginalCommand(token);
if (Tcl_GetCommandInfoFromToken(origin, &info) == 0) {
@@ -1946,7 +1963,7 @@ Tcl_ForgetImport(
*/
Command *cmdPtr = (Command *) token;
- ImportedCmdData *dataPtr = cmdPtr->objClientData;
+ ImportedCmdData *dataPtr = (ImportedCmdData *)cmdPtr->objClientData;
Tcl_Command firstToken = (Tcl_Command) dataPtr->realCmdPtr;
if (firstToken == origin) {
@@ -2001,7 +2018,7 @@ TclGetOriginalCommand(
}
while (cmdPtr->deleteProc == DeleteImportedCmd) {
- dataPtr = cmdPtr->objClientData;
+ dataPtr = (ImportedCmdData *)cmdPtr->objClientData;
cmdPtr = dataPtr->realCmdPtr;
}
return (Tcl_Command) cmdPtr;
@@ -2034,7 +2051,7 @@ InvokeImportedNRCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* The argument objects. */
{
- ImportedCmdData *dataPtr = clientData;
+ ImportedCmdData *dataPtr = (ImportedCmdData *)clientData;
Command *realCmdPtr = dataPtr->realCmdPtr;
TclSkipTailcall(interp);
@@ -2079,7 +2096,7 @@ DeleteImportedCmd(
ClientData clientData) /* Points to the imported command's
* ImportedCmdData structure. */
{
- ImportedCmdData *dataPtr = clientData;
+ ImportedCmdData *dataPtr = (ImportedCmdData *)clientData;
Command *realCmdPtr = dataPtr->realCmdPtr;
Command *selfPtr = dataPtr->selfPtr;
ImportRef *refPtr, *prevPtr;
@@ -2355,7 +2372,7 @@ TclGetNamespaceForQualName(
}
#endif
if (entryPtr != NULL) {
- nsPtr = Tcl_GetHashValue(entryPtr);
+ nsPtr = (Namespace *)Tcl_GetHashValue(entryPtr);
} else if (flags & TCL_CREATE_NS_IF_UNKNOWN) {
Tcl_CallFrame *framePtr;
@@ -2390,7 +2407,7 @@ TclGetNamespaceForQualName(
}
#endif
if (entryPtr != NULL) {
- altNsPtr = Tcl_GetHashValue(entryPtr);
+ altNsPtr = (Namespace *)Tcl_GetHashValue(entryPtr);
} else {
altNsPtr = NULL;
}
@@ -2640,7 +2657,7 @@ Tcl_FindCommand(
|| !(realNsPtr->flags & NS_DYING)) {
entryPtr = Tcl_FindHashEntry(&realNsPtr->cmdTable, simpleName);
if (entryPtr != NULL) {
- cmdPtr = Tcl_GetHashValue(entryPtr);
+ cmdPtr = (Command *)Tcl_GetHashValue(entryPtr);
}
}
}
@@ -2661,7 +2678,7 @@ Tcl_FindCommand(
&& !(realNsPtr->flags & NS_DYING)) {
entryPtr = Tcl_FindHashEntry(&realNsPtr->cmdTable, simpleName);
if (entryPtr != NULL) {
- cmdPtr = Tcl_GetHashValue(entryPtr);
+ cmdPtr = (Command *)Tcl_GetHashValue(entryPtr);
}
}
}
@@ -2679,7 +2696,7 @@ Tcl_FindCommand(
&& !(realNsPtr->flags & NS_DYING)) {
entryPtr = Tcl_FindHashEntry(&realNsPtr->cmdTable, simpleName);
if (entryPtr != NULL) {
- cmdPtr = Tcl_GetHashValue(entryPtr);
+ cmdPtr = (Command *)Tcl_GetHashValue(entryPtr);
}
}
}
@@ -2701,7 +2718,7 @@ Tcl_FindCommand(
entryPtr = Tcl_FindHashEntry(&nsPtr[search]->cmdTable,
simpleName);
if (entryPtr != NULL) {
- cmdPtr = Tcl_GetHashValue(entryPtr);
+ cmdPtr = (Command *)Tcl_GetHashValue(entryPtr);
}
}
}
@@ -2765,7 +2782,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 *));
/*
@@ -2785,7 +2802,7 @@ TclResetShadowedCmdRefs(
* cmdName.
*/
- cmdName = Tcl_GetHashKey(newCmdPtr->hPtr->tablePtr, newCmdPtr->hPtr);
+ cmdName = (char *)Tcl_GetHashKey(newCmdPtr->hPtr->tablePtr, newCmdPtr->hPtr);
for (nsPtr=newCmdPtr->nsPtr ; (nsPtr!=NULL) && (nsPtr!=globalNsPtr) ;
nsPtr=nsPtr->parentPtr) {
/*
@@ -2814,7 +2831,7 @@ TclResetShadowedCmdRefs(
}
#endif
if (hPtr != NULL) {
- shadowNsPtr = Tcl_GetHashValue(hPtr);
+ shadowNsPtr = (Namespace *)Tcl_GetHashValue(hPtr);
} else {
found = 0;
break;
@@ -2855,7 +2872,7 @@ TclResetShadowedCmdRefs(
if (trailFront == trailSize) {
int newSize = 2 * trailSize;
- trailPtr = TclStackRealloc(interp, trailPtr,
+ trailPtr = (Namespace **)TclStackRealloc(interp, trailPtr,
newSize * sizeof(Namespace *));
trailSize = newSize;
}
@@ -3012,6 +3029,7 @@ NamespaceChildrenCmd(
Tcl_HashEntry *entryPtr;
Tcl_HashSearch search;
Tcl_Obj *listPtr, *elemPtr;
+ (void)dummy;
/*
* Get a pointer to the specified namespace, or the current namespace.
@@ -3083,7 +3101,7 @@ NamespaceChildrenCmd(
entryPtr = Tcl_FirstHashEntry(nsPtr->childTablePtr, &search);
#endif
while (entryPtr != NULL) {
- childNsPtr = Tcl_GetHashValue(entryPtr);
+ childNsPtr = (Namespace *)Tcl_GetHashValue(entryPtr);
if ((pattern == NULL)
|| Tcl_StringMatch(childNsPtr->fullName, pattern)) {
elemPtr = Tcl_NewStringObj(childNsPtr->fullName, -1);
@@ -3137,6 +3155,7 @@ NamespaceCodeCmd(
Tcl_Obj *listPtr, *objPtr;
const char *arg;
size_t length;
+ (void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "arg");
@@ -3215,6 +3234,7 @@ NamespaceCurrentCmd(
Tcl_Obj *const objv[]) /* Argument objects. */
{
Namespace *currNsPtr;
+ (void)dummy;
if (objc != 1) {
Tcl_WrongNumArgs(interp, 1, objv, NULL);
@@ -3280,6 +3300,7 @@ NamespaceDeleteCmd(
Tcl_Namespace *namespacePtr;
const char *name;
int i;
+ (void)dummy;
if (objc < 1) {
Tcl_WrongNumArgs(interp, 1, objv, "?name name...?");
@@ -3372,6 +3393,7 @@ NRNamespaceEvalCmd(
CallFrame *framePtr, **framePtrPtr;
Tcl_Obj *objPtr;
int result;
+ (void)dummy;
if (objc < 3) {
Tcl_WrongNumArgs(interp, 1, objv, "name arg ?arg...?");
@@ -3446,13 +3468,13 @@ NsEval_Callback(
Tcl_Interp *interp,
int result)
{
- Tcl_Namespace *namespacePtr = data[0];
+ Tcl_Namespace *namespacePtr = (Tcl_Namespace *)data[0];
if (result == TCL_ERROR) {
size_t length = strlen(namespacePtr->fullName);
unsigned limit = 200;
int overflow = (length > limit);
- char *cmd = data[1];
+ char *cmd = (char *)data[1];
Tcl_AppendObjToErrorInfo(interp, Tcl_ObjPrintf(
"\n (in namespace %s \"%.*s%s\" script line %d)",
@@ -3498,6 +3520,7 @@ NamespaceExistsCmd(
Tcl_Obj *const objv[]) /* Argument objects. */
{
Tcl_Namespace *namespacePtr;
+ (void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "name");
@@ -3553,6 +3576,7 @@ NamespaceExportCmd(
Tcl_Obj *const objv[]) /* Argument objects. */
{
int firstArg, i;
+ (void)dummy;
if (objc < 1) {
Tcl_WrongNumArgs(interp, 1, objv, "?-clear? ?pattern pattern...?");
@@ -3635,6 +3659,7 @@ NamespaceForgetCmd(
{
const char *pattern;
int i, result;
+ (void)dummy;
if (objc < 1) {
Tcl_WrongNumArgs(interp, 1, objv, "?pattern pattern...?");
@@ -3702,6 +3727,7 @@ NamespaceImportCmd(
const char *string, *pattern;
int i, result;
int firstArg;
+ (void)dummy;
if (objc < 1) {
Tcl_WrongNumArgs(interp, 1, objv, "?-force? ?pattern pattern...?");
@@ -3733,11 +3759,11 @@ NamespaceImportCmd(
TclNewObj(listPtr);
for (hPtr = Tcl_FirstHashEntry(&nsPtr->cmdTable, &search);
hPtr != NULL; hPtr = Tcl_NextHashEntry(&search)) {
- Command *cmdPtr = Tcl_GetHashValue(hPtr);
+ Command *cmdPtr = (Command *)Tcl_GetHashValue(hPtr);
if (cmdPtr->deleteProc == DeleteImportedCmd) {
Tcl_ListObjAppendElement(NULL, listPtr, Tcl_NewStringObj(
- Tcl_GetHashKey(&nsPtr->cmdTable, hPtr) ,-1));
+ (char *)Tcl_GetHashKey(&nsPtr->cmdTable, hPtr) ,-1));
}
}
Tcl_SetObjResult(interp, listPtr);
@@ -3817,6 +3843,7 @@ NRNamespaceInscopeCmd(
CallFrame *framePtr, **framePtrPtr;
int i;
Tcl_Obj *cmdObjPtr;
+ (void)dummy;
if (objc < 3) {
Tcl_WrongNumArgs(interp, 1, objv, "name arg ?arg...?");
@@ -3912,6 +3939,7 @@ NamespaceOriginCmd(
{
Tcl_Command command, origCommand;
Tcl_Obj *resultPtr;
+ (void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "name");
@@ -3972,6 +4000,7 @@ NamespaceParentCmd(
Tcl_Obj *const objv[]) /* Argument objects. */
{
Tcl_Namespace *nsPtr;
+ (void)dummy;
if (objc == 1) {
nsPtr = TclGetCurrentNamespace(interp);
@@ -4034,6 +4063,7 @@ NamespacePathCmd(
int nsObjc, result = TCL_ERROR;
Tcl_Obj **nsObjv;
Tcl_Namespace **namespaceList = NULL;
+ (void)dummy;
if (objc > 2) {
Tcl_WrongNumArgs(interp, 1, objv, "?pathList?");
@@ -4065,7 +4095,7 @@ NamespacePathCmd(
goto badNamespace;
}
if (nsObjc != 0) {
- namespaceList = TclStackAlloc(interp,
+ namespaceList = (Tcl_Namespace **)TclStackAlloc(interp,
sizeof(Tcl_Namespace *) * nsObjc);
for (i=0 ; i<(size_t)nsObjc ; i++) {
@@ -4118,7 +4148,7 @@ TclSetNsPath(
{
if (pathLength != 0) {
NamespacePathEntry *tmpPathArray =
- Tcl_Alloc(sizeof(NamespacePathEntry) * pathLength);
+ (NamespacePathEntry *)Tcl_Alloc(sizeof(NamespacePathEntry) * pathLength);
size_t i;
for (i=0 ; i<pathLength ; i++) {
@@ -4257,6 +4287,7 @@ NamespaceQualifiersCmd(
{
const char *name, *p;
size_t length;
+ (void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "string");
@@ -4326,6 +4357,7 @@ NamespaceUnknownCmd(
Tcl_Namespace *currNsPtr;
Tcl_Obj *resultPtr;
int rc;
+ (void)dummy;
if (objc > 2) {
Tcl_WrongNumArgs(interp, 1, objv, "?script?");
@@ -4511,6 +4543,7 @@ NamespaceTailCmd(
Tcl_Obj *const objv[]) /* Argument objects. */
{
const char *name, *p;
+ (void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "string");
@@ -4572,6 +4605,7 @@ NamespaceUpvarCmd(
Tcl_Namespace *nsPtr, *savedNsPtr;
Var *otherPtr, *arrayPtr;
const char *myName;
+ (void)dummy;
if (objc < 2 || (objc & 1)) {
Tcl_WrongNumArgs(interp, 1, objv, "ns ?otherVar myVar ...?");
@@ -4647,6 +4681,7 @@ NamespaceWhichCmd(
};
int lookupType = 0;
Tcl_Obj *resultPtr;
+ (void)dummy;
if (objc < 2 || objc > 3) {
badArgs:
@@ -4821,7 +4856,7 @@ SetNsNameFromAny(
*/
nsPtr->refCount++;
- resNamePtr = Tcl_Alloc(sizeof(ResolvedNsName));
+ resNamePtr = (ResolvedNsName *)Tcl_Alloc(sizeof(ResolvedNsName));
resNamePtr->nsPtr = nsPtr;
if ((name[0] == ':') && (name[1] == ':')) {
resNamePtr->refNsPtr = NULL;
@@ -4881,7 +4916,7 @@ TclGetNamespaceChildTable(
return &nPtr->childTable;
#else
if (nPtr->childTablePtr == NULL) {
- nPtr->childTablePtr = Tcl_Alloc(sizeof(Tcl_HashTable));
+ nPtr->childTablePtr = (Tcl_HashTable *)Tcl_Alloc(sizeof(Tcl_HashTable));
Tcl_InitHashTable(nPtr->childTablePtr, TCL_STRING_KEYS);
}
return nPtr->childTablePtr;
@@ -4970,7 +5005,7 @@ TclLogCommandInfo(
} else {
Tcl_HashEntry *hPtr
= Tcl_FindHashEntry(&iPtr->varTraces, (char *) varPtr);
- VarTrace *tracePtr = Tcl_GetHashValue(hPtr);
+ VarTrace *tracePtr = (VarTrace *)Tcl_GetHashValue(hPtr);
if (tracePtr->traceProc != EstablishErrorInfoTraces) {
/*
diff --git a/generic/tclNotify.c b/generic/tclNotify.c
index 41a70b1..2f13710 100644
--- a/generic/tclNotify.c
+++ b/generic/tclNotify.c
@@ -276,7 +276,7 @@ Tcl_CreateEventSource(
* checkProc. */
{
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
- EventSource *sourcePtr = Tcl_Alloc(sizeof(EventSource));
+ EventSource *sourcePtr = (EventSource *)Tcl_Alloc(sizeof(EventSource));
sourcePtr->setupProc = setupProc;
sourcePtr->checkProc = checkProc;
diff --git a/generic/tclOO.c b/generic/tclOO.c
index 5ffe294..14a3343 100644
--- a/generic/tclOO.c
+++ b/generic/tclOO.c
@@ -299,8 +299,8 @@ InitFoundation(
{
static Tcl_ThreadDataKey tsdKey;
ThreadLocalData *tsdPtr =
- Tcl_GetThreadData(&tsdKey, sizeof(ThreadLocalData));
- Foundation *fPtr = Tcl_Alloc(sizeof(Foundation));
+ (ThreadLocalData *)Tcl_GetThreadData(&tsdKey, sizeof(ThreadLocalData));
+ Foundation *fPtr = (Foundation *)Tcl_Alloc(sizeof(Foundation));
Tcl_Obj *namePtr;
Tcl_DString buffer;
Command *cmdPtr;
@@ -533,7 +533,7 @@ static void
DeletedDefineNamespace(
ClientData clientData)
{
- Foundation *fPtr = clientData;
+ Foundation *fPtr = (Foundation *)clientData;
fPtr->defineNs = NULL;
}
@@ -542,7 +542,7 @@ static void
DeletedObjdefNamespace(
ClientData clientData)
{
- Foundation *fPtr = clientData;
+ Foundation *fPtr = (Foundation *)clientData;
fPtr->objdefNs = NULL;
}
@@ -551,7 +551,7 @@ static void
DeletedHelpersNamespace(
ClientData clientData)
{
- Foundation *fPtr = clientData;
+ Foundation *fPtr = (Foundation *)clientData;
fPtr->helpersNs = NULL;
}
@@ -569,12 +569,13 @@ DeletedHelpersNamespace(
static void
KillFoundation(
- ClientData clientData, /* Pointer to the OO system foundation
+ ClientData dummy, /* Pointer to the OO system foundation
* structure. */
Tcl_Interp *interp) /* The interpreter containing the OO system
* foundation. */
{
Foundation *fPtr = GetFoundation(interp);
+ (void)dummy;
TclDecrRefCount(fPtr->unknownMethodNameObj);
TclDecrRefCount(fPtr->constructorName);
@@ -624,7 +625,7 @@ AllocObject(
CommandTrace *tracePtr;
size_t creationEpoch;
- oPtr = Tcl_Alloc(sizeof(Object));
+ oPtr = (Object *)Tcl_Alloc(sizeof(Object));
memset(oPtr, 0, sizeof(Object));
/*
@@ -735,7 +736,7 @@ AllocObject(
cmdPtr = (Command *) oPtr->command;
cmdPtr->nreProc = PublicNRObjectCmd;
- cmdPtr->tracePtr = tracePtr = Tcl_Alloc(sizeof(CommandTrace));
+ cmdPtr->tracePtr = tracePtr = (CommandTrace *)Tcl_Alloc(sizeof(CommandTrace));
tracePtr->traceProc = ObjectRenamedTrace;
tracePtr->clientData = oPtr;
tracePtr->flags = TCL_TRACE_RENAME|TCL_TRACE_DELETE;
@@ -789,7 +790,7 @@ MyDeleted(
ClientData clientData) /* Reference to the object whose [my] has been
* squelched. */
{
- Object *oPtr = clientData;
+ Object *oPtr = (Object *)clientData;
oPtr->myCommand = NULL;
}
@@ -798,7 +799,7 @@ static void
MyClassDeleted(
ClientData clientData)
{
- Object *oPtr = clientData;
+ Object *oPtr = (Object *)clientData;
oPtr->myclassCommand = NULL;
}
@@ -823,7 +824,10 @@ ObjectRenamedTrace(
const char *newName, /* What it's getting renamed to. (unused) */
int flags) /* Why was the object deleted? */
{
- Object *oPtr = clientData;
+ Object *oPtr = (Object *)clientData;
+ (void)interp;
+ (void)oldName;
+ (void)newName;
/*
* If this is a rename and not a delete of the object, we just flush the
@@ -1110,7 +1114,7 @@ ObjectNamespaceDeleted(
ClientData clientData) /* Pointer to the class whose namespace is
* being deleted. */
{
- Object *oPtr = clientData;
+ Object *oPtr = (Object *)clientData;
Foundation *fPtr = oPtr->fPtr;
FOREACH_HASH_DECLS;
Class *mixinPtr;
@@ -1394,9 +1398,9 @@ TclOOAddToInstances(
if (clsPtr->instances.num >= clsPtr->instances.size) {
clsPtr->instances.size += ALLOC_CHUNK;
if (clsPtr->instances.size == ALLOC_CHUNK) {
- clsPtr->instances.list = Tcl_Alloc(sizeof(Object *) * ALLOC_CHUNK);
+ clsPtr->instances.list = (Object **)Tcl_Alloc(sizeof(Object *) * ALLOC_CHUNK);
} else {
- clsPtr->instances.list = Tcl_Realloc(clsPtr->instances.list,
+ clsPtr->instances.list = (Object **)Tcl_Realloc(clsPtr->instances.list,
sizeof(Object *) * clsPtr->instances.size);
}
}
@@ -1493,9 +1497,9 @@ TclOOAddToSubclasses(
if (superPtr->subclasses.num >= superPtr->subclasses.size) {
superPtr->subclasses.size += ALLOC_CHUNK;
if (superPtr->subclasses.size == ALLOC_CHUNK) {
- superPtr->subclasses.list = Tcl_Alloc(sizeof(Class *) * ALLOC_CHUNK);
+ superPtr->subclasses.list = (Class **)Tcl_Alloc(sizeof(Class *) * ALLOC_CHUNK);
} else {
- superPtr->subclasses.list = Tcl_Realloc(superPtr->subclasses.list,
+ superPtr->subclasses.list = (Class **)Tcl_Realloc(superPtr->subclasses.list,
sizeof(Class *) * superPtr->subclasses.size);
}
}
@@ -1558,9 +1562,9 @@ TclOOAddToMixinSubs(
if (superPtr->mixinSubs.num >= superPtr->mixinSubs.size) {
superPtr->mixinSubs.size += ALLOC_CHUNK;
if (superPtr->mixinSubs.size == ALLOC_CHUNK) {
- superPtr->mixinSubs.list = Tcl_Alloc(sizeof(Class *) * ALLOC_CHUNK);
+ superPtr->mixinSubs.list = (Class **)Tcl_Alloc(sizeof(Class *) * ALLOC_CHUNK);
} else {
- superPtr->mixinSubs.list = Tcl_Realloc(superPtr->mixinSubs.list,
+ superPtr->mixinSubs.list = (Class **)Tcl_Realloc(superPtr->mixinSubs.list,
sizeof(Class *) * superPtr->mixinSubs.size);
}
}
@@ -1606,7 +1610,7 @@ TclOOAllocClass(
* representation. */
{
Foundation *fPtr = GetFoundation(interp);
- Class *clsPtr = Tcl_Alloc(sizeof(Class));
+ Class *clsPtr = (Class *)Tcl_Alloc(sizeof(Class));
memset(clsPtr, 0, sizeof(Class));
clsPtr->thisPtr = useThisObj;
@@ -1623,7 +1627,7 @@ TclOOAllocClass(
*/
clsPtr->superclasses.num = 1;
- clsPtr->superclasses.list = Tcl_Alloc(sizeof(Class *));
+ clsPtr->superclasses.list = (Class **)Tcl_Alloc(sizeof(Class *));
clsPtr->superclasses.list[0] = fPtr->objectCls;
AddRef(fPtr->objectCls->thisPtr);
@@ -1851,10 +1855,10 @@ FinalizeAlloc(
Tcl_Interp *interp,
int result)
{
- CallContext *contextPtr = data[0];
- Object *oPtr = data[1];
- Tcl_InterpState state = data[2];
- Tcl_Object *objectPtr = data[3];
+ CallContext *contextPtr = (CallContext *)data[0];
+ Object *oPtr = (Object *)data[1];
+ Tcl_InterpState state = (Tcl_InterpState)data[2];
+ Tcl_Object *objectPtr = (Tcl_Object *)data[3];
/*
* Ensure an error if the object was deleted in the constructor. Don't
@@ -2074,11 +2078,11 @@ Tcl_CopyObjectInstance(
TclOODecrRefCount(superPtr->thisPtr);
}
if (cls2Ptr->superclasses.num) {
- cls2Ptr->superclasses.list = Tcl_Realloc(cls2Ptr->superclasses.list,
+ cls2Ptr->superclasses.list = (Class **)Tcl_Realloc(cls2Ptr->superclasses.list,
sizeof(Class *) * clsPtr->superclasses.num);
} else {
cls2Ptr->superclasses.list =
- Tcl_Alloc(sizeof(Class *) * clsPtr->superclasses.num);
+ (Class **)Tcl_Alloc(sizeof(Class *) * clsPtr->superclasses.num);
}
memcpy(cls2Ptr->superclasses.list, clsPtr->superclasses.list,
sizeof(Class *) * clsPtr->superclasses.num);
@@ -2372,7 +2376,7 @@ Tcl_ClassSetMetadata(
if (metadata == NULL) {
return;
}
- clsPtr->metadataPtr = Tcl_Alloc(sizeof(Tcl_HashTable));
+ clsPtr->metadataPtr = (Tcl_HashTable *)Tcl_Alloc(sizeof(Tcl_HashTable));
Tcl_InitHashTable(clsPtr->metadataPtr, TCL_ONE_WORD_KEYS);
}
@@ -2452,7 +2456,7 @@ Tcl_ObjectSetMetadata(
if (metadata == NULL) {
return;
}
- oPtr->metadataPtr = Tcl_Alloc(sizeof(Tcl_HashTable));
+ oPtr->metadataPtr = (Tcl_HashTable *)Tcl_Alloc(sizeof(Tcl_HashTable));
Tcl_InitHashTable(oPtr->metadataPtr, TCL_ONE_WORD_KEYS);
}
@@ -2511,7 +2515,7 @@ PublicNRObjectCmd(
int objc,
Tcl_Obj *const *objv)
{
- return TclOOObjectCmdCore(clientData, interp, objc, objv, PUBLIC_METHOD,
+ return TclOOObjectCmdCore((Object *)clientData, interp, objc, objv, PUBLIC_METHOD,
NULL);
}
@@ -2532,7 +2536,7 @@ PrivateNRObjectCmd(
int objc,
Tcl_Obj *const *objv)
{
- return TclOOObjectCmdCore(clientData, interp, objc, objv, 0, NULL);
+ return TclOOObjectCmdCore((Object *)clientData, interp, objc, objv, 0, NULL);
}
int
@@ -2593,7 +2597,7 @@ MyClassNRObjCmd(
int objc,
Tcl_Obj *const *objv)
{
- Object *oPtr = clientData;
+ Object *oPtr = (Object *)clientData;
if (objc < 2) {
Tcl_WrongNumArgs(interp, 1, objv, "methodName ?arg ...?");
@@ -2652,7 +2656,7 @@ TclOOObjectCmdCore(
*/
if (framePtr->isProcCallFrame & FRAME_IS_METHOD) {
- CallContext *callerContextPtr = framePtr->clientData;
+ CallContext *callerContextPtr = (CallContext *)framePtr->clientData;
Method *callerMethodPtr =
callerContextPtr->callPtr->chain[callerContextPtr->index].mPtr;
@@ -2761,15 +2765,16 @@ TclOOObjectCmdCore(
static int
FinalizeObjectCall(
ClientData data[],
- Tcl_Interp *interp,
+ Tcl_Interp *dummy,
int result)
{
+ (void)dummy;
/*
* Dispose of the call chain, which drops the lock on the object's
* structure.
*/
- TclOODeleteContext(data[0]);
+ TclOODeleteContext((CallContext *)data[0]);
return result;
}
@@ -2922,10 +2927,11 @@ TclNRObjectContextInvokeNext(
static int
FinalizeNext(
ClientData data[],
- Tcl_Interp *interp,
+ Tcl_Interp *dummy,
int result)
{
- CallContext *contextPtr = data[0];
+ CallContext *contextPtr = (CallContext *)data[0];
+ (void)dummy;
/*
* Restore the call chain context index as we've finished the inner invoke
@@ -2966,7 +2972,7 @@ Tcl_GetObjectFromObj(
goto notAnObject;
}
}
- return cmdPtr->objClientData;
+ return (Tcl_Object)cmdPtr->objClientData;
notAnObject:
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
diff --git a/generic/tclOOBasic.c b/generic/tclOOBasic.c
index 7094405..c823f7a 100644
--- a/generic/tclOOBasic.c
+++ b/generic/tclOOBasic.c
@@ -55,7 +55,7 @@ FinalizeConstruction(
Tcl_Interp *interp,
int result)
{
- Object *oPtr = data[0];
+ Object *oPtr = (Object *)data[0];
if (result != TCL_OK) {
return result;
@@ -76,7 +76,7 @@ FinalizeConstruction(
int
TclOO_Class_Constructor(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
Tcl_ObjectContext context,
int objc,
@@ -84,6 +84,7 @@ TclOO_Class_Constructor(
{
Object *oPtr = (Object *) Tcl_ObjectContextObject(context);
Tcl_Obj **invoke, *nameObj;
+ (void)dummy;
if (objc-1 > Tcl_ObjectContextSkippedArgs(context)) {
Tcl_WrongNumArgs(interp, Tcl_ObjectContextSkippedArgs(context), objv,
@@ -108,7 +109,7 @@ TclOO_Class_Constructor(
* Delegate to [oo::define] to do the work.
*/
- invoke = Tcl_Alloc(3 * sizeof(Tcl_Obj *));
+ invoke = (Tcl_Obj **)Tcl_Alloc(3 * sizeof(Tcl_Obj *));
invoke[0] = oPtr->fPtr->defineName;
invoke[1] = TclOOObjectName(interp, oPtr);
invoke[2] = objv[objc-1];
@@ -138,8 +139,8 @@ DecrRefsPostClassConstructor(
Tcl_Interp *interp,
int result)
{
- Tcl_Obj **invoke = data[0];
- Object *oPtr = data[1];
+ Tcl_Obj **invoke = (Tcl_Obj **)data[0];
+ Object *oPtr = (Object *)data[1];
Tcl_InterpState saved;
int code;
@@ -174,7 +175,7 @@ DecrRefsPostClassConstructor(
int
TclOO_Class_Create(
- ClientData clientData, /* Ignored. */
+ ClientData dummy, /* Ignored. */
Tcl_Interp *interp, /* Interpreter in which to create the object;
* also used for error reporting. */
Tcl_ObjectContext context, /* The object/call context. */
@@ -184,6 +185,7 @@ TclOO_Class_Create(
Object *oPtr = (Object *) Tcl_ObjectContextObject(context);
const char *objName;
size_t len;
+ (void)dummy;
/*
* Sanity check; should not be possible to invoke this method on a
@@ -239,7 +241,7 @@ TclOO_Class_Create(
int
TclOO_Class_CreateNs(
- ClientData clientData, /* Ignored. */
+ ClientData dummy, /* Ignored. */
Tcl_Interp *interp, /* Interpreter in which to create the object;
* also used for error reporting. */
Tcl_ObjectContext context, /* The object/call context. */
@@ -249,6 +251,7 @@ TclOO_Class_CreateNs(
Object *oPtr = (Object *) Tcl_ObjectContextObject(context);
const char *objName, *nsName;
size_t len;
+ (void)dummy;
/*
* Sanity check; should not be possible to invoke this method on a
@@ -312,7 +315,7 @@ TclOO_Class_CreateNs(
int
TclOO_Class_New(
- ClientData clientData, /* Ignored. */
+ ClientData dummy, /* Ignored. */
Tcl_Interp *interp, /* Interpreter in which to create the object;
* also used for error reporting. */
Tcl_ObjectContext context, /* The object/call context. */
@@ -320,6 +323,7 @@ TclOO_Class_New(
Tcl_Obj *const *objv) /* The actual arguments. */
{
Object *oPtr = (Object *) Tcl_ObjectContextObject(context);
+ (void)dummy;
/*
* Sanity check; should not be possible to invoke this method on a
@@ -356,7 +360,7 @@ TclOO_Class_New(
int
TclOO_Object_Destroy(
- ClientData clientData, /* Ignored. */
+ ClientData dummy, /* Ignored. */
Tcl_Interp *interp, /* Interpreter in which to create the object;
* also used for error reporting. */
Tcl_ObjectContext context, /* The object/call context. */
@@ -365,6 +369,7 @@ TclOO_Object_Destroy(
{
Object *oPtr = (Object *) Tcl_ObjectContextObject(context);
CallContext *contextPtr;
+ (void)dummy;
if (objc != Tcl_ObjectContextSkippedArgs(context)) {
Tcl_WrongNumArgs(interp, Tcl_ObjectContextSkippedArgs(context), objv,
@@ -396,7 +401,7 @@ AfterNRDestructor(
Tcl_Interp *interp,
int result)
{
- CallContext *contextPtr = data[0];
+ CallContext *contextPtr = (CallContext *)data[0];
if (contextPtr->oPtr->command) {
Tcl_DeleteCommandFromToken(interp, contextPtr->oPtr->command);
@@ -417,7 +422,7 @@ AfterNRDestructor(
int
TclOO_Object_Eval(
- ClientData clientData, /* Ignored. */
+ ClientData dummy, /* Ignored. */
Tcl_Interp *interp, /* Interpreter in which to create the object;
* also used for error reporting. */
Tcl_ObjectContext context, /* The object/call context. */
@@ -430,6 +435,7 @@ TclOO_Object_Eval(
CallFrame *framePtr, **framePtrPtr = &framePtr;
Tcl_Obj *scriptPtr;
CmdFrame *invoker;
+ (void)dummy;
if (objc-1 < skip) {
Tcl_WrongNumArgs(interp, skip, objv, "arg ?arg ...?");
@@ -483,7 +489,7 @@ FinalizeEval(
int result)
{
if (result == TCL_ERROR) {
- Object *oPtr = data[0];
+ Object *oPtr = (Object *)data[0];
const char *namePtr;
if (oPtr) {
@@ -518,7 +524,7 @@ FinalizeEval(
int
TclOO_Object_Unknown(
- ClientData clientData, /* Ignored. */
+ ClientData dummy, /* Ignored. */
Tcl_Interp *interp, /* Interpreter in which to create the object;
* also used for error reporting. */
Tcl_ObjectContext context, /* The object/call context. */
@@ -533,6 +539,7 @@ TclOO_Object_Unknown(
int numMethodNames, i, skip = Tcl_ObjectContextSkippedArgs(context);
CallFrame *framePtr = ((Interp *) interp)->varFramePtr;
Tcl_Obj *errorMsg;
+ (void)dummy;
/*
* If no method name, generate an error asking for a method name. (Only by
@@ -551,7 +558,7 @@ TclOO_Object_Unknown(
*/
if (framePtr->isProcCallFrame & FRAME_IS_METHOD) {
- CallContext *callerContext = framePtr->clientData;
+ CallContext *callerContext = (CallContext *)framePtr->clientData;
Method *mPtr = callerContext->callPtr->chain[
callerContext->index].mPtr;
@@ -624,7 +631,7 @@ TclOO_Object_Unknown(
int
TclOO_Object_LinkVar(
- ClientData clientData, /* Ignored. */
+ ClientData dummy, /* Ignored. */
Tcl_Interp *interp, /* Interpreter in which to create the object;
* also used for error reporting. */
Tcl_ObjectContext context, /* The object/call context. */
@@ -635,6 +642,7 @@ TclOO_Object_LinkVar(
Tcl_Object object = Tcl_ObjectContextObject(context);
Namespace *savedNsPtr;
int i;
+ (void)dummy;
if (objc-Tcl_ObjectContextSkippedArgs(context) < 0) {
Tcl_WrongNumArgs(interp, Tcl_ObjectContextSkippedArgs(context), objv,
@@ -726,7 +734,7 @@ TclOO_Object_LinkVar(
int
TclOO_Object_VarName(
- ClientData clientData, /* Ignored. */
+ ClientData dummy, /* Ignored. */
Tcl_Interp *interp, /* Interpreter in which to create the object;
* also used for error reporting. */
Tcl_ObjectContext context, /* The object/call context. */
@@ -737,6 +745,7 @@ TclOO_Object_VarName(
Tcl_Obj *varNamePtr, *argPtr;
CallFrame *framePtr = ((Interp *) interp)->varFramePtr;
const char *arg;
+ (void)dummy;
if (Tcl_ObjectContextSkippedArgs(context)+1 != objc) {
Tcl_WrongNumArgs(interp, Tcl_ObjectContextSkippedArgs(context), objv,
@@ -773,7 +782,7 @@ TclOO_Object_VarName(
if (framePtr->isProcCallFrame & FRAME_IS_METHOD) {
Object *oPtr = (Object *) Tcl_ObjectContextObject(context);
- CallContext *callerContext = framePtr->clientData;
+ CallContext *callerContext = (CallContext *)framePtr->clientData;
Method *mPtr = callerContext->callPtr->chain[
callerContext->index].mPtr;
PrivateVariableMapping *pvPtr;
@@ -864,7 +873,7 @@ TclOO_Object_VarName(
int
TclOONextObjCmd(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const *objv)
@@ -872,6 +881,7 @@ TclOONextObjCmd(
Interp *iPtr = (Interp *) interp;
CallFrame *framePtr = iPtr->varFramePtr;
Tcl_ObjectContext context;
+ (void)dummy;
/*
* Start with sanity checks on the calling context to make sure that we
@@ -886,7 +896,7 @@ TclOONextObjCmd(
Tcl_SetErrorCode(interp, "TCL", "OO", "CONTEXT_REQUIRED", NULL);
return TCL_ERROR;
}
- context = framePtr->clientData;
+ context = (Tcl_ObjectContext)framePtr->clientData;
/*
* Invoke the (advanced) method call context in the caller context. Note
@@ -900,7 +910,7 @@ TclOONextObjCmd(
int
TclOONextToObjCmd(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const *objv)
@@ -912,6 +922,7 @@ TclOONextToObjCmd(
int i;
Tcl_Object object;
const char *methodType;
+ (void)dummy;
/*
* Start with sanity checks on the calling context to make sure that we
@@ -926,7 +937,7 @@ TclOONextToObjCmd(
Tcl_SetErrorCode(interp, "TCL", "OO", "CONTEXT_REQUIRED", NULL);
return TCL_ERROR;
}
- contextPtr = framePtr->clientData;
+ contextPtr = (CallContext *)framePtr->clientData;
/*
* Sanity check the arguments; we need the first one to refer to a class.
@@ -1011,9 +1022,9 @@ NextRestoreFrame(
int result)
{
Interp *iPtr = (Interp *) interp;
- CallContext *contextPtr = data[1];
+ CallContext *contextPtr = (CallContext *)data[1];
- iPtr->varFramePtr = data[0];
+ iPtr->varFramePtr = (CallFrame *)data[0];
if (contextPtr != NULL) {
contextPtr->index = PTR2INT(data[2]);
}
@@ -1033,7 +1044,7 @@ NextRestoreFrame(
int
TclOOSelfObjCmd(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const *objv)
@@ -1051,6 +1062,7 @@ TclOOSelfObjCmd(
CallContext *contextPtr;
Tcl_Obj *result[3];
int index;
+ (void)dummy;
#define CurrentlyInvoked(contextPtr) \
((contextPtr)->callPtr->chain[(contextPtr)->index])
@@ -1067,7 +1079,7 @@ TclOOSelfObjCmd(
return TCL_ERROR;
}
- contextPtr = framePtr->clientData;
+ contextPtr = (CallContext*)framePtr->clientData;
/*
* Now we do "conventional" argument parsing for a while. Note that no
@@ -1148,7 +1160,7 @@ TclOOSelfObjCmd(
Tcl_SetErrorCode(interp, "TCL", "OO", "CONTEXT_REQUIRED", NULL);
return TCL_ERROR;
} else {
- CallContext *callerPtr = framePtr->callerVarPtr->clientData;
+ CallContext *callerPtr = (CallContext *)framePtr->callerVarPtr->clientData;
Method *mPtr = callerPtr->callPtr->chain[callerPtr->index].mPtr;
Object *declarerPtr;
@@ -1270,12 +1282,13 @@ TclOOSelfObjCmd(
int
TclOOCopyObjectCmd(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const *objv)
{
Tcl_Object oPtr, o2Ptr;
+ (void)dummy;
if (objc < 2 || objc > 4) {
Tcl_WrongNumArgs(interp, 1, objv,
diff --git a/generic/tclOOCall.c b/generic/tclOOCall.c
index fe4436a..03b7be0 100644
--- a/generic/tclOOCall.c
+++ b/generic/tclOOCall.c
@@ -280,7 +280,7 @@ DupMethodNameRep(
Tcl_Obj *dstPtr)
{
StashCallChain(dstPtr,
- TclFetchIntRep(srcPtr, &methodNameType)->twoPtrValue.ptr1);
+ (CallChain *)TclFetchIntRep(srcPtr, &methodNameType)->twoPtrValue.ptr1);
}
static void
@@ -288,7 +288,7 @@ FreeMethodNameRep(
Tcl_Obj *objPtr)
{
TclOODeleteChain(
- TclFetchIntRep(objPtr, &methodNameType)->twoPtrValue.ptr1);
+ (CallChain *)TclFetchIntRep(objPtr, &methodNameType)->twoPtrValue.ptr1);
}
/*
@@ -314,7 +314,7 @@ TclOOInvokeContext(
int objc, /* The number of arguments. */
Tcl_Obj *const objv[]) /* The arguments as actually seen. */
{
- CallContext *const contextPtr = clientData;
+ CallContext *const contextPtr = (CallContext *)clientData;
Method *const mPtr = contextPtr->callPtr->chain[contextPtr->index].mPtr;
const int isFilter =
contextPtr->callPtr->chain[contextPtr->index].isFilter;
@@ -376,10 +376,11 @@ TclOOInvokeContext(
static int
SetFilterFlags(
ClientData data[],
- Tcl_Interp *interp,
+ Tcl_Interp *dummy,
int result)
{
- CallContext *contextPtr = data[0];
+ CallContext *contextPtr = (CallContext *)data[0];
+ (void)dummy;
contextPtr->oPtr->flags |= FILTER_HANDLING;
return result;
@@ -388,10 +389,11 @@ SetFilterFlags(
static int
ResetFilterFlags(
ClientData data[],
- Tcl_Interp *interp,
+ Tcl_Interp *dummy,
int result)
{
- CallContext *contextPtr = data[0];
+ CallContext *contextPtr = (CallContext *)data[0];
+ (void)dummy;
contextPtr->oPtr->flags &= ~FILTER_HANDLING;
return result;
@@ -400,11 +402,12 @@ ResetFilterFlags(
static int
FinalizeMethodRefs(
ClientData data[],
- Tcl_Interp *interp,
+ Tcl_Interp *dummy,
int result)
{
- CallContext *contextPtr = data[0];
+ CallContext *contextPtr = (CallContext *)data[0];
int i;
+ (void)dummy;
for (i = 0 ; i < contextPtr->callPtr->numChain ; i++) {
TclOODelMethodRef(contextPtr->callPtr->chain[i].mPtr);
@@ -613,7 +616,7 @@ SortMethodNames(
* sorted when it is long enough to matter.
*/
- strings = Tcl_Alloc(sizeof(char *) * namesPtr->numEntries);
+ strings = (const char **)Tcl_Alloc(sizeof(char *) * namesPtr->numEntries);
FOREACH_HASH(namePtr, isWanted, namesPtr) {
if (!WANT_PUBLIC(flags) || (PTR2INT(isWanted) & IN_LIST)) {
if (PTR2INT(isWanted) & NO_IMPLEMENTATION) {
@@ -835,7 +838,7 @@ AddInstancePrivateToCallContext(
if (oPtr->methodsPtr) {
hPtr = Tcl_FindHashEntry(oPtr->methodsPtr, (char *) methodName);
if (hPtr != NULL) {
- mPtr = Tcl_GetHashValue(hPtr);
+ mPtr = (Method *)Tcl_GetHashValue(hPtr);
if (IS_PRIVATE(mPtr)) {
AddMethodToCallChain(mPtr, cbPtr, NULL, NULL, flags);
donePrivate = 1;
@@ -885,7 +888,7 @@ AddSimpleChainToCallContext(
hPtr = Tcl_FindHashEntry(oPtr->methodsPtr, (char *) methodNameObj);
if (hPtr != NULL) {
- mPtr = Tcl_GetHashValue(hPtr);
+ mPtr = (Method *)Tcl_GetHashValue(hPtr);
if (!IS_PRIVATE(mPtr)) {
if (WANT_PUBLIC(flags)) {
if (!IS_PUBLIC(mPtr)) {
@@ -915,7 +918,7 @@ AddSimpleChainToCallContext(
if (oPtr->methodsPtr && !blockedUnexported) {
hPtr = Tcl_FindHashEntry(oPtr->methodsPtr, (char*) methodNameObj);
if (hPtr != NULL) {
- mPtr = Tcl_GetHashValue(hPtr);
+ mPtr = (Method *)Tcl_GetHashValue(hPtr);
if (!IS_PRIVATE(mPtr)) {
AddMethodToCallChain(mPtr, cbPtr, doneFilters, filterDecl,
flags);
@@ -1037,11 +1040,11 @@ AddMethodToCallChain(
if (callPtr->numChain == CALL_CHAIN_STATIC_SIZE) {
callPtr->chain =
- Tcl_Alloc(sizeof(struct MInvoke) * (callPtr->numChain + 1));
+ (struct MInvoke *)Tcl_Alloc(sizeof(struct MInvoke) * (callPtr->numChain + 1));
memcpy(callPtr->chain, callPtr->staticChain,
sizeof(struct MInvoke) * callPtr->numChain);
} else if (callPtr->numChain > CALL_CHAIN_STATIC_SIZE) {
- callPtr->chain = Tcl_Realloc(callPtr->chain,
+ callPtr->chain = (struct MInvoke *)Tcl_Realloc(callPtr->chain,
sizeof(struct MInvoke) * (callPtr->numChain + 1));
}
callPtr->chain[i].mPtr = mPtr;
@@ -1193,7 +1196,7 @@ TclOOGetCallContext(
const int reuseMask = (WANT_PUBLIC(flags) ? ~0 : ~PUBLIC_METHOD);
if ((irPtr = TclFetchIntRep(cacheInThisObj, &methodNameType))) {
- callPtr = irPtr->twoPtrValue.ptr1;
+ callPtr = (CallChain *)irPtr->twoPtrValue.ptr1;
if (IsStillValid(callPtr, oPtr, flags, reuseMask)) {
callPtr->refCount++;
goto returnContext;
@@ -1218,7 +1221,7 @@ TclOOGetCallContext(
}
if (hPtr != NULL && Tcl_GetHashValue(hPtr) != NULL) {
- callPtr = Tcl_GetHashValue(hPtr);
+ callPtr = (CallChain *)Tcl_GetHashValue(hPtr);
if (IsStillValid(callPtr, oPtr, flags, reuseMask)) {
callPtr->refCount++;
goto returnContext;
@@ -1230,7 +1233,7 @@ TclOOGetCallContext(
doFilters = 1;
}
- callPtr = Tcl_Alloc(sizeof(CallChain));
+ callPtr = (CallChain *)Tcl_Alloc(sizeof(CallChain));
InitCallChain(callPtr, oPtr, flags);
cb.callChainPtr = callPtr;
@@ -1335,7 +1338,7 @@ TclOOGetCallContext(
if (oPtr->flags & USE_CLASS_CACHE) {
if (oPtr->selfCls->classChainCache == NULL) {
oPtr->selfCls->classChainCache =
- Tcl_Alloc(sizeof(Tcl_HashTable));
+ (Tcl_HashTable *)Tcl_Alloc(sizeof(Tcl_HashTable));
Tcl_InitObjHashTable(oPtr->selfCls->classChainCache);
}
@@ -1343,7 +1346,7 @@ TclOOGetCallContext(
(char *) methodNameObj, &i);
} else {
if (oPtr->chainCache == NULL) {
- oPtr->chainCache = Tcl_Alloc(sizeof(Tcl_HashTable));
+ oPtr->chainCache = (Tcl_HashTable *)Tcl_Alloc(sizeof(Tcl_HashTable));
Tcl_InitObjHashTable(oPtr->chainCache);
}
@@ -1369,7 +1372,7 @@ TclOOGetCallContext(
}
returnContext:
- contextPtr = TclStackAlloc(oPtr->fPtr->interp, sizeof(CallContext));
+ contextPtr = (CallContext *)TclStackAlloc(oPtr->fPtr->interp, sizeof(CallContext));
contextPtr->oPtr = oPtr;
/*
@@ -1438,7 +1441,7 @@ TclOOGetStereotypeCallChain(
if (hPtr != NULL && Tcl_GetHashValue(hPtr) != NULL) {
const int reuseMask = (WANT_PUBLIC(flags) ? ~0 : ~PUBLIC_METHOD);
- callPtr = Tcl_GetHashValue(hPtr);
+ callPtr = (CallChain *)Tcl_GetHashValue(hPtr);
if (IsStillValid(callPtr, &obj, flags, reuseMask)) {
callPtr->refCount++;
return callPtr;
@@ -1450,7 +1453,7 @@ TclOOGetStereotypeCallChain(
hPtr = NULL;
}
- callPtr = Tcl_Alloc(sizeof(CallChain));
+ callPtr = (CallChain *)Tcl_Alloc(sizeof(CallChain));
memset(callPtr, 0, sizeof(CallChain));
callPtr->flags = flags & (PUBLIC_METHOD|PRIVATE_METHOD|FILTER_HANDLING);
callPtr->epoch = fPtr->epoch;
@@ -1505,7 +1508,7 @@ TclOOGetStereotypeCallChain(
} else {
if (hPtr == NULL) {
if (clsPtr->classChainCache == NULL) {
- clsPtr->classChainCache = Tcl_Alloc(sizeof(Tcl_HashTable));
+ clsPtr->classChainCache = (Tcl_HashTable *)Tcl_Alloc(sizeof(Tcl_HashTable));
Tcl_InitObjHashTable(clsPtr->classChainCache);
}
hPtr = Tcl_CreateHashEntry(clsPtr->classChainCache,
@@ -1653,10 +1656,10 @@ AddPrivatesFromClassChainToCallContext(
if (classPtr == contextCls) {
Tcl_HashEntry *hPtr = Tcl_FindHashEntry(&classPtr->classMethods,
- (char *) methodName);
+ methodName);
if (hPtr != NULL) {
- Method *mPtr = Tcl_GetHashValue(hPtr);
+ Method *mPtr = (Method *)Tcl_GetHashValue(hPtr);
if (IS_PRIVATE(mPtr)) {
AddMethodToCallChain(mPtr, cbPtr, doneFilters, filterDecl,
@@ -1741,7 +1744,7 @@ AddSimpleClassChainToCallContext(
privateDanger |= 1;
}
if (hPtr != NULL) {
- Method *mPtr = Tcl_GetHashValue(hPtr);
+ Method *mPtr = (Method *)Tcl_GetHashValue(hPtr);
if (!IS_PRIVATE(mPtr)) {
if (!(flags & KNOWN_STATE)) {
@@ -1821,7 +1824,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];
@@ -2089,11 +2092,11 @@ AddDefinitionNamespaceToChain(
DefineEntry *staticList = definePtr->list;
definePtr->list =
- Tcl_Alloc(sizeof(DefineEntry) * definePtr->size);
+ (DefineEntry *)Tcl_Alloc(sizeof(DefineEntry) * definePtr->size);
memcpy(definePtr->list, staticList,
sizeof(DefineEntry) * definePtr->num);
} else {
- definePtr->list = Tcl_Realloc(definePtr->list,
+ definePtr->list = (DefineEntry *)Tcl_Realloc(definePtr->list,
sizeof(DefineEntry) * definePtr->size);
}
}
diff --git a/generic/tclOODefineCmds.c b/generic/tclOODefineCmds.c
index fb2fbb5..c2fa243 100644
--- a/generic/tclOODefineCmds.c
+++ b/generic/tclOODefineCmds.c
@@ -280,9 +280,9 @@ TclOOObjectSetFilters(
int size = sizeof(Tcl_Obj *) * numFilters; /* should be size_t */
if (oPtr->filters.num == 0) {
- filtersList = Tcl_Alloc(size);
+ filtersList = (Tcl_Obj **)Tcl_Alloc(size);
} else {
- filtersList = Tcl_Realloc(oPtr->filters.list, size);
+ filtersList = (Tcl_Obj **)Tcl_Realloc(oPtr->filters.list, size);
}
for (i = 0 ; i < numFilters ; i++) {
filtersList[i] = filters[i];
@@ -339,9 +339,9 @@ TclOOClassSetFilters(
int size = sizeof(Tcl_Obj *) * numFilters; /* should be size_t */
if (classPtr->filters.num == 0) {
- filtersList = Tcl_Alloc(size);
+ filtersList = (Tcl_Obj **)Tcl_Alloc(size);
} else {
- filtersList = Tcl_Realloc(classPtr->filters.list, size);
+ filtersList = (Tcl_Obj **)Tcl_Realloc(classPtr->filters.list, size);
}
for (i = 0 ; i < numFilters ; i++) {
filtersList[i] = filters[i];
@@ -395,10 +395,10 @@ TclOOObjectSetMixins(
}
TclOODecrRefCount(mixinPtr->thisPtr);
}
- oPtr->mixins.list = Tcl_Realloc(oPtr->mixins.list,
+ oPtr->mixins.list = (Class **)Tcl_Realloc(oPtr->mixins.list,
sizeof(Class *) * numMixins);
} else {
- oPtr->mixins.list = Tcl_Alloc(sizeof(Class *) * numMixins);
+ oPtr->mixins.list = (Class **)Tcl_Alloc(sizeof(Class *) * numMixins);
oPtr->flags &= ~USE_CLASS_CACHE;
}
oPtr->mixins.num = numMixins;
@@ -453,10 +453,10 @@ TclOOClassSetMixins(
TclOORemoveFromMixinSubs(classPtr, mixinPtr);
TclOODecrRefCount(mixinPtr->thisPtr);
}
- classPtr->mixins.list = Tcl_Realloc(classPtr->mixins.list,
+ classPtr->mixins.list = (Class **)Tcl_Realloc(classPtr->mixins.list,
sizeof(Class *) * numMixins);
} else {
- classPtr->mixins.list = Tcl_Alloc(sizeof(Class *) * numMixins);
+ classPtr->mixins.list = (Class **)Tcl_Alloc(sizeof(Class *) * numMixins);
}
classPtr->mixins.num = numMixins;
memcpy(classPtr->mixins.list, mixins, sizeof(Class *) * numMixins);
@@ -502,9 +502,9 @@ InstallStandardVariableMapping(
if (varc == 0) {
Tcl_Free(vnlPtr->list);
} else if (i) {
- vnlPtr->list = Tcl_Realloc(vnlPtr->list, sizeof(Tcl_Obj *) * varc);
+ vnlPtr->list = (Tcl_Obj **)Tcl_Realloc(vnlPtr->list, sizeof(Tcl_Obj *) * varc);
} else {
- vnlPtr->list = Tcl_Alloc(sizeof(Tcl_Obj *) * varc);
+ vnlPtr->list = (Tcl_Obj **)Tcl_Alloc(sizeof(Tcl_Obj *) * varc);
}
}
vnlPtr->num = 0;
@@ -525,7 +525,7 @@ InstallStandardVariableMapping(
*/
if (n != varc) {
- vnlPtr->list = Tcl_Realloc(vnlPtr->list, sizeof(Tcl_Obj *) * n);
+ vnlPtr->list = (Tcl_Obj **)Tcl_Realloc(vnlPtr->list, sizeof(Tcl_Obj *) * n);
}
Tcl_DeleteHashTable(&uniqueTable);
}
@@ -553,10 +553,10 @@ InstallPrivateVariableMapping(
if (varc == 0) {
Tcl_Free(pvlPtr->list);
} else if (i) {
- pvlPtr->list = Tcl_Realloc(pvlPtr->list,
+ pvlPtr->list = (PrivateVariableMapping *)Tcl_Realloc(pvlPtr->list,
sizeof(PrivateVariableMapping) * varc);
} else {
- pvlPtr->list = Tcl_Alloc(sizeof(PrivateVariableMapping) * varc);
+ pvlPtr->list = (PrivateVariableMapping *)Tcl_Alloc(sizeof(PrivateVariableMapping) * varc);
}
}
@@ -583,7 +583,7 @@ InstallPrivateVariableMapping(
*/
if (n != varc) {
- pvlPtr->list = Tcl_Realloc(pvlPtr->list,
+ pvlPtr->list = (PrivateVariableMapping *)Tcl_Realloc(pvlPtr->list,
sizeof(PrivateVariableMapping) * n);
}
Tcl_DeleteHashTable(&uniqueTable);
@@ -664,7 +664,7 @@ RenameDeleteMethod(
* Complete the splicing by changing the method's name.
*/
- mPtr = Tcl_GetHashValue(hPtr);
+ mPtr = (Method *)Tcl_GetHashValue(hPtr);
if (toPtr) {
Tcl_IncrRefCount(toPtr);
Tcl_DecrRefCount(mPtr->namePtr);
@@ -695,7 +695,7 @@ RenameDeleteMethod(
int
TclOOUnknownDefinition(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const *objv)
@@ -705,6 +705,7 @@ TclOOUnknownDefinition(
Tcl_HashEntry *hPtr;
size_t soughtLen;
const char *soughtStr, *matchedStr = NULL;
+ (void)dummy;
if (objc < 2) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
@@ -722,7 +723,7 @@ TclOOUnknownDefinition(
}
hPtr = Tcl_FirstHashEntry(&nsPtr->cmdTable, &search);
while (hPtr != NULL) {
- const char *nameStr = Tcl_GetHashKey(&nsPtr->cmdTable, hPtr);
+ const char *nameStr = (const char *)Tcl_GetHashKey(&nsPtr->cmdTable, hPtr);
if (strncmp(soughtStr, nameStr, soughtLen) == 0) {
if (matchedStr != NULL) {
@@ -738,7 +739,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;
@@ -890,7 +891,7 @@ TclOOGetDefineCmdContext(
Tcl_SetErrorCode(interp, "TCL", "OO", "MONKEY_BUSINESS", NULL);
return NULL;
}
- object = iPtr->varFramePtr->clientData;
+ object = (Tcl_Object)iPtr->varFramePtr->clientData;
if (Tcl_ObjectDeleted(object)) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"this command cannot be called when the object has been"
@@ -1092,7 +1093,7 @@ MagicDefinitionInvoke(
int
TclOODefineObjCmd(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const *objv)
@@ -1100,6 +1101,7 @@ TclOODefineObjCmd(
Tcl_Namespace *nsPtr;
Object *oPtr;
int result;
+ (void)dummy;
if (objc < 3) {
Tcl_WrongNumArgs(interp, 1, objv, "className arg ?arg ...?");
@@ -1168,7 +1170,7 @@ TclOODefineObjCmd(
int
TclOOObjDefObjCmd(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const *objv)
@@ -1176,6 +1178,7 @@ TclOOObjDefObjCmd(
Tcl_Namespace *nsPtr;
Object *oPtr;
int result;
+ (void)dummy;
if (objc < 3) {
Tcl_WrongNumArgs(interp, 1, objv, "objectName arg ?arg ...?");
@@ -1237,7 +1240,7 @@ TclOOObjDefObjCmd(
int
TclOODefineSelfObjCmd(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const *objv)
@@ -1245,6 +1248,7 @@ TclOODefineSelfObjCmd(
Tcl_Namespace *nsPtr;
Object *oPtr;
int result, isPrivate;
+ (void)dummy;
oPtr = (Object *) TclOOGetDefineCmdContext(interp);
if (oPtr == NULL) {
@@ -1308,12 +1312,13 @@ TclOODefineSelfObjCmd(
int
TclOODefineObjSelfObjCmd(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const *objv)
{
Object *oPtr;
+ (void)dummy;
if (objc != 1) {
Tcl_WrongNumArgs(interp, 1, objv, NULL);
@@ -1415,7 +1420,7 @@ TclOODefinePrivateObjCmd(
int
TclOODefineClassObjCmd(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const *objv)
@@ -1424,6 +1429,7 @@ TclOODefineClassObjCmd(
Class *clsPtr;
Foundation *fPtr = TclOOGetFoundation(interp);
int wasClass, willBeClass;
+ (void)dummy;
/*
* Parse the context to get the object to operate on.
@@ -1524,7 +1530,7 @@ TclOODefineClassObjCmd(
int
TclOODefineConstructorObjCmd(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const *objv)
@@ -1533,6 +1539,7 @@ TclOODefineConstructorObjCmd(
Class *clsPtr;
Tcl_Method method;
size_t bodyLength;
+ (void)dummy;
if (objc != 3) {
Tcl_WrongNumArgs(interp, 1, objv, "arguments body");
@@ -1593,7 +1600,7 @@ TclOODefineConstructorObjCmd(
int
TclOODefineDefnNsObjCmd(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const *objv)
@@ -1607,6 +1614,7 @@ TclOODefineDefnNsObjCmd(
Object *oPtr;
Tcl_Namespace *nsPtr;
Tcl_Obj *nsNamePtr, **storagePtr;
+ (void)dummy;
oPtr = (Object *) TclOOGetDefineCmdContext(interp);
if (oPtr == NULL) {
@@ -1735,7 +1743,7 @@ TclOODefineDeleteMethodObjCmd(
int
TclOODefineDestructorObjCmd(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const *objv)
@@ -1744,6 +1752,7 @@ TclOODefineDestructorObjCmd(
Class *clsPtr;
Tcl_Method method;
size_t bodyLength;
+ (void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "body");
@@ -1841,7 +1850,7 @@ TclOODefineExportObjCmd(
if (isInstanceExport) {
if (!oPtr->methodsPtr) {
- oPtr->methodsPtr = Tcl_Alloc(sizeof(Tcl_HashTable));
+ oPtr->methodsPtr = (Tcl_HashTable *)Tcl_Alloc(sizeof(Tcl_HashTable));
Tcl_InitObjHashTable(oPtr->methodsPtr);
oPtr->flags &= ~USE_CLASS_CACHE;
}
@@ -1853,14 +1862,14 @@ TclOODefineExportObjCmd(
}
if (isNew) {
- mPtr = Tcl_Alloc(sizeof(Method));
+ mPtr = (Method *)Tcl_Alloc(sizeof(Method));
memset(mPtr, 0, sizeof(Method));
mPtr->refCount = 1;
mPtr->namePtr = objv[i];
Tcl_IncrRefCount(objv[i]);
Tcl_SetHashValue(hPtr, mPtr);
} else {
- mPtr = Tcl_GetHashValue(hPtr);
+ mPtr = (Method *)Tcl_GetHashValue(hPtr);
}
if (isNew || !(mPtr->flags & (PUBLIC_METHOD | PRIVATE_METHOD))) {
mPtr->flags |= PUBLIC_METHOD;
@@ -2154,7 +2163,7 @@ TclOODefineUnexportObjCmd(
if (isInstanceUnexport) {
if (!oPtr->methodsPtr) {
- oPtr->methodsPtr = Tcl_Alloc(sizeof(Tcl_HashTable));
+ oPtr->methodsPtr = (Tcl_HashTable *)Tcl_Alloc(sizeof(Tcl_HashTable));
Tcl_InitObjHashTable(oPtr->methodsPtr);
oPtr->flags &= ~USE_CLASS_CACHE;
}
@@ -2166,14 +2175,14 @@ TclOODefineUnexportObjCmd(
}
if (isNew) {
- mPtr = Tcl_Alloc(sizeof(Method));
+ mPtr = (Method *)Tcl_Alloc(sizeof(Method));
memset(mPtr, 0, sizeof(Method));
mPtr->refCount = 1;
mPtr->namePtr = objv[i];
Tcl_IncrRefCount(objv[i]);
Tcl_SetHashValue(hPtr, mPtr);
} else {
- mPtr = Tcl_GetHashValue(hPtr);
+ mPtr = (Method *)Tcl_GetHashValue(hPtr);
}
if (isNew || mPtr->flags & (PUBLIC_METHOD | TRUE_PRIVATE_METHOD)) {
mPtr->flags &= ~(PUBLIC_METHOD | TRUE_PRIVATE_METHOD);
@@ -2314,7 +2323,7 @@ TclOODefineSlots(
static int
ClassFilterGet(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
Tcl_ObjectContext context,
int objc,
@@ -2323,6 +2332,7 @@ ClassFilterGet(
Object *oPtr = (Object *) TclOOGetDefineCmdContext(interp);
Tcl_Obj *resultObj, *filterObj;
int i;
+ (void)dummy;
if (Tcl_ObjectContextSkippedArgs(context) != objc) {
Tcl_WrongNumArgs(interp, Tcl_ObjectContextSkippedArgs(context), objv,
@@ -2348,7 +2358,7 @@ ClassFilterGet(
static int
ClassFilterSet(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
Tcl_ObjectContext context,
int objc,
@@ -2357,6 +2367,7 @@ ClassFilterSet(
Object *oPtr = (Object *) TclOOGetDefineCmdContext(interp);
int filterc;
Tcl_Obj **filterv;
+ (void)dummy;
if (Tcl_ObjectContextSkippedArgs(context) + 1 != objc) {
Tcl_WrongNumArgs(interp, Tcl_ObjectContextSkippedArgs(context), objv,
@@ -2394,7 +2405,7 @@ ClassFilterSet(
static int
ClassMixinGet(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
Tcl_ObjectContext context,
int objc,
@@ -2404,6 +2415,7 @@ ClassMixinGet(
Tcl_Obj *resultObj;
Class *mixinPtr;
int i;
+ (void)dummy;
if (Tcl_ObjectContextSkippedArgs(context) != objc) {
Tcl_WrongNumArgs(interp, Tcl_ObjectContextSkippedArgs(context), objv,
@@ -2431,7 +2443,7 @@ ClassMixinGet(
static int
ClassMixinSet(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
Tcl_ObjectContext context,
int objc,
@@ -2441,6 +2453,7 @@ ClassMixinSet(
int mixinc, i;
Tcl_Obj **mixinv;
Class **mixins;
+ (void)dummy;
if (Tcl_ObjectContextSkippedArgs(context) + 1 != objc) {
Tcl_WrongNumArgs(interp, Tcl_ObjectContextSkippedArgs(context), objv,
@@ -2461,7 +2474,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],
@@ -2500,7 +2513,7 @@ ClassMixinSet(
static int
ClassSuperGet(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
Tcl_ObjectContext context,
int objc,
@@ -2510,6 +2523,7 @@ ClassSuperGet(
Tcl_Obj *resultObj;
Class *superPtr;
int i;
+ (void)dummy;
if (Tcl_ObjectContextSkippedArgs(context) != objc) {
Tcl_WrongNumArgs(interp, Tcl_ObjectContextSkippedArgs(context), objv,
@@ -2536,7 +2550,7 @@ ClassSuperGet(
static int
ClassSuperSet(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
Tcl_ObjectContext context,
int objc,
@@ -2546,6 +2560,7 @@ ClassSuperSet(
int superc, i, j;
Tcl_Obj **superv;
Class **superclasses, *superPtr;
+ (void)dummy;
if (Tcl_ObjectContextSkippedArgs(context) + 1 != objc) {
Tcl_WrongNumArgs(interp, Tcl_ObjectContextSkippedArgs(context), objv,
@@ -2585,7 +2600,7 @@ ClassSuperSet(
*/
if (superc == 0) {
- superclasses = Tcl_Realloc(superclasses, sizeof(Class *));
+ superclasses = (Class **)Tcl_Realloc(superclasses, sizeof(Class *));
if (TclOOIsReachable(oPtr->fPtr->classCls, oPtr->classPtr)) {
superclasses[0] = oPtr->fPtr->classCls;
} else {
@@ -2667,7 +2682,7 @@ ClassSuperSet(
static int
ClassVarsGet(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
Tcl_ObjectContext context,
int objc,
@@ -2676,6 +2691,7 @@ ClassVarsGet(
Object *oPtr = (Object *) TclOOGetDefineCmdContext(interp);
Tcl_Obj *resultObj;
int i;
+ (void)dummy;
if (Tcl_ObjectContextSkippedArgs(context) != objc) {
Tcl_WrongNumArgs(interp, Tcl_ObjectContextSkippedArgs(context), objv,
@@ -2711,7 +2727,7 @@ ClassVarsGet(
static int
ClassVarsSet(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
Tcl_ObjectContext context,
int objc,
@@ -2721,6 +2737,7 @@ ClassVarsSet(
int varc;
Tcl_Obj **varv;
int i;
+ (void)dummy;
if (Tcl_ObjectContextSkippedArgs(context) + 1 != objc) {
Tcl_WrongNumArgs(interp, Tcl_ObjectContextSkippedArgs(context), objv,
@@ -2782,7 +2799,7 @@ ClassVarsSet(
static int
ObjFilterGet(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
Tcl_ObjectContext context,
int objc,
@@ -2791,6 +2808,7 @@ ObjFilterGet(
Object *oPtr = (Object *) TclOOGetDefineCmdContext(interp);
Tcl_Obj *resultObj, *filterObj;
int i;
+ (void)dummy;
if (Tcl_ObjectContextSkippedArgs(context) != objc) {
Tcl_WrongNumArgs(interp, Tcl_ObjectContextSkippedArgs(context), objv,
@@ -2810,7 +2828,7 @@ ObjFilterGet(
static int
ObjFilterSet(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
Tcl_ObjectContext context,
int objc,
@@ -2819,6 +2837,7 @@ ObjFilterSet(
Object *oPtr = (Object *) TclOOGetDefineCmdContext(interp);
int filterc;
Tcl_Obj **filterv;
+ (void)dummy;
if (Tcl_ObjectContextSkippedArgs(context) + 1 != objc) {
Tcl_WrongNumArgs(interp, Tcl_ObjectContextSkippedArgs(context), objv,
@@ -2850,7 +2869,7 @@ ObjFilterSet(
static int
ObjMixinGet(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
Tcl_ObjectContext context,
int objc,
@@ -2860,6 +2879,7 @@ ObjMixinGet(
Tcl_Obj *resultObj;
Class *mixinPtr;
int i;
+ (void)dummy;
if (Tcl_ObjectContextSkippedArgs(context) != objc) {
Tcl_WrongNumArgs(interp, Tcl_ObjectContextSkippedArgs(context), objv,
@@ -2882,7 +2902,7 @@ ObjMixinGet(
static int
ObjMixinSet(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
Tcl_ObjectContext context,
int objc,
@@ -2893,6 +2913,7 @@ ObjMixinSet(
Tcl_Obj **mixinv;
Class **mixins;
int i;
+ (void)dummy;
if (Tcl_ObjectContextSkippedArgs(context) + 1 != objc) {
Tcl_WrongNumArgs(interp, Tcl_ObjectContextSkippedArgs(context), objv,
@@ -2907,7 +2928,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],
@@ -2936,7 +2957,7 @@ ObjMixinSet(
static int
ObjVarsGet(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
Tcl_ObjectContext context,
int objc,
@@ -2945,6 +2966,7 @@ ObjVarsGet(
Object *oPtr = (Object *) TclOOGetDefineCmdContext(interp);
Tcl_Obj *resultObj;
int i;
+ (void)dummy;
if (Tcl_ObjectContextSkippedArgs(context) != objc) {
Tcl_WrongNumArgs(interp, Tcl_ObjectContextSkippedArgs(context), objv,
@@ -2974,7 +2996,7 @@ ObjVarsGet(
static int
ObjVarsSet(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
Tcl_ObjectContext context,
int objc,
@@ -2983,6 +3005,7 @@ ObjVarsSet(
Object *oPtr = (Object *) TclOOGetDefineCmdContext(interp);
int varc, i;
Tcl_Obj **varv;
+ (void)dummy;
if (Tcl_ObjectContextSkippedArgs(context) + 1 != objc) {
Tcl_WrongNumArgs(interp, Tcl_ObjectContextSkippedArgs(context), objv,
@@ -3039,7 +3062,7 @@ ObjVarsSet(
static int
ResolveClass(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
Tcl_ObjectContext context,
int objc,
@@ -3048,6 +3071,7 @@ ResolveClass(
int idx = Tcl_ObjectContextSkippedArgs(context);
Object *oPtr = (Object *) TclOOGetDefineCmdContext(interp);
Class *clsPtr;
+ (void)dummy;
/*
* Check if were called wrongly. The definition context isn't used...
diff --git a/generic/tclOOInfo.c b/generic/tclOOInfo.c
index 3446392..7d53fbd 100644
--- a/generic/tclOOInfo.c
+++ b/generic/tclOOInfo.c
@@ -171,12 +171,13 @@ GetClassFromObj(
static int
InfoObjectClassCmd(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
{
Object *oPtr;
+ (void)dummy;
if (objc != 2 && objc != 3) {
Tcl_WrongNumArgs(interp, 1, objv, "objName ?className?");
@@ -228,7 +229,7 @@ InfoObjectClassCmd(
static int
InfoObjectDefnCmd(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
@@ -238,6 +239,7 @@ InfoObjectDefnCmd(
Proc *procPtr;
CompiledLocal *localPtr;
Tcl_Obj *resultObjs[2];
+ (void)dummy;
if (objc != 3) {
Tcl_WrongNumArgs(interp, 1, objv, "objName methodName");
@@ -261,7 +263,7 @@ InfoObjectDefnCmd(
TclGetString(objv[2]), NULL);
return TCL_ERROR;
}
- procPtr = TclOOGetProcFromMethod(Tcl_GetHashValue(hPtr));
+ procPtr = TclOOGetProcFromMethod((Method *)Tcl_GetHashValue(hPtr));
if (procPtr == NULL) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"definition not available for this kind of method", -1));
@@ -285,7 +287,7 @@ InfoObjectDefnCmd(
Tcl_ListObjAppendElement(NULL, resultObjs[0], argObj);
}
}
- resultObjs[1] = TclOOGetMethodBody(Tcl_GetHashValue(hPtr));
+ resultObjs[1] = TclOOGetMethodBody((Method *)Tcl_GetHashValue(hPtr));
Tcl_SetObjResult(interp, Tcl_NewListObj(2, resultObjs));
return TCL_OK;
}
@@ -302,7 +304,7 @@ InfoObjectDefnCmd(
static int
InfoObjectFiltersCmd(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
@@ -310,6 +312,7 @@ InfoObjectFiltersCmd(
int i;
Tcl_Obj *filterObj, *resultObj;
Object *oPtr;
+ (void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "objName");
@@ -341,7 +344,7 @@ InfoObjectFiltersCmd(
static int
InfoObjectForwardCmd(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
@@ -349,6 +352,7 @@ InfoObjectForwardCmd(
Object *oPtr;
Tcl_HashEntry *hPtr;
Tcl_Obj *prefixObj;
+ (void)dummy;
if (objc != 3) {
Tcl_WrongNumArgs(interp, 1, objv, "objName methodName");
@@ -372,7 +376,7 @@ InfoObjectForwardCmd(
TclGetString(objv[2]), NULL);
return TCL_ERROR;
}
- prefixObj = TclOOGetFwdFromMethod(Tcl_GetHashValue(hPtr));
+ prefixObj = TclOOGetFwdFromMethod((Method *)Tcl_GetHashValue(hPtr));
if (prefixObj == NULL) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"prefix argument list not available for this kind of method",
@@ -398,7 +402,7 @@ InfoObjectForwardCmd(
static int
InfoObjectIsACmd(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
@@ -411,6 +415,7 @@ InfoObjectIsACmd(
};
Object *oPtr, *o2Ptr;
int idx, i, result = 0;
+ (void)dummy;
if (objc < 3) {
Tcl_WrongNumArgs(interp, 1, objv, "category objName ?arg ...?");
@@ -517,7 +522,7 @@ InfoObjectIsACmd(
static int
InfoObjectMethodsCmd(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
@@ -540,6 +545,7 @@ InfoObjectMethodsCmd(
SCOPE_PRIVATE, SCOPE_PUBLIC, SCOPE_UNEXPORTED,
SCOPE_LOCALPRIVATE
};
+ (void)dummy;
if (objc < 2) {
Tcl_WrongNumArgs(interp, 1, objv, "objName ?-option value ...?");
@@ -637,7 +643,7 @@ InfoObjectMethodsCmd(
static int
InfoObjectMethodTypeCmd(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
@@ -645,6 +651,7 @@ InfoObjectMethodTypeCmd(
Object *oPtr;
Tcl_HashEntry *hPtr;
Method *mPtr;
+ (void)dummy;
if (objc != 3) {
Tcl_WrongNumArgs(interp, 1, objv, "objName methodName");
@@ -668,7 +675,7 @@ InfoObjectMethodTypeCmd(
TclGetString(objv[2]), NULL);
return TCL_ERROR;
}
- mPtr = Tcl_GetHashValue(hPtr);
+ mPtr = (Method *)Tcl_GetHashValue(hPtr);
if (mPtr->typePtr == NULL) {
/*
* Special entry for visibility control: pretend the method doesnt
@@ -694,7 +701,7 @@ InfoObjectMethodTypeCmd(
static int
InfoObjectMixinsCmd(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
@@ -703,6 +710,7 @@ InfoObjectMixinsCmd(
Object *oPtr;
Tcl_Obj *resultObj;
int i;
+ (void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "objName");
@@ -737,12 +745,13 @@ InfoObjectMixinsCmd(
static int
InfoObjectIdCmd(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
{
Object *oPtr;
+ (void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "objName");
@@ -769,12 +778,13 @@ InfoObjectIdCmd(
static int
InfoObjectNsCmd(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
{
Object *oPtr;
+ (void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "objName");
@@ -802,7 +812,7 @@ InfoObjectNsCmd(
static int
InfoObjectVariablesCmd(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
@@ -810,6 +820,7 @@ InfoObjectVariablesCmd(
Object *oPtr;
Tcl_Obj *resultObj;
int i, isPrivate = 0;
+ (void)dummy;
if (objc != 2 && objc != 3) {
Tcl_WrongNumArgs(interp, 1, objv, "objName ?-private?");
@@ -856,7 +867,7 @@ InfoObjectVariablesCmd(
static int
InfoObjectVarsCmd(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
@@ -866,6 +877,7 @@ InfoObjectVarsCmd(
FOREACH_HASH_DECLS;
VarInHash *vihPtr;
Tcl_Obj *nameObj, *resultObj;
+ (void)dummy;
if (objc != 2 && objc != 3) {
Tcl_WrongNumArgs(interp, 1, objv, "objName ?pattern?");
@@ -917,7 +929,7 @@ InfoObjectVarsCmd(
static int
InfoClassConstrCmd(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
@@ -926,6 +938,7 @@ InfoClassConstrCmd(
CompiledLocal *localPtr;
Tcl_Obj *resultObjs[2];
Class *clsPtr;
+ (void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "className");
@@ -978,7 +991,7 @@ InfoClassConstrCmd(
static int
InfoClassDefnCmd(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
@@ -988,6 +1001,7 @@ InfoClassDefnCmd(
CompiledLocal *localPtr;
Tcl_Obj *resultObjs[2];
Class *clsPtr;
+ (void)dummy;
if (objc != 3) {
Tcl_WrongNumArgs(interp, 1, objv, "className methodName");
@@ -1005,7 +1019,7 @@ InfoClassDefnCmd(
TclGetString(objv[2]), NULL);
return TCL_ERROR;
}
- procPtr = TclOOGetProcFromMethod(Tcl_GetHashValue(hPtr));
+ procPtr = TclOOGetProcFromMethod((Method *)Tcl_GetHashValue(hPtr));
if (procPtr == NULL) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"definition not available for this kind of method", -1));
@@ -1029,7 +1043,7 @@ InfoClassDefnCmd(
Tcl_ListObjAppendElement(NULL, resultObjs[0], argObj);
}
}
- resultObjs[1] = TclOOGetMethodBody(Tcl_GetHashValue(hPtr));
+ resultObjs[1] = TclOOGetMethodBody((Method *)Tcl_GetHashValue(hPtr));
Tcl_SetObjResult(interp, Tcl_NewListObj(2, resultObjs));
return TCL_OK;
}
@@ -1046,7 +1060,7 @@ InfoClassDefnCmd(
static int
InfoClassDefnNsCmd(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
@@ -1059,6 +1073,7 @@ InfoClassDefnNsCmd(
int kind = 0;
Tcl_Obj *nsNamePtr;
Class *clsPtr;
+ (void)dummy;
if (objc != 2 && objc != 3) {
Tcl_WrongNumArgs(interp, 1, objv, "className ?kind?");
@@ -1096,13 +1111,14 @@ InfoClassDefnNsCmd(
static int
InfoClassDestrCmd(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
{
Proc *procPtr;
Class *clsPtr;
+ (void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "className");
@@ -1140,7 +1156,7 @@ InfoClassDestrCmd(
static int
InfoClassFiltersCmd(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
@@ -1148,6 +1164,7 @@ InfoClassFiltersCmd(
int i;
Tcl_Obj *filterObj, *resultObj;
Class *clsPtr;
+ (void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "className");
@@ -1178,7 +1195,7 @@ InfoClassFiltersCmd(
static int
InfoClassForwardCmd(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
@@ -1186,6 +1203,7 @@ InfoClassForwardCmd(
Tcl_HashEntry *hPtr;
Tcl_Obj *prefixObj;
Class *clsPtr;
+ (void)dummy;
if (objc != 3) {
Tcl_WrongNumArgs(interp, 1, objv, "className methodName");
@@ -1203,7 +1221,7 @@ InfoClassForwardCmd(
TclGetString(objv[2]), NULL);
return TCL_ERROR;
}
- prefixObj = TclOOGetFwdFromMethod(Tcl_GetHashValue(hPtr));
+ prefixObj = TclOOGetFwdFromMethod((Method *)Tcl_GetHashValue(hPtr));
if (prefixObj == NULL) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"prefix argument list not available for this kind of method",
@@ -1229,7 +1247,7 @@ InfoClassForwardCmd(
static int
InfoClassInstancesCmd(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
@@ -1239,6 +1257,7 @@ InfoClassInstancesCmd(
int i;
const char *pattern = NULL;
Tcl_Obj *resultObj;
+ (void)dummy;
if (objc != 2 && objc != 3) {
Tcl_WrongNumArgs(interp, 1, objv, "className ?pattern?");
@@ -1277,7 +1296,7 @@ InfoClassInstancesCmd(
static int
InfoClassMethodsCmd(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
@@ -1298,6 +1317,7 @@ InfoClassMethodsCmd(
enum Scopes {
SCOPE_PRIVATE, SCOPE_PUBLIC, SCOPE_UNEXPORTED
};
+ (void)dummy;
if (objc < 2) {
Tcl_WrongNumArgs(interp, 1, objv, "className ?-option value ...?");
@@ -1393,7 +1413,7 @@ InfoClassMethodsCmd(
static int
InfoClassMethodTypeCmd(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
@@ -1401,6 +1421,7 @@ InfoClassMethodTypeCmd(
Tcl_HashEntry *hPtr;
Method *mPtr;
Class *clsPtr;
+ (void)dummy;
if (objc != 3) {
Tcl_WrongNumArgs(interp, 1, objv, "className methodName");
@@ -1420,7 +1441,7 @@ InfoClassMethodTypeCmd(
TclGetString(objv[2]), NULL);
return TCL_ERROR;
}
- mPtr = Tcl_GetHashValue(hPtr);
+ mPtr = (Method *)Tcl_GetHashValue(hPtr);
if (mPtr->typePtr == NULL) {
/*
* Special entry for visibility control: pretend the method doesnt
@@ -1445,7 +1466,7 @@ InfoClassMethodTypeCmd(
static int
InfoClassMixinsCmd(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
@@ -1453,6 +1474,7 @@ InfoClassMixinsCmd(
Class *clsPtr, *mixinPtr;
Tcl_Obj *resultObj;
int i;
+ (void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "className");
@@ -1487,7 +1509,7 @@ InfoClassMixinsCmd(
static int
InfoClassSubsCmd(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
@@ -1496,6 +1518,7 @@ InfoClassSubsCmd(
Tcl_Obj *resultObj;
int i;
const char *pattern = NULL;
+ (void)dummy;
if (objc != 2 && objc != 3) {
Tcl_WrongNumArgs(interp, 1, objv, "className ?pattern?");
@@ -1542,7 +1565,7 @@ InfoClassSubsCmd(
static int
InfoClassSupersCmd(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
@@ -1550,6 +1573,7 @@ InfoClassSupersCmd(
Class *clsPtr, *superPtr;
Tcl_Obj *resultObj;
int i;
+ (void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "className");
@@ -1581,7 +1605,7 @@ InfoClassSupersCmd(
static int
InfoClassVariablesCmd(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
@@ -1589,6 +1613,7 @@ InfoClassVariablesCmd(
Class *clsPtr;
Tcl_Obj *resultObj;
int i, isPrivate = 0;
+ (void)dummy;
if (objc != 2 && objc != 3) {
Tcl_WrongNumArgs(interp, 1, objv, "className ?-private?");
@@ -1635,13 +1660,14 @@ InfoClassVariablesCmd(
static int
InfoObjectCallCmd(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
{
Object *oPtr;
CallContext *contextPtr;
+ (void)dummy;
if (objc != 3) {
Tcl_WrongNumArgs(interp, 1, objv, "objName methodName");
@@ -1681,13 +1707,14 @@ InfoObjectCallCmd(
static int
InfoClassCallCmd(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
{
Class *clsPtr;
CallChain *callPtr;
+ (void)dummy;
if (objc != 3) {
Tcl_WrongNumArgs(interp, 1, objv, "className methodName");
diff --git a/generic/tclOOInt.h b/generic/tclOOInt.h
index 54f4476..1aa4f88 100644
--- a/generic/tclOOInt.h
+++ b/generic/tclOOInt.h
@@ -679,11 +679,11 @@ MODULE_SCOPE void TclOOSetupVariableResolver(Tcl_Namespace *nsPtr);
Tcl_HashEntry *hPtr;Tcl_HashSearch search
#define FOREACH_HASH(key,val,tablePtr) \
for(hPtr=Tcl_FirstHashEntry((tablePtr),&search); hPtr!=NULL ? \
- ((key)=(void *)Tcl_GetHashKey((tablePtr),hPtr),\
- (val)=Tcl_GetHashValue(hPtr),1):0; hPtr=Tcl_NextHashEntry(&search))
+ (*(void **)&(key)=Tcl_GetHashKey((tablePtr),hPtr),\
+ *(void **)&(val)=Tcl_GetHashValue(hPtr),1):0; hPtr=Tcl_NextHashEntry(&search))
#define FOREACH_HASH_VALUE(val,tablePtr) \
for(hPtr=Tcl_FirstHashEntry((tablePtr),&search); hPtr!=NULL ? \
- ((val)=Tcl_GetHashValue(hPtr),1):0;hPtr=Tcl_NextHashEntry(&search))
+ (*(void **)&(val)=Tcl_GetHashValue(hPtr),1):0;hPtr=Tcl_NextHashEntry(&search))
/*
* Convenience macro for duplicating a list. Needs no external declaration,
diff --git a/generic/tclOOMethod.c b/generic/tclOOMethod.c
index 1797c6a..bf010b9 100644
--- a/generic/tclOOMethod.c
+++ b/generic/tclOOMethod.c
@@ -135,7 +135,7 @@ static const Tcl_MethodType fwdMethodType = {
Tcl_Method
Tcl_NewInstanceMethod(
- Tcl_Interp *interp, /* Unused? */
+ Tcl_Interp *dummy, /* Unused. */
Tcl_Object object, /* The object that has the method attached to
* it. */
Tcl_Obj *nameObj, /* The name of the method. May be NULL; if so,
@@ -153,27 +153,28 @@ Tcl_NewInstanceMethod(
Method *mPtr;
Tcl_HashEntry *hPtr;
int isNew;
+ (void)dummy;
if (nameObj == NULL) {
- mPtr = Tcl_Alloc(sizeof(Method));
+ mPtr = (Method *)Tcl_Alloc(sizeof(Method));
mPtr->namePtr = NULL;
mPtr->refCount = 1;
goto populate;
}
if (!oPtr->methodsPtr) {
- oPtr->methodsPtr = Tcl_Alloc(sizeof(Tcl_HashTable));
+ oPtr->methodsPtr = (Tcl_HashTable *)Tcl_Alloc(sizeof(Tcl_HashTable));
Tcl_InitObjHashTable(oPtr->methodsPtr);
oPtr->flags &= ~USE_CLASS_CACHE;
}
hPtr = Tcl_CreateHashEntry(oPtr->methodsPtr, (char *) nameObj, &isNew);
if (isNew) {
- mPtr = Tcl_Alloc(sizeof(Method));
+ mPtr = (Method *)Tcl_Alloc(sizeof(Method));
mPtr->namePtr = nameObj;
mPtr->refCount = 1;
Tcl_IncrRefCount(nameObj);
Tcl_SetHashValue(hPtr, mPtr);
} else {
- mPtr = Tcl_GetHashValue(hPtr);
+ mPtr = (Method *)Tcl_GetHashValue(hPtr);
if (mPtr->typePtr != NULL && mPtr->typePtr->deleteProc != NULL) {
mPtr->typePtr->deleteProc(mPtr->clientData);
}
@@ -208,7 +209,7 @@ Tcl_NewInstanceMethod(
Tcl_Method
Tcl_NewMethod(
- Tcl_Interp *interp, /* The interpreter containing the class. */
+ Tcl_Interp *dummy, /* The interpreter containing the class. */
Tcl_Class cls, /* The class to attach the method to. */
Tcl_Obj *nameObj, /* The name of the object. May be NULL (e.g.,
* for constructors or destructors); if so, up
@@ -225,22 +226,23 @@ Tcl_NewMethod(
Method *mPtr;
Tcl_HashEntry *hPtr;
int isNew;
+ (void)dummy;
if (nameObj == NULL) {
- mPtr = Tcl_Alloc(sizeof(Method));
+ mPtr = (Method *)Tcl_Alloc(sizeof(Method));
mPtr->namePtr = NULL;
mPtr->refCount = 1;
goto populate;
}
hPtr = Tcl_CreateHashEntry(&clsPtr->classMethods, (char *)nameObj,&isNew);
if (isNew) {
- mPtr = Tcl_Alloc(sizeof(Method));
+ mPtr = (Method *)Tcl_Alloc(sizeof(Method));
mPtr->refCount = 1;
mPtr->namePtr = nameObj;
Tcl_IncrRefCount(nameObj);
Tcl_SetHashValue(hPtr, mPtr);
} else {
- mPtr = Tcl_GetHashValue(hPtr);
+ mPtr = (Method *)Tcl_GetHashValue(hPtr);
if (mPtr->typePtr != NULL && mPtr->typePtr->deleteProc != NULL) {
mPtr->typePtr->deleteProc(mPtr->clientData);
}
@@ -350,7 +352,7 @@ TclOONewProcInstanceMethod(
if (Tcl_ListObjLength(interp, argsObj, &argsLen) != TCL_OK) {
return NULL;
}
- pmPtr = Tcl_Alloc(sizeof(ProcedureMethod));
+ pmPtr = (ProcedureMethod *)Tcl_Alloc(sizeof(ProcedureMethod));
memset(pmPtr, 0, sizeof(ProcedureMethod));
pmPtr->version = TCLOO_PROCEDURE_METHOD_VERSION;
pmPtr->flags = flags & USE_DECLARER_NS;
@@ -411,7 +413,7 @@ TclOONewProcMethod(
procName = (nameObj==NULL ? "<constructor>" : TclGetString(nameObj));
}
- pmPtr = Tcl_Alloc(sizeof(ProcedureMethod));
+ pmPtr = (ProcedureMethod *)Tcl_Alloc(sizeof(ProcedureMethod));
memset(pmPtr, 0, sizeof(ProcedureMethod));
pmPtr->version = TCLOO_PROCEDURE_METHOD_VERSION;
pmPtr->flags = flags & USE_DECLARER_NS;
@@ -505,12 +507,12 @@ TclOOMakeProcInstanceMethod(
if (context.line
&& (context.nline >= 4) && (context.line[3] >= 0)) {
int isNew;
- CmdFrame *cfPtr = Tcl_Alloc(sizeof(CmdFrame));
+ CmdFrame *cfPtr = (CmdFrame *)Tcl_Alloc(sizeof(CmdFrame));
Tcl_HashEntry *hPtr;
cfPtr->level = -1;
cfPtr->type = context.type;
- cfPtr->line = Tcl_Alloc(sizeof(int));
+ cfPtr->line = (int *)Tcl_Alloc(sizeof(int));
cfPtr->line[0] = context.line[3];
cfPtr->nline = 1;
cfPtr->framePtr = NULL;
@@ -618,12 +620,12 @@ TclOOMakeProcMethod(
if (context.line
&& (context.nline >= 4) && (context.line[3] >= 0)) {
int isNew;
- CmdFrame *cfPtr = Tcl_Alloc(sizeof(CmdFrame));
+ CmdFrame *cfPtr = (CmdFrame *)Tcl_Alloc(sizeof(CmdFrame));
Tcl_HashEntry *hPtr;
cfPtr->level = -1;
cfPtr->type = context.type;
- cfPtr->line = Tcl_Alloc(sizeof(int));
+ cfPtr->line = (int *)Tcl_Alloc(sizeof(int));
cfPtr->line[0] = context.line[3];
cfPtr->nline = 1;
cfPtr->framePtr = NULL;
@@ -672,7 +674,7 @@ InvokeProcedureMethod(
int objc, /* Number of arguments. */
Tcl_Obj *const *objv) /* Arguments as actually seen. */
{
- ProcedureMethod *pmPtr = clientData;
+ ProcedureMethod *pmPtr = (ProcedureMethod *)clientData;
int result;
PMFrameData *fdPtr; /* Important data that has to have a lifetime
* matched by this function (or rather, by the
@@ -694,7 +696,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.
@@ -751,9 +753,9 @@ FinalizePMCall(
Tcl_Interp *interp,
int result)
{
- ProcedureMethod *pmPtr = data[0];
- Tcl_ObjectContext context = data[1];
- PMFrameData *fdPtr = data[2];
+ ProcedureMethod *pmPtr = (ProcedureMethod *)data[0];
+ Tcl_ObjectContext context = (Tcl_ObjectContext)data[1];
+ PMFrameData *fdPtr = (PMFrameData *)data[2];
/*
* Give the post-call callback a chance to do some cleanup. Note that at
@@ -965,6 +967,7 @@ ProcedureMethodVarResolver(
{
int result;
Tcl_ResolvedVarInfo *rPtr = NULL;
+ (void)flags;
result = ProcedureMethodCompiledVarResolver(interp, varName,
strlen(varName), contextNs, &rPtr);
@@ -1008,7 +1011,7 @@ ProcedureMethodCompiledVarConnect(
if (framePtr == NULL || !(framePtr->isProcCallFrame & FRAME_IS_METHOD)) {
return NULL;
}
- contextPtr = framePtr->clientData;
+ contextPtr = (CallContext *)framePtr->clientData;
/*
* If we've done the work before (in a comparable context) then reuse that
@@ -1108,7 +1111,7 @@ ProcedureMethodCompiledVarDelete(
static int
ProcedureMethodCompiledVarResolver(
- Tcl_Interp *interp,
+ Tcl_Interp *dummy,
const char *varName,
int length,
Tcl_Namespace *contextNs,
@@ -1116,6 +1119,8 @@ ProcedureMethodCompiledVarResolver(
{
OOResVarInfo *infoPtr;
Tcl_Obj *variableObj = Tcl_NewStringObj(varName, length);
+ (void)dummy;
+ (void)contextNs;
/*
* Do not create resolvers for cases that contain namespace separators or
@@ -1128,7 +1133,7 @@ ProcedureMethodCompiledVarResolver(
return TCL_CONTINUE;
}
- infoPtr = Tcl_Alloc(sizeof(OOResVarInfo));
+ infoPtr = (OOResVarInfo *)Tcl_Alloc(sizeof(OOResVarInfo));
infoPtr->info.fetchProc = ProcedureMethodCompiledVarConnect;
infoPtr->info.deleteProc = ProcedureMethodCompiledVarDelete;
infoPtr->cachedObjectVar = NULL;
@@ -1155,7 +1160,7 @@ static Tcl_Obj *
RenderDeclarerName(
void *clientData)
{
- struct PNI *pni = clientData;
+ struct PNI *pni = (struct PNI *)clientData;
Tcl_Object object = Tcl_MethodDeclarerObject(pni->method);
if (object == NULL) {
@@ -1189,11 +1194,12 @@ MethodErrorHandler(
Tcl_Obj *methodNameObj)
{
size_t nameLen, objectNameLen;
- CallContext *contextPtr = ((Interp *) interp)->varFramePtr->clientData;
+ CallContext *contextPtr = (CallContext *)((Interp *) interp)->varFramePtr->clientData;
Method *mPtr = contextPtr->callPtr->chain[contextPtr->index].mPtr;
const char *objectName, *kindName, *methodName =
TclGetStringFromObj(mPtr->namePtr, &nameLen);
Object *declarerPtr;
+ (void)methodNameObj;
if (mPtr->declaringObjectPtr != NULL) {
declarerPtr = mPtr->declaringObjectPtr;
@@ -1219,11 +1225,12 @@ ConstructorErrorHandler(
Tcl_Interp *interp,
Tcl_Obj *methodNameObj)
{
- CallContext *contextPtr = ((Interp *) interp)->varFramePtr->clientData;
+ CallContext *contextPtr = (CallContext *)((Interp *) interp)->varFramePtr->clientData;
Method *mPtr = contextPtr->callPtr->chain[contextPtr->index].mPtr;
Object *declarerPtr;
const char *objectName, *kindName;
size_t objectNameLen;
+ (void)methodNameObj;
if (mPtr->declaringObjectPtr != NULL) {
declarerPtr = mPtr->declaringObjectPtr;
@@ -1248,11 +1255,12 @@ DestructorErrorHandler(
Tcl_Interp *interp,
Tcl_Obj *methodNameObj)
{
- CallContext *contextPtr = ((Interp *) interp)->varFramePtr->clientData;
+ CallContext *contextPtr = (CallContext *)((Interp *) interp)->varFramePtr->clientData;
Method *mPtr = contextPtr->callPtr->chain[contextPtr->index].mPtr;
Object *declarerPtr;
const char *objectName, *kindName;
size_t objectNameLen;
+ (void)methodNameObj;
if (mPtr->declaringObjectPtr != NULL) {
declarerPtr = mPtr->declaringObjectPtr;
@@ -1297,7 +1305,7 @@ static void
DeleteProcedureMethod(
void *clientData)
{
- ProcedureMethod *pmPtr = clientData;
+ ProcedureMethod *pmPtr = (ProcedureMethod *)clientData;
if (pmPtr->refCount-- <= 1) {
DeleteProcedureMethodRecord(pmPtr);
@@ -1310,7 +1318,7 @@ CloneProcedureMethod(
void *clientData,
void **newClientData)
{
- ProcedureMethod *pmPtr = clientData;
+ ProcedureMethod *pmPtr = (ProcedureMethod *)clientData;
ProcedureMethod *pm2Ptr;
Tcl_Obj *bodyObj, *argsObj;
CompiledLocal *localPtr;
@@ -1348,7 +1356,7 @@ CloneProcedureMethod(
* record.
*/
- pm2Ptr = Tcl_Alloc(sizeof(ProcedureMethod));
+ pm2Ptr = (ProcedureMethod *)Tcl_Alloc(sizeof(ProcedureMethod));
memcpy(pm2Ptr, pmPtr, sizeof(ProcedureMethod));
pm2Ptr->refCount = 1;
Tcl_IncrRefCount(argsObj);
@@ -1402,7 +1410,7 @@ TclOONewForwardInstanceMethod(
return NULL;
}
- fmPtr = Tcl_Alloc(sizeof(ForwardMethod));
+ fmPtr = (ForwardMethod *)Tcl_Alloc(sizeof(ForwardMethod));
fmPtr->prefixObj = prefixObj;
Tcl_IncrRefCount(prefixObj);
return (Method *) Tcl_NewInstanceMethod(interp, (Tcl_Object) oPtr,
@@ -1441,7 +1449,7 @@ TclOONewForwardMethod(
return NULL;
}
- fmPtr = Tcl_Alloc(sizeof(ForwardMethod));
+ fmPtr = (ForwardMethod *)Tcl_Alloc(sizeof(ForwardMethod));
fmPtr->prefixObj = prefixObj;
Tcl_IncrRefCount(prefixObj);
return (Method *) Tcl_NewMethod(interp, (Tcl_Class) clsPtr, nameObj,
@@ -1468,7 +1476,7 @@ InvokeForwardMethod(
Tcl_Obj *const *objv) /* Arguments as actually seen. */
{
CallContext *contextPtr = (CallContext *) context;
- ForwardMethod *fmPtr = clientData;
+ ForwardMethod *fmPtr = (ForwardMethod *)clientData;
Tcl_Obj **argObjs, **prefixObjs;
int numPrefixes, len, skip = contextPtr->skip;
@@ -1499,7 +1507,7 @@ FinalizeForwardCall(
Tcl_Interp *interp,
int result)
{
- Tcl_Obj **argObjs = data[0];
+ Tcl_Obj **argObjs = (Tcl_Obj **)data[0];
TclStackFree(interp, argObjs);
return result;
@@ -1519,7 +1527,7 @@ static void
DeleteForwardMethod(
void *clientData)
{
- ForwardMethod *fmPtr = clientData;
+ ForwardMethod *fmPtr = (ForwardMethod *)clientData;
Tcl_DecrRefCount(fmPtr->prefixObj);
Tcl_Free(fmPtr);
@@ -1527,12 +1535,13 @@ DeleteForwardMethod(
static int
CloneForwardMethod(
- Tcl_Interp *interp,
+ Tcl_Interp *dummy,
void *clientData,
void **newClientData)
{
- ForwardMethod *fmPtr = clientData;
- ForwardMethod *fm2Ptr = Tcl_Alloc(sizeof(ForwardMethod));
+ ForwardMethod *fmPtr = (ForwardMethod *)clientData;
+ ForwardMethod *fm2Ptr = (ForwardMethod *)Tcl_Alloc(sizeof(ForwardMethod));
+ (void)dummy;
fm2Ptr->prefixObj = fmPtr->prefixObj;
Tcl_IncrRefCount(fm2Ptr->prefixObj);
@@ -1556,7 +1565,7 @@ TclOOGetProcFromMethod(
Method *mPtr)
{
if (mPtr->typePtr == &procMethodType) {
- ProcedureMethod *pmPtr = mPtr->clientData;
+ ProcedureMethod *pmPtr = (ProcedureMethod *)mPtr->clientData;
return pmPtr->procPtr;
}
@@ -1568,7 +1577,7 @@ TclOOGetMethodBody(
Method *mPtr)
{
if (mPtr->typePtr == &procMethodType) {
- ProcedureMethod *pmPtr = mPtr->clientData;
+ ProcedureMethod *pmPtr = (ProcedureMethod *)mPtr->clientData;
(void) TclGetString(pmPtr->procPtr->bodyPtr);
return pmPtr->procPtr->bodyPtr;
@@ -1581,7 +1590,7 @@ TclOOGetFwdFromMethod(
Method *mPtr)
{
if (mPtr->typePtr == &fwdMethodType) {
- ForwardMethod *fwPtr = mPtr->clientData;
+ ForwardMethod *fwPtr = (ForwardMethod *)mPtr->clientData;
return fwPtr->prefixObj;
}
@@ -1623,7 +1632,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/tclObj.c b/generic/tclObj.c
index 487ea26..3c22dc7 100644
--- a/generic/tclObj.c
+++ b/generic/tclObj.c
@@ -169,7 +169,7 @@ static __thread PendingObjData pendingObjData;
static Tcl_ThreadDataKey pendingObjDataKey;
#define ObjInitDeletionContext(contextPtr) \
PendingObjData *const contextPtr = \
- Tcl_GetThreadData(&pendingObjDataKey, sizeof(PendingObjData))
+ (PendingObjData *)Tcl_GetThreadData(&pendingObjDataKey, sizeof(PendingObjData))
#endif
/*
@@ -178,7 +178,7 @@ static Tcl_ThreadDataKey pendingObjDataKey;
#define PACK_BIGNUM(bignum, objPtr) \
if ((bignum).used > 0x7fff) { \
- mp_int *temp = (void *) Tcl_Alloc(sizeof(mp_int)); \
+ mp_int *temp = (mp_int *) Tcl_Alloc(sizeof(mp_int)); \
*temp = bignum; \
(objPtr)->internalRep.twoPtrValue.ptr1 = temp; \
(objPtr)->internalRep.twoPtrValue.ptr2 = INT2PTR(-1); \
@@ -498,7 +498,7 @@ TclGetContLineTable(void)
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
if (!tsdPtr->lineCLPtr) {
- tsdPtr->lineCLPtr = Tcl_Alloc(sizeof(Tcl_HashTable));
+ tsdPtr->lineCLPtr = (Tcl_HashTable *)Tcl_Alloc(sizeof(Tcl_HashTable));
Tcl_InitHashTable(tsdPtr->lineCLPtr, TCL_ONE_WORD_KEYS);
Tcl_CreateThreadExitHandler(TclThreadFinalizeContLines,NULL);
}
@@ -533,7 +533,7 @@ TclContinuationsEnter(
ThreadSpecificData *tsdPtr = TclGetContLineTable();
Tcl_HashEntry *hPtr =
Tcl_CreateHashEntry(tsdPtr->lineCLPtr, objPtr, &newEntry);
- ContLineLoc *clLocPtr = Tcl_Alloc(sizeof(ContLineLoc) + num*sizeof(int));
+ ContLineLoc *clLocPtr = (ContLineLoc *)Tcl_Alloc(sizeof(ContLineLoc) + num*sizeof(int));
if (!newEntry) {
/*
@@ -691,7 +691,7 @@ TclContinuationsCopy(
Tcl_FindHashEntry(tsdPtr->lineCLPtr, originObjPtr);
if (hPtr) {
- ContLineLoc *clLocPtr = Tcl_GetHashValue(hPtr);
+ ContLineLoc *clLocPtr = (ContLineLoc *)Tcl_GetHashValue(hPtr);
TclContinuationsEnter(objPtr, clLocPtr->num, clLocPtr->loc);
}
@@ -727,7 +727,7 @@ TclContinuationsGet(
if (!hPtr) {
return NULL;
}
- return Tcl_GetHashValue(hPtr);
+ return (ContLineLoc *)Tcl_GetHashValue(hPtr);
}
/*
@@ -750,7 +750,7 @@ TclContinuationsGet(
static void
TclThreadFinalizeContLines(
- ClientData clientData)
+ ClientData dummy)
{
/*
* Release the hashtable tracking invisible continuation lines.
@@ -759,6 +759,7 @@ TclThreadFinalizeContLines(
ThreadSpecificData *tsdPtr = TclGetContLineTable();
Tcl_HashEntry *hPtr;
Tcl_HashSearch hSearch;
+ (void)dummy;
for (hPtr = Tcl_FirstHashEntry(tsdPtr->lineCLPtr, &hSearch);
hPtr != NULL; hPtr = Tcl_NextHashEntry(&hSearch)) {
@@ -855,7 +856,7 @@ Tcl_AppendAllObjTypes(
for (hPtr = Tcl_FirstHashEntry(&typeTable, &search);
hPtr != NULL; hPtr = Tcl_NextHashEntry(&search)) {
Tcl_ListObjAppendElement(NULL, objPtr,
- Tcl_NewStringObj(Tcl_GetHashKey(&typeTable, hPtr), -1));
+ Tcl_NewStringObj((char *)Tcl_GetHashKey(&typeTable, hPtr), -1));
}
Tcl_MutexUnlock(&tableMutex);
return TCL_OK;
@@ -888,7 +889,7 @@ Tcl_GetObjType(
Tcl_MutexLock(&tableMutex);
hPtr = Tcl_FindHashEntry(&typeTable, typeName);
if (hPtr != NULL) {
- typePtr = Tcl_GetHashValue(hPtr);
+ typePtr = (const Tcl_ObjType *)Tcl_GetHashValue(hPtr);
}
Tcl_MutexUnlock(&tableMutex);
return typePtr;
@@ -988,6 +989,8 @@ TclDbDumpActiveObjects(
}
}
}
+#else
+ (void)outFile;
#endif
}
@@ -1036,7 +1039,7 @@ TclDbInitNewObj(
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
if (tsdPtr->objThreadMap == NULL) {
- tsdPtr->objThreadMap = Tcl_Alloc(sizeof(Tcl_HashTable));
+ tsdPtr->objThreadMap = (Tcl_HashTable *)Tcl_Alloc(sizeof(Tcl_HashTable));
Tcl_InitHashTable(tsdPtr->objThreadMap, TCL_ONE_WORD_KEYS);
}
tablePtr = tsdPtr->objThreadMap;
@@ -1049,7 +1052,7 @@ TclDbInitNewObj(
* Record the debugging information.
*/
- objData = Tcl_Alloc(sizeof(ObjData));
+ objData = (ObjData *)Tcl_Alloc(sizeof(ObjData));
objData->objPtr = objPtr;
objData->file = file;
objData->line = line;
@@ -1164,6 +1167,9 @@ Tcl_DbNewObj(
int line) /* Line number in the source file; used for
* debugging. */
{
+ (void)file;
+ (void)line;
+
return Tcl_NewObj();
}
#endif /* TCL_MEM_DEBUG */
@@ -1208,7 +1214,7 @@ TclAllocateFreeObjects(void)
* Purify apparently can't figure that out, and fires a false alarm.
*/
- basePtr = Tcl_Alloc(bytesToAlloc);
+ basePtr = (char *)Tcl_Alloc(bytesToAlloc);
prevPtr = NULL;
objPtr = (Tcl_Obj *) basePtr;
@@ -1732,7 +1738,7 @@ Tcl_InitStringRep(
/* Allocate only as empty - extend later if bytes copied */
objPtr->length = 0;
if (numBytes) {
- objPtr->bytes = Tcl_AttemptAlloc(numBytes + 1);
+ objPtr->bytes = (char *)Tcl_AttemptAlloc(numBytes + 1);
if (objPtr->bytes == NULL) {
return NULL;
}
@@ -1746,7 +1752,7 @@ Tcl_InitStringRep(
}
} else {
/* objPtr->bytes != NULL bytes == NULL - Truncate */
- objPtr->bytes = Tcl_Realloc(objPtr->bytes, numBytes + 1);
+ objPtr->bytes = (char *)Tcl_Realloc(objPtr->bytes, numBytes + 1);
objPtr->length = numBytes;
}
@@ -2235,6 +2241,9 @@ Tcl_DbNewDoubleObj(
int line) /* Line number in the source file; used for
* debugging. */
{
+ (void)file;
+ (void)line;
+
return Tcl_NewDoubleObj(dblValue);
}
#endif /* TCL_MEM_DEBUG */
@@ -2567,6 +2576,7 @@ Tcl_GetLongFromObj(
* values in the unsigned long range will fit in a long.
*/
+ {
mp_int big;
unsigned long scratch, value = 0;
unsigned char *bytes = (unsigned char *) &scratch;
@@ -2589,6 +2599,7 @@ Tcl_GetLongFromObj(
}
}
}
+ }
#ifndef TCL_WIDE_INT_IS_LONG
tooLarge:
#endif
@@ -2722,6 +2733,9 @@ Tcl_DbNewWideIntObj(
int line) /* Line number in the source file; used for
* debugging. */
{
+ (void)file;
+ (void)line;
+
return Tcl_NewWideIntObj(wideValue);
}
#endif /* TCL_MEM_DEBUG */
@@ -3102,6 +3116,9 @@ Tcl_DbNewBignumObj(
const char *file,
int line)
{
+ (void)file;
+ (void)line;
+
return Tcl_NewBignumObj(bignumValue);
}
#endif
@@ -3386,7 +3403,8 @@ TclGetNumberFromObj(
}
if (objPtr->typePtr == &tclBignumType) {
static Tcl_ThreadDataKey bignumKey;
- mp_int *bigPtr = Tcl_GetThreadData(&bignumKey, sizeof(mp_int));
+ mp_int *bigPtr = (mp_int *)Tcl_GetThreadData(&bignumKey,
+ sizeof(mp_int));
TclUnpackBignum(objPtr, *bigPtr);
*typePtr = TCL_NUMBER_BIG;
@@ -3522,6 +3540,9 @@ Tcl_DbIncrRefCount(
}
}
# endif /* TCL_THREADS */
+#else
+ (void)file;
+ (void)line;
#endif /* TCL_MEM_DEBUG */
++(objPtr)->refCount;
}
@@ -3585,6 +3606,9 @@ Tcl_DbDecrRefCount(
}
}
# endif /* TCL_THREADS */
+#else
+ (void)file;
+ (void)line;
#endif /* TCL_MEM_DEBUG */
if (objPtr->refCount-- <= 1) {
@@ -3650,6 +3674,9 @@ Tcl_DbIsShared(
}
}
# endif /* TCL_THREADS */
+#else
+ (void)file;
+ (void)line;
#endif /* TCL_MEM_DEBUG */
#ifdef TCL_COMPILE_STATS
@@ -3713,11 +3740,12 @@ Tcl_InitObjHashTable(
static Tcl_HashEntry *
AllocObjEntry(
- Tcl_HashTable *tablePtr, /* Hash table. */
+ Tcl_HashTable *dummy, /* Hash table. */
void *keyPtr) /* Key to store in the hash table entry. */
{
Tcl_Obj *objPtr = (Tcl_Obj *)keyPtr;
- Tcl_HashEntry *hPtr = Tcl_Alloc(sizeof(Tcl_HashEntry));
+ Tcl_HashEntry *hPtr = (Tcl_HashEntry *)Tcl_Alloc(sizeof(Tcl_HashEntry));
+ (void)dummy;
hPtr->key.objPtr = objPtr;
Tcl_IncrRefCount(objPtr);
@@ -3748,8 +3776,8 @@ TclCompareObjKeys(
void *keyPtr, /* New key to compare. */
Tcl_HashEntry *hPtr) /* Existing key to compare. */
{
- Tcl_Obj *objPtr1 = (Tcl_Obj *) keyPtr;
- Tcl_Obj *objPtr2 = (Tcl_Obj *) hPtr->key.oneWordValue;
+ Tcl_Obj *objPtr1 = (Tcl_Obj *)keyPtr;
+ Tcl_Obj *objPtr2 = (Tcl_Obj *)hPtr->key.oneWordValue;
const char *p1, *p2;
size_t l1, l2;
@@ -3834,13 +3862,14 @@ TclFreeObjEntry(
TCL_HASH_TYPE
TclHashObjKey(
- Tcl_HashTable *tablePtr, /* Hash table. */
+ Tcl_HashTable *dummy, /* Hash table. */
void *keyPtr) /* Key from which to compute hash value. */
{
Tcl_Obj *objPtr = (Tcl_Obj *)keyPtr;
const char *string = TclGetString(objPtr);
size_t length = objPtr->length;
TCL_HASH_TYPE result = 0;
+ (void)dummy;
/*
* I tried a zillion different hash functions and asked many other people
@@ -3935,7 +3964,7 @@ Tcl_GetCommandFromObj(
* to discard the old rep and create a new one.
*/
- resPtr = objPtr->internalRep.twoPtrValue.ptr1;
+ resPtr = (ResolvedCmdName *)objPtr->internalRep.twoPtrValue.ptr1;
if (objPtr->typePtr == &tclCmdNameType) {
Command *cmdPtr = resPtr->cmdPtr;
@@ -3963,7 +3992,7 @@ Tcl_GetCommandFromObj(
if (tclCmdNameType.setFromAnyProc(interp, objPtr) != TCL_OK) {
return NULL;
}
- resPtr = objPtr->internalRep.twoPtrValue.ptr1;
+ resPtr = (ResolvedCmdName *)objPtr->internalRep.twoPtrValue.ptr1;
return (Tcl_Command) (resPtr ? resPtr->cmdPtr : NULL);
}
@@ -4001,7 +4030,7 @@ SetCmdNameObj(
if (resPtr) {
fillPtr = resPtr;
} else {
- fillPtr = Tcl_Alloc(sizeof(ResolvedCmdName));
+ fillPtr = (ResolvedCmdName *)Tcl_Alloc(sizeof(ResolvedCmdName));
fillPtr->refCount = 1;
}
@@ -4052,7 +4081,7 @@ TclSetCmdNameObj(
ResolvedCmdName *resPtr;
if (objPtr->typePtr == &tclCmdNameType) {
- resPtr = objPtr->internalRep.twoPtrValue.ptr1;
+ resPtr = (ResolvedCmdName *)objPtr->internalRep.twoPtrValue.ptr1;
if (resPtr != NULL && resPtr->cmdPtr == cmdPtr) {
return;
}
@@ -4087,7 +4116,7 @@ FreeCmdNameInternalRep(
Tcl_Obj *objPtr) /* CmdName object with internal
* representation to free. */
{
- ResolvedCmdName *resPtr = objPtr->internalRep.twoPtrValue.ptr1;
+ ResolvedCmdName *resPtr = (ResolvedCmdName *)objPtr->internalRep.twoPtrValue.ptr1;
/*
* Decrement the reference count of the ResolvedCmdName structure. If
@@ -4134,7 +4163,7 @@ DupCmdNameInternalRep(
Tcl_Obj *srcPtr, /* Object with internal rep to copy. */
Tcl_Obj *copyPtr) /* Object with internal rep to set. */
{
- ResolvedCmdName *resPtr = srcPtr->internalRep.twoPtrValue.ptr1;
+ ResolvedCmdName *resPtr = (ResolvedCmdName *)srcPtr->internalRep.twoPtrValue.ptr1;
copyPtr->internalRep.twoPtrValue.ptr1 = resPtr;
copyPtr->internalRep.twoPtrValue.ptr2 = NULL;
@@ -4197,7 +4226,7 @@ SetCmdNameFromAny(
return TCL_ERROR;
}
- resPtr = objPtr->internalRep.twoPtrValue.ptr1;
+ resPtr = (ResolvedCmdName *)objPtr->internalRep.twoPtrValue.ptr1;
if ((objPtr->typePtr == &tclCmdNameType) && (resPtr->refCount == 1)) {
/*
* Re-use existing ResolvedCmdName struct when possible.
@@ -4235,12 +4264,13 @@ SetCmdNameFromAny(
int
Tcl_RepresentationCmd(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
{
Tcl_Obj *descObj;
+ (void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "value");
diff --git a/generic/tclOptimize.c b/generic/tclOptimize.c
index 6419d87..69d3441 100644
--- a/generic/tclOptimize.c
+++ b/generic/tclOptimize.c
@@ -427,9 +427,9 @@ void
TclOptimizeBytecode(
void *envPtr)
{
- ConvertZeroEffectToNOP(envPtr);
- AdvanceJumps(envPtr);
- TrimUnreachable(envPtr);
+ ConvertZeroEffectToNOP((CompileEnv *)envPtr);
+ AdvanceJumps((CompileEnv *)envPtr);
+ TrimUnreachable((CompileEnv *)envPtr);
}
/*
diff --git a/generic/tclParse.c b/generic/tclParse.c
index 36ba1ed..0de091e 100644
--- a/generic/tclParse.c
+++ b/generic/tclParse.c
@@ -1144,7 +1144,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;
@@ -1532,7 +1532,7 @@ Tcl_ParseVar(
{
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);
@@ -2014,7 +2014,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 ==
@@ -2156,7 +2156,7 @@ TclSubstTokens(
if (isLiteral) {
maxNumCL = NUM_STATIC_POS;
- clPosition = Tcl_Alloc(maxNumCL * sizeof(int));
+ clPosition = (int *)Tcl_Alloc(maxNumCL * sizeof(int));
}
adjust = 0;
@@ -2206,7 +2206,7 @@ TclSubstTokens(
if (numCL >= maxNumCL) {
maxNumCL *= 2;
- clPosition = Tcl_Realloc(clPosition,
+ clPosition = (int *)Tcl_Realloc(clPosition,
maxNumCL * sizeof(int));
}
clPosition[numCL] = clPos;
diff --git a/generic/tclPathObj.c b/generic/tclPathObj.c
index dd78362..578c6ff 100644
--- a/generic/tclPathObj.c
+++ b/generic/tclPathObj.c
@@ -1272,7 +1272,7 @@ TclNewFSPathObj(
}
pathPtr = Tcl_NewObj();
- fsPathPtr = Tcl_Alloc(sizeof(FsPath));
+ fsPathPtr = (FsPath *)Tcl_Alloc(sizeof(FsPath));
/*
* Set up the path.
@@ -1384,13 +1384,14 @@ AppendPath(
Tcl_Obj *
TclFSMakePathRelative(
- Tcl_Interp *interp, /* Used for error reporting if not NULL. */
+ Tcl_Interp *dummy, /* Used for error reporting if not NULL. */
Tcl_Obj *pathPtr, /* The path we have. */
Tcl_Obj *cwdPtr) /* Make it relative to this. */
{
size_t cwdLen, len;
const char *tempStr;
Tcl_ObjIntRep *irPtr = TclFetchIntRep(pathPtr, &fsPathType);
+ (void)dummy;
if (irPtr) {
FsPath *fsPathPtr = PATHOBJ(pathPtr);
@@ -1455,16 +1456,17 @@ TclFSMakePathRelative(
static int
MakePathFromNormalized(
- Tcl_Interp *interp, /* Used for error reporting if not NULL. */
+ Tcl_Interp *dummy, /* Not used. */
Tcl_Obj *pathPtr) /* The object to convert. */
{
FsPath *fsPathPtr;
+ (void)dummy;
if (TclHasIntRep(pathPtr, &fsPathType)) {
return TCL_OK;
}
- fsPathPtr = Tcl_Alloc(sizeof(FsPath));
+ fsPathPtr = (FsPath *)Tcl_Alloc(sizeof(FsPath));
/*
* It's a pure normalized absolute path.
@@ -1532,7 +1534,7 @@ Tcl_FSNewNativePath(
*/
Tcl_StoreIntRep(pathPtr, &fsPathType, NULL);
- fsPathPtr = Tcl_Alloc(sizeof(FsPath));
+ fsPathPtr = (FsPath *)Tcl_Alloc(sizeof(FsPath));
fsPathPtr->translatedPathPtr = NULL;
@@ -1658,7 +1660,7 @@ Tcl_FSGetTranslatedStringPath(
if (transPtr != NULL) {
size_t len;
const char *orig = TclGetStringFromObj(transPtr, &len);
- char *result = Tcl_Alloc(len+1);
+ char *result = (char *)Tcl_Alloc(len+1);
memcpy(result, orig, len+1);
TclDecrRefCount(transPtr);
@@ -2014,7 +2016,7 @@ Tcl_FSGetInternalRep(
return NULL;
}
- nativePathPtr = proc(pathPtr);
+ nativePathPtr = (char *)proc(pathPtr);
srcFsPathPtr = PATHOBJ(pathPtr);
srcFsPathPtr->nativePathPtr = nativePathPtr;
srcFsPathPtr->filesystemEpoch = TclFSEpoch();
@@ -2348,7 +2350,7 @@ SetFsPathFromAny(
* slashes on Windows, and will not contain any ~user sequences.
*/
- fsPathPtr = Tcl_Alloc(sizeof(FsPath));
+ fsPathPtr = (FsPath *)Tcl_Alloc(sizeof(FsPath));
if (transPtr == pathPtr) {
transPtr = Tcl_DuplicateObj(pathPtr);
@@ -2408,7 +2410,7 @@ DupFsPathInternalRep(
Tcl_Obj *copyPtr) /* Path obj with internal rep to set. */
{
FsPath *srcFsPathPtr = PATHOBJ(srcPtr);
- FsPath *copyFsPathPtr = Tcl_Alloc(sizeof(FsPath));
+ FsPath *copyFsPathPtr = (FsPath *)Tcl_Alloc(sizeof(FsPath));
SETPATHOBJ(copyPtr, copyFsPathPtr);
@@ -2512,8 +2514,9 @@ UpdateStringOfFsPath(
int
TclNativePathInFilesystem(
Tcl_Obj *pathPtr,
- ClientData *clientDataPtr)
+ ClientData *dummy)
{
+ (void)dummy;
/*
* A special case is required to handle the empty path "". This is a valid
* path (i.e. the user should be able to do 'file exists ""' without
diff --git a/generic/tclPipe.c b/generic/tclPipe.c
index 81a7680..6c73f92 100644
--- a/generic/tclPipe.c
+++ b/generic/tclPipe.c
@@ -188,7 +188,7 @@ Tcl_DetachPids(
Tcl_MutexLock(&pipeMutex);
for (i = 0; i < numPids; i++) {
- detPtr = Tcl_Alloc(sizeof(Detached));
+ detPtr = (Detached *)Tcl_Alloc(sizeof(Detached));
detPtr->pid = pidPtr[i];
detPtr->nextPtr = detList;
detList = detPtr;
@@ -824,7 +824,7 @@ TclCreatePipeline(
*/
Tcl_ReapDetachedProcs();
- pidPtr = Tcl_Alloc(cmdCount * sizeof(Tcl_Pid));
+ pidPtr = (Tcl_Pid *)Tcl_Alloc(cmdCount * sizeof(Tcl_Pid));
curInFile = inputFile;
diff --git a/generic/tclPkg.c b/generic/tclPkg.c
index 700323f..9a72c66 100644
--- a/generic/tclPkg.c
+++ b/generic/tclPkg.c
@@ -111,7 +111,7 @@ static int TclNRPackageObjCmdCleanup(ClientData data[], Tcl_Interp *interp, int
*/
#define DupBlock(v,s,len) \
- ((v) = Tcl_Alloc(len), memcpy((v),(s),(len)))
+ ((v) = (char *)Tcl_Alloc(len), memcpy((v),(s),(len)))
#define DupString(v,s) \
do { \
size_t local__len = strlen(s) + 1; \
@@ -226,11 +226,12 @@ Tcl_PkgProvideEx(
static void
PkgFilesCleanupProc(
ClientData clientData,
- Tcl_Interp *interp)
+ Tcl_Interp *dummy)
{
PkgFiles *pkgFiles = (PkgFiles *) clientData;
Tcl_HashSearch search;
Tcl_HashEntry *entry;
+ (void)dummy;
while (pkgFiles->names) {
PkgName *name = pkgFiles->names;
@@ -258,10 +259,10 @@ TclInitPkgFiles(
* If assocdata "tclPkgFiles" doesn't exist yet, create it.
*/
- PkgFiles *pkgFiles = Tcl_GetAssocData(interp, "tclPkgFiles", NULL);
+ PkgFiles *pkgFiles = (PkgFiles *)Tcl_GetAssocData(interp, "tclPkgFiles", NULL);
if (!pkgFiles) {
- pkgFiles = Tcl_Alloc(sizeof(PkgFiles));
+ pkgFiles = (PkgFiles *)Tcl_Alloc(sizeof(PkgFiles));
pkgFiles->names = NULL;
Tcl_InitHashTable(&pkgFiles->table, TCL_STRING_KEYS);
Tcl_SetAssocData(interp, "tclPkgFiles", PkgFilesCleanupProc, pkgFiles);
@@ -281,7 +282,7 @@ TclPkgFileSeen(
const char *name = pkgFiles->names->name;
Tcl_HashTable *table = &pkgFiles->table;
int isNew;
- Tcl_HashEntry *entry = Tcl_CreateHashEntry(table, name, &isNew);
+ Tcl_HashEntry *entry = (Tcl_HashEntry *)Tcl_CreateHashEntry(table, name, &isNew);
Tcl_Obj *list;
if (isNew) {
@@ -289,7 +290,7 @@ TclPkgFileSeen(
Tcl_SetHashValue(entry, list);
Tcl_IncrRefCount(list);
} else {
- list = Tcl_GetHashValue(entry);
+ list = (Tcl_Obj *)Tcl_GetHashValue(entry);
}
Tcl_ListObjAppendElement(interp, list, Tcl_NewStringObj(fileName, -1));
}
@@ -447,7 +448,7 @@ TclNRPkgRequireProc(
int reqc,
Tcl_Obj *const reqv[])
{
- RequireProcArgs *args = clientData;
+ RequireProcArgs *args = (RequireProcArgs *)clientData;
Tcl_NRAddCallback(interp,
PkgRequireCore, (void *) args->name, INT2PTR(reqc), (void *) reqv,
@@ -461,27 +462,28 @@ PkgRequireCore(
Tcl_Interp *interp,
int result)
{
- const char *name = data[0];
+ const char *name = (const char *)data[0];
int reqc = PTR2INT(data[1]);
- Tcl_Obj *const *reqv = data[2];
+ Tcl_Obj **reqv = (Tcl_Obj **)data[2];
int code = CheckAllRequirements(interp, reqc, reqv);
Require *reqPtr;
+ (void)result;
if (code != TCL_OK) {
return code;
}
- reqPtr = Tcl_Alloc(sizeof(Require));
+ reqPtr = (Require *)Tcl_Alloc(sizeof(Require));
Tcl_NRAddCallback(interp, PkgRequireCoreCleanup, reqPtr, NULL, NULL, NULL);
reqPtr->clientDataPtr = data[3];
reqPtr->name = name;
reqPtr->pkgPtr = FindPackage(interp, name);
if (reqPtr->pkgPtr->version == NULL) {
Tcl_NRAddCallback(interp,
- SelectPackage, reqPtr, INT2PTR(reqc), (void *) reqv,
- PkgRequireCoreStep1);
+ SelectPackage, reqPtr, INT2PTR(reqc), reqv,
+ (void *)PkgRequireCoreStep1);
} else {
Tcl_NRAddCallback(interp,
- PkgRequireCoreFinal, reqPtr, INT2PTR(reqc), (void *) reqv,NULL);
+ PkgRequireCoreFinal, reqPtr, INT2PTR(reqc), reqv, NULL);
}
return TCL_OK;
}
@@ -494,10 +496,11 @@ PkgRequireCoreStep1(
{
Tcl_DString command;
char *script;
- Require *reqPtr = data[0];
+ Require *reqPtr = (Require *)data[0];
int reqc = PTR2INT(data[1]);
- Tcl_Obj **const reqv = data[2];
+ Tcl_Obj **const reqv = (Tcl_Obj **)data[2];
const char *name = reqPtr->name /* Name of desired package. */;
+ (void)result;
/*
* If we've got the package in the DB already, go on to actually loading
@@ -551,9 +554,9 @@ PkgRequireCoreStep2(
Tcl_Interp *interp,
int result)
{
- Require *reqPtr = data[0];
+ Require *reqPtr = (Require *)data[0];
int reqc = PTR2INT(data[1]);
- Tcl_Obj **const reqv = data[2];
+ Tcl_Obj **const reqv = (Tcl_Obj **)data[2];
const char *name = reqPtr->name; /* Name of desired package. */
if ((result != TCL_OK) && (result != TCL_ERROR)) {
@@ -575,8 +578,8 @@ PkgRequireCoreStep2(
reqPtr->pkgPtr = FindPackage(interp, name);
Tcl_NRAddCallback(interp,
- SelectPackage, reqPtr, INT2PTR(reqc), (void *) reqv,
- PkgRequireCoreFinal);
+ SelectPackage, reqPtr, INT2PTR(reqc), reqv,
+ (void *)PkgRequireCoreFinal);
return TCL_OK;
}
@@ -586,12 +589,13 @@ PkgRequireCoreFinal(
Tcl_Interp *interp,
int result)
{
- Require *reqPtr = data[0];
+ Require *reqPtr = (Require *)data[0];
int reqc = PTR2INT(data[1]), satisfies;
- Tcl_Obj **const reqv = data[2];
+ Tcl_Obj **const reqv = (Tcl_Obj **)data[2];
char *pkgVersionI;
void *clientDataPtr = reqPtr->clientDataPtr;
const char *name = reqPtr->name; /* Name of desired package. */
+ (void)result;
if (reqPtr->pkgPtr->version == NULL) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
@@ -635,9 +639,11 @@ PkgRequireCoreFinal(
static int
PkgRequireCoreCleanup(
ClientData data[],
- Tcl_Interp *interp,
+ Tcl_Interp *dummy,
int result)
{
+ (void)dummy;
+
Tcl_Free(data[0]);
return result;
}
@@ -652,12 +658,13 @@ SelectPackage(
char *availVersion, *bestVersion, *bestStableVersion;
/* Internal rep. of versions */
int availStable, satisfies;
- Require *reqPtr = data[0];
+ Require *reqPtr = (Require *)data[0];
int reqc = PTR2INT(data[1]);
- Tcl_Obj **const reqv = data[2];
+ Tcl_Obj **const reqv = (Tcl_Obj **)data[2];
const char *name = reqPtr->name;
Package *pkgPtr = reqPtr->pkgPtr;
Interp *iPtr = (Interp *) interp;
+ (void)result;
/*
* Check whether we're already attempting to load some version of this
@@ -806,7 +813,7 @@ SelectPackage(
if (bestPtr == NULL) {
Tcl_NRAddCallback(interp,
- data[3], reqPtr, INT2PTR(reqc), (void *)reqv, NULL);
+ (Tcl_NRPostProc *)data[3], reqPtr, INT2PTR(reqc), (void *)reqv, NULL);
} else {
/*
* We found an ifneeded script for the package. Be careful while
@@ -822,13 +829,13 @@ SelectPackage(
Tcl_Preserve(versionToProvide);
pkgPtr->clientData = versionToProvide;
- pkgFiles = TclInitPkgFiles(interp);
+ pkgFiles = (PkgFiles *)TclInitPkgFiles(interp);
/*
* Push "ifneeded" package name in "tclPkgFiles" assocdata.
*/
- pkgName = Tcl_Alloc(sizeof(PkgName) + strlen(name));
+ pkgName = (PkgName *)Tcl_Alloc(sizeof(PkgName) + strlen(name));
pkgName->nextPtr = pkgFiles->names;
strcpy(pkgName->name, name);
pkgFiles->names = pkgName;
@@ -851,9 +858,9 @@ SelectPackageFinal(
Tcl_Interp *interp,
int result)
{
- Require *reqPtr = data[0];
+ Require *reqPtr = (Require *)data[0];
int reqc = PTR2INT(data[1]);
- Tcl_Obj **const reqv = data[2];
+ Tcl_Obj **const reqv = (Tcl_Obj **)data[2];
const char *name = reqPtr->name;
char *versionToProvide = reqPtr->versionToProvide;
@@ -861,7 +868,7 @@ SelectPackageFinal(
* Pop the "ifneeded" package name from "tclPkgFiles" assocdata
*/
- PkgFiles *pkgFiles = Tcl_GetAssocData(interp, "tclPkgFiles", NULL);
+ PkgFiles *pkgFiles = (PkgFiles *)Tcl_GetAssocData(interp, "tclPkgFiles", NULL);
PkgName *pkgName = pkgFiles->names;
pkgFiles->names = pkgName->nextPtr;
Tcl_Free(pkgName);
@@ -943,7 +950,7 @@ SelectPackageFinal(
}
Tcl_NRAddCallback(interp,
- data[3], reqPtr, INT2PTR(reqc), (void *) reqv, NULL);
+ (Tcl_NRPostProc *)data[3], reqPtr, INT2PTR(reqc), (void *) reqv, NULL);
return TCL_OK;
}
@@ -1004,7 +1011,7 @@ Tcl_PkgPresentEx(
hPtr = Tcl_FindHashEntry(&iPtr->packageTable, name);
if (hPtr) {
- pkgPtr = Tcl_GetHashValue(hPtr);
+ pkgPtr = (Package *)Tcl_GetHashValue(hPtr);
if (pkgPtr->version != NULL) {
/*
* At this point we know that the package is present. Make sure
@@ -1057,6 +1064,8 @@ Tcl_PackageObjCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
+ (void)dummy;
+
return Tcl_NRCallObjProc(interp, TclNRPackageObjCmd, NULL, objc, objv);
}
@@ -1089,6 +1098,7 @@ TclNRPackageObjCmd(
const char *argv2, *argv3, *argv4;
char *iva = NULL, *ivb = NULL;
Tcl_Obj *objvListPtr, **newObjvPtr;
+ (void)dummy;
if (objc < 2) {
Tcl_WrongNumArgs(interp, 1, objv, "option ?arg ...?");
@@ -1128,7 +1138,7 @@ TclNRPackageObjCmd(
if (pkgFiles) {
hPtr = Tcl_FindHashEntry(&pkgFiles->table, keyString);
if (hPtr) {
- Tcl_Obj *obj = Tcl_GetHashValue(hPtr);
+ Tcl_Obj *obj = (Tcl_Obj *)Tcl_GetHashValue(hPtr);
Tcl_DeleteHashEntry(hPtr);
Tcl_DecrRefCount(obj);
}
@@ -1138,7 +1148,7 @@ TclNRPackageObjCmd(
if (hPtr == NULL) {
continue;
}
- pkgPtr = Tcl_GetHashValue(hPtr);
+ pkgPtr = (Package *)Tcl_GetHashValue(hPtr);
Tcl_DeleteHashEntry(hPtr);
if (pkgPtr->version != NULL) {
Tcl_DecrRefCount(pkgPtr->version);
@@ -1178,7 +1188,7 @@ TclNRPackageObjCmd(
Tcl_Free(argv3i);
return TCL_OK;
}
- pkgPtr = Tcl_GetHashValue(hPtr);
+ pkgPtr = (Package *)Tcl_GetHashValue(hPtr);
} else {
pkgPtr = FindPackage(interp, argv2);
}
@@ -1216,7 +1226,7 @@ TclNRPackageObjCmd(
return TCL_OK;
}
if (availPtr == NULL) {
- availPtr = Tcl_Alloc(sizeof(PkgAvail));
+ availPtr = (PkgAvail *)Tcl_Alloc(sizeof(PkgAvail));
availPtr->pkgIndex = NULL;
DupBlock(availPtr->version, argv3, length + 1);
@@ -1247,10 +1257,10 @@ TclNRPackageObjCmd(
tablePtr = &iPtr->packageTable;
for (hPtr = Tcl_FirstHashEntry(tablePtr, &search); hPtr != NULL;
hPtr = Tcl_NextHashEntry(&search)) {
- pkgPtr = Tcl_GetHashValue(hPtr);
+ pkgPtr = (Package *)Tcl_GetHashValue(hPtr);
if ((pkgPtr->version != NULL) || (pkgPtr->availPtr != NULL)) {
Tcl_ListObjAppendElement(NULL,resultObj, Tcl_NewStringObj(
- Tcl_GetHashKey(tablePtr, hPtr), -1));
+ (char *)Tcl_GetHashKey(tablePtr, hPtr), -1));
}
}
Tcl_SetObjResult(interp, resultObj);
@@ -1276,7 +1286,7 @@ TclNRPackageObjCmd(
hPtr = Tcl_FindHashEntry(&iPtr->packageTable, name);
if (hPtr != NULL) {
- pkgPtr = Tcl_GetHashValue(hPtr);
+ pkgPtr = (Package *)Tcl_GetHashValue(hPtr);
if (pkgPtr->version != NULL) {
goto require;
}
@@ -1311,7 +1321,7 @@ TclNRPackageObjCmd(
if (objc == 3) {
hPtr = Tcl_FindHashEntry(&iPtr->packageTable, argv2);
if (hPtr != NULL) {
- pkgPtr = Tcl_GetHashValue(hPtr);
+ pkgPtr = (Package *)Tcl_GetHashValue(hPtr);
if (pkgPtr->version != NULL) {
Tcl_SetObjResult(interp, pkgPtr->version);
}
@@ -1497,7 +1507,7 @@ TclNRPackageObjCmd(
argv2 = TclGetString(objv[2]);
hPtr = Tcl_FindHashEntry(&iPtr->packageTable, argv2);
if (hPtr != NULL) {
- pkgPtr = Tcl_GetHashValue(hPtr);
+ pkgPtr = (Package *)Tcl_GetHashValue(hPtr);
for (availPtr = pkgPtr->availPtr; availPtr != NULL;
availPtr = availPtr->nextPtr) {
Tcl_ListObjAppendElement(NULL, resultObj,
@@ -1538,9 +1548,11 @@ TclNRPackageObjCmd(
static int
TclNRPackageObjCmdCleanup(
ClientData data[],
- Tcl_Interp *interp,
+ Tcl_Interp *dummy,
int result)
{
+ (void)dummy;
+
TclDecrRefCount((Tcl_Obj *) data[0]);
TclDecrRefCount((Tcl_Obj *) data[1]);
return result;
@@ -1576,13 +1588,13 @@ FindPackage(
hPtr = Tcl_CreateHashEntry(&iPtr->packageTable, name, &isNew);
if (isNew) {
- pkgPtr = Tcl_Alloc(sizeof(Package));
+ pkgPtr = (Package *)Tcl_Alloc(sizeof(Package));
pkgPtr->version = NULL;
pkgPtr->availPtr = NULL;
pkgPtr->clientData = NULL;
Tcl_SetHashValue(hPtr, pkgPtr);
} else {
- pkgPtr = Tcl_GetHashValue(hPtr);
+ pkgPtr = (Package *)Tcl_GetHashValue(hPtr);
}
return pkgPtr;
}
@@ -1615,7 +1627,7 @@ TclFreePackageInfo(
for (hPtr = Tcl_FirstHashEntry(&iPtr->packageTable, &search);
hPtr != NULL; hPtr = Tcl_NextHashEntry(&search)) {
- pkgPtr = Tcl_GetHashValue(hPtr);
+ pkgPtr = (Package *)Tcl_GetHashValue(hPtr);
if (pkgPtr->version != NULL) {
Tcl_DecrRefCount(pkgPtr->version);
}
@@ -1674,7 +1686,7 @@ CheckVersionAndConvert(
* 4* assuming that each char is a separator (a,b become ' -x ').
* 4+ to have spce for an additional -2 at the end
*/
- char *ibuf = Tcl_Alloc(4 + 4*strlen(string));
+ char *ibuf = (char *)Tcl_Alloc(4 + 4*strlen(string));
char *ip = ibuf;
/*
@@ -2001,7 +2013,7 @@ CheckRequirement(
char *dash = NULL, *buf;
- dash = strchr(string, '-');
+ dash = (char *)strchr(string, '-');
if (dash == NULL) {
/*
* No dash found, has to be a simple version.
@@ -2190,7 +2202,7 @@ RequirementSatisfied(
int satisfied, res;
char *dash = NULL, *buf, *min, *max;
- dash = strchr(req, '-');
+ dash = (char *)strchr(req, '-');
if (dash == NULL) {
/*
* No dash found, is a simple version, fallback to regular check. The
diff --git a/generic/tclPreserve.c b/generic/tclPreserve.c
index 695eeb9..53e86bf 100644
--- a/generic/tclPreserve.c
+++ b/generic/tclPreserve.c
@@ -144,7 +144,7 @@ Tcl_Preserve(
if (inUse == spaceAvl) {
spaceAvl = spaceAvl ? 2*spaceAvl : INITIAL_SIZE;
- refArray = Tcl_Realloc(refArray, spaceAvl * sizeof(Reference));
+ refArray = (Reference *)Tcl_Realloc(refArray, spaceAvl * sizeof(Reference));
}
/*
@@ -226,7 +226,7 @@ Tcl_Release(
if (freeProc == TCL_DYNAMIC) {
Tcl_Free(clientData);
} else {
- freeProc(clientData);
+ freeProc((char *)clientData);
}
}
return;
@@ -293,7 +293,7 @@ Tcl_EventuallyFree(
if (freeProc == TCL_DYNAMIC) {
Tcl_Free(clientData);
} else {
- freeProc(clientData);
+ freeProc((char *)clientData);
}
}
@@ -327,7 +327,7 @@ TclHandleCreate(
* be tracked for deletion. Must not be
* NULL. */
{
- HandleStruct *handlePtr = Tcl_Alloc(sizeof(HandleStruct));
+ HandleStruct *handlePtr = (HandleStruct *)Tcl_Alloc(sizeof(HandleStruct));
handlePtr->ptr = ptr;
#ifdef TCL_MEM_DEBUG
diff --git a/generic/tclProc.c b/generic/tclProc.c
index 7aa553c..09821ae 100644
--- a/generic/tclProc.c
+++ b/generic/tclProc.c
@@ -81,7 +81,7 @@ const Tcl_ObjType tclProcBodyType = {
do { \
const Tcl_ObjIntRep *irPtr; \
irPtr = TclFetchIntRep((objPtr), &tclProcBodyType); \
- (procPtr) = irPtr ? irPtr->twoPtrValue.ptr1 : NULL; \
+ (procPtr) = irPtr ? (Proc *)irPtr->twoPtrValue.ptr1 : NULL; \
} while (0)
/*
@@ -127,8 +127,8 @@ static const Tcl_ObjType lambdaType = {
do { \
const Tcl_ObjIntRep *irPtr; \
irPtr = TclFetchIntRep((objPtr), &lambdaType); \
- (procPtr) = irPtr ? irPtr->twoPtrValue.ptr1 : NULL; \
- (nsObjPtr) = irPtr ? irPtr->twoPtrValue.ptr2 : NULL; \
+ (procPtr) = irPtr ? (Proc *)irPtr->twoPtrValue.ptr1 : NULL; \
+ (nsObjPtr) = irPtr ? (Tcl_Obj *)irPtr->twoPtrValue.ptr2 : NULL; \
} while (0)
@@ -163,6 +163,7 @@ Tcl_ProcObjCmd(
const char *simpleName, *procArgs, *procBody;
Namespace *nsPtr, *altNsPtr, *cxtNsPtr;
Tcl_Command cmd;
+ (void)dummy;
if (objc != 4) {
Tcl_WrongNumArgs(interp, 1, objv, "name args body");
@@ -232,7 +233,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) {
@@ -263,11 +264,11 @@ Tcl_ProcObjCmd(
&& (contextPtr->nline >= 4) && (contextPtr->line[3] >= 0)) {
int isNew;
Tcl_HashEntry *hePtr;
- CmdFrame *cfPtr = Tcl_Alloc(sizeof(CmdFrame));
+ CmdFrame *cfPtr = (CmdFrame *)Tcl_Alloc(sizeof(CmdFrame));
cfPtr->level = -1;
cfPtr->type = contextPtr->type;
- cfPtr->line = Tcl_Alloc(sizeof(int));
+ cfPtr->line = (int *)Tcl_Alloc(sizeof(int));
cfPtr->line[0] = contextPtr->line[3];
cfPtr->nline = 1;
cfPtr->framePtr = NULL;
@@ -289,7 +290,7 @@ Tcl_ProcObjCmd(
* is able to trigger this situation.
*/
- CmdFrame *cfOldPtr = Tcl_GetHashValue(hePtr);
+ CmdFrame *cfOldPtr = (CmdFrame *)Tcl_GetHashValue(hePtr);
if (cfOldPtr->type == TCL_LOCATION_SOURCE) {
Tcl_DecrRefCount(cfOldPtr->data.eval.path);
@@ -410,6 +411,7 @@ TclCreateProc(
CompiledLocal *localPtr = NULL;
Tcl_Obj **argArray;
int precompiled = 0;
+ (void)nsPtr;
ProcGetIntRep(bodyPtr, procPtr);
if (procPtr != NULL) {
@@ -469,7 +471,7 @@ TclCreateProc(
Tcl_IncrRefCount(bodyPtr);
- procPtr = Tcl_Alloc(sizeof(Proc));
+ procPtr = (Proc *)Tcl_Alloc(sizeof(Proc));
procPtr->iPtr = iPtr;
procPtr->refCount = 1;
procPtr->bodyPtr = bodyPtr;
@@ -634,7 +636,7 @@ TclCreateProc(
* local variables for the argument.
*/
- localPtr = Tcl_Alloc(offsetof(CompiledLocal, name) + fieldValues[0]->length +1);
+ localPtr = (CompiledLocal *)Tcl_Alloc(offsetof(CompiledLocal, name) + fieldValues[0]->length +1);
if (procPtr->firstLocalPtr == NULL) {
procPtr->firstLocalPtr = procPtr->lastLocalPtr = localPtr;
} else {
@@ -870,7 +872,7 @@ Uplevel_Callback(
Tcl_Interp *interp,
int result)
{
- CallFrame *savedVarFramePtr = data[0];
+ CallFrame *savedVarFramePtr = (CallFrame *)data[0];
if (result == TCL_ERROR) {
Tcl_AppendObjToErrorInfo(interp, Tcl_ObjPrintf(
@@ -910,6 +912,7 @@ TclNRUplevelObjCmd(
int result;
CallFrame *savedVarFramePtr, *framePtr;
Tcl_Obj *objPtr;
+ (void)dummy;
if (objc < 2) {
uplevelSyntax:
@@ -1033,7 +1036,7 @@ TclIsProc(
cmdPtr = (Command *) origCmd;
}
if (cmdPtr->deleteProc == TclProcDeleteProc) {
- return cmdPtr->objClientData;
+ return (Proc *)cmdPtr->objClientData;
}
return NULL;
}
@@ -1054,8 +1057,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);
@@ -1264,7 +1267,7 @@ InitLocalCache(
* for future calls.
*/
- localCachePtr = Tcl_Alloc(sizeof(LocalCache)
+ localCachePtr = (LocalCache *)Tcl_Alloc(sizeof(LocalCache)
+ (localCt - 1) * sizeof(Tcl_Obj *)
+ numArgs * sizeof(Var));
@@ -1329,6 +1332,7 @@ InitArgsAndLocals(
Var *varPtr, *defPtr;
int localCt = procPtr->numCompiledLocals, numArgs, argCt, i, imax;
Tcl_Obj *const *argObjs;
+ (void)procNameObj;
ByteCodeGetIntRep(procPtr->bodyPtr, &tclByteCodeType, codePtr);
@@ -1354,7 +1358,7 @@ InitArgsAndLocals(
* parameters.
*/
- varPtr = TclStackAlloc(interp, (int)(localCt * sizeof(Var)));
+ varPtr = (Var *)TclStackAlloc(interp, localCt * sizeof(Var));
framePtr->compiledLocals = varPtr;
framePtr->numCompiledLocals = localCt;
@@ -1492,7 +1496,7 @@ TclPushProcCallFrame(
int isLambda) /* 1 if this is a call by ApplyObjCmd: it
* needs special rules for error msg */
{
- Proc *procPtr = clientData;
+ Proc *procPtr = (Proc *)clientData;
Namespace *nsPtr = procPtr->cmdPtr->nsPtr;
CallFrame *framePtr, **framePtrPtr;
int result;
@@ -1732,7 +1736,7 @@ InterpProcNR2(
Interp *iPtr = (Interp *) interp;
Proc *procPtr = iPtr->varFramePtr->procPtr;
CallFrame *freePtr;
- Tcl_Obj *procNameObj = data[0];
+ Tcl_Obj *procNameObj = (Tcl_Obj *)data[0];
ProcErrorProc *errorProc = (ProcErrorProc *)data[1];
if (TCL_DTRACE_PROC_RETURN_ENABLED()) {
@@ -1909,6 +1913,9 @@ TclProcCompileProc(
fprintf(stdout, "%s\"\n", TclGetString(message));
Tcl_DecrRefCount(message);
}
+#else
+ (void)description;
+ (void)procName;
#endif
/*
@@ -1970,7 +1977,7 @@ TclProcCompileProc(
*/
iPtr->invokeWord = 0;
- iPtr->invokeCmdFramePtr = (hePtr ? Tcl_GetHashValue(hePtr) : NULL);
+ iPtr->invokeCmdFramePtr = hePtr ? (CmdFrame *)Tcl_GetHashValue(hePtr) : NULL;
TclSetByteCodeFromAny(interp, bodyPtr, NULL, NULL);
iPtr->invokeCmdFramePtr = NULL;
TclPopStackFrame(interp);
@@ -2046,7 +2053,7 @@ void
TclProcDeleteProc(
ClientData clientData) /* Procedure to be deleted. */
{
- Proc *procPtr = clientData;
+ Proc *procPtr = (Proc *)clientData;
if (procPtr->refCount-- <= 1) {
TclProcCleanupProc(procPtr);
@@ -2121,7 +2128,7 @@ TclProcCleanupProc(
return;
}
- cfPtr = Tcl_GetHashValue(hePtr);
+ cfPtr = (CmdFrame *)Tcl_GetHashValue(hePtr);
if (cfPtr) {
if (cfPtr->type == TCL_LOCATION_SOURCE) {
@@ -2428,7 +2435,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) {
@@ -2464,12 +2471,12 @@ SetLambdaFromAny(
* location (line of 2nd list element).
*/
- cfPtr = Tcl_Alloc(sizeof(CmdFrame));
+ cfPtr = (CmdFrame *)Tcl_Alloc(sizeof(CmdFrame));
TclListLines(objPtr, contextPtr->line[1], 2, buf, NULL);
cfPtr->level = -1;
cfPtr->type = contextPtr->type;
- cfPtr->line = Tcl_Alloc(sizeof(int));
+ cfPtr->line = (int *)Tcl_Alloc(sizeof(int));
cfPtr->line[0] = buf[1];
cfPtr->nline = 1;
cfPtr->framePtr = NULL;
@@ -2588,6 +2595,7 @@ TclNRApplyObjCmd(
int result;
Tcl_Namespace *nsPtr;
ApplyExtraData *extraPtr;
+ (void)dummy;
if (objc < 2) {
Tcl_WrongNumArgs(interp, 1, objv, "lambdaExpr ?arg ...?");
@@ -2616,7 +2624,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;
@@ -2651,7 +2659,7 @@ ApplyNR2(
Tcl_Interp *interp,
int result)
{
- ApplyExtraData *extraPtr = data[0];
+ ApplyExtraData *extraPtr = (ApplyExtraData *)data[0];
TclStackFree(interp, extraPtr);
return result;
diff --git a/generic/tclProcess.c b/generic/tclProcess.c
index 254e1e7..5647c65 100644
--- a/generic/tclProcess.c
+++ b/generic/tclProcess.c
@@ -402,7 +402,7 @@ BuildProcessStatusObj(
static int
ProcessListObjCmd(
- ClientData clientData, /* Not used. */
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
@@ -411,6 +411,7 @@ ProcessListObjCmd(
Tcl_HashEntry *entry;
Tcl_HashSearch search;
ProcessInfo *info;
+ (void)dummy;
if (objc != 1) {
Tcl_WrongNumArgs(interp, 1, objv, NULL);
@@ -453,7 +454,7 @@ ProcessListObjCmd(
static int
ProcessStatusObjCmd(
- ClientData clientData, /* Not used. */
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
@@ -475,6 +476,7 @@ ProcessStatusObjCmd(
enum switches {
STATUS_WAIT, STATUS_LAST
};
+ (void)dummy;
while (objc > 1) {
if (TclGetString(objv[1])[0] != '-') {
@@ -601,7 +603,7 @@ ProcessStatusObjCmd(
static int
ProcessPurgeObjCmd(
- ClientData clientData, /* Not used. */
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
@@ -614,6 +616,7 @@ ProcessPurgeObjCmd(
int result;
int i;
int pid;
+ (void)dummy;
if (objc != 1 && objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "?pids?");
@@ -701,11 +704,13 @@ ProcessPurgeObjCmd(
static int
ProcessAutopurgeObjCmd(
- ClientData clientData, /* Not used. */
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
+ (void)dummy;
+
if (objc != 1 && objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "?flag?");
return TCL_ERROR;
diff --git a/generic/tclRegexp.c b/generic/tclRegexp.c
index 7f97288..a21f4d7 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)
@@ -915,7 +915,7 @@ CompileRegexp(
* This is a new expression, so compile it and add it to the cache.
*/
- regexpPtr = Tcl_Alloc(sizeof(TclRegexp));
+ regexpPtr = (TclRegexp*)Tcl_Alloc(sizeof(TclRegexp));
regexpPtr->objPtr = NULL;
regexpPtr->string = NULL;
regexpPtr->details.rm_extend.rm_so = -1;
@@ -970,7 +970,7 @@ CompileRegexp(
*/
regexpPtr->matches =
- Tcl_Alloc(sizeof(regmatch_t) * (regexpPtr->re.re_nsub + 1));
+ (regmatch_t*)Tcl_Alloc(sizeof(regmatch_t) * (regexpPtr->re.re_nsub + 1));
/*
* Initialize the refcount to one initially, since it is in the cache.
@@ -996,7 +996,7 @@ CompileRegexp(
tsdPtr->patLengths[i+1] = tsdPtr->patLengths[i];
tsdPtr->regexps[i+1] = tsdPtr->regexps[i];
}
- tsdPtr->patterns[0] = Tcl_Alloc(length + 1);
+ tsdPtr->patterns[0] = (char *)Tcl_Alloc(length + 1);
memcpy(tsdPtr->patterns[0], string, length + 1);
tsdPtr->patLengths[0] = length;
tsdPtr->regexps[0] = regexpPtr;
@@ -1052,11 +1052,12 @@ FreeRegexp(
static void
FinalizeRegexp(
- ClientData clientData) /* Not used. */
+ ClientData dummy) /* Not used. */
{
int i;
TclRegexp *regexpPtr;
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
+ (void)dummy;
for (i = 0; (i < NUM_REGEXPS) && (tsdPtr->patterns[i] != NULL); i++) {
regexpPtr = tsdPtr->regexps[i];
diff --git a/generic/tclResolve.c b/generic/tclResolve.c
index 23f2326..c70cbd3 100644
--- a/generic/tclResolve.c
+++ b/generic/tclResolve.c
@@ -101,9 +101,9 @@ Tcl_AddInterpResolvers(
* list, so that it overrides existing schemes.
*/
- resPtr = Tcl_Alloc(sizeof(ResolverScheme));
+ resPtr = (ResolverScheme *)Tcl_Alloc(sizeof(ResolverScheme));
len = strlen(name) + 1;
- resPtr->name = Tcl_Alloc(len);
+ resPtr->name = (char *)Tcl_Alloc(len);
memcpy(resPtr->name, name, len);
resPtr->cmdResProc = cmdProc;
resPtr->varResProc = varProc;
@@ -265,7 +265,7 @@ BumpCmdRefEpochs(
#ifndef BREAK_NAMESPACE_COMPAT
for (entry = Tcl_FirstHashEntry(&nsPtr->childTable, &search);
entry != NULL; entry = Tcl_NextHashEntry(&search)) {
- Namespace *childNsPtr = Tcl_GetHashValue(entry);
+ Namespace *childNsPtr = (Namespace *)Tcl_GetHashValue(entry);
BumpCmdRefEpochs(childNsPtr);
}
diff --git a/generic/tclResult.c b/generic/tclResult.c
index 69edd39..9168237 100644
--- a/generic/tclResult.c
+++ b/generic/tclResult.c
@@ -74,7 +74,7 @@ Tcl_SaveInterpState(
int status) /* status code for current operation */
{
Interp *iPtr = (Interp *) interp;
- InterpState *statePtr = Tcl_Alloc(sizeof(InterpState));
+ InterpState *statePtr = (InterpState *)Tcl_Alloc(sizeof(InterpState));
statePtr->status = status;
statePtr->flags = iPtr->flags & ERR_ALREADY_LOGGED;
@@ -609,8 +609,8 @@ static Tcl_Obj **
GetKeys(void)
{
static Tcl_ThreadDataKey returnKeysKey;
- Tcl_Obj **keys = Tcl_GetThreadData(&returnKeysKey,
- (int) (KEY_LAST * sizeof(Tcl_Obj *)));
+ Tcl_Obj **keys = (Tcl_Obj **)Tcl_GetThreadData(&returnKeysKey,
+ KEY_LAST * sizeof(Tcl_Obj *));
if (keys[0] == NULL) {
/*
@@ -661,7 +661,7 @@ static void
ReleaseKeys(
ClientData clientData)
{
- Tcl_Obj **keys = clientData;
+ Tcl_Obj **keys = (Tcl_Obj **)clientData;
int i;
for (i = KEY_CODE; i < KEY_LAST; i++) {
diff --git a/generic/tclScan.c b/generic/tclScan.c
index 20cb9d0..e30267b 100644
--- a/generic/tclScan.c
+++ b/generic/tclScan.c
@@ -30,14 +30,16 @@
*/
typedef struct {
+ Tcl_UniChar start;
+ Tcl_UniChar end;
+} Range;
+
+typedef struct {
int exclude; /* 1 if this is an exclusion set. */
int nchars;
Tcl_UniChar *chars;
int nranges;
- struct Range {
- Tcl_UniChar start;
- Tcl_UniChar end;
- } *ranges;
+ Range *ranges;
} CharSet;
/*
@@ -102,9 +104,9 @@ BuildCharSet(
end += TclUtfToUniChar(end, &ch);
}
- cset->chars = Tcl_Alloc(sizeof(Tcl_UniChar) * (end - format - 1));
+ cset->chars = (Tcl_UniChar *)Tcl_Alloc(sizeof(Tcl_UniChar) * (end - format - 1));
if (nranges > 0) {
- cset->ranges = Tcl_Alloc(sizeof(struct Range) * nranges);
+ cset->ranges = (Range *)Tcl_Alloc(sizeof(Range) * nranges);
} else {
cset->ranges = NULL;
}
@@ -260,7 +262,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));
Tcl_Obj *errorMsg; /* Place to build an error messages. Note that
* these are messy operations because we do
* not want to use the formatting engine;
@@ -477,7 +479,7 @@ ValidateFormat(
} else {
nspace += 16; /* formerly STATIC_LIST_SIZE */
}
- nassign = TclStackRealloc(interp, nassign,
+ nassign = (int *)TclStackRealloc(interp, nassign,
nspace * sizeof(int));
for (i = value; i < nspace; i++) {
nassign[i] = 0;
@@ -579,6 +581,7 @@ Tcl_ScanObjCmd(
Tcl_UniChar ch = 0, sch = 0;
Tcl_Obj **objs = NULL, *objPtr = NULL;
int flags;
+ (void)dummy;
if (objc < 3) {
Tcl_WrongNumArgs(interp, 1, objv,
@@ -602,7 +605,7 @@ Tcl_ScanObjCmd(
*/
if (totalVars > 0) {
- objs = Tcl_Alloc(sizeof(Tcl_Obj *) * totalVars);
+ objs = (Tcl_Obj **)Tcl_Alloc(sizeof(Tcl_Obj *) * totalVars);
for (i = 0; i < totalVars; i++) {
objs[i] = NULL;
}
diff --git a/generic/tclStrToD.c b/generic/tclStrToD.c
index 9028ff4..68a3c4e 100644
--- a/generic/tclStrToD.c
+++ b/generic/tclStrToD.c
@@ -2273,13 +2273,13 @@ FormatInfAndNaN(
*decpt = 9999;
if (!(d->w.word1) && !(d->w.word0 & HI_ORDER_SIG_MASK)) {
- retval = Tcl_Alloc(9);
+ retval = (char *)Tcl_Alloc(9);
strcpy(retval, "Infinity");
if (endPtr) {
*endPtr = retval + 8;
}
} else {
- retval = Tcl_Alloc(4);
+ retval = (char *)Tcl_Alloc(4);
strcpy(retval, "NaN");
if (endPtr) {
*endPtr = retval + 3;
@@ -2310,7 +2310,7 @@ FormatZero(
int *decpt, /* Location of the decimal point. */
char **endPtr) /* Pointer to the end of the formatted data */
{
- char *retval = Tcl_Alloc(2);
+ char *retval = (char *)Tcl_Alloc(2);
strcpy(retval, "0");
if (endPtr) {
@@ -2856,7 +2856,7 @@ QuickConversion(
* Handle the peculiar case where the result has no significant digits.
*/
- retval = Tcl_Alloc(len + 1);
+ retval = (char *)Tcl_Alloc(len + 1);
if (ilim == 0) {
d -= 5.;
if (d > eps.d) {
@@ -2967,7 +2967,7 @@ ShorteningInt64Conversion(
char **endPtr) /* OUTPUT: Position of the terminal '\0' at
* the end of the returned string. */
{
- char *retval = Tcl_Alloc(len + 1);
+ char *retval = (char *)Tcl_Alloc(len + 1);
/* Output buffer. */
Tcl_WideUInt b = (bw * wuipow5[b5]) << b2;
/* Numerator of the fraction being
@@ -3131,7 +3131,7 @@ StrictInt64Conversion(
char **endPtr) /* OUTPUT: Position of the terminal '\0' at
* the end of the returned string. */
{
- char *retval = Tcl_Alloc(len + 1);
+ char *retval = (char *)Tcl_Alloc(len + 1);
/* Output buffer. */
Tcl_WideUInt b = (bw * wuipow5[b5]) << b2;
/* Numerator of the fraction being
@@ -3142,6 +3142,7 @@ StrictInt64Conversion(
int digit; /* Current output digit. */
char *s = retval; /* Cursor in the output buffer. */
int i; /* Current position in the output buffer. */
+ (void)dPtr;
/*
* Adjust if the logarithm was guessed wrong.
@@ -3331,7 +3332,7 @@ ShorteningBignumConversionPowD(
char **endPtr) /* OUTPUT: Position of the terminal '\0' at
* the end of the returned string. */
{
- char *retval = Tcl_Alloc(len + 1);
+ char *retval = (char *)Tcl_Alloc(len + 1);
/* Output buffer. */
mp_int b; /* Numerator of the fraction being
* converted. */
@@ -3539,7 +3540,7 @@ StrictBignumConversionPowD(
char **endPtr) /* OUTPUT: Position of the terminal '\0' at
* the end of the returned string. */
{
- char *retval = Tcl_Alloc(len + 1);
+ char *retval = (char *)Tcl_Alloc(len + 1);
/* Output buffer. */
mp_int b; /* Numerator of the fraction being
* converted. */
@@ -3547,6 +3548,7 @@ StrictBignumConversionPowD(
char *s = retval; /* Cursor in the output buffer. */
int i; /* Index in the output buffer. */
mp_err err;
+ (void)dPtr;
/*
* b = bw * 2**b2 * 5**b5
@@ -3739,7 +3741,7 @@ ShorteningBignumConversion(
int *decpt, /* OUTPUT: Position of the decimal point. */
char **endPtr) /* OUTPUT: Pointer to the end of the number */
{
- char *retval = Tcl_Alloc(len+1);
+ char *retval = (char *)Tcl_Alloc(len+1);
/* Buffer of digits to return. */
char *s = retval; /* Cursor in the return value. */
mp_int b; /* Numerator of the result. */
@@ -3974,7 +3976,7 @@ StrictBignumConversion(
int *decpt, /* OUTPUT: Position of the decimal point. */
char **endPtr) /* OUTPUT: Pointer to the end of the number */
{
- char *retval = Tcl_Alloc(len+1);
+ char *retval = (char *)Tcl_Alloc(len+1);
/* Buffer of digits to return. */
char *s = retval; /* Cursor in the return value. */
mp_int b; /* Numerator of the result. */
@@ -3984,6 +3986,7 @@ StrictBignumConversion(
int g; /* Size of the current digit ground. */
int i, j;
mp_err err;
+ (void)dPtr;
/*
* b = bw * 2**b2 * 5**b5
diff --git a/generic/tclStringObj.c b/generic/tclStringObj.c
index d78112f..da391dc 100644
--- a/generic/tclStringObj.c
+++ b/generic/tclStringObj.c
@@ -142,7 +142,7 @@ GrowStringBuffer(
}
if (flag == 0 || stringPtr->allocated > 0) {
attempt = 2 * needed;
- ptr = Tcl_AttemptRealloc(objPtr->bytes, attempt + 1);
+ ptr = (char *)Tcl_AttemptRealloc(objPtr->bytes, attempt + 1);
if (ptr == NULL) {
/*
* Take care computing the amount of modest growth to avoid
@@ -154,7 +154,7 @@ GrowStringBuffer(
size_t growth = (extra > limit) ? limit : extra;
attempt = needed + growth;
- ptr = Tcl_AttemptRealloc(objPtr->bytes, attempt + 1);
+ ptr = (char *)Tcl_AttemptRealloc(objPtr->bytes, attempt + 1);
}
}
if (ptr == NULL) {
@@ -163,7 +163,7 @@ GrowStringBuffer(
*/
attempt = needed;
- ptr = Tcl_Realloc(objPtr->bytes, attempt + 1);
+ ptr = (char *)Tcl_Realloc(objPtr->bytes, attempt + 1);
}
objPtr->bytes = ptr;
stringPtr->allocated = attempt;
@@ -337,6 +337,9 @@ Tcl_DbNewStringObj(
int line) /* Line number in the source file; used for
* debugging. */
{
+ (void)file;
+ (void)line;
+
return Tcl_NewStringObj(bytes, length);
}
#endif /* TCL_MEM_DEBUG */
@@ -830,9 +833,9 @@ Tcl_SetObjLength(
* Need to enlarge the buffer.
*/
if (objPtr->bytes == &tclEmptyString) {
- objPtr->bytes = Tcl_Alloc(length + 1);
+ objPtr->bytes = (char *)Tcl_Alloc(length + 1);
} else {
- objPtr->bytes = Tcl_Realloc(objPtr->bytes, length + 1);
+ objPtr->bytes = (char *)Tcl_Realloc(objPtr->bytes, length + 1);
}
stringPtr->allocated = length;
}
@@ -923,9 +926,9 @@ Tcl_AttemptSetObjLength(
char *newBytes;
if (objPtr->bytes == &tclEmptyString) {
- newBytes = Tcl_AttemptAlloc(length + 1);
+ newBytes = (char *)Tcl_AttemptAlloc(length + 1);
} else {
- newBytes = Tcl_AttemptRealloc(objPtr->bytes, length + 1);
+ newBytes = (char *)Tcl_AttemptRealloc(objPtr->bytes, length + 1);
}
if (newBytes == NULL) {
return 0;
@@ -3478,7 +3481,7 @@ TclStringFirst(
* starting at check and stopping when there's not enough room
* for the needle left.
*/
- check = memchr(check, bn[0], (end + 1 - ln) - check);
+ check = (unsigned char *)memchr(check, bn[0], (end + 1 - ln) - check);
if (check == NULL) {
/* Leading byte not found -> needle cannot be found. */
return TCL_IO_FAILURE;
@@ -4056,9 +4059,11 @@ DupStringInternalRep(
static int
SetStringFromAny(
- Tcl_Interp *interp, /* Used for error reporting if not NULL. */
+ Tcl_Interp *dummy, /* Not used. */
Tcl_Obj *objPtr) /* The object to convert. */
{
+ (void)dummy;
+
if (!TclHasIntRep(objPtr, &tclStringType)) {
String *stringPtr = stringAlloc(0);
diff --git a/generic/tclTest.c b/generic/tclTest.c
index 7cdcf0e..ba0b220 100644
--- a/generic/tclTest.c
+++ b/generic/tclTest.c
@@ -37,7 +37,6 @@
/*
* Declare external functions used in Windows tests.
*/
-
DLLEXPORT int Tcltest_Init(Tcl_Interp *interp);
DLLEXPORT int Tcltest_SafeInit(Tcl_Interp *interp);
@@ -227,7 +226,7 @@ static int TestbumpinterpepochObjCmd(ClientData clientData,
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,
@@ -852,6 +851,7 @@ TestasyncCmd(
TestAsyncHandler *asyncPtr, *prevPtr;
int id, code;
static int nextId = 1;
+ (void)dummy;
if (argc < 2) {
wrongNumArgs:
@@ -862,8 +862,8 @@ TestasyncCmd(
if (argc != 3) {
goto wrongNumArgs;
}
- asyncPtr = Tcl_Alloc(sizeof(TestAsyncHandler));
- asyncPtr->command = Tcl_Alloc(strlen(argv[2]) + 1);
+ asyncPtr = (TestAsyncHandler *)Tcl_Alloc(sizeof(TestAsyncHandler));
+ asyncPtr->command = (char *)Tcl_Alloc(strlen(argv[2]) + 1);
strcpy(asyncPtr->command, argv[2]);
Tcl_MutexLock(&asyncTestMutex);
asyncPtr->id = nextId;
@@ -1061,6 +1061,8 @@ TestbumpinterpepochObjCmd(
Tcl_Obj *const objv[]) /* Argument objects. */
{
Interp *iPtr = (Interp *)interp;
+ (void)dummy;
+
if (objc != 1) {
Tcl_WrongNumArgs(interp, 1, objv, "");
return TCL_ERROR;
@@ -1096,6 +1098,7 @@ TestcmdinfoCmd(
const char **argv) /* Argument strings. */
{
Tcl_CmdInfo info;
+ (void)dummy;
if (argc != 3) {
Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
@@ -1166,6 +1169,9 @@ CmdProc1(
int argc, /* Number of arguments. */
const char **argv) /* Argument strings. */
{
+ (void)argc;
+ (void)argv;
+
Tcl_AppendResult(interp, "CmdProc1 ", (char *) clientData, NULL);
return TCL_OK;
}
@@ -1178,6 +1184,9 @@ CmdProc2(
int argc, /* Number of arguments. */
const char **argv) /* Argument strings. */
{
+ (void)argc;
+ (void)argv;
+
Tcl_AppendResult(interp, "CmdProc2 ", (char *) clientData, NULL);
return TCL_OK;
}
@@ -1228,6 +1237,7 @@ TestcmdtokenCmd(
Tcl_Command token;
int *l;
char buf[30];
+ (void)dummy;
if (argc != 3) {
Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
@@ -1291,6 +1301,7 @@ TestcmdtraceCmd(
{
Tcl_DString buffer;
int result;
+ (void)dummy;
if (argc != 3) {
Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
@@ -1388,6 +1399,10 @@ CmdTraceProc(
{
Tcl_DString *bufPtr = (Tcl_DString *) clientData;
int i;
+ (void)interp;
+ (void)level;
+ (void)cmdProc;
+ (void)cmdClientData;
Tcl_DStringAppendElement(bufPtr, command);
@@ -1400,7 +1415,7 @@ CmdTraceProc(
static void
CmdTraceDeleteProc(
- void *clientData, /* Unused. */
+ void *dummy, /* Unused. */
Tcl_Interp *interp, /* Current interpreter. */
int level, /* Current trace level. */
char *command, /* The command being traced (after
@@ -1411,6 +1426,14 @@ CmdTraceDeleteProc(
int argc, /* Number of arguments. */
const char *argv[]) /* Argument strings. */
{
+ (void)dummy;
+ (void)level;
+ (void)command;
+ (void)cmdProc;
+ (void)cmdClientData;
+ (void)argc;
+ (void)argv;
+
/*
* Remove ourselves to test whether calling Tcl_DeleteTrace within a trace
* callback causes the for loop in TclNRExecuteByteCode that calls traces to
@@ -1422,7 +1445,7 @@ CmdTraceDeleteProc(
static int
ObjTraceProc(
- void *clientData, /* unused */
+ void *dummy, /* unused */
Tcl_Interp *interp, /* Tcl interpreter */
int level, /* Execution level */
const char *command, /* Command being executed */
@@ -1431,6 +1454,11 @@ ObjTraceProc(
Tcl_Obj *const objv[]) /* Parameter list */
{
const char *word = Tcl_GetString(objv[0]);
+ (void)dummy;
+ (void)level;
+ (void)token;
+ (void)objc;
+ (void)objv;
if (!strcmp(word, "Error")) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(command, -1));
@@ -1484,6 +1512,8 @@ TestcreatecommandCmd(
int argc, /* Number of arguments. */
const char **argv) /* Argument strings. */
{
+ (void)dummy;
+
if (argc != 2) {
Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
" option\"", NULL);
@@ -1509,13 +1539,16 @@ TestcreatecommandCmd(
static int
CreatedCommandProc(
- void *clientData, /* String to return. */
+ void *dummy, /* String to return. */
Tcl_Interp *interp, /* Current interpreter. */
int argc, /* Number of arguments. */
const char **argv) /* Argument strings. */
{
Tcl_CmdInfo info;
int found;
+ (void)dummy;
+ (void)argc;
+ (void)argv;
found = Tcl_GetCommandInfo(interp, "test_ns_basic::createdcommand",
&info);
@@ -1531,13 +1564,16 @@ CreatedCommandProc(
static int
CreatedCommandProc2(
- void *clientData, /* String to return. */
+ void *dummy, /* String to return. */
Tcl_Interp *interp, /* Current interpreter. */
int argc, /* Number of arguments. */
const char **argv) /* Argument strings. */
{
Tcl_CmdInfo info;
int found;
+ (void)dummy;
+ (void)argc;
+ (void)argv;
found = Tcl_GetCommandInfo(interp, "value:at:", &info);
if (!found) {
@@ -1576,6 +1612,7 @@ TestdcallCmd(
const char **argv) /* Argument strings. */
{
int i, id;
+ (void)dummy;
delInterp = Tcl_CreateInterp();
Tcl_DStringInit(&delString);
@@ -1642,6 +1679,7 @@ TestdelCmd(
{
DelCmd *dPtr;
Tcl_Interp *slave;
+ (void)dummy;
if (argc != 4) {
Tcl_AppendResult(interp, "wrong # args", NULL);
@@ -1653,9 +1691,9 @@ TestdelCmd(
return TCL_ERROR;
}
- dPtr = Tcl_Alloc(sizeof(DelCmd));
+ dPtr = (DelCmd*)Tcl_Alloc(sizeof(DelCmd));
dPtr->interp = interp;
- dPtr->deleteCmd = Tcl_Alloc(strlen(argv[3]) + 1);
+ dPtr->deleteCmd = (char *)Tcl_Alloc(strlen(argv[3]) + 1);
strcpy(dPtr->deleteCmd, argv[3]);
Tcl_CreateCommand(slave, argv[2], DelCmdProc, dPtr,
@@ -1671,6 +1709,8 @@ DelCmdProc(
const char **argv) /* Argument strings. */
{
DelCmd *dPtr = (DelCmd *) clientData;
+ (void)argc;
+ (void)argv;
Tcl_AppendResult(interp, dPtr->deleteCmd, NULL);
Tcl_Free(dPtr->deleteCmd);
@@ -1682,7 +1722,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);
@@ -1710,11 +1750,13 @@ DelDeleteProc(
static int
TestdelassocdataCmd(
- void *clientData, /* Not used. */
+ void *dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int argc, /* Number of arguments. */
const char **argv) /* Argument strings. */
{
+ (void)dummy;
+
if (argc != 2) {
Tcl_AppendResult(interp, "wrong # arguments: should be \"", argv[0],
" data_key\"", NULL);
@@ -1746,7 +1788,7 @@ TestdelassocdataCmd(
*/
static int
-TestdoubledigitsObjCmd(void *unused,
+TestdoubledigitsObjCmd(void *dummy,
/* NULL */
Tcl_Interp* interp,
/* Tcl interpreter */
@@ -1778,6 +1820,7 @@ TestdoubledigitsObjCmd(void *unused,
char* endPtr;
Tcl_Obj* strObj;
Tcl_Obj* retval;
+ (void)dummy;
if (objc < 4 || objc > 5) {
Tcl_WrongNumArgs(interp, 1, objv, "fpval ndigits type ?shorten?");
@@ -1844,6 +1887,7 @@ TestdstringCmd(
const char **argv) /* Argument strings. */
{
int count;
+ (void)dummy;
if (argc < 2) {
wrongNumArgs:
@@ -1887,7 +1931,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 = Tcl_Alloc(100);
+ char *s = (char *)Tcl_Alloc(100);
strcpy(s, "This is a malloc-ed string");
Tcl_SetResult(interp, s, TCL_DYNAMIC);
} else if (strcmp(argv[2], "special") == 0) {
@@ -1939,9 +1983,9 @@ TestdstringCmd(
* Tcl_DStringGetResult handles freeProc's other than free.
*/
-static void SpecialFree(blockPtr)
- void *blockPtr; /* Block to free. */
-{
+static void SpecialFree(
+ void *blockPtr /* Block to free. */
+) {
Tcl_Free(((char *)blockPtr) - 16);
}
@@ -1980,6 +2024,7 @@ TestencodingObjCmd(
enum options {
ENC_CREATE, ENC_DELETE
};
+ (void)dummy;
if (Tcl_GetIndexFromObj(interp, objv[1], optionStrings, "option", 0,
&index) != TCL_OK) {
@@ -1993,15 +2038,15 @@ TestencodingObjCmd(
if (objc != 5) {
return TCL_ERROR;
}
- encodingPtr = Tcl_Alloc(sizeof(TclEncoding));
+ encodingPtr = (TclEncoding*)Tcl_Alloc(sizeof(TclEncoding));
encodingPtr->interp = interp;
string = Tcl_GetStringFromObj(objv[3], &length);
- encodingPtr->toUtfCmd = Tcl_Alloc(length + 1);
+ encodingPtr->toUtfCmd = (char *)Tcl_Alloc(length + 1);
memcpy(encodingPtr->toUtfCmd, string, length + 1);
string = Tcl_GetStringFromObj(objv[4], &length);
- encodingPtr->fromUtfCmd = Tcl_Alloc(length + 1);
+ encodingPtr->fromUtfCmd = (char *)Tcl_Alloc(length + 1);
memcpy(encodingPtr->fromUtfCmd, string, length + 1);
string = Tcl_GetStringFromObj(objv[2], &length);
@@ -2046,6 +2091,9 @@ EncodingToUtfProc(
{
int len;
TclEncoding *encodingPtr;
+ (void)src;
+ (void)flags;
+ (void)statePtr;
encodingPtr = (TclEncoding *) clientData;
Tcl_EvalEx(encodingPtr->interp, encodingPtr->toUtfCmd, -1, TCL_EVAL_GLOBAL);
@@ -2078,6 +2126,9 @@ EncodingFromUtfProc(
{
int len;
TclEncoding *encodingPtr;
+ (void)src;
+ (void)flags;
+ (void)statePtr;
encodingPtr = (TclEncoding *) clientData;
Tcl_EvalEx(encodingPtr->interp, encodingPtr->fromUtfCmd, -1, TCL_EVAL_GLOBAL);
@@ -2099,7 +2150,7 @@ static void
EncodingFreeProc(
void *clientData) /* ClientData associated with type. */
{
- TclEncoding *encodingPtr = clientData;
+ TclEncoding *encodingPtr = (TclEncoding *)clientData;
Tcl_Free(encodingPtr->toUtfCmd);
Tcl_Free(encodingPtr->fromUtfCmd);
@@ -2132,6 +2183,7 @@ TestevalexObjCmd(
{
int length, flags;
const char *script;
+ (void)dummy;
flags = 0;
if (objc == 3) {
@@ -2176,6 +2228,7 @@ TestevalobjvObjCmd(
Tcl_Obj *const objv[]) /* Argument objects. */
{
int evalGlobal;
+ (void)dummy;
if (objc < 3) {
Tcl_WrongNumArgs(interp, 1, objv, "global word ?word ...?");
@@ -2219,7 +2272,7 @@ TestevalobjvObjCmd(
static int
TesteventObjCmd(
- void *unused, /* Not used */
+ void *dummy, /* Not used */
Tcl_Interp *interp, /* Tcl interpreter */
int objc, /* Parameter count */
Tcl_Obj *const objv[]) /* Parameter vector */
@@ -2239,6 +2292,7 @@ TesteventObjCmd(
TCL_QUEUE_MARK
};
TestEvent *ev; /* Event to be queued */
+ (void)dummy;
if (objc < 2) {
Tcl_WrongNumArgs(interp, 1, objv, "subcommand ?arg ...?");
@@ -2258,7 +2312,7 @@ TesteventObjCmd(
"position specifier", TCL_EXACT, &posIndex) != TCL_OK) {
return TCL_ERROR;
}
- ev = Tcl_Alloc(sizeof(TestEvent));
+ ev = (TestEvent *)Tcl_Alloc(sizeof(TestEvent));
ev->header.proc = TesteventProc;
ev->header.nextPtr = NULL;
ev->interp = interp;
@@ -2312,6 +2366,7 @@ TesteventProc(
int result = Tcl_EvalObjEx(interp, command,
TCL_EVAL_GLOBAL | TCL_EVAL_DIRECT);
int retval;
+ (void)flags;
if (result != TCL_OK) {
Tcl_AddErrorInfo(interp,
@@ -2398,12 +2453,13 @@ TesteventDeleteProc(
static int
TestexithandlerCmd(
- void *clientData, /* Not used. */
+ void *dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int argc, /* Number of arguments. */
const char **argv) /* Argument strings. */
{
int value;
+ (void)dummy;
if (argc != 3) {
Tcl_AppendResult(interp, "wrong # arguments: should be \"", argv[0],
@@ -2474,7 +2530,7 @@ ExitProcEven(
static int
TestexprlongCmd(
- void *clientData, /* Not used. */
+ void *dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int argc, /* Number of arguments. */
const char **argv) /* Argument strings. */
@@ -2482,6 +2538,7 @@ TestexprlongCmd(
long exprResult;
char buf[4 + TCL_INTEGER_SPACE];
int result;
+ (void)dummy;
if (argc != 2) {
Tcl_AppendResult(interp, "wrong # arguments: should be \"", argv[0],
@@ -2517,7 +2574,7 @@ TestexprlongCmd(
static int
TestexprlongobjCmd(
- void *clientData, /* Not used. */
+ void *dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const *objv) /* Argument objects. */
@@ -2525,6 +2582,7 @@ TestexprlongobjCmd(
long exprResult;
char buf[4 + TCL_INTEGER_SPACE];
int result;
+ (void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "expression");
@@ -2559,7 +2617,7 @@ TestexprlongobjCmd(
static int
TestexprdoubleCmd(
- void *clientData, /* Not used. */
+ void *dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int argc, /* Number of arguments. */
const char **argv) /* Argument strings. */
@@ -2567,6 +2625,7 @@ TestexprdoubleCmd(
double exprResult;
char buf[4 + TCL_DOUBLE_SPACE];
int result;
+ (void)dummy;
if (argc != 2) {
Tcl_AppendResult(interp, "wrong # arguments: should be \"", argv[0],
@@ -2603,7 +2662,7 @@ TestexprdoubleCmd(
static int
TestexprdoubleobjCmd(
- void *clientData, /* Not used. */
+ void *dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const *objv) /* Argument objects. */
@@ -2611,6 +2670,7 @@ TestexprdoubleobjCmd(
double exprResult;
char buf[4 + TCL_DOUBLE_SPACE];
int result;
+ (void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "expression");
@@ -2645,11 +2705,13 @@ TestexprdoubleobjCmd(
static int
TestexprstringCmd(
- void *clientData, /* Not used. */
+ void *dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int argc, /* Number of arguments. */
const char **argv) /* Argument strings. */
{
+ (void)dummy;
+
if (argc != 2) {
Tcl_AppendResult(interp, "wrong # arguments: should be \"", argv[0],
" expression\"", NULL);
@@ -2677,12 +2739,13 @@ TestexprstringCmd(
static int
TestfilelinkCmd(
- void *clientData, /* Not used. */
+ void *dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* The argument objects. */
{
Tcl_Obj *contents;
+ (void)dummy;
if (objc < 2 || objc > 3) {
Tcl_WrongNumArgs(interp, 1, objv, "source ?target?");
@@ -2744,12 +2807,13 @@ TestfilelinkCmd(
static int
TestgetassocdataCmd(
- void *clientData, /* Not used. */
+ void *dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int argc, /* Number of arguments. */
const char **argv) /* Argument strings. */
{
char *res;
+ (void)dummy;
if (argc != 2) {
Tcl_AppendResult(interp, "wrong # arguments: should be \"", argv[0],
@@ -2782,13 +2846,14 @@ TestgetassocdataCmd(
static int
TestgetplatformCmd(
- void *clientData, /* Not used. */
+ void *dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int argc, /* Number of arguments. */
const char **argv) /* Argument strings. */
{
static const char *const platformStrings[] = { "unix", "mac", "windows" };
TclPlatformType *platform;
+ (void)dummy;
platform = TclGetPlatform();
@@ -2829,6 +2894,7 @@ TestinterpdeleteCmd(
const char **argv) /* Argument strings. */
{
Tcl_Interp *slaveToDelete;
+ (void)dummy;
if (argc != 2) {
Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
@@ -2887,6 +2953,7 @@ TestlinkCmd(
char buffer[2*TCL_DOUBLE_SPACE];
int writable, flag;
Tcl_Obj *tmp;
+ (void)dummy;
if (argc < 2) {
Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
@@ -3116,7 +3183,7 @@ TestlinkCmd(
if (strcmp(argv[5], "-") == 0) {
stringVar = NULL;
} else {
- stringVar = Tcl_Alloc(strlen(argv[5]) + 1);
+ stringVar = (char *)Tcl_Alloc(strlen(argv[5]) + 1);
strcpy(stringVar, argv[5]);
}
}
@@ -3223,7 +3290,7 @@ TestlinkCmd(
if (strcmp(argv[5], "-") == 0) {
stringVar = NULL;
} else {
- stringVar = Tcl_Alloc(strlen(argv[5]) + 1);
+ stringVar = (char *)Tcl_Alloc(strlen(argv[5]) + 1);
strcpy(stringVar, argv[5]);
}
Tcl_UpdateLinkedVar(interp, "string");
@@ -3332,7 +3399,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. */
@@ -3356,6 +3423,7 @@ TestlinkarrayCmd(
int optionIndex, typeIndex, readonly, i, size, length;
char *name, *arg;
Tcl_WideInt addr;
+ (void)dummy;
if (objc < 2) {
Tcl_WrongNumArgs(interp, 1, objv, "option args");
@@ -3450,14 +3518,13 @@ TestlinkarrayCmd(
static int
TestlocaleCmd(
- void *clientData, /* Not used. */
+ void *dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* The argument objects. */
{
int index;
const char *locale;
-
static const char *const optionStrings[] = {
"ctype", "numeric", "time", "collate", "monetary",
"all", NULL
@@ -3466,6 +3533,7 @@ TestlocaleCmd(
LC_CTYPE, LC_NUMERIC, LC_TIME, LC_COLLATE, LC_MONETARY,
LC_ALL
};
+ (void)dummy;
/*
* LC_CTYPE, etc. correspond to the indices for the strings.
@@ -3513,8 +3581,10 @@ TestlocaleCmd(
static void
CleanupTestSetassocdataTests(
void *clientData, /* Data to be released. */
- Tcl_Interp *interp) /* Interpreter being deleted. */
+ Tcl_Interp *dummy) /* Interpreter being deleted. */
{
+ (void)dummy;
+
Tcl_Free(clientData);
}
@@ -3537,7 +3607,7 @@ CleanupTestSetassocdataTests(
static int
TestparserObjCmd(
- void *clientData, /* Not used. */
+ void *dummy1, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* The argument objects. */
@@ -3545,6 +3615,7 @@ TestparserObjCmd(
const char *script;
int length, dummy;
Tcl_Parse parse;
+ (void)dummy1;
if (objc != 3) {
Tcl_WrongNumArgs(interp, 1, objv, "script length");
@@ -3593,7 +3664,7 @@ TestparserObjCmd(
static int
TestexprparserObjCmd(
- void *clientData, /* Not used. */
+ void *dummy1, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* The argument objects. */
@@ -3601,6 +3672,7 @@ TestexprparserObjCmd(
const char *script;
int length, dummy;
Tcl_Parse parse;
+ (void)dummy1;
if (objc != 3) {
Tcl_WrongNumArgs(interp, 1, objv, "expr length");
@@ -3740,12 +3812,13 @@ PrintParse(
static int
TestparsevarObjCmd(
- void *clientData, /* Not used. */
+ void *dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* The argument objects. */
{
const char *value, *name, *termPtr;
+ (void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "varName");
@@ -3781,7 +3854,7 @@ TestparsevarObjCmd(
static int
TestparsevarnameObjCmd(
- void *clientData, /* Not used. */
+ void *dummy1, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* The argument objects. */
@@ -3789,6 +3862,7 @@ TestparsevarnameObjCmd(
const char *script;
int append, length, dummy;
Tcl_Parse parse;
+ (void)dummy1;
if (objc != 4) {
Tcl_WrongNumArgs(interp, 1, objv, "script length append");
@@ -3844,12 +3918,16 @@ TestparsevarnameObjCmd(
static int
TestpreferstableObjCmd(
- void *clientData, /* Not used. */
+ void *dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* The argument objects. */
{
Interp *iPtr = (Interp *) interp;
+ (void)dummy;
+ (void)objc;
+ (void)objv;
+
iPtr->packagePrefer = PKG_PREFER_STABLE;
return TCL_OK;
}
@@ -3873,13 +3951,14 @@ TestpreferstableObjCmd(
static int
TestprintObjCmd(
- void *clientData, /* Not used. */
+ void *dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* The argument objects. */
{
Tcl_WideInt argv1 = 0;
size_t argv2;
+ (void)dummy;
if (objc < 2 || objc > 3) {
Tcl_WrongNumArgs(interp, 1, objv, "format wideint");
@@ -3939,6 +4018,7 @@ TestregexpObjCmd(
REGEXP_XFLAGS,
REGEXP_LAST
};
+ (void)dummy;
indices = 0;
about = 0;
@@ -4246,6 +4326,11 @@ TestreturnObjCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
+ (void)dummy;
+ (void)interp;
+ (void)objc;
+ (void)objv;
+
return TCL_RETURN;
}
@@ -4269,13 +4354,14 @@ TestreturnObjCmd(
static int
TestsetassocdataCmd(
- void *clientData, /* Not used. */
+ void *dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int argc, /* Number of arguments. */
const char **argv) /* Argument strings. */
{
char *buf, *oldData;
Tcl_InterpDeleteProc *procPtr;
+ (void)dummy;
if (argc != 3) {
Tcl_AppendResult(interp, "wrong # arguments: should be \"", argv[0],
@@ -4283,7 +4369,7 @@ TestsetassocdataCmd(
return TCL_ERROR;
}
- buf = Tcl_Alloc(strlen(argv[2]) + 1);
+ buf = (char *)Tcl_Alloc(strlen(argv[2]) + 1);
strcpy(buf, argv[2]);
/*
@@ -4320,13 +4406,14 @@ TestsetassocdataCmd(
static int
TestsetplatformCmd(
- void *clientData, /* Not used. */
+ void *dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int argc, /* Number of arguments. */
const char **argv) /* Argument strings. */
{
size_t length;
TclPlatformType *platform;
+ (void)dummy;
platform = TclGetPlatform();
@@ -4375,6 +4462,7 @@ TeststaticpkgCmd(
const char **argv) /* Argument strings. */
{
int safe, loaded;
+ (void)dummy;
if (argc != 4) {
Tcl_AppendResult(interp, "wrong # arguments: should be \"",
@@ -4427,6 +4515,7 @@ TesttranslatefilenameCmd(
{
Tcl_DString buffer;
const char *result;
+ (void)dummy;
if (argc != 2) {
Tcl_AppendResult(interp, "wrong # arguments: should be \"",
@@ -4468,6 +4557,7 @@ TestupvarCmd(
const char **argv) /* Argument strings. */
{
int flags = 0;
+ (void)dummy;
if ((argc != 5) && (argc != 6)) {
Tcl_AppendResult(interp, "wrong # arguments: should be \"",
@@ -4520,6 +4610,8 @@ TestseterrorcodeCmd(
int argc, /* Number of arguments. */
const char **argv) /* Argument strings. */
{
+ (void)dummy;
+
if (argc > 6) {
Tcl_AppendResult(interp, "too many args", NULL);
return TCL_ERROR;
@@ -4573,6 +4665,8 @@ TestsetobjerrorcodeCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* The argument objects. */
{
+ (void)dummy;
+
Tcl_SetObjErrorCode(interp, Tcl_ConcatObj(objc - 1, objv + 1));
return TCL_ERROR;
}
@@ -4597,7 +4691,7 @@ TestsetobjerrorcodeCmd(
/* ARGSUSED */
static int
TestfeventCmd(
- void *clientData, /* Not used. */
+ void *dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int argc, /* Number of arguments. */
const char **argv) /* Argument strings. */
@@ -4605,6 +4699,7 @@ TestfeventCmd(
static Tcl_Interp *interp2 = NULL;
int code;
Tcl_Channel chan;
+ (void)dummy;
if (argc < 2) {
Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
@@ -4675,6 +4770,8 @@ TestpanicCmd(
const char **argv) /* Argument strings. */
{
char *argString;
+ (void)dummy;
+ (void)interp;
/*
* Put the arguments into a var args structure
@@ -4698,6 +4795,7 @@ TestfileCmd(
int force, i, j, result;
Tcl_Obj *error = NULL;
const char *subcmd;
+ (void)dummy;
if (argc < 3) {
return TCL_ERROR;
@@ -4782,6 +4880,7 @@ TestgetvarfullnameCmd(
Tcl_Namespace *namespacePtr;
Tcl_CallFrame *framePtr;
Tcl_Var variable;
+ (void)dummy;
if (objc != 3) {
Tcl_WrongNumArgs(interp, 1, objv, "name scope");
@@ -4846,10 +4945,10 @@ TestgetvarfullnameCmd(
static int
GetTimesObjCmd(
- void *unused, /* Unused. */
+ void *dummy, /* Unused. */
Tcl_Interp *interp, /* The current interpreter. */
- int notused1, /* Number of arguments. */
- Tcl_Obj *const notused2[]) /* The argument objects. */
+ int cobjc, /* Number of arguments. */
+ Tcl_Obj *const cobjv[]) /* The argument objects. */
{
Interp *iPtr = (Interp *) interp;
int i, n;
@@ -4858,12 +4957,15 @@ GetTimesObjCmd(
Tcl_Obj *objPtr, **objv;
const char *s;
char newString[TCL_INTEGER_SPACE];
+ (void)dummy;
+ (void)cobjc;
+ (void)cobjv;
/* alloc & free 100000 times */
fprintf(stderr, "alloc & free 100000 6 word items\n");
Tcl_GetTime(&start);
for (i = 0; i < 100000; i++) {
- objPtr = Tcl_Alloc(sizeof(Tcl_Obj));
+ objPtr = (Tcl_Obj *)Tcl_Alloc(sizeof(Tcl_Obj));
Tcl_Free(objPtr);
}
Tcl_GetTime(&stop);
@@ -4872,10 +4974,10 @@ GetTimesObjCmd(
/* alloc 5000 times */
fprintf(stderr, "alloc 5000 6 word items\n");
- objv = Tcl_Alloc(5000 * sizeof(Tcl_Obj *));
+ objv = (Tcl_Obj **)Tcl_Alloc(5000 * sizeof(Tcl_Obj *));
Tcl_GetTime(&start);
for (i = 0; i < 5000; i++) {
- objv[i] = Tcl_Alloc(sizeof(Tcl_Obj));
+ objv[i] = (Tcl_Obj *)Tcl_Alloc(sizeof(Tcl_Obj));
}
Tcl_GetTime(&stop);
timePer = (stop.sec - start.sec)*1000000 + (stop.usec - start.usec);
@@ -5025,11 +5127,16 @@ GetTimesObjCmd(
static int
NoopCmd(
- void *unused, /* Unused. */
+ void *dummy, /* Unused. */
Tcl_Interp *interp, /* The current interpreter. */
int argc, /* The number of arguments. */
const char **argv) /* The argument strings. */
{
+ (void)dummy;
+ (void)interp;
+ (void)argc;
+ (void)argv;
+
return TCL_OK;
}
@@ -5052,11 +5159,16 @@ NoopCmd(
static int
NoopObjCmd(
- void *unused, /* Not used. */
+ void *dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* The argument objects. */
{
+ (void)dummy;
+ (void)interp;
+ (void)objc;
+ (void)objv;
+
return TCL_OK;
}
@@ -5077,13 +5189,14 @@ NoopObjCmd(
static int
TeststringbytesObjCmd(
- void *unused, /* Not used. */
+ void *dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* The argument objects. */
{
int n;
const unsigned char *p;
+ (void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "value");
@@ -5117,12 +5230,13 @@ TeststringbytesObjCmd(
static int
TestpurebytesobjObjCmd(
- ClientData unused, /* Not used. */
+ void *dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* The argument objects. */
{
Tcl_Obj *objPtr;
+ (void)dummy;
if (objc > 2) {
Tcl_WrongNumArgs(interp, 1, objv, "?string?");
@@ -5137,7 +5251,7 @@ TestpurebytesobjObjCmd(
if (objc == 2) {
const char *s = Tcl_GetString(objv[1]);
objPtr->length = objv[1]->length;
- objPtr->bytes = Tcl_Alloc(objPtr->length + 1);
+ objPtr->bytes = (char *)Tcl_Alloc(objPtr->length + 1);
memcpy(objPtr->bytes, s, objPtr->length);
objPtr->bytes[objPtr->length] = 0;
}
@@ -5164,13 +5278,14 @@ TestpurebytesobjObjCmd(
static int
TestbytestringObjCmd(
- void *unused, /* Not used. */
+ void *dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* The argument objects. */
{
int n = 0;
const char *p;
+ (void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "bytearray");
@@ -5302,6 +5417,7 @@ TestsaveresultCmd(
enum options {
RESULT_APPEND, RESULT_DYNAMIC, RESULT_FREE, RESULT_OBJECT, RESULT_SMALL
};
+ (void)dummy;
/*
* Parse arguments
@@ -5329,7 +5445,7 @@ TestsaveresultCmd(
Tcl_AppendResult(interp, "append result", NULL);
break;
case RESULT_FREE: {
- char *buf = Tcl_Alloc(200);
+ char *buf = (char *)Tcl_Alloc(200);
strcpy(buf, "free result");
Tcl_SetResult(interp, buf, TCL_DYNAMIC);
@@ -5393,6 +5509,7 @@ static void
TestsaveresultFree(
void *blockPtr)
{
+ (void)blockPtr;
freeCount++;
}
@@ -5420,6 +5537,9 @@ TestmainthreadCmd(
int argc, /* Number of arguments. */
const char **argv) /* Argument strings. */
{
+ (void)dummy;
+ (void)argv;
+
if (argc == 1) {
Tcl_Obj *idObj = Tcl_NewWideIntObj((Tcl_WideInt)(size_t)Tcl_GetCurrentThread());
@@ -5481,9 +5601,14 @@ TestsetmainloopCmd(
int argc, /* Number of arguments. */
const char **argv) /* Argument strings. */
{
- exitMainLoop = 0;
- Tcl_SetMainLoop(MainLoop);
- return TCL_OK;
+ (void)dummy;
+ (void)interp;
+ (void)argc;
+ (void)argv;
+
+ exitMainLoop = 0;
+ Tcl_SetMainLoop(MainLoop);
+ return TCL_OK;
}
/*
@@ -5510,8 +5635,13 @@ TestexitmainloopCmd(
int argc, /* Number of arguments. */
const char **argv) /* Argument strings. */
{
- exitMainLoop = 1;
- return TCL_OK;
+ (void)dummy;
+ (void)interp;
+ (void)argc;
+ (void)argv;
+
+ exitMainLoop = 1;
+ return TCL_OK;
}
/*
@@ -5534,7 +5664,7 @@ TestexitmainloopCmd(
/* ARGSUSED */
static int
TestChannelCmd(
- void *clientData, /* Not used. */
+ void *dummy, /* Not used. */
Tcl_Interp *interp, /* Interpreter for result. */
int argc, /* Count of additional args. */
const char **argv) /* Additional arg strings. */
@@ -5550,6 +5680,7 @@ TestChannelCmd(
int IOQueued; /* How much IO is queued inside channel? */
char buf[TCL_INTEGER_SPACE];/* For sprintf. */
int mode; /* rw mode of the channel */
+ (void)dummy;
if (argc < 2) {
Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
@@ -5648,7 +5779,7 @@ TestChannelCmd(
/* Remember the channel in the pool of detached channels */
- det = Tcl_Alloc(sizeof(TestChannel));
+ det = (TestChannel *)Tcl_Alloc(sizeof(TestChannel));
det->chan = chan;
det->nextPtr = firstDetached;
firstDetached = det;
@@ -5840,7 +5971,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;
}
@@ -5881,7 +6012,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;
@@ -5938,7 +6069,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;
@@ -6014,6 +6145,7 @@ TestChannelEventCmd(
EventScriptRecord *esPtr, *prevEsPtr, *nextEsPtr;
const char *cmd;
int index, i, mask, len;
+ (void)dummy;
if ((argc < 3) || (argc > 5)) {
Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
@@ -6046,7 +6178,7 @@ TestChannelEventCmd(
return TCL_ERROR;
}
- esPtr = Tcl_Alloc(sizeof(EventScriptRecord));
+ esPtr = (EventScriptRecord *)Tcl_Alloc(sizeof(EventScriptRecord));
esPtr->nextPtr = statePtr->scriptRecordPtr;
statePtr->scriptRecordPtr = esPtr;
@@ -6216,13 +6348,14 @@ TestChannelEventCmd(
/* ARGSUSED */
static int
TestSocketCmd(
- void *clientData, /* Not used. */
+ void *dummy, /* Not used. */
Tcl_Interp *interp, /* Interpreter for result. */
int argc, /* Count of additional args. */
const char **argv) /* Additional arg strings. */
{
const char *cmdName; /* Sub command. */
size_t len; /* Length of subcommand string. */
+ (void)dummy;
if (argc < 2) {
Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
@@ -6290,6 +6423,7 @@ TestWrongNumArgsObjCmd(
{
int i, length;
const char *msg;
+ (void)dummy;
if (objc < 3) {
/*
@@ -6348,6 +6482,7 @@ TestGetIndexFromObjStructObjCmd(
"a", "b", "c", "d", "e", "f", NULL, NULL
};
int idx,target;
+ (void)dummy;
if (objc != 3) {
Tcl_WrongNumArgs(interp, 1, objv, "argument targetvalue");
@@ -6400,6 +6535,7 @@ TestFilesystemObjCmd(
{
int res, boolVal;
const char *msg;
+ (void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "boolean");
@@ -6472,7 +6608,7 @@ TestReportFreeInternalRep(
}
}
-static ClientData
+static void *
TestReportDupInternalRep(
void *clientData)
{
@@ -6729,10 +6865,12 @@ TestReportUtime(
static int
TestReportNormalizePath(
- Tcl_Interp *interp,
+ Tcl_Interp *dummy,
Tcl_Obj *pathPtr,
int nextCheckpoint)
{
+ (void)dummy;
+
TestReport("normalizepath", pathPtr, NULL);
return nextCheckpoint;
}
@@ -6740,9 +6878,10 @@ TestReportNormalizePath(
static int
SimplePathInFilesystem(
Tcl_Obj *pathPtr,
- void **clientDataPtr)
+ void **dummy)
{
const char *str = Tcl_GetString(pathPtr);
+ (void)dummy;
if (strncmp(str, "simplefs:/", 10)) {
return -1;
@@ -6776,6 +6915,7 @@ TestSimpleFilesystemObjCmd(
{
int res, boolVal;
const char *msg;
+ (void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "boolean");
@@ -6929,11 +7069,13 @@ SimpleListVolumes(void)
static int
TestNumUtfCharsCmd(
- void *clientData,
+ void *dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
{
+ (void)dummy;
+
if (objc > 1) {
int len = -1;
@@ -6952,11 +7094,13 @@ TestNumUtfCharsCmd(
static int
TestFindFirstCmd(
- void *clientData,
+ void *dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
{
+ (void)dummy;
+
if (objc > 1) {
int len = -1;
@@ -6974,11 +7118,13 @@ TestFindFirstCmd(
static int
TestFindLastCmd(
- void *clientData,
+ void *dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
{
+ (void)dummy;
+
if (objc > 1) {
int len = -1;
@@ -7024,6 +7170,7 @@ TestcpuidCmd(
int status, index, i;
int regs[4];
Tcl_Obj *regsObjs[4];
+ (void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "eax");
@@ -7052,7 +7199,7 @@ TestcpuidCmd(
static int
TestHashSystemHashCmd(
- void *clientData,
+ void *dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
@@ -7064,6 +7211,7 @@ TestHashSystemHashCmd(
Tcl_HashTable hash;
Tcl_HashEntry *hPtr;
int i, isNew, limit = 100;
+ (void)dummy;
if (objc>1 && Tcl_GetIntFromObj(interp, objv[1], &limit)!=TCL_OK) {
return TCL_ERROR;
@@ -7133,6 +7281,8 @@ TestgetintCmd(
int argc,
const char **argv)
{
+ (void)dummy;
+
if (argc < 2) {
Tcl_AppendResult(interp, "wrong # args", NULL);
return TCL_ERROR;
@@ -7160,6 +7310,9 @@ TestlongsizeCmd(
int argc,
const char **argv)
{
+ (void)dummy;
+ (void)argv;
+
if (argc != 1) {
Tcl_AppendResult(interp, "wrong # args", NULL);
return TCL_ERROR;
@@ -7175,6 +7328,7 @@ NREUnwind_callback(
int result)
{
int none;
+ (void)result;
if (data[0] == INT2PTR(-1)) {
Tcl_NRAddCallback(interp, NREUnwind_callback, &none, INT2PTR(-1),
@@ -7197,11 +7351,14 @@ NREUnwind_callback(
static int
TestNREUnwind(
- void *clientData,
+ void *dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
{
+ (void)dummy;
+ (void)objc;
+ (void)objv;
/*
* Insure that callbacks effectively run at the proper level during the
* unwinding of the NRE stack.
@@ -7215,7 +7372,7 @@ TestNREUnwind(
static int
TestNRELevels(
- void *clientData,
+ void *dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
@@ -7226,6 +7383,9 @@ TestNRELevels(
Tcl_Obj *levels[6];
int i = 0;
NRE_callback *cbPtr = iPtr->execEnvPtr->callbackPtr;
+ (void)dummy;
+ (void)objc;
+ (void)objv;
if (refDepth == NULL) {
refDepth = &depth;
@@ -7279,6 +7439,9 @@ TestconcatobjCmd(
Tcl_Obj *list1Ptr, *list2Ptr, *emptyPtr, *concatPtr, *tmpPtr;
int result = TCL_OK, len;
Tcl_Obj *objv[3];
+ (void)dummy;
+ (void)argc;
+ (void)argv;
/*
* Set the start of the error message as obj result; it will be cleared at
@@ -7567,11 +7730,13 @@ TestconcatobjCmd(
static int
TestgetencpathObjCmd(
- ClientData clientData, /* Not used. */
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const *objv) /* Argument strings. */
{
+ (void)dummy;
+
if (objc != 1) {
Tcl_WrongNumArgs(interp, 1, objv, "");
return TCL_ERROR;
@@ -7600,11 +7765,13 @@ TestgetencpathObjCmd(
static int
TestsetencpathObjCmd(
- ClientData clientData, /* Not used. */
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const *objv) /* Argument strings. */
{
+ (void)dummy;
+
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "defaultDir");
return TCL_ERROR;
@@ -7646,6 +7813,7 @@ TestparseargsCmd(
{TCL_ARGV_CONSTANT, "-bool", INT2PTR(1), &foo, "booltest", NULL},
TCL_ARGV_AUTO_REST, TCL_ARGV_AUTO_HELP, TCL_ARGV_TABLE_END
};
+ (void)dummy;
foo = 0;
if (Tcl_ParseArgsObjv(interp, argTable, &count, objv, &remObjv)!=TCL_OK) {
@@ -7677,6 +7845,8 @@ InterpCmdResolver(
varFramePtr->procPtr : NULL;
Namespace *callerNsPtr = varFramePtr->nsPtr;
Tcl_Command resolvedCmdPtr = NULL;
+ (void)context;
+ (void)flags;
/*
* Just do something special on a cmd literal "z" in two cases:
@@ -7764,6 +7934,12 @@ InterpVarResolver(
int flags,
Tcl_Var *rPtr)
{
+ (void)interp;
+ (void)name;
+ (void)context;
+ (void)flags;
+ (void)rPtr;
+
/*
* Don't resolve the variable; use standard rules.
*/
@@ -7851,14 +8027,18 @@ MyCompiledVarFetch(
static int
InterpCompiledVarResolver(
- Tcl_Interp *interp,
+ Tcl_Interp *dummy,
const char *name,
int length,
Tcl_Namespace *context,
Tcl_ResolvedVarInfo **rPtr)
{
+ (void)dummy;
+ (void)length;
+ (void)context;
+
if (*name == 'T') {
- MyResolvedVarInfo *resVarInfo = Tcl_Alloc(sizeof(MyResolvedVarInfo));
+ MyResolvedVarInfo *resVarInfo = (MyResolvedVarInfo *)Tcl_Alloc(sizeof(MyResolvedVarInfo));
resVarInfo->vInfo.fetchProc = MyCompiledVarFetch;
resVarInfo->vInfo.deleteProc = MyCompiledVarFree;
@@ -7873,7 +8053,7 @@ InterpCompiledVarResolver(
static int
TestInterpResolverCmd(
- void *clientData,
+ void *dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
@@ -7883,6 +8063,7 @@ TestInterpResolverCmd(
};
int idx;
#define RESOLVER_KEY "testInterpResolver"
+ (void)dummy;
if ((objc < 2) || (objc > 3)) {
Tcl_WrongNumArgs(interp, 1, objv, "up|down ?interp?");
diff --git a/generic/tclTestObj.c b/generic/tclTestObj.c
index 1e35a75..98d1a15 100644
--- a/generic/tclTestObj.c
+++ b/generic/tclTestObj.c
@@ -34,28 +34,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)
{
int i;
Tcl_Obj **varPtr = (Tcl_Obj **) clientData;
@@ -150,7 +150,7 @@ TclObjTest_Init(
static int
TestbignumobjCmd(
- ClientData clientData, /* unused */
+ void *dummy, /* unused */
Tcl_Interp *interp, /* Tcl interpreter */
int objc, /* Argument count */
Tcl_Obj *const objv[]) /* Argument vector */
@@ -166,6 +166,7 @@ TestbignumobjCmd(
const char *string;
mp_int bignumValue;
Tcl_Obj **varPtr;
+ (void)dummy;
if (objc < 3) {
Tcl_WrongNumArgs(interp, 1, objv, "option ?arg ...?");
@@ -349,7 +350,7 @@ TestbignumobjCmd(
static int
TestbooleanobjCmd(
- ClientData clientData, /* Not used. */
+ void *dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
@@ -357,6 +358,7 @@ TestbooleanobjCmd(
int varIndex, boolValue;
const char *index, *subCmd;
Tcl_Obj **varPtr;
+ (void)dummy;
if (objc < 3) {
wrongNumArgs:
@@ -449,7 +451,7 @@ TestbooleanobjCmd(
static int
TestdoubleobjCmd(
- ClientData clientData, /* Not used. */
+ void *dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
@@ -458,6 +460,7 @@ TestdoubleobjCmd(
double doubleValue;
const char *index, *subCmd, *string;
Tcl_Obj **varPtr;
+ (void)dummy;
if (objc < 3) {
wrongNumArgs:
@@ -567,7 +570,7 @@ TestdoubleobjCmd(
static int
TestindexobjCmd(
- ClientData clientData, /* Not used. */
+ void *dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
@@ -575,6 +578,7 @@ TestindexobjCmd(
int allowAbbrev, index, index2, setError, i, result;
const char **argv;
static const char *const tablePtr[] = {"a", "b", "check", NULL};
+
/*
* Keep this structure declaration in sync with tclIndexObj.c
*/
@@ -584,6 +588,7 @@ TestindexobjCmd(
size_t index; /* Selected index into table. */
};
struct IndexRep *indexRep;
+ (void)dummy;
if ((objc == 3) && (strcmp(Tcl_GetString(objv[1]),
"check") == 0)) {
@@ -598,7 +603,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);
@@ -620,7 +625,7 @@ TestindexobjCmd(
return TCL_ERROR;
}
- argv = Tcl_Alloc((objc-3) * sizeof(char *));
+ argv = (const char **)Tcl_Alloc((objc-3) * sizeof(char *));
for (i = 4; i < objc; i++) {
argv[i-4] = Tcl_GetString(objv[i]);
}
@@ -656,7 +661,7 @@ TestindexobjCmd(
static int
TestintobjCmd(
- ClientData clientData, /* Not used. */
+ void *dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
@@ -665,6 +670,7 @@ TestintobjCmd(
Tcl_WideInt wideValue;
const char *index, *subCmd, *string;
Tcl_Obj **varPtr;
+ (void)dummy;
if (objc < 3) {
wrongNumArgs:
@@ -860,7 +866,7 @@ TestintobjCmd(
static int
TestlistobjCmd(
- ClientData clientData, /* Not used */
+ void *dummy, /* Not used */
Tcl_Interp *interp, /* Tcl interpreter */
int objc, /* Number of arguments */
Tcl_Obj *const objv[]) /* Argument objects */
@@ -883,6 +889,7 @@ TestlistobjCmd(
int first; /* First index in the list */
int count; /* Count of elements in a list */
Tcl_Obj **varPtr;
+ (void)dummy;
if (objc < 3) {
Tcl_WrongNumArgs(interp, 1, objv, "option arg ?arg...?");
@@ -957,7 +964,7 @@ TestlistobjCmd(
static int
TestobjCmd(
- ClientData clientData, /* Not used. */
+ void *dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
@@ -966,6 +973,7 @@ TestobjCmd(
const char *index, *subCmd, *string;
const Tcl_ObjType *targetType;
Tcl_Obj **varPtr;
+ (void)dummy;
if (objc < 2) {
wrongNumArgs:
@@ -1169,7 +1177,7 @@ TestobjCmd(
static int
TeststringobjCmd(
- ClientData clientData, /* Not used. */
+ void *dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
@@ -1185,6 +1193,7 @@ TeststringobjCmd(
"set", "set2", "setlength", "maxchars", "appendself",
"appendself2", NULL
};
+ (void)dummy;
if (objc < 3) {
wrongNumArgs:
@@ -1287,7 +1296,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;
@@ -1341,7 +1350,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 68c6c62..76a4279 100644
--- a/generic/tclTestProcBodyObj.c
+++ b/generic/tclTestProcBodyObj.c
@@ -45,9 +45,9 @@ typedef struct {
* 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,
@@ -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 */
@@ -240,6 +240,7 @@ ProcBodyTestProcObjCmd(
Tcl_Obj *bodyObjPtr;
Tcl_Obj *myobjv[5];
int result;
+ (void)dummy;
if (objc != 4) {
Tcl_WrongNumArgs(interp, 1, objv, "newName argsList bodyName");
@@ -327,12 +328,13 @@ 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 */
{
const char *version;
+ (void)dummy;
if (objc != 1) {
Tcl_WrongNumArgs(interp, 1, objv, "");
diff --git a/generic/tclThread.c b/generic/tclThread.c
index 45b0af2..0aa668e 100644
--- a/generic/tclThread.c
+++ b/generic/tclThread.c
@@ -164,7 +164,7 @@ RememberSyncObject(
if (recPtr->num >= recPtr->max) {
recPtr->max += 8;
- newList = Tcl_Alloc(recPtr->max * sizeof(void *));
+ newList = (void **)Tcl_Alloc(recPtr->max * sizeof(void *));
for (i=0,j=0 ; i<recPtr->num ; i++) {
if (recPtr->list[i] != NULL) {
newList[j++] = recPtr->list[i];
diff --git a/generic/tclThreadAlloc.c b/generic/tclThreadAlloc.c
index c2a94f6..fda42f8 100644
--- a/generic/tclThreadAlloc.c
+++ b/generic/tclThreadAlloc.c
@@ -134,7 +134,7 @@ static void LockBucket(Cache *cachePtr, int bucket);
static void UnlockBucket(Cache *cachePtr, int bucket);
static void PutBlocks(Cache *cachePtr, int bucket, int numMove);
static int GetBlocks(Cache *cachePtr, int bucket);
-static Block * Ptr2Block(char *ptr);
+static Block * Ptr2Block(void *ptr);
static char * Block2Ptr(Block *blockPtr, int bucket, unsigned int reqSize);
static void MoveObjs(Cache *fromPtr, Cache *toPtr, int numMove);
static void PutObjs(Cache *fromPtr, int numMove);
@@ -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));
+ cachePtr = (Cache*)TclpSysAlloc(sizeof(Cache));
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;
unsigned int bucket;
@@ -324,7 +324,7 @@ TclpAlloc(
#endif
if (size > MAXALLOC) {
bucket = NBUCKETS;
- blockPtr = TclpSysAlloc(size);
+ blockPtr = (Block *)TclpSysAlloc(size);
if (blockPtr != NULL) {
cachePtr->totalAssigned += reqSize;
}
@@ -465,7 +465,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;
}
@@ -484,7 +484,7 @@ TclpRealloc(
memcpy(newPtr, ptr, reqSize);
TclpFree(ptr);
}
- return newPtr;
+ return (char *)newPtr;
}
/*
@@ -537,7 +537,7 @@ TclThreadAllocObj(void)
Tcl_Obj *newObjsPtr;
cachePtr->numObjects = numMove = NOBJALLOC;
- newObjsPtr = TclpSysAlloc(sizeof(Tcl_Obj) * numMove);
+ newObjsPtr = (Tcl_Obj *)TclpSysAlloc(sizeof(Tcl_Obj) * numMove);
if (newObjsPtr == NULL) {
Tcl_Panic("alloc: could not allocate %d new objects", numMove);
}
@@ -556,7 +556,7 @@ TclThreadAllocObj(void)
*/
objPtr = cachePtr->firstObjPtr;
- cachePtr->firstObjPtr = objPtr->internalRep.twoPtrValue.ptr1;
+ cachePtr->firstObjPtr = (Tcl_Obj *)objPtr->internalRep.twoPtrValue.ptr1;
cachePtr->numObjects--;
return objPtr;
}
@@ -695,9 +695,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
@@ -740,7 +740,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;
}
@@ -798,7 +798,7 @@ Block2Ptr(
static Block *
Ptr2Block(
- char *ptr)
+ void *ptr)
{
Block *blockPtr;
@@ -849,6 +849,8 @@ UnlockBucket(
Cache *cachePtr,
int bucket)
{
+ (void)cachePtr;
+
Tcl_MutexUnlock(bucketInfo[bucket].lockPtr);
}
@@ -1006,7 +1008,7 @@ GetBlocks(
if (blockPtr == NULL) {
size = MAXALLOC;
- blockPtr = TclpSysAlloc(size);
+ blockPtr = (Block*)TclpSysAlloc(size);
if (blockPtr == NULL) {
return 0;
}
@@ -1121,7 +1123,7 @@ TclFinalizeThreadAlloc(void)
void
TclFinalizeThreadAllocThread(void)
{
- Cache *cachePtr = TclpGetAllocCache();
+ Cache *cachePtr = (Cache *)TclpGetAllocCache();
if (cachePtr != NULL) {
TclpFreeAllocCache(cachePtr);
}
diff --git a/generic/tclThreadJoin.c b/generic/tclThreadJoin.c
index 66c54a0..483a6c0 100644
--- a/generic/tclThreadJoin.c
+++ b/generic/tclThreadJoin.c
@@ -230,7 +230,7 @@ TclRememberJoinableThread(
{
JoinableThread *threadPtr;
- threadPtr = Tcl_Alloc(sizeof(JoinableThread));
+ threadPtr = (JoinableThread *)Tcl_Alloc(sizeof(JoinableThread));
threadPtr->id = id;
threadPtr->done = 0;
threadPtr->waitedUpon = 0;
diff --git a/generic/tclThreadStorage.c b/generic/tclThreadStorage.c
index 339cc71..72f0c2f 100644
--- a/generic/tclThreadStorage.c
+++ b/generic/tclThreadStorage.c
@@ -85,14 +85,14 @@ TSDTableCreate(void)
TSDTable *tsdTablePtr;
sig_atomic_t i;
- tsdTablePtr = TclpSysAlloc(sizeof(TSDTable));
+ tsdTablePtr = (TSDTable *)TclpSysAlloc(sizeof(TSDTable));
if (tsdTablePtr == NULL) {
Tcl_Panic("unable to allocate TSDTable");
}
tsdTablePtr->allocated = 8;
tsdTablePtr->tablePtr =
- TclpSysAlloc(sizeof(void *) * tsdTablePtr->allocated);
+ (void **)TclpSysAlloc(sizeof(void *) * tsdTablePtr->allocated);
if (tsdTablePtr->tablePtr == NULL) {
Tcl_Panic("unable to allocate TSDTable");
}
@@ -148,15 +148,15 @@ TSDTableGrow(
sig_atomic_t atLeast)
{
sig_atomic_t newAllocated = tsdTablePtr->allocated * 2;
- ClientData *newTablePtr;
+ void **newTablePtr;
sig_atomic_t i;
if (newAllocated <= atLeast) {
newAllocated = atLeast + 10;
}
- newTablePtr = TclpSysRealloc(tsdTablePtr->tablePtr,
- sizeof(ClientData) * newAllocated);
+ newTablePtr = (void **)TclpSysRealloc(tsdTablePtr->tablePtr,
+ sizeof(void *) * newAllocated);
if (newTablePtr == NULL) {
Tcl_Panic("unable to reallocate TSDTable");
}
@@ -189,7 +189,7 @@ void *
TclThreadStorageKeyGet(
Tcl_ThreadDataKey *dataKeyPtr)
{
- TSDTable *tsdTablePtr = TclpThreadGetMasterTSD(tsdMaster.key);
+ TSDTable *tsdTablePtr = (TSDTable *)TclpThreadGetMasterTSD(tsdMaster.key);
ClientData resultPtr = NULL;
TSDUnion *keyPtr = (TSDUnion *) dataKeyPtr;
sig_atomic_t offset = keyPtr->offset;
@@ -223,7 +223,7 @@ TclThreadStorageKeySet(
Tcl_ThreadDataKey *dataKeyPtr,
void *value)
{
- TSDTable *tsdTablePtr = TclpThreadGetMasterTSD(tsdMaster.key);
+ TSDTable *tsdTablePtr = (TSDTable *)TclpThreadGetMasterTSD(tsdMaster.key);
TSDUnion *keyPtr = (TSDUnion *) dataKeyPtr;
if (tsdTablePtr == NULL) {
@@ -288,7 +288,7 @@ TclThreadStorageKeySet(
void
TclFinalizeThreadDataThread(void)
{
- TSDTable *tsdTablePtr = TclpThreadGetMasterTSD(tsdMaster.key);
+ TSDTable *tsdTablePtr = (TSDTable *)TclpThreadGetMasterTSD(tsdMaster.key);
if (tsdTablePtr != NULL) {
TSDTableDelete(tsdTablePtr);
diff --git a/generic/tclThreadTest.c b/generic/tclThreadTest.c
index 64858cb..f4687ea 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. */
@@ -223,6 +223,7 @@ ThreadObjCmd(
THREAD_ID, THREAD_JOIN, THREAD_NAMES, THREAD_SEND,
THREAD_WAIT, THREAD_ERRORPROC
};
+ (void)dummy;
if (objc < 2) {
Tcl_WrongNumArgs(interp, 1, objv, "option ?arg ...?");
@@ -435,7 +436,7 @@ ThreadObjCmd(
Tcl_Free(errorProcString);
}
proc = Tcl_GetString(objv[2]);
- errorProcString = Tcl_Alloc(strlen(proc) + 1);
+ errorProcString = (char *)Tcl_Alloc(strlen(proc) + 1);
strcpy(errorProcString, proc);
Tcl_MutexUnlock(&threadMutex);
return TCL_OK;
@@ -556,9 +557,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 +596,7 @@ NewTestThread(
* eval'ing, for the case that we exit during evaluation
*/
- threadEvalScript = Tcl_Alloc(strlen(ctrlPtr->script) + 1);
+ threadEvalScript = (char *)Tcl_Alloc(strlen(ctrlPtr->script) + 1);
strcpy(threadEvalScript, ctrlPtr->script);
Tcl_CreateThreadExitHandler(ThreadExitProc, threadEvalScript);
@@ -840,13 +841,13 @@ ThreadSend(
* Create the event for its event queue.
*/
- threadEventPtr = Tcl_Alloc(sizeof(ThreadEvent));
- threadEventPtr->script = Tcl_Alloc(strlen(script) + 1);
+ threadEventPtr = (ThreadEvent*)Tcl_Alloc(sizeof(ThreadEvent));
+ threadEventPtr->script = (char *)Tcl_Alloc(strlen(script) + 1);
strcpy(threadEventPtr->script, script);
if (!wait) {
resultPtr = threadEventPtr->resultPtr = NULL;
} else {
- resultPtr = Tcl_Alloc(sizeof(ThreadEventResult));
+ resultPtr = (ThreadEventResult *)Tcl_Alloc(sizeof(ThreadEventResult));
threadEventPtr->resultPtr = resultPtr;
/*
@@ -1018,6 +1019,7 @@ ThreadEventProc(
Tcl_Interp *interp = tsdPtr->interp;
int code;
const char *result, *errorCode, *errorInfo;
+ (void)mask;
if (interp == NULL) {
code = TCL_ERROR;
@@ -1042,14 +1044,14 @@ ThreadEventProc(
if (resultPtr) {
Tcl_MutexLock(&threadMutex);
resultPtr->code = code;
- resultPtr->result = Tcl_Alloc(strlen(result) + 1);
+ resultPtr->result = (char *)Tcl_Alloc(strlen(result) + 1);
strcpy(resultPtr->result, result);
if (errorCode != NULL) {
- resultPtr->errorCode = Tcl_Alloc(strlen(errorCode) + 1);
+ resultPtr->errorCode = (char *)Tcl_Alloc(strlen(errorCode) + 1);
strcpy(resultPtr->errorCode, errorCode);
}
if (errorInfo != NULL) {
- resultPtr->errorInfo = Tcl_Alloc(strlen(errorInfo) + 1);
+ resultPtr->errorInfo = (char *)Tcl_Alloc(strlen(errorInfo) + 1);
strcpy(resultPtr->errorInfo, errorInfo);
}
Tcl_ConditionNotify(&resultPtr->done);
@@ -1073,7 +1075,7 @@ ThreadEventProc(
* None.
*
* Side effects:
- * Clears up mem specified in ClientData
+ * Clears up mem specified in clientData
*
*------------------------------------------------------------------------
*/
@@ -1081,7 +1083,7 @@ ThreadEventProc(
/* ARGSUSED */
static void
ThreadFreeProc(
- ClientData clientData)
+ void *clientData)
{
if (clientData) {
Tcl_Free(clientData);
@@ -1109,8 +1111,10 @@ ThreadFreeProc(
static int
ThreadDeleteEvent(
Tcl_Event *eventPtr, /* Really ThreadEvent */
- ClientData clientData) /* dummy */
+ void *dummy) /* dummy */
{
+ (void)dummy;
+
if (eventPtr->proc == ThreadEventProc) {
Tcl_Free(((ThreadEvent *) eventPtr)->script);
return 1;
@@ -1144,9 +1148,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 +1203,7 @@ ThreadExitProc(
const char *msg = "target thread died";
- resultPtr->result = Tcl_Alloc(strlen(msg) + 1);
+ resultPtr->result = (char *)Tcl_Alloc(strlen(msg) + 1);
strcpy(resultPtr->result, msg);
resultPtr->code = TCL_ERROR;
Tcl_ConditionNotify(&resultPtr->done);
diff --git a/generic/tclTimer.c b/generic/tclTimer.c
index 5451614..837a8a3 100644
--- a/generic/tclTimer.c
+++ b/generic/tclTimer.c
@@ -182,7 +182,7 @@ static void TimerSetupProc(ClientData clientData, int flags);
static ThreadSpecificData *
InitTimer(void)
{
- ThreadSpecificData *tsdPtr = TclThreadDataKeyGet(&dataKey);
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)TclThreadDataKeyGet(&dataKey);
if (tsdPtr == NULL) {
tsdPtr = TCL_TSD_INIT(&dataKey);
@@ -211,9 +211,10 @@ InitTimer(void)
static void
TimerExitProc(
- ClientData clientData) /* Not used. */
+ ClientData dummy) /* Not used. */
{
- ThreadSpecificData *tsdPtr = TclThreadDataKeyGet(&dataKey);
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)TclThreadDataKeyGet(&dataKey);
+ (void)dummy;
Tcl_DeleteEventSource(TimerSetupProc, TimerCheckProc, NULL);
if (tsdPtr != NULL) {
@@ -297,7 +298,7 @@ TclCreateAbsoluteTimerHandler(
TimerHandler *timerHandlerPtr, *tPtr2, *prevPtr;
ThreadSpecificData *tsdPtr = InitTimer();
- timerHandlerPtr = Tcl_Alloc(sizeof(TimerHandler));
+ timerHandlerPtr = (TimerHandler *)Tcl_Alloc(sizeof(TimerHandler));
/*
* Fill in fields for the event.
@@ -398,11 +399,12 @@ Tcl_DeleteTimerHandler(
static void
TimerSetupProc(
- ClientData data, /* Not used. */
+ ClientData dummy, /* Not used. */
int flags) /* Event flags as passed to Tcl_DoOneEvent. */
{
Tcl_Time blockTime;
ThreadSpecificData *tsdPtr = InitTimer();
+ (void)dummy;
if (((flags & TCL_IDLE_EVENTS) && tsdPtr->idleList)
|| ((flags & TCL_TIMER_EVENTS) && tsdPtr->timerPending)) {
@@ -456,12 +458,13 @@ TimerSetupProc(
static void
TimerCheckProc(
- ClientData data, /* Not used. */
+ ClientData dummy, /* Not used. */
int flags) /* Event flags as passed to Tcl_DoOneEvent. */
{
Tcl_Event *timerEvPtr;
Tcl_Time blockTime;
ThreadSpecificData *tsdPtr = InitTimer();
+ (void)dummy;
if ((flags & TCL_TIMER_EVENTS) && tsdPtr->firstTimerHandlerPtr) {
/*
@@ -488,7 +491,7 @@ TimerCheckProc(
if (blockTime.sec == 0 && blockTime.usec == 0 &&
!tsdPtr->timerPending) {
tsdPtr->timerPending = 1;
- timerEvPtr = Tcl_Alloc(sizeof(Tcl_Event));
+ timerEvPtr = (Tcl_Event *)Tcl_Alloc(sizeof(Tcl_Event));
timerEvPtr->proc = TimerHandlerEventProc;
Tcl_QueueEvent(timerEvPtr, TCL_QUEUE_TAIL);
}
@@ -526,6 +529,7 @@ TimerHandlerEventProc(
Tcl_Time time;
int currentTimerId;
ThreadSpecificData *tsdPtr = InitTimer();
+ (void)evPtr;
/*
* Do nothing if timers aren't enabled. This leaves the event on the
@@ -625,7 +629,7 @@ Tcl_DoWhenIdle(
Tcl_Time blockTime;
ThreadSpecificData *tsdPtr = InitTimer();
- idlePtr = Tcl_Alloc(sizeof(IdleHandler));
+ idlePtr = (IdleHandler *)Tcl_Alloc(sizeof(IdleHandler));
idlePtr->proc = proc;
idlePtr->clientData = clientData;
idlePtr->generation = tsdPtr->idleGeneration;
@@ -779,7 +783,7 @@ TclServiceIdle(void)
/* ARGSUSED */
int
Tcl_AfterObjCmd(
- ClientData clientData, /* Unused */
+ ClientData dummy, /* Unused */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
@@ -795,6 +799,7 @@ Tcl_AfterObjCmd(
};
enum afterSubCmds {AFTER_CANCEL, AFTER_IDLE, AFTER_INFO};
ThreadSpecificData *tsdPtr = InitTimer();
+ (void)dummy;
if (objc < 2) {
Tcl_WrongNumArgs(interp, 1, objv, "option ?arg ...?");
@@ -806,9 +811,9 @@ Tcl_AfterObjCmd(
* doesn't already exist.
*/
- assocPtr = Tcl_GetAssocData(interp, "tclAfter", NULL);
+ assocPtr = (AfterAssocData *)Tcl_GetAssocData(interp, "tclAfter", NULL);
if (assocPtr == NULL) {
- assocPtr = Tcl_Alloc(sizeof(AfterAssocData));
+ assocPtr = (AfterAssocData *)Tcl_Alloc(sizeof(AfterAssocData));
assocPtr->interp = interp;
assocPtr->firstAfterPtr = NULL;
Tcl_SetAssocData(interp, "tclAfter", AfterCleanupProc, assocPtr);
@@ -845,7 +850,7 @@ Tcl_AfterObjCmd(
if (objc == 2) {
return AfterDelay(interp, ms);
}
- afterPtr = Tcl_Alloc(sizeof(AfterInfo));
+ afterPtr = (AfterInfo *)Tcl_Alloc(sizeof(AfterInfo));
afterPtr->assocPtr = assocPtr;
if (objc == 3) {
afterPtr->commandPtr = objv[2];
@@ -925,7 +930,7 @@ Tcl_AfterObjCmd(
Tcl_WrongNumArgs(interp, 2, objv, "script ?script ...?");
return TCL_ERROR;
}
- afterPtr = Tcl_Alloc(sizeof(AfterInfo));
+ afterPtr = (AfterInfo *)Tcl_Alloc(sizeof(AfterInfo));
afterPtr->assocPtr = assocPtr;
if (objc == 3) {
afterPtr->commandPtr = objv[2];
@@ -1150,7 +1155,7 @@ static void
AfterProc(
ClientData clientData) /* Describes command to execute. */
{
- AfterInfo *afterPtr = clientData;
+ AfterInfo *afterPtr = (AfterInfo *)clientData;
AfterAssocData *assocPtr = afterPtr->assocPtr;
AfterInfo *prevPtr;
int result;
@@ -1253,10 +1258,11 @@ static void
AfterCleanupProc(
ClientData clientData, /* Points to AfterAssocData for the
* interpreter. */
- Tcl_Interp *interp) /* Interpreter that is being deleted. */
+ Tcl_Interp *dummy) /* Interpreter that is being deleted. */
{
- AfterAssocData *assocPtr = clientData;
+ AfterAssocData *assocPtr = (AfterAssocData *)clientData;
AfterInfo *afterPtr;
+ (void)dummy;
while (assocPtr->firstAfterPtr != NULL) {
afterPtr = assocPtr->firstAfterPtr;
diff --git a/generic/tclTomMathDecls.h b/generic/tclTomMathDecls.h
index d6d8baf..973de52 100644
--- a/generic/tclTomMathDecls.h
+++ b/generic/tclTomMathDecls.h
@@ -56,9 +56,14 @@
# define MODULE_SCOPE extern
#endif
+#ifdef __cplusplus
+extern "C" {
+#endif
MODULE_SCOPE mp_err TclBN_mp_sqr(const mp_int *a, mp_int *b);
MODULE_SCOPE mp_err TclBN_mp_div_3(const mp_int *a, mp_int *q, mp_digit *r);
-
+#ifdef __cplusplus
+}
+#endif
/* Rename the global symbols in libtommath to avoid linkage conflicts */
diff --git a/generic/tclTrace.c b/generic/tclTrace.c
index c00bbe4..bf2d0d8 100644
--- a/generic/tclTrace.c
+++ b/generic/tclTrace.c
@@ -209,6 +209,7 @@ Tcl_TraceObjCmd(
TRACE_OLD_VARIABLE, TRACE_OLD_VDELETE, TRACE_OLD_VINFO
#endif
};
+ (void)dummy;
if (objc < 2) {
Tcl_WrongNumArgs(interp, 1, objv, "option ?arg ...?");
@@ -325,7 +326,7 @@ Tcl_TraceObjCmd(
resultListPtr = Tcl_NewObj();
name = TclGetString(objv[2]);
FOREACH_VAR_TRACE(interp, name, clientData) {
- TraceVarInfo *tvarPtr = clientData;
+ TraceVarInfo *tvarPtr = (TraceVarInfo *)clientData;
char *q = ops;
pairObjPtr = Tcl_NewListObj(0, NULL);
@@ -469,7 +470,7 @@ TraceExecutionObjCmd(
command = TclGetStringFromObj(objv[5], &commandLength);
length = commandLength;
if ((enum traceOptions) optionIndex == TRACE_ADD) {
- TraceCommandInfo *tcmdPtr = Tcl_Alloc(
+ TraceCommandInfo *tcmdPtr = (TraceCommandInfo *)Tcl_Alloc(
offsetof(TraceCommandInfo, command) + 1 + length);
tcmdPtr->flags = flags;
@@ -509,7 +510,7 @@ TraceExecutionObjCmd(
}
FOREACH_COMMAND_TRACE(interp, name, clientData) {
- TraceCommandInfo *tcmdPtr = clientData;
+ TraceCommandInfo *tcmdPtr = (TraceCommandInfo *)clientData;
/*
* In checking the 'flags' field we must remove any extraneous
@@ -578,7 +579,7 @@ TraceExecutionObjCmd(
FOREACH_COMMAND_TRACE(interp, name, clientData) {
int numOps = 0;
Tcl_Obj *opObj, *eachTraceObjPtr, *elemObjPtr;
- TraceCommandInfo *tcmdPtr = clientData;
+ TraceCommandInfo *tcmdPtr = (TraceCommandInfo *)clientData;
/*
* Build a list with the ops list as the first obj element and the
@@ -706,7 +707,7 @@ TraceCommandObjCmd(
command = TclGetStringFromObj(objv[5], &commandLength);
length = commandLength;
if ((enum traceOptions) optionIndex == TRACE_ADD) {
- TraceCommandInfo *tcmdPtr = Tcl_Alloc(
+ TraceCommandInfo *tcmdPtr = (TraceCommandInfo *)Tcl_Alloc(
offsetof(TraceCommandInfo, command) + 1 + length);
tcmdPtr->flags = flags;
@@ -742,7 +743,7 @@ TraceCommandObjCmd(
}
FOREACH_COMMAND_TRACE(interp, name, clientData) {
- TraceCommandInfo *tcmdPtr = clientData;
+ TraceCommandInfo *tcmdPtr = (TraceCommandInfo *)clientData;
if ((tcmdPtr->length == length) && (tcmdPtr->flags == flags)
&& (strncmp(command, tcmdPtr->command,
@@ -781,7 +782,7 @@ TraceCommandObjCmd(
FOREACH_COMMAND_TRACE(interp, name, clientData) {
int numOps = 0;
Tcl_Obj *opObj, *eachTraceObjPtr, *elemObjPtr;
- TraceCommandInfo *tcmdPtr = clientData;
+ TraceCommandInfo *tcmdPtr = (TraceCommandInfo *)clientData;
/*
* Build a list with the ops list as the first obj element and the
@@ -909,7 +910,7 @@ TraceVariableObjCmd(
command = TclGetStringFromObj(objv[5], &commandLength);
length = commandLength;
if ((enum traceOptions) optionIndex == TRACE_ADD) {
- CombinedTraceVarInfo *ctvarPtr = Tcl_Alloc(
+ CombinedTraceVarInfo *ctvarPtr = (CombinedTraceVarInfo *)Tcl_Alloc(
offsetof(CombinedTraceVarInfo, traceCmdInfo.command)
+ 1 + length);
@@ -940,7 +941,7 @@ TraceVariableObjCmd(
name = TclGetString(objv[3]);
FOREACH_VAR_TRACE(interp, name, clientData) {
- TraceVarInfo *tvarPtr = clientData;
+ TraceVarInfo *tvarPtr = (TraceVarInfo *)clientData;
if ((tvarPtr->length == length)
&& ((tvarPtr->flags
@@ -971,7 +972,7 @@ TraceVariableObjCmd(
name = TclGetString(objv[3]);
FOREACH_VAR_TRACE(interp, name, clientData) {
Tcl_Obj *opObjPtr, *eachTraceObjPtr, *elemObjPtr;
- TraceVarInfo *tvarPtr = clientData;
+ TraceVarInfo *tvarPtr = (TraceVarInfo *)clientData;
/*
* Build a list with the ops list as the first obj element and the
@@ -1050,6 +1051,7 @@ Tcl_CommandTraceInfo(
{
Command *cmdPtr;
CommandTrace *tracePtr;
+ (void)flags;
cmdPtr = (Command *) Tcl_FindCommand(interp, cmdName, NULL,
TCL_LEAVE_ERR_MSG);
@@ -1126,7 +1128,7 @@ Tcl_TraceCommand(
* Set up trace information.
*/
- tracePtr = Tcl_Alloc(sizeof(CommandTrace));
+ tracePtr = (CommandTrace *)Tcl_Alloc(sizeof(CommandTrace));
tracePtr->traceProc = proc;
tracePtr->clientData = clientData;
tracePtr->flags = flags &
@@ -1291,7 +1293,7 @@ TraceCommandProc(
int flags) /* OR-ed bits giving operation and other
* information. */
{
- TraceCommandInfo *tcmdPtr = clientData;
+ TraceCommandInfo *tcmdPtr = (TraceCommandInfo *)clientData;
int code;
Tcl_DString cmd;
@@ -1437,6 +1439,7 @@ TclCheckExecutionTraces(
int curLevel;
int traceCode = TCL_OK;
Tcl_InterpState state = NULL;
+ (void)numChars;
if (cmdPtr->tracePtr == NULL) {
return traceCode;
@@ -1469,7 +1472,7 @@ TclCheckExecutionTraces(
active.nextTracePtr = tracePtr->nextPtr;
}
if (tracePtr->traceProc == TraceCommandProc) {
- TraceCommandInfo *tcmdPtr = tracePtr->clientData;
+ TraceCommandInfo *tcmdPtr = (TraceCommandInfo *)tracePtr->clientData;
if (tcmdPtr->flags != 0) {
tcmdPtr->curFlags = traceFlags | TCL_TRACE_EXEC_DIRECT;
@@ -1610,7 +1613,7 @@ TclCheckInterpTraces(
if (tracePtr->flags & traceFlags) {
if (tracePtr->proc == TraceExecutionProc) {
- TraceCommandInfo *tcmdPtr = tracePtr->clientData;
+ TraceCommandInfo *tcmdPtr = (TraceCommandInfo *)tracePtr->clientData;
tcmdPtr->curFlags = traceFlags;
tcmdPtr->curCode = code;
@@ -1689,7 +1692,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';
@@ -1725,7 +1728,7 @@ static void
CommandObjTraceDeleted(
ClientData clientData)
{
- TraceCommandInfo *tcmdPtr = clientData;
+ TraceCommandInfo *tcmdPtr = (TraceCommandInfo *)clientData;
if (tcmdPtr->refCount-- <= 1) {
Tcl_Free(tcmdPtr);
@@ -1769,10 +1772,11 @@ TraceExecutionProc(
{
int call = 0;
Interp *iPtr = (Interp *) interp;
- TraceCommandInfo *tcmdPtr = clientData;
+ TraceCommandInfo *tcmdPtr = (TraceCommandInfo *)clientData;
int flags = tcmdPtr->curFlags;
int code = tcmdPtr->curCode;
int traceCode = TCL_OK;
+ (void)cmdInfo;
if (tcmdPtr->flags & TCL_TRACE_EXEC_IN_PROGRESS) {
/*
@@ -1920,10 +1924,10 @@ TraceExecutionProc(
if ((flags & TCL_TRACE_ENTER_EXEC) && (tcmdPtr->stepTrace == NULL)
&& (tcmdPtr->flags & (TCL_TRACE_ENTER_DURING_EXEC |
TCL_TRACE_LEAVE_DURING_EXEC))) {
- size_t len = strlen(command) + 1;
+ unsigned len = strlen(command) + 1;
tcmdPtr->startLevel = level;
- tcmdPtr->startCmd = Tcl_Alloc(len);
+ tcmdPtr->startCmd = (char *)Tcl_Alloc(len);
memcpy(tcmdPtr->startCmd, command, len);
tcmdPtr->refCount++;
tcmdPtr->stepTrace = Tcl_CreateObjTrace(interp, 0,
@@ -1975,7 +1979,7 @@ TraceVarProc(
int flags) /* OR-ed bits giving operation and other
* information. */
{
- TraceVarInfo *tvarPtr = clientData;
+ TraceVarInfo *tvarPtr = (TraceVarInfo *)clientData;
char *result;
int code, destroy = 0;
Tcl_DString cmd;
@@ -2167,7 +2171,7 @@ Tcl_CreateObjTrace(
iPtr->tracesForbiddingInline++;
}
- tracePtr = Tcl_Alloc(sizeof(Trace));
+ tracePtr = (Trace *)Tcl_Alloc(sizeof(Trace));
tracePtr->level = level;
tracePtr->proc = proc;
tracePtr->clientData = clientData;
@@ -2230,7 +2234,7 @@ Tcl_CreateTrace(
* command. */
ClientData clientData) /* Arbitrary value word to pass to proc. */
{
- StringTraceData *data = Tcl_Alloc(sizeof(StringTraceData));
+ StringTraceData *data = (StringTraceData *)Tcl_Alloc(sizeof(StringTraceData));
data->clientData = clientData;
data->proc = proc;
@@ -2264,7 +2268,7 @@ StringTraceProc(
int objc,
Tcl_Obj *const *objv)
{
- StringTraceData *data = clientData;
+ StringTraceData *data = (StringTraceData *)clientData;
Command *cmdPtr = (Command *) commandInfo;
const char **argv; /* Args to pass to string trace proc */
int i;
@@ -2655,7 +2659,7 @@ TclCallVarTraces(
&& (arrayPtr->flags & traceflags)) {
hPtr = Tcl_FindHashEntry(&iPtr->varTraces, (char *) arrayPtr);
active.varPtr = arrayPtr;
- for (tracePtr = Tcl_GetHashValue(hPtr);
+ for (tracePtr = (VarTrace *)Tcl_GetHashValue(hPtr);
tracePtr != NULL; tracePtr = active.nextTracePtr) {
active.nextTracePtr = tracePtr->nextPtr;
if (!(tracePtr->flags & flags)) {
@@ -2696,7 +2700,7 @@ TclCallVarTraces(
active.varPtr = varPtr;
if (varPtr->flags & traceflags) {
hPtr = Tcl_FindHashEntry(&iPtr->varTraces, (char *) varPtr);
- for (tracePtr = Tcl_GetHashValue(hPtr);
+ for (tracePtr = (VarTrace *)Tcl_GetHashValue(hPtr);
tracePtr != NULL; tracePtr = active.nextTracePtr) {
active.nextTracePtr = tracePtr->nextPtr;
if (!(tracePtr->flags & flags)) {
@@ -2896,7 +2900,7 @@ Tcl_UntraceVar2(
flags &= flagMask;
hPtr = Tcl_FindHashEntry(&iPtr->varTraces, (char *) varPtr);
- for (tracePtr = Tcl_GetHashValue(hPtr), prevPtr = NULL; ;
+ for (tracePtr = (VarTrace *)Tcl_GetHashValue(hPtr), prevPtr = NULL; ;
prevPtr = tracePtr, tracePtr = tracePtr->nextPtr) {
if (tracePtr == NULL) {
goto updateFlags;
@@ -3012,7 +3016,7 @@ Tcl_VarTraceInfo2(
hPtr = Tcl_FindHashEntry(&iPtr->varTraces, (char *) varPtr);
if (hPtr) {
- VarTrace *tracePtr = Tcl_GetHashValue(hPtr);
+ VarTrace *tracePtr = (VarTrace *)Tcl_GetHashValue(hPtr);
if (prevClientData != NULL) {
for (; tracePtr != NULL; tracePtr = tracePtr->nextPtr) {
@@ -3072,7 +3076,7 @@ Tcl_TraceVar2(
VarTrace *tracePtr;
int result;
- tracePtr = Tcl_Alloc(sizeof(VarTrace));
+ tracePtr = (VarTrace *)Tcl_Alloc(sizeof(VarTrace));
tracePtr->traceProc = proc;
tracePtr->clientData = clientData;
tracePtr->flags = flags;
@@ -3166,7 +3170,7 @@ TraceVarEx(
if (isNew) {
tracePtr->nextPtr = NULL;
} else {
- tracePtr->nextPtr = Tcl_GetHashValue(hPtr);
+ tracePtr->nextPtr = (VarTrace *)Tcl_GetHashValue(hPtr);
}
Tcl_SetHashValue(hPtr, tracePtr);
diff --git a/generic/tclUtil.c b/generic/tclUtil.c
index e1e2486..c8ba12e 100644
--- a/generic/tclUtil.c
+++ b/generic/tclUtil.c
@@ -870,7 +870,7 @@ Tcl_SplitList(
size = TclMaxListLength(list, -1, &end) + 1;
length = end - list;
- argv = Tcl_Alloc((size * sizeof(char *)) + length + 1);
+ argv = (const char **)Tcl_Alloc((size * sizeof(char *)) + length + 1);
for (i = 0, p = ((char *) argv) + size*sizeof(char *);
*list != 0; i++) {
@@ -1571,7 +1571,7 @@ Tcl_Merge(
*/
if (argc == 0) {
- result = Tcl_Alloc(1);
+ result = (char *)Tcl_Alloc(1);
result[0] = '\0';
return result;
}
@@ -1583,7 +1583,7 @@ Tcl_Merge(
if (argc <= LOCAL_SIZE) {
flagPtr = localFlags;
} else {
- flagPtr = Tcl_Alloc(argc);
+ flagPtr = (char *)Tcl_Alloc(argc);
}
for (i = 0; i < argc; i++) {
flagPtr[i] = ( i ? TCL_DONT_QUOTE_HASH : 0 );
@@ -1595,7 +1595,7 @@ Tcl_Merge(
* Pass two: copy into the result area.
*/
- result = Tcl_Alloc(bytesNeeded);
+ result = (char *)Tcl_Alloc(bytesNeeded);
dst = result;
for (i = 0; i < argc; i++) {
flagPtr[i] |= ( i ? TCL_DONT_QUOTE_HASH : 0 );
@@ -1954,7 +1954,7 @@ Tcl_Concat(
* All element bytes + (argc - 1) spaces + 1 terminating NULL.
*/
- result = Tcl_Alloc(bytesNeeded + argc);
+ result = (char *)Tcl_Alloc(bytesNeeded + argc);
for (p = result, i = 0; i < argc; i++) {
size_t triml, trimr, elemLength;
@@ -2386,6 +2386,7 @@ TclByteArrayMatch(
{
const unsigned char *stringEnd, *patternEnd;
unsigned char p;
+ (void)flags;
stringEnd = string + strLen;
patternEnd = pattern + ptnLen;
@@ -2659,7 +2660,7 @@ Tcl_DStringAppend(
if (newSize >= dsPtr->spaceAvl) {
dsPtr->spaceAvl = newSize * 2;
if (dsPtr->string == dsPtr->staticSpace) {
- char *newString = Tcl_Alloc(dsPtr->spaceAvl);
+ char *newString = (char *)Tcl_Alloc(dsPtr->spaceAvl);
memcpy(newString, dsPtr->string, dsPtr->length);
dsPtr->string = newString;
@@ -2672,7 +2673,7 @@ Tcl_DStringAppend(
index = bytes - dsPtr->string;
}
- dsPtr->string = Tcl_Realloc(dsPtr->string, dsPtr->spaceAvl);
+ dsPtr->string = (char *)Tcl_Realloc(dsPtr->string, dsPtr->spaceAvl);
if (index != TCL_INDEX_NONE) {
bytes = dsPtr->string + index;
@@ -2762,7 +2763,7 @@ Tcl_DStringAppendElement(
if (newSize >= dsPtr->spaceAvl) {
dsPtr->spaceAvl = newSize * 2;
if (dsPtr->string == dsPtr->staticSpace) {
- char *newString = Tcl_Alloc(dsPtr->spaceAvl);
+ char *newString = (char *)Tcl_Alloc(dsPtr->spaceAvl);
memcpy(newString, dsPtr->string, dsPtr->length);
dsPtr->string = newString;
@@ -2775,7 +2776,7 @@ Tcl_DStringAppendElement(
offset = element - dsPtr->string;
}
- dsPtr->string = Tcl_Realloc(dsPtr->string, dsPtr->spaceAvl);
+ dsPtr->string = (char *)Tcl_Realloc(dsPtr->string, dsPtr->spaceAvl);
if (offset >= 0) {
element = dsPtr->string + offset;
@@ -2852,12 +2853,12 @@ Tcl_DStringSetLength(
dsPtr->spaceAvl = length + 1;
}
if (dsPtr->string == dsPtr->staticSpace) {
- char *newString = Tcl_Alloc(dsPtr->spaceAvl);
+ char *newString = (char *)Tcl_Alloc(dsPtr->spaceAvl);
memcpy(newString, dsPtr->string, dsPtr->length);
dsPtr->string = newString;
} else {
- dsPtr->string = Tcl_Realloc(dsPtr->string, dsPtr->spaceAvl);
+ dsPtr->string = (char *)Tcl_Realloc(dsPtr->string, dsPtr->spaceAvl);
}
}
dsPtr->length = length;
@@ -3092,7 +3093,7 @@ Tcl_DStringEndSublist(
void
Tcl_PrintDouble(
- Tcl_Interp *interp, /* Not used */
+ Tcl_Interp *dummy, /* Not used. */
double value, /* Value to print as string. */
char *dst) /* Where to store converted value; must have
* at least TCL_DOUBLE_SPACE characters. */
@@ -3102,6 +3103,7 @@ Tcl_PrintDouble(
int signum;
char *digits;
char *end;
+ (void)dummy;
/*
* Handle NaN.
@@ -3859,7 +3861,7 @@ ClearHash(
for (hPtr = Tcl_FirstHashEntry(tablePtr, &search); hPtr != NULL;
hPtr = Tcl_NextHashEntry(&search)) {
- Tcl_Obj *objPtr = Tcl_GetHashValue(hPtr);
+ Tcl_Obj *objPtr = (Tcl_Obj *)Tcl_GetHashValue(hPtr);
Tcl_DecrRefCount(objPtr);
Tcl_DeleteHashEntry(hPtr);
@@ -3889,10 +3891,10 @@ GetThreadHash(
Tcl_ThreadDataKey *keyPtr)
{
Tcl_HashTable **tablePtrPtr =
- Tcl_GetThreadData(keyPtr, sizeof(Tcl_HashTable *));
+ (Tcl_HashTable **)Tcl_GetThreadData(keyPtr, sizeof(Tcl_HashTable *));
if (NULL == *tablePtrPtr) {
- *tablePtrPtr = Tcl_Alloc(sizeof(Tcl_HashTable));
+ *tablePtrPtr = (Tcl_HashTable *)Tcl_Alloc(sizeof(Tcl_HashTable));
Tcl_CreateThreadExitHandler(FreeThreadHash, *tablePtrPtr);
Tcl_InitHashTable(*tablePtrPtr, TCL_ONE_WORD_KEYS);
}
@@ -3917,7 +3919,7 @@ static void
FreeThreadHash(
ClientData clientData)
{
- Tcl_HashTable *tablePtr = clientData;
+ Tcl_HashTable *tablePtr = (Tcl_HashTable *)clientData;
ClearHash(tablePtr);
Tcl_DeleteHashTable(tablePtr);
@@ -3939,7 +3941,7 @@ static void
FreeProcessGlobalValue(
ClientData clientData)
{
- ProcessGlobalValue *pgvPtr = clientData;
+ ProcessGlobalValue *pgvPtr = (ProcessGlobalValue *)clientData;
pgvPtr->epoch++;
pgvPtr->numBytes = 0;
@@ -3988,7 +3990,7 @@ TclSetProcessGlobalValue(
}
bytes = TclGetString(newValue);
pgvPtr->numBytes = newValue->length;
- pgvPtr->value = Tcl_Alloc(pgvPtr->numBytes + 1);
+ pgvPtr->value = (char *)Tcl_Alloc(pgvPtr->numBytes + 1);
memcpy(pgvPtr->value, bytes, pgvPtr->numBytes + 1);
if (pgvPtr->encoding) {
Tcl_FreeEncoding(pgvPtr->encoding);
@@ -4052,7 +4054,7 @@ TclGetProcessGlobalValue(
Tcl_DStringLength(&native), &newValue);
Tcl_DStringFree(&native);
Tcl_Free(pgvPtr->value);
- pgvPtr->value = Tcl_Alloc(Tcl_DStringLength(&newValue) + 1);
+ pgvPtr->value = (char *)Tcl_Alloc(Tcl_DStringLength(&newValue) + 1);
memcpy(pgvPtr->value, Tcl_DStringValue(&newValue),
Tcl_DStringLength(&newValue) + 1);
Tcl_DStringFree(&newValue);
@@ -4102,7 +4104,7 @@ TclGetProcessGlobalValue(
Tcl_SetHashValue(hPtr, value);
Tcl_IncrRefCount(value);
}
- return Tcl_GetHashValue(hPtr);
+ return (Tcl_Obj *)Tcl_GetHashValue(hPtr);
}
/*
diff --git a/generic/tclVar.c b/generic/tclVar.c
index f520c36..5744132 100644
--- a/generic/tclVar.c
+++ b/generic/tclVar.c
@@ -268,7 +268,7 @@ static const Tcl_ObjType localVarNameType = {
do { \
const Tcl_ObjIntRep *irPtr; \
irPtr = TclFetchIntRep((objPtr), &localVarNameType); \
- (name) = irPtr ? irPtr->twoPtrValue.ptr1 : NULL; \
+ (name) = irPtr ? (Tcl_Obj *)irPtr->twoPtrValue.ptr1 : NULL; \
(index) = irPtr ? PTR2INT(irPtr->twoPtrValue.ptr2) : -1; \
} while (0)
@@ -294,8 +294,8 @@ static const Tcl_ObjType parsedVarNameType = {
const Tcl_ObjIntRep *irPtr; \
irPtr = TclFetchIntRep((objPtr), &parsedVarNameType); \
(parsed) = (irPtr != NULL); \
- (array) = irPtr ? irPtr->twoPtrValue.ptr1 : NULL; \
- (elem) = irPtr ? irPtr->twoPtrValue.ptr2 : NULL; \
+ (array) = irPtr ? (Tcl_Obj *)irPtr->twoPtrValue.ptr1 : NULL; \
+ (elem) = irPtr ? (Tcl_Obj *)irPtr->twoPtrValue.ptr2 : NULL; \
} while (0)
Var *
@@ -997,7 +997,7 @@ TclLookupSimpleVar(
tablePtr = varFramePtr->varTablePtr;
if (create) {
if (tablePtr == NULL) {
- tablePtr = Tcl_Alloc(sizeof(TclVarHashTable));
+ tablePtr = (TclVarHashTable *)Tcl_Alloc(sizeof(TclVarHashTable));
TclInitVarHashTable(tablePtr, NULL);
varFramePtr->varTablePtr = tablePtr;
}
@@ -1486,6 +1486,7 @@ Tcl_SetObjCmd(
Tcl_Obj *const objv[]) /* Argument objects. */
{
Tcl_Obj *varValueObj;
+ (void)dummy;
if (objc == 2) {
varValueObj = Tcl_ObjGetVar2(interp, objv[1], NULL,TCL_LEAVE_ERR_MSG);
@@ -2561,7 +2562,7 @@ UnsetVarStruct(
int isNew;
tPtr = Tcl_FindHashEntry(&iPtr->varTraces, varPtr);
- tracePtr = Tcl_GetHashValue(tPtr);
+ tracePtr = (VarTrace *)Tcl_GetHashValue(tPtr);
varPtr->flags &= ~VAR_ALL_TRACES;
Tcl_DeleteHashEntry(tPtr);
if (dummyVar.flags & VAR_TRACED_UNSET) {
@@ -2588,7 +2589,7 @@ UnsetVarStruct(
if (TclIsVarTraced(&dummyVar)) {
tPtr = Tcl_FindHashEntry(&iPtr->varTraces, &dummyVar);
if (tPtr) {
- tracePtr = Tcl_GetHashValue(tPtr);
+ tracePtr = (VarTrace *)Tcl_GetHashValue(tPtr);
Tcl_DeleteHashEntry(tPtr);
}
}
@@ -2684,6 +2685,7 @@ Tcl_UnsetObjCmd(
{
int i, flags = TCL_LEAVE_ERR_MSG;
const char *name;
+ (void)dummy;
if (objc == 1) {
/*
@@ -2754,6 +2756,7 @@ Tcl_AppendObjCmd(
Tcl_Obj *varValuePtr = NULL;
/* Initialized to avoid compiler warning. */
int i;
+ (void)dummy;
if (objc < 2) {
Tcl_WrongNumArgs(interp, 1, objv, "varName ?value ...?");
@@ -2820,6 +2823,7 @@ Tcl_LappendObjCmd(
int numElems, createdNewObj;
Var *varPtr, *arrayPtr;
int result;
+ (void)dummy;
if (objc < 2) {
Tcl_WrongNumArgs(interp, 1, objv, "varName ?value ...?");
@@ -3027,7 +3031,7 @@ ArrayForObjCmd(
static int
ArrayForNRCmd(
- ClientData dummy,
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp,
int objc,
Tcl_Obj *const *objv)
@@ -3036,6 +3040,7 @@ ArrayForNRCmd(
ArraySearch *searchPtr = NULL;
Var *varPtr;
int isArray, numVars;
+ (void)dummy;
/*
* array for {k v} a body
@@ -3075,7 +3080,7 @@ ArrayForNRCmd(
* Make a new array search, put it on the stack.
*/
- searchPtr = Tcl_Alloc(sizeof(ArraySearch));
+ searchPtr = (ArraySearch *)Tcl_Alloc(sizeof(ArraySearch));
ArrayPopulateSearch(interp, arrayNameObj, varPtr, searchPtr);
/*
@@ -3103,10 +3108,10 @@ ArrayForLoopCallback(
int result)
{
Interp *iPtr = (Interp *) interp;
- ArraySearch *searchPtr = data[0];
- Tcl_Obj *varListObj = data[1];
- Tcl_Obj *arrayNameObj = data[2];
- Tcl_Obj *scriptObj = data[3];
+ ArraySearch *searchPtr = (ArraySearch *)data[0];
+ Tcl_Obj *varListObj = (Tcl_Obj *)data[1];
+ Tcl_Obj *arrayNameObj = (Tcl_Obj *)data[2];
+ Tcl_Obj *scriptObj = (Tcl_Obj *)data[3];
Tcl_Obj **varv;
Tcl_Obj *keyObj, *valueObj;
Var *varPtr;
@@ -3226,7 +3231,7 @@ ArrayPopulateSearch(
searchPtr->nextPtr = NULL;
} else {
searchPtr->id = ((ArraySearch *) Tcl_GetHashValue(hPtr))->id + 1;
- searchPtr->nextPtr = Tcl_GetHashValue(hPtr);
+ searchPtr->nextPtr = (ArraySearch *)Tcl_GetHashValue(hPtr);
}
searchPtr->varPtr = varPtr;
searchPtr->nextEntry = VarHashFirstEntry(varPtr->value.tablePtr,
@@ -3258,7 +3263,7 @@ ArrayPopulateSearch(
static int
ArrayStartSearchCmd(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
@@ -3266,6 +3271,7 @@ ArrayStartSearchCmd(
Var *varPtr;
int isArray;
ArraySearch *searchPtr;
+ (void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "arrayName");
@@ -3284,7 +3290,7 @@ ArrayStartSearchCmd(
* Make a new array search with a free name.
*/
- searchPtr = Tcl_Alloc(sizeof(ArraySearch));
+ searchPtr = (ArraySearch *)Tcl_Alloc(sizeof(ArraySearch));
ArrayPopulateSearch(interp, objv[1], varPtr, searchPtr);
Tcl_SetObjResult(interp, searchPtr->name);
return TCL_OK;
@@ -3325,7 +3331,7 @@ ArrayDoneSearch(
Tcl_DeleteHashEntry(hPtr);
}
} else {
- for (prevPtr=Tcl_GetHashValue(hPtr) ;; prevPtr=prevPtr->nextPtr) {
+ for (prevPtr = (ArraySearch *)Tcl_GetHashValue(hPtr); ; prevPtr=prevPtr->nextPtr) {
if (prevPtr->nextPtr == searchPtr) {
prevPtr->nextPtr = searchPtr->nextPtr;
break;
@@ -3354,7 +3360,7 @@ ArrayDoneSearch(
/* ARGSUSED */
static int
ArrayAnyMoreCmd(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
@@ -3364,6 +3370,7 @@ ArrayAnyMoreCmd(
Tcl_Obj *varNameObj, *searchObj;
int gotValue, isArray;
ArraySearch *searchPtr;
+ (void)dummy;
if (objc != 3) {
Tcl_WrongNumArgs(interp, 1, objv, "arrayName searchId");
@@ -3433,7 +3440,7 @@ ArrayAnyMoreCmd(
/* ARGSUSED */
static int
ArrayNextElementCmd(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
@@ -3442,6 +3449,7 @@ ArrayNextElementCmd(
Tcl_Obj *varNameObj, *searchObj;
ArraySearch *searchPtr;
int isArray;
+ (void)dummy;
if (objc != 3) {
Tcl_WrongNumArgs(interp, 1, objv, "arrayName searchId");
@@ -3514,7 +3522,7 @@ ArrayNextElementCmd(
/* ARGSUSED */
static int
ArrayDoneSearchCmd(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
@@ -3524,6 +3532,7 @@ ArrayDoneSearchCmd(
Tcl_Obj *varNameObj, *searchObj;
ArraySearch *searchPtr;
int isArray;
+ (void)dummy;
if (objc != 3) {
Tcl_WrongNumArgs(interp, 1, objv, "arrayName searchId");
@@ -3575,13 +3584,14 @@ ArrayDoneSearchCmd(
/* ARGSUSED */
static int
ArrayExistsCmd(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
{
Interp *iPtr = (Interp *)interp;
int isArray;
+ (void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "arrayName");
@@ -3616,7 +3626,7 @@ ArrayExistsCmd(
/* ARGSUSED */
static int
ArrayGetCmd(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
@@ -3627,6 +3637,7 @@ ArrayGetCmd(
Tcl_HashSearch search;
const char *pattern;
int i, count, result, isArray;
+ (void)dummy;
switch (objc) {
case 2:
@@ -3776,7 +3787,7 @@ ArrayGetCmd(
/* ARGSUSED */
static int
ArrayNamesCmd(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
@@ -3790,6 +3801,7 @@ ArrayNamesCmd(
Tcl_HashSearch search;
const char *pattern = NULL;
int isArray, mode = OPT_GLOB;
+ (void)dummy;
if ((objc < 2) || (objc > 4)) {
Tcl_WrongNumArgs(interp, 1, objv, "arrayName ?mode? ?pattern?");
@@ -3944,7 +3956,7 @@ TclFindArrayPtrElements(
/* ARGSUSED */
static int
ArraySetCmd(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
@@ -3953,6 +3965,7 @@ ArraySetCmd(
Tcl_Obj *arrayElemObj;
Var *varPtr, *arrayPtr;
int result, i;
+ (void)dummy;
if (objc != 3) {
Tcl_WrongNumArgs(interp, 1, objv, "arrayName list");
@@ -4120,7 +4133,7 @@ ArraySetCmd(
/* ARGSUSED */
static int
ArraySizeCmd(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
@@ -4129,6 +4142,7 @@ ArraySizeCmd(
Tcl_HashSearch search;
Var *varPtr2;
int isArray, size = 0;
+ (void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "arrayName");
@@ -4180,7 +4194,7 @@ ArraySizeCmd(
/* ARGSUSED */
static int
ArrayStatsCmd(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
@@ -4189,6 +4203,7 @@ ArrayStatsCmd(
Tcl_Obj *varNameObj;
char *stats;
int isArray;
+ (void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "arrayName");
@@ -4235,7 +4250,7 @@ ArrayStatsCmd(
/* ARGSUSED */
static int
ArrayUnsetCmd(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
@@ -4246,6 +4261,7 @@ ArrayUnsetCmd(
const char *pattern;
const int unsetFlags = 0; /* Should this be TCL_LEAVE_ERR_MSG? */
int isArray;
+ (void)dummy;
switch (objc) {
case 2:
@@ -4814,6 +4830,7 @@ Tcl_GlobalObjCmd(
const char *varName;
const char *tail;
int result, i;
+ (void)dummy;
/*
* If we are not executing inside a Tcl procedure, just return.
@@ -4919,6 +4936,7 @@ Tcl_VariableObjCmd(
Tcl_Obj *varValuePtr;
int i, result;
Tcl_Obj *varNamePtr, *tailPtr;
+ (void)dummy;
for (i=1 ; i<objc ; i+=2) {
/*
@@ -5050,6 +5068,7 @@ Tcl_UpvarObjCmd(
CallFrame *framePtr;
int result, hasLevel;
Tcl_Obj *levelObj;
+ (void)dummy;
if (objc < 3) {
Tcl_WrongNumArgs(interp, 1, objv,
@@ -5156,14 +5175,14 @@ ParseSearchId(
Tcl_FindHashEntry(&iPtr->varSearches, varPtr);
/* First look for same (Tcl_Obj *) */
- for (searchPtr = Tcl_GetHashValue(hPtr); searchPtr != NULL;
+ for (searchPtr = (ArraySearch *)Tcl_GetHashValue(hPtr); searchPtr != NULL;
searchPtr = searchPtr->nextPtr) {
if (searchPtr->name == handleObj) {
return searchPtr;
}
}
/* Fallback: do string compares. */
- for (searchPtr = Tcl_GetHashValue(hPtr); searchPtr != NULL;
+ for (searchPtr = (ArraySearch *)Tcl_GetHashValue(hPtr); searchPtr != NULL;
searchPtr = searchPtr->nextPtr) {
if (strcmp(TclGetString(searchPtr->name), handle) == 0) {
return searchPtr;
@@ -5215,7 +5234,7 @@ DeleteSearches(
if (arrayVarPtr->flags & VAR_SEARCH_ACTIVE) {
sPtr = Tcl_FindHashEntry(&iPtr->varSearches, arrayVarPtr);
- for (searchPtr = Tcl_GetHashValue(sPtr); searchPtr != NULL;
+ for (searchPtr = (ArraySearch *)Tcl_GetHashValue(sPtr); searchPtr != NULL;
searchPtr = nextPtr) {
nextPtr = searchPtr->nextPtr;
Tcl_DecrRefCount(searchPtr->name);
@@ -5285,7 +5304,7 @@ TclDeleteNamespaceVars(
if (TclIsVarTraced(varPtr)) {
Tcl_HashEntry *tPtr = Tcl_FindHashEntry(&iPtr->varTraces, varPtr);
- VarTrace *tracePtr = Tcl_GetHashValue(tPtr);
+ VarTrace *tracePtr = (VarTrace *)Tcl_GetHashValue(tPtr);
ActiveVarTrace *activePtr;
while (tracePtr) {
@@ -5482,7 +5501,7 @@ DeleteArray(
elNamePtr, flags,/* leaveErrMsg */ 0, index);
}
tPtr = Tcl_FindHashEntry(&iPtr->varTraces, elPtr);
- tracePtr = Tcl_GetHashValue(tPtr);
+ tracePtr = (VarTrace *)Tcl_GetHashValue(tPtr);
while (tracePtr) {
VarTrace *prevPtr = tracePtr;
@@ -5872,6 +5891,7 @@ TclInfoVarsCmd(
Tcl_Obj *listPtr, *elemObjPtr, *varNamePtr;
int specificNsInPattern = 0;/* Init. to avoid compiler warning. */
Tcl_Obj *simplePatternPtr = NULL;
+ (void)dummy;
/*
* Get the pattern and find the "effective namespace" in which to list
@@ -6058,6 +6078,7 @@ TclInfoGlobalsCmd(
Tcl_HashSearch search;
Var *varPtr;
Tcl_Obj *listPtr, *varNamePtr, *patternPtr;
+ (void)dummy;
if (objc == 1) {
pattern = NULL;
@@ -6148,6 +6169,7 @@ TclInfoLocalsCmd(
{
Interp *iPtr = (Interp *) interp;
Tcl_Obj *patternPtr, *listPtr;
+ (void)dummy;
if (objc == 1) {
patternPtr = NULL;
@@ -6292,7 +6314,7 @@ AppendLocals(
if (iPtr->varFramePtr->isProcCallFrame & FRAME_IS_METHOD) {
Method *mPtr = (Method *)
- Tcl_ObjectContextMethod(iPtr->varFramePtr->clientData);
+ Tcl_ObjectContextMethod((Tcl_ObjectContext)iPtr->varFramePtr->clientData);
PrivateVariableMapping *privatePtr;
if (mPtr->declaringObjectPtr) {
@@ -6362,8 +6384,9 @@ AllocVarEntry(
Tcl_Obj *objPtr = (Tcl_Obj *)keyPtr;
Tcl_HashEntry *hPtr;
Var *varPtr;
+ (void)tablePtr;
- varPtr = Tcl_Alloc(sizeof(VarInHash));
+ varPtr = (Var *)Tcl_Alloc(sizeof(VarInHash));
varPtr->flags = VAR_IN_HASHTABLE;
varPtr->value.objPtr = NULL;
VarHashRefCount(varPtr) = 1;
@@ -6447,7 +6470,7 @@ CompareVarKeys(
/* ARGSUSED */
static int
ArrayDefaultCmd(
- ClientData clientData, /* Not used. */
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
@@ -6459,6 +6482,7 @@ ArrayDefaultCmd(
Tcl_Obj *arrayNameObj, *defaultValueObj;
Var *varPtr, *arrayPtr;
int isArray, option;
+ (void)dummy;
/*
* Parse arguments.
@@ -6593,7 +6617,7 @@ void
TclInitArrayVar(
Var *arrayPtr)
{
- ArrayVarHashTable *tablePtr = Tcl_Alloc(sizeof(ArrayVarHashTable));
+ ArrayVarHashTable *tablePtr = (ArrayVarHashTable *)Tcl_Alloc(sizeof(ArrayVarHashTable));
/*
* Mark the variable as an array.
diff --git a/generic/tclZipfs.c b/generic/tclZipfs.c
index 815854b..fbbe1ed 100644
--- a/generic/tclZipfs.c
+++ b/generic/tclZipfs.c
@@ -841,7 +841,7 @@ ZipFSLookup(
hPtr = Tcl_FindHashEntry(&ZipFS.fileHash, filename);
if (hPtr) {
- z = Tcl_GetHashValue(hPtr);
+ z = (ZipEntry *)Tcl_GetHashValue(hPtr);
}
return z;
}
@@ -929,7 +929,7 @@ ZipFSCloseArchive(
#else /* !_WIN32 */
if ((zf->data != MAP_FAILED) && !zf->ptrToFree) {
munmap(zf->data, zf->length);
- zf->data = MAP_FAILED;
+ zf->data = (unsigned char *)MAP_FAILED;
}
#endif /* _WIN32 */
@@ -1099,7 +1099,7 @@ ZipFSOpenArchive(
zf->data = NULL;
zf->mountHandle = INVALID_HANDLE_VALUE;
#else /* !_WIN32 */
- zf->data = MAP_FAILED;
+ zf->data = (unsigned char *)MAP_FAILED;
#endif /* _WIN32 */
zf->length = 0;
zf->numFiles = 0;
@@ -1128,7 +1128,7 @@ ZipFSOpenArchive(
ZIPFS_POSIX_ERROR(interp, "seek error");
goto error;
}
- zf->ptrToFree = zf->data = Tcl_AttemptAlloc(zf->length);
+ zf->ptrToFree = zf->data = (unsigned char *)Tcl_AttemptAlloc(zf->length);
if (!zf->ptrToFree) {
ZIPFS_ERROR(interp, "out of memory");
if (interp) {
@@ -1157,13 +1157,13 @@ ZipFSOpenArchive(
ZIPFS_POSIX_ERROR(interp, "invalid file size");
goto error;
}
- zf->mountHandle = CreateFileMapping((HANDLE) handle, 0, PAGE_READONLY,
+ zf->mountHandle = CreateFileMappingW((HANDLE) handle, 0, PAGE_READONLY,
0, zf->length, 0);
if (zf->mountHandle == INVALID_HANDLE_VALUE) {
ZIPFS_POSIX_ERROR(interp, "file mapping failed");
goto error;
}
- zf->data = MapViewOfFile(zf->mountHandle, FILE_MAP_READ, 0, 0,
+ zf->data = (unsigned char *)MapViewOfFile(zf->mountHandle, FILE_MAP_READ, 0, 0,
zf->length);
if (!zf->data) {
ZIPFS_POSIX_ERROR(interp, "file mapping failed");
@@ -1259,7 +1259,7 @@ ZipFSCatalogFilesystem(
hPtr = Tcl_CreateHashEntry(&ZipFS.zipHash, mountPoint, &isNew);
if (!isNew) {
if (interp) {
- zf = Tcl_GetHashValue(hPtr);
+ zf = (ZipFile *)Tcl_GetHashValue(hPtr);
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"%s is already mounted on %s", zf->name, mountPoint));
Tcl_SetErrorCode(interp, "TCL", "ZIPFS", "MOUNTED", NULL);
@@ -1268,7 +1268,7 @@ ZipFSCatalogFilesystem(
ZipFSCloseArchive(interp, zf0);
return TCL_ERROR;
}
- zf = Tcl_AttemptAlloc(sizeof(ZipFile) + strlen(mountPoint) + 1);
+ zf = (ZipFile *)Tcl_AttemptAlloc(sizeof(ZipFile) + strlen(mountPoint) + 1);
if (!zf) {
if (interp) {
Tcl_AppendResult(interp, "out of memory", (char *) NULL);
@@ -1281,11 +1281,11 @@ ZipFSCatalogFilesystem(
Unlock();
*zf = *zf0;
- zf->mountPoint = Tcl_GetHashKey(&ZipFS.zipHash, hPtr);
+ zf->mountPoint = (char *)Tcl_GetHashKey(&ZipFS.zipHash, hPtr);
Tcl_CreateExitHandler(ZipfsExitHandler, zf);
zf->mountPointLen = strlen(zf->mountPoint);
zf->nameLength = strlen(zipname);
- zf->name = Tcl_Alloc(zf->nameLength + 1);
+ zf->name = (char *)Tcl_Alloc(zf->nameLength + 1);
memcpy(zf->name, zipname, zf->nameLength + 1);
zf->entries = NULL;
zf->topEnts = NULL;
@@ -1304,7 +1304,7 @@ ZipFSCatalogFilesystem(
if (mountPoint[0] != '\0') {
hPtr = Tcl_CreateHashEntry(&ZipFS.fileHash, mountPoint, &isNew);
if (isNew) {
- z = Tcl_Alloc(sizeof(ZipEntry));
+ z = (ZipEntry *)Tcl_Alloc(sizeof(ZipEntry));
Tcl_SetHashValue(hPtr, z);
z->tnext = NULL;
@@ -1318,7 +1318,7 @@ ZipFSCatalogFilesystem(
z->numBytes = z->numCompressedBytes = 0;
z->compressMethod = ZIP_COMPMETH_STORED;
z->data = NULL;
- z->name = Tcl_GetHashKey(&ZipFS.fileHash, hPtr);
+ z->name = (char *)Tcl_GetHashKey(&ZipFS.fileHash, hPtr);
z->next = zf->entries;
zf->entries = z;
}
@@ -1399,7 +1399,7 @@ ZipFSCatalogFilesystem(
}
Tcl_DStringSetLength(&fpBuf, 0);
fullpath = CanonicalPath(mountPoint, path, &fpBuf, 1);
- z = Tcl_Alloc(sizeof(ZipEntry));
+ z = (ZipEntry *)Tcl_Alloc(sizeof(ZipEntry));
z->name = NULL;
z->tnext = NULL;
z->depth = CountSlashes(fullpath);
@@ -1431,7 +1431,7 @@ ZipFSCatalogFilesystem(
Tcl_Free(z);
} else {
Tcl_SetHashValue(hPtr, z);
- z->name = Tcl_GetHashKey(&ZipFS.fileHash, hPtr);
+ z->name = (char *)Tcl_GetHashKey(&ZipFS.fileHash, hPtr);
z->next = zf->entries;
zf->entries = z;
if (isdir && (mountPoint[0] == '\0') && (z->depth == 1)) {
@@ -1453,7 +1453,7 @@ ZipFSCatalogFilesystem(
if (!isNew) {
break;
}
- zd = Tcl_Alloc(sizeof(ZipEntry));
+ zd = (ZipEntry *)Tcl_Alloc(sizeof(ZipEntry));
zd->name = NULL;
zd->tnext = NULL;
zd->depth = CountSlashes(dir);
@@ -1467,7 +1467,7 @@ ZipFSCatalogFilesystem(
zd->compressMethod = ZIP_COMPMETH_STORED;
zd->data = NULL;
Tcl_SetHashValue(hPtr, zd);
- zd->name = Tcl_GetHashKey(&ZipFS.fileHash, hPtr);
+ zd->name = (char *)Tcl_GetHashKey(&ZipFS.fileHash, hPtr);
zd->next = zf->entries;
zf->entries = zd;
if ((mountPoint[0] == '\0') && (zd->depth == 1)) {
@@ -1553,7 +1553,7 @@ ListMountPoints(
if (!interp) {
return TCL_OK;
}
- zf = Tcl_GetHashValue(hPtr);
+ zf = (ZipFile *)Tcl_GetHashValue(hPtr);
Tcl_AppendElement(interp, zf->mountPoint);
Tcl_AppendElement(interp, zf->name);
}
@@ -1590,7 +1590,7 @@ DescribeMounted(
if (interp) {
hPtr = Tcl_FindHashEntry(&ZipFS.zipHash, mountPoint);
if (hPtr) {
- zf = Tcl_GetHashValue(hPtr);
+ zf = (ZipFile *)Tcl_GetHashValue(hPtr);
Tcl_SetObjResult(interp, Tcl_NewStringObj(zf->name, -1));
return TCL_OK;
}
@@ -1667,7 +1667,7 @@ TclZipfs_Mount(
return TCL_ERROR;
}
}
- zf = Tcl_AttemptAlloc(sizeof(ZipFile) + strlen(mountPoint) + 1);
+ zf = (ZipFile *)Tcl_AttemptAlloc(sizeof(ZipFile) + strlen(mountPoint) + 1);
if (!zf) {
if (interp) {
Tcl_AppendResult(interp, "out of memory", (char *) NULL);
@@ -1748,7 +1748,7 @@ TclZipfs_MountBuffer(
* Have both a mount point and data to mount there.
*/
- zf = Tcl_AttemptAlloc(sizeof(ZipFile) + strlen(mountPoint) + 1);
+ zf = (ZipFile *)Tcl_AttemptAlloc(sizeof(ZipFile) + strlen(mountPoint) + 1);
if (!zf) {
if (interp) {
Tcl_AppendResult(interp, "out of memory", (char *) NULL);
@@ -1759,7 +1759,7 @@ TclZipfs_MountBuffer(
zf->isMemBuffer = 1;
zf->length = datalen;
if (copy) {
- zf->data = Tcl_AttemptAlloc(datalen);
+ zf->data = (unsigned char *)Tcl_AttemptAlloc(datalen);
if (!zf->data) {
if (interp) {
Tcl_AppendResult(interp, "out of memory", (char *) NULL);
@@ -1829,7 +1829,7 @@ TclZipfs_Unmount(
goto done;
}
- zf = Tcl_GetHashValue(hPtr);
+ zf = (ZipFile *)Tcl_GetHashValue(hPtr);
if (zf->numOpen > 0) {
ZIPFS_ERROR(interp, "filesystem is busy");
ret = TCL_ERROR;
@@ -1882,6 +1882,8 @@ ZipFSMountObjCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
+ (void)dummy;
+
if (objc > 4) {
Tcl_WrongNumArgs(interp, 1, objv,
"?mountpoint? ?zipfile? ?password?");
@@ -1919,6 +1921,7 @@ ZipFSMountBufferObjCmd(
const char *mountPoint; /* Mount point path. */
unsigned char *data;
size_t length = 0;
+ (void)dummy;
if (objc > 3) {
Tcl_WrongNumArgs(interp, 1, objv, "?mountpoint? ?data?");
@@ -1968,6 +1971,10 @@ ZipFSRootObjCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
+ (void)dummy;
+ (void)objc;
+ (void)objv;
+
Tcl_SetObjResult(interp, Tcl_NewStringObj(ZIPFS_VOLUME, -1));
return TCL_OK;
}
@@ -1995,6 +2002,8 @@ ZipFSUnmountObjCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
+ (void)dummy;
+
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "zipfile");
return TCL_ERROR;
@@ -2028,6 +2037,7 @@ ZipFSMkKeyObjCmd(
{
int len, i = 0;
char *pw, passBuf[264];
+ (void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "password");
@@ -2367,7 +2377,7 @@ ZipAddFile(
return TCL_ERROR;
}
- z = Tcl_Alloc(sizeof(ZipEntry));
+ z = (ZipEntry *)Tcl_Alloc(sizeof(ZipEntry));
Tcl_SetHashValue(hPtr, z);
z->name = NULL;
z->tnext = NULL;
@@ -2382,7 +2392,7 @@ ZipAddFile(
z->numCompressedBytes = nbytecompr;
z->compressMethod = compMeth;
z->data = NULL;
- z->name = Tcl_GetHashKey(fileHash, hPtr);
+ z->name = (char *)Tcl_GetHashKey(fileHash, hPtr);
z->next = NULL;
/*
@@ -2557,7 +2567,7 @@ ZipFSMkZipOrImgObjCmd(
WriteLock();
for (hPtr = Tcl_FirstHashEntry(&ZipFS.zipHash, &search); hPtr;
hPtr = Tcl_NextHashEntry(&search)) {
- zf = Tcl_GetHashValue(hPtr);
+ zf = (ZipFile *)Tcl_GetHashValue(hPtr);
if (strcmp(zf->name, imgName) == 0) {
isMounted = 1;
zf->numOpen++;
@@ -2718,7 +2728,7 @@ ZipFSMkZipOrImgObjCmd(
if (!hPtr) {
continue;
}
- z = Tcl_GetHashValue(hPtr);
+ z = (ZipEntry *)Tcl_GetHashValue(hPtr);
len = strlen(z->name);
ZipWriteInt(buf + ZIP_CENTRAL_SIG_OFFS, ZIP_CENTRAL_HEADER_SIG);
ZipWriteShort(buf + ZIP_CENTRAL_VERSIONMADE_OFFS, ZIP_MIN_VERSION);
@@ -2773,7 +2783,7 @@ ZipFSMkZipOrImgObjCmd(
Tcl_DecrRefCount(list);
for (hPtr = Tcl_FirstHashEntry(&fileHash, &search); hPtr;
hPtr = Tcl_NextHashEntry(&search)) {
- z = Tcl_GetHashValue(hPtr);
+ z = (ZipEntry *)Tcl_GetHashValue(hPtr);
Tcl_Free(z);
Tcl_DeleteHashEntry(hPtr);
}
@@ -2805,6 +2815,8 @@ ZipFSMkZipObjCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
+ (void)dummy;
+
if (objc < 3 || objc > 5) {
Tcl_WrongNumArgs(interp, 1, objv, "outfile indir ?strip? ?password?");
return TCL_ERROR;
@@ -2825,6 +2837,8 @@ ZipFSLMkZipObjCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
+ (void)dummy;
+
if (objc < 3 || objc > 4) {
Tcl_WrongNumArgs(interp, 1, objv, "outfile inlist ?password?");
return TCL_ERROR;
@@ -2862,6 +2876,8 @@ ZipFSMkImgObjCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
+ (void)dummy;
+
if (objc < 3 || objc > 6) {
Tcl_WrongNumArgs(interp, 1, objv,
"outfile indir ?strip? ?password? ?infile?");
@@ -2883,6 +2899,8 @@ ZipFSLMkImgObjCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
+ (void)dummy;
+
if (objc < 3 || objc > 5) {
Tcl_WrongNumArgs(interp, 1, objv, "outfile inlist ?password infile?");
return TCL_ERROR;
@@ -2924,6 +2942,7 @@ ZipFSCanonicalObjCmd(
char *filename = NULL;
char *result;
Tcl_DString dPath;
+ (void)dummy;
if (objc < 2 || objc > 4) {
Tcl_WrongNumArgs(interp, 1, objv, "?mountpoint? filename ?inZipfs?");
@@ -2979,6 +2998,7 @@ ZipFSExistsObjCmd(
char *filename;
int exists;
Tcl_DString ds;
+ (void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "filename");
@@ -3031,6 +3051,7 @@ ZipFSInfoObjCmd(
{
char *filename;
ZipEntry *z;
+ (void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "filename");
@@ -3084,6 +3105,7 @@ ZipFSListObjCmd(
Tcl_HashEntry *hPtr;
Tcl_HashSearch search;
Tcl_Obj *result = Tcl_GetObjResult(interp);
+ (void)dummy;
if (objc > 3) {
Tcl_WrongNumArgs(interp, 1, objv, "?(-glob|-regexp)? ?pattern?");
@@ -3113,7 +3135,7 @@ ZipFSListObjCmd(
if (pattern) {
for (hPtr = Tcl_FirstHashEntry(&ZipFS.fileHash, &search);
hPtr != NULL; hPtr = Tcl_NextHashEntry(&search)) {
- ZipEntry *z = Tcl_GetHashValue(hPtr);
+ ZipEntry *z = (ZipEntry *)Tcl_GetHashValue(hPtr);
if (Tcl_StringMatch(z->name, pattern)) {
Tcl_ListObjAppendElement(interp, result,
@@ -3123,7 +3145,7 @@ ZipFSListObjCmd(
} else if (regexp) {
for (hPtr = Tcl_FirstHashEntry(&ZipFS.fileHash, &search);
hPtr; hPtr = Tcl_NextHashEntry(&search)) {
- ZipEntry *z = Tcl_GetHashValue(hPtr);
+ ZipEntry *z = (ZipEntry *)Tcl_GetHashValue(hPtr);
if (Tcl_RegExpExec(interp, regexp, z->name, z->name)) {
Tcl_ListObjAppendElement(interp, result,
@@ -3133,7 +3155,7 @@ ZipFSListObjCmd(
} else {
for (hPtr = Tcl_FirstHashEntry(&ZipFS.fileHash, &search);
hPtr; hPtr = Tcl_NextHashEntry(&search)) {
- ZipEntry *z = Tcl_GetHashValue(hPtr);
+ ZipEntry *z = (ZipEntry *)Tcl_GetHashValue(hPtr);
Tcl_ListObjAppendElement(interp, result,
Tcl_NewStringObj(z->name, -1));
@@ -3276,6 +3298,10 @@ ZipFSTclLibraryObjCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
+ (void)dummy;
+ (void)objc;
+ (void)objv;
+
if (!Tcl_IsSafe(interp)) {
Tcl_Obj *pResult = TclZipfs_TclLibrary();
@@ -3308,7 +3334,8 @@ ZipChannelClose(
void *instanceData,
Tcl_Interp *dummy) /* Current interpreter. */
{
- ZipChannel *info = instanceData;
+ ZipChannel *info = (ZipChannel *)instanceData;
+ (void)dummy;
if (info->iscompr && info->ubuf) {
Tcl_Free(info->ubuf);
@@ -3320,7 +3347,7 @@ ZipChannelClose(
}
if (info->isWriting) {
ZipEntry *z = info->zipEntryPtr;
- unsigned char *newdata = Tcl_AttemptRealloc(info->ubuf, info->numRead);
+ unsigned char *newdata = (unsigned char *)Tcl_AttemptRealloc(info->ubuf, info->numRead);
if (newdata) {
if (z->data) {
@@ -3568,6 +3595,9 @@ ZipChannelWatchChannel(
void *instanceData,
int mask)
{
+ (void)instanceData;
+ (void)mask;
+
return;
}
@@ -3594,6 +3624,10 @@ ZipChannelGetFile(
int direction,
void **handlePtr)
{
+ (void)instanceData;
+ (void)direction;
+ (void)handlePtr;
+
return TCL_ERROR;
}
@@ -3625,6 +3659,7 @@ ZipChannelOpen(
ZipChannel *info;
int i, ch, trunc, wr, flags = 0;
char cname[128];
+ (void)permissions;
if ((mode & O_APPEND)
|| ((ZipFS.wrmax <= 0) && (mode & (O_WRONLY | O_RDWR)))) {
@@ -3681,7 +3716,7 @@ ZipChannelOpen(
} else {
flags = TCL_WRITABLE;
}
- info = Tcl_AttemptAlloc(sizeof(ZipChannel));
+ info = (ZipChannel *)Tcl_AttemptAlloc(sizeof(ZipChannel));
if (!info) {
ZIPFS_ERROR(interp, "out of memory");
if (interp) {
@@ -3699,7 +3734,7 @@ ZipChannelOpen(
info->maxWrite = ZipFS.wrmax;
info->iscompr = 0;
info->isEncrypted = 0;
- info->ubuf = Tcl_AttemptAlloc(info->maxWrite);
+ info->ubuf = (unsigned char *)Tcl_AttemptAlloc(info->maxWrite);
if (!info->ubuf) {
merror0:
if (info->ubuf) {
@@ -3757,7 +3792,7 @@ ZipChannelOpen(
size_t j;
stream.avail_in -= 12;
- cbuf = Tcl_AttemptAlloc(stream.avail_in);
+ cbuf = (unsigned char *)Tcl_AttemptAlloc(stream.avail_in);
if (!cbuf) {
goto merror0;
}
@@ -3857,7 +3892,7 @@ ZipChannelOpen(
stream.avail_in = z->numCompressedBytes;
if (info->isEncrypted) {
stream.avail_in -= 12;
- ubuf = Tcl_AttemptAlloc(stream.avail_in);
+ ubuf = (unsigned char *)Tcl_AttemptAlloc(stream.avail_in);
if (!ubuf) {
info->ubuf = NULL;
goto merror;
@@ -3870,7 +3905,7 @@ ZipChannelOpen(
} else {
stream.next_in = info->ubuf;
}
- stream.next_out = info->ubuf = Tcl_AttemptAlloc(info->numBytes);
+ stream.next_out = info->ubuf = (unsigned char *)Tcl_AttemptAlloc(info->numBytes);
if (!info->ubuf) {
merror:
if (ubuf) {
@@ -4142,6 +4177,8 @@ static Tcl_Obj *
ZipFSFilesystemSeparatorProc(
Tcl_Obj *pathPtr)
{
+ (void)pathPtr;
+
return Tcl_NewStringObj("/", -1);
}
@@ -4179,6 +4216,7 @@ ZipFSMatchInDirectoryProc(
size_t len, prefixLen;
char *pat, *prefix, *path;
Tcl_DString dsPref;
+ (void)dummy;
if (!normPathPtr) {
return -1;
@@ -4225,7 +4263,7 @@ ZipFSMatchInDirectoryProc(
}
for (hPtr = Tcl_FirstHashEntry(&ZipFS.zipHash, &search); hPtr;
hPtr = Tcl_NextHashEntry(&search)) {
- ZipFile *zf = Tcl_GetHashValue(hPtr);
+ ZipFile *zf = (ZipFile *)Tcl_GetHashValue(hPtr);
if (zf->mountPointLen == 0) {
ZipEntry *z;
@@ -4276,7 +4314,7 @@ ZipFSMatchInDirectoryProc(
if (!pattern || (pattern[0] == '\0')) {
hPtr = Tcl_FindHashEntry(&ZipFS.fileHash, path);
if (hPtr) {
- ZipEntry *z = Tcl_GetHashValue(hPtr);
+ ZipEntry *z = (ZipEntry *)Tcl_GetHashValue(hPtr);
if ((dirOnly < 0) || (!dirOnly && !z->isDirectory)
|| (dirOnly && z->isDirectory)) {
@@ -4296,7 +4334,7 @@ ZipFSMatchInDirectoryProc(
}
l = strlen(pattern);
- pat = Tcl_Alloc(len + l + 2);
+ pat = (char *)Tcl_Alloc(len + l + 2);
memcpy(pat, path, len);
while ((len > 1) && (pat[len - 1] == '/')) {
--len;
@@ -4309,7 +4347,7 @@ ZipFSMatchInDirectoryProc(
scnt = CountSlashes(pat);
for (hPtr = Tcl_FirstHashEntry(&ZipFS.fileHash, &search);
hPtr; hPtr = Tcl_NextHashEntry(&search)) {
- ZipEntry *z = Tcl_GetHashValue(hPtr);
+ ZipEntry *z = (ZipEntry *)Tcl_GetHashValue(hPtr);
if ((dirOnly >= 0) && ((dirOnly && !z->isDirectory)
|| (!dirOnly && z->isDirectory))) {
@@ -4363,6 +4401,7 @@ ZipFSPathInFilesystemProc(
int ret = -1;
size_t len;
char *path;
+ (void)dummy;
pathPtr = Tcl_FSGetNormalizedPath(NULL, pathPtr);
if (!pathPtr) {
@@ -4383,7 +4422,7 @@ ZipFSPathInFilesystemProc(
for (hPtr = Tcl_FirstHashEntry(&ZipFS.zipHash, &search); hPtr;
hPtr = Tcl_NextHashEntry(&search)) {
- ZipFile *zf = Tcl_GetHashValue(hPtr);
+ ZipFile *zf = (ZipFile *)Tcl_GetHashValue(hPtr);
if (zf->mountPointLen == 0) {
ZipEntry *z;
@@ -4462,6 +4501,9 @@ ZipFSFileAttrStringsProc(
"-permissions",
NULL,
};
+ (void)pathPtr;
+ (void)objPtrRef;
+
return attrs;
}
@@ -4563,6 +4605,10 @@ ZipFSFileAttrsSetProc(
Tcl_Obj *pathPtr,
Tcl_Obj *objPtr)
{
+ (void)index;
+ (void)pathPtr;
+ (void)objPtr;
+
if (interp) {
Tcl_SetObjResult(interp, Tcl_NewStringObj("unsupported operation", -1));
Tcl_SetErrorCode(interp, "TCL", "ZIPFS", "UNSUPPORTED_OP", NULL);
@@ -4586,6 +4632,7 @@ static Tcl_Obj *
ZipFSFilesystemPathTypeProc(
Tcl_Obj *pathPtr)
{
+ (void)pathPtr;
return Tcl_NewStringObj("zip", -1);
}
@@ -4878,10 +4925,11 @@ TclZipfs_AppHook(
char *archive;
#ifdef _WIN32
+ (void)argvPtr;
Tcl_FindExecutable(NULL);
-#else /* !_WIN32 */
+#else
Tcl_FindExecutable((*argvPtr)[0]);
-#endif /* _WIN32 */
+#endif
archive = (char *) Tcl_GetNameOfExecutable();
TclZipfs_Init(NULL);
@@ -4981,6 +5029,8 @@ TclZipfs_AppHook(
#ifdef _WIN32
Tcl_DStringFree(&ds);
#endif /* _WIN32 */
+#else
+ (void)argcPtr;
#endif /* SUPPORT_BUILTIN_ZIP_INSTALL */
}
return TCL_OK;
diff --git a/generic/tclZlib.c b/generic/tclZlib.c
index b3fe234..d520739 100644
--- a/generic/tclZlib.c
+++ b/generic/tclZlib.c
@@ -700,7 +700,7 @@ Tcl_ZlibStreamInit(
case TCL_ZLIB_FORMAT_GZIP:
wbits = WBITS_GZIP;
if (dictObj) {
- gzHeaderPtr = Tcl_Alloc(sizeof(GzipHeader));
+ gzHeaderPtr = (GzipHeader *)Tcl_Alloc(sizeof(GzipHeader));
memset(gzHeaderPtr, 0, sizeof(GzipHeader));
if (GenerateHeader(interp, dictObj, gzHeaderPtr,
NULL) != TCL_OK) {
@@ -734,7 +734,7 @@ Tcl_ZlibStreamInit(
break;
case TCL_ZLIB_FORMAT_GZIP:
wbits = WBITS_GZIP;
- gzHeaderPtr = Tcl_Alloc(sizeof(GzipHeader));
+ gzHeaderPtr = (GzipHeader *)Tcl_Alloc(sizeof(GzipHeader));
memset(gzHeaderPtr, 0, sizeof(GzipHeader));
gzHeaderPtr->header.name = (Bytef *)
gzHeaderPtr->nativeFilenameBuf;
@@ -760,7 +760,7 @@ Tcl_ZlibStreamInit(
" TCL_ZLIB_STREAM_INFLATE");
}
- zshPtr = Tcl_Alloc(sizeof(ZlibStreamHandle));
+ zshPtr = (ZlibStreamHandle *)Tcl_Alloc(sizeof(ZlibStreamHandle));
zshPtr->interp = interp;
zshPtr->mode = mode;
zshPtr->format = format;
@@ -887,7 +887,7 @@ static void
ZlibStreamCmdDelete(
void *cd)
{
- ZlibStreamHandle *zshPtr = cd;
+ ZlibStreamHandle *zshPtr = (ZlibStreamHandle *)cd;
zshPtr->cmd = NULL;
ZlibStreamCleanup(zshPtr);
@@ -1235,7 +1235,7 @@ Tcl_ZlibStreamPut(
if (outSize > BUFFER_SIZE_LIMIT) {
outSize = BUFFER_SIZE_LIMIT;
}
- dataTmp = Tcl_Alloc(outSize);
+ dataTmp = (char *)Tcl_Alloc(outSize);
while (1) {
e = Deflate(&zshPtr->stream, dataTmp, outSize, flush, &toStore);
@@ -1269,7 +1269,7 @@ Tcl_ZlibStreamPut(
if (outSize < BUFFER_SIZE_LIMIT) {
outSize = BUFFER_SIZE_LIMIT;
/* There may be *lots* of data left to output... */
- dataTmp = Tcl_Realloc(dataTmp, outSize);
+ dataTmp = (char *)Tcl_Realloc(dataTmp, outSize);
}
}
@@ -1757,10 +1757,10 @@ Tcl_ZlibInflate(
if (gzipHeaderDictObj) {
headerPtr = &header;
memset(headerPtr, 0, sizeof(gz_header));
- nameBuf = Tcl_Alloc(MAXPATHLEN);
+ nameBuf = (char *)Tcl_Alloc(MAXPATHLEN);
header.name = (Bytef *) nameBuf;
header.name_max = MAXPATHLEN - 1;
- commentBuf = Tcl_Alloc(MAX_COMMENT_LEN);
+ commentBuf = (char *)Tcl_Alloc(MAX_COMMENT_LEN);
header.comment = (Bytef *) commentBuf;
header.comm_max = MAX_COMMENT_LEN - 1;
}
@@ -1925,7 +1925,7 @@ Tcl_ZlibAdler32(
static int
ZlibCmd(
- void *notUsed,
+ void *dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
@@ -1945,6 +1945,7 @@ ZlibCmd(
CMD_ADLER, CMD_COMPRESS, CMD_CRC, CMD_DECOMPRESS, CMD_DEFLATE,
CMD_GUNZIP, CMD_GZIP, CMD_INFLATE, CMD_PUSH, CMD_STREAM
};
+ (void)dummy;
if (objc < 2) {
Tcl_WrongNumArgs(interp, 1, objv, "command arg ?...?");
@@ -2530,7 +2531,7 @@ ZlibStreamCmd(
int objc,
Tcl_Obj *const objv[])
{
- Tcl_ZlibStream zstream = cd;
+ Tcl_ZlibStream zstream = (Tcl_ZlibStream)cd;
int command, count, code;
Tcl_Obj *obj;
static const char *const cmds[] = {
@@ -2656,7 +2657,7 @@ ZlibStreamAddCmd(
int objc,
Tcl_Obj *const objv[])
{
- Tcl_ZlibStream zstream = cd;
+ Tcl_ZlibStream zstream = (Tcl_ZlibStream)cd;
int index, code, buffersize = -1, flush = -1, i;
Tcl_Obj *obj, *compDictObj = NULL;
static const char *const add_options[] = {
@@ -2780,7 +2781,7 @@ ZlibStreamPutCmd(
int objc,
Tcl_Obj *const objv[])
{
- Tcl_ZlibStream zstream = cd;
+ Tcl_ZlibStream zstream = (Tcl_ZlibStream)cd;
int index, flush = -1, i;
Tcl_Obj *compDictObj = NULL;
static const char *const put_options[] = {
@@ -2869,7 +2870,7 @@ ZlibStreamHeaderCmd(
int objc,
Tcl_Obj *const objv[])
{
- ZlibStreamHandle *zshPtr = cd;
+ ZlibStreamHandle *zshPtr = (ZlibStreamHandle *)cd;
Tcl_Obj *resultObj;
if (objc != 2) {
@@ -2906,7 +2907,7 @@ ZlibTransformClose(
void *instanceData,
Tcl_Interp *interp)
{
- ZlibChannelData *cd = instanceData;
+ ZlibChannelData *cd = (ZlibChannelData *)instanceData;
int e, result = TCL_OK;
size_t written;
@@ -3000,7 +3001,7 @@ ZlibTransformInput(
int toRead,
int *errorCodePtr)
{
- ZlibChannelData *cd = instanceData;
+ ZlibChannelData *cd = (ZlibChannelData *)instanceData;
Tcl_DriverInputProc *inProc =
Tcl_ChannelInputProc(Tcl_GetChannelType(cd->parent));
int readBytes, gotBytes, copied;
@@ -3114,7 +3115,7 @@ ZlibTransformOutput(
int toWrite,
int *errorCodePtr)
{
- ZlibChannelData *cd = instanceData;
+ ZlibChannelData *cd = (ZlibChannelData *)instanceData;
Tcl_DriverOutputProc *outProc =
Tcl_ChannelOutputProc(Tcl_GetChannelType(cd->parent));
int e;
@@ -3237,7 +3238,7 @@ ZlibTransformSetOption( /* not used */
const char *optionName,
const char *value)
{
- ZlibChannelData *cd = instanceData;
+ ZlibChannelData *cd = (ZlibChannelData *)instanceData;
Tcl_DriverSetOptionProc *setOptionProc =
Tcl_ChannelSetOptionProc(Tcl_GetChannelType(cd->parent));
static const char *compressChanOptions = "dictionary flush";
@@ -3350,7 +3351,7 @@ ZlibTransformGetOption(
const char *optionName,
Tcl_DString *dsPtr)
{
- ZlibChannelData *cd = instanceData;
+ ZlibChannelData *cd = (ZlibChannelData *)instanceData;
Tcl_DriverGetOptionProc *getOptionProc =
Tcl_ChannelGetOptionProc(Tcl_GetChannelType(cd->parent));
static const char *compressChanOptions = "checksum dictionary";
@@ -3468,7 +3469,7 @@ ZlibTransformWatch(
void *instanceData,
int mask)
{
- ZlibChannelData *cd = instanceData;
+ ZlibChannelData *cd = (ZlibChannelData *)instanceData;
Tcl_DriverWatchProc *watchProc;
/*
@@ -3491,7 +3492,7 @@ ZlibTransformEventHandler(
void *instanceData,
int interestMask)
{
- ZlibChannelData *cd = instanceData;
+ ZlibChannelData *cd = (ZlibChannelData *)instanceData;
ZlibTransformEventTimerKill(cd);
return interestMask;
@@ -3511,7 +3512,7 @@ static void
ZlibTransformTimerRun(
void *clientData)
{
- ZlibChannelData *cd = clientData;
+ ZlibChannelData *cd = (ZlibChannelData *)clientData;
cd->timer = NULL;
Tcl_NotifyChannel(cd->chan, TCL_READABLE);
@@ -3534,7 +3535,7 @@ ZlibTransformGetHandle(
int direction,
void **handlePtr)
{
- ZlibChannelData *cd = instanceData;
+ ZlibChannelData *cd = (ZlibChannelData *)instanceData;
return Tcl_GetChannelHandle(cd->parent, direction, handlePtr);
}
@@ -3554,7 +3555,7 @@ ZlibTransformBlockMode(
void *instanceData,
int mode)
{
- ZlibChannelData *cd = instanceData;
+ ZlibChannelData *cd = (ZlibChannelData *)instanceData;
if (mode == TCL_MODE_NONBLOCKING) {
cd->flags |= ASYNC;
@@ -3604,7 +3605,7 @@ ZlibStackChannelTransform(
* dictionary (not dictObj!) to use if
* necessary. */
{
- ZlibChannelData *cd = Tcl_Alloc(sizeof(ZlibChannelData));
+ ZlibChannelData *cd = (ZlibChannelData *)Tcl_Alloc(sizeof(ZlibChannelData));
Tcl_Channel chan;
int wbits = 0;
@@ -3664,7 +3665,7 @@ ZlibStackChannelTransform(
goto error;
}
cd->inAllocated = DEFAULT_BUFFER_SIZE;
- cd->inBuffer = Tcl_Alloc(cd->inAllocated);
+ cd->inBuffer = (char *)Tcl_Alloc(cd->inAllocated);
if (cd->flags & IN_HEADER) {
if (inflateGetHeader(&cd->inStream, &cd->inHeader.header) != Z_OK) {
goto error;
@@ -3681,7 +3682,7 @@ ZlibStackChannelTransform(
goto error;
}
cd->outAllocated = DEFAULT_BUFFER_SIZE;
- cd->outBuffer = Tcl_Alloc(cd->outAllocated);
+ cd->outBuffer = (char *)Tcl_Alloc(cd->outAllocated);
if (cd->flags & OUT_HEADER) {
if (deflateSetHeader(&cd->outStream, &cd->outHeader.header) != Z_OK) {
goto error;
diff --git a/macosx/tclMacOSXBundle.c b/macosx/tclMacOSXBundle.c
index eeaf7b9..6714696 100644
--- a/macosx/tclMacOSXBundle.c
+++ b/macosx/tclMacOSXBundle.c
@@ -106,7 +106,7 @@ OpenResourceMap(
if (tclMacOSXDarwinRelease >= 8)
#endif
{
- openresourcemap = dlsym(RTLD_NEXT,
+ openresourcemap = (short (*)(CFBundleRef))dlsym(RTLD_NEXT,
"CFBundleOpenBundleResourceMap");
#ifdef TCL_DEBUG_LOAD
if (!openresourcemap) {
@@ -197,7 +197,7 @@ Tcl_MacOSXOpenBundleResources(
int
Tcl_MacOSXOpenVersionedBundleResources(
- Tcl_Interp *interp,
+ Tcl_Interp *dummy,
const char *bundleName,
const char *bundleVersion,
int hasResourceFile,
@@ -208,6 +208,7 @@ Tcl_MacOSXOpenVersionedBundleResources(
CFBundleRef bundleRef, versionedBundleRef = NULL;
CFStringRef bundleNameRef;
CFURLRef libURL;
+ (void)dummy;
libraryPath[0] = '\0';
diff --git a/macosx/tclMacOSXFCmd.c b/macosx/tclMacOSXFCmd.c
index 9d43c92..8dc3775 100644
--- a/macosx/tclMacOSXFCmd.c
+++ b/macosx/tclMacOSXFCmd.c
@@ -172,7 +172,7 @@ TclMacOSXGetFileAttribute(
} else {
alist.commonattr = ATTR_CMN_FNDRINFO;
}
- native = Tcl_FSGetNativePath(fileName);
+ native = (const char *)Tcl_FSGetNativePath(fileName);
result = getattrlist(native, &alist, &finfo, sizeof(fileinfobuf), 0);
if (result != 0) {
@@ -268,7 +268,7 @@ TclMacOSXSetFileAttribute(
} else {
alist.commonattr = ATTR_CMN_FNDRINFO;
}
- native = Tcl_FSGetNativePath(fileName);
+ native = (const char *)Tcl_FSGetNativePath(fileName);
result = getattrlist(native, &alist, &finfo, sizeof(fileinfobuf), 0);
if (result != 0) {
diff --git a/macosx/tclMacOSXNotify.c b/macosx/tclMacOSXNotify.c
index aa00475..3f37193 100644
--- a/macosx/tclMacOSXNotify.c
+++ b/macosx/tclMacOSXNotify.c
@@ -858,7 +858,7 @@ void
Tcl_AlertNotifier(
ClientData clientData)
{
- ThreadSpecificData *tsdPtr = clientData;
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)clientData;
if (tclNotifierHooks.alertNotifierProc) {
tclNotifierHooks.alertNotifierProc(clientData);
@@ -945,6 +945,8 @@ TimerWakeUp(
CFRunLoopTimerRef timer,
void *info)
{
+ (void)timer;
+ (void)info;
}
/*
@@ -1036,7 +1038,7 @@ Tcl_CreateFileHandler(
}
}
if (filePtr == NULL) {
- filePtr = Tcl_Alloc(sizeof(FileHandler));
+ filePtr = (FileHandler *)Tcl_Alloc(sizeof(FileHandler));
filePtr->fd = fd;
filePtr->readyMask = 0;
filePtr->nextPtr = tsdPtr->firstFileHandlerPtr;
@@ -1380,7 +1382,7 @@ QueueFileEvents(
{
SelectMasks readyMasks;
FileHandler *filePtr;
- ThreadSpecificData *tsdPtr = info;
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)info;
/*
* Queue all detected file events.
@@ -1419,7 +1421,7 @@ QueueFileEvents(
*/
if (filePtr->readyMask == 0) {
- FileHandlerEvent *fileEvPtr = Tcl_Alloc(sizeof(FileHandlerEvent));
+ FileHandlerEvent *fileEvPtr = (FileHandlerEvent *)Tcl_Alloc(sizeof(FileHandlerEvent));
fileEvPtr->header.proc = FileHandlerEventProc;
fileEvPtr->fd = filePtr->fd;
@@ -1452,7 +1454,8 @@ UpdateWaitingListAndServiceEvents(
CFRunLoopActivity activity,
void *info)
{
- ThreadSpecificData *tsdPtr = info;
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)info;
+ (void)observer;
if (tsdPtr->sleeping) {
return;
@@ -1827,13 +1830,14 @@ TclUnixWaitForFile(
static TCL_NORETURN void
NotifierThreadProc(
- ClientData clientData) /* Not used. */
+ ClientData dummy) /* Not used. */
{
ThreadSpecificData *tsdPtr;
fd_set readableMask, writableMask, exceptionalMask;
int i, numFdBits = 0, polling;
struct timeval poll = {0., 0.}, *timePtr;
char buf[2];
+ (void)dummy;
/*
* Look for file events and report them to interested threads.
diff --git a/unix/configure b/unix/configure
index f4073cd..892288d 100755
--- a/unix/configure
+++ b/unix/configure
@@ -5036,7 +5036,7 @@ fi
if test "$GCC" = yes; then :
CFLAGS_OPTIMIZE=-O2
- CFLAGS_WARNING="-Wall -Wwrite-strings -Wsign-compare -Wdeclaration-after-statement -Wpointer-arith"
+ CFLAGS_WARNING="-Wall -Wextra -Wwrite-strings -Wsign-compare -Wpointer-arith"
else
diff --git a/unix/tcl.m4 b/unix/tcl.m4
index 1bf731e..7f4f70b 100644
--- a/unix/tcl.m4
+++ b/unix/tcl.m4
@@ -93,7 +93,7 @@ AC_DEFUN([SC_PATH_TCLCONFIG], [
`ls -d /usr/local/lib 2>/dev/null` \
`ls -d /usr/contrib/lib 2>/dev/null` \
`ls -d /usr/pkg/lib 2>/dev/null` \
- `ls -d /usr/lib/tcl8.7 2>/dev/null` \
+ `ls -d /usr/lib/tcl9.0 2>/dev/null` \
`ls -d /usr/lib 2>/dev/null` \
`ls -d /usr/lib64 2>/dev/null` \
`ls -d /usr/local/lib/tcl9.0 2>/dev/null` \
@@ -229,8 +229,8 @@ AC_DEFUN([SC_PATH_TKCONFIG], [
`ls -d /usr/lib/tk8.7 2>/dev/null` \
`ls -d /usr/lib 2>/dev/null` \
`ls -d /usr/lib64 2>/dev/null` \
- `ls -d /usr/local/lib/tk9.0 2>/dev/null` \
- `ls -d /usr/local/lib/tcl/tk9.0 2>/dev/null` \
+ `ls -d /usr/local/lib/tk8.7 2>/dev/null` \
+ `ls -d /usr/local/lib/tcl/tk8.7 2>/dev/null` \
; do
if test -f "$i/tkConfig.sh" ; then
ac_cv_c_tkconfig="`(cd $i; pwd)`"
@@ -966,7 +966,15 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
CFLAGS_DEBUG=-g
AS_IF([test "$GCC" = yes], [
CFLAGS_OPTIMIZE=-O2
- CFLAGS_WARNING="-Wall -Wwrite-strings -Wsign-compare -Wdeclaration-after-statement -Wpointer-arith"
+ CFLAGS_WARNING="-Wall -Wextra -Wwrite-strings -Wpointer-arith"
+ case "${CC}" in
+ *++)
+ ;;
+ *)
+ CFLAGS_WARNING="${CFLAGS_WARNING} -Wc++-compat -Wdeclaration-after-statement"
+ ;;
+ esac
+
], [
CFLAGS_OPTIMIZE=-O
CFLAGS_WARNING=""
diff --git a/unix/tclEpollNotfy.c b/unix/tclEpollNotfy.c
index 4d75781..f1d8cca 100644
--- a/unix/tclEpollNotfy.c
+++ b/unix/tclEpollNotfy.c
@@ -16,7 +16,9 @@
#ifndef HAVE_COREFOUNDATION /* Darwin/Mac OS X CoreFoundation notifier is
* in tclMacOSXNotify.c */
#if defined(NOTIFIER_EPOLL) && TCL_THREADS
-#define _GNU_SOURCE /* For pipe2(2) */
+#ifndef _GNU_SOURCE
+# define _GNU_SOURCE /* For pipe2(2) */
+#endif
#include <fcntl.h>
#include <signal.h>
#include <sys/epoll.h>
@@ -238,7 +240,7 @@ PlatformEventsControl(
newEvent.events |= EPOLLOUT;
}
if (isNew) {
- newPedPtr = Tcl_Alloc(sizeof(*newPedPtr));
+ newPedPtr = (struct PlatformEventData *)Tcl_Alloc(sizeof(struct PlatformEventData));
newPedPtr->filePtr = filePtr;
newPedPtr->tsdPtr = tsdPtr;
filePtr->pedPtr = newPedPtr;
@@ -370,7 +372,7 @@ PlatformEventsInit(void)
if (errno) {
Tcl_Panic("Tcl_InitNotifier: %s", "could not create mutex");
}
- filePtr = Tcl_Alloc(sizeof(*filePtr));
+ filePtr = (FileHandler *)Tcl_Alloc(sizeof(FileHandler));
#ifdef HAVE_EVENTFD
tsdPtr->triggerEventFd = eventfd(0, EFD_CLOEXEC | EFD_NONBLOCK);
if (tsdPtr->triggerEventFd <= 0) {
@@ -391,7 +393,7 @@ PlatformEventsInit(void)
PlatformEventsControl(filePtr, tsdPtr, EPOLL_CTL_ADD, 1);
if (!tsdPtr->readyEvents) {
tsdPtr->maxReadyEvents = 512;
- tsdPtr->readyEvents = Tcl_Alloc(
+ tsdPtr->readyEvents = (struct epoll_event *)Tcl_Alloc(
tsdPtr->maxReadyEvents * sizeof(tsdPtr->readyEvents[0]));
}
LIST_INIT(&tsdPtr->firstReadyFileHandlerPtr);
@@ -550,7 +552,7 @@ Tcl_CreateFileHandler(
}
}
if (filePtr == NULL) {
- filePtr = Tcl_Alloc(sizeof(FileHandler));
+ filePtr = (FileHandler *)Tcl_Alloc(sizeof(FileHandler));
filePtr->fd = fd;
filePtr->readyMask = 0;
filePtr->nextPtr = tsdPtr->firstFileHandlerPtr;
@@ -733,7 +735,7 @@ Tcl_WaitForEvent(
*/
if (filePtr->readyMask == 0) {
- FileHandlerEvent *fileEvPtr =
+ FileHandlerEvent *fileEvPtr = (FileHandlerEvent *)
Tcl_Alloc(sizeof(FileHandlerEvent));
fileEvPtr->header.proc = FileHandlerEventProc;
@@ -772,7 +774,7 @@ Tcl_WaitForEvent(
numFound = PlatformEventsWait(tsdPtr->readyEvents,
tsdPtr->maxReadyEvents, timeoutPtr);
for (numEvent = 0; numEvent < numFound; numEvent++) {
- pedPtr = tsdPtr->readyEvents[numEvent].data.ptr;
+ pedPtr = (struct PlatformEventData*)tsdPtr->readyEvents[numEvent].data.ptr;
filePtr = pedPtr->filePtr;
mask = PlatformEventsTranslate(&tsdPtr->readyEvents[numEvent]);
#ifdef HAVE_EVENTFD
@@ -810,7 +812,7 @@ Tcl_WaitForEvent(
*/
if (filePtr->readyMask == 0) {
- FileHandlerEvent *fileEvPtr =
+ FileHandlerEvent *fileEvPtr = (FileHandlerEvent *)
Tcl_Alloc(sizeof(FileHandlerEvent));
fileEvPtr->header.proc = FileHandlerEventProc;
diff --git a/unix/tclKqueueNotfy.c b/unix/tclKqueueNotfy.c
index bbb8061..6361d63 100644
--- a/unix/tclKqueueNotfy.c
+++ b/unix/tclKqueueNotfy.c
@@ -222,7 +222,7 @@ PlatformEventsControl(
struct stat fdStat;
if (isNew) {
- newPedPtr = Tcl_Alloc(sizeof(*newPedPtr));
+ newPedPtr = (struct PlatformEventData *)Tcl_Alloc(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 = Tcl_Alloc(sizeof(*filePtr));
+ filePtr = (FileHandler *)Tcl_Alloc(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 = Tcl_Alloc(
+ tsdPtr->readyEvents = (struct kevent *)Tcl_Alloc(
tsdPtr->maxReadyEvents * sizeof(tsdPtr->readyEvents[0]));
}
LIST_INIT(&tsdPtr->firstReadyFileHandlerPtr);
@@ -580,7 +580,7 @@ Tcl_CreateFileHandler(
}
}
if (filePtr == NULL) {
- filePtr = Tcl_Alloc(sizeof(FileHandler));
+ filePtr = (FileHandler *)Tcl_Alloc(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 *)
Tcl_Alloc(sizeof(FileHandlerEvent));
fileEvPtr->header.proc = FileHandlerEventProc;
@@ -828,7 +828,7 @@ Tcl_WaitForEvent(
*/
if (filePtr->readyMask == 0) {
- FileHandlerEvent *fileEvPtr =
+ FileHandlerEvent *fileEvPtr = (FileHandlerEvent *)
Tcl_Alloc(sizeof(FileHandlerEvent));
fileEvPtr->header.proc = FileHandlerEventProc;
diff --git a/unix/tclLoadDl.c b/unix/tclLoadDl.c
index d68df76..4b8fca6 100644
--- a/unix/tclLoadDl.c
+++ b/unix/tclLoadDl.c
@@ -83,7 +83,7 @@ TclpDlopen(
* relative path.
*/
- native = Tcl_FSGetNativePath(pathPtr);
+ native = (const char *)Tcl_FSGetNativePath(pathPtr);
/*
* Use (RTLD_NOW|RTLD_LOCAL) as default, see [Bug #3216070]
*/
@@ -131,7 +131,7 @@ TclpDlopen(
}
return TCL_ERROR;
}
- newHandle = Tcl_Alloc(sizeof(*newHandle));
+ newHandle = (Tcl_LoadHandle)Tcl_Alloc(sizeof(*newHandle));
newHandle->clientData = handle;
newHandle->findSymbolProcPtr = &FindSymbol;
newHandle->unloadFileProcPtr = &UnloadFile;
@@ -188,6 +188,31 @@ FindSymbol(
proc = dlsym(handle, native); /* INTL: Native. */
Tcl_DStringFree(&newName);
}
+#ifdef __cplusplus
+ if (proc == NULL) {
+ char buf[32];
+ sprintf(buf, "%d", (int)Tcl_DStringLength(&ds));
+ Tcl_DStringInit(&newName);
+ TclDStringAppendLiteral(&newName, "__Z");
+ Tcl_DStringAppend(&newName, buf, -1);
+ Tcl_DStringAppend(&newName, Tcl_DStringValue(&ds), -1);
+ TclDStringAppendLiteral(&newName, "P10Tcl_Interp");
+ native = Tcl_DStringValue(&newName);
+ proc = dlsym(handle, native + 1); /* INTL: Native. */
+ if (proc == NULL) {
+ proc = dlsym(handle, native); /* INTL: Native. */
+ }
+ if (proc == NULL) {
+ TclDStringAppendLiteral(&newName, "i");
+ native = Tcl_DStringValue(&newName);
+ proc = dlsym(handle, native + 1); /* INTL: Native. */
+ }
+ if (proc == NULL) {
+ proc = dlsym(handle, native); /* INTL: Native. */
+ }
+ Tcl_DStringFree(&newName);
+ }
+#endif
Tcl_DStringFree(&ds);
if (proc == NULL) {
const char *errorStr = dlerror();
@@ -261,6 +286,8 @@ TclGuessPackageName(
Tcl_DString *bufPtr) /* Initialized empty dstring. Append package
* name to this if possible. */
{
+ (void)fileName;
+ (void)bufPtr;
return 0;
}
diff --git a/unix/tclLoadDyld.c b/unix/tclLoadDyld.c
index af24841..dac4160 100644
--- a/unix/tclLoadDyld.c
+++ b/unix/tclLoadDyld.c
@@ -183,7 +183,7 @@ TclpDlopen(
* relative path.
*/
- nativePath = Tcl_FSGetNativePath(pathPtr);
+ nativePath = (const char *)Tcl_FSGetNativePath(pathPtr);
nativeFileName = Tcl_UtfToExternalDString(NULL, TclGetString(pathPtr),
-1, &ds);
@@ -258,7 +258,7 @@ TclpDlopen(
module = NSLinkModule(dyldObjFileImage, nativePath, nsflags);
NSDestroyObjectFileImage(dyldObjFileImage);
if (module) {
- modulePtr = Tcl_Alloc(sizeof(Tcl_DyldModuleHandle));
+ modulePtr = (Tcl_DyldModuleHandle *)Tcl_Alloc(sizeof(Tcl_DyldModuleHandle));
modulePtr->module = module;
modulePtr->nextPtr = NULL;
} else {
@@ -278,13 +278,13 @@ TclpDlopen(
|| dyldLibHeader || modulePtr
#endif /* TCL_DYLD_USE_NSMODULE */
) {
- dyldLoadHandle = Tcl_Alloc(sizeof(Tcl_DyldLoadHandle));
+ dyldLoadHandle = (Tcl_DyldLoadHandle *)Tcl_Alloc(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 = Tcl_Alloc(sizeof(*newHandle));
+ newHandle = (Tcl_LoadHandle)Tcl_Alloc(sizeof(*newHandle));
newHandle->clientData = dyldLoadHandle;
newHandle->findSymbolProcPtr = &FindSymbol;
newHandle->unloadFileProcPtr = &UnloadFile;
@@ -334,7 +334,7 @@ FindSymbol(
Tcl_LoadHandle loadHandle, /* Handle from TclpDlopen. */
const char *symbol) /* Symbol name to look up. */
{
- Tcl_DyldLoadHandle *dyldLoadHandle = loadHandle->clientData;
+ Tcl_DyldLoadHandle *dyldLoadHandle = (Tcl_DyldLoadHandle *)loadHandle->clientData;
Tcl_PackageInitProc *proc = NULL;
const char *errMsg = NULL;
Tcl_DString ds;
@@ -343,7 +343,7 @@ FindSymbol(
native = Tcl_UtfToExternalDString(NULL, symbol, -1, &ds);
if (dyldLoadHandle->dlHandle) {
#if TCL_DYLD_USE_DLFCN
- proc = dlsym(dyldLoadHandle->dlHandle, native);
+ proc = (Tcl_PackageInitProc *)dlsym(dyldLoadHandle->dlHandle, native);
if (!proc) {
errMsg = dlerror();
}
@@ -381,7 +381,7 @@ FindSymbol(
modulePtr = modulePtr->nextPtr;
}
if (modulePtr == NULL) {
- modulePtr = Tcl_Alloc(sizeof(Tcl_DyldModuleHandle));
+ modulePtr = (Tcl_DyldModuleHandle *)Tcl_Alloc(sizeof(Tcl_DyldModuleHandle));
modulePtr->module = module;
modulePtr->nextPtr = dyldLoadHandle->modulePtr;
dyldLoadHandle->modulePtr = modulePtr;
@@ -399,7 +399,7 @@ FindSymbol(
dyldLoadHandle->modulePtr->module, native);
}
if (nsSymbol) {
- proc = NSAddressOfSymbol(nsSymbol);
+ proc = (Tcl_PackageInitProc *)NSAddressOfSymbol(nsSymbol);
}
Tcl_DStringFree(&newName);
#endif /* TCL_DYLD_USE_NSMODULE */
@@ -411,7 +411,7 @@ FindSymbol(
Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "LOAD_SYMBOL", symbol,
NULL);
}
- return proc;
+ return (void *)proc;
}
/*
@@ -440,7 +440,7 @@ UnloadFile(
* TclpDlopen(). The loadHandle is a token
* that represents the loaded file. */
{
- Tcl_DyldLoadHandle *dyldLoadHandle = loadHandle->clientData;
+ Tcl_DyldLoadHandle *dyldLoadHandle = (Tcl_DyldLoadHandle *)loadHandle->clientData;
if (dyldLoadHandle->dlHandle) {
#if TCL_DYLD_USE_DLFCN
@@ -491,6 +491,9 @@ TclGuessPackageName(
Tcl_DString *bufPtr) /* Initialized empty dstring. Append package
* name to this if possible. */
{
+ (void)fileName;
+ (void)bufPtr;
+
return 0;
}
@@ -513,10 +516,11 @@ TclGuessPackageName(
#ifdef TCL_LOAD_FROM_MEMORY
MODULE_SCOPE void *
TclpLoadMemoryGetBuffer(
- Tcl_Interp *interp, /* Used for error reporting. */
+ Tcl_Interp *dummy, /* Used for error reporting. */
int size) /* Size of desired buffer. */
{
void *buffer = NULL;
+ (void)dummy;
/*
* NSCreateObjectFileImageFromMemory is available but always fails
@@ -588,7 +592,7 @@ TclpLoadMemory(
if (codeSize >= 0) {
NSObjectFileImageReturnCode err = NSObjectFileImageSuccess;
- const struct fat_header *fh = buffer;
+ const struct fat_header *fh = (const struct fat_header *)buffer;
uint32_t ms = 0;
#ifndef __LP64__
const struct mach_header *mh = NULL;
@@ -617,18 +621,18 @@ TclpLoadMemory(
struct fat_arch *fa;
if (fh->magic != FAT_MAGIC) {
- swap_fat_arch(fatarchs, fh_nfat_arch, arch->byteorder);
+ swap_fat_arch((struct fat_arch *)fatarchs, fh_nfat_arch, arch->byteorder);
}
fa = NXFindBestFatArch(arch->cputype | arch_abi,
- arch->cpusubtype, fatarchs, fh_nfat_arch);
+ arch->cpusubtype, (struct fat_arch *)fatarchs, fh_nfat_arch);
if (fa) {
- mh = (void *)((char *) buffer + fa->offset);
+ mh = (const struct mach_header_64 *)((char *) buffer + fa->offset);
ms = fa->size;
} else {
err = NSObjectFileImageInappropriateFile;
}
if (fh->magic != FAT_MAGIC) {
- swap_fat_arch(fatarchs, fh_nfat_arch, arch->byteorder);
+ swap_fat_arch((struct fat_arch *)fatarchs, fh_nfat_arch, arch->byteorder);
}
} else {
err = NSObjectFileImageInappropriateFile;
@@ -638,7 +642,7 @@ TclpLoadMemory(
* Thin binary
*/
- mh = buffer;
+ mh = (const struct mach_header_64 *)buffer;
ms = codeSize;
}
if (ms && !(ms >= mh_size && mh->magic == mh_magic &&
@@ -693,14 +697,14 @@ TclpLoadMemory(
* Stash the module reference within the load handle we create and return.
*/
- modulePtr = Tcl_Alloc(sizeof(Tcl_DyldModuleHandle));
+ modulePtr = (Tcl_DyldModuleHandle *)Tcl_Alloc(sizeof(Tcl_DyldModuleHandle));
modulePtr->module = module;
modulePtr->nextPtr = NULL;
- dyldLoadHandle = Tcl_Alloc(sizeof(Tcl_DyldLoadHandle));
+ dyldLoadHandle = (Tcl_DyldLoadHandle *)Tcl_Alloc(sizeof(Tcl_DyldLoadHandle));
dyldLoadHandle->dlHandle = NULL;
dyldLoadHandle->dyldLibHeader = NULL;
dyldLoadHandle->modulePtr = modulePtr;
- newHandle = Tcl_Alloc(sizeof(*newHandle));
+ newHandle = (Tcl_LoadHandle)Tcl_Alloc(sizeof(*newHandle));
newHandle->clientData = dyldLoadHandle;
newHandle->findSymbolProcPtr = &FindSymbol;
newHandle->unloadFileProcPtr = &UnloadFile;
diff --git a/unix/tclLoadNext.c b/unix/tclLoadNext.c
index 393bfc5..5fa9c21 100644
--- a/unix/tclLoadNext.c
+++ b/unix/tclLoadNext.c
@@ -101,7 +101,7 @@ TclpDlopen(
}
NXCloseMemory(errorStream, NX_FREEBUFFER);
- newHandle = Tcl_Alloc(sizeof(Tcl_LoadHandle));
+ newHandle = (Tcl_LoadHandle) Tcl_Alloc(sizeof(*newHandle));
newHandle->clientData = INT2PTR(1);
newHandle->findSymbolProcPtr = &FindSymbol;
newHandle->unloadFileProcPtr = &UnloadFile;
diff --git a/unix/tclLoadOSF.c b/unix/tclLoadOSF.c
index f67725f..a69a0be 100644
--- a/unix/tclLoadOSF.c
+++ b/unix/tclLoadOSF.c
@@ -128,7 +128,7 @@ TclpDlopen(
} else {
pkg++;
}
- newHandle = Tcl_Alloc(sizeof(*newHandle));
+ newHandle = (Tcl_LoadHandle)Tcl_Alloc(sizeof(*newHandle));
newHandle->clientData = pkg;
newHandle->findSymbolProcPtr = &FindSymbol;
newHandle->unloadFileProcPtr = &UnloadFile;
diff --git a/unix/tclLoadShl.c b/unix/tclLoadShl.c
index fc5f27c..534ca4d 100644
--- a/unix/tclLoadShl.c
+++ b/unix/tclLoadShl.c
@@ -97,7 +97,7 @@ TclpDlopen(
fileName, Tcl_PosixError(interp)));
return TCL_ERROR;
}
- newHandle = Tcl_Alloc(sizeof(*newHandle));
+ newHandle = (Tcl_LoadHandle)Tcl_Alloc(sizeof(*newHandle));
newHandle->clientData = handle;
newHandle->findSymbolProcPtr = &FindSymbol;
newHandle->unloadFileProcPtr = *unloadProcPtr = &UnloadFile;
diff --git a/unix/tclSelectNotfy.c b/unix/tclSelectNotfy.c
index 62d77dd..2a22639 100644
--- a/unix/tclSelectNotfy.c
+++ b/unix/tclSelectNotfy.c
@@ -210,6 +210,9 @@ static int FileHandlerEventProc(Tcl_Event *evPtr, int flags);
*/
#if defined(__CYGWIN__)
+#ifdef __cplusplus
+extern "C" {
+#endif
typedef struct {
void *hwnd; /* Messaging window. */
unsigned int *message; /* Message payload. */
@@ -260,9 +263,12 @@ extern unsigned char __stdcall TranslateMessage(const MSG *);
* Threaded-cygwin specific constants and functions in this file:
*/
-static const WCHAR className[] = L"TclNotifier";
+static const wchar_t className[] = L"TclNotifier";
static DWORD __stdcall NotifierProc(void *hwnd, unsigned int message,
void *wParam, void *lParam);
+#ifdef __cplusplus
+}
+#endif
#endif /* TCL_THREADS && __CYGWIN__ */
@@ -300,22 +306,22 @@ Tcl_InitNotifier(void)
*/
if (tsdPtr->waitCVinitialized == 0) {
#ifdef __CYGWIN__
- WNDCLASSW class;
-
- class.style = 0;
- class.cbClsExtra = 0;
- class.cbWndExtra = 0;
- class.hInstance = TclWinGetTclInstance();
- class.hbrBackground = NULL;
- class.lpszMenuName = NULL;
- class.lpszClassName = className;
- class.lpfnWndProc = NotifierProc;
- class.hIcon = NULL;
- class.hCursor = NULL;
-
- RegisterClassW(&class);
- tsdPtr->hwnd = CreateWindowExW(NULL, class.lpszClassName,
- class.lpszClassName, 0, 0, 0, 0, 0, NULL, NULL,
+ WNDCLASSW clazz;
+
+ clazz.style = 0;
+ clazz.cbClsExtra = 0;
+ clazz.cbWndExtra = 0;
+ clazz.hInstance = TclWinGetTclInstance();
+ clazz.hbrBackground = NULL;
+ clazz.lpszMenuName = NULL;
+ clazz.lpszClassName = className;
+ clazz.lpfnWndProc = (void *)NotifierProc;
+ clazz.hIcon = NULL;
+ clazz.hCursor = NULL;
+
+ RegisterClassW(&clazz);
+ tsdPtr->hwnd = CreateWindowExW(NULL, clazz.lpszClassName,
+ clazz.lpszClassName, 0, 0, 0, 0, 0, NULL, NULL,
TclWinGetTclInstance(), NULL);
tsdPtr->event = CreateEventW(NULL, 1 /* manual */,
0 /* !signaled */, NULL);
@@ -467,7 +473,7 @@ Tcl_CreateFileHandler(
}
}
if (filePtr == NULL) {
- filePtr = Tcl_Alloc(sizeof(FileHandler));
+ filePtr = (FileHandler *)Tcl_Alloc(sizeof(FileHandler));
filePtr->fd = fd;
filePtr->readyMask = 0;
filePtr->nextPtr = tsdPtr->firstFileHandlerPtr;
@@ -880,7 +886,7 @@ Tcl_WaitForEvent(
if (filePtr->readyMask == 0) {
FileHandlerEvent *fileEvPtr =
- Tcl_Alloc(sizeof(FileHandlerEvent));
+ (FileHandlerEvent *)Tcl_Alloc(sizeof(FileHandlerEvent));
fileEvPtr->header.proc = FileHandlerEventProc;
fileEvPtr->fd = filePtr->fd;
@@ -922,7 +928,7 @@ Tcl_WaitForEvent(
#if TCL_THREADS
static TCL_NORETURN void
NotifierThreadProc(
- ClientData clientData) /* Not used. */
+ ClientData dummy) /* Not used. */
{
ThreadSpecificData *tsdPtr;
fd_set readableMask;
@@ -931,9 +937,10 @@ NotifierThreadProc(
int i;
int fds[2], receivePipe;
long found;
- struct timeval poll = {0., 0.}, *timePtr;
+ struct timeval poll = {0, 0}, *timePtr;
char buf[2];
int numFdBits = 0;
+ (void)dummy;
if (pipe(fds) != 0) {
Tcl_Panic("NotifierThreadProc: %s", "could not create trigger pipe");
diff --git a/unix/tclUnixChan.c b/unix/tclUnixChan.c
index f1838a2..2314ba3 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,11 +352,12 @@ FileOutputProc(
static int
FileCloseProc(
- ClientData instanceData, /* File state. */
- Tcl_Interp *interp) /* For error reporting - unused. */
+ void *instanceData, /* File state. */
+ Tcl_Interp *dummy) /* For error reporting - unused. */
{
- FileState *fsPtr = instanceData;
+ FileState *fsPtr = (FileState *)instanceData;
int errorCode = 0;
+ (void)dummy;
Tcl_DeleteFileHandler(fsPtr->fd);
@@ -377,10 +378,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 +436,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 +497,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 +531,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 +573,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 +640,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;
size_t len, vlen;
TtyAttrs tty;
int argc;
@@ -978,12 +979,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;
size_t len;
char buf[3*TCL_INTEGER_SPACE + 16];
int valid = 0; /* Flag if valid option parsed. */
@@ -1652,7 +1653,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 +1713,7 @@ TclpOpenFileChannel(
sprintf(channelName, "file%d", fd);
}
- fsPtr = Tcl_Alloc(sizeof(TtyState));
+ fsPtr = (TtyState *)Tcl_Alloc(sizeof(TtyState));
fsPtr->fileState.validMask = channelPermissions | TCL_EXCEPTION;
fsPtr->fileState.fd = fd;
#ifdef SUPPORTS_TTY
@@ -1763,7 +1764,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. */
{
@@ -1792,7 +1793,7 @@ 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);
}
goto normalChannelAfterAll;
} else {
@@ -1801,7 +1802,7 @@ Tcl_MakeFileChannel(
sprintf(channelName, "file%d", fd);
}
- fsPtr = Tcl_Alloc(sizeof(TtyState));
+ fsPtr = (TtyState *)Tcl_Alloc(sizeof(TtyState));
fsPtr->fileState.fd = fd;
fsPtr->fileState.validMask = mode | TCL_EXCEPTION;
fsPtr->fileState.channel = Tcl_CreateChannel(channelTypePtr, channelName,
@@ -1932,18 +1933,19 @@ Tcl_GetOpenFile(
const char *chanID, /* String that identifies file. */
int forWriting, /* 1 means the file is going to be used for
* writing, 0 means for reading. */
- int checkUsage, /* 1 means verify that the file was opened in
+ int dummy, /* 1 means verify that the file was opened in
* a mode that allows the access specified by
* "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;
+ (void)dummy;
chan = Tcl_GetChannel(interp, chanID, &chanMode);
if (chan == NULL) {
@@ -2027,10 +2029,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 9b8acc9..3b81e6f 100644
--- a/unix/tclUnixCompat.c
+++ b/unix/tclUnixCompat.c
@@ -116,10 +116,10 @@ static int CopyString(const char *src, char *buf, int buflen);
#endif
#ifdef NEED_PW_CLEANER
-static void FreePwBuf(ClientData ignored);
+static void FreePwBuf(ClientData dummy);
#endif
#ifdef NEED_GR_CLEANER
-static void FreeGrBuf(ClientData ignored);
+static void FreeGrBuf(ClientData dummy);
#endif
#endif /* TCL_THREADS */
@@ -199,7 +199,7 @@ TclpGetPwNam(
if (tsdPtr->pbuflen < 1) {
tsdPtr->pbuflen = 1024;
}
- tsdPtr->pbuf = Tcl_Alloc(tsdPtr->pbuflen);
+ tsdPtr->pbuf = (char *)Tcl_Alloc(tsdPtr->pbuflen);
Tcl_CreateThreadExitHandler(FreePwBuf, NULL);
}
while (1) {
@@ -212,7 +212,7 @@ TclpGetPwNam(
return NULL;
}
tsdPtr->pbuflen *= 2;
- tsdPtr->pbuf = Tcl_Realloc(tsdPtr->pbuf, tsdPtr->pbuflen);
+ tsdPtr->pbuf = (char *)Tcl_Realloc(tsdPtr->pbuf, tsdPtr->pbuflen);
}
return (pwPtr != NULL ? &tsdPtr->pwd : NULL);
@@ -279,7 +279,7 @@ TclpGetPwUid(
if (tsdPtr->pbuflen < 1) {
tsdPtr->pbuflen = 1024;
}
- tsdPtr->pbuf = Tcl_Alloc(tsdPtr->pbuflen);
+ tsdPtr->pbuf = (char *)Tcl_Alloc(tsdPtr->pbuflen);
Tcl_CreateThreadExitHandler(FreePwBuf, NULL);
}
while (1) {
@@ -292,7 +292,7 @@ TclpGetPwUid(
return NULL;
}
tsdPtr->pbuflen *= 2;
- tsdPtr->pbuf = Tcl_Realloc(tsdPtr->pbuf, tsdPtr->pbuflen);
+ tsdPtr->pbuf = (char *)Tcl_Realloc(tsdPtr->pbuf, tsdPtr->pbuflen);
}
return (pwPtr != NULL ? &tsdPtr->pwd : NULL);
@@ -334,9 +334,10 @@ TclpGetPwUid(
#ifdef NEED_PW_CLEANER
static void
FreePwBuf(
- ClientData ignored)
+ ClientData dummy)
{
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
+ (void)dummy;
Tcl_Free(tsdPtr->pbuf);
}
@@ -382,7 +383,7 @@ TclpGetGrNam(
if (tsdPtr->gbuflen < 1) {
tsdPtr->gbuflen = 1024;
}
- tsdPtr->gbuf = Tcl_Alloc(tsdPtr->gbuflen);
+ tsdPtr->gbuf = (char*)Tcl_Alloc(tsdPtr->gbuflen);
Tcl_CreateThreadExitHandler(FreeGrBuf, NULL);
}
while (1) {
@@ -395,7 +396,7 @@ TclpGetGrNam(
return NULL;
}
tsdPtr->gbuflen *= 2;
- tsdPtr->gbuf = Tcl_Realloc(tsdPtr->gbuf, tsdPtr->gbuflen);
+ tsdPtr->gbuf = (char *)Tcl_Realloc(tsdPtr->gbuf, tsdPtr->gbuflen);
}
return (grPtr != NULL ? &tsdPtr->grp : NULL);
@@ -462,7 +463,7 @@ TclpGetGrGid(
if (tsdPtr->gbuflen < 1) {
tsdPtr->gbuflen = 1024;
}
- tsdPtr->gbuf = Tcl_Alloc(tsdPtr->gbuflen);
+ tsdPtr->gbuf = (char*)Tcl_Alloc(tsdPtr->gbuflen);
Tcl_CreateThreadExitHandler(FreeGrBuf, NULL);
}
while (1) {
@@ -475,7 +476,7 @@ TclpGetGrGid(
return NULL;
}
tsdPtr->gbuflen *= 2;
- tsdPtr->gbuf = Tcl_Realloc(tsdPtr->gbuf, tsdPtr->gbuflen);
+ tsdPtr->gbuf = (char *)Tcl_Realloc(tsdPtr->gbuf, tsdPtr->gbuflen);
}
return (grPtr != NULL ? &tsdPtr->grp : NULL);
@@ -517,9 +518,10 @@ TclpGetGrGid(
#ifdef NEED_GR_CLEANER
static void
FreeGrBuf(
- ClientData ignored)
+ ClientData dummy)
{
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
+ (void)dummy;
Tcl_Free(tsdPtr->gbuf);
}
diff --git a/unix/tclUnixFCmd.c b/unix/tclUnixFCmd.c
index b32a2a2..1e2156c 100644
--- a/unix/tclUnixFCmd.c
+++ b/unix/tclUnixFCmd.c
@@ -111,16 +111,8 @@ typedef int (TraversalProc)(Tcl_DString *srcPtr, Tcl_DString *dstPtr,
* elsewhere in Tcl's core.
*/
-#ifdef DJGPP
-
-/*
- * See contrib/djgpp/tclDjgppFCmd.c for definition.
- */
-
-extern TclFileAttrProcs tclpFileAttrProcs[];
-extern const char *const tclpFileAttrStrings[];
+#ifndef DJGPP
-#else /* !DJGPP */
enum {
#if defined(__CYGWIN__)
UNIX_ARCHIVE_ATTRIBUTE,
@@ -143,7 +135,6 @@ enum {
UNIX_INVALID_ATTRIBUTE /* lint - last enum value needs no trailing , */
};
-MODULE_SCOPE const char *const tclpFileAttrStrings[];
const char *const tclpFileAttrStrings[] = {
#if defined(__CYGWIN__)
"-archive",
@@ -165,7 +156,6 @@ const char *const tclpFileAttrStrings[] = {
NULL
};
-MODULE_SCOPE const TclFileAttrProcs tclpFileAttrProcs[];
const TclFileAttrProcs tclpFileAttrProcs[] = {
#if defined(__CYGWIN__)
{GetUnixFileAttributes, SetUnixFileAttributes},
@@ -334,8 +324,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
@@ -450,14 +440,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
@@ -613,7 +603,7 @@ TclUnixCopyFile(
if (blockSize <= 0) {
blockSize = DEFAULT_COPY_BLOCK_SIZE;
}
- buffer = Tcl_Alloc(blockSize);
+ buffer = (char *)Tcl_Alloc(blockSize);
while (1) {
nread = read(srcFd, buffer, blockSize);
if ((nread == TCL_IO_FAILURE) || (nread == 0)) {
@@ -712,7 +702,7 @@ int
TclpObjCreateDirectory(
Tcl_Obj *pathPtr)
{
- return DoCreateDirectory(Tcl_FSGetNativePath(pathPtr));
+ return DoCreateDirectory((const char *)Tcl_FSGetNativePath(pathPtr));
}
static int
@@ -1243,7 +1233,7 @@ TraversalCopy(
static int
TraversalDelete(
Tcl_DString *srcPtr, /* Source pathname (native). */
- Tcl_DString *ignore, /* Destination pathname (not used). */
+ Tcl_DString *dummy, /* Destination pathname (not used). */
const Tcl_StatBuf *statBufPtr,
/* Stat info for file specified by srcPtr. */
int type, /* Reason for call - see TraverseUnixTree(). */
@@ -1251,6 +1241,9 @@ TraversalDelete(
* filled with UTF-8 name of file causing
* error. */
{
+ (void)dummy;
+ (void)statBufPtr;
+
switch (type) {
case DOTREE_F:
if (TclpDeleteFile(Tcl_DStringValue(srcPtr)) == 0) {
@@ -1299,6 +1292,7 @@ CopyFileAtts(
{
struct utimbuf tval;
mode_t newMode;
+ (void)src;
newMode = statBufPtr->st_mode
& (S_ISUID | S_ISGID | S_IRWXU | S_IRWXG | S_IRWXO);
@@ -1357,6 +1351,7 @@ GetGroupAttribute(
Tcl_StatBuf statBuf;
struct group *groupPtr;
int result;
+ (void)objIndex;
result = TclpObjStat(fileName, &statBuf);
@@ -1411,6 +1406,7 @@ GetOwnerAttribute(
Tcl_StatBuf statBuf;
struct passwd *pwPtr;
int result;
+ (void)objIndex;
result = TclpObjStat(fileName, &statBuf);
@@ -1462,6 +1458,7 @@ GetPermissionsAttribute(
{
Tcl_StatBuf statBuf;
int result;
+ (void)objIndex;
result = TclpObjStat(fileName, &statBuf);
@@ -1505,6 +1502,7 @@ SetGroupAttribute(
Tcl_WideInt gid;
int result;
const char *native;
+ (void)objIndex;
if (Tcl_GetWideIntFromObj(NULL, attributePtr, &gid) != TCL_OK) {
Tcl_DString ds;
@@ -1532,7 +1530,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) {
@@ -1572,6 +1570,7 @@ SetOwnerAttribute(
Tcl_WideInt uid;
int result;
const char *native;
+ (void)objIndex;
if (Tcl_GetWideIntFromObj(NULL, attributePtr, &uid) != TCL_OK) {
Tcl_DString ds;
@@ -1599,7 +1598,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) {
@@ -1642,6 +1641,7 @@ SetPermissionsAttribute(
const char *native;
const char *modeStringPtr = TclGetString(attributePtr);
int scanned = TclParseAllWhiteSpace(modeStringPtr, -1);
+ (void)objIndex;
/*
* First supply support for octal number format
@@ -1693,7 +1693,7 @@ SetPermissionsAttribute(
}
}
- native = Tcl_FSGetNativePath(fileName);
+ native = (const char *)Tcl_FSGetNativePath(fileName);
result = chmod(native, newMode); /* INTL: Native. */
if (result != 0) {
if (interp != NULL) {
@@ -1754,7 +1754,7 @@ TclpObjListVolumes(void)
static int
GetModeFromPermString(
- Tcl_Interp *interp, /* The interp we are using for errors. */
+ Tcl_Interp *dummy, /* The interp we are using for errors. */
const char *modeStringPtr, /* Permissions string */
mode_t *modePtr) /* pointer to the mode value */
{
@@ -1763,6 +1763,7 @@ GetModeFromPermString(
* is passed in), to allow for the chmod style
* manipulation. */
int i,n, who, op, what, op_found, who_found;
+ (void)dummy;
/*
* We start off checking for an "rwxrwxrwx" style permissions string
@@ -1941,7 +1942,7 @@ GetModeFromPermString(
int
TclpObjNormalizePath(
- Tcl_Interp *interp,
+ Tcl_Interp *dummy,
Tcl_Obj *pathPtr, /* An unshared object containing the path to
* normalize. */
int nextCheckpoint) /* offset to start at in pathPtr. Must either
@@ -1960,6 +1961,7 @@ TclpObjNormalizePath(
#ifndef NO_REALPATH
char normPath[MAXPATHLEN];
#endif
+ (void)dummy;
currentPathEndPosition = path + nextCheckpoint;
if (*currentPathEndPosition == '/') {
@@ -1972,7 +1974,7 @@ TclpObjNormalizePath(
* Try to get the entire path in one go
*/
- char *lastDir = strrchr(currentPathEndPosition, '/');
+ const char *lastDir = strrchr(currentPathEndPosition, '/');
if (lastDir != NULL) {
nativePath = Tcl_UtfToExternalDString(NULL, path,
@@ -2174,7 +2176,7 @@ TclUnixOpenTemporaryFile(
Tcl_Obj *extensionObj,
Tcl_Obj *resultingNameObj)
{
- Tcl_DString template, tmp;
+ Tcl_DString templ, tmp;
const char *string;
int fd;
size_t length;
@@ -2185,46 +2187,46 @@ TclUnixOpenTemporaryFile(
if (dirObj) {
string = TclGetStringFromObj(dirObj, &length);
- Tcl_UtfToExternalDString(NULL, string, length, &template);
+ Tcl_UtfToExternalDString(NULL, string, 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 = TclGetStringFromObj(basenameObj, &length);
Tcl_UtfToExternalDString(NULL, string, 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 = TclGetStringFromObj(extensionObj, &length);
Tcl_UtfToExternalDString(NULL, string, 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);
@@ -2235,10 +2237,10 @@ TclUnixOpenTemporaryFile(
* this!
*/
- unlink(Tcl_DStringValue(&template));
+ unlink(Tcl_DStringValue(&templ));
errno = 0;
}
- Tcl_DStringFree(&template);
+ Tcl_DStringFree(&templ);
return fd;
}
@@ -2298,7 +2300,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"
@@ -2310,37 +2312,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;
}
@@ -2348,9 +2350,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);
}
@@ -2372,11 +2374,11 @@ winPathFromObj(
Tcl_Obj *fileName)
{
size_t 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 = Tcl_Alloc(size);
+ winPath = (WCHAR *)Tcl_Alloc(size);
cygwin_conv_path(1, native, winPath, size);
return winPath;
@@ -2511,6 +2513,7 @@ GetUnixFileAttributes(
{
Tcl_StatBuf statBuf;
int result;
+ (void)objIndex;
result = TclpObjStat(fileName, &statBuf);
@@ -2553,6 +2556,7 @@ SetUnixFileAttributes(
Tcl_StatBuf statBuf;
int result, readonly;
const char *native;
+ (void)objIndex;
if (Tcl_GetBooleanFromObj(interp, attributePtr, &readonly) != TCL_OK) {
return TCL_ERROR;
@@ -2575,7 +2579,7 @@ SetUnixFileAttributes(
statBuf.st_flags &= ~UF_IMMUTABLE;
}
- native = Tcl_FSGetNativePath(fileName);
+ native = (const char *)Tcl_FSGetNativePath(fileName);
result = chflags(native, statBuf.st_flags); /* INTL: Native. */
if (result != 0) {
if (interp != NULL) {
diff --git a/unix/tclUnixFile.c b/unix/tclUnixFile.c
index 944bec8..83c194a 100644
--- a/unix/tclUnixFile.c
+++ b/unix/tclUnixFile.c
@@ -44,6 +44,8 @@ TclpFindExecutable(
size_t length;
wchar_t buf[PATH_MAX];
char name[PATH_MAX * 3 + 1];
+ (void)argv0;
+
GetModuleFileNameW(NULL, buf, PATH_MAX);
cygwin_conv_path(3, buf, name, PATH_MAX);
length = strlen(name);
@@ -249,9 +251,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);
@@ -555,6 +557,8 @@ NativeMatchType(
return matchResult;
}
}
+#else
+ (void)interp;
#endif /* MAC_OSX_TCL */
return 1;
@@ -622,7 +626,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 +654,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 +683,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 +724,7 @@ TclpGetNativeCwd(
#endif /* USEGETWD */
if ((clientData == NULL) || strcmp(buffer, (const char *) clientData)) {
- char *newCd = Tcl_Alloc(strlen(buffer) + 1);
+ char *newCd = (char*)Tcl_Alloc(strlen(buffer) + 1);
strcpy(newCd, buffer);
return newCd;
@@ -847,7 +851,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 +868,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 +914,7 @@ TclpObjLink(
Tcl_DecrRefCount(absPtr);
Tcl_DecrRefCount(dirPtr);
} else {
- target = Tcl_FSGetNativePath(toPtr);
+ target = (const char*)Tcl_FSGetNativePath(toPtr);
if (target == NULL) {
return NULL;
}
@@ -983,7 +987,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;
}
@@ -1019,6 +1023,7 @@ Tcl_Obj *
TclpFilesystemPathType(
Tcl_Obj *pathPtr)
{
+ (void)pathPtr;
/*
* All native paths are of the same type.
*/
@@ -1116,7 +1121,7 @@ TclNativeCreateNativeRep(
return NULL;
}
Tcl_DecrRefCount(validPathPtr);
- nativePathPtr = Tcl_Alloc(len);
+ nativePathPtr = (char *)Tcl_Alloc(len);
memcpy(nativePathPtr, Tcl_DStringValue(&ds), len);
Tcl_DStringFree(&ds);
@@ -1157,7 +1162,7 @@ TclNativeDupInternalRep(
len = (strlen((const char*) clientData) + 1) * sizeof(char);
- copy = Tcl_Alloc(len);
+ copy = (char *)Tcl_Alloc(len);
memcpy(copy, clientData, len);
return copy;
}
@@ -1183,7 +1188,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 +1199,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 +1222,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 2aa64bf..b37d4ad 100644
--- a/unix/tclUnixInit.c
+++ b/unix/tclUnixInit.c
@@ -31,6 +31,9 @@
#endif
#ifdef __CYGWIN__
+#ifdef __cplusplus
+extern "C" {
+#endif
#ifdef __clang__
#pragma clang diagnostic ignored "-Wignored-attributes"
#endif
@@ -39,6 +42,9 @@ DLLIMPORT extern __stdcall void *GetModuleHandleW(const void *);
DLLIMPORT extern __stdcall void FreeLibrary(void *);
DLLIMPORT extern __stdcall void *GetProcAddress(void *, const char *);
DLLIMPORT extern __stdcall void GetSystemInfo(void *);
+#ifdef __cplusplus
+}
+#endif
#define NUMPROCESSORS 11
static const char *const processors[NUMPROCESSORS] = {
@@ -539,7 +545,7 @@ TclpInitLibraryPath(
*encodingPtr = Tcl_GetEncoding(NULL, NULL);
str = TclGetStringFromObj(pathPtr, lengthPtr);
- *valuePtr = Tcl_Alloc(*lengthPtr + 1);
+ *valuePtr = (char *)Tcl_Alloc(*lengthPtr + 1);
memcpy(*valuePtr, str, *lengthPtr + 1);
Tcl_DecrRefCount(pathPtr);
}
@@ -1058,6 +1064,10 @@ MacOSXGetLibraryPath(
foundInFramework = Tcl_MacOSXOpenVersionedBundleResources(interp,
"com.tcltk.tcllibrary", TCL_FRAMEWORK_VERSION, 0, maxPathLen,
tclLibPath);
+#else
+ (void)interp;
+ (void)maxPathLen;
+ (void)tclLibPath;
#endif
return foundInFramework;
diff --git a/unix/tclUnixNotfy.c b/unix/tclUnixNotfy.c
index 3817071..6b1ec3d 100644
--- a/unix/tclUnixNotfy.c
+++ b/unix/tclUnixNotfy.c
@@ -108,7 +108,7 @@ Tcl_AlertNotifier(
} else {
#ifdef NOTIFIER_SELECT
#if TCL_THREADS
- ThreadSpecificData *tsdPtr = clientData;
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)clientData;
pthread_mutex_lock(&notifierMutex);
tsdPtr->eventReady = 1;
@@ -121,7 +121,7 @@ Tcl_AlertNotifier(
pthread_mutex_unlock(&notifierMutex);
#endif /* TCL_THREADS */
#else /* !NOTIFIER_SELECT */
- ThreadSpecificData *tsdPtr = clientData;
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)clientData;
#if defined(NOTIFIER_EPOLL) && defined(HAVE_EVENTFD)
uint64_t eventFdVal = 1;
if (write(tsdPtr->triggerEventFd, &eventFdVal,
diff --git a/unix/tclUnixPipe.c b/unix/tclUnixPipe.c
index dfeee0c..55fd03d 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;
@@ -271,6 +271,7 @@ TclpTempFileNameForLibrary(
Tcl_Obj *path) /* Path name of the library in the VFS. */
{
Tcl_Obj *retval = TclpTempFileName();
+ (void)path;
if (retval == NULL) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
@@ -432,8 +433,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 +745,7 @@ TclpCreateCommandChannel(
{
char channelName[16 + TCL_INTEGER_SPACE];
int channelId;
- PipeState *statePtr = Tcl_Alloc(sizeof(PipeState));
+ PipeState *statePtr = (PipeState *)Tcl_Alloc(sizeof(PipeState));
int mode;
statePtr->inFile = readFile;
@@ -813,6 +814,7 @@ Tcl_CreatePipe(
int flags) /* Reserved for future use. */
{
int fileNums[2];
+ (void)flags;
if (pipe(fileNums) < 0) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf("pipe creation failed: %s",
@@ -869,7 +871,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 +905,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 +945,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 +1040,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 +1091,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 +1136,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 +1184,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 +1254,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. */
@@ -1261,6 +1263,7 @@ Tcl_PidObjCmd(
PipeState *pipePtr;
int i;
Tcl_Obj *resultPtr;
+ (void)dummy;
if (objc > 2) {
Tcl_WrongNumArgs(interp, 1, objv, "?channelId?");
@@ -1286,7 +1289,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/tclUnixPort.h b/unix/tclUnixPort.h
index adbb7aa..1f8ff99 100644
--- a/unix/tclUnixPort.h
+++ b/unix/tclUnixPort.h
@@ -87,6 +87,9 @@ typedef off_t Tcl_SeekOffset;
#ifdef __CYGWIN__
+#ifdef __cplusplus
+extern "C" {
+#endif
/* Make some symbols available without including <windows.h> */
# define DWORD unsigned int
# define CP_UTF8 65001
@@ -124,6 +127,9 @@ typedef off_t Tcl_SeekOffset;
# define timezone _timezone
extern int TclOSstat(const char *name, void *statBuf);
extern int TclOSlstat(const char *name, void *statBuf);
+#ifdef __cplusplus
+}
+#endif
#elif defined(HAVE_STRUCT_STAT64) && !defined(__APPLE__)
# define TclOSstat stat64
# define TclOSlstat lstat64
diff --git a/unix/tclUnixSock.c b/unix/tclUnixSock.c
index 29defff..0fa4edf 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 = Tcl_Alloc(dot - u.nodename + 1);
+ char *node = (char *)Tcl_Alloc(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 = Tcl_Alloc(*lengthPtr + 1);
+ *valuePtr = (char *)Tcl_Alloc(*lengthPtr + 1);
memcpy(*valuePtr, native, *lengthPtr + 1);
} else {
*lengthPtr = 0;
- *valuePtr = Tcl_Alloc(1);
+ *valuePtr = (char *)Tcl_Alloc(1);
*valuePtr[0] = '\0';
}
}
@@ -335,8 +335,10 @@ Tcl_GetHostName(void)
int
TclpHasSockets(
- Tcl_Interp *interp) /* Not used. */
+ Tcl_Interp *dummy) /* Not used. */
{
+ (void)dummy;
+
return TCL_OK;
}
@@ -382,12 +384,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);
@@ -528,13 +530,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;
@@ -579,12 +581,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;
@@ -621,12 +623,13 @@ TcpOutputProc(
/* ARGSUSED */
static int
TcpCloseProc(
- ClientData instanceData, /* The socket to close. */
- Tcl_Interp *interp) /* For error reporting - unused. */
+ void *instanceData, /* The socket to close. */
+ Tcl_Interp *dummy) /* For error reporting - unused. */
{
- TcpState *statePtr = instanceData;
+ TcpState *statePtr = (TcpState *)instanceData;
int errorCode = 0;
TcpFdList *fds;
+ (void)dummy;
/*
* Delete a file handler that may be active for this socket if this is a
@@ -682,11 +685,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 readError = 0;
int writeError = 0;
@@ -833,7 +836,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
@@ -841,7 +844,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);
@@ -999,7 +1002,7 @@ TcpGetOptionProc(
static void
WrapNotify(
- ClientData clientData,
+ void *clientData,
int mask)
{
TcpState *statePtr = (TcpState *) clientData;
@@ -1028,12 +1031,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) {
/*
@@ -1102,11 +1105,12 @@ 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;
+ (void)direction;
*handlePtr = INT2PTR(statePtr->fds.fd);
return TCL_OK;
@@ -1126,12 +1130,14 @@ 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);
+ (void)mask;
+
+ TcpConnect(NULL, (TcpState *)clientData);
}
/*
@@ -1173,6 +1179,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;
@@ -1183,7 +1190,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
@@ -1390,7 +1396,7 @@ Tcl_OpenTcpClient(
* Allocate a new TcpState for this socket.
*/
- statePtr = Tcl_Alloc(sizeof(TcpState));
+ statePtr = (TcpState *)Tcl_Alloc(sizeof(TcpState));
memset(statePtr, 0, sizeof(TcpState));
statePtr->flags = async ? TCP_ASYNC_CONNECT : 0;
statePtr->cachedBlocking = TCL_MODE_BLOCKING;
@@ -1437,7 +1443,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);
@@ -1469,7 +1475,7 @@ TclpMakeTcpClientChannelMode(
TcpState *statePtr;
char channelName[SOCK_CHAN_LENGTH];
- statePtr = Tcl_Alloc(sizeof(TcpState));
+ statePtr = (TcpState *)Tcl_Alloc(sizeof(TcpState));
memset(statePtr, 0, sizeof(TcpState));
statePtr->fds.fd = PTR2INT(sock);
statePtr->flags = 0;
@@ -1512,7 +1518,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 */
@@ -1692,14 +1698,14 @@ Tcl_OpenTcpServerEx(
* Allocate a new TcpState for this socket.
*/
- statePtr = Tcl_Alloc(sizeof(TcpState));
+ statePtr = (TcpState *)Tcl_Alloc(sizeof(TcpState));
memset(statePtr, 0, sizeof(TcpState));
statePtr->acceptProc = acceptProc;
statePtr->acceptProcData = acceptProcData;
sprintf(channelName, SOCK_TEMPLATE, (long) statePtr);
newfds = &statePtr->fds;
} else {
- newfds = Tcl_Alloc(sizeof(TcpFdList));
+ newfds = (TcpFdList *)Tcl_Alloc(sizeof(TcpFdList));
memset(newfds, (int) 0, sizeof(TcpFdList));
fds->next = newfds;
}
@@ -1760,16 +1766,17 @@ 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 */
socklen_t len; /* For accept interface */
char channelName[SOCK_CHAN_LENGTH];
char host[NI_MAXHOST], port[NI_MAXSERV];
+ (void)mask;
len = sizeof(addr);
newsock = accept(fds->fd, &addr.sa, &len);
@@ -1784,7 +1791,7 @@ TcpAccept(
(void) fcntl(newsock, F_SETFD, FD_CLOEXEC);
- newSockState = Tcl_Alloc(sizeof(TcpState));
+ newSockState = (TcpState *)Tcl_Alloc(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 75dccfa..8868bbe 100644
--- a/unix/tclUnixTest.c
+++ b/unix/tclUnixTest.c
@@ -129,7 +129,7 @@ TclplatformtestInit(
static int
TestfilehandlerCmd(
- ClientData clientData, /* Not used. */
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const *objv) /* Argument strings. */
@@ -139,6 +139,7 @@ TestfilehandlerCmd(
static int initialized = 0;
char buffer[4000];
TclFile file;
+ (void)dummy;
/*
* NOTE: When we make this code work on Windows also, the following
@@ -314,7 +315,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++;
@@ -343,7 +344,7 @@ TestFileHandlerProc(
static int
TestfilewaitCmd(
- ClientData clientData, /* Not used. */
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const *objv) /* Argument strings. */
@@ -352,6 +353,7 @@ TestfilewaitCmd(
Tcl_Channel channel;
int fd;
ClientData data;
+ (void)dummy;
if (objc != 4) {
Tcl_WrongNumArgs(interp, 2, objv, "file readable|writable|both timeout");
@@ -411,12 +413,13 @@ TestfilewaitCmd(
static int
TestfindexecutableCmd(
- ClientData clientData, /* Not used. */
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const *objv) /* Argument strings. */
{
Tcl_Obj *saveName;
+ (void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "argv0");
@@ -453,12 +456,13 @@ TestfindexecutableCmd(
static int
TestforkCmd(
- ClientData clientData, /* Not used. */
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const *objv) /* Argument strings. */
{
pid_t pid;
+ (void)dummy;
if (objc != 1) {
Tcl_WrongNumArgs(interp, 1, objv, "");
@@ -499,7 +503,7 @@ TestforkCmd(
static int
TestalarmCmd(
- ClientData clientData, /* Not used. */
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const *objv) /* Argument strings. */
@@ -507,6 +511,7 @@ TestalarmCmd(
#ifdef SA_RESTART
unsigned int sec = 1;
struct sigaction action;
+ (void)dummy;
if (objc > 1) {
Tcl_GetIntFromObj(interp, objv[1], (int *)&sec);
@@ -528,6 +533,8 @@ TestalarmCmd(
(void) alarm(sec);
return TCL_OK;
#else
+ (void)dummy;
+
Tcl_AppendResult(interp,
"warning: sigaction SA_RESTART not support on this platform",
NULL);
@@ -555,6 +562,8 @@ static void
AlarmHandler(
int signum)
{
+ (void)signum;
+
gotsig = "1";
}
@@ -576,11 +585,15 @@ AlarmHandler(
static int
TestgotsigCmd(
- ClientData clientData, /* Not used. */
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const *objv) /* Argument strings. */
{
+ (void)dummy;
+ (void)objc;
+ (void)objv;
+
Tcl_AppendResult(interp, gotsig, NULL);
gotsig = "0";
return TCL_OK;
@@ -613,6 +626,7 @@ TestchmodCmd(
Tcl_Obj *const *objv) /* Argument strings. */
{
int i, mode;
+ (void)dummy;
if (objc < 2) {
Tcl_WrongNumArgs(interp, 1, objv, "mode file ?file ...?");
diff --git a/unix/tclUnixThrd.c b/unix/tclUnixThrd.c
index 7b1a4bb..302249a 100644
--- a/unix/tclUnixThrd.c
+++ b/unix/tclUnixThrd.c
@@ -569,7 +569,7 @@ Tcl_MutexLock(
* Double inside master lock check to avoid a race condition.
*/
- pmutexPtr = Tcl_Alloc(sizeof(PMutex));
+ pmutexPtr = (PMutex *)Tcl_Alloc(sizeof(PMutex));
PMutexInit(pmutexPtr);
*mutexPtr = (Tcl_Mutex) pmutexPtr;
TclRememberMutex(mutexPtr);
@@ -679,7 +679,7 @@ Tcl_ConditionWait(
*/
if (*condPtr == NULL) {
- pcondPtr = Tcl_Alloc(sizeof(pthread_cond_t));
+ pcondPtr = (pthread_cond_t *)Tcl_Alloc(sizeof(pthread_cond_t));
pthread_cond_init(pcondPtr, NULL);
*condPtr = (Tcl_Condition) pcondPtr;
TclRememberCondition(condPtr);
@@ -790,7 +790,7 @@ TclpNewAllocMutex(void)
AllocMutex *lockPtr;
PMutex *plockPtr;
- lockPtr = malloc(sizeof(AllocMutex));
+ lockPtr = (AllocMutex *)malloc(sizeof(AllocMutex));
if (lockPtr == NULL) {
Tcl_Panic("could not allocate lock");
}
@@ -861,7 +861,7 @@ TclpThreadCreateKey(void)
{
pthread_key_t *ptkeyPtr;
- ptkeyPtr = TclpSysAlloc(sizeof(pthread_key_t));
+ ptkeyPtr = (pthread_key_t *)TclpSysAlloc(sizeof(pthread_key_t));
if (NULL == ptkeyPtr) {
Tcl_Panic("unable to allocate thread key!");
}
@@ -877,7 +877,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!");
@@ -891,7 +891,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");
@@ -902,7 +902,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 72de7a2..1ca0cbb 100644
--- a/unix/tclUnixTime.c
+++ b/unix/tclUnixTime.c
@@ -30,7 +30,7 @@ static void NativeGetTime(Tcl_Time *timebuf,
Tcl_GetTimeProc *tclGetTimeProcPtr = NativeGetTime;
Tcl_ScaleTimeProc *tclScaleTimeProcPtr = NativeScaleTime;
-ClientData tclTimeClientData = NULL;
+void *tclTimeClientData = NULL;
/*
*----------------------------------------------------------------------
@@ -373,6 +373,8 @@ NativeScaleTime(
Tcl_Time *timePtr,
ClientData clientData)
{
+ (void)timePtr;
+ (void)clientData;
/* Native scale is 1:1. Nothing is done */
}
@@ -396,9 +398,10 @@ NativeScaleTime(
static void
NativeGetTime(
Tcl_Time *timePtr,
- ClientData clientData)
+ ClientData dummy)
{
struct timeval tv;
+ (void)dummy;
(void) gettimeofday(&tv, NULL);
timePtr->sec = tv.tv_sec;
diff --git a/unix/tclXtNotify.c b/unix/tclXtNotify.c
index 56fe840..b2ec6e6 100644
--- a/unix/tclXtNotify.c
+++ b/unix/tclXtNotify.c
@@ -359,7 +359,7 @@ CreateFileHandler(
}
}
if (filePtr == NULL) {
- filePtr = Tcl_Alloc(sizeof(FileHandler));
+ filePtr = (FileHandler *)Tcl_Alloc(sizeof(FileHandler));
filePtr->fd = fd;
filePtr->read = 0;
filePtr->write = 0;
@@ -525,7 +525,7 @@ FileProc(
*/
filePtr->readyMask |= mask;
- fileEvPtr = Tcl_Alloc(sizeof(FileHandlerEvent));
+ fileEvPtr = (FileHandlerEvent *)Tcl_Alloc(sizeof(FileHandlerEvent));
fileEvPtr->header.proc = FileHandlerEventProc;
fileEvPtr->fd = filePtr->fd;
Tcl_QueueEvent((Tcl_Event *) fileEvPtr, TCL_QUEUE_TAIL);
diff --git a/win/configure b/win/configure
index 5e1adc5..c210d89 100755
--- a/win/configure
+++ b/win/configure
@@ -4196,7 +4196,7 @@ $as_echo "using shared flags" >&6; }
CFLAGS_DEBUG=-g
CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer"
- CFLAGS_WARNING="-Wall -Wwrite-strings -Wsign-compare -Wpointer-arith"
+ CFLAGS_WARNING="-Wall -Wextra -Wwrite-strings -Wsign-compare -Wpointer-arith"
LDFLAGS_DEBUG=
LDFLAGS_OPTIMIZE=
diff --git a/win/tcl.m4 b/win/tcl.m4
index 4728cdf..6ad7cf9 100644
--- a/win/tcl.m4
+++ b/win/tcl.m4
@@ -685,7 +685,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
CFLAGS_DEBUG=-g
CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer"
- CFLAGS_WARNING="-Wall -Wwrite-strings -Wsign-compare -Wpointer-arith"
+ CFLAGS_WARNING="-Wall -Wextra -Wwrite-strings -Wpointer-arith"
LDFLAGS_DEBUG=
LDFLAGS_OPTIMIZE=
@@ -694,7 +694,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
CFLAGS_WARNING="${CFLAGS_WARNING} -Wno-format"
;;
*)
- CFLAGS_WARNING="${CFLAGS_WARNING} -Wdeclaration-after-statement"
+ CFLAGS_WARNING="${CFLAGS_WARNING} -Wc++-compat -Wdeclaration-after-statement"
;;
esac
diff --git a/win/tclAppInit.c b/win/tclAppInit.c
index 3292335..3e95e3b 100644
--- a/win/tclAppInit.c
+++ b/win/tclAppInit.c
@@ -90,14 +90,16 @@ main(
char *dummy[]) /* Not used. */
{
TCHAR **argv;
+ TCHAR *p;
+ (void)dummy;
#else
int
_tmain(
int argc, /* Number of command-line arguments. */
TCHAR *argv[]) /* Values of command-line arguments. */
{
-#endif
TCHAR *p;
+#endif
/*
* Set up the default locale to be standard "C" locale so parsing is
@@ -270,7 +272,7 @@ setargv(
/* Make sure we don't call Tcl_Alloc through the (not yet initialized) stub table */
# undef Tcl_Alloc
- argSpace = Tcl_Alloc(size * sizeof(char *)
+ argSpace = (TCHAR *)Tcl_Alloc(size * sizeof(char *)
+ (_tcslen(cmdLine) * sizeof(TCHAR)) + sizeof(TCHAR));
argv = (TCHAR **) argSpace;
argSpace += size * (sizeof(char *)/sizeof(TCHAR));
diff --git a/win/tclWin32Dll.c b/win/tclWin32Dll.c
index 8299eed..fc6fd16 100644
--- a/win/tclWin32Dll.c
+++ b/win/tclWin32Dll.c
@@ -119,6 +119,8 @@ DllMain(
DWORD reason, /* Reason this function is being called. */
LPVOID reserved) /* Not used. */
{
+ (void)reserved;
+
switch (reason) {
case DLL_PROCESS_ATTACH:
DisableThreadLibraryCalls(hInst);
@@ -385,8 +387,8 @@ TclWinDriveLetterForVolMountPoint(
}
}
if (!alreadyStored) {
- dlPtr2 = Tcl_Alloc(sizeof(MountPointMap));
- dlPtr2->volumeName = TclNativeDupInternalRep(Target);
+ dlPtr2 = (MountPointMap *)Tcl_Alloc(sizeof(MountPointMap));
+ dlPtr2->volumeName = (WCHAR *)TclNativeDupInternalRep(Target);
dlPtr2->driveLetter = (char) drive[0];
dlPtr2->nextPtr = driveLetterLookup;
driveLetterLookup = dlPtr2;
@@ -411,8 +413,8 @@ TclWinDriveLetterForVolMountPoint(
* that fact and store '-1' so we don't have to look it up each time.
*/
- dlPtr2 = Tcl_Alloc(sizeof(MountPointMap));
- dlPtr2->volumeName = TclNativeDupInternalRep((ClientData) mountPoint);
+ dlPtr2 = (MountPointMap *)Tcl_Alloc(sizeof(MountPointMap));
+ dlPtr2->volumeName = (WCHAR *)TclNativeDupInternalRep((ClientData) mountPoint);
dlPtr2->driveLetter = -1;
dlPtr2->nextPtr = driveLetterLookup;
driveLetterLookup = dlPtr2;
diff --git a/win/tclWinChan.c b/win/tclWinChan.c
index f5b324f..23a3545 100644
--- a/win/tclWinChan.c
+++ b/win/tclWinChan.c
@@ -180,8 +180,10 @@ FileInit(void)
static void
FileChannelExitHandler(
- ClientData clientData) /* Old window proc */
+ ClientData dummy) /* Old window proc */
{
+ (void)dummy;
+
Tcl_DeleteEventSource(FileSetupProc, FileCheckProc, NULL);
}
@@ -204,12 +206,13 @@ FileChannelExitHandler(
void
FileSetupProc(
- ClientData data, /* Not used. */
+ ClientData dummy, /* Not used. */
int flags) /* Event flags as passed to Tcl_DoOneEvent. */
{
FileInfo *infoPtr;
Tcl_Time blockTime = { 0, 0 };
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
+ (void)dummy;
if (!TEST_FLAG(flags, TCL_FILE_EVENTS)) {
return;
@@ -247,12 +250,13 @@ FileSetupProc(
static void
FileCheckProc(
- ClientData data, /* Not used. */
+ ClientData dummy, /* Not used. */
int flags) /* Event flags as passed to Tcl_DoOneEvent. */
{
FileEvent *evPtr;
FileInfo *infoPtr;
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
+ (void)dummy;
if (!TEST_FLAG(flags, TCL_FILE_EVENTS)) {
return;
@@ -267,7 +271,7 @@ FileCheckProc(
infoPtr = infoPtr->nextPtr) {
if (infoPtr->watchMask && !TEST_FLAG(infoPtr->flags, FILE_PENDING)) {
SET_FLAG(infoPtr->flags, FILE_PENDING);
- evPtr = Tcl_Alloc(sizeof(FileEvent));
+ evPtr = (FileEvent *)Tcl_Alloc(sizeof(FileEvent));
evPtr->header.proc = FileEventProc;
evPtr->infoPtr = infoPtr;
Tcl_QueueEvent((Tcl_Event *) evPtr, TCL_QUEUE_TAIL);
@@ -350,7 +354,7 @@ FileBlockProc(
int mode) /* TCL_MODE_BLOCKING or
* TCL_MODE_NONBLOCKING. */
{
- FileInfo *infoPtr = instanceData;
+ FileInfo *infoPtr = (FileInfo *)instanceData;
/*
* Files on Windows can not be switched between blocking and nonblocking,
@@ -386,12 +390,13 @@ FileBlockProc(
static int
FileCloseProc(
ClientData instanceData, /* Pointer to FileInfo structure. */
- Tcl_Interp *interp) /* Not used. */
+ Tcl_Interp *dummy) /* Not used. */
{
- FileInfo *fileInfoPtr = instanceData;
+ FileInfo *fileInfoPtr = (FileInfo *)instanceData;
FileInfo *infoPtr;
ThreadSpecificData *tsdPtr;
int errorCode = 0;
+ (void)dummy;
/*
* Remove the file from the watch list.
@@ -463,7 +468,7 @@ FileSeekProc(
int mode, /* Relative to where should we seek? */
int *errorCodePtr) /* To store error code. */
{
- FileInfo *infoPtr = instanceData;
+ FileInfo *infoPtr = (FileInfo *)instanceData;
LONG newPos, newPosHigh, oldPos, oldPosHigh;
DWORD moveMethod;
@@ -541,7 +546,7 @@ FileWideSeekProc(
int mode, /* Relative to where should we seek? */
int *errorCodePtr) /* To store error code. */
{
- FileInfo *infoPtr = instanceData;
+ FileInfo *infoPtr = (FileInfo *)instanceData;
DWORD moveMethod;
LONG newPos, newPosHigh;
@@ -591,7 +596,7 @@ FileTruncateProc(
ClientData instanceData, /* File state. */
Tcl_WideInt length) /* Length to truncate at. */
{
- FileInfo *infoPtr = instanceData;
+ FileInfo *infoPtr = (FileInfo *)instanceData;
LONG newPos, newPosHigh, oldPos, oldPosHigh;
/*
@@ -669,7 +674,7 @@ FileInputProc(
int bufSize, /* Num bytes available in buffer. */
int *errorCode) /* Where to store error code. */
{
- FileInfo *infoPtr = instanceData;
+ FileInfo *infoPtr = (FileInfo *)instanceData;
DWORD bytesRead;
*errorCode = 0;
@@ -724,7 +729,7 @@ FileOutputProc(
int toWrite, /* How many bytes to write? */
int *errorCode) /* Where to store error code. */
{
- FileInfo *infoPtr = instanceData;
+ FileInfo *infoPtr = (FileInfo *)instanceData;
DWORD bytesWritten;
*errorCode = 0;
@@ -771,7 +776,7 @@ FileWatchProc(
* of TCL_READABLE, TCL_WRITABLE and
* TCL_EXCEPTION. */
{
- FileInfo *infoPtr = instanceData;
+ FileInfo *infoPtr = (FileInfo *)instanceData;
Tcl_Time blockTime = { 0, 0 };
/*
@@ -809,7 +814,7 @@ FileGetHandleProc(
int direction, /* TCL_READABLE or TCL_WRITABLE */
ClientData *handlePtr) /* Where to store the handle. */
{
- FileInfo *infoPtr = instanceData;
+ FileInfo *infoPtr = (FileInfo *)instanceData;
if (!TEST_FLAG(direction, infoPtr->validMask)) {
return TCL_ERROR;
@@ -854,7 +859,7 @@ TclpOpenFileChannel(
char channelName[16 + TCL_INTEGER_SPACE];
TclFile readFile = NULL, writeFile = NULL;
- nativeName = Tcl_FSGetNativePath(pathPtr);
+ nativeName = (const WCHAR *)Tcl_FSGetNativePath(pathPtr);
if (nativeName == NULL) {
if (interp) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
@@ -1365,7 +1370,7 @@ TclWinOpenFileChannel(
}
}
- infoPtr = Tcl_Alloc(sizeof(FileInfo));
+ infoPtr = (FileInfo *)Tcl_Alloc(sizeof(FileInfo));
/*
* TIP #218. Removed the code inserting the new structure into the global
@@ -1456,7 +1461,7 @@ FileThreadActionProc(
int action)
{
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
- FileInfo *infoPtr = instanceData;
+ FileInfo *infoPtr = (FileInfo *)instanceData;
if (action == TCL_CHANNEL_THREAD_INSERT) {
infoPtr->nextPtr = tsdPtr->firstFilePtr;
diff --git a/win/tclWinConsole.c b/win/tclWinConsole.c
index f1bb75c..b92be89 100644
--- a/win/tclWinConsole.c
+++ b/win/tclWinConsole.c
@@ -317,8 +317,10 @@ ConsoleInit(void)
static void
ConsoleExitHandler(
- ClientData clientData) /* Old window proc. */
+ ClientData dummy) /* Old window proc. */
{
+ (void)dummy;
+
Tcl_DeleteEventSource(ConsoleSetupProc, ConsoleCheckProc, NULL);
}
@@ -341,8 +343,10 @@ ConsoleExitHandler(
static void
ProcExitHandler(
- ClientData clientData) /* Old window proc. */
+ ClientData dummy) /* Old window proc. */
{
+ (void)dummy;
+
Tcl_MutexLock(&consoleMutex);
initialized = 0;
Tcl_MutexUnlock(&consoleMutex);
@@ -367,13 +371,14 @@ ProcExitHandler(
void
ConsoleSetupProc(
- ClientData data, /* Not used. */
+ ClientData dummy, /* Not used. */
int flags) /* Event flags as passed to Tcl_DoOneEvent. */
{
ConsoleInfo *infoPtr;
Tcl_Time blockTime = { 0, 0 };
int block = 1;
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
+ (void)dummy;
if (!(flags & TCL_FILE_EVENTS)) {
return;
@@ -421,12 +426,13 @@ ConsoleSetupProc(
static void
ConsoleCheckProc(
- ClientData data, /* Not used. */
+ ClientData dummy, /* Not used. */
int flags) /* Event flags as passed to Tcl_DoOneEvent. */
{
ConsoleInfo *infoPtr;
int needEvent;
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
+ (void)dummy;
if (!(flags & TCL_FILE_EVENTS)) {
return;
@@ -462,7 +468,7 @@ ConsoleCheckProc(
}
if (needEvent) {
- ConsoleEvent *evPtr = Tcl_Alloc(sizeof(ConsoleEvent));
+ ConsoleEvent *evPtr = (ConsoleEvent *)Tcl_Alloc(sizeof(ConsoleEvent));
infoPtr->flags |= CONSOLE_PENDING;
evPtr->header.proc = ConsoleEventProc;
@@ -494,7 +500,7 @@ ConsoleBlockModeProc(
int mode) /* TCL_MODE_BLOCKING or
* TCL_MODE_NONBLOCKING. */
{
- ConsoleInfo *infoPtr = instanceData;
+ ConsoleInfo *infoPtr = (ConsoleInfo *)instanceData;
/*
* Consoles on Windows can not be switched between blocking and
@@ -531,12 +537,13 @@ ConsoleBlockModeProc(
static int
ConsoleCloseProc(
ClientData instanceData, /* Pointer to ConsoleInfo structure. */
- Tcl_Interp *interp) /* For error reporting. */
+ Tcl_Interp *dummy) /* For error reporting. */
{
- ConsoleInfo *consolePtr = instanceData;
+ ConsoleInfo *consolePtr = (ConsoleInfo *)instanceData;
int errorCode = 0;
ConsoleInfo *infoPtr, **nextPtrPtr;
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
+ (void)dummy;
/*
* Clean up the background thread if necessary. Note that this must be
@@ -651,7 +658,7 @@ ConsoleInputProc(
* buffer? */
int *errorCode) /* Where to store error code. */
{
- ConsoleInfo *infoPtr = instanceData;
+ ConsoleInfo *infoPtr = (ConsoleInfo *)instanceData;
DWORD count, bytesRead = 0;
int result;
@@ -743,7 +750,7 @@ ConsoleOutputProc(
int toWrite, /* How many bytes to write? */
int *errorCode) /* Where to store error code. */
{
- ConsoleInfo *infoPtr = instanceData;
+ ConsoleInfo *infoPtr = (ConsoleInfo *)instanceData;
ConsoleThreadInfo *threadInfo = &infoPtr->writer;
DWORD bytesWritten, timeout;
@@ -787,7 +794,7 @@ ConsoleOutputProc(
Tcl_Free(infoPtr->writeBuf);
}
infoPtr->writeBufLen = toWrite;
- infoPtr->writeBuf = Tcl_Alloc(toWrite);
+ infoPtr->writeBuf = (char *)Tcl_Alloc(toWrite);
}
memcpy(infoPtr->writeBuf, buf, toWrite);
infoPtr->toWrite = toWrite;
@@ -928,7 +935,7 @@ ConsoleWatchProc(
* TCL_EXCEPTION. */
{
ConsoleInfo **nextPtrPtr, *ptr;
- ConsoleInfo *infoPtr = instanceData;
+ ConsoleInfo *infoPtr = (ConsoleInfo *)instanceData;
int oldMask = infoPtr->watchMask;
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
@@ -986,7 +993,8 @@ ConsoleGetHandleProc(
int direction, /* TCL_READABLE or TCL_WRITABLE. */
ClientData *handlePtr) /* Where to store the handle. */
{
- ConsoleInfo *infoPtr = instanceData;
+ ConsoleInfo *infoPtr = (ConsoleInfo *)instanceData;
+ (void)direction;
*handlePtr = infoPtr->handle;
return TCL_OK;
@@ -1020,7 +1028,7 @@ WaitForRead(
* or not. */
{
DWORD timeout, count;
- HANDLE *handle = infoPtr->handle;
+ HANDLE *handle = (HANDLE *)infoPtr->handle;
ConsoleThreadInfo *threadInfo = &infoPtr->reader;
INPUT_RECORD input;
@@ -1136,7 +1144,7 @@ ConsoleReaderThread(
}
if (!infoPtr) {
infoPtr = (ConsoleInfo *)pipeTI->clientData;
- handle = infoPtr->handle;
+ handle = (HANDLE *)infoPtr->handle;
threadInfo = &infoPtr->reader;
}
@@ -1234,7 +1242,7 @@ ConsoleWriterThread(
}
if (!infoPtr) {
infoPtr = (ConsoleInfo *)pipeTI->clientData;
- handle = infoPtr->handle;
+ handle = (HANDLE *)infoPtr->handle;
threadInfo = &infoPtr->writer;
}
@@ -1321,7 +1329,7 @@ TclWinOpenConsoleChannel(
* See if a channel with this handle already exists.
*/
- infoPtr = Tcl_Alloc(sizeof(ConsoleInfo));
+ infoPtr = (ConsoleInfo *)Tcl_Alloc(sizeof(ConsoleInfo));
memset(infoPtr, 0, sizeof(ConsoleInfo));
infoPtr->validMask = permissions;
@@ -1405,7 +1413,7 @@ ConsoleThreadActionProc(
ClientData instanceData,
int action)
{
- ConsoleInfo *infoPtr = instanceData;
+ ConsoleInfo *infoPtr = (ConsoleInfo *)instanceData;
/*
* We do not access firstConsolePtr in the thread structures. This is not
@@ -1459,7 +1467,7 @@ ConsoleSetOptionProc(
const char *optionName, /* Which option to set? */
const char *value) /* New value for option. */
{
- ConsoleInfo *infoPtr = instanceData;
+ ConsoleInfo *infoPtr = (ConsoleInfo *)instanceData;
int len = strlen(optionName);
int vlen = strlen(value);
@@ -1557,7 +1565,7 @@ ConsoleGetOptionProc(
const char *optionName, /* Option to get. */
Tcl_DString *dsPtr) /* Where to store value(s). */
{
- ConsoleInfo *infoPtr = instanceData;
+ ConsoleInfo *infoPtr = (ConsoleInfo *)instanceData;
int valid = 0; /* Flag if valid option parsed. */
unsigned int len;
char buf[TCL_INTEGER_SPACE];
diff --git a/win/tclWinDde.c b/win/tclWinDde.c
index a4c00fa..2fc4990 100644
--- a/win/tclWinDde.c
+++ b/win/tclWinDde.c
@@ -251,7 +251,7 @@ Initialize(void)
if (ddeInstance == 0) {
Tcl_MutexLock(&ddeMutex);
if (ddeInstance == 0) {
- if (DdeInitializeW(&ddeInstance, (PFNCALLBACK) DdeServerProc,
+ if (DdeInitializeW(&ddeInstance, (PFNCALLBACK)(void *)DdeServerProc,
CBF_SKIP_REGISTRATIONS | CBF_SKIP_UNREGISTRATIONS
| CBF_FAIL_POKES, 0) != DMLERR_NO_ERROR) {
ddeInstance = 0;
diff --git a/win/tclWinFCmd.c b/win/tclWinFCmd.c
index b796b29..960188e 100644
--- a/win/tclWinFCmd.c
+++ b/win/tclWinFCmd.c
@@ -145,8 +145,8 @@ TclpObjRenameFile(
Tcl_Obj *srcPathPtr,
Tcl_Obj *destPathPtr)
{
- return DoRenameFile(Tcl_FSGetNativePath(srcPathPtr),
- Tcl_FSGetNativePath(destPathPtr));
+ return DoRenameFile((const WCHAR *)Tcl_FSGetNativePath(srcPathPtr),
+ (const WCHAR *)Tcl_FSGetNativePath(destPathPtr));
}
static int
@@ -536,8 +536,8 @@ TclpObjCopyFile(
Tcl_Obj *srcPathPtr,
Tcl_Obj *destPathPtr)
{
- return DoCopyFile(Tcl_FSGetNativePath(srcPathPtr),
- Tcl_FSGetNativePath(destPathPtr));
+ return DoCopyFile((const WCHAR *)Tcl_FSGetNativePath(srcPathPtr),
+ (const WCHAR *)Tcl_FSGetNativePath(destPathPtr));
}
static int
@@ -751,7 +751,7 @@ TclpDeleteFile(
const void *nativePath) /* Pathname of file to be removed (native). */
{
DWORD attr;
- const WCHAR *path = nativePath;
+ const WCHAR *path = (const WCHAR *)nativePath;
/*
* The DeleteFile API acts differently under Win95/98 and NT WRT NULL and
@@ -856,7 +856,7 @@ int
TclpObjCreateDirectory(
Tcl_Obj *pathPtr)
{
- return DoCreateDirectory(Tcl_FSGetNativePath(pathPtr));
+ return DoCreateDirectory((const WCHAR *)Tcl_FSGetNativePath(pathPtr));
}
static int
@@ -993,7 +993,7 @@ TclpObjRemoveDirectory(
ret = DoRemoveDirectory(&native, recursive, &ds);
Tcl_DStringFree(&native);
} else {
- ret = DoRemoveJustDirectory(Tcl_FSGetNativePath(pathPtr), 0, &ds);
+ ret = DoRemoveJustDirectory((const WCHAR *)Tcl_FSGetNativePath(pathPtr), 0, &ds);
}
if (ret != TCL_OK) {
@@ -1432,6 +1432,8 @@ TraversalDelete(
Tcl_DString *errorPtr) /* If non-NULL, initialized DString filled
* with UTF-8 name of file causing error. */
{
+ (void)dstPtr;
+
switch (type) {
case DOTREE_F:
if (TclpDeleteFile(nativeSrc) == TCL_OK) {
@@ -1517,7 +1519,7 @@ GetWinFileAttributes(
const WCHAR *nativeName;
int attr;
- nativeName = Tcl_FSGetNativePath(fileName);
+ nativeName = (const WCHAR *)Tcl_FSGetNativePath(fileName);
result = GetFileAttributesW(nativeName);
if (result == 0xffffffff) {
@@ -1598,6 +1600,7 @@ ConvertFileNameFormat(
int pathc, i;
Tcl_Obj *splitPath;
size_t length;
+ (void)objIndex;
splitPath = Tcl_FSSplitPath(fileName, &pathc);
@@ -1843,7 +1846,7 @@ SetWinFileAttributes(
int yesNo, result;
const WCHAR *nativeName;
- nativeName = Tcl_FSGetNativePath(fileName);
+ nativeName = (const WCHAR *)Tcl_FSGetNativePath(fileName);
fileAttributes = old = GetFileAttributesW(nativeName);
if (fileAttributes == 0xffffffff) {
@@ -1894,6 +1897,8 @@ CannotSetAttribute(
Tcl_Obj *fileName, /* The name of the file. */
Tcl_Obj *attributePtr) /* The new value of the attribute. */
{
+ (void)attributePtr;
+
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"cannot set attribute \"%s\" for file \"%s\": attribute is readonly",
tclpFileAttrStrings[objIndex], TclGetString(fileName)));
diff --git a/win/tclWinFile.c b/win/tclWinFile.c
index 10d846e..083375d 100644
--- a/win/tclWinFile.c
+++ b/win/tclWinFile.c
@@ -859,6 +859,7 @@ TclpFindExecutable(
{
WCHAR wName[MAX_PATH];
char name[MAX_PATH * 3];
+ (void)argv0;
GetModuleFileNameW(NULL, wName, MAX_PATH);
WideCharToMultiByte(CP_UTF8, 0, wName, -1, name, sizeof(name), NULL, NULL);
@@ -918,7 +919,7 @@ TclpMatchInDirectory(
size_t length = 0;
const char *str = TclGetStringFromObj(norm, &length);
- native = Tcl_FSGetNativePath(pathPtr);
+ native = (const WCHAR *)Tcl_FSGetNativePath(pathPtr);
if (GetFileAttributesExW(native,
GetFileExInfoStandard, &data) != TRUE) {
@@ -959,7 +960,7 @@ TclpMatchInDirectory(
* Verify that the specified path exists and is actually a directory.
*/
- native = Tcl_FSGetNativePath(pathPtr);
+ native = (const WCHAR *)Tcl_FSGetNativePath(pathPtr);
if (native == NULL) {
return TCL_OK;
}
@@ -1481,7 +1482,7 @@ TclpGetUserHome(
if (rc != 0) {
break;
}
- domain = INT2PTR(-1); /* repeat once */
+ domain = (const char *)INT2PTR(-1); /* repeat once */
}
if (rc == 0) {
DWORD i, size = MAX_PATH;
@@ -1900,7 +1901,7 @@ TclpObjChdir(
int result;
const WCHAR *nativePath;
- nativePath = Tcl_FSGetNativePath(pathPtr);
+ nativePath = (const WCHAR *)Tcl_FSGetNativePath(pathPtr);
if (!nativePath) {
return -1;
@@ -1993,7 +1994,7 @@ TclpObjStat(
TclWinFlushDirtyChannels();
- return NativeStat(Tcl_FSGetNativePath(pathPtr), statPtr, 0);
+ return NativeStat((const WCHAR *)Tcl_FSGetNativePath(pathPtr), statPtr, 0);
}
/*
@@ -2187,7 +2188,7 @@ NativeDev(
p = strchr(p + 1, '\\');
if (p == NULL) {
/*
- * Add terminating backslash to fullpath or GetVolumeInformation()
+ * Add terminating backslash to fullpath or GetVolumeInformationW()
* won't work.
*/
@@ -2364,7 +2365,7 @@ TclpObjAccess(
Tcl_Obj *pathPtr,
int mode)
{
- return NativeAccess(Tcl_FSGetNativePath(pathPtr), mode);
+ return NativeAccess((const WCHAR *)Tcl_FSGetNativePath(pathPtr), mode);
}
int
@@ -2380,7 +2381,7 @@ TclpObjLstat(
TclWinFlushDirtyChannels();
- return NativeStat(Tcl_FSGetNativePath(pathPtr), statPtr, 1);
+ return NativeStat((const WCHAR *)Tcl_FSGetNativePath(pathPtr), statPtr, 1);
}
#ifdef S_IFLNK
@@ -2393,14 +2394,14 @@ TclpObjLink(
if (toPtr != NULL) {
int res;
const WCHAR *LinkTarget;
- const WCHAR *LinkSource = Tcl_FSGetNativePath(pathPtr);
+ const WCHAR *LinkSource = (const WCHAR *)Tcl_FSGetNativePath(pathPtr);
Tcl_Obj *normalizedToPtr = Tcl_FSGetNormalizedPath(NULL, toPtr);
if (normalizedToPtr == NULL) {
return NULL;
}
- LinkTarget = Tcl_FSGetNativePath(normalizedToPtr);
+ LinkTarget = (const WCHAR *)Tcl_FSGetNativePath(normalizedToPtr);
if (LinkSource == NULL || LinkTarget == NULL) {
return NULL;
@@ -2412,7 +2413,7 @@ TclpObjLink(
return NULL;
}
} else {
- const WCHAR *LinkSource = Tcl_FSGetNativePath(pathPtr);
+ const WCHAR *LinkSource = (const WCHAR *)Tcl_FSGetNativePath(pathPtr);
if (LinkSource == NULL) {
return NULL;
@@ -2461,13 +2462,13 @@ TclpFilesystemPathType(
firstSeparator = strchr(path, '/');
if (firstSeparator == NULL) {
- found = GetVolumeInformationW(Tcl_FSGetNativePath(pathPtr),
+ found = GetVolumeInformationW((const WCHAR *)Tcl_FSGetNativePath(pathPtr),
NULL, 0, NULL, NULL, NULL, volType, VOL_BUF_SIZE);
} else {
Tcl_Obj *driveName = Tcl_NewStringObj(path, firstSeparator - path+1);
Tcl_IncrRefCount(driveName);
- found = GetVolumeInformationW(Tcl_FSGetNativePath(driveName),
+ found = GetVolumeInformationW((const WCHAR *)Tcl_FSGetNativePath(driveName),
NULL, 0, NULL, NULL, NULL, volType, VOL_BUF_SIZE);
Tcl_DecrRefCount(driveName);
}
@@ -2521,7 +2522,7 @@ TclpFilesystemPathType(
int
TclpObjNormalizePath(
- Tcl_Interp *interp,
+ Tcl_Interp *dummy,
Tcl_Obj *pathPtr, /* An unshared object containing the path to
* normalize */
int nextCheckpoint) /* offset to start at in pathPtr */
@@ -2532,6 +2533,7 @@ TclpObjNormalizePath(
Tcl_Obj *temp = NULL;
int isDrive = 1;
Tcl_DString ds; /* Some workspace. */
+ (void)dummy;
Tcl_DStringInit(&dsNorm);
path = TclGetString(pathPtr);
@@ -3093,7 +3095,7 @@ TclNativeCreateNativeRep(
* Overallocate 6 chars, making some room for extended paths
*/
- wp = nativePathPtr = Tcl_Alloc((len + 6) * sizeof(WCHAR));
+ wp = nativePathPtr = (WCHAR *)Tcl_Alloc((len + 6) * sizeof(WCHAR));
if (nativePathPtr==0) {
goto done;
}
@@ -3191,7 +3193,7 @@ TclNativeDupInternalRep(
len = sizeof(WCHAR) * (wcslen((const WCHAR *) clientData) + 1);
- copy = Tcl_Alloc(len);
+ copy = (char *)Tcl_Alloc(len);
memcpy(copy, clientData, len);
return copy;
}
@@ -3228,7 +3230,7 @@ TclpUtime(
FromCTime(tval->actime, &lastAccessTime);
FromCTime(tval->modtime, &lastModTime);
- native = Tcl_FSGetNativePath(pathPtr);
+ native = (const WCHAR *)Tcl_FSGetNativePath(pathPtr);
attr = GetFileAttributesW(native);
@@ -3279,7 +3281,7 @@ TclWinFileOwned(
DWORD bufsz;
int owned = 0;
- native = Tcl_FSGetNativePath(pathPtr);
+ native = (const WCHAR *)Tcl_FSGetNativePath(pathPtr);
if (GetNamedSecurityInfoW((LPWSTR) native, SE_FILE_OBJECT,
OWNER_SECURITY_INFORMATION, &ownerSid, NULL, NULL, NULL,
@@ -3307,7 +3309,7 @@ TclWinFileOwned(
bufsz = 0;
GetTokenInformation(token, TokenUser, NULL, 0, &bufsz);
if (bufsz) {
- buf = Tcl_Alloc(bufsz);
+ buf = (LPBYTE)Tcl_Alloc(bufsz);
if (GetTokenInformation(token, TokenUser, buf, bufsz, &bufsz)) {
owned = EqualSid(ownerSid, ((PTOKEN_USER) buf)->User.Sid);
}
diff --git a/win/tclWinInit.c b/win/tclWinInit.c
index d2fa32c..1dfc9b5 100644
--- a/win/tclWinInit.c
+++ b/win/tclWinInit.c
@@ -226,7 +226,7 @@ TclpInitLibraryPath(
*encodingPtr = NULL;
bytes = TclGetStringFromObj(pathPtr, &length);
*lengthPtr = length++;
- *valuePtr = Tcl_Alloc(length);
+ *valuePtr = (char *)Tcl_Alloc(length);
memcpy(*valuePtr, bytes, length);
Tcl_DecrRefCount(pathPtr);
}
@@ -363,7 +363,7 @@ InitializeDefaultLibraryDir(
TclWinNoBackslash(name);
sprintf(end + 1, "lib/tcl%s", TCL_VERSION);
*lengthPtr = strlen(name);
- *valuePtr = Tcl_Alloc(*lengthPtr + 1);
+ *valuePtr = (char *)Tcl_Alloc(*lengthPtr + 1);
*encodingPtr = NULL;
memcpy(*valuePtr, name, *lengthPtr + 1);
}
@@ -411,7 +411,7 @@ InitializeSourceLibraryDir(
TclWinNoBackslash(name);
sprintf(end + 1, "../library");
*lengthPtr = strlen(name);
- *valuePtr = Tcl_Alloc(*lengthPtr + 1);
+ *valuePtr = (char *)Tcl_Alloc(*lengthPtr + 1);
*encodingPtr = NULL;
memcpy(*valuePtr, name, *lengthPtr + 1);
}
@@ -644,7 +644,7 @@ TclpFindVariable(
*/
length = strlen(name);
- nameUpper = Tcl_Alloc(length + 1);
+ nameUpper = (char *)Tcl_Alloc(length + 1);
memcpy(nameUpper, name, length+1);
Tcl_UtfToUpper(nameUpper);
diff --git a/win/tclWinLoad.c b/win/tclWinLoad.c
index aac48af..238af65 100644
--- a/win/tclWinLoad.c
+++ b/win/tclWinLoad.c
@@ -67,6 +67,7 @@ TclpDlopen(
const WCHAR *nativeName;
Tcl_LoadHandle handlePtr;
DWORD firstError;
+ (void)flags;
/*
* First try the full path the user gave us. This is particularly
@@ -74,7 +75,7 @@ TclpDlopen(
* relative path.
*/
- nativeName = Tcl_FSGetNativePath(pathPtr);
+ nativeName = (const WCHAR *)Tcl_FSGetNativePath(pathPtr);
if (nativeName != NULL) {
hInstance = LoadLibraryExW(nativeName, NULL,
LOAD_WITH_ALTERED_SEARCH_PATH);
@@ -171,7 +172,7 @@ TclpDlopen(
* Succeded; package everything up for Tcl.
*/
- handlePtr = Tcl_Alloc(sizeof(struct Tcl_LoadHandle_));
+ handlePtr = (Tcl_LoadHandle)Tcl_Alloc(sizeof(struct Tcl_LoadHandle_));
handlePtr->clientData = (ClientData) hInstance;
handlePtr->findSymbolProcPtr = &FindSymbol;
handlePtr->unloadFileProcPtr = &UnloadFile;
@@ -203,14 +204,14 @@ FindSymbol(
const char *symbol)
{
HINSTANCE hInstance = (HINSTANCE) loadHandle->clientData;
- Tcl_PackageInitProc *proc = NULL;
+ void *proc = NULL;
/*
* For each symbol, check for both Symbol and _Symbol, since Borland
* generates C symbols with a leading '_' by default.
*/
- proc = (void *) GetProcAddress(hInstance, symbol);
+ proc = (void *)GetProcAddress(hInstance, symbol);
if (proc == NULL) {
Tcl_DString ds;
const char *sym2;
@@ -218,7 +219,7 @@ FindSymbol(
Tcl_DStringInit(&ds);
TclDStringAppendLiteral(&ds, "_");
sym2 = Tcl_DStringAppend(&ds, symbol, -1);
- proc = (Tcl_PackageInitProc *) GetProcAddress(hInstance, sym2);
+ proc = (void *)GetProcAddress(hInstance, sym2);
Tcl_DStringFree(&ds);
}
if (proc == NULL && interp != NULL) {
@@ -286,6 +287,9 @@ TclGuessPackageName(
Tcl_DString *bufPtr) /* Initialized empty dstring. Append package
* name to this if possible. */
{
+ (void)fileName;
+ (void)bufPtr;
+
return 0;
}
@@ -417,7 +421,7 @@ InitDLLDirectoryName(void)
*/
copyToGlobalBuffer:
- dllDirectoryName = Tcl_Alloc((nameLen+1) * sizeof(WCHAR));
+ dllDirectoryName = (WCHAR *)Tcl_Alloc((nameLen+1) * sizeof(WCHAR));
wcscpy(dllDirectoryName, name);
return TCL_OK;
}
diff --git a/win/tclWinPipe.c b/win/tclWinPipe.c
index 96a6e93..4d2b20a 100644
--- a/win/tclWinPipe.c
+++ b/win/tclWinPipe.c
@@ -310,13 +310,14 @@ TclpFinalizePipes(void)
void
PipeSetupProc(
- ClientData data, /* Not used. */
+ ClientData dummy, /* Not used. */
int flags) /* Event flags as passed to Tcl_DoOneEvent. */
{
PipeInfo *infoPtr;
Tcl_Time blockTime = { 0, 0 };
int block = 1;
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
+ (void)dummy;
if (!(flags & TCL_FILE_EVENTS)) {
return;
@@ -363,13 +364,14 @@ PipeSetupProc(
static void
PipeCheckProc(
- ClientData data, /* Not used. */
+ ClientData dummy, /* Not used. */
int flags) /* Event flags as passed to Tcl_DoOneEvent. */
{
PipeInfo *infoPtr;
PipeEvent *evPtr;
int needEvent;
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
+ (void)dummy;
if (!(flags & TCL_FILE_EVENTS)) {
return;
@@ -402,7 +404,7 @@ PipeCheckProc(
if (needEvent) {
infoPtr->flags |= PIPE_PENDING;
- evPtr = Tcl_Alloc(sizeof(PipeEvent));
+ evPtr = (PipeEvent *)Tcl_Alloc(sizeof(PipeEvent));
evPtr->header.proc = PipeEventProc;
evPtr->infoPtr = infoPtr;
Tcl_QueueEvent((Tcl_Event *) evPtr, TCL_QUEUE_TAIL);
@@ -433,7 +435,7 @@ TclWinMakeFile(
{
WinFile *filePtr;
- filePtr = Tcl_Alloc(sizeof(WinFile));
+ filePtr = (WinFile *)Tcl_Alloc(sizeof(WinFile));
filePtr->type = WIN_FILE;
filePtr->handle = handle;
@@ -1763,7 +1765,7 @@ TclpCreateCommandChannel(
Tcl_Pid *pidPtr) /* An array of process identifiers. */
{
char channelName[16 + TCL_INTEGER_SPACE];
- PipeInfo *infoPtr = Tcl_Alloc(sizeof(PipeInfo));
+ PipeInfo *infoPtr = (PipeInfo *)Tcl_Alloc(sizeof(PipeInfo));
PipeInit();
@@ -1860,6 +1862,7 @@ Tcl_CreatePipe(
{
HANDLE readHandle, writeHandle;
SECURITY_ATTRIBUTES sec;
+ (void)flags;
sec.nLength = sizeof(SECURITY_ATTRIBUTES);
sec.lpSecurityDescriptor = NULL;
@@ -1917,7 +1920,7 @@ TclGetAndDetachPids(
return;
}
- pipePtr = Tcl_GetChannelInstanceData(chan);
+ pipePtr = (PipeInfo *)Tcl_GetChannelInstanceData(chan);
TclNewObj(pidsObj);
for (i = 0; i < pipePtr->numPids; i++) {
Tcl_ListObjAppendElement(NULL, pidsObj,
@@ -2303,7 +2306,7 @@ PipeOutputProc(
Tcl_Free(infoPtr->writeBuf);
}
infoPtr->writeBufLen = toWrite;
- infoPtr->writeBuf = Tcl_Alloc(toWrite);
+ infoPtr->writeBuf = (char *)Tcl_Alloc(toWrite);
}
memcpy(infoPtr->writeBuf, buf, toWrite);
infoPtr->toWrite = toWrite;
@@ -2711,7 +2714,7 @@ TclWinAddProcess(
void *hProcess, /* Handle to process */
size_t id) /* Global process identifier */
{
- ProcInfo *procPtr = Tcl_Alloc(sizeof(ProcInfo));
+ ProcInfo *procPtr = (ProcInfo*)Tcl_Alloc(sizeof(ProcInfo));
PipeInit();
@@ -2753,6 +2756,7 @@ Tcl_PidObjCmd(
PipeInfo *pipePtr;
int i;
Tcl_Obj *resultPtr;
+ (void)dummy;
if (objc > 2) {
Tcl_WrongNumArgs(interp, 1, objv, "?channelId?");
@@ -2812,7 +2816,7 @@ WaitForRead(
* or not. */
{
DWORD timeout, count;
- HANDLE *handle = ((WinFile *) infoPtr->readFile)->handle;
+ HANDLE *handle = (HANDLE *)((WinFile *) infoPtr->readFile)->handle;
while (1) {
/*
@@ -3201,6 +3205,8 @@ TclpOpenTemporaryFile(
size_t length;
int counter, counter2;
Tcl_DString buf;
+ (void)dirObj;
+ (void)extensionObj;
if (!resultingNameObj) {
flags |= FILE_FLAG_DELETE_ON_CLOSE;
@@ -3287,9 +3293,9 @@ TclPipeThreadCreateTI(
{
TclPipeThreadInfo *pipeTI;
#ifndef _PTI_USE_CKALLOC
- pipeTI = malloc(sizeof(TclPipeThreadInfo));
+ pipeTI = (TclPipeThreadInfo *)malloc(sizeof(TclPipeThreadInfo));
#else
- pipeTI = Tcl_Alloc(sizeof(TclPipeThreadInfo));
+ pipeTI = (TclPipeThreadInfo *)Tcl_Alloc(sizeof(TclPipeThreadInfo));
#endif /* !_PTI_USE_CKALLOC */
pipeTI->evControl = CreateEventW(NULL, FALSE, FALSE, NULL);
pipeTI->state = PTI_STATE_IDLE;
diff --git a/win/tclWinReg.c b/win/tclWinReg.c
index 7bbb10b..16a0d3d 100644
--- a/win/tclWinReg.c
+++ b/win/tclWinReg.c
@@ -1235,7 +1235,7 @@ RecursiveDeleteKey(
checkExProc = 1;
handle = GetModuleHandleW(L"ADVAPI32");
regDeleteKeyExProc = (LONG (*) (HKEY, LPCWSTR, REGSAM, DWORD))
- GetProcAddress(handle, "RegDeleteKeyExW");
+ (void *)GetProcAddress(handle, "RegDeleteKeyExW");
}
if (mode && regDeleteKeyExProc) {
result = regDeleteKeyExProc(startKey, keyName, mode, 0);
diff --git a/win/tclWinSerial.c b/win/tclWinSerial.c
index fc0255a..bcc7983 100644
--- a/win/tclWinSerial.c
+++ b/win/tclWinSerial.c
@@ -285,10 +285,11 @@ SerialInit(void)
static void
SerialExitHandler(
- ClientData clientData) /* Old window proc */
+ ClientData dummy) /* Old window proc */
{
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
SerialInfo *infoPtr;
+ (void)dummy;
/*
* Clear all eventually pending output. Otherwise Tcl's exit could totally
@@ -323,8 +324,10 @@ SerialExitHandler(
static void
ProcExitHandler(
- ClientData clientData) /* Old window proc */
+ ClientData dummy) /* Old window proc */
{
+ (void)dummy;
+
Tcl_MutexLock(&serialMutex);
initialized = 0;
Tcl_MutexUnlock(&serialMutex);
@@ -400,15 +403,20 @@ SerialGetMilliseconds(void)
*----------------------------------------------------------------------
*/
+#ifdef __cplusplus
+#define min(a, b) (((a) < (b)) ? (a) : (b))
+#endif
+
void
SerialSetupProc(
- ClientData data, /* Not used. */
+ ClientData dummy, /* Not used. */
int flags) /* Event flags as passed to Tcl_DoOneEvent. */
{
SerialInfo *infoPtr;
int block = 1;
int msec = INT_MAX; /* min. found block time */
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
+ (void)dummy;
if (!(flags & TCL_FILE_EVENTS)) {
return;
@@ -457,7 +465,7 @@ SerialSetupProc(
static void
SerialCheckProc(
- ClientData data, /* Not used. */
+ ClientData dummy, /* Not used. */
int flags) /* Event flags as passed to Tcl_DoOneEvent. */
{
SerialInfo *infoPtr;
@@ -466,6 +474,7 @@ SerialCheckProc(
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
COMSTAT cStat;
unsigned int time;
+ (void)dummy;
if (!(flags & TCL_FILE_EVENTS)) {
return;
@@ -531,7 +540,7 @@ SerialCheckProc(
if (needEvent) {
infoPtr->flags |= SERIAL_PENDING;
- evPtr = Tcl_Alloc(sizeof(SerialEvent));
+ evPtr = (SerialEvent *)Tcl_Alloc(sizeof(SerialEvent));
evPtr->header.proc = SerialEventProc;
evPtr->infoPtr = infoPtr;
Tcl_QueueEvent((Tcl_Event *) evPtr, TCL_QUEUE_TAIL);
@@ -597,12 +606,13 @@ SerialBlockProc(
static int
SerialCloseProc(
ClientData instanceData, /* Pointer to SerialInfo structure. */
- Tcl_Interp *interp) /* For error reporting. */
+ Tcl_Interp *dummy) /* For error reporting. */
{
SerialInfo *serialPtr = (SerialInfo *) instanceData;
int errorCode, result = 0;
SerialInfo *infoPtr, **nextPtrPtr;
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
+ (void)dummy;
errorCode = 0;
@@ -1030,7 +1040,7 @@ SerialOutputProc(
Tcl_Free(infoPtr->writeBuf);
}
infoPtr->writeBufLen = toWrite;
- infoPtr->writeBuf = Tcl_Alloc(toWrite);
+ infoPtr->writeBuf = (char *)Tcl_Alloc(toWrite);
}
memcpy(infoPtr->writeBuf, buf, toWrite);
infoPtr->toWrite = toWrite;
@@ -1246,6 +1256,7 @@ SerialGetHandleProc(
ClientData *handlePtr) /* Where to store the handle. */
{
SerialInfo *infoPtr = (SerialInfo *) instanceData;
+ (void)direction;
*handlePtr = (ClientData) infoPtr->handle;
return TCL_OK;
@@ -1447,7 +1458,7 @@ TclWinOpenSerialChannel(
SerialInit();
- infoPtr = Tcl_Alloc(sizeof(SerialInfo));
+ infoPtr = (SerialInfo *)Tcl_Alloc(sizeof(SerialInfo));
memset(infoPtr, 0, sizeof(SerialInfo));
infoPtr->validMask = permissions;
diff --git a/win/tclWinSock.c b/win/tclWinSock.c
index 13aaf0b..c6d5501 100644
--- a/win/tclWinSock.c
+++ b/win/tclWinSock.c
@@ -310,7 +310,7 @@ static ProcessGlobalValue hostName =
*/
#define SendSelectMessage(tsdPtr, message, payload) \
- SendMessage((tsdPtr)->hwnd, SOCKET_SELECT, \
+ SendMessageW((tsdPtr)->hwnd, SOCKET_SELECT, \
(WPARAM) (message), (LPARAM) (payload))
@@ -397,7 +397,7 @@ InitializeHostName(
*encodingPtr = Tcl_GetEncoding(NULL, "utf-8");
*lengthPtr = Tcl_DStringLength(&ds);
- *valuePtr = Tcl_Alloc(*lengthPtr + 1);
+ *valuePtr = (char *)Tcl_Alloc(*lengthPtr + 1);
memcpy(*valuePtr, Tcl_DStringValue(&ds), *lengthPtr + 1);
Tcl_DStringFree(&ds);
}
@@ -489,7 +489,7 @@ TclpHasSockets(
void
TclpFinalizeSockets(void)
{
- ThreadSpecificData *tsdPtr = TclThreadDataKeyGet(&dataKey);
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)TclThreadDataKeyGet(&dataKey);
/*
* Careful! This is a finalizer!
@@ -501,7 +501,7 @@ TclpFinalizeSockets(void)
if (tsdPtr->socketThread != NULL) {
if (tsdPtr->hwnd != NULL) {
- PostMessage(tsdPtr->hwnd, SOCKET_TERMINATE, 0, 0);
+ PostMessageW(tsdPtr->hwnd, SOCKET_TERMINATE, 0, 0);
/*
* Wait for the thread to exit. This ensures that we are
@@ -550,7 +550,7 @@ TcpBlockModeProc(
* TCL_MODE_BLOCKING or
* TCL_MODE_NONBLOCKING. */
{
- TcpState *statePtr = instanceData;
+ TcpState *statePtr = (TcpState *)instanceData;
if (mode == TCL_MODE_NONBLOCKING) {
SET_BITS(statePtr->flags, TCP_NONBLOCKING);
@@ -646,10 +646,10 @@ WaitForConnect(
while (1) {
/*
- * Get the statePtr lock.
- */
+ * Get the statePtr lock.
+ */
- tsdPtr = TclThreadDataKeyGet(&dataKey);
+ tsdPtr = (ThreadSpecificData *)TclThreadDataKeyGet(&dataKey);
WaitForSingleObject(tsdPtr->socketListLock, INFINITE);
/*
@@ -783,10 +783,10 @@ TcpInputProc(
* buffer? */
int *errorCodePtr) /* Where to store error code. */
{
- TcpState *statePtr = instanceData;
+ TcpState *statePtr = (TcpState *)instanceData;
int bytesRead;
DWORD error;
- ThreadSpecificData *tsdPtr = TclThreadDataKeyGet(&dataKey);
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)TclThreadDataKeyGet(&dataKey);
*errorCodePtr = 0;
@@ -926,10 +926,10 @@ TcpOutputProc(
int toWrite, /* How many bytes to write? */
int *errorCodePtr) /* Where to store error code. */
{
- TcpState *statePtr = instanceData;
+ TcpState *statePtr = (TcpState *)instanceData;
int written;
DWORD error;
- ThreadSpecificData *tsdPtr = TclThreadDataKeyGet(&dataKey);
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)TclThreadDataKeyGet(&dataKey);
*errorCodePtr = 0;
@@ -1038,12 +1038,13 @@ TcpOutputProc(
static int
TcpCloseProc(
ClientData instanceData, /* The socket to close. */
- Tcl_Interp *interp) /* Unused. */
+ Tcl_Interp *dummy) /* Unused. */
{
- TcpState *statePtr = instanceData;
+ TcpState *statePtr = (TcpState *)instanceData;
/* TIP #218 */
int errorCode = 0;
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
+ (void)dummy;
/*
* Check that WinSock is initialized; do not call it if not, to prevent
@@ -1135,7 +1136,7 @@ TcpClose2Proc(
Tcl_Interp *interp, /* For error reporting. */
int flags) /* Flags that indicate which side to close. */
{
- TcpState *statePtr = instanceData;
+ TcpState *statePtr = (TcpState *)instanceData;
int readError = 0;
int writeError = 0;
@@ -1189,7 +1190,10 @@ TcpSetOptionProc(
#ifdef TCL_FEATURE_KEEPALIVE_NAGLE
TcpState *statePtr = instanceData;
SOCKET sock;
+#else
+ (void)instanceData;
#endif /*TCL_FEATURE_KEEPALIVE_NAGLE*/
+ (void)value;
/*
* Check that WinSock is initialized; do not call it if not, to prevent
@@ -1292,7 +1296,7 @@ TcpGetOptionProc(
Tcl_DString *dsPtr) /* Where to store the computed value;
* initialized by caller. */
{
- TcpState *statePtr = instanceData;
+ TcpState *statePtr = (TcpState *)instanceData;
char host[NI_MAXHOST], port[NI_MAXSERV];
SOCKET sock;
size_t len = 0;
@@ -1611,7 +1615,7 @@ TcpWatchProc(
* TCL_READABLE, TCL_WRITABLE and
* TCL_EXCEPTION. */
{
- TcpState *statePtr = instanceData;
+ TcpState *statePtr = (TcpState *)instanceData;
/*
* Update the watch events mask. Only if the socket is not a server
@@ -1665,7 +1669,8 @@ TcpGetHandleProc(
int direction, /* Not used. */
ClientData *handlePtr) /* Where to store the handle. */
{
- TcpState *statePtr = instanceData;
+ TcpState *statePtr = (TcpState *)instanceData;
+ (void)direction;
*handlePtr = INT2PTR(statePtr->sockets->fd);
return TCL_OK;
@@ -1722,7 +1727,7 @@ TcpConnect(
int async_callback = GOT_BITS(statePtr->flags, TCP_ASYNC_PENDING);
/* We were called by the event procedure and
* continue our loop. */
- ThreadSpecificData *tsdPtr = TclThreadDataKeyGet(&dataKey);
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)TclThreadDataKeyGet(&dataKey);
if (async_callback) {
goto reenter;
@@ -2141,7 +2146,7 @@ Tcl_MakeTcpClientChannel(
return NULL;
}
- tsdPtr = TclThreadDataKeyGet(&dataKey);
+ tsdPtr = (ThreadSpecificData *)TclThreadDataKeyGet(&dataKey);
/*
* Set kernel space buffering and non-blocking.
@@ -2333,7 +2338,7 @@ Tcl_OpenTcpServerEx(
}
if (statePtr != NULL) {
- ThreadSpecificData *tsdPtr = TclThreadDataKeyGet(&dataKey);
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)TclThreadDataKeyGet(&dataKey);
statePtr->acceptProc = acceptProc;
statePtr->acceptProcData = acceptProcData;
@@ -2401,7 +2406,7 @@ TcpAccept(
int len = sizeof(addr);
char channelName[SOCK_CHAN_LENGTH];
char host[NI_MAXHOST], port[NI_MAXSERV];
- ThreadSpecificData *tsdPtr = TclThreadDataKeyGet(&dataKey);
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)TclThreadDataKeyGet(&dataKey);
/*
* Win-NT has a misfeature that sockets are inherited in child processes
@@ -2472,7 +2477,7 @@ static void
InitSockets(void)
{
DWORD id;
- ThreadSpecificData *tsdPtr = TclThreadDataKeyGet(&dataKey);
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)TclThreadDataKeyGet(&dataKey);
if (!initialized) {
initialized = 1;
@@ -2521,11 +2526,11 @@ InitSockets(void)
tsdPtr->socketList = NULL;
tsdPtr->hwnd = NULL;
tsdPtr->threadId = Tcl_GetCurrentThread();
- tsdPtr->readyEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
+ tsdPtr->readyEvent = CreateEventW(NULL, FALSE, FALSE, NULL);
if (tsdPtr->readyEvent == NULL) {
goto initFailure;
}
- tsdPtr->socketListLock = CreateEvent(NULL, FALSE, TRUE, NULL);
+ tsdPtr->socketListLock = CreateEventW(NULL, FALSE, TRUE, NULL);
if (tsdPtr->socketListLock == NULL) {
goto initFailure;
}
@@ -2611,8 +2616,10 @@ SocketsEnabled(void)
/* ARGSUSED */
static void
SocketExitHandler(
- ClientData clientData) /* Not used. */
+ ClientData dummy) /* Not used. */
{
+ (void)dummy;
+
Tcl_MutexLock(&socketMutex);
/*
@@ -2645,12 +2652,13 @@ SocketExitHandler(
void
SocketSetupProc(
- ClientData data, /* Not used. */
+ ClientData dummy, /* Not used. */
int flags) /* Event flags as passed to Tcl_DoOneEvent. */
{
TcpState *statePtr;
Tcl_Time blockTime = { 0, 0 };
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
+ (void)dummy;
if (!GOT_BITS(flags, TCL_FILE_EVENTS)) {
return;
@@ -2690,12 +2698,13 @@ SocketSetupProc(
static void
SocketCheckProc(
- ClientData data, /* Not used. */
+ ClientData dummy, /* Not used. */
int flags) /* Event flags as passed to Tcl_DoOneEvent. */
{
TcpState *statePtr;
SocketEvent *evPtr;
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
+ (void)dummy;
if (!GOT_BITS(flags, TCL_FILE_EVENTS)) {
return;
@@ -2714,7 +2723,7 @@ SocketCheckProc(
statePtr->watchEvents | FD_CONNECT | FD_ACCEPT)
&& !GOT_BITS(statePtr->flags, SOCKET_PENDING)) {
SET_BITS(statePtr->flags, SOCKET_PENDING);
- evPtr = Tcl_Alloc(sizeof(SocketEvent));
+ evPtr = (SocketEvent *)Tcl_Alloc(sizeof(SocketEvent));
evPtr->header.proc = SocketEventProc;
evPtr->socket = statePtr->sockets->fd;
Tcl_QueueEvent((Tcl_Event *) evPtr, TCL_QUEUE_TAIL);
@@ -2989,7 +2998,7 @@ AddSocketInfoFd(
* Add the first FD.
*/
- statePtr->sockets = Tcl_Alloc(sizeof(TcpFdList));
+ statePtr->sockets = (TcpFdList *)Tcl_Alloc(sizeof(TcpFdList));
fds = statePtr->sockets;
} else {
/*
@@ -3000,7 +3009,7 @@ AddSocketInfoFd(
fds = fds->next;
}
- fds->next = Tcl_Alloc(sizeof(TcpFdList));
+ fds->next = (TcpFdList *)Tcl_Alloc(sizeof(TcpFdList));
fds = fds->next;
}
@@ -3033,7 +3042,7 @@ AddSocketInfoFd(
static TcpState *
NewSocketInfo(SOCKET socket)
{
- TcpState *statePtr = Tcl_Alloc(sizeof(TcpState));
+ TcpState *statePtr = (TcpState *)Tcl_Alloc(sizeof(TcpState));
memset(statePtr, 0, sizeof(TcpState));
@@ -3076,7 +3085,7 @@ WaitForSocketEvent(
{
int result = 1;
int oldMode;
- ThreadSpecificData *tsdPtr = TclThreadDataKeyGet(&dataKey);
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)TclThreadDataKeyGet(&dataKey);
/*
* Be sure to disable event servicing so we are truly modal.
@@ -3162,7 +3171,7 @@ SocketThread(
LPVOID arg)
{
MSG msg;
- ThreadSpecificData *tsdPtr = arg;
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)arg;
/*
* Create a dummy window receiving socket events.
@@ -3188,7 +3197,7 @@ SocketThread(
/*
* Process all messages on the socket window until WM_QUIT. This threads
* exits only when instructed to do so by the call to
- * PostMessage(SOCKET_TERMINATE) in TclpFinalizeSockets().
+ * PostMessageW(SOCKET_TERMINATE) in TclpFinalizeSockets().
*/
while (GetMessageW(&msg, NULL, 0, 0) > 0) {
@@ -3254,7 +3263,7 @@ SocketProc(
*/
#ifdef _WIN64
- SetWindowLongPtr(hwnd, GWLP_USERDATA,
+ SetWindowLongPtrW(hwnd, GWLP_USERDATA,
(LONG_PTR) ((LPCREATESTRUCT)lParam)->lpCreateParams);
#else
SetWindowLongW(hwnd, GWL_USERDATA,
@@ -3415,7 +3424,7 @@ TcpThreadActionProc(
int action)
{
ThreadSpecificData *tsdPtr;
- TcpState *statePtr = instanceData;
+ TcpState *statePtr = (TcpState *)instanceData;
int notifyCmd;
if (action == TCL_CHANNEL_THREAD_INSERT) {
diff --git a/win/tclWinTest.c b/win/tclWinTest.c
index 07b83a4..062e4f1 100644
--- a/win/tclWinTest.c
+++ b/win/tclWinTest.c
@@ -102,7 +102,7 @@ TclplatformtestInit(
static int
TesteventloopCmd(
- ClientData clientData, /* Not used. */
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
@@ -110,6 +110,7 @@ TesteventloopCmd(
static int *framePtr = NULL;/* Pointer to integer on stack frame of
* innermost invocation of the "wait"
* subcommand. */
+ (void)dummy;
if (objc < 2) {
Tcl_WrongNumArgs(interp, 1, objv, "option ...");
@@ -178,7 +179,7 @@ TesteventloopCmd(
static int
TestvolumetypeCmd(
- ClientData clientData, /* Not used. */
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
@@ -187,6 +188,7 @@ TestvolumetypeCmd(
int found;
char volType[VOL_BUF_SIZE];
const char *path;
+ (void)dummy;
if (objc > 2) {
Tcl_WrongNumArgs(interp, 1, objv, "?name?");
@@ -257,6 +259,7 @@ TestwinclockCmd(
Tcl_Obj *result; /* Result of the command */
LARGE_INTEGER t1, t2;
LARGE_INTEGER p1, p2;
+ (void)dummy;
if (objc != 1) {
Tcl_WrongNumArgs(interp, 1, objv, "");
@@ -293,12 +296,13 @@ TestwinclockCmd(
static int
TestwinsleepCmd(
- ClientData clientData, /* Unused */
+ ClientData dummy, /* Unused */
Tcl_Interp* interp, /* Tcl interpreter */
int objc, /* Parameter count */
Tcl_Obj *const * objv) /* Parameter vector */
{
int ms;
+ (void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "ms");
@@ -363,6 +367,7 @@ TestExceptionCmd(
EXCEPTION_GUARD_PAGE, EXCEPTION_INVALID_HANDLE, CONTROL_C_EXIT
};
int cmd;
+ (void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 0, objv, "<type-of-exception>");
@@ -466,7 +471,7 @@ TestplatformChmod(
goto done;
}
- secDesc = Tcl_Alloc(secDescLen);
+ secDesc = (BYTE *)Tcl_Alloc(secDescLen);
if (!GetFileSecurityA(nativePath, infoBits,
(PSECURITY_DESCRIPTOR) secDesc, secDescLen, &secDescLen2)
|| (secDescLen < secDescLen2)) {
@@ -478,7 +483,7 @@ TestplatformChmod(
* Get the World SID.
*/
- userSid = Tcl_Alloc(GetSidLengthRequired((UCHAR) 1));
+ userSid = (SID *)Tcl_Alloc(GetSidLengthRequired((UCHAR) 1));
InitializeSid(userSid, &userSidAuthority, (BYTE) 1);
*(GetSidSubAuthority(userSid, 0)) = SECURITY_WORLD_RID;
@@ -504,7 +509,7 @@ TestplatformChmod(
newAclSize = ACLSize.AclBytesInUse + sizeof(ACCESS_DENIED_ACE)
+ GetLengthSid(userSid) - sizeof(DWORD);
- newAcl = Tcl_Alloc(newAclSize);
+ newAcl = (PACL) Tcl_Alloc(newAclSize);
/*
* Initialize the new ACL.
@@ -631,6 +636,7 @@ TestchmodCmd(
Tcl_Obj *const * objv) /* Parameter vector */
{
int i, mode;
+ (void)dummy;
if (objc < 2) {
Tcl_WrongNumArgs(interp, 1, objv, "mode file ?file ...?");
diff --git a/win/tclWinThrd.c b/win/tclWinThrd.c
index 3e8b7d5..6bd9f11 100644
--- a/win/tclWinThrd.c
+++ b/win/tclWinThrd.c
@@ -568,7 +568,7 @@ Tcl_MutexLock(
*/
if (*mutexPtr == NULL) {
- csPtr = Tcl_Alloc(sizeof(CRITICAL_SECTION));
+ csPtr = (CRITICAL_SECTION *)Tcl_Alloc(sizeof(CRITICAL_SECTION));
InitializeCriticalSection(csPtr);
*mutexPtr = (Tcl_Mutex)csPtr;
TclRememberMutex(mutexPtr);
@@ -711,7 +711,7 @@ Tcl_ConditionWait(
*/
if (*condPtr == NULL) {
- winCondPtr = Tcl_Alloc(sizeof(WinCondition));
+ winCondPtr = (WinCondition *)Tcl_Alloc(sizeof(WinCondition));
InitializeCriticalSection(&winCondPtr->condLock);
winCondPtr->firstPtr = NULL;
winCondPtr->lastPtr = NULL;
@@ -940,7 +940,7 @@ TclpNewAllocMutex(void)
{
allocMutex *lockPtr;
- lockPtr = malloc(sizeof(allocMutex));
+ lockPtr = (allocMutex *)malloc(sizeof(allocMutex));
if (lockPtr == NULL) {
Tcl_Panic("could not allocate lock");
}
@@ -1037,7 +1037,7 @@ TclpThreadCreateKey(void)
{
DWORD *key;
- key = TclpSysAlloc(sizeof *key);
+ key = (DWORD *)TclpSysAlloc(sizeof *key);
if (key == NULL) {
Tcl_Panic("unable to allocate thread key!");
}
@@ -1055,7 +1055,7 @@ void
TclpThreadDeleteKey(
void *keyPtr)
{
- DWORD *key = keyPtr;
+ DWORD *key = (DWORD *)keyPtr;
if (!TlsFree(*key)) {
Tcl_Panic("unable to delete key");
@@ -1069,7 +1069,7 @@ TclpThreadSetMasterTSD(
void *tsdKeyPtr,
void *ptr)
{
- DWORD *key = tsdKeyPtr;
+ DWORD *key = (DWORD *)tsdKeyPtr;
if (!TlsSetValue(*key, ptr)) {
Tcl_Panic("unable to set master TSD value");
@@ -1080,7 +1080,7 @@ void *
TclpThreadGetMasterTSD(
void *tsdKeyPtr)
{
- DWORD *key = tsdKeyPtr;
+ DWORD *key = (DWORD *)tsdKeyPtr;
return TlsGetValue(*key);
}
diff --git a/win/tclWinTime.c b/win/tclWinTime.c
index cce2776..0c2f212 100644
--- a/win/tclWinTime.c
+++ b/win/tclWinTime.c
@@ -73,7 +73,7 @@ static TimeInfo timeInfo = {
(HANDLE) NULL,
(HANDLE) NULL,
(HANDLE) NULL,
-#ifdef HAVE_CAST_TO_UNION
+#if defined(HAVE_CAST_TO_UNION) && !defined(__cplusplus)
(LARGE_INTEGER) (Tcl_WideInt) 0,
(ULARGE_INTEGER) (DWORDLONG) 0,
(LARGE_INTEGER) (Tcl_WideInt) 0,
@@ -386,8 +386,11 @@ Tcl_GetTime(
static void
NativeScaleTime(
Tcl_Time *timePtr,
- ClientData clientData)
+ ClientData dummy)
{
+ (void)timePtr;
+ (void)dummy;
+
/*
* Native scale is 1:1. Nothing is done.
*/
@@ -621,9 +624,10 @@ NativeGetMicroseconds(void)
static void
NativeGetTime(
Tcl_Time *timePtr,
- ClientData clientData)
+ ClientData dummy)
{
Tcl_WideInt usecSincePosixEpoch;
+ (void)dummy;
/*
* Try to use high resolution timer.
@@ -666,8 +670,10 @@ void TclWinResetTimerResolution(void);
static void
StopCalibration(
- ClientData unused) /* Client data is unused */
+ ClientData dummy) /* Client data is unused */
{
+ (void)dummy;
+
SetEvent(timeInfo.exitEvent);
/*
@@ -712,6 +718,7 @@ CalibrationThread(
{
FILETIME curFileTime;
DWORD waitResult;
+ (void)arg;
/*
* Get initial system time and performance counter.