summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2020-02-28 12:06:07 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2020-02-28 12:06:07 (GMT)
commit52e543c5691a60c3ef802fecf1ae08e7efcf19b7 (patch)
tree1f02ba454f2725719d80901eef77168723e980f7
parentf9ddbba3d621449f2cb1b2a4d0a94927b48391eb (diff)
parent24a416ad3867b536dd613454c6f07df349f797f2 (diff)
downloadtcl-52e543c5691a60c3ef802fecf1ae08e7efcf19b7.zip
tcl-52e543c5691a60c3ef802fecf1ae08e7efcf19b7.tar.gz
tcl-52e543c5691a60c3ef802fecf1ae08e7efcf19b7.tar.bz2
Implement TIP #557: C++ support for Tcl
-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.c376
-rw-r--r--generic/tclBinary.c60
-rw-r--r--generic/tclClock.c58
-rw-r--r--generic/tclCmdAH.c141
-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.c69
-rw-r--r--generic/tclConfig.c15
-rw-r--r--generic/tclDate.c5
-rw-r--r--generic/tclDecls.h6
-rw-r--r--generic/tclDictObj.c142
-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.c65
-rw-r--r--generic/tclFCmd.c27
-rw-r--r--generic/tclFileName.c10
-rw-r--r--generic/tclGetDate.y5
-rw-r--r--generic/tclHash.c33
-rw-r--r--generic/tclHistory.c9
-rw-r--r--generic/tclIO.c65
-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.c40
-rw-r--r--generic/tclInt.h23
-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.c101
-rw-r--r--generic/tclOptimize.c6
-rw-r--r--generic/tclPanic.c2
-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.c12
-rw-r--r--generic/tclScan.c21
-rw-r--r--generic/tclStrToD.c23
-rw-r--r--generic/tclStringObj.c23
-rw-r--r--generic/tclStubInit.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.c30
-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.c52
-rw-r--r--generic/tclVar.c98
-rw-r--r--generic/tclZipfs.c138
-rw-r--r--generic/tclZlib.c53
-rw-r--r--libtommath/tommath_private.h7
-rw-r--r--macosx/tclMacOSXBundle.c5
-rw-r--r--macosx/tclMacOSXFCmd.c4
-rw-r--r--macosx/tclMacOSXNotify.c16
-rwxr-xr-xunix/configure10
-rw-r--r--unix/tcl.m410
-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.c12
-rw-r--r--unix/tclXtNotify.c4
-rwxr-xr-xwin/configure4
-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.c39
-rw-r--r--win/tclWinInit.c12
-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.c22
-rw-r--r--win/tclWinThrd.c14
-rw-r--r--win/tclWinTime.c15
130 files changed, 3373 insertions, 2215 deletions
diff --git a/.travis.yml b/.travis.yml
index 9ccb3fb..236bb2e 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
@@ -322,6 +330,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
@@ -357,6 +374,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 9a90fec..9768778 100644
--- a/generic/tcl.h
+++ b/generic/tcl.h
@@ -361,7 +361,7 @@ typedef long LONG;
*/
#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 51e7ca0..88f3e29 100644
--- a/generic/tclAssembly.c
+++ b/generic/tclAssembly.c
@@ -772,7 +772,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. */
@@ -782,7 +782,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 9f650d6..c02cf6a 100644
--- a/generic/tclBasic.c
+++ b/generic/tclBasic.c
@@ -106,7 +106,7 @@ typedef struct {
char *result; /* The script cancellation result or NULL for
* a default result. */
int length; /* Length of the above error message. */
- ClientData clientData; /* Ignored */
+ ClientData clientData; /* Not used. */
int flags; /* Additional flags */
} CancelInfo;
static Tcl_HashTable cancelTable;
@@ -453,24 +453,24 @@ typedef struct {
const char *name; /* Name of the function. The full name is
* "::tcl::mathfunc::<name>". */
Tcl_ObjCmdProc *objCmdProc; /* Function that evaluates the function */
- ClientData clientData; /* Client data for the function */
+ 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 },
@@ -479,19 +479,19 @@ static const BuiltinFuncDef BuiltinFuncTable[] = {
{ "isqrt", ExprIsqrtFunc, NULL },
{ "issubnormal", ExprIsSubnormalFunc, NULL, },
{ "isunordered", ExprIsUnorderedFunc, NULL, },
- { "log", ExprUnaryFunc, (ClientData) log },
- { "log10", ExprUnaryFunc, (ClientData) log10 },
+ { "log", ExprUnaryFunc, 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 }
};
@@ -700,7 +700,7 @@ Tcl_CreateInterp(void)
* object type table and other object management code.
*/
- iPtr = ckalloc(sizeof(Interp));
+ iPtr = (Interp *)ckalloc(sizeof(Interp));
interp = (Tcl_Interp *) iPtr;
#ifdef TCL_NO_DEPRECATED
@@ -731,10 +731,10 @@ Tcl_CreateInterp(void)
*/
iPtr->cmdFramePtr = NULL;
- iPtr->linePBodyPtr = ckalloc(sizeof(Tcl_HashTable));
- iPtr->lineBCPtr = ckalloc(sizeof(Tcl_HashTable));
- iPtr->lineLAPtr = ckalloc(sizeof(Tcl_HashTable));
- iPtr->lineLABCPtr = ckalloc(sizeof(Tcl_HashTable));
+ iPtr->linePBodyPtr = (Tcl_HashTable *)ckalloc(sizeof(Tcl_HashTable));
+ iPtr->lineBCPtr = (Tcl_HashTable *)ckalloc(sizeof(Tcl_HashTable));
+ iPtr->lineLAPtr = (Tcl_HashTable *)ckalloc(sizeof(Tcl_HashTable));
+ iPtr->lineLABCPtr = (Tcl_HashTable *)ckalloc(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);
@@ -837,7 +837,7 @@ Tcl_CreateInterp(void)
*/
/* This is needed to satisfy GCC 3.3's strict aliasing rules */
- framePtr = ckalloc(sizeof(CallFrame));
+ framePtr = (CallFrame *)ckalloc(sizeof(CallFrame));
(void) Tcl_PushCallFrame(interp, (Tcl_CallFrame *) framePtr,
(Tcl_Namespace *) iPtr->globalNsPtr, /*isProcCallFrame*/ 0);
framePtr->objc = 0;
@@ -867,7 +867,7 @@ Tcl_CreateInterp(void)
iPtr->asyncCancelMsg = Tcl_NewObj();
- cancelInfo = ckalloc(sizeof(CancelInfo));
+ cancelInfo = (CancelInfo *)ckalloc(sizeof(CancelInfo));
cancelInfo->interp = interp;
iPtr->asyncCancel = Tcl_AsyncCreate(CancelEvalProc, cancelInfo);
@@ -937,7 +937,7 @@ Tcl_CreateInterp(void)
*/
#if TCL_THREADS && defined(USE_THREAD_ALLOC)
- iPtr->allocCache = TclpGetAllocCache();
+ iPtr->allocCache = (AllocCache *)TclpGetAllocCache();
#else
iPtr->allocCache = NULL;
#endif
@@ -966,7 +966,7 @@ Tcl_CreateInterp(void)
hPtr = Tcl_CreateHashEntry(&iPtr->globalNsPtr->cmdTable,
cmdInfoPtr->name, &isNew);
if (isNew) {
- cmdPtr = ckalloc(sizeof(Command));
+ cmdPtr = (Command *)ckalloc(sizeof(Command));
cmdPtr->hPtr = hPtr;
cmdPtr->nsPtr = iPtr->globalNsPtr;
cmdPtr->refCount = 1;
@@ -1080,7 +1080,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);
}
@@ -1096,7 +1096,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 = ckalloc(sizeof(TclOpCmdClientData));
+ TclOpCmdClientData *occdPtr = (TclOpCmdClientData *)ckalloc(sizeof(TclOpCmdClientData));
occdPtr->op = opcmdInfoPtr->name;
occdPtr->i.numArgs = opcmdInfoPtr->i.numArgs;
@@ -1209,7 +1209,7 @@ static void
DeleteOpCmdClientData(
ClientData clientData)
{
- TclOpCmdClientData *occdPtr = clientData;
+ TclOpCmdClientData *occdPtr = (TclOpCmdClientData *)clientData;
ckfree(occdPtr);
}
@@ -1260,7 +1260,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) {
@@ -1332,7 +1332,7 @@ TclHideUnsafeCommands(
Tcl_GetString(Tcl_GetObjResult(interp)));
}
Tcl_CreateObjCommand(interp, TclGetString(cmdName),
- BadEnsembleSubcommand, (ClientData) unsafePtr, NULL);
+ BadEnsembleSubcommand, (void *)unsafePtr, NULL);
TclDecrRefCount(cmdName);
TclDecrRefCount(hideName);
} else {
@@ -1377,7 +1377,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",
@@ -1417,17 +1419,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 = ckalloc(sizeof(AssocData));
+ AssocData *dPtr = (AssocData *)ckalloc(sizeof(AssocData));
Tcl_HashEntry *hPtr;
sprintf(buffer, "Assoc Data Key #%d", *assocDataCounterPtr);
(*assocDataCounterPtr)++;
if (iPtr->assocData == NULL) {
- iPtr->assocData = ckalloc(sizeof(Tcl_HashTable));
+ iPtr->assocData = (Tcl_HashTable *)ckalloc(sizeof(Tcl_HashTable));
Tcl_InitHashTable(iPtr->assocData, TCL_STRING_KEYS);
}
hPtr = Tcl_CreateHashEntry(iPtr->assocData, buffer, &isNew);
@@ -1474,7 +1476,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)) {
ckfree(dPtr);
Tcl_DeleteHashEntry(hPtr);
@@ -1516,14 +1518,14 @@ Tcl_SetAssocData(
int isNew;
if (iPtr->assocData == NULL) {
- iPtr->assocData = ckalloc(sizeof(Tcl_HashTable));
+ iPtr->assocData = (Tcl_HashTable *)ckalloc(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 = ckalloc(sizeof(AssocData));
+ dPtr = (AssocData *)ckalloc(sizeof(AssocData));
}
dPtr->proc = proc;
dPtr->clientData = clientData;
@@ -1564,7 +1566,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);
}
@@ -1609,7 +1611,7 @@ Tcl_GetAssocData(
if (hPtr == NULL) {
return NULL;
}
- dPtr = Tcl_GetHashValue(hPtr);
+ dPtr = (AssocData *)Tcl_GetHashValue(hPtr);
if (procPtr != NULL) {
*procPtr = dPtr->proc;
}
@@ -1760,7 +1762,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) {
@@ -1818,7 +1820,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);
ckfree(hTablePtr);
@@ -1837,7 +1839,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);
@@ -1934,7 +1936,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;
@@ -1958,7 +1960,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);
@@ -2122,7 +2124,7 @@ Tcl_HideCommand(
hiddenCmdTablePtr = iPtr->hiddenCmdTablePtr;
if (hiddenCmdTablePtr == NULL) {
- hiddenCmdTablePtr = ckalloc(sizeof(Tcl_HashTable));
+ hiddenCmdTablePtr = (Tcl_HashTable *)ckalloc(sizeof(Tcl_HashTable));
Tcl_InitHashTable(hiddenCmdTablePtr, TCL_STRING_KEYS);
iPtr->hiddenCmdTablePtr = hiddenCmdTablePtr;
}
@@ -2262,7 +2264,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
@@ -2458,7 +2460,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
@@ -2513,7 +2515,7 @@ Tcl_CreateCommand(
TclInvalidateNsCmdLookup(nsPtr);
TclInvalidateNsPath(nsPtr);
}
- cmdPtr = ckalloc(sizeof(Command));
+ cmdPtr = (Command *)ckalloc(sizeof(Command));
Tcl_SetHashValue(hPtr, cmdPtr);
cmdPtr->hPtr = hPtr;
cmdPtr->nsPtr = nsPtr;
@@ -2540,7 +2542,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;
}
@@ -2677,7 +2679,7 @@ TclCreateObjCommandInNs(
* An existing command conflicts. Try to delete it...
*/
- cmdPtr = Tcl_GetHashValue(hPtr);
+ cmdPtr = (Command *)Tcl_GetHashValue(hPtr);
/*
* [***] This is wrong. See Tcl Bug a16752c252.
@@ -2758,7 +2760,7 @@ TclCreateObjCommandInNs(
TclInvalidateNsCmdLookup(nsPtr);
TclInvalidateNsPath(nsPtr);
}
- cmdPtr = ckalloc(sizeof(Command));
+ cmdPtr = (Command *)ckalloc(sizeof(Command));
Tcl_SetHashValue(hPtr, cmdPtr);
cmdPtr->hPtr = hPtr;
cmdPtr->nsPtr = nsPtr;
@@ -2786,7 +2788,7 @@ TclCreateObjCommandInNs(
while (oldRefPtr != NULL) {
Command *refCmdPtr = oldRefPtr->importedCmdPtr;
- dataPtr = refCmdPtr->objClientData;
+ dataPtr = (ImportedCmdData*)refCmdPtr->objClientData;
dataPtr->realCmdPtr = cmdPtr;
oldRefPtr = oldRefPtr->nextPtr;
}
@@ -2831,9 +2833,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++) {
@@ -2879,10 +2881,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++) {
@@ -3317,12 +3319,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)) {
/*
@@ -3334,7 +3337,7 @@ Tcl_GetCommandName(
return "";
}
- return Tcl_GetHashKey(cmdPtr->hPtr->tablePtr, cmdPtr->hPtr);
+ return (const char *)Tcl_GetHashKey(cmdPtr->hPtr->tablePtr, cmdPtr->hPtr);
}
/*
@@ -3384,7 +3387,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);
}
}
@@ -3765,11 +3768,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);
@@ -3888,11 +3892,11 @@ Tcl_CreateMathFunc(
* function. */
{
Tcl_DString bigName;
- OldMathFuncData *data = ckalloc(sizeof(OldMathFuncData));
+ OldMathFuncData *data = (OldMathFuncData *)ckalloc(sizeof(OldMathFuncData));
data->proc = proc;
data->numArgs = numArgs;
- data->argTypes = ckalloc(numArgs * sizeof(Tcl_ValueType));
+ data->argTypes = (Tcl_ValueType *)ckalloc(numArgs * sizeof(Tcl_ValueType));
memcpy(data->argTypes, argTypes, numArgs * sizeof(Tcl_ValueType));
data->clientData = clientData;
@@ -3930,7 +3934,7 @@ OldMathFuncProc(
Tcl_Obj *const *objv) /* Parameter vector */
{
Tcl_Obj *valuePtr;
- OldMathFuncData *dataPtr = clientData;
+ OldMathFuncData *dataPtr = (OldMathFuncData *)clientData;
Tcl_Value funcResult, *args;
int result;
int j, k;
@@ -3949,7 +3953,7 @@ OldMathFuncProc(
* Convert arguments from Tcl_Obj's to Tcl_Value's.
*/
- args = ckalloc(dataPtr->numArgs * sizeof(Tcl_Value));
+ args = (Tcl_Value *)ckalloc(dataPtr->numArgs * sizeof(Tcl_Value));
for (j = 1, k = 0; j < objc; ++j, ++k) {
/* TODO: Convert to TclGetNumberFromObj? */
valuePtr = objv[j];
@@ -4072,7 +4076,7 @@ static void
OldMathFuncDeleteProc(
ClientData clientData)
{
- OldMathFuncData *dataPtr = clientData;
+ OldMathFuncData *dataPtr = (OldMathFuncData *)clientData;
ckfree(dataPtr->argTypes);
ckfree(dataPtr);
@@ -4145,7 +4149,7 @@ Tcl_GetMathFuncInfo(
*/
if (cmdPtr->objProc == &OldMathFuncProc) {
- OldMathFuncData *dataPtr = cmdPtr->clientData;
+ OldMathFuncData *dataPtr = (OldMathFuncData *)cmdPtr->clientData;
*procPtr = dataPtr->proc;
*numArgsPtr = dataPtr->numArgs;
@@ -4482,7 +4486,7 @@ Tcl_CancelEval(
goto done;
}
- cancelInfo = Tcl_GetHashValue(hPtr);
+ cancelInfo = (CancelInfo *)Tcl_GetHashValue(hPtr);
/*
* Populate information needed by the interpreter thread to fulfill the
@@ -4494,7 +4498,7 @@ Tcl_CancelEval(
if (resultObjPtr != NULL) {
result = TclGetStringFromObj(resultObjPtr, &cancelInfo->length);
- cancelInfo->result = ckrealloc(cancelInfo->result,cancelInfo->length);
+ cancelInfo->result = (char *)ckrealloc(cancelInfo->result,cancelInfo->length);
memcpy(cancelInfo->result, result, cancelInfo->length);
TclDecrRefCount(resultObjPtr); /* Discard their result object. */
} else {
@@ -4614,13 +4618,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
@@ -4774,11 +4779,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()) {
@@ -4962,7 +4968,7 @@ TEOV_RestoreVarFrame(
Tcl_Interp *interp,
int result)
{
- ((Interp *) interp)->varFramePtr = data[0];
+ ((Interp *) interp)->varFramePtr = (CallFrame *)data[0];
return result;
}
@@ -5006,7 +5012,7 @@ TEOV_Error(
const char *cmdString;
int 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)) {
/*
@@ -5068,7 +5074,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
@@ -5129,8 +5135,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;
@@ -5210,9 +5216,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];
int length;
const char *command = TclGetStringFromObj(commandPtr, &length);
@@ -5435,12 +5441,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
@@ -5576,9 +5582,9 @@ TclEvalEx(
*/
if (numWords > minObjs) {
- expand = ckalloc(numWords * sizeof(int));
- objvSpace = ckalloc(numWords * sizeof(Tcl_Obj *));
- lineSpace = ckalloc(numWords * sizeof(int));
+ expand = (int *)ckalloc(numWords * sizeof(int));
+ objvSpace = (Tcl_Obj **)ckalloc(numWords * sizeof(Tcl_Obj *));
+ lineSpace = (int *)ckalloc(numWords * sizeof(int));
}
expandRequested = 0;
objv = objvSpace;
@@ -5664,8 +5670,8 @@ TclEvalEx(
if ((numWords > minObjs) || (objectsNeeded > minObjs)) {
objv = objvSpace =
- ckalloc(objectsNeeded * sizeof(Tcl_Obj *));
- lines = lineSpace = ckalloc(objectsNeeded * sizeof(int));
+ (Tcl_Obj **)ckalloc(objectsNeeded * sizeof(Tcl_Obj *));
+ lines = lineSpace = (int *)ckalloc(objectsNeeded * sizeof(int));
}
objectsUsed = 0;
@@ -5986,7 +5992,7 @@ TclArgumentEnter(
* and initialize references.
*/
- cfwPtr = ckalloc(sizeof(CFWord));
+ cfwPtr = (CFWord *)ckalloc(sizeof(CFWord));
cfwPtr->framePtr = cfPtr;
cfwPtr->word = i;
cfwPtr->refCount = 1;
@@ -5997,7 +6003,7 @@ TclArgumentEnter(
* relevant. Just remember the reference to prevent early removal.
*/
- cfwPtr = Tcl_GetHashValue(hPtr);
+ cfwPtr = (CFWord *)Tcl_GetHashValue(hPtr);
cfwPtr->refCount++;
}
}
@@ -6040,7 +6046,7 @@ TclArgumentRelease(
if (!hPtr) {
continue;
}
- cfwPtr = Tcl_GetHashValue(hPtr);
+ cfwPtr = (CFWord *)Tcl_GetHashValue(hPtr);
if (cfwPtr->refCount-- > 1) {
continue;
@@ -6092,7 +6098,7 @@ TclArgumentBCEnter(
if (!hePtr) {
return;
}
- eclPtr = Tcl_GetHashValue(hePtr);
+ eclPtr = (ExtCmdLoc *)Tcl_GetHashValue(hePtr);
ePtr = &eclPtr->loc[cmd];
/*
@@ -6125,10 +6131,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 = ckalloc(sizeof(CFWordBC));
+ objv[word], &isNew);
+ CFWordBC *cfwPtr = (CFWordBC *)ckalloc(sizeof(CFWordBC));
cfwPtr->framePtr = cfPtr;
cfwPtr->obj = objv[word];
@@ -6137,7 +6143,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.
@@ -6152,7 +6158,7 @@ TclArgumentBCEnter(
* information in the new structure.
*/
- cfwPtr->prevPtr = Tcl_GetHashValue(hPtr);
+ cfwPtr->prevPtr = (CFWordBC *)Tcl_GetHashValue(hPtr);
}
Tcl_SetHashValue(hPtr, cfwPtr);
@@ -6194,7 +6200,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");
@@ -6260,7 +6266,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;
@@ -6274,7 +6280,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 *)
@@ -6490,7 +6496,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;
@@ -6599,8 +6605,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) {
@@ -6645,9 +6651,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
@@ -7031,7 +7037,7 @@ TclObjInvoke(
int
TclNRInvoke(
- ClientData clientData,
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
@@ -7041,6 +7047,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;
@@ -7054,7 +7061,7 @@ TclNRInvoke(
NULL);
return TCL_ERROR;
}
- cmdPtr = Tcl_GetHashValue(hPtr);
+ cmdPtr = (Command *)Tcl_GetHashValue(hPtr);
/*
* Avoid the exception-handling brain damage when numLevels == 0
@@ -7074,11 +7081,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;
}
@@ -7513,7 +7522,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. */
@@ -7522,6 +7531,7 @@ ExprCeilFunc(
int code;
double d;
mp_int big;
+ (void)dummy;
if (objc != 2) {
MathFuncWrongNumArgs(interp, 2, objc, objv);
@@ -7553,7 +7563,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. */
@@ -7562,6 +7572,7 @@ ExprFloorFunc(
int code;
double d;
mp_int big;
+ (void)dummy;
if (objc != 2) {
MathFuncWrongNumArgs(interp, 2, objc, objv);
@@ -7593,7 +7604,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. */
@@ -7605,6 +7616,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.
@@ -7699,7 +7711,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. */
@@ -7708,6 +7720,7 @@ ExprSqrtFunc(
int code;
double d;
mp_int big;
+ (void)dummy;
if (objc != 2) {
MathFuncWrongNumArgs(interp, 2, objc, objv);
@@ -7867,7 +7880,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. */
@@ -7876,6 +7889,7 @@ ExprAbsFunc(
ClientData ptr;
int type;
mp_int big;
+ (void)dummy;
if (objc != 2) {
MathFuncWrongNumArgs(interp, 2, objc, objv);
@@ -7966,13 +7980,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);
@@ -7987,13 +8002,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);
@@ -8014,7 +8030,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. */
@@ -8023,6 +8039,7 @@ ExprIntFunc(
double d;
int type;
ClientData ptr;
+ (void)dummy;
if (objc != 2) {
MathFuncWrongNumArgs(interp, 2, objc, objv);
@@ -8070,13 +8087,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;
@@ -8091,7 +8109,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. */
@@ -8102,6 +8120,7 @@ ExprMaxMinFunc(
double d;
int type, i;
ClientData ptr;
+ (void)dummy;
if (objc < 2) {
MathFuncWrongNumArgs(interp, 2, objc, objv);
@@ -8131,29 +8150,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. */
@@ -8164,6 +8185,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);
@@ -8246,7 +8268,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. */
@@ -8255,6 +8277,7 @@ ExprRoundFunc(
double d;
ClientData ptr;
int type;
+ (void)dummy;
if (objc != 2) {
MathFuncWrongNumArgs(interp, 2, objc, objv);
@@ -8325,7 +8348,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. */
@@ -8333,6 +8356,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.
@@ -8364,7 +8388,7 @@ ExprSrandFunc(
* will always succeed.
*/
- return ExprRandFunc(clientData, interp, 1, objv);
+ return ExprRandFunc(NULL, interp, 1, objv);
}
/*
@@ -8514,7 +8538,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 */
@@ -8523,6 +8547,7 @@ ExprIsFiniteFunc(
double d;
ClientData ptr;
int type, result = 0;
+ (void)dummy;
if (objc != 2) {
MathFuncWrongNumArgs(interp, 2, objc, objv);
@@ -8545,7 +8570,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 */
@@ -8554,6 +8579,7 @@ ExprIsInfinityFunc(
double d;
ClientData ptr;
int type, result = 0;
+ (void)dummy;
if (objc != 2) {
MathFuncWrongNumArgs(interp, 2, objc, objv);
@@ -8575,7 +8601,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 */
@@ -8584,6 +8610,7 @@ ExprIsNaNFunc(
double d;
ClientData ptr;
int type, result = 1;
+ (void)dummy;
if (objc != 2) {
MathFuncWrongNumArgs(interp, 2, objc, objv);
@@ -8605,7 +8632,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 */
@@ -8614,6 +8641,7 @@ ExprIsNormalFunc(
double d;
ClientData ptr;
int type, result = 0;
+ (void)dummy;
if (objc != 2) {
MathFuncWrongNumArgs(interp, 2, objc, objv);
@@ -8635,7 +8663,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 */
@@ -8644,6 +8672,7 @@ ExprIsSubnormalFunc(
double d;
ClientData ptr;
int type, result = 0;
+ (void)dummy;
if (objc != 2) {
MathFuncWrongNumArgs(interp, 2, objc, objv);
@@ -8665,7 +8694,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 */
@@ -8674,6 +8703,7 @@ ExprIsUnorderedFunc(
double d;
ClientData ptr;
int type, result = 0;
+ (void)dummy;
if (objc != 3) {
MathFuncWrongNumArgs(interp, 3, objc, objv);
@@ -8706,7 +8736,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 */
@@ -8716,6 +8746,7 @@ FloatClassifyObjCmd(
Tcl_Obj *objPtr;
ClientData ptr;
int type;
+ (void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "floatValue");
@@ -8820,6 +8851,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;
@@ -9199,12 +9233,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 ...?");
@@ -9269,7 +9304,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;
@@ -9304,10 +9339,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]);
@@ -9391,7 +9428,7 @@ TclNRYieldObjCmd(
int
TclNRYieldToObjCmd(
- ClientData clientData,
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
@@ -9399,6 +9436,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 ...?");
@@ -9447,7 +9485,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
@@ -9472,7 +9511,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);
@@ -9487,7 +9526,7 @@ NRCoroutineCallerCallback(
Tcl_Interp *interp,
int result)
{
- CoroutineData *corPtr = data[0];
+ CoroutineData *corPtr = (CoroutineData *)data[0];
Command *cmdPtr = corPtr->cmdPtr;
/*
@@ -9533,7 +9572,7 @@ NRCoroutineExitCallback(
Tcl_Interp *interp,
int result)
{
- CoroutineData *corPtr = data[0];
+ CoroutineData *corPtr = (CoroutineData *)data[0];
Command *cmdPtr = corPtr->cmdPtr;
/*
@@ -9598,10 +9637,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) {
/*
@@ -9679,7 +9719,8 @@ TclNREvalList(
{
int objc;
Tcl_Obj **objv;
- Tcl_Obj *listPtr = data[0];
+ Tcl_Obj *listPtr = (Tcl_Obj *)data[0];
+ (void)result;
Tcl_IncrRefCount(listPtr);
@@ -9701,13 +9742,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");
@@ -9732,7 +9774,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;
@@ -9786,18 +9828,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:
@@ -9836,7 +9879,7 @@ TclNRCoroInjectObjCmd(
static int
TclNRCoroProbeObjCmd(
- ClientData clientData,
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
@@ -9845,6 +9888,7 @@ TclNRCoroProbeObjCmd(
ExecEnv *savedEEPtr = iPtr->execEnvPtr;
int numLevels, unused;
int *stackLevel = &unused;
+ (void)dummy;
/*
* Usage more or less like tailcall:
@@ -9937,12 +9981,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) {
/*
@@ -9983,8 +10028,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;
@@ -10029,13 +10074,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:
@@ -10079,7 +10125,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(
@@ -10149,6 +10195,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 ...?");
@@ -10179,7 +10226,7 @@ TclNRCoroutineObjCmd(
* struct and create the corresponding command.
*/
- corPtr = ckalloc(sizeof(CoroutineData));
+ corPtr = (CoroutineData *)ckalloc(sizeof(CoroutineData));
cmdPtr = (Command *) TclNRCreateCommandInNs(interp, simpleName,
(Tcl_Namespace *)nsPtr, /*objProc*/ NULL, TclNRInterpCoroutine,
@@ -10201,7 +10248,7 @@ TclNRCoroutineObjCmd(
Tcl_HashSearch hSearch;
Tcl_HashEntry *hePtr;
- corPtr->lineLABCPtr = ckalloc(sizeof(Tcl_HashTable));
+ corPtr->lineLABCPtr = (Tcl_HashTable *)ckalloc(sizeof(Tcl_HashTable));
Tcl_InitHashTable(corPtr->lineLABCPtr, TCL_ONE_WORD_KEYS);
for (hePtr = Tcl_FirstHashEntry(iPtr->lineLABCPtr,&hSearch);
@@ -10271,12 +10318,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 eacac35..d269fbe 100644
--- a/generic/tclBinary.c
+++ b/generic/tclBinary.c
@@ -370,6 +370,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 */
}
@@ -411,7 +413,7 @@ Tcl_SetByteArrayObj(
if (length < 0) {
length = 0;
}
- byteArrayPtr = ckalloc(BYTEARRAY_SIZE(length));
+ byteArrayPtr = (ByteArray *)ckalloc(BYTEARRAY_SIZE(length));
byteArrayPtr->used = length;
byteArrayPtr->allocated = length;
@@ -520,7 +522,7 @@ Tcl_SetByteArrayLength(
byteArrayPtr = GET_BYTEARRAY(irPtr);
if (newLength > byteArrayPtr->allocated) {
- byteArrayPtr = ckrealloc(byteArrayPtr, BYTEARRAY_SIZE(newLength));
+ byteArrayPtr = (ByteArray *)ckrealloc(byteArrayPtr, BYTEARRAY_SIZE(newLength));
byteArrayPtr->allocated = newLength;
SET_BYTEARRAY(irPtr, byteArrayPtr);
}
@@ -547,7 +549,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;
@@ -557,6 +559,7 @@ SetByteArrayFromAny(
Tcl_UniChar ch = 0;
ByteArray *byteArrayPtr;
Tcl_ObjIntRep ir;
+ (void)dummy;
if (TclHasIntRep(objPtr, &properByteArrayType)) {
return TCL_OK;
@@ -569,7 +572,7 @@ SetByteArrayFromAny(
length = objPtr->length;
srcEnd = src + length;
- byteArrayPtr = ckalloc(BYTEARRAY_SIZE(length));
+ byteArrayPtr = (ByteArray *)ckalloc(BYTEARRAY_SIZE(length));
for (dst = byteArrayPtr->bytes; src < srcEnd; ) {
src += TclUtfToUniChar(src, &ch);
improper = improper || (ch > 255);
@@ -645,7 +648,7 @@ DupByteArrayInternalRep(
srcArrayPtr = GET_BYTEARRAY(TclFetchIntRep(srcPtr, &tclByteArrayType));
length = srcArrayPtr->used;
- copyArrayPtr = ckalloc(BYTEARRAY_SIZE(length));
+ copyArrayPtr = (ByteArray *)ckalloc(BYTEARRAY_SIZE(length));
copyArrayPtr->used = length;
copyArrayPtr->allocated = length;
memcpy(copyArrayPtr->bytes, srcArrayPtr->bytes, length);
@@ -666,7 +669,7 @@ DupProperByteArrayInternalRep(
srcArrayPtr = GET_BYTEARRAY(TclFetchIntRep(srcPtr, &properByteArrayType));
length = srcArrayPtr->used;
- copyArrayPtr = ckalloc(BYTEARRAY_SIZE(length));
+ copyArrayPtr = (ByteArray *)ckalloc(BYTEARRAY_SIZE(length));
copyArrayPtr->used = length;
copyArrayPtr->allocated = length;
memcpy(copyArrayPtr->bytes, srcArrayPtr->bytes, length);
@@ -809,7 +812,7 @@ TclAppendBytesToByteArray(
*/
attempt = 2 * needed;
- ptr = attemptckrealloc(byteArrayPtr, BYTEARRAY_SIZE(attempt));
+ ptr = (ByteArray *)attemptckrealloc(byteArrayPtr, BYTEARRAY_SIZE(attempt));
}
if (ptr == NULL) {
/*
@@ -821,7 +824,7 @@ TclAppendBytesToByteArray(
int growth = (int) ((extra > limit) ? limit : extra);
attempt = needed + growth;
- ptr = attemptckrealloc(byteArrayPtr, BYTEARRAY_SIZE(attempt));
+ ptr = (ByteArray *)attemptckrealloc(byteArrayPtr, BYTEARRAY_SIZE(attempt));
}
if (ptr == NULL) {
/*
@@ -829,7 +832,7 @@ TclAppendBytesToByteArray(
*/
attempt = needed;
- ptr = ckrealloc(byteArrayPtr, BYTEARRAY_SIZE(attempt));
+ ptr = (ByteArray *)ckrealloc(byteArrayPtr, BYTEARRAY_SIZE(attempt));
}
byteArrayPtr = ptr;
byteArrayPtr->allocated = attempt;
@@ -912,6 +915,7 @@ BinaryFormatCmd(
const char *errorString;
const char *errorValue, *str;
int offset, size, length;
+ (void)dummy;
if (objc < 2) {
Tcl_WrongNumArgs(interp, 1, objv, "formatString ?arg ...?");
@@ -1413,12 +1417,12 @@ BinaryScanCmd(
unsigned char *buffer; /* Start of result buffer. */
const char *errorString;
const char *str;
- int offset, size, length;
+ int offset, size, length, i;
- int i;
Tcl_Obj *valuePtr, *elementPtr;
Tcl_HashTable numberCacheHash;
Tcl_HashTable *numberCachePtr;
+ (void)dummy;
if (objc < 3) {
Tcl_WrongNumArgs(interp, 1, objv,
@@ -1946,8 +1950,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:
@@ -1970,8 +1974,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];
@@ -1984,8 +1988,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];
@@ -2294,7 +2298,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);
@@ -2417,7 +2421,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);
@@ -2463,7 +2467,7 @@ DeleteScanNumberCache(
static int
BinaryEncodeHex(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
@@ -2472,6 +2476,7 @@ BinaryEncodeHex(
unsigned char *data = NULL;
unsigned char *cursor = NULL;
int offset = 0, count = 0;
+ (void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "data");
@@ -2507,7 +2512,7 @@ BinaryEncodeHex(
static int
BinaryDecodeHex(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
@@ -2518,6 +2523,7 @@ BinaryDecodeHex(
int i, index, value, size, count = 0, cut = 0, strict = 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");
@@ -2626,7 +2632,7 @@ BinaryDecodeHex(
static int
BinaryEncode64(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
@@ -2639,6 +2645,7 @@ BinaryEncode64(
int offset, i, index, size, outindex = 0, 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,
@@ -2732,7 +2739,7 @@ BinaryEncode64(
static int
BinaryEncodeUu(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
@@ -2746,6 +2753,7 @@ BinaryEncodeUu(
int 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,
@@ -2849,7 +2857,7 @@ BinaryEncodeUu(
static int
BinaryDecodeUu(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
@@ -2861,6 +2869,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");
@@ -3012,7 +3021,7 @@ BinaryDecodeUu(
static int
BinaryDecode64(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
@@ -3025,6 +3034,7 @@ BinaryDecode64(
int i, index, size, cut = 0, 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/tclClock.c b/generic/tclClock.c
index 6e6bc65..0aa1527 100644
--- a/generic/tclClock.c
+++ b/generic/tclClock.c
@@ -109,7 +109,7 @@ typedef struct TclDateFields {
* 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 = ckalloc(sizeof(ClockClientData));
+ data = (ClockClientData *)ckalloc(sizeof(ClockClientData));
data->refCount = 0;
- data->literals = ckalloc(LIT__END * sizeof(Tcl_Obj*));
+ data->literals = (Tcl_Obj **)ckalloc(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)) {
ckfree(tzWas);
}
- tzWas = ckalloc(strlen(tzIsNow) + 1);
+ tzWas = (char *)ckalloc(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 c895817..f2db757 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;
@@ -173,6 +175,7 @@ Tcl_CaseObjCmd(
const char *stringPtr, *arg;
Tcl_Obj *const *caseObjv;
Tcl_Obj *armPtr;
+ (void)dummy;
if (objc < 3) {
Tcl_WrongNumArgs(interp, 1, objv,
@@ -317,6 +320,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,
@@ -349,8 +353,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;
/*
@@ -412,6 +416,7 @@ Tcl_CdObjCmd(
{
Tcl_Obj *dir;
int result;
+ (void)dummy;
if (objc > 2) {
Tcl_WrongNumArgs(interp, 1, objv, "?dirName?");
@@ -466,6 +471,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));
}
@@ -501,6 +508,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;
@@ -566,6 +575,7 @@ EncodingConvertfromObjCmd(
Tcl_Encoding encoding; /* Encoding to use */
int length; /* 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);
@@ -628,6 +638,7 @@ EncodingConverttoObjCmd(
Tcl_Encoding encoding; /* Encoding to use */
int 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 */
@@ -688,6 +699,7 @@ EncodingDirsObjCmd(
Tcl_Obj *const objv[]) /* Argument objects. */
{
Tcl_Obj *dirListObj;
+ (void)dummy;
if (objc > 2) {
Tcl_WrongNumArgs(interp, 1, objv, "?dirList?");
@@ -725,11 +737,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;
@@ -755,11 +770,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;
@@ -799,6 +817,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?");
@@ -843,10 +862,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)));
@@ -875,6 +896,7 @@ TclNREvalObjCmd(
Interp *iPtr = (Interp *) interp;
CmdFrame *invoker = NULL;
int word = 0;
+ (void)dummy;
if (objc < 2) {
Tcl_WrongNumArgs(interp, 1, objv, "arg ?arg ...?");
@@ -932,6 +954,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?");
@@ -991,6 +1014,7 @@ TclNRExprObjCmd(
Tcl_Obj *const objv[]) /* Argument objects. */
{
Tcl_Obj *resultPtr, *objPtr;
+ (void)dummy;
if (objc < 2) {
Tcl_WrongNumArgs(interp, 1, objv, "arg ?arg ...?");
@@ -1016,8 +1040,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);
@@ -1121,13 +1145,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?");
@@ -1203,13 +1228,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?");
@@ -1282,12 +1308,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");
@@ -1318,12 +1345,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");
@@ -1354,12 +1382,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");
@@ -1392,12 +1421,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");
@@ -1429,13 +1459,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");
@@ -1467,11 +1498,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;
@@ -1498,11 +1531,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;
@@ -1529,13 +1564,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");
@@ -1567,7 +1603,7 @@ FileAttrIsFileCmd(
static int
FileAttrIsOwnedCmd(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
@@ -1579,6 +1615,7 @@ FileAttrIsOwnedCmd(
Tcl_StatBuf buf;
#endif
int value = 0;
+ (void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "name");
@@ -1614,11 +1651,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;
@@ -1645,11 +1684,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;
@@ -1676,12 +1717,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");
@@ -1715,12 +1757,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");
@@ -1754,12 +1797,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");
@@ -1793,12 +1837,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");
@@ -1832,12 +1877,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");
@@ -1873,11 +1919,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;
@@ -1905,12 +1953,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");
@@ -1942,12 +1991,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");
@@ -1980,12 +2030,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");
@@ -2023,12 +2074,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");
@@ -2071,11 +2123,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;
@@ -2126,11 +2180,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;
@@ -2404,6 +2460,7 @@ TclNRForObjCmd(
{
Interp *iPtr = (Interp *) interp;
ForIterData *iterPtr;
+ (void)dummy;
if (objc != 5) {
Tcl_WrongNumArgs(interp, 1, objv, "start test next command");
@@ -2432,7 +2489,7 @@ ForSetupCallback(
Tcl_Interp *interp,
int result)
{
- ForIterData *iterPtr = data[0];
+ ForIterData *iterPtr = (ForIterData *)data[0];
if (result != TCL_OK) {
if (result == TCL_ERROR) {
@@ -2451,7 +2508,7 @@ TclNRForIterCallback(
Tcl_Interp *interp,
int result)
{
- ForIterData *iterPtr = data[0];
+ ForIterData *iterPtr = (ForIterData *)data[0];
Tcl_Obj *boolObj;
switch (result) {
@@ -2487,8 +2544,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) {
@@ -2525,7 +2582,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)) {
@@ -2549,7 +2606,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) {
@@ -2597,6 +2654,8 @@ TclNRForeachCmd(
int objc,
Tcl_Obj *const objv[])
{
+ (void)dummy;
+
return EachloopCmd(interp, TCL_EACH_KEEP_NONE, objc, objv);
}
@@ -2617,6 +2676,7 @@ TclNRLmapCmd(
int objc,
Tcl_Obj *const objv[])
{
+ (void)dummy;
return EachloopCmd(interp, TCL_EACH_COLLECT, objc, objv);
}
@@ -2654,7 +2714,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,
@@ -2755,7 +2815,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
@@ -2906,6 +2966,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 f027cec..07b41ac 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;
int 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;
int 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;
int 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");
@@ -2202,6 +2229,7 @@ Tcl_JoinObjCmd(
{
int length, listLen;
Tcl_Obj *resObjPtr = NULL, *joinObjPtr, **elemPtrs;
+ (void)dummy;
if ((objc < 2) || (objc > 3)) {
Tcl_WrongNumArgs(interp, 1, objv, "list ?joinString?");
@@ -2289,6 +2317,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 ...?");
@@ -2359,8 +2388,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 ...?");
@@ -2420,6 +2449,7 @@ Tcl_LinsertObjCmd(
{
Tcl_Obj *listPtr;
int index, len, result;
+ (void)dummy;
if (objc < 3) {
Tcl_WrongNumArgs(interp, 1, objv, "list index ?element ...?");
@@ -2501,6 +2531,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.
@@ -2538,6 +2569,7 @@ Tcl_LlengthObjCmd(
/* Argument objects. */
{
int listLen, result;
+ (void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "list");
@@ -2577,7 +2609,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[])
@@ -2586,6 +2618,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?");
@@ -2670,13 +2703,14 @@ 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[])
/* Argument objects. */
{
int listLen, first, last, result;
+ (void)dummy;
if (objc != 4) {
Tcl_WrongNumArgs(interp, 1, objv, "list first last");
@@ -2738,7 +2772,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. */
@@ -2746,6 +2780,7 @@ Tcl_LremoveObjCmd(
int i, idxc;
int listLen, *idxv, prevIdx, first, num;
Tcl_Obj *listObj;
+ (void)dummy;
/*
* Parse the arguments.
@@ -2766,7 +2801,7 @@ Tcl_LremoveObjCmd(
Tcl_SetObjResult(interp, listObj);
return TCL_OK;
}
- idxv = ckalloc((objc - 2) * sizeof(int));
+ idxv = (int *)ckalloc((objc - 2) * sizeof(int));
for (i = 2; i < objc; i++) {
if (TclGetIntForIndexM(interp, objv[i], /*endValue*/ listLen - 1,
&idxv[i - 2]) != TCL_OK) {
@@ -2865,6 +2900,7 @@ Tcl_LrepeatObjCmd(
{
int elementCount, i, totalElems;
Tcl_Obj *listPtr, **dataArray = NULL;
+ (void)dummy;
/*
* Check arguments for legality:
@@ -2973,6 +3009,7 @@ Tcl_LreplaceObjCmd(
{
Tcl_Obj *listPtr;
int first, last, listLen, numToDelete, result;
+ (void)dummy;
if (objc < 4) {
Tcl_WrongNumArgs(interp, 1, objv,
@@ -3067,13 +3104,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");
@@ -3146,7 +3184,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. */
@@ -3183,6 +3221,7 @@ Tcl_LsearchObjCmd(
EXACT, GLOB, REGEXP, SORTED
};
enum modes mode;
+ (void)dummy;
mode = GLOB;
dataType = ASCII;
@@ -3362,7 +3401,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. */
@@ -3898,13 +3937,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.
@@ -3983,7 +4023,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. */
@@ -4013,6 +4053,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");
@@ -4181,7 +4222,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. */
@@ -4321,9 +4362,9 @@ Tcl_LsortObjCmd(
elmArrSize = length * sizeof(SortElement);
if (elmArrSize <= MAXCALLOC) {
- elementArray = ckalloc(elmArrSize);
+ elementArray = (SortElement *)ckalloc(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 b5d5c89..136eecb 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;
@@ -504,6 +506,7 @@ Tcl_RegsubObjCmd(
REGSUB_LINESTOP, REGSUB_LINEANCHOR, REGSUB_NOCASE, REGSUB_START,
REGSUB_LAST
};
+ (void)dummy;
cflags = TCL_REG_ADVANCED;
all = 0;
@@ -778,7 +781,7 @@ Tcl_RegsubObjCmd(
Tcl_ListObjGetElements(interp, subPtr, &numParts, &parts);
numArgs = numParts + info.nsubs + 1;
- args = ckalloc(sizeof(Tcl_Obj*) * numArgs);
+ args = (Tcl_Obj **)ckalloc(sizeof(Tcl_Obj*) * numArgs);
memcpy(args, parts, sizeof(Tcl_Obj*) * numParts);
for (idx = 0 ; idx <= info.nsubs ; idx++) {
@@ -1002,12 +1005,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");
@@ -1053,6 +1057,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)) {
@@ -1105,6 +1110,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");
@@ -1136,7 +1142,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;
@@ -1181,6 +1187,7 @@ Tcl_SplitObjCmd(
const char *end;
int splitCharLen, stringLen;
Tcl_Obj *listPtr, *objPtr;
+ (void)dummy;
if (objc == 2) {
splitChars = " \n\t\r";
@@ -1243,14 +1250,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
@@ -1323,6 +1330,7 @@ StringFirstCmd(
Tcl_Obj *const objv[]) /* Argument objects. */
{
int start = 0;
+ (void)dummy;
if (objc < 3 || objc > 4) {
Tcl_WrongNumArgs(interp, 1, objv,
@@ -1368,6 +1376,7 @@ StringLastCmd(
Tcl_Obj *const objv[]) /* Argument objects. */
{
int last = INT_MAX - 1;
+ (void)dummy;
if (objc < 3 || objc > 4) {
Tcl_WrongNumArgs(interp, 1, objv,
@@ -1413,6 +1422,7 @@ StringIndexCmd(
Tcl_Obj *const objv[]) /* Argument objects. */
{
int length, index;
+ (void)dummy;
if (objc != 3) {
Tcl_WrongNumArgs(interp, 1, objv, "string charIndex");
@@ -1485,6 +1495,7 @@ StringInsertCmd(
int length; /* String length */
int index; /* Insert index */
Tcl_Obj *outObj; /* Output object */
+ (void)dummy;
if (objc != 4) {
Tcl_WrongNumArgs(interp, 1, objv, "string index insertString");
@@ -1568,6 +1579,7 @@ StringIsCmd(
enum isOptions {
OPT_STRICT, OPT_FAILIDX
};
+ (void)dummy;
if (objc < 3 || objc > 6) {
Tcl_WrongNumArgs(interp, 1, objv,
@@ -1983,6 +1995,7 @@ StringMapCmd(
Tcl_Obj **mapElemv, *sourceObj, *resultPtr;
Tcl_UniChar *ustring1, *ustring2, *p, *end;
int (*strCmpFn)(const Tcl_UniChar*, const Tcl_UniChar*, unsigned long);
+ (void)dummy;
if (objc < 3 || objc > 4) {
Tcl_WrongNumArgs(interp, 1, objv, "?-nocase? charMap string");
@@ -2037,7 +2050,7 @@ StringMapCmd(
* adapt this code...
*/
- mapElemv = TclStackAlloc(interp, sizeof(Tcl_Obj *) * mapElemc);
+ mapElemv = (Tcl_Obj **)TclStackAlloc(interp, sizeof(Tcl_Obj *) * mapElemc);
Tcl_DictObjFirst(interp, objv[objc-2], &search, mapElemv+0,
mapElemv+1, &done);
for (i=2 ; i<mapElemc ; i+=2) {
@@ -2148,10 +2161,10 @@ StringMapCmd(
* case.
*/
- mapStrings = TclStackAlloc(interp, mapElemc*2*sizeof(Tcl_UniChar *));
- mapLens = TclStackAlloc(interp, mapElemc * 2 * sizeof(int));
+ mapStrings = (Tcl_UniChar **)TclStackAlloc(interp, mapElemc*2*sizeof(Tcl_UniChar *));
+ mapLens = (int *)TclStackAlloc(interp, mapElemc * 2 * sizeof(int));
if (nocase) {
- u2lc = TclStackAlloc(interp, mapElemc * sizeof(int));
+ u2lc = (int *)TclStackAlloc(interp, mapElemc * sizeof(int));
}
for (index = 0; index < mapElemc; index++) {
mapStrings[index] = Tcl_GetUnicodeFromObj(mapElemv[index],
@@ -2250,6 +2263,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");
@@ -2302,6 +2316,7 @@ StringRangeCmd(
Tcl_Obj *const objv[]) /* Argument objects. */
{
int length, first, last;
+ (void)dummy;
if (objc != 4) {
Tcl_WrongNumArgs(interp, 1, objv, "string first last");
@@ -2359,6 +2374,7 @@ StringReptCmd(
{
int count;
Tcl_Obj *resultPtr;
+ (void)dummy;
if (objc != 3) {
Tcl_WrongNumArgs(interp, 1, objv, "string count");
@@ -2414,6 +2430,7 @@ StringRplcCmd(
Tcl_Obj *const objv[]) /* Argument objects. */
{
int first, last, length, end;
+ (void)dummy;
if (objc < 4 || objc > 5) {
Tcl_WrongNumArgs(interp, 1, objv, "string first last ?string?");
@@ -2489,6 +2506,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;
@@ -2527,6 +2546,7 @@ StringStartCmd(
Tcl_UniChar ch = 0;
const char *p, *string;
int cur, index, length, numChars;
+ (void)dummy;
if (objc != 3) {
Tcl_WrongNumArgs(interp, 1, objv, "string index");
@@ -2588,6 +2608,7 @@ StringEndCmd(
Tcl_UniChar ch = 0;
const char *p, *end, *string;
int cur, index, length, numChars;
+ (void)dummy;
if (objc != 3) {
Tcl_WrongNumArgs(interp, 1, objv, "string index");
@@ -2655,6 +2676,7 @@ StringEqualCmd(
const char *string2;
int length, i, match, nocase = 0, reqlength = -1;
+ (void)dummy;
if (objc < 3 || objc > 6) {
str_cmp_args:
@@ -2729,6 +2751,7 @@ StringCmpCmd(
*/
int match, nocase, reqlength, status;
+ (void)dummy;
status = TclStringCmpOpts(interp, objc, objv, &nocase, &reqlength);
if (status != TCL_OK) {
@@ -2811,6 +2834,7 @@ StringCatCmd(
Tcl_Obj *const objv[]) /* Argument objects. */
{
Tcl_Obj *objResultPtr;
+ (void)dummy;
if (objc < 2) {
/*
@@ -2856,6 +2880,7 @@ StringBytesCmd(
Tcl_Obj *const objv[]) /* Argument objects. */
{
int length;
+ (void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "string");
@@ -2892,6 +2917,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;
@@ -2929,6 +2956,7 @@ StringLowerCmd(
int length1, length2;
const char *string1;
char *string2;
+ (void)dummy;
if (objc < 2 || objc > 4) {
Tcl_WrongNumArgs(interp, 1, objv, "string ?first? ?last?");
@@ -3014,6 +3042,7 @@ StringUpperCmd(
int length1, length2;
const char *string1;
char *string2;
+ (void)dummy;
if (objc < 2 || objc > 4) {
Tcl_WrongNumArgs(interp, 1, objv, "string ?first? ?last?");
@@ -3099,6 +3128,7 @@ StringTitleCmd(
int length1, length2;
const char *string1;
char *string2;
+ (void)dummy;
if (objc < 2 || objc > 4) {
Tcl_WrongNumArgs(interp, 1, objv, "string ?first? ?last?");
@@ -3183,6 +3213,7 @@ StringTrimCmd(
{
const char *string1, *string2;
int triml, trimr, length1, length2;
+ (void)dummy;
if (objc == 3) {
string2 = TclGetStringFromObj(objv[2], &length2);
@@ -3230,6 +3261,7 @@ StringTrimLCmd(
{
const char *string1, *string2;
int trim, length1, length2;
+ (void)dummy;
if (objc == 3) {
string2 = TclGetStringFromObj(objv[2], &length2);
@@ -3276,6 +3308,7 @@ StringTrimRCmd(
{
const char *string1, *string2;
int trim, length1, length2;
+ (void)dummy;
if (objc == 3) {
string2 = TclGetStringFromObj(objv[2], &length2);
@@ -3428,6 +3461,7 @@ TclNRSubstObjCmd(
Tcl_Obj *const objv[]) /* Argument objects. */
{
int flags;
+ (void)dummy;
if (objc < 2) {
Tcl_WrongNumArgs(interp, 1, objv,
@@ -3502,6 +3536,7 @@ TclNRSwitchObjCmd(
};
typedef int (*strCmpFn_t)(const char *, const char *);
strCmpFn_t strCmpFn = TclUtfCmp;
+ (void)dummy;
mode = OPT_EXACT;
foundmode = 0;
@@ -3852,7 +3887,7 @@ TclNRSwitchObjCmd(
*/
matchFound:
- ctxPtr = TclStackAlloc(interp, sizeof(CmdFrame));
+ ctxPtr = (CmdFrame *)TclStackAlloc(interp, sizeof(CmdFrame));
*ctxPtr = *iPtr->cmdFramePtr;
if (splitObjs) {
@@ -3882,7 +3917,7 @@ TclNRSwitchObjCmd(
if (ctxPtr->type == TCL_LOCATION_SOURCE && ctxPtr->line[bidx] >= 0) {
int bline = ctxPtr->line[bidx];
- ctxPtr->line = ckalloc(objc * sizeof(int));
+ ctxPtr->line = (int *)ckalloc(objc * sizeof(int));
ctxPtr->nline = objc;
TclListLines(blist, bline, objc, ctxPtr->line, objv);
} else {
@@ -3896,7 +3931,7 @@ TclNRSwitchObjCmd(
int k;
- ctxPtr->line = ckalloc(objc * sizeof(int));
+ ctxPtr->line = (int *)ckalloc(objc * sizeof(int));
ctxPtr->nline = objc;
for (k=0; k < objc; k++) {
ctxPtr->line[k] = -1;
@@ -3936,9 +3971,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];
int patternLength = strlen(pattern);
/*
@@ -4000,6 +4035,7 @@ Tcl_ThrowObjCmd(
{
Tcl_Obj *options;
int len;
+ (void)dummy;
if (objc != 3) {
Tcl_WrongNumArgs(interp, 1, objv, "type message");
@@ -4070,6 +4106,7 @@ Tcl_TimeObjCmd(
#else
Tcl_WideInt start, stop;
#endif
+ (void)dummy;
if (objc == 2) {
count = 1;
@@ -4188,6 +4225,7 @@ Tcl_TimeRateObjCmd(
};
NRE_callback *rootPtr;
ByteCode *codePtr = NULL;
+ (void)dummy;
for (i = 1; i < objc - 1; i++) {
int index;
@@ -4719,6 +4757,7 @@ TclNRTryObjCmd(
enum Handlers {
TryFinally, TryOn, TryTrap
};
+ (void)clientData;
/*
* Parse the arguments. The handlers are passed to subsequent callbacks as
@@ -4912,9 +4951,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];
@@ -5127,9 +5166,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];
@@ -5211,9 +5250,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.
@@ -5288,6 +5327,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 8c6050d..35501d2 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 = ckalloc(sizeof(ForeachInfo));
+ infoPtr = (ForeachInfo *)ckalloc(sizeof(ForeachInfo));
infoPtr->numLists = 1;
- infoPtr->varLists[0] = ckalloc(sizeof(ForeachVarList) + sizeof(int));
+ infoPtr->varLists[0] = (ForeachVarList *)ckalloc(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) {
@@ -952,7 +961,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
@@ -961,6 +970,8 @@ TclCompileContinueCmd(
{
ExceptionRange *rangePtr;
ExceptionAux *auxPtr;
+ (void)dummy;
+ (void)cmdPtr;
/*
* There should be no argument after the "continue".
@@ -1026,6 +1037,7 @@ TclCompileDictSetCmd(
int i, dictVarIndex;
DefineLineInformation; /* TIP #280 */
Tcl_Token *varTokenPtr;
+ (void)cmdPtr;
/*
* There must be at least one argument after the command.
@@ -1151,6 +1163,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
@@ -1188,6 +1201,7 @@ TclCompileDictGetWithDefaultCmd(
Tcl_Token *tokenPtr;
int i;
DefineLineInformation; /* TIP #280 */
+ (void)cmdPtr;
/*
* There must be at least three arguments after the command.
@@ -1220,6 +1234,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
@@ -1811,9 +1826,9 @@ TclCompileDictUpdateCmd(
* that are to be used.
*/
- duiPtr = ckalloc(sizeof(DictUpdateInfo) + sizeof(int) * (numVars - 1));
+ duiPtr = (DictUpdateInfo *)ckalloc(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++) {
@@ -2290,11 +2305,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 = ckalloc(len);
+ dui2Ptr = (DictUpdateInfo *)ckalloc(len);
memcpy(dui2Ptr, dui1Ptr, len);
return dui2Ptr;
}
@@ -2313,8 +2328,10 @@ PrintDictUpdateInfo(
ByteCode *codePtr,
unsigned int pcOffset)
{
- DictUpdateInfo *duiPtr = clientData;
+ DictUpdateInfo *duiPtr = (DictUpdateInfo *)clientData;
int i;
+ (void)codePtr;
+ (void)pcOffset;
for (i=0 ; i<duiPtr->length ; i++) {
if (i) {
@@ -2331,9 +2348,11 @@ DisassembleDictUpdateInfo(
ByteCode *codePtr,
unsigned int pcOffset)
{
- DictUpdateInfo *duiPtr = clientData;
+ DictUpdateInfo *duiPtr = (DictUpdateInfo *)clientData;
int i;
Tcl_Obj *variables = Tcl_NewObj();
+ (void)codePtr;
+ (void)pcOffset;
for (i=0 ; i<duiPtr->length ; i++) {
Tcl_ListObjAppendElement(NULL, variables,
@@ -2376,6 +2395,7 @@ TclCompileErrorCmd(
Tcl_Token *tokenPtr;
DefineLineInformation; /* TIP #280 */
+ (void)cmdPtr;
if (parsePtr->numWords < 2 || parsePtr->numWords > 4) {
return TCL_ERROR;
@@ -2445,6 +2465,7 @@ TclCompileExprCmd(
CompileEnv *envPtr) /* Holds resulting instructions. */
{
Tcl_Token *firstWordPtr;
+ (void)cmdPtr;
if (parsePtr->numWords == 1) {
return TCL_ERROR;
@@ -2494,6 +2515,7 @@ TclCompileForCmd(
int bodyCodeOffset, nextCodeOffset, jumpDist;
int bodyRange, nextRange;
DefineLineInformation; /* TIP #280 */
+ (void)cmdPtr;
if (parsePtr->numWords != 5) {
return TCL_ERROR;
@@ -2712,6 +2734,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:
@@ -2747,7 +2770,7 @@ CompileEachloopCmd(
*/
numLists = (numWords - 2)/2;
- infoPtr = ckalloc(sizeof(ForeachInfo)
+ infoPtr = (ForeachInfo *)ckalloc(sizeof(ForeachInfo)
+ (numLists - 1) * sizeof(ForeachVarList *));
infoPtr->numLists = 0; /* Count this up as we go */
@@ -2781,7 +2804,7 @@ CompileEachloopCmd(
goto done;
}
- varListPtr = ckalloc(sizeof(ForeachVarList)
+ varListPtr = (ForeachVarList *)ckalloc(sizeof(ForeachVarList)
+ (numVars - 1) * sizeof(int));
varListPtr->numVars = numVars;
infoPtr->varLists[i/2] = varListPtr;
@@ -2912,12 +2935,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 = ckalloc(sizeof(ForeachInfo)
+ dupPtr = (ForeachInfo *)ckalloc(sizeof(ForeachInfo)
+ numLists * sizeof(ForeachVarList *));
dupPtr->numLists = numLists;
dupPtr->firstValueTemp = srcPtr->firstValueTemp;
@@ -2926,7 +2949,7 @@ DupForeachInfo(
for (i = 0; i < numLists; i++) {
srcListPtr = srcPtr->varLists[i];
numVars = srcListPtr->numVars;
- dupListPtr = ckalloc(sizeof(ForeachVarList)
+ dupListPtr = (ForeachVarList *)ckalloc(sizeof(ForeachVarList)
+ numVars * sizeof(int));
dupListPtr->numVars = numVars;
for (j = 0; j < numVars; j++) {
@@ -2961,7 +2984,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;
@@ -2997,9 +3020,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);
@@ -3037,9 +3062,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);
@@ -3067,10 +3094,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.
@@ -3114,10 +3143,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.
@@ -3176,6 +3207,7 @@ TclCompileFormatCmd(
Tcl_Obj **objv, *formatObj, *tmpObj;
const char *bytes, *start;
int i, j, len;
+ (void)cmdPtr;
/*
* Don't handle any guaranteed-error cases.
@@ -3198,7 +3230,7 @@ TclCompileFormatCmd(
return TCL_ERROR;
}
- objv = ckalloc((parsePtr->numWords-2) * sizeof(Tcl_Obj *));
+ objv = (Tcl_Obj **)ckalloc((parsePtr->numWords-2) * sizeof(Tcl_Obj *));
for (i=0 ; i+2 < parsePtr->numWords ; i++) {
tokenPtr = TokenAfter(tokenPtr);
objv[i] = Tcl_NewObj();
@@ -3492,7 +3524,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;
@@ -3547,7 +3579,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 3c8a156..513aa7d 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;
@@ -188,6 +189,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
@@ -478,6 +480,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;
@@ -640,13 +643,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.
*/
@@ -675,6 +680,7 @@ TclCompileInfoExistsCmd(
Tcl_Token *tokenPtr;
int isScalar, localIndex;
DefineLineInformation; /* TIP #280 */
+ (void)cmdPtr;
if (parsePtr->numWords != 2) {
return TCL_ERROR;
@@ -721,6 +727,7 @@ TclCompileInfoLevelCmd(
* compiled. */
CompileEnv *envPtr) /* Holds resulting instructions. */
{
+ (void)cmdPtr;
/*
* Only compile [info level] without arguments or with a single argument.
*/
@@ -758,6 +765,7 @@ TclCompileInfoObjectClassCmd(
{
DefineLineInformation; /* TIP #280 */
Tcl_Token *tokenPtr = TokenAfter(parsePtr->tokenPtr);
+ (void)cmdPtr;
if (parsePtr->numWords != 2) {
return TCL_ERROR;
@@ -778,6 +786,7 @@ TclCompileInfoObjectIsACmd(
{
DefineLineInformation; /* TIP #280 */
Tcl_Token *tokenPtr = TokenAfter(parsePtr->tokenPtr);
+ (void)cmdPtr;
/*
* We only handle [info object isa object <somevalue>]. The first three
@@ -814,6 +823,7 @@ TclCompileInfoObjectNamespaceCmd(
{
DefineLineInformation; /* TIP #280 */
Tcl_Token *tokenPtr = TokenAfter(parsePtr->tokenPtr);
+ (void)cmdPtr;
if (parsePtr->numWords != 2) {
return TCL_ERROR;
@@ -853,6 +863,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;
@@ -969,6 +980,7 @@ TclCompileLassignCmd(
Tcl_Token *tokenPtr;
int isScalar, localIndex, numWords, idx;
DefineLineInformation; /* TIP #280 */
+ (void)cmdPtr;
numWords = parsePtr->numWords;
@@ -1073,6 +1085,7 @@ TclCompileLindexCmd(
Tcl_Token *idxTokenPtr, *valTokenPtr;
int i, idx, numWords = parsePtr->numWords;
DefineLineInformation; /* TIP #280 */
+ (void)cmdPtr;
/*
* Quit if too few args.
@@ -1165,6 +1178,7 @@ TclCompileListCmd(
Tcl_Token *valueTokenPtr;
int i, numWords, concat, build;
Tcl_Obj *listObj, *objPtr;
+ (void)cmdPtr;
if (parsePtr->numWords == 1) {
/*
@@ -1277,6 +1291,7 @@ TclCompileLlengthCmd(
{
Tcl_Token *varTokenPtr;
DefineLineInformation; /* TIP #280 */
+ (void)cmdPtr;
if (parsePtr->numWords != 2) {
return TCL_ERROR;
@@ -1311,6 +1326,7 @@ TclCompileLrangeCmd(
Tcl_Token *tokenPtr, *listTokenPtr;
DefineLineInformation; /* TIP #280 */
int idx1, idx2;
+ (void)cmdPtr;
if (parsePtr->numWords != 4) {
return TCL_ERROR;
@@ -1372,6 +1388,7 @@ TclCompileLinsertCmd(
Tcl_Token *tokenPtr, *listTokenPtr;
DefineLineInformation; /* TIP #280 */
int idx, i;
+ (void)cmdPtr;
if (parsePtr->numWords < 3) {
return TCL_ERROR;
@@ -1476,6 +1493,7 @@ TclCompileLreplaceCmd(
DefineLineInformation; /* TIP #280 */
int idx1, idx2, i;
int emptyPrefix=1, suffixStart = 0;
+ (void)cmdPtr;
if (parsePtr->numWords < 4) {
return TCL_ERROR;
@@ -1644,6 +1662,7 @@ TclCompileLsetCmd(
int isScalar; /* Flag == 1 if scalar, 0 if array. */
int i;
DefineLineInformation; /* TIP #280 */
+ (void)cmdPtr;
/*
* Check argument count.
@@ -1776,13 +1795,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.
*/
@@ -1810,6 +1831,7 @@ TclCompileNamespaceCodeCmd(
{
Tcl_Token *tokenPtr;
DefineLineInformation; /* TIP #280 */
+ (void)cmdPtr;
if (parsePtr->numWords != 2) {
return TCL_ERROR;
@@ -1860,6 +1882,7 @@ TclCompileNamespaceOriginCmd(
{
Tcl_Token *tokenPtr;
DefineLineInformation; /* TIP #280 */
+ (void)cmdPtr;
if (parsePtr->numWords != 2) {
return TCL_ERROR;
@@ -1883,6 +1906,7 @@ TclCompileNamespaceQualifiersCmd(
Tcl_Token *tokenPtr = TokenAfter(parsePtr->tokenPtr);
DefineLineInformation; /* TIP #280 */
int off;
+ (void)cmdPtr;
if (parsePtr->numWords != 2) {
return TCL_ERROR;
@@ -1919,6 +1943,7 @@ TclCompileNamespaceTailCmd(
Tcl_Token *tokenPtr = TokenAfter(parsePtr->tokenPtr);
DefineLineInformation; /* TIP #280 */
JumpFixup jumpFixup;
+ (void)cmdPtr;
if (parsePtr->numWords != 2) {
return TCL_ERROR;
@@ -1956,6 +1981,7 @@ TclCompileNamespaceUpvarCmd(
Tcl_Token *tokenPtr, *otherTokenPtr, *localTokenPtr;
int localIndex, numWords, i;
DefineLineInformation; /* TIP #280 */
+ (void)cmdPtr;
if (envPtr->procPtr == NULL) {
return TCL_ERROR;
@@ -2017,6 +2043,7 @@ TclCompileNamespaceWhichCmd(
DefineLineInformation; /* TIP #280 */
Tcl_Token *tokenPtr, *opt;
int idx;
+ (void)cmdPtr;
if (parsePtr->numWords < 2 || parsePtr->numWords > 3) {
return TCL_ERROR;
@@ -2083,6 +2110,7 @@ TclCompileRegexpCmd(
int i, len, nocase, exact, sawLast, simple;
const char *str;
DefineLineInformation; /* TIP #280 */
+ (void)cmdPtr;
/*
* We are only interested in compiling simple regexp cases. Currently
@@ -2269,6 +2297,7 @@ TclCompileRegsubCmd(
Tcl_DString pattern;
const char *bytes;
int len, exact, quantified, result = TCL_ERROR;
+ (void)cmdPtr;
if (parsePtr->numWords < 5 || parsePtr->numWords > 6) {
return TCL_ERROR;
@@ -2429,6 +2458,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:
@@ -2455,7 +2485,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,
@@ -2674,6 +2704,7 @@ TclCompileUpvarCmd(
int localIndex, numWords, i;
DefineLineInformation; /* TIP #280 */
Tcl_Obj *objPtr;
+ (void)cmdPtr;
if (envPtr->procPtr == NULL) {
return TCL_ERROR;
@@ -2780,6 +2811,7 @@ TclCompileVariableCmd(
Tcl_Token *varTokenPtr, *valueTokenPtr;
int localIndex, numWords, i;
DefineLineInformation; /* TIP #280 */
+ (void)cmdPtr;
numWords = parsePtr->numWords;
if (numWords < 2) {
@@ -2855,7 +2887,7 @@ TclCompileVariableCmd(
static int
IndexTailVarIfKnown(
- Tcl_Interp *interp,
+ Tcl_Interp *dummy,
Tcl_Token *varTokenPtr, /* Token representing the variable name */
CompileEnv *envPtr) /* Holds resulting instructions. */
{
@@ -2864,6 +2896,7 @@ IndexTailVarIfKnown(
int len, n = varTokenPtr->numComponents;
Tcl_Token *lastTokenPtr;
int full, localIndex;
+ (void)dummy;
/*
* Determine if the tail is (a) known at compile time, and (b) not an
@@ -2954,6 +2987,7 @@ TclCompileObjectNextCmd(
DefineLineInformation; /* TIP #280 */
Tcl_Token *tokenPtr = parsePtr->tokenPtr;
int i;
+ (void)cmdPtr;
if (parsePtr->numWords > 255) {
return TCL_ERROR;
@@ -2979,6 +3013,7 @@ TclCompileObjectNextToCmd(
DefineLineInformation; /* TIP #280 */
Tcl_Token *tokenPtr = parsePtr->tokenPtr;
int i;
+ (void)cmdPtr;
if (parsePtr->numWords < 2 || parsePtr->numWords > 255) {
return TCL_ERROR;
@@ -2994,13 +3029,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 f665e0a..ac8ca48 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;
@@ -886,6 +893,7 @@ TclCompileStringLenCmd(
DefineLineInformation; /* TIP #280 */
Tcl_Token *tokenPtr;
Tcl_Obj *objPtr;
+ (void)cmdPtr;
if (parsePtr->numWords != 2) {
return TCL_ERROR;
@@ -989,6 +997,7 @@ TclCompileStringRangeCmd(
DefineLineInformation; /* TIP #280 */
Tcl_Token *stringTokenPtr, *fromTokenPtr, *toTokenPtr;
int idx1, idx2;
+ (void)cmdPtr;
if (parsePtr->numWords != 4) {
return TCL_ERROR;
@@ -1065,6 +1074,7 @@ TclCompileStringReplaceCmd(
Tcl_Token *tokenPtr, *valueTokenPtr;
DefineLineInformation; /* TIP #280 */
int first, last;
+ (void)cmdPtr;
if (parsePtr->numWords < 4 || parsePtr->numWords > 5) {
return TCL_ERROR;
@@ -1263,6 +1273,7 @@ TclCompileStringTrimLCmd(
{
DefineLineInformation; /* TIP #280 */
Tcl_Token *tokenPtr;
+ (void)cmdPtr;
if (parsePtr->numWords != 2 && parsePtr->numWords != 3) {
return TCL_ERROR;
@@ -1291,6 +1302,7 @@ TclCompileStringTrimRCmd(
{
DefineLineInformation; /* TIP #280 */
Tcl_Token *tokenPtr;
+ (void)cmdPtr;
if (parsePtr->numWords != 2 && parsePtr->numWords != 3) {
return TCL_ERROR;
@@ -1319,6 +1331,7 @@ TclCompileStringTrimCmd(
{
DefineLineInformation; /* TIP #280 */
Tcl_Token *tokenPtr;
+ (void)cmdPtr;
if (parsePtr->numWords != 2 && parsePtr->numWords != 3) {
return TCL_ERROR;
@@ -1473,12 +1486,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();
@@ -1817,6 +1831,7 @@ TclCompileSwitchCmd(
int result = TCL_ERROR;
DefineLineInformation; /* TIP #280 */
int *clNext = envPtr->clNext;
+ (void)cmdPtr;
/*
* Only handle the following versions:
@@ -1971,10 +1986,10 @@ TclCompileSwitchCmd(
if (maxLen < 2) {
return TCL_ERROR;
}
- bodyTokenArray = ckalloc(sizeof(Tcl_Token) * maxLen);
- bodyToken = ckalloc(sizeof(Tcl_Token *) * maxLen);
- bodyLines = ckalloc(sizeof(int) * maxLen);
- bodyContLines = ckalloc(sizeof(int*) * maxLen);
+ bodyTokenArray = (Tcl_Token *)ckalloc(sizeof(Tcl_Token) * maxLen);
+ bodyToken = (Tcl_Token **)ckalloc(sizeof(Tcl_Token *) * maxLen);
+ bodyLines = (int *)ckalloc(sizeof(int) * maxLen);
+ bodyContLines = (int **)ckalloc(sizeof(int*) * maxLen);
bline = mapPtr->loc[eclIndex].line[valueIndex+1];
numWords = 0;
@@ -2033,9 +2048,9 @@ TclCompileSwitchCmd(
* Multi-word definition of patterns & actions.
*/
- bodyToken = ckalloc(sizeof(Tcl_Token *) * numWords);
- bodyLines = ckalloc(sizeof(int) * numWords);
- bodyContLines = ckalloc(sizeof(int*) * numWords);
+ bodyToken = (Tcl_Token **)ckalloc(sizeof(Tcl_Token *) * numWords);
+ bodyLines = (int *)ckalloc(sizeof(int) * numWords);
+ bodyContLines = (int **)ckalloc(sizeof(int*) * numWords);
bodyTokenArray = NULL;
for (i=0 ; i<numWords ; i++) {
/*
@@ -2081,10 +2096,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;
@@ -2125,7 +2140,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. */
@@ -2155,8 +2169,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;
@@ -2374,7 +2388,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. */
@@ -2399,10 +2412,10 @@ IssueSwitchJumpTable(
* Start by allocating the jump table itself, plus some workspace.
*/
- jtPtr = ckalloc(sizeof(JumptableInfo));
+ jtPtr = (JumptableInfo *)ckalloc(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;
@@ -2570,8 +2583,8 @@ static ClientData
DupJumptableInfo(
ClientData clientData)
{
- JumptableInfo *jtPtr = clientData;
- JumptableInfo *newJtPtr = ckalloc(sizeof(JumptableInfo));
+ JumptableInfo *jtPtr = (JumptableInfo *)clientData;
+ JumptableInfo *newJtPtr = (JumptableInfo *)ckalloc(sizeof(JumptableInfo));
Tcl_HashEntry *hPtr, *newHPtr;
Tcl_HashSearch search;
int isNew;
@@ -2590,7 +2603,7 @@ static void
FreeJumptableInfo(
ClientData clientData)
{
- JumptableInfo *jtPtr = clientData;
+ JumptableInfo *jtPtr = (JumptableInfo *)clientData;
Tcl_DeleteHashTable(&jtPtr->hashTable);
ckfree(jtPtr);
@@ -2603,15 +2616,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++) {
@@ -2632,16 +2646,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));
@@ -2679,6 +2695,7 @@ TclCompileTailcallCmd(
DefineLineInformation; /* TIP #280 */
Tcl_Token *tokenPtr = parsePtr->tokenPtr;
int i;
+ (void)cmdPtr;
if (parsePtr->numWords < 2 || parsePtr->numWords > 256
|| envPtr->procPtr == NULL) {
@@ -2728,6 +2745,7 @@ TclCompileThrowCmd(
Tcl_Token *codeToken, *msgToken;
Tcl_Obj *objPtr;
int codeKnown, codeIsList, codeIsValid, len;
+ (void)cmdPtr;
if (numWords != 3) {
return TCL_ERROR;
@@ -2833,6 +2851,7 @@ TclCompileTryCmd(
Tcl_Obj **matchClauses = NULL;
int *matchCodes=NULL, *resultVarIndices=NULL, *optionVarIndices=NULL;
int i;
+ (void)cmdPtr;
if (numWords < 2) {
return TCL_ERROR;
@@ -2860,12 +2879,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;
@@ -3126,9 +3145,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;
@@ -3337,8 +3356,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;
@@ -3640,6 +3659,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. */
@@ -3782,6 +3802,7 @@ TclCompileWhileCmd(
* infinite loop. */
Tcl_Obj *boolObj;
DefineLineInformation; /* TIP #280 */
+ (void)cmdPtr;
if (parsePtr->numWords != 3) {
return TCL_ERROR;
@@ -3953,6 +3974,8 @@ TclCompileYieldCmd(
* compiled. */
CompileEnv *envPtr) /* Holds resulting instructions. */
{
+ (void)cmdPtr;
+
if (parsePtr->numWords < 1 || parsePtr->numWords > 2) {
return TCL_ERROR;
}
@@ -3999,6 +4022,7 @@ TclCompileYieldToCmd(
DefineLineInformation; /* TIP #280 */
Tcl_Token *tokenPtr = TokenAfter(parsePtr->tokenPtr);
int i;
+ (void)cmdPtr;
if (parsePtr->numWords < 2) {
return TCL_ERROR;
@@ -4246,6 +4270,7 @@ TclCompileInvertOpCmd(
* compiled. */
CompileEnv *envPtr)
{
+ (void)cmdPtr;
return CompileUnaryOpCmd(interp, parsePtr, INST_BITNOT, envPtr);
}
@@ -4257,6 +4282,7 @@ TclCompileNotOpCmd(
* compiled. */
CompileEnv *envPtr)
{
+ (void)cmdPtr;
return CompileUnaryOpCmd(interp, parsePtr, INST_LNOT, envPtr);
}
@@ -4268,6 +4294,7 @@ TclCompileAddOpCmd(
* compiled. */
CompileEnv *envPtr)
{
+ (void)cmdPtr;
return CompileAssociativeBinaryOpCmd(interp, parsePtr, "0", INST_ADD,
envPtr);
}
@@ -4280,6 +4307,7 @@ TclCompileMulOpCmd(
* compiled. */
CompileEnv *envPtr)
{
+ (void)cmdPtr;
return CompileAssociativeBinaryOpCmd(interp, parsePtr, "1", INST_MULT,
envPtr);
}
@@ -4292,6 +4320,7 @@ TclCompileAndOpCmd(
* compiled. */
CompileEnv *envPtr)
{
+ (void)cmdPtr;
return CompileAssociativeBinaryOpCmd(interp, parsePtr, "-1", INST_BITAND,
envPtr);
}
@@ -4304,6 +4333,7 @@ TclCompileOrOpCmd(
* compiled. */
CompileEnv *envPtr)
{
+ (void)cmdPtr;
return CompileAssociativeBinaryOpCmd(interp, parsePtr, "0", INST_BITOR,
envPtr);
}
@@ -4316,6 +4346,7 @@ TclCompileXorOpCmd(
* compiled. */
CompileEnv *envPtr)
{
+ (void)cmdPtr;
return CompileAssociativeBinaryOpCmd(interp, parsePtr, "0", INST_BITXOR,
envPtr);
}
@@ -4336,6 +4367,7 @@ TclCompilePowOpCmd(
Tcl_Token *tokenPtr = parsePtr->tokenPtr;
DefineLineInformation; /* TIP #280 */
int words;
+ (void)cmdPtr;
for (words=1 ; words<parsePtr->numWords ; words++) {
tokenPtr = TokenAfter(tokenPtr);
@@ -4359,6 +4391,7 @@ TclCompileLshiftOpCmd(
* compiled. */
CompileEnv *envPtr)
{
+ (void)cmdPtr;
return CompileStrictlyBinaryOpCmd(interp, parsePtr, INST_LSHIFT, envPtr);
}
@@ -4370,6 +4403,7 @@ TclCompileRshiftOpCmd(
* compiled. */
CompileEnv *envPtr)
{
+ (void)cmdPtr;
return CompileStrictlyBinaryOpCmd(interp, parsePtr, INST_RSHIFT, envPtr);
}
@@ -4381,6 +4415,7 @@ TclCompileModOpCmd(
* compiled. */
CompileEnv *envPtr)
{
+ (void)cmdPtr;
return CompileStrictlyBinaryOpCmd(interp, parsePtr, INST_MOD, envPtr);
}
@@ -4392,6 +4427,7 @@ TclCompileNeqOpCmd(
* compiled. */
CompileEnv *envPtr)
{
+ (void)cmdPtr;
return CompileStrictlyBinaryOpCmd(interp, parsePtr, INST_NEQ, envPtr);
}
@@ -4403,6 +4439,7 @@ TclCompileStrneqOpCmd(
* compiled. */
CompileEnv *envPtr)
{
+ (void)cmdPtr;
return CompileStrictlyBinaryOpCmd(interp, parsePtr, INST_STR_NEQ, envPtr);
}
@@ -4414,6 +4451,7 @@ TclCompileInOpCmd(
* compiled. */
CompileEnv *envPtr)
{
+ (void)cmdPtr;
return CompileStrictlyBinaryOpCmd(interp, parsePtr, INST_LIST_IN, envPtr);
}
@@ -4425,6 +4463,7 @@ TclCompileNiOpCmd(
* compiled. */
CompileEnv *envPtr)
{
+ (void)cmdPtr;
return CompileStrictlyBinaryOpCmd(interp, parsePtr, INST_LIST_NOT_IN,
envPtr);
}
@@ -4437,6 +4476,7 @@ TclCompileLessOpCmd(
* compiled. */
CompileEnv *envPtr)
{
+ (void)cmdPtr;
return CompileComparisonOpCmd(interp, parsePtr, INST_LT, envPtr);
}
@@ -4448,6 +4488,7 @@ TclCompileLeqOpCmd(
* compiled. */
CompileEnv *envPtr)
{
+ (void)cmdPtr;
return CompileComparisonOpCmd(interp, parsePtr, INST_LE, envPtr);
}
@@ -4459,6 +4500,7 @@ TclCompileGreaterOpCmd(
* compiled. */
CompileEnv *envPtr)
{
+ (void)cmdPtr;
return CompileComparisonOpCmd(interp, parsePtr, INST_GT, envPtr);
}
@@ -4470,6 +4512,7 @@ TclCompileGeqOpCmd(
* compiled. */
CompileEnv *envPtr)
{
+ (void)cmdPtr;
return CompileComparisonOpCmd(interp, parsePtr, INST_GE, envPtr);
}
@@ -4481,6 +4524,7 @@ TclCompileEqOpCmd(
* compiled. */
CompileEnv *envPtr)
{
+ (void)cmdPtr;
return CompileComparisonOpCmd(interp, parsePtr, INST_EQ, envPtr);
}
@@ -4492,6 +4536,7 @@ TclCompileStreqOpCmd(
* compiled. */
CompileEnv *envPtr)
{
+ (void)cmdPtr;
return CompileComparisonOpCmd(interp, parsePtr, INST_STR_EQ, envPtr);
}
@@ -4503,6 +4548,7 @@ TclCompileStrLtOpCmd(
* compiled. */
CompileEnv *envPtr)
{
+ (void)cmdPtr;
return CompileComparisonOpCmd(interp, parsePtr, INST_STR_LT, envPtr);
}
@@ -4514,6 +4560,7 @@ TclCompileStrLeOpCmd(
* compiled. */
CompileEnv *envPtr)
{
+ (void)cmdPtr;
return CompileComparisonOpCmd(interp, parsePtr, INST_STR_LE, envPtr);
}
@@ -4525,6 +4572,7 @@ TclCompileStrGtOpCmd(
* compiled. */
CompileEnv *envPtr)
{
+ (void)cmdPtr;
return CompileComparisonOpCmd(interp, parsePtr, INST_STR_GT, envPtr);
}
@@ -4536,6 +4584,7 @@ TclCompileStrGeOpCmd(
* compiled. */
CompileEnv *envPtr)
{
+ (void)cmdPtr;
return CompileComparisonOpCmd(interp, parsePtr, INST_STR_GE, envPtr);
}
@@ -4550,6 +4599,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) {
@@ -4596,6 +4646,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 a6ac797..4fb41fc 100644
--- a/generic/tclCompExpr.c
+++ b/generic/tclCompExpr.c
@@ -631,7 +631,7 @@ ParseExpr(
TclParseInit(interp, start, numBytes, parsePtr);
- nodes = attemptckalloc(nodesAvailable * sizeof(OpNode));
+ nodes = (OpNode *)attemptckalloc(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 = attemptckrealloc(nodes, size * sizeof(OpNode));
+ newPtr = (OpNode *)attemptckrealloc(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 < 0) {
@@ -2156,7 +2156,7 @@ TclCompileExpr(
OpNode *opTree = NULL; /* Will point to the tree of operators */
Tcl_Obj *litList = Tcl_NewObj(); /* List to hold the literals */
Tcl_Obj *funcList = Tcl_NewObj(); /* List to hold the functon names*/
- Tcl_Parse *parsePtr = TclStackAlloc(interp, sizeof(Tcl_Parse));
+ Tcl_Parse *parsePtr = (Tcl_Parse *)TclStackAlloc(interp, sizeof(Tcl_Parse));
/* Holds the Tcl_Tokens of substitutions */
int code = ParseExpr(interp, script, numBytes, &opTree, litList,
@@ -2226,7 +2226,7 @@ ExecConstantExprTree(
* bytecode, so there's no need to tend to TIP 280 issues.
*/
- envPtr = TclStackAlloc(interp, sizeof(CompileEnv));
+ envPtr = (CompileEnv *)TclStackAlloc(interp, sizeof(CompileEnv));
TclInitCompileEnv(interp, envPtr, NULL, 0, NULL, 0);
CompileExprTree(interp, nodes, index, litObjvPtr, NULL, NULL, envPtr,
0 /* optimize */);
@@ -2321,13 +2321,13 @@ CompileExprTree(
break;
}
case QUESTION:
- newJump = TclStackAlloc(interp, sizeof(JumpList));
+ newJump = (JumpList *)TclStackAlloc(interp, sizeof(JumpList));
newJump->next = jumpPtr;
jumpPtr = newJump;
TclEmitForwardJump(envPtr, TCL_FALSE_JUMP, &jumpPtr->jump);
break;
case COLON:
- newJump = TclStackAlloc(interp, sizeof(JumpList));
+ newJump = (JumpList *)TclStackAlloc(interp, sizeof(JumpList));
newJump->next = jumpPtr;
jumpPtr = newJump;
TclEmitForwardJump(envPtr, TCL_UNCONDITIONAL_JUMP,
@@ -2340,7 +2340,7 @@ CompileExprTree(
break;
case AND:
case OR:
- newJump = TclStackAlloc(interp, sizeof(JumpList));
+ newJump = (JumpList *)TclStackAlloc(interp, sizeof(JumpList));
newJump->next = jumpPtr;
jumpPtr = newJump;
TclEmitForwardJump(envPtr, (nodePtr->lexeme == AND)
@@ -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 7afbc33..7ed24ae 100644
--- a/generic/tclCompile.c
+++ b/generic/tclCompile.c
@@ -712,7 +712,7 @@ static void StartExpanding(CompileEnv *envPtr);
* commands.
*/
static void EnterCmdWordData(ExtCmdLoc *eclPtr, int srcOffset,
- Tcl_Token *tokenPtr, const char *cmd, int len,
+ Tcl_Token *tokenPtr, const char *cmd,
int numWords, int line, int *clNext, int **lines,
CompileEnv *envPtr);
static void ReleaseCmdWordData(ExtCmdLoc *eclPtr);
@@ -965,6 +965,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;
}
@@ -1148,7 +1150,7 @@ CleanupByteCode(
(char *) codePtr);
if (hePtr) {
- ReleaseCmdWordData(Tcl_GetHashValue(hePtr));
+ ReleaseCmdWordData((ExtCmdLoc *)Tcl_GetHashValue(hePtr));
Tcl_DeleteHashEntry(hePtr);
}
}
@@ -1174,11 +1176,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
@@ -1498,7 +1501,7 @@ TclInitCompileEnv(
* non-compiling evaluator
*/
- envPtr->extCmdMapPtr = ckalloc(sizeof(ExtCmdLoc));
+ envPtr->extCmdMapPtr = (ExtCmdLoc *)ckalloc(sizeof(ExtCmdLoc));
envPtr->extCmdMapPtr->loc = NULL;
envPtr->extCmdMapPtr->nloc = 0;
envPtr->extCmdMapPtr->nuloc = 0;
@@ -1554,7 +1557,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;
@@ -2065,7 +2068,7 @@ CompileCommandTokens(
EnterCmdWordData(eclPtr, parsePtr->commandStart - envPtr->source,
parsePtr->tokenPtr, parsePtr->commandStart,
- parsePtr->commandSize, parsePtr->numWords, cmdLine,
+ parsePtr->numWords, cmdLine,
clNext, &wlines, envPtr);
wlineat = eclPtr->nuloc - 1;
@@ -2187,7 +2190,7 @@ TclCompileScript(
* many nested compilations (body enclosed in body) can cause abnormal
* program termination with a stack overflow exception, bug [fec0c17d39].
*/
- Tcl_Parse *parsePtr = ckalloc(sizeof(Tcl_Parse));
+ Tcl_Parse *parsePtr = (Tcl_Parse *)ckalloc(sizeof(Tcl_Parse));
do {
const char *next;
@@ -2445,7 +2448,7 @@ TclCompileTokens(
if (isLiteral) {
maxNumCL = NUM_STATIC_POS;
- clPosition = ckalloc(maxNumCL * sizeof(int));
+ clPosition = (int *)ckalloc(maxNumCL * sizeof(int));
}
adjust = 0;
@@ -2486,7 +2489,7 @@ TclCompileTokens(
if (numCL >= maxNumCL) {
maxNumCL *= 2;
- clPosition = ckrealloc(clPosition,
+ clPosition = (int *)ckrealloc(clPosition,
maxNumCL * sizeof(int));
}
clPosition[numCL] = clPos;
@@ -2743,6 +2746,7 @@ TclCompileNoOp(
{
Tcl_Token *tokenPtr;
int i;
+ (void)cmdPtr;
tokenPtr = parsePtr->tokenPtr;
for (i = 1; i < parsePtr->numWords; i++) {
@@ -2860,7 +2864,7 @@ TclInitByteCode(
namespacePtr = envPtr->iPtr->globalNsPtr;
}
- p = ckalloc(structureSize);
+ p = (unsigned char *)ckalloc(structureSize);
codePtr = (ByteCode *) p;
codePtr->interpHandle = TclHandlePreserve(iPtr->handle);
codePtr->compileEpoch = iPtr->compileEpoch;
@@ -3073,7 +3077,7 @@ TclFindCompiledLocal(
if (create || (name == NULL)) {
localVar = procPtr->numCompiledLocals;
- localPtr = ckalloc(offsetof(CompiledLocal, name) + nameBytes + 1);
+ localPtr = (CompiledLocal *)ckalloc(offsetof(CompiledLocal, name) + nameBytes + 1);
if (procPtr->firstLocalPtr == NULL) {
procPtr->firstLocalPtr = procPtr->lastLocalPtr = localPtr;
} else {
@@ -3123,7 +3127,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. */
@@ -3137,14 +3141,14 @@ TclExpandCodeArray(
size_t newBytes = 2 * (envPtr->codeEnd - envPtr->codeStart);
if (envPtr->mallocedCodeArray) {
- envPtr->codeStart = ckrealloc(envPtr->codeStart, newBytes);
+ envPtr->codeStart = (unsigned char *)ckrealloc(envPtr->codeStart, newBytes);
} else {
/*
* envPtr->codeStart isn't a ckalloc'd pointer, so we must code a
* ckrealloc equivalent for ourselves.
*/
- unsigned char *newPtr = ckalloc(newBytes);
+ unsigned char *newPtr = (unsigned char *)ckalloc(newBytes);
memcpy(newPtr, envPtr->codeStart, currBytes);
envPtr->codeStart = newPtr;
@@ -3204,14 +3208,14 @@ EnterCmdStartData(
size_t newBytes = newElems * sizeof(CmdLocation);
if (envPtr->mallocedCmdMap) {
- envPtr->cmdMapPtr = ckrealloc(envPtr->cmdMapPtr, newBytes);
+ envPtr->cmdMapPtr = (CmdLocation *)ckrealloc(envPtr->cmdMapPtr, newBytes);
} else {
/*
* envPtr->cmdMapPtr isn't a ckalloc'd pointer, so we must code a
* ckrealloc equivalent for ourselves.
*/
- CmdLocation *newPtr = ckalloc(newBytes);
+ CmdLocation *newPtr = (CmdLocation *)ckalloc(newBytes);
memcpy(newPtr, envPtr->cmdMapPtr, currBytes);
envPtr->cmdMapPtr = newPtr;
@@ -3308,7 +3312,6 @@ EnterCmdWordData(
int srcOffset, /* Offset of first char of the command. */
Tcl_Token *tokenPtr,
const char *cmd,
- int len,
int numWords,
int line,
int *clNext,
@@ -3330,16 +3333,16 @@ EnterCmdWordData(
size_t newElems = (currElems ? 2*currElems : 1);
size_t newBytes = newElems * sizeof(ECL);
- eclPtr->loc = ckrealloc(eclPtr->loc, newBytes);
+ eclPtr->loc = (ECL *)ckrealloc(eclPtr->loc, newBytes);
eclPtr->nloc = newElems;
}
ePtr = &eclPtr->loc[eclPtr->nuloc];
ePtr->srcOffset = srcOffset;
- ePtr->line = ckalloc(numWords * sizeof(int));
- ePtr->next = ckalloc(numWords * sizeof(int *));
+ ePtr->line = (int *)ckalloc(numWords * sizeof(int));
+ ePtr->next = (int **)ckalloc(numWords * sizeof(int *));
ePtr->nline = numWords;
- wwlines = ckalloc(numWords * sizeof(int));
+ wwlines = (int *)ckalloc(numWords * sizeof(int));
last = cmd;
wordLine = line;
@@ -3408,17 +3411,17 @@ TclCreateExceptRange(
if (envPtr->mallocedExceptArray) {
envPtr->exceptArrayPtr =
- ckrealloc(envPtr->exceptArrayPtr, newBytes);
+ (ExceptionRange *)ckrealloc(envPtr->exceptArrayPtr, newBytes);
envPtr->exceptAuxArrayPtr =
- ckrealloc(envPtr->exceptAuxArrayPtr, newBytes2);
+ (ExceptionAux *)ckrealloc(envPtr->exceptAuxArrayPtr, newBytes2);
} else {
/*
* envPtr->exceptArrayPtr isn't a ckalloc'd pointer, so we must
* code a ckrealloc equivalent for ourselves.
*/
- ExceptionRange *newPtr = ckalloc(newBytes);
- ExceptionAux *newPtr2 = ckalloc(newBytes2);
+ ExceptionRange *newPtr = (ExceptionRange *)ckalloc(newBytes);
+ ExceptionAux *newPtr2 = (ExceptionAux *)ckalloc(newBytes2);
memcpy(newPtr, envPtr->exceptArrayPtr, currBytes);
memcpy(newPtr2, envPtr->exceptAuxArrayPtr, currBytes2);
@@ -3521,11 +3524,11 @@ TclAddLoopBreakFixup(
auxPtr->allocBreakTargets *= 2;
auxPtr->allocBreakTargets += 2;
if (auxPtr->breakTargets) {
- auxPtr->breakTargets = ckrealloc(auxPtr->breakTargets,
+ auxPtr->breakTargets = (unsigned int *)ckrealloc(auxPtr->breakTargets,
sizeof(int) * auxPtr->allocBreakTargets);
} else {
auxPtr->breakTargets =
- ckalloc(sizeof(int) * auxPtr->allocBreakTargets);
+ (unsigned int *)ckalloc(sizeof(int) * auxPtr->allocBreakTargets);
}
}
auxPtr->breakTargets[auxPtr->numBreakTargets - 1] = CurrentOffset(envPtr);
@@ -3547,11 +3550,11 @@ TclAddLoopContinueFixup(
auxPtr->allocContinueTargets *= 2;
auxPtr->allocContinueTargets += 2;
if (auxPtr->continueTargets) {
- auxPtr->continueTargets = ckrealloc(auxPtr->continueTargets,
+ auxPtr->continueTargets = (unsigned int *)ckrealloc(auxPtr->continueTargets,
sizeof(int) * auxPtr->allocContinueTargets);
} else {
auxPtr->continueTargets =
- ckalloc(sizeof(int) * auxPtr->allocContinueTargets);
+ (unsigned int *)ckalloc(sizeof(int) * auxPtr->allocContinueTargets);
}
}
auxPtr->continueTargets[auxPtr->numContinueTargets - 1] =
@@ -3774,14 +3777,14 @@ TclCreateAuxData(
if (envPtr->mallocedAuxDataArray) {
envPtr->auxDataArrayPtr =
- ckrealloc(envPtr->auxDataArrayPtr, newBytes);
+ (AuxData *)ckrealloc(envPtr->auxDataArrayPtr, newBytes);
} else {
/*
* envPtr->auxDataArrayPtr isn't a ckalloc'd pointer, so we must
* code a ckrealloc equivalent for ourselves.
*/
- AuxData *newPtr = ckalloc(newBytes);
+ AuxData *newPtr = (AuxData *)ckalloc(newBytes);
memcpy(newPtr, envPtr->auxDataArrayPtr, currBytes);
envPtr->auxDataArrayPtr = newPtr;
@@ -3863,14 +3866,14 @@ TclExpandJumpFixupArray(
size_t newBytes = newElems * sizeof(JumpFixup);
if (fixupArrayPtr->mallocedArray) {
- fixupArrayPtr->fixup = ckrealloc(fixupArrayPtr->fixup, newBytes);
+ fixupArrayPtr->fixup = (JumpFixup *)ckrealloc(fixupArrayPtr->fixup, newBytes);
} else {
/*
* fixupArrayPtr->fixup isn't a ckalloc'd pointer, so we must code a
* ckrealloc equivalent for ourselves.
*/
- JumpFixup *newPtr = ckalloc(newBytes);
+ JumpFixup *newPtr = (JumpFixup *)ckalloc(newBytes);
memcpy(newPtr, fixupArrayPtr->fixup, currBytes);
fixupArrayPtr->fixup = newPtr;
diff --git a/generic/tclConfig.c b/generic/tclConfig.c
index eb6807c..e7e521a 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 = ckalloc(sizeof(QCCD));
+ QCCD *cdPtr = (QCCD *)ckalloc(sizeof(QCCD));
cdPtr->interp = interp;
if (valEncoding) {
- cdPtr->encoding = ckalloc(strlen(valEncoding)+1);
+ cdPtr->encoding = (char *)ckalloc(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;
int n, index;
@@ -326,7 +326,7 @@ static void
QueryConfigDelete(
ClientData clientData)
{
- QCCD *cdPtr = clientData;
+ QCCD *cdPtr = (QCCD *)clientData;
Tcl_Obj *pkgName = cdPtr->pkg;
Tcl_Obj *pDB = GetConfigDict(cdPtr->interp);
@@ -359,7 +359,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();
@@ -392,9 +392,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 fb4f3cf..d31badd 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((int)
- 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 e79b6e4..3387164 100644
--- a/generic/tclDecls.h
+++ b/generic/tclDecls.h
@@ -4058,14 +4058,14 @@ extern const TclStubs *tclStubsPtr;
#undef Tcl_SetResult
#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) { \
- ckfree(__result); \
+ ckfree((char *)__result); \
} else { \
- (*__freeProc)(__result); \
+ (*__freeProc)((char *)__result); \
} \
} \
} while(0)
diff --git a/generic/tclDictObj.c b/generic/tclDictObj.c
index 5c6cb52..88a7876 100644
--- a/generic/tclDictObj.c
+++ b/generic/tclDictObj.c
@@ -179,7 +179,7 @@ const Tcl_ObjType tclDictType = {
do { \
const Tcl_ObjIntRep *irPtr; \
irPtr = TclFetchIntRep((objPtr), &tclDictType); \
- (dictRepPtr) = irPtr ? irPtr->twoPtrValue.ptr1 : NULL; \
+ (dictRepPtr) = irPtr ? (Dict *)irPtr->twoPtrValue.ptr1 : NULL; \
} while (0)
/*
@@ -243,10 +243,11 @@ AllocChainEntry(
Tcl_HashTable *tablePtr,
void *keyPtr)
{
- Tcl_Obj *objPtr = keyPtr;
+ Tcl_Obj *objPtr = (Tcl_Obj *)keyPtr;
ChainEntry *cPtr;
+ (void)tablePtr;
- cPtr = ckalloc(sizeof(ChainEntry));
+ cPtr = (ChainEntry *)ckalloc(sizeof(ChainEntry));
cPtr->entry.key.objPtr = objPtr;
Tcl_IncrRefCount(objPtr);
cPtr->entry.clientData = 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 = ckalloc(sizeof(Dict));
+ Dict *oldDict, *newDict = (Dict *)ckalloc(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 = ckalloc(numElems);
+ flagPtr = (char *)ckalloc(numElems);
}
for (i=0,cPtr=dict->entryChainHead; i<numElems; i+=2,cPtr=cPtr->nextPtr) {
/*
@@ -545,7 +546,7 @@ UpdateStringOfDict(
*/
flagPtr[i] = ( i ? TCL_DONT_QUOTE_HASH : 0 );
- keyPtr = Tcl_GetHashKey(&dict->table, &cPtr->entry);
+ keyPtr = (Tcl_Obj *)Tcl_GetHashKey(&dict->table, &cPtr->entry);
elem = TclGetStringFromObj(keyPtr, &length);
bytesNeeded += TclScanElement(elem, length, flagPtr+i);
if (bytesNeeded < 0) {
@@ -553,7 +554,7 @@ UpdateStringOfDict(
}
flagPtr[i+1] = TCL_DONT_QUOTE_HASH;
- valuePtr = Tcl_GetHashValue(&cPtr->entry);
+ valuePtr = (Tcl_Obj *)Tcl_GetHashValue(&cPtr->entry);
elem = TclGetStringFromObj(valuePtr, &length);
bytesNeeded += TclScanElement(elem, length, flagPtr+i+1);
if (bytesNeeded < 0) {
@@ -573,13 +574,13 @@ UpdateStringOfDict(
TclOOM(dst, bytesNeeded);
for (i=0,cPtr=dict->entryChainHead; i<numElems; i+=2,cPtr=cPtr->nextPtr) {
flagPtr[i] |= ( i ? TCL_DONT_QUOTE_HASH : 0 );
- keyPtr = Tcl_GetHashKey(&dict->table, &cPtr->entry);
+ keyPtr = (Tcl_Obj *)Tcl_GetHashKey(&dict->table, &cPtr->entry);
elem = TclGetStringFromObj(keyPtr, &length);
dst += TclConvertElement(elem, length, dst, flagPtr[i]);
*dst++ = ' ';
flagPtr[i+1] |= TCL_DONT_QUOTE_HASH;
- valuePtr = Tcl_GetHashValue(&cPtr->entry);
+ valuePtr = (Tcl_Obj *)Tcl_GetHashValue(&cPtr->entry);
elem = TclGetStringFromObj(valuePtr, &length);
dst += TclConvertElement(elem, length, dst, flagPtr[i+1]);
*dst++ = ' ';
@@ -618,7 +619,7 @@ SetDictFromAny(
{
Tcl_HashEntry *hPtr;
int isNew;
- Dict *dict = ckalloc(sizeof(Dict));
+ Dict *dict = (Dict *)ckalloc(sizeof(Dict));
InitChainTable(dict);
@@ -643,7 +644,7 @@ SetDictFromAny(
/* Store key and value in the hash table we're building. */
hPtr = CreateChainEntry(dict, objv[i], &isNew);
if (!isNew) {
- Tcl_Obj *discardedValue = Tcl_GetHashValue(hPtr);
+ Tcl_Obj *discardedValue = (Tcl_Obj *)Tcl_GetHashValue(hPtr);
/*
* Not really a well-formed dictionary as there are duplicate
@@ -716,7 +717,7 @@ SetDictFromAny(
/* Store key and value in the hash table we're building. */
hPtr = CreateChainEntry(dict, keyPtr, &isNew);
if (!isNew) {
- Tcl_Obj *discardedValue = Tcl_GetHashValue(hPtr);
+ Tcl_Obj *discardedValue = (Tcl_Obj *)Tcl_GetHashValue(hPtr);
TclDecrRefCount(keyPtr);
TclDecrRefCount(discardedValue);
@@ -851,7 +852,7 @@ TclTraceDictPath(
Tcl_IncrRefCount(tmpObj);
Tcl_SetHashValue(hPtr, tmpObj);
} else {
- tmpObj = Tcl_GetHashValue(hPtr);
+ tmpObj = (Tcl_Obj *)Tcl_GetHashValue(hPtr);
DictGetIntRep(tmpObj, newDict);
@@ -972,7 +973,7 @@ Tcl_DictObjPut(
DictSetIntRep(dictPtr, dict);
Tcl_IncrRefCount(valuePtr);
if (!isNew) {
- Tcl_Obj *oldValuePtr = Tcl_GetHashValue(hPtr);
+ Tcl_Obj *oldValuePtr = (Tcl_Obj *)Tcl_GetHashValue(hPtr);
TclDecrRefCount(oldValuePtr);
}
@@ -1021,7 +1022,7 @@ Tcl_DictObjGet(
if (hPtr == NULL) {
*valuePtrPtr = NULL;
} else {
- *valuePtrPtr = Tcl_GetHashValue(hPtr);
+ *valuePtrPtr = (Tcl_Obj *)Tcl_GetHashValue(hPtr);
}
return TCL_OK;
}
@@ -1162,10 +1163,10 @@ Tcl_DictObjFirst(
searchPtr->next = cPtr->nextPtr;
dict->refCount++;
if (keyPtrPtr != NULL) {
- *keyPtrPtr = Tcl_GetHashKey(&dict->table, &cPtr->entry);
+ *keyPtrPtr = (Tcl_Obj *)Tcl_GetHashKey(&dict->table, &cPtr->entry);
}
if (valuePtrPtr != NULL) {
- *valuePtrPtr = Tcl_GetHashValue(&cPtr->entry);
+ *valuePtrPtr = (Tcl_Obj *)Tcl_GetHashValue(&cPtr->entry);
}
}
return TCL_OK;
@@ -1228,7 +1229,7 @@ Tcl_DictObjNext(
Tcl_Panic("concurrent dictionary modification and search");
}
- cPtr = searchPtr->next;
+ cPtr = (ChainEntry *)searchPtr->next;
if (cPtr == NULL) {
Tcl_DictObjDone(searchPtr);
*donePtr = 1;
@@ -1238,11 +1239,11 @@ Tcl_DictObjNext(
searchPtr->next = cPtr->nextPtr;
*donePtr = 0;
if (keyPtrPtr != NULL) {
- *keyPtrPtr = Tcl_GetHashKey(
+ *keyPtrPtr = (Tcl_Obj *)Tcl_GetHashKey(
&((Dict *)searchPtr->dictionaryPtr)->table, &cPtr->entry);
}
if (valuePtrPtr != NULL) {
- *valuePtrPtr = Tcl_GetHashValue(&cPtr->entry);
+ *valuePtrPtr = (Tcl_Obj *)Tcl_GetHashValue(&cPtr->entry);
}
}
@@ -1329,7 +1330,7 @@ Tcl_DictObjPutKeyList(
hPtr = CreateChainEntry(dict, keyv[keyc-1], &isNew);
Tcl_IncrRefCount(valuePtr);
if (!isNew) {
- Tcl_Obj *oldValuePtr = Tcl_GetHashValue(hPtr);
+ Tcl_Obj *oldValuePtr = (Tcl_Obj *)Tcl_GetHashValue(hPtr);
TclDecrRefCount(oldValuePtr);
}
@@ -1424,7 +1425,7 @@ Tcl_NewDictObj(void)
TclNewObj(dictPtr);
TclInvalidateStringRep(dictPtr);
- dict = ckalloc(sizeof(Dict));
+ dict = (Dict *)ckalloc(sizeof(Dict));
InitChainTable(dict);
dict->epoch = 1;
dict->chain = NULL;
@@ -1472,7 +1473,7 @@ Tcl_DbNewDictObj(
TclDbNewObj(dictPtr, file, line);
TclInvalidateStringRep(dictPtr);
- dict = ckalloc(sizeof(Dict));
+ dict = (Dict *)ckalloc(sizeof(Dict));
InitChainTable(dict);
dict->epoch = 1;
dict->chain = NULL;
@@ -1480,6 +1481,8 @@ Tcl_DbNewDictObj(
DictSetIntRep(dictPtr, dict);
return dictPtr;
#else /* !TCL_MEM_DEBUG */
+ (void)file;
+ (void)line;
return Tcl_NewDictObj();
#endif
}
@@ -1506,13 +1509,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
@@ -1556,13 +1560,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 ...?");
@@ -1649,7 +1654,7 @@ DictGetCmd(
static int
DictGetDefCmd(
- ClientData dummy,
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp,
int objc,
Tcl_Obj *const *objv)
@@ -1657,6 +1662,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");
@@ -1714,13 +1720,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 ...?");
@@ -1762,13 +1769,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 ...?");
@@ -1810,7 +1818,7 @@ DictRemoveCmd(
static int
DictMergeCmd(
- ClientData dummy,
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp,
int objc,
Tcl_Obj *const *objv)
@@ -1819,6 +1827,7 @@ DictMergeCmd(
int allocatedDict = 0;
int i, done;
Tcl_DictSearch search;
+ (void)dummy;
if (objc == 1) {
/*
@@ -1897,13 +1906,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?");
@@ -1976,7 +1986,7 @@ DictKeysCmd(
static int
DictValuesCmd(
- ClientData dummy,
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp,
int objc,
Tcl_Obj *const *objv)
@@ -1985,6 +1995,7 @@ DictValuesCmd(
Tcl_DictSearch search;
int done;
const char *pattern;
+ (void)dummy;
if (objc!=2 && objc!=3) {
Tcl_WrongNumArgs(interp, 1, objv, "dictionary ?pattern?");
@@ -2036,12 +2047,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");
@@ -2074,12 +2086,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 ...?");
@@ -2116,13 +2129,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");
@@ -2160,13 +2174,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?");
@@ -2280,13 +2295,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 ...?");
@@ -2367,13 +2383,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 ...?");
@@ -2469,7 +2486,7 @@ DictAppendCmd(
static int
DictForNRCmd(
- ClientData dummy,
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp,
int objc,
Tcl_Obj *const *objv)
@@ -2479,6 +2496,7 @@ DictForNRCmd(
Tcl_Obj **varv, *keyObj, *valueObj;
Tcl_DictSearch *searchPtr;
int varc, done;
+ (void)dummy;
if (objc != 4) {
Tcl_WrongNumArgs(interp, 1, objv,
@@ -2499,7 +2517,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);
@@ -2569,10 +2587,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;
@@ -2664,7 +2682,7 @@ DictForLoopCallback(
static int
DictMapNRCmd(
- ClientData dummy,
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp,
int objc,
Tcl_Obj *const *objv)
@@ -2673,6 +2691,7 @@ DictMapNRCmd(
Tcl_Obj **varv, *keyObj, *valueObj;
DictMapStorage *storagePtr;
int varc, done;
+ (void)dummy;
if (objc != 4) {
Tcl_WrongNumArgs(interp, 1, objv,
@@ -2693,7 +2712,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);
@@ -2773,7 +2792,7 @@ DictMapLoopCallback(
int result)
{
Interp *iPtr = (Interp *) interp;
- DictMapStorage *storagePtr = data[0];
+ DictMapStorage *storagePtr = (DictMapStorage *)data[0];
Tcl_Obj *keyObj, *valueObj;
int done;
@@ -2876,13 +2895,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");
@@ -2936,13 +2956,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 ...?");
@@ -2995,7 +3016,7 @@ DictUnsetCmd(
static int
DictFilterCmd(
- ClientData dummy,
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp,
int objc,
Tcl_Obj *const *objv)
@@ -3012,6 +3033,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 ...?");
@@ -3288,6 +3310,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,
@@ -3341,8 +3364,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.
@@ -3438,13 +3461,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");
@@ -3492,9 +3516,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 a7ab8db..83642f0 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;
@@ -952,8 +950,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;
@@ -962,6 +959,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);
@@ -1577,7 +1575,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));
@@ -1627,7 +1625,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 375e519..c888962 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 = ckalloc(sizeof(TableEncodingData));
+ dataPtr = (TableEncodingData *)ckalloc(sizeof(TableEncodingData));
memset(dataPtr, 0, sizeof(TableEncodingData));
dataPtr->fallback = '?';
size = 256*(sizeof(unsigned short *) + sizeof(unsigned short));
- dataPtr->toUnicode = ckalloc(size);
+ dataPtr->toUnicode = (unsigned short **)ckalloc(size);
memset(dataPtr->toUnicode, 0, size);
- dataPtr->fromUnicode = ckalloc(size);
+ dataPtr->fromUnicode = (unsigned short **)ckalloc(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);
}
@@ -827,7 +827,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;
@@ -972,7 +972,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);
@@ -1089,7 +1089,7 @@ Tcl_CreateEncoding(
const Tcl_EncodingType *typePtr)
/* The encoding type. */
{
- Encoding *encodingPtr = ckalloc(sizeof(Encoding));
+ Encoding *encodingPtr = (Encoding *)ckalloc(sizeof(Encoding));
encodingPtr->name = NULL;
encodingPtr->toUtfProc = typePtr->toUtfProc;
encodingPtr->fromUtfProc = typePtr->fromUtfProc;
@@ -1117,11 +1117,11 @@ Tcl_CreateEncoding(
* reference goes away.
*/
- Encoding *replaceMe = Tcl_GetHashValue(hPtr);
+ Encoding *replaceMe = (Encoding *)Tcl_GetHashValue(hPtr);
replaceMe->hPtr = NULL;
}
- name = ckalloc(strlen(typePtr->encodingName) + 1);
+ name = (char *)ckalloc(strlen(typePtr->encodingName) + 1);
encodingPtr->name = strcpy(name, typePtr->encodingName);
encodingPtr->hPtr = hPtr;
Tcl_SetHashValue(hPtr, encodingPtr);
@@ -1226,7 +1226,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. */
@@ -1260,6 +1260,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;
@@ -1417,7 +1418,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. */
@@ -1448,6 +1449,7 @@ Tcl_UtfToExternal(
const Encoding *encodingPtr;
int result, srcRead, dstWrote, dstChars;
Tcl_EncodingState state;
+ (void)dummy;
if (encoding == NULL) {
encoding = systemEncoding;
@@ -1788,7 +1790,7 @@ LoadTableEncoding(
#undef PAGESIZE
#define PAGESIZE (256 * sizeof(unsigned short))
- dataPtr = ckalloc(sizeof(TableEncodingData));
+ dataPtr = (TableEncodingData *)ckalloc(sizeof(TableEncodingData));
memset(dataPtr, 0, sizeof(TableEncodingData));
dataPtr->fallback = fallback;
@@ -1800,7 +1802,7 @@ LoadTableEncoding(
*/
size = 256 * sizeof(unsigned short *) + numPages * PAGESIZE;
- dataPtr->toUnicode = ckalloc(size);
+ dataPtr->toUnicode = (unsigned short **)ckalloc(size);
memset(dataPtr->toUnicode, 0, size);
pageMemPtr = (unsigned short *) (dataPtr->toUnicode + 256);
@@ -1861,7 +1863,7 @@ LoadTableEncoding(
}
}
size = 256 * sizeof(unsigned short *) + numPages * PAGESIZE;
- dataPtr->fromUnicode = ckalloc(size);
+ dataPtr->fromUnicode = (unsigned short **)ckalloc(size);
memset(dataPtr->fromUnicode, 0, size);
pageMemPtr = (unsigned short *) (dataPtr->fromUnicode + 256);
@@ -1893,8 +1895,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)'\\'] = '\\';
}
}
}
@@ -2099,7 +2101,7 @@ LoadEscapeEncoding(
size = sizeof(EscapeEncodingData) - sizeof(EscapeSubTable)
+ Tcl_DStringLength(&escapeData);
- dataPtr = ckalloc(size);
+ dataPtr = (EscapeEncodingData *)ckalloc(size);
dataPtr->initLen = strlen(init);
memcpy(dataPtr->init, init, dataPtr->initLen + 1);
dataPtr->finalLen = strlen(final);
@@ -2178,6 +2180,8 @@ BinaryProc(
* output buffer. */
{
int result;
+ (void)clientData;
+ (void)statePtr;
result = TCL_OK;
dstLen -= TCL_UTF_MAX - 1;
@@ -2349,6 +2353,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;
@@ -2480,6 +2485,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;
@@ -2701,6 +2707,7 @@ UtfToUcs2Proc(
int len;
#endif
Tcl_UniChar ch = 0;
+ (void)statePtr;
srcStart = src;
srcEnd = src + srcLen;
@@ -2810,7 +2817,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;
@@ -2921,8 +2929,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;
@@ -3045,6 +3054,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;
@@ -3128,10 +3139,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;
@@ -3216,7 +3227,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]
@@ -3274,7 +3285,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;
@@ -3410,7 +3421,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;
@@ -3488,7 +3499,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;
@@ -3529,7 +3540,7 @@ EscapeFromUtfProc(
}
encodingPtr = GetTableEncoding(dataPtr, state);
- tableDataPtr = encodingPtr->clientData;
+ tableDataPtr = (const TableEncodingData *)encodingPtr->clientData;
tablePrefixBytes = tableDataPtr->prefixBytes;
tableFromUnicode = (const unsigned short *const *)
tableDataPtr->fromUnicode;
@@ -3557,7 +3568,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;
@@ -3571,7 +3582,7 @@ EscapeFromUtfProc(
break;
}
encodingPtr = GetTableEncoding(dataPtr, state);
- tableDataPtr = encodingPtr->clientData;
+ tableDataPtr = (const TableEncodingData *)encodingPtr->clientData;
word = tableDataPtr->fallback;
}
@@ -3677,7 +3688,7 @@ EscapeFreeProc(
ClientData clientData) /* EscapeEncodingData that specifies
* encoding. */
{
- EscapeEncodingData *dataPtr = clientData;
+ EscapeEncodingData *dataPtr = (EscapeEncodingData *)clientData;
EscapeSubTable *subTablePtr;
int i;
@@ -3842,7 +3853,7 @@ InitializeEncodingSearchPath(
bytes = TclGetString(searchPathObj);
*lengthPtr = searchPathObj->length;
- *valuePtr = ckalloc(*lengthPtr + 1);
+ *valuePtr = (char *)ckalloc(*lengthPtr + 1);
memcpy(*valuePtr, bytes, *lengthPtr + 1);
Tcl_DecrRefCount(searchPathObj);
}
diff --git a/generic/tclEnsemble.c b/generic/tclEnsemble.c
index 16d8310..654f33e 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 = ckalloc(sizeof(EnsembleConfig));
+ ensemblePtr = (EnsembleConfig *)ckalloc(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;
ckfree(store);
ckfree(tmp);
@@ -2176,9 +2179,9 @@ TclSpellFix(
if (search[0] == NULL) {
store = (Tcl_Obj **) search[2];
} else {
- Tcl_Obj **tmp = ckalloc(3 * sizeof(Tcl_Obj *));
+ Tcl_Obj **tmp = (Tcl_Obj **)ckalloc(3 * sizeof(Tcl_Obj *));
- store = ckalloc(size * sizeof(Tcl_Obj *));
+ store = (Tcl_Obj **)ckalloc(size * sizeof(Tcl_Obj *));
memcpy(store, iPtr->ensembleRewrite.sourceObjs,
size * sizeof(Tcl_Obj *));
@@ -2418,7 +2421,7 @@ MakeCachedEnsembleCommand(
* our own.
*/
- ensembleCmd = ckalloc(sizeof(EnsembleCmdRep));
+ ensembleCmd = (EnsembleCmdRep *)ckalloc(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;
/*
@@ -2691,7 +2694,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,
@@ -2740,7 +2743,7 @@ BuildEnsembleConfig(
*/
ensemblePtr->subcommandArrayPtr =
- ckalloc(sizeof(char *) * hash->numEntries);
+ (char **)ckalloc(sizeof(char *) * hash->numEntries);
/*
* Fill array from both ends as this makes us less likely to end up with
@@ -2764,12 +2767,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) {
@@ -2861,7 +2864,7 @@ DupEnsembleCmdRep(
Tcl_Obj *copyPtr)
{
EnsembleCmdRep *ensembleCmd;
- EnsembleCmdRep *ensembleCopy = ckalloc(sizeof(EnsembleCmdRep));
+ EnsembleCmdRep *ensembleCopy = (EnsembleCmdRep *)ckalloc(sizeof(EnsembleCmdRep));
ECRGetIntRep(objPtr, ensembleCmd);
ECRSetIntRep(copyPtr, ensembleCopy);
diff --git a/generic/tclEnv.c b/generic/tclEnv.c
index 8a6f996..d7f8d5f 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 = ckalloc((length + 5) * sizeof(char *));
+ char **newEnviron = (char **)ckalloc((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 = ckalloc(nameLength + valueLength + 2);
+ p = (char *)ckalloc(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 = ckrealloc(p, Tcl_DStringLength(&envString) + 1);
+ p = (char *)ckrealloc(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';
@@ -454,18 +454,18 @@ TclUnsetEnv(
*/
#if defined(_WIN32)
- string = ckalloc(length + 2);
+ string = (char *)ckalloc(length + 2);
memcpy(string, name, length);
string[length] = '=';
string[length+1] = '\0';
#else
- string = ckalloc(length + 1);
+ string = (char *)ckalloc(length + 1);
memcpy(string, name, length);
string[length] = '\0';
#endif /* _WIN32 */
Tcl_UtfToExternalDString(NULL, string, -1, &envString);
- string = ckrealloc(string, Tcl_DStringLength(&envString) + 1);
+ string = (char *)ckrealloc(string, Tcl_DStringLength(&envString) + 1);
memcpy(string, Tcl_DStringValue(&envString),
Tcl_DStringLength(&envString)+1);
Tcl_DStringFree(&envString);
@@ -579,7 +579,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". */
@@ -587,6 +587,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.
*/
@@ -701,7 +702,7 @@ ReplaceString(
const int growth = 5;
- env.cache = ckrealloc(env.cache,
+ env.cache = (char **)ckrealloc(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 41aeca4..fbc2bf3 100644
--- a/generic/tclEvent.c
+++ b/generic/tclEvent.c
@@ -55,7 +55,7 @@ typedef struct {
typedef struct ExitHandler {
Tcl_ExitProc *proc; /* Function to call when process exits. */
- ClientData clientData; /* One word of information to pass to proc. */
+ void *clientData; /* One word of information to pass to proc. */
struct ExitHandler *nextPtr;/* Next in list of all exit handlers for this
* application, or NULL for end of list. */
} ExitHandler;
@@ -103,19 +103,19 @@ static Tcl_ThreadDataKey dataKey;
#if TCL_THREADS
typedef struct {
Tcl_ThreadCreateProc *proc; /* Main() function of the thread */
- ClientData clientData; /* The one argument to Main() */
+ void *clientData; /* The one argument to Main() */
} ThreadClientData;
-static Tcl_ThreadCreateType NewThreadProc(ClientData clientData);
+static Tcl_ThreadCreateType NewThreadProc(void *clientData);
#endif /* TCL_THREADS */
/*
* Prototypes for functions referenced only in this file:
*/
-static void BgErrorDeleteProc(ClientData clientData,
+static void BgErrorDeleteProc(void *clientData,
Tcl_Interp *interp);
-static void HandleBgErrors(ClientData clientData);
-static char * VwaitVarProc(ClientData clientData,
+static void HandleBgErrors(void *clientData);
+static char * VwaitVarProc(void *clientData,
Tcl_Interp *interp, const char *name1,
const char *name2, int flags);
static void InvokeExitHandlers(void);
@@ -163,7 +163,7 @@ Tcl_BackgroundException(
return;
}
- errPtr = ckalloc(sizeof(BgError));
+ errPtr = (BgError*)ckalloc(sizeof(BgError));
errPtr->errorMsg = Tcl_GetObjResult(interp);
Tcl_IncrRefCount(errPtr->errorMsg);
errPtr->returnOpts = Tcl_GetReturnOptions(interp, code);
@@ -171,7 +171,7 @@ Tcl_BackgroundException(
errPtr->nextPtr = NULL;
(void) TclGetBgErrorHandler(interp);
- assocPtr = Tcl_GetAssocData(interp, "tclBgError", NULL);
+ assocPtr = (ErrAssocData *)Tcl_GetAssocData(interp, "tclBgError", NULL);
if (assocPtr->firstBgPtr == NULL) {
assocPtr->firstBgPtr = errPtr;
Tcl_DoWhenIdle(HandleBgErrors, assocPtr);
@@ -201,9 +201,9 @@ Tcl_BackgroundException(
static void
HandleBgErrors(
- ClientData clientData) /* Pointer to ErrAssocData structure. */
+ void *clientData) /* Pointer to ErrAssocData structure. */
{
- ErrAssocData *assocPtr = clientData;
+ ErrAssocData *assocPtr = (ErrAssocData *)clientData;
Tcl_Interp *interp = assocPtr->interp;
BgError *errPtr;
@@ -230,7 +230,7 @@ HandleBgErrors(
errPtr = assocPtr->firstBgPtr;
Tcl_ListObjGetElements(NULL, copyObj, &prefixObjc, &prefixObjv);
- tempObjv = ckalloc((prefixObjc+2) * sizeof(Tcl_Obj *));
+ tempObjv = (Tcl_Obj**)ckalloc((prefixObjc+2) * sizeof(Tcl_Obj *));
memcpy(tempObjv, prefixObjv, prefixObjc*sizeof(Tcl_Obj *));
tempObjv[prefixObjc] = errPtr->errorMsg;
tempObjv[prefixObjc+1] = errPtr->returnOpts;
@@ -311,7 +311,7 @@ HandleBgErrors(
int
TclDefaultBgErrorHandlerObjCmd(
- ClientData dummy, /* Not used. */
+ void *dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
@@ -320,6 +320,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");
@@ -518,7 +519,7 @@ TclSetBgErrorHandler(
Tcl_Interp *interp,
Tcl_Obj *cmdPrefix)
{
- ErrAssocData *assocPtr = Tcl_GetAssocData(interp, "tclBgError", NULL);
+ ErrAssocData *assocPtr = (ErrAssocData *)Tcl_GetAssocData(interp, "tclBgError", NULL);
if (cmdPrefix == NULL) {
Tcl_Panic("TclSetBgErrorHandler: NULL cmdPrefix argument");
@@ -528,7 +529,7 @@ TclSetBgErrorHandler(
* First access: initialize.
*/
- assocPtr = ckalloc(sizeof(ErrAssocData));
+ assocPtr = (ErrAssocData*)ckalloc(sizeof(ErrAssocData));
assocPtr->interp = interp;
assocPtr->cmdPrefix = NULL;
assocPtr->firstBgPtr = NULL;
@@ -563,14 +564,14 @@ Tcl_Obj *
TclGetBgErrorHandler(
Tcl_Interp *interp)
{
- ErrAssocData *assocPtr = Tcl_GetAssocData(interp, "tclBgError", NULL);
+ ErrAssocData *assocPtr = (ErrAssocData *)Tcl_GetAssocData(interp, "tclBgError", NULL);
if (assocPtr == NULL) {
Tcl_Obj *bgerrorObj;
TclNewLiteralStringObj(bgerrorObj, "::tcl::Bgerror");
TclSetBgErrorHandler(interp, bgerrorObj);
- assocPtr = Tcl_GetAssocData(interp, "tclBgError", NULL);
+ assocPtr = (ErrAssocData *)Tcl_GetAssocData(interp, "tclBgError", NULL);
}
return assocPtr->cmdPrefix;
}
@@ -596,11 +597,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;
@@ -635,9 +637,9 @@ BgErrorDeleteProc(
void
Tcl_CreateExitHandler(
Tcl_ExitProc *proc, /* Function to invoke. */
- ClientData clientData) /* Arbitrary value to pass to proc. */
+ void *clientData) /* Arbitrary value to pass to proc. */
{
- ExitHandler *exitPtr = ckalloc(sizeof(ExitHandler));
+ ExitHandler *exitPtr = (ExitHandler*)ckalloc(sizeof(ExitHandler));
exitPtr->proc = proc;
exitPtr->clientData = clientData;
@@ -668,9 +670,9 @@ Tcl_CreateExitHandler(
void
TclCreateLateExitHandler(
Tcl_ExitProc *proc, /* Function to invoke. */
- ClientData clientData) /* Arbitrary value to pass to proc. */
+ void *clientData) /* Arbitrary value to pass to proc. */
{
- ExitHandler *exitPtr = ckalloc(sizeof(ExitHandler));
+ ExitHandler *exitPtr = (ExitHandler*)ckalloc(sizeof(ExitHandler));
exitPtr->proc = proc;
exitPtr->clientData = clientData;
@@ -701,7 +703,7 @@ TclCreateLateExitHandler(
void
Tcl_DeleteExitHandler(
Tcl_ExitProc *proc, /* Function that was previously registered. */
- ClientData clientData) /* Arbitrary value to pass to proc. */
+ void *clientData) /* Arbitrary value to pass to proc. */
{
ExitHandler *exitPtr, *prevPtr;
@@ -744,7 +746,7 @@ Tcl_DeleteExitHandler(
void
TclDeleteLateExitHandler(
Tcl_ExitProc *proc, /* Function that was previously registered. */
- ClientData clientData) /* Arbitrary value to pass to proc. */
+ void *clientData) /* Arbitrary value to pass to proc. */
{
ExitHandler *exitPtr, *prevPtr;
@@ -787,12 +789,12 @@ TclDeleteLateExitHandler(
void
Tcl_CreateThreadExitHandler(
Tcl_ExitProc *proc, /* Function to invoke. */
- ClientData clientData) /* Arbitrary value to pass to proc. */
+ void *clientData) /* Arbitrary value to pass to proc. */
{
ExitHandler *exitPtr;
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
- exitPtr = ckalloc(sizeof(ExitHandler));
+ exitPtr = (ExitHandler*)ckalloc(sizeof(ExitHandler));
exitPtr->proc = proc;
exitPtr->clientData = clientData;
exitPtr->nextPtr = tsdPtr->firstExitPtr;
@@ -820,7 +822,7 @@ Tcl_CreateThreadExitHandler(
void
Tcl_DeleteThreadExitHandler(
Tcl_ExitProc *proc, /* Function that was previously registered. */
- ClientData clientData) /* Arbitrary value to pass to proc. */
+ void *clientData) /* Arbitrary value to pass to proc. */
{
ExitHandler *exitPtr, *prevPtr;
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
@@ -1296,7 +1298,7 @@ FinalizeThread(
* initialized already.
*/
- tsdPtr = TclThreadDataKeyGet(&dataKey);
+ tsdPtr = (ThreadSpecificData*)TclThreadDataKeyGet(&dataKey);
if (tsdPtr != NULL) {
tsdPtr->inExit = 1;
@@ -1371,7 +1373,7 @@ TclInExit(void)
int
TclInThreadExit(void)
{
- ThreadSpecificData *tsdPtr = TclThreadDataKeyGet(&dataKey);
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)TclThreadDataKeyGet(&dataKey);
if (tsdPtr == NULL) {
return 0;
@@ -1399,13 +1401,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");
@@ -1463,16 +1466,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;
}
@@ -1497,7 +1501,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. */
@@ -1506,6 +1510,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;
@@ -1565,10 +1570,10 @@ Tcl_UpdateObjCmd(
static Tcl_ThreadCreateType
NewThreadProc(
- ClientData clientData)
+ void *clientData)
{
- ThreadClientData *cdPtr = clientData;
- ClientData threadClientData;
+ ThreadClientData *cdPtr = (ThreadClientData *)clientData;
+ void *threadClientData;
Tcl_ThreadCreateProc *threadProc;
threadProc = cdPtr->proc;
@@ -1604,13 +1609,13 @@ int
Tcl_CreateThread(
Tcl_ThreadId *idPtr, /* Return, the ID of the thread */
Tcl_ThreadCreateProc *proc, /* Main() function of the thread */
- ClientData clientData, /* The one argument to Main() */
+ void *clientData, /* The one argument to Main() */
int stackSize, /* Size of stack for the new thread */
int flags) /* Flags controlling behaviour of the new
* thread. */
{
#if TCL_THREADS
- ThreadClientData *cdPtr = ckalloc(sizeof(ThreadClientData));
+ ThreadClientData *cdPtr = (ThreadClientData *)ckalloc(sizeof(ThreadClientData));
int result;
cdPtr->proc = proc;
diff --git a/generic/tclExecute.c b/generic/tclExecute.c
index 0ecdbfa..e757230 100644
--- a/generic/tclExecute.c
+++ b/generic/tclExecute.c
@@ -202,7 +202,7 @@ typedef struct TEBCdata {
#define POP_TAUX_OBJ() \
do { \
tmpPtr = auxObjList; \
- auxObjList = tmpPtr->internalRep.twoPtrValue.ptr1; \
+ auxObjList = (Tcl_Obj *)tmpPtr->internalRep.twoPtrValue.ptr1; \
Tcl_DecrRefCount(tmpPtr); \
} while (0)
@@ -769,11 +769,11 @@ ReleaseDictIterator(
* that we were holding.
*/
- searchPtr = irPtr->twoPtrValue.ptr1;
+ searchPtr = (Tcl_DictSearch *)irPtr->twoPtrValue.ptr1;
Tcl_DictObjDone(searchPtr);
ckfree(searchPtr);
- dictPtr = irPtr->twoPtrValue.ptr2;
+ dictPtr = (Tcl_Obj *)irPtr->twoPtrValue.ptr2;
TclDecrRefCount(dictPtr);
}
@@ -846,8 +846,8 @@ TclCreateExecEnv(
int size) /* The initial stack size, in number of words
* [sizeof(Tcl_Obj*)] */
{
- ExecEnv *eePtr = ckalloc(sizeof(ExecEnv));
- ExecStack *esPtr = ckalloc(sizeof(ExecStack)
+ ExecEnv *eePtr = (ExecEnv *)ckalloc(sizeof(ExecEnv));
+ ExecStack *esPtr = (ExecStack *)ckalloc(sizeof(ExecStack)
+ (size_t) (size-1) * sizeof(Tcl_Obj *));
eePtr->execStackPtr = esPtr;
@@ -1116,7 +1116,7 @@ GrowEvaluationStack(
newBytes = sizeof(ExecStack) + (newElems-1) * sizeof(Tcl_Obj *);
oldPtr = esPtr;
- esPtr = ckalloc(newBytes);
+ esPtr = (ExecStack *)ckalloc(newBytes);
oldPtr->nextPtr = esPtr;
esPtr->prevPtr = oldPtr;
@@ -1361,8 +1361,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) {
@@ -1420,8 +1421,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));
@@ -1709,9 +1710,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) {
@@ -2066,7 +2067,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)
@@ -2078,7 +2079,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 */
@@ -4546,7 +4547,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.
@@ -4574,7 +4575,7 @@ TEBCresume(
CACHE_STACK_INFO();
goto gotError;
}
- contextPtr = framePtr->clientData;
+ contextPtr = (CallContext *)framePtr->clientData;
oPtr = (Object *) Tcl_GetObjectFromObj(interp, valuePtr);
if (oPtr == NULL) {
@@ -4673,7 +4674,7 @@ TEBCresume(
CACHE_STACK_INFO();
goto gotError;
}
- contextPtr = framePtr->clientData;
+ contextPtr = (CallContext *)framePtr->clientData;
newDepth = contextPtr->index + 1;
if (newDepth >= contextPtr->callPtr->numChain) {
@@ -6426,7 +6427,7 @@ TEBCresume(
*/
opnd = TclGetUInt4AtPtr(pc+1);
- infoPtr = codePtr->auxDataArrayPtr[opnd].clientData;
+ infoPtr = (ForeachInfo *)codePtr->auxDataArrayPtr[opnd].clientData;
iterTmpIndex = infoPtr->loopCtTemp;
iterVarPtr = LOCAL(iterTmpIndex);
oldValuePtr = iterVarPtr->value.objPtr;
@@ -6460,7 +6461,7 @@ TEBCresume(
opnd = TclGetUInt4AtPtr(pc+1);
TRACE(("%u => ", opnd));
- infoPtr = codePtr->auxDataArrayPtr[opnd].clientData;
+ infoPtr = (ForeachInfo *)codePtr->auxDataArrayPtr[opnd].clientData;
numLists = infoPtr->numLists;
/*
@@ -6590,7 +6591,7 @@ TEBCresume(
*/
opnd = TclGetUInt4AtPtr(pc+1);
- infoPtr = codePtr->auxDataArrayPtr[opnd].clientData;
+ infoPtr = (ForeachInfo *)codePtr->auxDataArrayPtr[opnd].clientData;
numLists = infoPtr->numLists;
TRACE(("%u => ", opnd));
@@ -6658,7 +6659,7 @@ TEBCresume(
*/
tmpPtr = OBJ_AT_TOS;
- infoPtr = tmpPtr->internalRep.twoPtrValue.ptr1;
+ infoPtr = (ForeachInfo *)tmpPtr->internalRep.twoPtrValue.ptr1;
numLists = infoPtr->numLists;
TRACE(("=> "));
@@ -6742,7 +6743,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);
@@ -6759,7 +6760,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));
@@ -7206,7 +7207,7 @@ TEBCresume(
opnd = TclGetUInt4AtPtr(pc+1);
TRACE(("%u => ", opnd));
dictPtr = POP_OBJECT();
- searchPtr = ckalloc(sizeof(Tcl_DictSearch));
+ searchPtr = (Tcl_DictSearch *)ckalloc(sizeof(Tcl_DictSearch));
if (Tcl_DictObjFirst(interp, dictPtr, searchPtr, &keyPtr,
&valuePtr, &done) != TCL_OK) {
@@ -7248,7 +7249,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!");
@@ -7280,7 +7281,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;
}
@@ -7340,7 +7341,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;
}
@@ -7881,13 +7882,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
@@ -7907,13 +7908,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
@@ -9284,7 +9285,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 8ef0456..bfb5b36 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 834eef7..ee2321d 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 = ckalloc((((*argcPtr) + 1) * sizeof(char *)) + size);
+ *argvPtr = (const char **)ckalloc((((*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 = ckalloc(elemc*sizeof(Tcl_Obj *));
+ Tcl_Obj *ret, **elemv = (Tcl_Obj**)ckalloc(elemc*sizeof(Tcl_Obj *));
elemv[0] = pathPtr;
memcpy(elemv+1, objv, objc*sizeof(Tcl_Obj *));
@@ -1241,6 +1241,7 @@ Tcl_GlobObjCmd(
};
enum pathDirOptions {PATH_NONE = -1 , PATH_GENERAL = 0, PATH_DIR = 1};
Tcl_GlobTypeData *globTypes = NULL;
+ (void)dummy;
globFlags = 0;
join = 0;
@@ -1449,7 +1450,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;
@@ -2522,7 +2523,7 @@ DoGlob(
Tcl_StatBuf *
Tcl_AllocStatBuf(void)
{
- return ckalloc(sizeof(Tcl_StatBuf));
+ return (Tcl_StatBuf *)ckalloc(sizeof(Tcl_StatBuf));
}
/*
@@ -2640,6 +2641,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 3b6134c..faa8b69 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((int)
- 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 9ea8807..10e3027 100644
--- a/generic/tclHash.c
+++ b/generic/tclHash.c
@@ -219,7 +219,7 @@ Tcl_FindHashEntry(
Tcl_HashTable *tablePtr, /* Table in which to lookup entry. */
const void *key) /* Key to use to find matching entry. */
{
- return (*((tablePtr)->findProc))(tablePtr, key);
+ return (*((tablePtr)->findProc))(tablePtr, (const char *)key);
}
static Tcl_HashEntry *
@@ -260,7 +260,7 @@ Tcl_CreateHashEntry(
int *newPtr) /* Store info here telling whether a new entry
* was created. */
{
- return (*((tablePtr)->createProc))(tablePtr, key, newPtr);
+ return (*((tablePtr)->createProc))(tablePtr, (const char *)key, newPtr);
}
static Tcl_HashEntry *
@@ -348,7 +348,7 @@ CreateHashEntry(
if (typePtr->allocEntryProc) {
hPtr = typePtr->allocEntryProc(tablePtr, (void *) key);
} else {
- hPtr = ckalloc(sizeof(Tcl_HashEntry));
+ hPtr = (Tcl_HashEntry *)ckalloc(sizeof(Tcl_HashEntry));
hPtr->key.oneWordValue = (char *) key;
hPtr->clientData = 0;
}
@@ -648,7 +648,7 @@ Tcl_HashStats(
* Print out the histogram and a few other pieces of information.
*/
- result = ckalloc((NUM_COUNTERS * 60) + 300);
+ result = (char *)ckalloc((NUM_COUNTERS * 60) + 300);
sprintf(result, "%d entries in table, %d buckets\n",
tablePtr->numEntries, tablePtr->numBuckets);
p = result + strlen(result);
@@ -697,7 +697,7 @@ AllocArrayEntry(
if (size < sizeof(Tcl_HashEntry)) {
size = sizeof(Tcl_HashEntry);
}
- hPtr = ckalloc(size);
+ hPtr = (Tcl_HashEntry *)ckalloc(size);
for (iPtr1 = array, iPtr2 = hPtr->key.words;
count > 0; count--, iPtr1++, iPtr2++) {
@@ -770,14 +770,14 @@ HashArrayKey(
void *keyPtr) /* Key from which to compute hash value. */
{
const int *array = (const int *) keyPtr;
- unsigned int result;
+ TCL_HASH_TYPE result;
int count;
for (result = 0, count = tablePtr->keyType; count > 0;
count--, array++) {
result += *array;
}
- return (TCL_HASH_TYPE) result;
+ return result;
}
/*
@@ -803,13 +803,14 @@ AllocStringEntry(
{
const char *string = (const char *) keyPtr;
Tcl_HashEntry *hPtr;
- unsigned int size, allocsize;
+ size_t size, allocsize;
+ (void)tablePtr;
allocsize = size = strlen(string) + 1;
if (size < sizeof(hPtr->key)) {
allocsize = sizeof(hPtr->key);
}
- hPtr = ckalloc(offsetof(Tcl_HashEntry, key) + allocsize);
+ hPtr = (Tcl_HashEntry *)ckalloc(offsetof(Tcl_HashEntry, key) + allocsize);
memset(hPtr, 0, sizeof(Tcl_HashEntry) + allocsize - sizeof(hPtr->key));
memcpy(hPtr->key.string, string, size);
hPtr->clientData = 0;
@@ -866,9 +867,10 @@ HashStringKey(
Tcl_HashTable *tablePtr, /* Hash table. */
void *keyPtr) /* Key from which to compute hash value. */
{
- const char *string = keyPtr;
- unsigned int result;
+ 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
@@ -907,7 +909,7 @@ HashStringKey(
result += (result << 3) + UCHAR(c);
}
}
- return (TCL_HASH_TYPE) result;
+ return result;
}
/*
@@ -933,6 +935,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;
}
@@ -963,6 +967,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;
}
@@ -1023,7 +1030,7 @@ RebuildTable(
tablePtr->numBuckets * sizeof(Tcl_HashEntry *), 0);
} else {
tablePtr->buckets =
- ckalloc(tablePtr->numBuckets * sizeof(Tcl_HashEntry *));
+ (Tcl_HashEntry **)ckalloc(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 46e6989..5408432 100644
--- a/generic/tclHistory.c
+++ b/generic/tclHistory.c
@@ -130,14 +130,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 = ckalloc(sizeof(HistoryObjs));
+ histObjsPtr = (HistoryObjs *)ckalloc(sizeof(HistoryObjs));
TclNewLiteralStringObj(histObjsPtr->historyObj, "::history");
TclNewLiteralStringObj(histObjsPtr->addObj, "add");
Tcl_IncrRefCount(histObjsPtr->historyObj);
@@ -211,9 +211,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 78a0f2d..f8bd819 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 = ckalloc(sizeof(CloseCallback));
+ cbPtr = (CloseCallback *)ckalloc(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 = ckalloc(sizeof(Tcl_HashTable));
+ hTblPtr = (Tcl_HashTable *)ckalloc(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 = ckalloc(sizeof(Channel));
- statePtr = ckalloc(sizeof(ChannelState));
+ chanPtr = (Channel *)ckalloc(sizeof(Channel));
+ statePtr = (ChannelState *)ckalloc(sizeof(ChannelState));
chanPtr->state = statePtr;
chanPtr->instanceData = instanceData;
@@ -1666,10 +1667,10 @@ Tcl_CreateChannel(
* later.
*/
- tmp = ckalloc((len < 7) ? 7 : len);
+ tmp = (char *)ckalloc((len < 7) ? 7 : len);
strcpy(tmp, chanName);
} else {
- tmp = ckalloc(7);
+ tmp = (char *)ckalloc(7);
tmp[0] = '\0';
}
statePtr->channelName = tmp;
@@ -1942,7 +1943,7 @@ Tcl_StackChannel(
statePtr->inQueueTail = NULL;
}
- chanPtr = ckalloc(sizeof(Channel));
+ chanPtr = (Channel *)ckalloc(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 = ckalloc(n);
+ bufPtr = (ChannelBuffer *)ckalloc(n);
bufPtr->nextAdded = BUFFER_PADDING;
bufPtr->nextRemoved = BUFFER_PADDING;
bufPtr->bufLength = length + BUFFER_PADDING;
@@ -4298,7 +4299,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) {
@@ -4396,7 +4397,7 @@ Write(
total += dstWrote;
dst += dstWrote;
dstLen -= dstWrote;
- nextNewLine = memchr(src, '\n', srcLen);
+ nextNewLine = (char *)memchr(src, '\n', srcLen);
needNlFlush = 1;
}
@@ -5198,6 +5199,7 @@ FreeBinaryEncoding(
ClientData dummy) /* Not used */
{
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
+ (void)dummy;
if (tsdPtr->binaryEncoding != NULL) {
Tcl_FreeEncoding(tsdPtr->binaryEncoding);
@@ -5206,7 +5208,7 @@ FreeBinaryEncoding(
}
static Tcl_Encoding
-GetBinaryEncoding()
+GetBinaryEncoding(void)
{
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
@@ -6503,7 +6505,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;
}
}
@@ -6518,7 +6520,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';
}
}
@@ -6529,7 +6531,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);
@@ -6569,7 +6571,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);
@@ -8541,7 +8543,7 @@ static void
ChannelTimerProc(
ClientData clientData)
{
- Channel *chanPtr = clientData;
+ Channel *chanPtr = (Channel *)clientData;
ChannelState *statePtr = chanPtr->state;
/* State info for channel */
@@ -8629,7 +8631,7 @@ Tcl_CreateChannelHandler(
}
}
if (chPtr == NULL) {
- chPtr = ckalloc(sizeof(ChannelHandler));
+ chPtr = (ChannelHandler *)ckalloc(sizeof(ChannelHandler));
chPtr->mask = 0;
chPtr->proc = proc;
chPtr->clientData = clientData;
@@ -8841,7 +8843,7 @@ CreateScriptRecord(
makeCH = (esPtr == NULL);
if (makeCH) {
- esPtr = ckalloc(sizeof(EventScriptRecord));
+ esPtr = (EventScriptRecord *)ckalloc(sizeof(EventScriptRecord));
}
/*
@@ -8897,7 +8899,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;
@@ -8952,7 +8954,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. */
@@ -8966,6 +8968,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?");
@@ -9051,7 +9054,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);
}
/*
@@ -9171,7 +9174,7 @@ TclCopyChannel(
* completed.
*/
- csPtr = ckalloc(sizeof(CopyState) + !moveBytes * inStatePtr->bufSize);
+ csPtr = (CopyState *)ckalloc(sizeof(CopyState) + !moveBytes * inStatePtr->bufSize);
csPtr->bufSize = !moveBytes * inStatePtr->bufSize;
csPtr->readPtr = inPtr;
csPtr->writePtr = outPtr;
@@ -10029,7 +10032,7 @@ CopyEventProc(
ClientData clientData,
int mask)
{
- (void) CopyData(clientData, mask);
+ (void) CopyData((CopyState *)clientData, mask);
}
/*
@@ -10362,7 +10365,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;
}
@@ -11036,7 +11039,7 @@ FixLevelCode(
lcn += 2;
}
- lvn = ckalloc(lcn * sizeof(Tcl_Obj *));
+ lvn = (Tcl_Obj **)ckalloc(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 af276eb..70206be 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] */
@@ -237,6 +239,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");
@@ -304,6 +307,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?");
@@ -390,6 +394,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;
@@ -523,7 +528,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. */
@@ -537,6 +542,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?");
@@ -599,7 +605,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. */
@@ -607,6 +613,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");
@@ -662,7 +669,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. */
@@ -672,6 +679,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?");
@@ -771,7 +779,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. */
@@ -779,6 +787,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 ...?");
@@ -847,12 +856,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");
@@ -905,6 +915,7 @@ Tcl_ExecObjCmd(
enum options {
EXEC_IGNORESTDERR, EXEC_KEEPNEWLINE, EXEC_LAST
};
+ (void)dummy;
/*
* Check for any leading option arguments.
@@ -952,7 +963,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
@@ -1055,13 +1066,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");
@@ -1102,7 +1114,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. */
@@ -1110,6 +1122,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?");
@@ -1228,15 +1241,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;
}
@@ -1278,10 +1292,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 = ckalloc(sizeof(Tcl_HashTable));
+ hTblPtr = (Tcl_HashTable *)ckalloc(sizeof(Tcl_HashTable));
Tcl_InitHashTable(hTblPtr, TCL_ONE_WORD_KEYS);
Tcl_SetAssocData(interp, "tclTCPAcceptCallbacks",
TcpAcceptCallbacksDeleteProc, hTblPtr);
@@ -1324,7 +1338,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;
}
@@ -1362,7 +1376,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
@@ -1448,7 +1462,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) {
@@ -1478,7 +1492,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. */
@@ -1497,6 +1511,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;
@@ -1652,7 +1667,7 @@ Tcl_SocketObjCmd(
port = TclGetString(objv[a]);
if (server) {
- AcceptCallback *acceptCallbackPtr = ckalloc(sizeof(AcceptCallback));
+ AcceptCallback *acceptCallbackPtr = (AcceptCallback *)ckalloc(sizeof(AcceptCallback));
Tcl_IncrRefCount(script);
acceptCallbackPtr->script = script;
@@ -1731,6 +1746,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,
@@ -1816,7 +1832,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. */
@@ -1825,6 +1841,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");
@@ -1885,6 +1902,7 @@ ChanTruncateObjCmd(
{
Tcl_Channel chan;
Tcl_WideInt length;
+ (void)dummy;
if ((objc < 2) || (objc > 3)) {
Tcl_WrongNumArgs(interp, 1, objv, "channelId ?length?");
@@ -1959,6 +1977,7 @@ ChanPipeObjCmd(
Tcl_Channel rchan, wchan;
const char *channelNames[2];
Tcl_Obj *resultPtr;
+ (void)dummy;
if (objc != 1) {
Tcl_WrongNumArgs(interp, 1, objv, "");
@@ -2002,11 +2021,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 9949a0e..3dac585 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 = ckalloc(sizeof(TransformChannelData));
+ dataPtr = (TransformChannelData *)ckalloc(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 = ckalloc(r->allocated);
+ r->buf = (unsigned char *)ckalloc(r->allocated);
} else {
r->allocated += toWrite + INCREMENT;
- r->buf = ckrealloc(r->buf, r->allocated);
+ r->buf = (unsigned char *)ckrealloc(r->buf, r->allocated);
}
}
diff --git a/generic/tclIORChan.c b/generic/tclIORChan.c
index 1d90def..ee47ab3 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 = ckalloc(sizeof(Tcl_ChannelType));
+ Tcl_ChannelType *clonePtr = (Tcl_ChannelType *)ckalloc(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 = ckalloc(sizeof(ReflectEvent));
+ ReflectEvent *ev = (ReflectEvent *)ckalloc(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;
int bytec; /* 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 = ckalloc(sizeof(ReflectedChannel));
+ rcPtr = (ReflectedChannel *)ckalloc(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 = ckalloc(sizeof(ReflectedChannelMap));
+ rcmPtr = (ReflectedChannelMap *)ckalloc(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 = ckalloc(sizeof(ReflectedChannelMap));
+ tsdPtr->rcmPtr = (ReflectedChannelMap *)ckalloc(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 = ckalloc(sizeof(ForwardingEvent));
- resultPtr = ckalloc(sizeof(ForwardingResult));
+ evPtr = (ForwardingEvent *)ckalloc(sizeof(ForwardingEvent));
+ resultPtr = (ForwardingResult *)ckalloc(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 = ckalloc(200);
+ char *buf = (char *)ckalloc(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 9d5e4b4..5ef409e 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 = ckalloc(sizeof(ReflectedTransform));
+ rtPtr = (ReflectedTransform *)ckalloc(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 = ckalloc(sizeof(Tcl_Obj *) * (listc+4));
+ rtPtr->argv = (Tcl_Obj **)ckalloc(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 = ckalloc(sizeof(ReflectedTransformMap));
+ rtmPtr = (ReflectedTransformMap *)ckalloc(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 = ckalloc(sizeof(ReflectedTransformMap));
+ tsdPtr->rtmPtr = (ReflectedTransformMap *)ckalloc(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 = ckalloc(sizeof(ForwardingEvent));
- resultPtr = ckalloc(sizeof(ForwardingResult));
+ evPtr = (ForwardingEvent *)ckalloc(sizeof(ForwardingEvent));
+ resultPtr = (ForwardingResult *)ckalloc(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 = ckalloc(bytec);
+ paramPtr->transform.buf = (char *)ckalloc(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 = ckalloc(bytec);
+ paramPtr->transform.buf = (char *)ckalloc(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 = ckalloc(bytec);
+ paramPtr->transform.buf = (char *)ckalloc(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 = ckalloc(bytec);
+ paramPtr->transform.buf = (char *)ckalloc(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 622fec6..6179637 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 = ckalloc(sizeof(FilesystemRecord));
+ tmpFsRecPtr = (FilesystemRecord *)ckalloc(sizeof(FilesystemRecord));
*tmpFsRecPtr = *fsRecPtr;
tmpFsRecPtr->nextPtr = list;
tmpFsRecPtr->prevPtr = NULL;
@@ -853,7 +852,7 @@ Tcl_FSRegister(
return TCL_ERROR;
}
- newFilesystemPtr = ckalloc(sizeof(FilesystemRecord));
+ newFilesystemPtr = (FilesystemRecord *)ckalloc(sizeof(FilesystemRecord));
newFilesystemPtr->clientData = clientData;
newFilesystemPtr->fsPtr = fsPtr;
@@ -1933,9 +1932,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
@@ -2318,6 +2317,8 @@ NativeFileAttrStrings(
Tcl_Obj *pathPtr,
Tcl_Obj **objPtrRef)
{
+ (void)pathPtr;
+ (void)objPtrRef;
return tclpFileAttrStrings;
}
@@ -3026,6 +3027,7 @@ Tcl_FSLoadFile(
const char *symbols[3];
void *procPtrs[2];
int res;
+ (void)unloadProcPtr;
symbols[0] = sym1;
symbols[1] = sym2;
@@ -3101,6 +3103,7 @@ skipUnlink(
#ifdef hpux
+ (void)shlibFile;
return 1;
#else
char *skipstr = getenv("TCL_TEMPLOAD_NO_UNLINK");
@@ -3109,7 +3112,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.
*/
@@ -3245,7 +3250,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);
@@ -3360,7 +3365,7 @@ Tcl_LoadFile(
* Divert the unloading in order to unload and cleanup the temporary file.
*/
- tvdlPtr = ckalloc(sizeof(FsDivertLoad));
+ tvdlPtr = (FsDivertLoad *)ckalloc(sizeof(FsDivertLoad));
/*
* Remember three pieces of information in order to clean up the diverted
@@ -3401,7 +3406,7 @@ Tcl_LoadFile(
copyToPtr = NULL;
- divertedLoadHandle = ckalloc(sizeof(struct Tcl_LoadHandle_));
+ divertedLoadHandle = (Tcl_LoadHandle)ckalloc(sizeof(struct Tcl_LoadHandle_));
divertedLoadHandle->clientData = tvdlPtr;
divertedLoadHandle->findSymbolProcPtr = DivertFindSymbol;
divertedLoadHandle->unloadFileProcPtr = DivertUnloadFile;
@@ -4684,6 +4689,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 e7c3b46..18d7a55 100644
--- a/generic/tclIndexObj.c
+++ b/generic/tclIndexObj.c
@@ -126,7 +126,7 @@ Tcl_GetIndexFromObj(
const Tcl_ObjIntRep *irPtr = TclFetchIntRep(objPtr, &indexType);
if (irPtr) {
- IndexRep *indexRep = irPtr->twoPtrValue.ptr1;
+ IndexRep *indexRep = (IndexRep *)irPtr->twoPtrValue.ptr1;
/*
* Here's hoping we don't get hit by unfortunate packing constraints
@@ -200,7 +200,7 @@ GetIndexFromObjList(
* Build a string table from the list.
*/
- tablePtr = ckalloc((objc + 1) * sizeof(char *));
+ tablePtr = (const char **)ckalloc((objc + 1) * sizeof(char *));
for (t = 0; t < objc; t++) {
if (objv[t] == objPtr) {
/*
@@ -284,7 +284,7 @@ Tcl_GetIndexFromObjStruct(
if (!(flags & INDEX_TEMP_TABLE)) {
irPtr = TclFetchIntRep(objPtr, &indexType);
if (irPtr) {
- indexRep = irPtr->twoPtrValue.ptr1;
+ indexRep = (IndexRep *)irPtr->twoPtrValue.ptr1;
if (indexRep->tablePtr==tablePtr && indexRep->offset==offset) {
*indexPtr = indexRep->index;
return TCL_OK;
@@ -308,7 +308,7 @@ Tcl_GetIndexFromObjStruct(
* - Several abbreviations (never allowed, but overridden by exact match)
*/
- for (entryPtr = tablePtr, idx = 0; *entryPtr != NULL;
+ for (entryPtr = (const char* const*)tablePtr, idx = 0; *entryPtr != NULL;
entryPtr = NEXT_ENTRY(entryPtr, offset), idx++) {
for (p1 = key, p2 = *entryPtr; *p1 == *p2; p1++, p2++) {
if (*p1 == '\0') {
@@ -348,11 +348,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 = ckalloc(sizeof(IndexRep));
+ indexRep = (IndexRep*)ckalloc(sizeof(IndexRep));
ir.twoPtrValue.ptr1 = indexRep;
Tcl_StoreIntRep(objPtr, &indexType, &ir);
}
@@ -373,7 +373,7 @@ Tcl_GetIndexFromObjStruct(
int count = 0;
TclNewObj(resultPtr);
- entryPtr = tablePtr;
+ entryPtr = (const char* const *)tablePtr;
while ((*entryPtr != NULL) && !**entryPtr) {
entryPtr = NEXT_ENTRY(entryPtr, offset);
}
@@ -428,6 +428,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",
@@ -457,7 +458,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));
@@ -487,7 +488,7 @@ DupIndex(
Tcl_Obj *dupPtr)
{
Tcl_ObjIntRep ir;
- IndexRep *dupIndexRep = ckalloc(sizeof(IndexRep));
+ IndexRep *dupIndexRep = (IndexRep *)ckalloc(sizeof(IndexRep));
memcpy(dupIndexRep, TclFetchIntRep(srcPtr, &indexType)->twoPtrValue.ptr1,
sizeof(IndexRep));
@@ -574,7 +575,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. */
@@ -590,6 +591,7 @@ PrefixMatchObjCmd(
enum matchOptions {
PRFMATCH_ERROR, PRFMATCH_EXACT, PRFMATCH_MESSAGE
};
+ (void)dummy;
if (objc < 3) {
Tcl_WrongNumArgs(interp, 1, objv, "?options? table string");
@@ -698,7 +700,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. */
@@ -706,6 +708,7 @@ PrefixAllObjCmd(
int tableObjc, result, t, length, elemLength;
const char *string, *elemString;
Tcl_Obj **tableObjv, *resultPtr;
+ (void)dummy;
if (objc != 3) {
Tcl_WrongNumArgs(interp, 1, objv, "table string");
@@ -755,7 +758,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. */
@@ -763,6 +766,7 @@ PrefixLongestObjCmd(
int tableObjc, result, i, t, length, elemLength, resultLength;
const char *string, *elemString, *resultString;
Tcl_Obj **tableObjv;
+ (void)dummy;
if (objc != 3) {
Tcl_WrongNumArgs(interp, 1, objv, "table string");
@@ -967,7 +971,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);
@@ -978,7 +982,7 @@ Tcl_WrongNumArgs(
len = TclScanElement(elementStr, elemLen, &flags);
if (MAY_QUOTE_WORD && len != elemLen) {
- char *quotedElementStr = TclStackAlloc(interp, len + 1);
+ char *quotedElementStr = (char *)TclStackAlloc(interp, len + 1);
len = TclConvertElement(elementStr, elemLen,
quotedElementStr, flags);
@@ -1016,7 +1020,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 {
@@ -1029,7 +1033,7 @@ Tcl_WrongNumArgs(
len = TclScanElement(elementStr, elemLen, &flags);
if (MAY_QUOTE_WORD && len != elemLen) {
- char *quotedElementStr = TclStackAlloc(interp, len + 1);
+ char *quotedElementStr = (char *)TclStackAlloc(interp, len + 1);
len = TclConvertElement(elementStr, elemLen,
quotedElementStr, flags);
@@ -1135,7 +1139,7 @@ Tcl_ParseArgsObjv(
*/
nrem = 1;
- leftovers = ckalloc((1 + *objcPtr) * sizeof(Tcl_Obj *));
+ leftovers = (Tcl_Obj **)ckalloc((1 + *objcPtr) * sizeof(Tcl_Obj *));
leftovers[0] = objv[0];
} else {
nrem = 0;
@@ -1319,7 +1323,7 @@ Tcl_ParseArgsObjv(
}
leftovers[nrem] = NULL;
*objcPtr = nrem++;
- *remObjv = ckrealloc(leftovers, nrem * sizeof(Tcl_Obj *));
+ *remObjv = (Tcl_Obj **)ckrealloc(leftovers, nrem * sizeof(Tcl_Obj *));
return TCL_OK;
/*
diff --git a/generic/tclInt.h b/generic/tclInt.h
index cddc8ab..6704789 100644
--- a/generic/tclInt.h
+++ b/generic/tclInt.h
@@ -4332,7 +4332,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)
@@ -4494,6 +4494,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).
@@ -4523,7 +4538,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; \
@@ -4971,7 +4986,7 @@ MODULE_SCOPE Tcl_PackageInitProc Procbodytest_SafeInit;
TCL_CT_ASSERT((nbytes)<=sizeof(Tcl_Obj)); \
TclIncrObjsAllocated(); \
TclAllocObjStorageEx((interp), (_objPtr)); \
- memPtr = (ClientData) (_objPtr); \
+ *(void **)&memPtr = (void *) (_objPtr); \
} while (0)
#define TclSmallFreeEx(interp, memPtr) \
@@ -4986,7 +5001,7 @@ MODULE_SCOPE Tcl_PackageInitProc Procbodytest_SafeInit;
Tcl_Obj *_objPtr; \
TCL_CT_ASSERT((nbytes)<=sizeof(Tcl_Obj)); \
TclNewObj(_objPtr); \
- memPtr = (ClientData) _objPtr; \
+ *(void **)memPtr = (void *) _objPtr; \
} while (0)
#define TclSmallFreeEx(interp, memPtr) \
diff --git a/generic/tclInterp.c b/generic/tclInterp.c
index 7d1dd0d..0d53476 100644
--- a/generic/tclInterp.c
+++ b/generic/tclInterp.c
@@ -336,7 +336,7 @@ Tcl_Init(
Tcl_Interp *interp) /* Interpreter to initialize. */
{
PkgName pkgName = {NULL, "Tcl"};
- PkgName **names = TclInitPkgFiles(interp);
+ PkgName **names = (PkgName **)TclInitPkgFiles(interp);
int result = TCL_ERROR;
pkgName.nextPtr = *names;
@@ -485,7 +485,7 @@ TclInterpInit(
Master *masterPtr;
Slave *slavePtr;
- interpInfoPtr = ckalloc(sizeof(InterpInfo));
+ interpInfoPtr = (InterpInfo *)ckalloc(sizeof(InterpInfo));
((Interp *) interp)->interpInfo = interpInfoPtr;
masterPtr = &interpInfoPtr->master;
@@ -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 = ckalloc(sizeof(Alias) + objc * sizeof(Tcl_Obj *));
+ aliasPtr = (Alias *)ckalloc(sizeof(Alias) + objc * sizeof(Tcl_Obj *));
aliasPtr->token = namePtr;
Tcl_IncrRefCount(aliasPtr->token);
aliasPtr->targetInterp = masterInterp;
@@ -1628,7 +1628,7 @@ AliasCreate(
* interp alias {} foo {} zop # Now recreate "foo"...
*/
- targetPtr = ckalloc(sizeof(Target));
+ targetPtr = (Target *)ckalloc(sizeof(Target));
targetPtr->slaveCmd = aliasPtr->slaveCmd;
targetPtr->slaveInterp = slaveInterp;
@@ -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 = ckalloc(sizeof(LimitHandler));
+ handlerPtr = (LimitHandler *)ckalloc(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 = ckalloc(sizeof(ScriptLimitCallback));
+ limitCBPtr = (ScriptLimitCallback *)ckalloc(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);
}
@@ -4693,7 +4693,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);
@@ -4741,7 +4741,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 35f1cee..9ed7f51 100644
--- a/generic/tclLink.c
+++ b/generic/tclLink.c
@@ -171,7 +171,7 @@ Tcl_LinkVar(
return TCL_ERROR;
}
- linkPtr = ckalloc(sizeof(Link));
+ linkPtr = (Link *)ckalloc(sizeof(Link));
linkPtr->interp = interp;
linkPtr->nsPtr = NULL;
linkPtr->varName = Tcl_NewStringObj(varName, -1);
@@ -259,7 +259,7 @@ Tcl_LinkArray(
return TCL_ERROR;
}
- linkPtr = ckalloc(sizeof(Link));
+ linkPtr = (Link *)ckalloc(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)
{
const char *str;
const char *endPtr;
+ (void)dummy;
str = TclGetString(objPtr);
if ((objPtr->length == 1) && (str[0] == '.')) {
@@ -749,7 +750,7 @@ LinkTraceProc(
const char *name2, /* Second part of variable name. */
int flags) /* Miscellaneous additional information. */
{
- Link *linkPtr = clientData;
+ Link *linkPtr = (Link *)clientData;
int changed;
int valueLength;
const char *value;
@@ -762,6 +763,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(
valueLength = valueObj->length + 1;
pp = (char **) linkPtr->addr;
- *pp = ckrealloc(*pp, valueLength);
+ *pp = (char *)ckrealloc(*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 = ckalloc(linkPtr->numElems * sizeof(Tcl_Obj *));
+ objv = (Tcl_Obj **)ckalloc(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 = ckalloc(linkPtr->numElems * sizeof(Tcl_Obj *));
+ objv = (Tcl_Obj **)ckalloc(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 = ckalloc(linkPtr->numElems * sizeof(Tcl_Obj *));
+ objv = (Tcl_Obj **)ckalloc(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 = ckalloc(linkPtr->numElems * sizeof(Tcl_Obj *));
+ objv = (Tcl_Obj **)ckalloc(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 = ckalloc(linkPtr->numElems * sizeof(Tcl_Obj *));
+ objv = (Tcl_Obj **)ckalloc(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 = ckalloc(linkPtr->numElems * sizeof(Tcl_Obj *));
+ objv = (Tcl_Obj **)ckalloc(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 = ckalloc(linkPtr->numElems * sizeof(Tcl_Obj *));
+ objv = (Tcl_Obj **)ckalloc(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 = ckalloc(linkPtr->numElems * sizeof(Tcl_Obj *));
+ objv = (Tcl_Obj **)ckalloc(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 = ckalloc(linkPtr->numElems * sizeof(Tcl_Obj *));
+ objv = (Tcl_Obj **)ckalloc(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 = ckalloc(linkPtr->numElems * sizeof(Tcl_Obj *));
+ objv = (Tcl_Obj **)ckalloc(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 = ckalloc(linkPtr->numElems * sizeof(Tcl_Obj *));
+ objv = (Tcl_Obj **)ckalloc(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 = ckalloc(linkPtr->numElems * sizeof(Tcl_Obj *));
+ objv = (Tcl_Obj **)ckalloc(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 = ckalloc(linkPtr->numElems * sizeof(Tcl_Obj *));
+ objv = (Tcl_Obj **)ckalloc(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 d4dec9b..bae6452 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) \
@@ -122,7 +122,7 @@ NewListIntRep(
return NULL;
}
- listRepPtr = attemptckalloc(LIST_SIZE(objc));
+ listRepPtr = (List *)attemptckalloc(LIST_SIZE(objc));
if (listRepPtr == NULL) {
if (p) {
Tcl_Panic("list creation failed: unable to alloc %u bytes",
@@ -341,6 +341,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 */
@@ -718,18 +720,18 @@ Tcl_ListObjAppendElement(
attempt = 2 * numRequired;
if (attempt <= LIST_MAX) {
- newPtr = attemptckrealloc(listRepPtr, LIST_SIZE(attempt));
+ newPtr = (List *)attemptckrealloc(listRepPtr, LIST_SIZE(attempt));
}
if (newPtr == NULL) {
attempt = numRequired + 1 + TCL_MIN_ELEMENT_GROWTH;
if (attempt > LIST_MAX) {
attempt = LIST_MAX;
}
- newPtr = attemptckrealloc(listRepPtr, LIST_SIZE(attempt));
+ newPtr = (List *)attemptckrealloc(listRepPtr, LIST_SIZE(attempt));
}
if (newPtr == NULL) {
attempt = numRequired;
- newPtr = attemptckrealloc(listRepPtr, LIST_SIZE(attempt));
+ newPtr = (List *)attemptckrealloc(listRepPtr, LIST_SIZE(attempt));
}
if (newPtr) {
listRepPtr = newPtr;
@@ -1047,18 +1049,18 @@ Tcl_ListObjReplace(
List *newPtr = NULL;
int attempt = 2 * numRequired;
if (attempt <= LIST_MAX) {
- newPtr = attemptckrealloc(listRepPtr, LIST_SIZE(attempt));
+ newPtr = (List *)attemptckrealloc(listRepPtr, LIST_SIZE(attempt));
}
if (newPtr == NULL) {
attempt = numRequired + 1 + TCL_MIN_ELEMENT_GROWTH;
if (attempt > LIST_MAX) {
attempt = LIST_MAX;
}
- newPtr = attemptckrealloc(listRepPtr, LIST_SIZE(attempt));
+ newPtr = (List *)attemptckrealloc(listRepPtr, LIST_SIZE(attempt));
}
if (newPtr == NULL) {
attempt = numRequired;
- newPtr = attemptckrealloc(listRepPtr, LIST_SIZE(attempt));
+ newPtr = (List *)attemptckrealloc(listRepPtr, LIST_SIZE(attempt));
}
if (newPtr) {
listRepPtr = newPtr;
@@ -1689,8 +1691,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) {
@@ -2171,7 +2173,7 @@ UpdateStringOfList(
* We know numElems <= LIST_MAX, so this is safe.
*/
- flagPtr = ckalloc(numElems);
+ flagPtr = (char *)ckalloc(numElems);
}
elemPtrs = &listRepPtr->elements;
for (i = 0; i < numElems; i++) {
diff --git a/generic/tclLiteral.c b/generic/tclLiteral.c
index 5982cc8..eb76884 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 = ckalloc(sizeof(LiteralEntry));
+ globalPtr = (LiteralEntry *)ckalloc(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;
@@ -758,14 +760,14 @@ ExpandLocalLiteralArray(
}
if (envPtr->mallocedLiteralArray) {
- newArrayPtr = ckrealloc(currArrayPtr, newSize);
+ newArrayPtr = (LiteralEntry *)ckrealloc(currArrayPtr, newSize);
} else {
/*
* envPtr->literalArrayPtr isn't a ckalloc'd pointer, so we must
* code a ckrealloc equivalent for ourselves.
*/
- newArrayPtr = ckalloc(newSize);
+ newArrayPtr = (LiteralEntry *)ckalloc(newSize);
memcpy(newArrayPtr, currArrayPtr, currBytes);
envPtr->mallocedLiteralArray = 1;
}
@@ -992,7 +994,7 @@ RebuildLiteralTable(
}
tablePtr->numBuckets *= 4;
- tablePtr->buckets = ckalloc(tablePtr->numBuckets * sizeof(LiteralEntry*));
+ tablePtr->buckets = (LiteralEntry **)ckalloc(tablePtr->numBuckets * sizeof(LiteralEntry*));
for (count=tablePtr->numBuckets, newChainPtr=tablePtr->buckets;
count>0 ; count--, newChainPtr++) {
*newChainPtr = NULL;
@@ -1130,7 +1132,7 @@ TclLiteralStats(
* Print out the histogram and a few other pieces of information.
*/
- result = ckalloc(NUM_COUNTERS*60 + 300);
+ result = (char *)ckalloc(NUM_COUNTERS*60 + 300);
sprintf(result, "%d entries in table, %d buckets\n",
tablePtr->numEntries, tablePtr->numBuckets);
p = result + strlen(result);
diff --git a/generic/tclLoad.c b/generic/tclLoad.c
index c5ac35c..d690902 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 = ckalloc(sizeof(LoadedPackage));
+ pkgPtr = (LoadedPackage *)ckalloc(sizeof(LoadedPackage));
len = strlen(fullFileName) + 1;
- pkgPtr->fileName = ckalloc(len);
+ pkgPtr->fileName = (char *)ckalloc(len);
memcpy(pkgPtr->fileName, fullFileName, len);
len = Tcl_DStringLength(&pkgName) + 1;
- pkgPtr->packageName = ckalloc(len);
+ pkgPtr->packageName = (char *)ckalloc(len);
memcpy(pkgPtr->packageName, Tcl_DStringValue(&pkgName), len);
pkgPtr->loadHandle = loadHandle;
pkgPtr->initProc = initProc;
@@ -507,8 +508,8 @@ Tcl_LoadObjCmd(
* static packages at the head of the linked list!
*/
- ipFirstPtr = Tcl_GetAssocData(target, "tclLoad", NULL);
- ipPtr = ckalloc(sizeof(InterpPackage));
+ ipFirstPtr = (InterpPackage *)Tcl_GetAssocData(target, "tclLoad", NULL);
+ ipPtr = (InterpPackage *)ckalloc(sizeof(InterpPackage));
ipPtr->pkgPtr = pkgPtr;
ipPtr->nextPtr = ipFirstPtr;
Tcl_SetAssocData(target, "tclLoad", LoadCleanupProc, ipPtr);
@@ -562,6 +563,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,
@@ -720,7 +722,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;
@@ -875,7 +877,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;
@@ -982,10 +984,10 @@ Tcl_StaticPackage(
*/
if (pkgPtr == NULL) {
- pkgPtr = ckalloc(sizeof(LoadedPackage));
- pkgPtr->fileName = ckalloc(1);
+ pkgPtr = (LoadedPackage *)ckalloc(sizeof(LoadedPackage));
+ pkgPtr->fileName = (char *)ckalloc(1);
pkgPtr->fileName[0] = 0;
- pkgPtr->packageName = ckalloc(strlen(pkgName) + 1);
+ pkgPtr->packageName = (char *)ckalloc(strlen(pkgName) + 1);
strcpy(pkgPtr->packageName, pkgName);
pkgPtr->loadHandle = NULL;
pkgPtr->initProc = initProc;
@@ -1003,7 +1005,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;
@@ -1015,7 +1017,7 @@ Tcl_StaticPackage(
* loaded.
*/
- ipPtr = ckalloc(sizeof(InterpPackage));
+ ipPtr = (InterpPackage *)ckalloc(sizeof(InterpPackage));
ipPtr->pkgPtr = pkgPtr;
ipPtr->nextPtr = ipFirstPtr;
Tcl_SetAssocData(interp, "tclLoad", LoadCleanupProc, ipPtr);
@@ -1091,7 +1093,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.
@@ -1152,11 +1154,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;
ckfree(ipPtr);
diff --git a/generic/tclMain.c b/generic/tclMain.c
index 7f13ebf..b882afc 100644
--- a/generic/tclMain.c
+++ b/generic/tclMain.c
@@ -738,10 +738,11 @@ StdinProc(
int mask) /* Not used. */
{
int code, 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);
@@ -910,7 +911,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 9f28661..14cea8b 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)
/*
@@ -480,7 +480,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);
}
@@ -514,12 +514,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,
@@ -546,13 +550,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;
@@ -588,12 +596,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,
@@ -620,13 +633,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 = ckalloc(sizeof(Namespace));
+ nsPtr = (Namespace *)ckalloc(sizeof(Namespace));
nameLen = strlen(simpleName) + 1;
- nsPtr->name = ckalloc(nameLen);
+ nsPtr->name = (char *)ckalloc(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 = ckalloc(nameLen + 1);
+ nsPtr->fullName = (char *)ckalloc(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) {
int 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) {
int 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) {
int 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 = ckrealloc(nsPtr->exportArrayPtr,
+ nsPtr->exportArrayPtr = (char **)ckrealloc(nsPtr->exportArrayPtr,
sizeof(char *) * nsPtr->maxExportPatterns);
}
@@ -1468,7 +1485,7 @@ Tcl_Export(
*/
len = strlen(pattern);
- patternCpy = ckalloc(len + 1);
+ patternCpy = (char *)ckalloc(len + 1);
memcpy(patternCpy, pattern, len + 1);
nsPtr->exportArrayPtr[nsPtr->numExportPatterns] = patternCpy;
@@ -1679,7 +1696,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,
@@ -1766,13 +1783,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(
@@ -1786,7 +1803,7 @@ DoImport(
}
}
- dataPtr = ckalloc(sizeof(ImportedCmdData));
+ dataPtr = (ImportedCmdData *)ckalloc(sizeof(ImportedCmdData));
importedCmd = Tcl_NRCreateCommand(interp, Tcl_DStringValue(&ds),
TclInvokeImportedCmd, InvokeImportedNRCmd, dataPtr,
DeleteImportedCmd);
@@ -1800,15 +1817,15 @@ DoImport(
* and add it to the import ref list in the "real" command.
*/
- refPtr = ckalloc(sizeof(ImportRef));
+ refPtr = (ImportRef *)ckalloc(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)) {
/*
@@ -1902,7 +1919,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);
@@ -1912,12 +1929,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);
}
@@ -1932,7 +1949,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) {
@@ -1945,7 +1962,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) {
@@ -2000,7 +2017,7 @@ TclGetOriginalCommand(
}
while (cmdPtr->deleteProc == DeleteImportedCmd) {
- dataPtr = cmdPtr->objClientData;
+ dataPtr = (ImportedCmdData *)cmdPtr->objClientData;
cmdPtr = dataPtr->realCmdPtr;
}
return (Tcl_Command) cmdPtr;
@@ -2033,7 +2050,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);
@@ -2078,7 +2095,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;
@@ -2354,7 +2371,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;
@@ -2389,7 +2406,7 @@ TclGetNamespaceForQualName(
}
#endif
if (entryPtr != NULL) {
- altNsPtr = Tcl_GetHashValue(entryPtr);
+ altNsPtr = (Namespace *)Tcl_GetHashValue(entryPtr);
} else {
altNsPtr = NULL;
}
@@ -2639,7 +2656,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);
}
}
}
@@ -2660,7 +2677,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);
}
}
}
@@ -2678,7 +2695,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);
}
}
}
@@ -2700,7 +2717,7 @@ Tcl_FindCommand(
entryPtr = Tcl_FindHashEntry(&nsPtr[search]->cmdTable,
simpleName);
if (entryPtr != NULL) {
- cmdPtr = Tcl_GetHashValue(entryPtr);
+ cmdPtr = (Command *)Tcl_GetHashValue(entryPtr);
}
}
}
@@ -2764,7 +2781,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 *));
/*
@@ -2784,7 +2801,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) {
/*
@@ -2813,7 +2830,7 @@ TclResetShadowedCmdRefs(
}
#endif
if (hPtr != NULL) {
- shadowNsPtr = Tcl_GetHashValue(hPtr);
+ shadowNsPtr = (Namespace *)Tcl_GetHashValue(hPtr);
} else {
found = 0;
break;
@@ -2854,7 +2871,7 @@ TclResetShadowedCmdRefs(
if (trailFront == trailSize) {
int newSize = 2 * trailSize;
- trailPtr = TclStackRealloc(interp, trailPtr,
+ trailPtr = (Namespace **)TclStackRealloc(interp, trailPtr,
newSize * sizeof(Namespace *));
trailSize = newSize;
}
@@ -3011,6 +3028,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.
@@ -3082,7 +3100,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);
@@ -3136,6 +3154,7 @@ NamespaceCodeCmd(
Tcl_Obj *listPtr, *objPtr;
const char *arg;
int length;
+ (void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "arg");
@@ -3214,6 +3233,7 @@ NamespaceCurrentCmd(
Tcl_Obj *const objv[]) /* Argument objects. */
{
Namespace *currNsPtr;
+ (void)dummy;
if (objc != 1) {
Tcl_WrongNumArgs(interp, 1, objv, NULL);
@@ -3279,6 +3299,7 @@ NamespaceDeleteCmd(
Tcl_Namespace *namespacePtr;
const char *name;
int i;
+ (void)dummy;
if (objc < 1) {
Tcl_WrongNumArgs(interp, 1, objv, "?name name...?");
@@ -3371,6 +3392,7 @@ NRNamespaceEvalCmd(
CallFrame *framePtr, **framePtrPtr;
Tcl_Obj *objPtr;
int result;
+ (void)dummy;
if (objc < 3) {
Tcl_WrongNumArgs(interp, 1, objv, "name arg ?arg...?");
@@ -3445,13 +3467,13 @@ NsEval_Callback(
Tcl_Interp *interp,
int result)
{
- Tcl_Namespace *namespacePtr = data[0];
+ Tcl_Namespace *namespacePtr = (Tcl_Namespace *)data[0];
if (result == TCL_ERROR) {
int length = strlen(namespacePtr->fullName);
int 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)",
@@ -3497,6 +3519,7 @@ NamespaceExistsCmd(
Tcl_Obj *const objv[]) /* Argument objects. */
{
Tcl_Namespace *namespacePtr;
+ (void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "name");
@@ -3552,6 +3575,7 @@ NamespaceExportCmd(
Tcl_Obj *const objv[]) /* Argument objects. */
{
int firstArg, i;
+ (void)dummy;
if (objc < 1) {
Tcl_WrongNumArgs(interp, 1, objv, "?-clear? ?pattern pattern...?");
@@ -3634,6 +3658,7 @@ NamespaceForgetCmd(
{
const char *pattern;
int i, result;
+ (void)dummy;
if (objc < 1) {
Tcl_WrongNumArgs(interp, 1, objv, "?pattern pattern...?");
@@ -3701,6 +3726,7 @@ NamespaceImportCmd(
const char *string, *pattern;
int i, result;
int firstArg;
+ (void)dummy;
if (objc < 1) {
Tcl_WrongNumArgs(interp, 1, objv, "?-force? ?pattern pattern...?");
@@ -3732,11 +3758,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);
@@ -3816,6 +3842,7 @@ NRNamespaceInscopeCmd(
CallFrame *framePtr, **framePtrPtr;
int i;
Tcl_Obj *cmdObjPtr;
+ (void)dummy;
if (objc < 3) {
Tcl_WrongNumArgs(interp, 1, objv, "name arg ?arg...?");
@@ -3911,6 +3938,7 @@ NamespaceOriginCmd(
{
Tcl_Command command, origCommand;
Tcl_Obj *resultPtr;
+ (void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "name");
@@ -3971,6 +3999,7 @@ NamespaceParentCmd(
Tcl_Obj *const objv[]) /* Argument objects. */
{
Tcl_Namespace *nsPtr;
+ (void)dummy;
if (objc == 1) {
nsPtr = TclGetCurrentNamespace(interp);
@@ -4032,6 +4061,7 @@ NamespacePathCmd(
int i, nsObjc, result = TCL_ERROR;
Tcl_Obj **nsObjv;
Tcl_Namespace **namespaceList = NULL;
+ (void)dummy;
if (objc > 2) {
Tcl_WrongNumArgs(interp, 1, objv, "?pathList?");
@@ -4063,7 +4093,7 @@ NamespacePathCmd(
goto badNamespace;
}
if (nsObjc != 0) {
- namespaceList = TclStackAlloc(interp,
+ namespaceList = (Tcl_Namespace **)TclStackAlloc(interp,
sizeof(Tcl_Namespace *) * nsObjc);
for (i=0 ; i<nsObjc ; i++) {
@@ -4116,7 +4146,7 @@ TclSetNsPath(
{
if (pathLength != 0) {
NamespacePathEntry *tmpPathArray =
- ckalloc(sizeof(NamespacePathEntry) * pathLength);
+ (NamespacePathEntry *)ckalloc(sizeof(NamespacePathEntry) * pathLength);
int i;
for (i=0 ; i<pathLength ; i++) {
@@ -4255,6 +4285,7 @@ NamespaceQualifiersCmd(
{
const char *name, *p;
int length;
+ (void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "string");
@@ -4324,6 +4355,7 @@ NamespaceUnknownCmd(
Tcl_Namespace *currNsPtr;
Tcl_Obj *resultPtr;
int rc;
+ (void)dummy;
if (objc > 2) {
Tcl_WrongNumArgs(interp, 1, objv, "?script?");
@@ -4509,6 +4541,7 @@ NamespaceTailCmd(
Tcl_Obj *const objv[]) /* Argument objects. */
{
const char *name, *p;
+ (void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "string");
@@ -4570,6 +4603,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 ...?");
@@ -4645,6 +4679,7 @@ NamespaceWhichCmd(
};
int lookupType = 0;
Tcl_Obj *resultPtr;
+ (void)dummy;
if (objc < 2 || objc > 3) {
badArgs:
@@ -4819,7 +4854,7 @@ SetNsNameFromAny(
*/
nsPtr->refCount++;
- resNamePtr = ckalloc(sizeof(ResolvedNsName));
+ resNamePtr = (ResolvedNsName *)ckalloc(sizeof(ResolvedNsName));
resNamePtr->nsPtr = nsPtr;
if ((name[0] == ':') && (name[1] == ':')) {
resNamePtr->refNsPtr = NULL;
@@ -4879,7 +4914,7 @@ TclGetNamespaceChildTable(
return &nPtr->childTable;
#else
if (nPtr->childTablePtr == NULL) {
- nPtr->childTablePtr = ckalloc(sizeof(Tcl_HashTable));
+ nPtr->childTablePtr = (Tcl_HashTable *)ckalloc(sizeof(Tcl_HashTable));
Tcl_InitHashTable(nPtr->childTablePtr, TCL_STRING_KEYS);
}
return nPtr->childTablePtr;
@@ -4968,7 +5003,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 e76bca8..65b4197 100644
--- a/generic/tclNotify.c
+++ b/generic/tclNotify.c
@@ -276,7 +276,7 @@ Tcl_CreateEventSource(
* checkProc. */
{
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
- EventSource *sourcePtr = ckalloc(sizeof(EventSource));
+ EventSource *sourcePtr = (EventSource *)ckalloc(sizeof(EventSource));
sourcePtr->setupProc = setupProc;
sourcePtr->checkProc = checkProc;
diff --git a/generic/tclOO.c b/generic/tclOO.c
index af5ea50..2d09f3a 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 = ckalloc(sizeof(Foundation));
+ (ThreadLocalData *)Tcl_GetThreadData(&tsdKey, sizeof(ThreadLocalData));
+ Foundation *fPtr = (Foundation *)ckalloc(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;
int creationEpoch;
- oPtr = ckalloc(sizeof(Object));
+ oPtr = (Object *)ckalloc(sizeof(Object));
memset(oPtr, 0, sizeof(Object));
/*
@@ -735,7 +736,7 @@ AllocObject(
cmdPtr = (Command *) oPtr->command;
cmdPtr->nreProc = PublicNRObjectCmd;
- cmdPtr->tracePtr = tracePtr = ckalloc(sizeof(CommandTrace));
+ cmdPtr->tracePtr = tracePtr = (CommandTrace *)ckalloc(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 = ckalloc(sizeof(Object *) * ALLOC_CHUNK);
+ clsPtr->instances.list = (Object **)ckalloc(sizeof(Object *) * ALLOC_CHUNK);
} else {
- clsPtr->instances.list = ckrealloc(clsPtr->instances.list,
+ clsPtr->instances.list = (Object **)ckrealloc(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 = ckalloc(sizeof(Class *) * ALLOC_CHUNK);
+ superPtr->subclasses.list = (Class **)ckalloc(sizeof(Class *) * ALLOC_CHUNK);
} else {
- superPtr->subclasses.list = ckrealloc(superPtr->subclasses.list,
+ superPtr->subclasses.list = (Class **)ckrealloc(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 = ckalloc(sizeof(Class *) * ALLOC_CHUNK);
+ superPtr->mixinSubs.list = (Class **)ckalloc(sizeof(Class *) * ALLOC_CHUNK);
} else {
- superPtr->mixinSubs.list = ckrealloc(superPtr->mixinSubs.list,
+ superPtr->mixinSubs.list = (Class **)ckrealloc(superPtr->mixinSubs.list,
sizeof(Class *) * superPtr->mixinSubs.size);
}
}
@@ -1606,7 +1610,7 @@ TclOOAllocClass(
* representation. */
{
Foundation *fPtr = GetFoundation(interp);
- Class *clsPtr = ckalloc(sizeof(Class));
+ Class *clsPtr = (Class *)ckalloc(sizeof(Class));
memset(clsPtr, 0, sizeof(Class));
clsPtr->thisPtr = useThisObj;
@@ -1623,7 +1627,7 @@ TclOOAllocClass(
*/
clsPtr->superclasses.num = 1;
- clsPtr->superclasses.list = ckalloc(sizeof(Class *));
+ clsPtr->superclasses.list = (Class **)ckalloc(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 = ckrealloc(cls2Ptr->superclasses.list,
+ cls2Ptr->superclasses.list = (Class **) ckrealloc(cls2Ptr->superclasses.list,
sizeof(Class *) * clsPtr->superclasses.num);
} else {
cls2Ptr->superclasses.list =
- ckalloc(sizeof(Class *) * clsPtr->superclasses.num);
+ (Class **)ckalloc(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 = ckalloc(sizeof(Tcl_HashTable));
+ clsPtr->metadataPtr = (Tcl_HashTable *)ckalloc(sizeof(Tcl_HashTable));
Tcl_InitHashTable(clsPtr->metadataPtr, TCL_ONE_WORD_KEYS);
}
@@ -2452,7 +2456,7 @@ Tcl_ObjectSetMetadata(
if (metadata == NULL) {
return;
}
- oPtr->metadataPtr = ckalloc(sizeof(Tcl_HashTable));
+ oPtr->metadataPtr = (Tcl_HashTable *)ckalloc(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 6de7513..5420c80 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 = ckalloc(3 * sizeof(Tcl_Obj *));
+ invoke = (Tcl_Obj **)ckalloc(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;
int 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;
int 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 423a41e..41f5334 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 = ckalloc(sizeof(char *) * namesPtr->numEntries);
+ strings = (const char **)ckalloc(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 =
- ckalloc(sizeof(struct MInvoke) * (callPtr->numChain + 1));
+ (struct MInvoke *)ckalloc(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 = ckrealloc(callPtr->chain,
+ callPtr->chain = (struct MInvoke *)ckrealloc(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 = ckalloc(sizeof(CallChain));
+ callPtr = (CallChain *)ckalloc(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 =
- ckalloc(sizeof(Tcl_HashTable));
+ (Tcl_HashTable *)ckalloc(sizeof(Tcl_HashTable));
Tcl_InitObjHashTable(oPtr->selfCls->classChainCache);
}
@@ -1343,7 +1346,7 @@ TclOOGetCallContext(
(char *) methodNameObj, &i);
} else {
if (oPtr->chainCache == NULL) {
- oPtr->chainCache = ckalloc(sizeof(Tcl_HashTable));
+ oPtr->chainCache = (Tcl_HashTable *)ckalloc(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 = ckalloc(sizeof(CallChain));
+ callPtr = (CallChain *)ckalloc(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 = ckalloc(sizeof(Tcl_HashTable));
+ clsPtr->classChainCache = (Tcl_HashTable *)ckalloc(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 =
- ckalloc(sizeof(DefineEntry) * definePtr->size);
+ (DefineEntry *)ckalloc(sizeof(DefineEntry) * definePtr->size);
memcpy(definePtr->list, staticList,
sizeof(DefineEntry) * definePtr->num);
} else {
- definePtr->list = ckrealloc(definePtr->list,
+ definePtr->list = (DefineEntry *)ckrealloc(definePtr->list,
sizeof(DefineEntry) * definePtr->size);
}
}
diff --git a/generic/tclOODefineCmds.c b/generic/tclOODefineCmds.c
index 2eed662..14ec496 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 = ckalloc(size);
+ filtersList = (Tcl_Obj **)ckalloc(size);
} else {
- filtersList = ckrealloc(oPtr->filters.list, size);
+ filtersList = (Tcl_Obj **)ckrealloc(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 = ckalloc(size);
+ filtersList = (Tcl_Obj **)ckalloc(size);
} else {
- filtersList = ckrealloc(classPtr->filters.list, size);
+ filtersList = (Tcl_Obj **)ckrealloc(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 = ckrealloc(oPtr->mixins.list,
+ oPtr->mixins.list = (Class **)ckrealloc(oPtr->mixins.list,
sizeof(Class *) * numMixins);
} else {
- oPtr->mixins.list = ckalloc(sizeof(Class *) * numMixins);
+ oPtr->mixins.list = (Class **)ckalloc(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 = ckrealloc(classPtr->mixins.list,
+ classPtr->mixins.list = (Class **)ckrealloc(classPtr->mixins.list,
sizeof(Class *) * numMixins);
} else {
- classPtr->mixins.list = ckalloc(sizeof(Class *) * numMixins);
+ classPtr->mixins.list = (Class **)ckalloc(sizeof(Class *) * numMixins);
}
classPtr->mixins.num = numMixins;
memcpy(classPtr->mixins.list, mixins, sizeof(Class *) * numMixins);
@@ -502,9 +502,9 @@ InstallStandardVariableMapping(
if (varc == 0) {
ckfree(vnlPtr->list);
} else if (i) {
- vnlPtr->list = ckrealloc(vnlPtr->list, sizeof(Tcl_Obj *) * varc);
+ vnlPtr->list = (Tcl_Obj **)ckrealloc(vnlPtr->list, sizeof(Tcl_Obj *) * varc);
} else {
- vnlPtr->list = ckalloc(sizeof(Tcl_Obj *) * varc);
+ vnlPtr->list = (Tcl_Obj **)ckalloc(sizeof(Tcl_Obj *) * varc);
}
}
vnlPtr->num = 0;
@@ -525,7 +525,7 @@ InstallStandardVariableMapping(
*/
if (n != varc) {
- vnlPtr->list = ckrealloc(vnlPtr->list, sizeof(Tcl_Obj *) * n);
+ vnlPtr->list = (Tcl_Obj **)ckrealloc(vnlPtr->list, sizeof(Tcl_Obj *) * n);
}
Tcl_DeleteHashTable(&uniqueTable);
}
@@ -553,10 +553,10 @@ InstallPrivateVariableMapping(
if (varc == 0) {
ckfree(pvlPtr->list);
} else if (i) {
- pvlPtr->list = ckrealloc(pvlPtr->list,
+ pvlPtr->list = (PrivateVariableMapping *)ckrealloc(pvlPtr->list,
sizeof(PrivateVariableMapping) * varc);
} else {
- pvlPtr->list = ckalloc(sizeof(PrivateVariableMapping) * varc);
+ pvlPtr->list = (PrivateVariableMapping *)ckalloc(sizeof(PrivateVariableMapping) * varc);
}
}
@@ -583,7 +583,7 @@ InstallPrivateVariableMapping(
*/
if (n != varc) {
- pvlPtr->list = ckrealloc(pvlPtr->list,
+ pvlPtr->list = (PrivateVariableMapping *)ckrealloc(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;
int 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;
int 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;
int bodyLength;
+ (void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "body");
@@ -1841,7 +1850,7 @@ TclOODefineExportObjCmd(
if (isInstanceExport) {
if (!oPtr->methodsPtr) {
- oPtr->methodsPtr = ckalloc(sizeof(Tcl_HashTable));
+ oPtr->methodsPtr = (Tcl_HashTable *)ckalloc(sizeof(Tcl_HashTable));
Tcl_InitObjHashTable(oPtr->methodsPtr);
oPtr->flags &= ~USE_CLASS_CACHE;
}
@@ -1853,14 +1862,14 @@ TclOODefineExportObjCmd(
}
if (isNew) {
- mPtr = ckalloc(sizeof(Method));
+ mPtr = (Method *)ckalloc(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 = ckalloc(sizeof(Tcl_HashTable));
+ oPtr->methodsPtr = (Tcl_HashTable *)ckalloc(sizeof(Tcl_HashTable));
Tcl_InitObjHashTable(oPtr->methodsPtr);
oPtr->flags &= ~USE_CLASS_CACHE;
}
@@ -2166,14 +2175,14 @@ TclOODefineUnexportObjCmd(
}
if (isNew) {
- mPtr = ckalloc(sizeof(Method));
+ mPtr = (Method *)ckalloc(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 = ckrealloc(superclasses, sizeof(Class *));
+ superclasses = (Class **)ckrealloc(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 99918ae..580a8d5 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 ca984d0..db4b7f1 100644
--- a/generic/tclOOInt.h
+++ b/generic/tclOOInt.h
@@ -655,11 +655,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 01b47ff..01e2c00 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 = ckalloc(sizeof(Method));
+ mPtr = (Method *)ckalloc(sizeof(Method));
mPtr->namePtr = NULL;
mPtr->refCount = 1;
goto populate;
}
if (!oPtr->methodsPtr) {
- oPtr->methodsPtr = ckalloc(sizeof(Tcl_HashTable));
+ oPtr->methodsPtr = (Tcl_HashTable *)ckalloc(sizeof(Tcl_HashTable));
Tcl_InitObjHashTable(oPtr->methodsPtr);
oPtr->flags &= ~USE_CLASS_CACHE;
}
hPtr = Tcl_CreateHashEntry(oPtr->methodsPtr, (char *) nameObj, &isNew);
if (isNew) {
- mPtr = ckalloc(sizeof(Method));
+ mPtr = (Method *)ckalloc(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 = ckalloc(sizeof(Method));
+ mPtr = (Method *)ckalloc(sizeof(Method));
mPtr->namePtr = NULL;
mPtr->refCount = 1;
goto populate;
}
hPtr = Tcl_CreateHashEntry(&clsPtr->classMethods, (char *)nameObj,&isNew);
if (isNew) {
- mPtr = ckalloc(sizeof(Method));
+ mPtr = (Method *)ckalloc(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 = ckalloc(sizeof(ProcedureMethod));
+ pmPtr = (ProcedureMethod *)ckalloc(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 = ckalloc(sizeof(ProcedureMethod));
+ pmPtr = (ProcedureMethod *)ckalloc(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 = ckalloc(sizeof(CmdFrame));
+ CmdFrame *cfPtr = (CmdFrame *)ckalloc(sizeof(CmdFrame));
Tcl_HashEntry *hPtr;
cfPtr->level = -1;
cfPtr->type = context.type;
- cfPtr->line = ckalloc(sizeof(int));
+ cfPtr->line = (int *)ckalloc(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 = ckalloc(sizeof(CmdFrame));
+ CmdFrame *cfPtr = (CmdFrame *)ckalloc(sizeof(CmdFrame));
Tcl_HashEntry *hPtr;
cfPtr->level = -1;
cfPtr->type = context.type;
- cfPtr->line = ckalloc(sizeof(int));
+ cfPtr->line = (int *)ckalloc(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);
@@ -1007,7 +1010,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
@@ -1107,7 +1110,7 @@ ProcedureMethodCompiledVarDelete(
static int
ProcedureMethodCompiledVarResolver(
- Tcl_Interp *interp,
+ Tcl_Interp *dummy,
const char *varName,
int length,
Tcl_Namespace *contextNs,
@@ -1115,6 +1118,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
@@ -1127,7 +1132,7 @@ ProcedureMethodCompiledVarResolver(
return TCL_CONTINUE;
}
- infoPtr = ckalloc(sizeof(OOResVarInfo));
+ infoPtr = (OOResVarInfo *)ckalloc(sizeof(OOResVarInfo));
infoPtr->info.fetchProc = ProcedureMethodCompiledVarConnect;
infoPtr->info.deleteProc = ProcedureMethodCompiledVarDelete;
infoPtr->cachedObjectVar = NULL;
@@ -1154,7 +1159,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) {
@@ -1188,11 +1193,12 @@ MethodErrorHandler(
Tcl_Obj *methodNameObj)
{
int 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;
@@ -1218,11 +1224,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;
int objectNameLen;
+ (void)methodNameObj;
if (mPtr->declaringObjectPtr != NULL) {
declarerPtr = mPtr->declaringObjectPtr;
@@ -1247,11 +1254,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;
int objectNameLen;
+ (void)methodNameObj;
if (mPtr->declaringObjectPtr != NULL) {
declarerPtr = mPtr->declaringObjectPtr;
@@ -1296,7 +1304,7 @@ static void
DeleteProcedureMethod(
void *clientData)
{
- ProcedureMethod *pmPtr = clientData;
+ ProcedureMethod *pmPtr = (ProcedureMethod *)clientData;
if (pmPtr->refCount-- <= 1) {
DeleteProcedureMethodRecord(pmPtr);
@@ -1309,7 +1317,7 @@ CloneProcedureMethod(
void *clientData,
void **newClientData)
{
- ProcedureMethod *pmPtr = clientData;
+ ProcedureMethod *pmPtr = (ProcedureMethod *)clientData;
ProcedureMethod *pm2Ptr;
Tcl_Obj *bodyObj, *argsObj;
CompiledLocal *localPtr;
@@ -1347,7 +1355,7 @@ CloneProcedureMethod(
* record.
*/
- pm2Ptr = ckalloc(sizeof(ProcedureMethod));
+ pm2Ptr = (ProcedureMethod *)ckalloc(sizeof(ProcedureMethod));
memcpy(pm2Ptr, pmPtr, sizeof(ProcedureMethod));
pm2Ptr->refCount = 1;
Tcl_IncrRefCount(argsObj);
@@ -1401,7 +1409,7 @@ TclOONewForwardInstanceMethod(
return NULL;
}
- fmPtr = ckalloc(sizeof(ForwardMethod));
+ fmPtr = (ForwardMethod *)ckalloc(sizeof(ForwardMethod));
fmPtr->prefixObj = prefixObj;
Tcl_IncrRefCount(prefixObj);
return (Method *) Tcl_NewInstanceMethod(interp, (Tcl_Object) oPtr,
@@ -1440,7 +1448,7 @@ TclOONewForwardMethod(
return NULL;
}
- fmPtr = ckalloc(sizeof(ForwardMethod));
+ fmPtr = (ForwardMethod *)ckalloc(sizeof(ForwardMethod));
fmPtr->prefixObj = prefixObj;
Tcl_IncrRefCount(prefixObj);
return (Method *) Tcl_NewMethod(interp, (Tcl_Class) clsPtr, nameObj,
@@ -1467,7 +1475,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;
@@ -1498,7 +1506,7 @@ FinalizeForwardCall(
Tcl_Interp *interp,
int result)
{
- Tcl_Obj **argObjs = data[0];
+ Tcl_Obj **argObjs = (Tcl_Obj **)data[0];
TclStackFree(interp, argObjs);
return result;
@@ -1518,7 +1526,7 @@ static void
DeleteForwardMethod(
void *clientData)
{
- ForwardMethod *fmPtr = clientData;
+ ForwardMethod *fmPtr = (ForwardMethod *)clientData;
Tcl_DecrRefCount(fmPtr->prefixObj);
ckfree(fmPtr);
@@ -1526,12 +1534,13 @@ DeleteForwardMethod(
static int
CloneForwardMethod(
- Tcl_Interp *interp,
+ Tcl_Interp *dummy,
void *clientData,
void **newClientData)
{
- ForwardMethod *fmPtr = clientData;
- ForwardMethod *fm2Ptr = ckalloc(sizeof(ForwardMethod));
+ ForwardMethod *fmPtr = (ForwardMethod *)clientData;
+ ForwardMethod *fm2Ptr = (ForwardMethod *)ckalloc(sizeof(ForwardMethod));
+ (void)dummy;
fm2Ptr->prefixObj = fmPtr->prefixObj;
Tcl_IncrRefCount(fm2Ptr->prefixObj);
@@ -1555,7 +1564,7 @@ TclOOGetProcFromMethod(
Method *mPtr)
{
if (mPtr->typePtr == &procMethodType) {
- ProcedureMethod *pmPtr = mPtr->clientData;
+ ProcedureMethod *pmPtr = (ProcedureMethod *)mPtr->clientData;
return pmPtr->procPtr;
}
@@ -1567,7 +1576,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;
@@ -1580,7 +1589,7 @@ TclOOGetFwdFromMethod(
Method *mPtr)
{
if (mPtr->typePtr == &fwdMethodType) {
- ForwardMethod *fwPtr = mPtr->clientData;
+ ForwardMethod *fwPtr = (ForwardMethod *)mPtr->clientData;
return fwPtr->prefixObj;
}
@@ -1622,7 +1631,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 e70d4a2..bc1953a 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 *) ckalloc(sizeof(mp_int)); \
+ mp_int *temp = (mp_int *) ckalloc(sizeof(mp_int)); \
*temp = bignum; \
(objPtr)->internalRep.twoPtrValue.ptr1 = temp; \
(objPtr)->internalRep.twoPtrValue.ptr2 = INT2PTR(-1); \
@@ -532,7 +532,7 @@ TclGetContLineTable(void)
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
if (!tsdPtr->lineCLPtr) {
- tsdPtr->lineCLPtr = ckalloc(sizeof(Tcl_HashTable));
+ tsdPtr->lineCLPtr = (Tcl_HashTable *)ckalloc(sizeof(Tcl_HashTable));
Tcl_InitHashTable(tsdPtr->lineCLPtr, TCL_ONE_WORD_KEYS);
Tcl_CreateThreadExitHandler(TclThreadFinalizeContLines,NULL);
}
@@ -567,7 +567,7 @@ TclContinuationsEnter(
ThreadSpecificData *tsdPtr = TclGetContLineTable();
Tcl_HashEntry *hPtr =
Tcl_CreateHashEntry(tsdPtr->lineCLPtr, objPtr, &newEntry);
- ContLineLoc *clLocPtr = ckalloc(sizeof(ContLineLoc) + num*sizeof(int));
+ ContLineLoc *clLocPtr = (ContLineLoc *)ckalloc(sizeof(ContLineLoc) + num*sizeof(int));
if (!newEntry) {
/*
@@ -724,7 +724,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);
}
@@ -760,7 +760,7 @@ TclContinuationsGet(
if (!hPtr) {
return NULL;
}
- return Tcl_GetHashValue(hPtr);
+ return (ContLineLoc *)Tcl_GetHashValue(hPtr);
}
/*
@@ -783,7 +783,7 @@ TclContinuationsGet(
static void
TclThreadFinalizeContLines(
- ClientData clientData)
+ ClientData dummy)
{
/*
* Release the hashtable tracking invisible continuation lines.
@@ -792,6 +792,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)) {
@@ -808,7 +809,7 @@ TclThreadFinalizeContLines(
*
* Tcl_RegisterObjType --
*
- * This function is called to a new Tcl object type in the table
+ * This function is called to register a new Tcl object type in the table
* of all object types supported by Tcl.
*
* Results:
@@ -888,7 +889,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;
@@ -921,7 +922,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;
@@ -1021,6 +1022,8 @@ TclDbDumpActiveObjects(
}
}
}
+#else
+ (void)outFile;
#endif
}
@@ -1069,7 +1072,7 @@ TclDbInitNewObj(
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
if (tsdPtr->objThreadMap == NULL) {
- tsdPtr->objThreadMap = ckalloc(sizeof(Tcl_HashTable));
+ tsdPtr->objThreadMap = (Tcl_HashTable *)ckalloc(sizeof(Tcl_HashTable));
Tcl_InitHashTable(tsdPtr->objThreadMap, TCL_ONE_WORD_KEYS);
}
tablePtr = tsdPtr->objThreadMap;
@@ -1082,7 +1085,7 @@ TclDbInitNewObj(
* Record the debugging information.
*/
- objData = ckalloc(sizeof(ObjData));
+ objData = (ObjData *)ckalloc(sizeof(ObjData));
objData->objPtr = objPtr;
objData->file = file;
objData->line = line;
@@ -1197,6 +1200,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 */
@@ -1241,7 +1247,7 @@ TclAllocateFreeObjects(void)
* Purify apparently can't figure that out, and fires a false alarm.
*/
- basePtr = ckalloc(bytesToAlloc);
+ basePtr = (char *)ckalloc(bytesToAlloc);
prevPtr = NULL;
objPtr = (Tcl_Obj *) basePtr;
@@ -1769,7 +1775,7 @@ Tcl_InitStringRep(
/* Allocate only as empty - extend later if bytes copied */
objPtr->length = 0;
if (numBytes) {
- objPtr->bytes = attemptckalloc(numBytes + 1);
+ objPtr->bytes = (char *)attemptckalloc(numBytes + 1);
if (objPtr->bytes == NULL) {
return NULL;
}
@@ -1783,7 +1789,7 @@ Tcl_InitStringRep(
}
} else {
/* objPtr->bytes != NULL bytes == NULL - Truncate */
- objPtr->bytes = ckrealloc(objPtr->bytes, numBytes + 1);
+ objPtr->bytes = (char *)ckrealloc(objPtr->bytes, numBytes + 1);
objPtr->length = (int)numBytes;
}
@@ -2035,6 +2041,9 @@ Tcl_DbNewBooleanObj(
int line) /* Line number in the source file; used for
* debugging. */
{
+ (void)file;
+ (void)line;
+
return Tcl_NewBooleanObj(boolValue);
}
#endif /* TCL_MEM_DEBUG */
@@ -2422,6 +2431,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 */
@@ -2906,6 +2918,9 @@ Tcl_DbNewLongObj(
int line) /* Line number in the source file; used for
* debugging. */
{
+ (void)file;
+ (void)line;
+
return Tcl_NewWideIntObj(longValue);
}
#endif /* TCL_MEM_DEBUG */
@@ -3015,6 +3030,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;
@@ -3037,6 +3053,7 @@ Tcl_GetLongFromObj(
}
}
}
+ }
#ifndef TCL_WIDE_INT_IS_LONG
tooLarge:
#endif
@@ -3170,6 +3187,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 */
@@ -3550,6 +3570,9 @@ Tcl_DbNewBignumObj(
const char *file,
int line)
{
+ (void)file;
+ (void)line;
+
return Tcl_NewBignumObj(bignumValue);
}
#endif
@@ -3834,8 +3857,8 @@ TclGetNumberFromObj(
}
if (objPtr->typePtr == &tclBignumType) {
static Tcl_ThreadDataKey bignumKey;
- mp_int *bigPtr = Tcl_GetThreadData(&bignumKey,
- (int) sizeof(mp_int));
+ mp_int *bigPtr = (mp_int *)Tcl_GetThreadData(&bignumKey,
+ sizeof(mp_int));
TclUnpackBignum(objPtr, *bigPtr);
*typePtr = TCL_NUMBER_BIG;
@@ -3971,6 +3994,9 @@ Tcl_DbIncrRefCount(
}
}
# endif /* TCL_THREADS */
+#else
+ (void)file;
+ (void)line;
#endif /* TCL_MEM_DEBUG */
++(objPtr)->refCount;
}
@@ -4034,6 +4060,9 @@ Tcl_DbDecrRefCount(
}
}
# endif /* TCL_THREADS */
+#else
+ (void)file;
+ (void)line;
#endif /* TCL_MEM_DEBUG */
if (objPtr->refCount-- <= 1) {
@@ -4099,6 +4128,9 @@ Tcl_DbIsShared(
}
}
# endif /* TCL_THREADS */
+#else
+ (void)file;
+ (void)line;
#endif /* TCL_MEM_DEBUG */
#ifdef TCL_COMPILE_STATS
@@ -4162,11 +4194,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 = keyPtr;
- Tcl_HashEntry *hPtr = ckalloc(sizeof(Tcl_HashEntry));
+ Tcl_Obj *objPtr = (Tcl_Obj *)keyPtr;
+ Tcl_HashEntry *hPtr = (Tcl_HashEntry *)ckalloc(sizeof(Tcl_HashEntry));
+ (void)dummy;
hPtr->key.objPtr = objPtr;
Tcl_IncrRefCount(objPtr);
@@ -4197,7 +4230,7 @@ TclCompareObjKeys(
void *keyPtr, /* New key to compare. */
Tcl_HashEntry *hPtr) /* Existing key to compare. */
{
- Tcl_Obj *objPtr1 = keyPtr;
+ Tcl_Obj *objPtr1 = (Tcl_Obj *)keyPtr;
Tcl_Obj *objPtr2 = (Tcl_Obj *) hPtr->key.oneWordValue;
const char *p1, *p2;
size_t l1, l2;
@@ -4283,13 +4316,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 = keyPtr;
+ Tcl_Obj *objPtr = (Tcl_Obj *)keyPtr;
int length;
const char *string = TclGetStringFromObj(objPtr, &length);
- unsigned int result = 0;
+ TCL_HASH_TYPE result = 0;
+ (void)dummy;
/*
* I tried a zillion different hash functions and asked many other people
@@ -4331,7 +4365,7 @@ TclHashObjKey(
result += (result << 3) + UCHAR(*++string);
}
}
- return (TCL_HASH_TYPE) result;
+ return result;
}
/*
@@ -4384,7 +4418,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;
@@ -4412,7 +4446,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);
}
@@ -4450,7 +4484,7 @@ SetCmdNameObj(
if (resPtr) {
fillPtr = resPtr;
} else {
- fillPtr = ckalloc(sizeof(ResolvedCmdName));
+ fillPtr = (ResolvedCmdName *)ckalloc(sizeof(ResolvedCmdName));
fillPtr->refCount = 1;
}
@@ -4501,7 +4535,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;
}
@@ -4536,7 +4570,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
@@ -4583,7 +4617,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;
@@ -4646,7 +4680,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.
@@ -4684,12 +4718,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 8267a7d..095e6c5 100644
--- a/generic/tclOptimize.c
+++ b/generic/tclOptimize.c
@@ -429,9 +429,9 @@ void
TclOptimizeBytecode(
void *envPtr)
{
- ConvertZeroEffectToNOP(envPtr);
- AdvanceJumps(envPtr);
- TrimUnreachable(envPtr);
+ ConvertZeroEffectToNOP((CompileEnv *)envPtr);
+ AdvanceJumps((CompileEnv *)envPtr);
+ TrimUnreachable((CompileEnv *)envPtr);
}
/*
diff --git a/generic/tclPanic.c b/generic/tclPanic.c
index 4fce082..a3fc47d 100644
--- a/generic/tclPanic.c
+++ b/generic/tclPanic.c
@@ -51,7 +51,7 @@ Tcl_SetPanicProc(
{
#if defined(_WIN32)
/* tclWinDebugPanic only installs if there is no panicProc yet. */
- if ((proc != tclWinDebugPanic) || (panicProc == NULL))
+ if (((Tcl_PanicProc *)proc != tclWinDebugPanic) || (panicProc == NULL))
#elif defined(__CYGWIN__)
if (proc == NULL)
panicProc = tclWinDebugPanic;
diff --git a/generic/tclParse.c b/generic/tclParse.c
index 3cc44b1..3bc6722 100644
--- a/generic/tclParse.c
+++ b/generic/tclParse.c
@@ -1143,7 +1143,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;
@@ -1531,7 +1531,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);
@@ -2012,7 +2012,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 ==
@@ -2154,7 +2154,7 @@ TclSubstTokens(
if (isLiteral) {
maxNumCL = NUM_STATIC_POS;
- clPosition = ckalloc(maxNumCL * sizeof(int));
+ clPosition = (int *)ckalloc(maxNumCL * sizeof(int));
}
adjust = 0;
@@ -2204,7 +2204,7 @@ TclSubstTokens(
if (numCL >= maxNumCL) {
maxNumCL *= 2;
- clPosition = ckrealloc(clPosition,
+ clPosition = (int *)ckrealloc(clPosition,
maxNumCL * sizeof(int));
}
clPosition[numCL] = clPos;
diff --git a/generic/tclPathObj.c b/generic/tclPathObj.c
index 13b7768..7accfa2 100644
--- a/generic/tclPathObj.c
+++ b/generic/tclPathObj.c
@@ -1273,7 +1273,7 @@ TclNewFSPathObj(
}
pathPtr = Tcl_NewObj();
- fsPathPtr = ckalloc(sizeof(FsPath));
+ fsPathPtr = (FsPath *)ckalloc(sizeof(FsPath));
/*
* Set up the path.
@@ -1385,13 +1385,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. */
{
int cwdLen, len;
const char *tempStr;
Tcl_ObjIntRep *irPtr = TclFetchIntRep(pathPtr, &fsPathType);
+ (void)dummy;
if (irPtr) {
FsPath *fsPathPtr = PATHOBJ(pathPtr);
@@ -1456,16 +1457,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 = ckalloc(sizeof(FsPath));
+ fsPathPtr = (FsPath *)ckalloc(sizeof(FsPath));
/*
* It's a pure normalized absolute path.
@@ -1533,7 +1535,7 @@ Tcl_FSNewNativePath(
*/
Tcl_StoreIntRep(pathPtr, &fsPathType, NULL);
- fsPathPtr = ckalloc(sizeof(FsPath));
+ fsPathPtr = (FsPath *)ckalloc(sizeof(FsPath));
fsPathPtr->translatedPathPtr = NULL;
@@ -1659,7 +1661,7 @@ Tcl_FSGetTranslatedStringPath(
if (transPtr != NULL) {
int len;
const char *orig = TclGetStringFromObj(transPtr, &len);
- char *result = ckalloc(len+1);
+ char *result = (char *)ckalloc(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();
@@ -2346,7 +2348,7 @@ SetFsPathFromAny(
* slashes on Windows, and will not contain any ~user sequences.
*/
- fsPathPtr = ckalloc(sizeof(FsPath));
+ fsPathPtr = (FsPath *)ckalloc(sizeof(FsPath));
if (transPtr == pathPtr) {
transPtr = Tcl_DuplicateObj(pathPtr);
@@ -2406,7 +2408,7 @@ DupFsPathInternalRep(
Tcl_Obj *copyPtr) /* Path obj with internal rep to set. */
{
FsPath *srcFsPathPtr = PATHOBJ(srcPtr);
- FsPath *copyFsPathPtr = ckalloc(sizeof(FsPath));
+ FsPath *copyFsPathPtr = (FsPath *)ckalloc(sizeof(FsPath));
SETPATHOBJ(copyPtr, copyFsPathPtr);
@@ -2510,8 +2512,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 70774e7..8d5c0c7 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 = ckalloc(sizeof(Detached));
+ detPtr = (Detached *)ckalloc(sizeof(Detached));
detPtr->pid = pidPtr[i];
detPtr->nextPtr = detList;
detList = detPtr;
@@ -824,7 +824,7 @@ TclCreatePipeline(
*/
Tcl_ReapDetachedProcs();
- pidPtr = ckalloc(cmdCount * sizeof(Tcl_Pid));
+ pidPtr = (Tcl_Pid *)ckalloc(cmdCount * sizeof(Tcl_Pid));
curInFile = inputFile;
diff --git a/generic/tclPkg.c b/generic/tclPkg.c
index 6727715..0a32f48 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) = ckalloc(len), memcpy((v),(s),(len)))
+ ((v) = (char *)ckalloc(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 = ckalloc(sizeof(PkgFiles));
+ pkgFiles = (PkgFiles *)ckalloc(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 = ckalloc(sizeof(Require));
+ reqPtr = (Require *)ckalloc(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;
+
ckfree(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 = ckalloc(sizeof(PkgName) + strlen(name));
+ pkgName = (PkgName *)ckalloc(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;
ckfree(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 ...?");
@@ -1127,7 +1137,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);
}
@@ -1137,7 +1147,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);
@@ -1176,7 +1186,7 @@ TclNRPackageObjCmd(
ckfree(argv3i);
return TCL_OK;
}
- pkgPtr = Tcl_GetHashValue(hPtr);
+ pkgPtr = (Package *)Tcl_GetHashValue(hPtr);
} else {
pkgPtr = FindPackage(interp, argv2);
}
@@ -1214,7 +1224,7 @@ TclNRPackageObjCmd(
return TCL_OK;
}
if (availPtr == NULL) {
- availPtr = ckalloc(sizeof(PkgAvail));
+ availPtr = (PkgAvail *)ckalloc(sizeof(PkgAvail));
availPtr->pkgIndex = NULL;
DupBlock(availPtr->version, argv3, length + 1);
@@ -1245,10 +1255,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);
@@ -1274,7 +1284,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;
}
@@ -1309,7 +1319,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);
}
@@ -1495,7 +1505,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,
@@ -1536,9 +1546,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;
@@ -1574,13 +1586,13 @@ FindPackage(
hPtr = Tcl_CreateHashEntry(&iPtr->packageTable, name, &isNew);
if (isNew) {
- pkgPtr = ckalloc(sizeof(Package));
+ pkgPtr = (Package *)ckalloc(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;
}
@@ -1613,7 +1625,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);
}
@@ -1672,7 +1684,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 = ckalloc(4 + 4*strlen(string));
+ char *ibuf = (char *)ckalloc(4 + 4*strlen(string));
char *ip = ibuf;
/*
@@ -1999,7 +2011,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.
@@ -2187,7 +2199,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 5c6097f..6930225 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 = ckrealloc(refArray, spaceAvl * sizeof(Reference));
+ refArray = (Reference *)ckrealloc(refArray, spaceAvl * sizeof(Reference));
}
/*
@@ -226,7 +226,7 @@ Tcl_Release(
if (freeProc == TCL_DYNAMIC) {
ckfree(clientData);
} else {
- freeProc(clientData);
+ freeProc((char *)clientData);
}
}
return;
@@ -293,7 +293,7 @@ Tcl_EventuallyFree(
if (freeProc == TCL_DYNAMIC) {
ckfree(clientData);
} else {
- freeProc(clientData);
+ freeProc((char *)clientData);
}
}
@@ -327,7 +327,7 @@ TclHandleCreate(
* be tracked for deletion. Must not be
* NULL. */
{
- HandleStruct *handlePtr = ckalloc(sizeof(HandleStruct));
+ HandleStruct *handlePtr = (HandleStruct *)ckalloc(sizeof(HandleStruct));
handlePtr->ptr = ptr;
#ifdef TCL_MEM_DEBUG
diff --git a/generic/tclProc.c b/generic/tclProc.c
index 85d6531..81da618 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 = ckalloc(sizeof(CmdFrame));
+ CmdFrame *cfPtr = (CmdFrame *)ckalloc(sizeof(CmdFrame));
cfPtr->level = -1;
cfPtr->type = contextPtr->type;
- cfPtr->line = ckalloc(sizeof(int));
+ cfPtr->line = (int *)ckalloc(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 = ckalloc(sizeof(Proc));
+ procPtr = (Proc *)ckalloc(sizeof(Proc));
procPtr->iPtr = iPtr;
procPtr->refCount = 1;
procPtr->bodyPtr = bodyPtr;
@@ -634,7 +636,7 @@ TclCreateProc(
* local variables for the argument.
*/
- localPtr = ckalloc(offsetof(CompiledLocal, name) + fieldValues[0]->length +1);
+ localPtr = (CompiledLocal *)ckalloc(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);
@@ -1316,7 +1319,7 @@ InitLocalCache(
* for future calls.
*/
- localCachePtr = ckalloc(sizeof(LocalCache)
+ localCachePtr = (LocalCache *)ckalloc(sizeof(LocalCache)
+ (localCt - 1) * sizeof(Tcl_Obj *)
+ numArgs * sizeof(Var));
@@ -1381,6 +1384,7 @@ InitArgsAndLocals(
Var *varPtr, *defPtr;
int localCt = procPtr->numCompiledLocals, numArgs, argCt, i, imax;
Tcl_Obj *const *argObjs;
+ (void)procNameObj;
ByteCodeGetIntRep(procPtr->bodyPtr, &tclByteCodeType, codePtr);
@@ -1406,7 +1410,7 @@ InitArgsAndLocals(
* parameters.
*/
- varPtr = TclStackAlloc(interp, (int)(localCt * sizeof(Var)));
+ varPtr = (Var *)TclStackAlloc(interp, localCt * sizeof(Var));
framePtr->compiledLocals = varPtr;
framePtr->numCompiledLocals = localCt;
@@ -1544,7 +1548,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;
@@ -1784,7 +1788,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()) {
@@ -1961,6 +1965,9 @@ TclProcCompileProc(
fprintf(stdout, "%s\"\n", TclGetString(message));
Tcl_DecrRefCount(message);
}
+#else
+ (void)description;
+ (void)procName;
#endif
/*
@@ -2022,7 +2029,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);
@@ -2097,7 +2104,7 @@ void
TclProcDeleteProc(
ClientData clientData) /* Procedure to be deleted. */
{
- Proc *procPtr = clientData;
+ Proc *procPtr = (Proc *)clientData;
if (procPtr->refCount-- <= 1) {
TclProcCleanupProc(procPtr);
@@ -2172,7 +2179,7 @@ TclProcCleanupProc(
return;
}
- cfPtr = Tcl_GetHashValue(hePtr);
+ cfPtr = (CmdFrame *)Tcl_GetHashValue(hePtr);
if (cfPtr) {
if (cfPtr->type == TCL_LOCATION_SOURCE) {
@@ -2479,7 +2486,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) {
@@ -2515,12 +2522,12 @@ SetLambdaFromAny(
* location (line of 2nd list element).
*/
- cfPtr = ckalloc(sizeof(CmdFrame));
+ cfPtr = (CmdFrame *)ckalloc(sizeof(CmdFrame));
TclListLines(objPtr, contextPtr->line[1], 2, buf, NULL);
cfPtr->level = -1;
cfPtr->type = contextPtr->type;
- cfPtr->line = ckalloc(sizeof(int));
+ cfPtr->line = (int *)ckalloc(sizeof(int));
cfPtr->line[0] = buf[1];
cfPtr->nline = 1;
cfPtr->framePtr = NULL;
@@ -2639,6 +2646,7 @@ TclNRApplyObjCmd(
int result;
Tcl_Namespace *nsPtr;
ApplyExtraData *extraPtr;
+ (void)dummy;
if (objc < 2) {
Tcl_WrongNumArgs(interp, 1, objv, "lambdaExpr ?arg ...?");
@@ -2667,7 +2675,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;
@@ -2702,7 +2710,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 2f3f4ba..573baf4 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 b4fd811..74b384a 100644
--- a/generic/tclRegexp.c
+++ b/generic/tclRegexp.c
@@ -122,7 +122,7 @@ const Tcl_ObjType tclRegexpType = {
do { \
const Tcl_ObjIntRep *irPtr; \
irPtr = TclFetchIntRep((objPtr), &tclRegexpType); \
- (rePtr) = irPtr ? irPtr->twoPtrValue.ptr1 : NULL; \
+ (rePtr) = irPtr ? (TclRegexp *)irPtr->twoPtrValue.ptr1 : NULL; \
} while (0)
@@ -916,7 +916,7 @@ CompileRegexp(
* This is a new expression, so compile it and add it to the cache.
*/
- regexpPtr = ckalloc(sizeof(TclRegexp));
+ regexpPtr = (TclRegexp*)ckalloc(sizeof(TclRegexp));
regexpPtr->objPtr = NULL;
regexpPtr->string = NULL;
regexpPtr->details.rm_extend.rm_so = -1;
@@ -971,7 +971,7 @@ CompileRegexp(
*/
regexpPtr->matches =
- ckalloc(sizeof(regmatch_t) * (regexpPtr->re.re_nsub + 1));
+ (regmatch_t*)ckalloc(sizeof(regmatch_t) * (regexpPtr->re.re_nsub + 1));
/*
* Initialize the refcount to one initially, since it is in the cache.
@@ -997,7 +997,7 @@ CompileRegexp(
tsdPtr->patLengths[i+1] = tsdPtr->patLengths[i];
tsdPtr->regexps[i+1] = tsdPtr->regexps[i];
}
- tsdPtr->patterns[0] = ckalloc(length + 1);
+ tsdPtr->patterns[0] = (char *)ckalloc(length + 1);
memcpy(tsdPtr->patterns[0], string, length + 1);
tsdPtr->patLengths[0] = length;
tsdPtr->regexps[0] = regexpPtr;
@@ -1053,11 +1053,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 974737e..ca53014 100644
--- a/generic/tclResolve.c
+++ b/generic/tclResolve.c
@@ -101,9 +101,9 @@ Tcl_AddInterpResolvers(
* list, so that it overrides existing schemes.
*/
- resPtr = ckalloc(sizeof(ResolverScheme));
+ resPtr = (ResolverScheme *)ckalloc(sizeof(ResolverScheme));
len = strlen(name) + 1;
- resPtr->name = ckalloc(len);
+ resPtr->name = (char *)ckalloc(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 29c5aac..2336aad 100644
--- a/generic/tclResult.c
+++ b/generic/tclResult.c
@@ -77,7 +77,7 @@ Tcl_SaveInterpState(
int status) /* status code for current operation */
{
Interp *iPtr = (Interp *) interp;
- InterpState *statePtr = ckalloc(sizeof(InterpState));
+ InterpState *statePtr = (InterpState *)ckalloc(sizeof(InterpState));
statePtr->status = status;
statePtr->flags = iPtr->flags & ERR_ALREADY_LOGGED;
@@ -432,7 +432,7 @@ Tcl_SetResult(
int length = strlen(result);
if (length > TCL_RESULT_SIZE) {
- iPtr->result = ckalloc(length + 1);
+ iPtr->result = (char *)ckalloc(length + 1);
iPtr->freeProc = TCL_DYNAMIC;
} else {
iPtr->result = iPtr->resultSpace;
@@ -839,7 +839,7 @@ SetupAppendBuffer(
} else {
totalSpace *= 2;
}
- newSpace = ckalloc(totalSpace);
+ newSpace = (char *)ckalloc(totalSpace);
strcpy(newSpace, iPtr->result);
if (iPtr->appendResult != NULL) {
ckfree(iPtr->appendResult);
@@ -1174,8 +1174,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) {
/*
@@ -1226,7 +1226,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 aa48c09..054d935 100644
--- a/generic/tclScan.c
+++ b/generic/tclScan.c
@@ -29,15 +29,17 @@
* character set.
*/
+typedef struct {
+ Tcl_UniChar start;
+ Tcl_UniChar end;
+} Range;
+
typedef struct CharSet {
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 = ckalloc(sizeof(Tcl_UniChar) * (end - format - 1));
+ cset->chars = (Tcl_UniChar *)ckalloc(sizeof(Tcl_UniChar) * (end - format - 1));
if (nranges > 0) {
- cset->ranges = ckalloc(sizeof(struct Range) * nranges);
+ cset->ranges = (Range *)ckalloc(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 = ckalloc(sizeof(Tcl_Obj *) * totalVars);
+ objs = (Tcl_Obj **)ckalloc(sizeof(Tcl_Obj *) * totalVars);
for (i = 0; i < totalVars; i++) {
objs[i] = NULL;
}
diff --git a/generic/tclStrToD.c b/generic/tclStrToD.c
index 3dc2332..be26d0b 100644
--- a/generic/tclStrToD.c
+++ b/generic/tclStrToD.c
@@ -2336,13 +2336,13 @@ FormatInfAndNaN(
*decpt = 9999;
if (!(d->w.word1) && !(d->w.word0 & HI_ORDER_SIG_MASK)) {
- retval = ckalloc(9);
+ retval = (char *)ckalloc(9);
strcpy(retval, "Infinity");
if (endPtr) {
*endPtr = retval + 8;
}
} else {
- retval = ckalloc(4);
+ retval = (char *)ckalloc(4);
strcpy(retval, "NaN");
if (endPtr) {
*endPtr = retval + 3;
@@ -2373,7 +2373,7 @@ FormatZero(
int *decpt, /* Location of the decimal point. */
char **endPtr) /* Pointer to the end of the formatted data */
{
- char *retval = ckalloc(2);
+ char *retval = (char *)ckalloc(2);
strcpy(retval, "0");
if (endPtr) {
@@ -2919,7 +2919,7 @@ QuickConversion(
* Handle the peculiar case where the result has no significant digits.
*/
- retval = ckalloc(len + 1);
+ retval = (char *)ckalloc(len + 1);
if (ilim == 0) {
d -= 5.;
if (d > eps.d) {
@@ -3030,7 +3030,7 @@ ShorteningInt64Conversion(
char **endPtr) /* OUTPUT: Position of the terminal '\0' at
* the end of the returned string. */
{
- char *retval = ckalloc(len + 1);
+ char *retval = (char *)ckalloc(len + 1);
/* Output buffer. */
Tcl_WideUInt b = (bw * wuipow5[b5]) << b2;
/* Numerator of the fraction being
@@ -3194,7 +3194,7 @@ StrictInt64Conversion(
char **endPtr) /* OUTPUT: Position of the terminal '\0' at
* the end of the returned string. */
{
- char *retval = ckalloc(len + 1);
+ char *retval = (char *)ckalloc(len + 1);
/* Output buffer. */
Tcl_WideUInt b = (bw * wuipow5[b5]) << b2;
/* Numerator of the fraction being
@@ -3205,6 +3205,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.
@@ -3394,7 +3395,7 @@ ShorteningBignumConversionPowD(
char **endPtr) /* OUTPUT: Position of the terminal '\0' at
* the end of the returned string. */
{
- char *retval = ckalloc(len + 1);
+ char *retval = (char *)ckalloc(len + 1);
/* Output buffer. */
mp_int b; /* Numerator of the fraction being
* converted. */
@@ -3602,7 +3603,7 @@ StrictBignumConversionPowD(
char **endPtr) /* OUTPUT: Position of the terminal '\0' at
* the end of the returned string. */
{
- char *retval = ckalloc(len + 1);
+ char *retval = (char *)ckalloc(len + 1);
/* Output buffer. */
mp_int b; /* Numerator of the fraction being
* converted. */
@@ -3610,6 +3611,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
@@ -3802,7 +3804,7 @@ ShorteningBignumConversion(
int *decpt, /* OUTPUT: Position of the decimal point. */
char **endPtr) /* OUTPUT: Pointer to the end of the number */
{
- char *retval = ckalloc(len+1);
+ char *retval = (char *)ckalloc(len+1);
/* Buffer of digits to return. */
char *s = retval; /* Cursor in the return value. */
mp_int b; /* Numerator of the result. */
@@ -4037,7 +4039,7 @@ StrictBignumConversion(
int *decpt, /* OUTPUT: Position of the decimal point. */
char **endPtr) /* OUTPUT: Pointer to the end of the number */
{
- char *retval = ckalloc(len+1);
+ char *retval = (char *)ckalloc(len+1);
/* Buffer of digits to return. */
char *s = retval; /* Cursor in the return value. */
mp_int b; /* Numerator of the result. */
@@ -4047,6 +4049,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 3de29ef..6ab2371 100644
--- a/generic/tclStringObj.c
+++ b/generic/tclStringObj.c
@@ -143,7 +143,7 @@ GrowStringBuffer(
if (flag == 0 || stringPtr->allocated > 0) {
if (needed <= INT_MAX / 2) {
attempt = 2 * needed;
- ptr = attemptckrealloc(objPtr->bytes, attempt + 1);
+ ptr = (char *)attemptckrealloc(objPtr->bytes, attempt + 1);
}
if (ptr == NULL) {
/*
@@ -156,7 +156,7 @@ GrowStringBuffer(
int growth = (int) ((extra > limit) ? limit : extra);
attempt = needed + growth;
- ptr = attemptckrealloc(objPtr->bytes, attempt + 1);
+ ptr = (char *)attemptckrealloc(objPtr->bytes, attempt + 1);
}
}
if (ptr == NULL) {
@@ -165,7 +165,7 @@ GrowStringBuffer(
*/
attempt = needed;
- ptr = ckrealloc(objPtr->bytes, attempt + 1);
+ ptr = (char *)ckrealloc(objPtr->bytes, attempt + 1);
}
objPtr->bytes = ptr;
stringPtr->allocated = attempt;
@@ -347,6 +347,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 */
@@ -881,9 +884,9 @@ Tcl_SetObjLength(
* Need to enlarge the buffer.
*/
if (objPtr->bytes == &tclEmptyString) {
- objPtr->bytes = ckalloc(length + 1);
+ objPtr->bytes = (char *)ckalloc(length + 1);
} else {
- objPtr->bytes = ckrealloc(objPtr->bytes, length + 1);
+ objPtr->bytes = (char *)ckrealloc(objPtr->bytes, length + 1);
}
stringPtr->allocated = length;
}
@@ -987,9 +990,9 @@ Tcl_AttemptSetObjLength(
char *newBytes;
if (objPtr->bytes == &tclEmptyString) {
- newBytes = attemptckalloc(length + 1);
+ newBytes = (char *)attemptckalloc(length + 1);
} else {
- newBytes = attemptckrealloc(objPtr->bytes, length + 1);
+ newBytes = (char *)attemptckrealloc(objPtr->bytes, length + 1);
}
if (newBytes == NULL) {
return 0;
@@ -3583,7 +3586,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 -1;
@@ -4166,9 +4169,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/tclStubInit.c b/generic/tclStubInit.c
index 6a588a5..f30f2d8 100644
--- a/generic/tclStubInit.c
+++ b/generic/tclStubInit.c
@@ -73,18 +73,18 @@
#undef Tcl_UtfToUniChar
#if TCL_UTF_MAX > 3
-static void uniCodePanic() {
+static void uniCodePanic(void) {
Tcl_Panic("This extension uses a deprecated function, not available now: Tcl is compiled with -DTCL_UTF_MAX==%d", TCL_UTF_MAX);
}
-# define Tcl_GetUnicode (int *(*)(Tcl_Obj *)) uniCodePanic
-# define Tcl_GetUnicodeFromObj (int *(*)(Tcl_Obj *, Tcl_UniChar *)) uniCodePanic
-# define Tcl_NewUnicodeObj (Tcl_Obj *(*)(const int *, Tcl_UniChar)) uniCodePanic
-# define Tcl_SetUnicodeObj (void(*)(Tcl_Obj *, const Tcl_UniChar *, int)) uniCodePanic
-# define Tcl_AppendUnicodeToObj (void(*)(Tcl_Obj *, const Tcl_UniChar *, int)) uniCodePanic
-# define Tcl_UniCharNcasecmp (int(*)(const Tcl_UniChar *, const Tcl_UniChar *, unsigned long)) uniCodePanic
-# define Tcl_UniCharCaseMatch (int(*)(const Tcl_UniChar *, const Tcl_UniChar *, int)) uniCodePanic
-# define Tcl_UniCharLen (int(*)(const Tcl_UniChar *)) uniCodePanic
-# define Tcl_UniCharNcmp (int(*)(const Tcl_UniChar *, const Tcl_UniChar *, unsigned long)) uniCodePanic
+# define Tcl_GetUnicode (int *(*)(Tcl_Obj *))(void *)uniCodePanic
+# define Tcl_GetUnicodeFromObj (int *(*)(Tcl_Obj *, Tcl_UniChar *))(void *)uniCodePanic
+# define Tcl_NewUnicodeObj (Tcl_Obj *(*)(const int *, Tcl_UniChar))(void *)uniCodePanic
+# define Tcl_SetUnicodeObj (void(*)(Tcl_Obj *, const Tcl_UniChar *, int))(void *)uniCodePanic
+# define Tcl_AppendUnicodeToObj (void(*)(Tcl_Obj *, const Tcl_UniChar *, int))(void *)uniCodePanic
+# define Tcl_UniCharNcasecmp (int(*)(const Tcl_UniChar *, const Tcl_UniChar *, unsigned long))(void *)uniCodePanic
+# define Tcl_UniCharCaseMatch (int(*)(const Tcl_UniChar *, const Tcl_UniChar *, int))(void *)uniCodePanic
+# define Tcl_UniCharLen (int(*)(const Tcl_UniChar *))(void *)uniCodePanic
+# define Tcl_UniCharNcmp (int(*)(const Tcl_UniChar *, const Tcl_UniChar *, unsigned long))(void *)uniCodePanic
#endif
#define TclBN_mp_add mp_add
@@ -269,6 +269,7 @@ mp_err TclBN_mp_div_3(const mp_int *a, mp_int *c, unsigned int *d) {
int TclBN_mp_expt_d_ex(const mp_int *a, unsigned int b, mp_int *c, int fast)
{
+ (void)fast;
return TclBN_mp_expt_u32(a, b, c);
}
@@ -512,7 +513,7 @@ static int uniCharNcmp(const Tcl_UniChar *ucs, const Tcl_UniChar *uct, unsigned
static int uniCharNcasecmp(const Tcl_UniChar *ucs, const Tcl_UniChar *uct, unsigned int n){
return Tcl_UniCharNcasecmp(ucs, uct, (unsigned long)n);
}
-#define Tcl_UniCharNcasecmp (int(*)(const Tcl_UniChar*,const Tcl_UniChar*,unsigned long))uniCharNcasecmp
+#define Tcl_UniCharNcasecmp (int(*)(const Tcl_UniChar*,const Tcl_UniChar*,unsigned long))(void *)uniCharNcasecmp
#endif
static int utfNcmp(const char *s1, const char *s2, unsigned int n){
return Tcl_UtfNcmp(s1, s2, (unsigned long)n);
diff --git a/generic/tclTest.c b/generic/tclTest.c
index 9270727..634f22b 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 = ckalloc(sizeof(TestAsyncHandler));
- asyncPtr->command = ckalloc(strlen(argv[2]) + 1);
+ asyncPtr = (TestAsyncHandler *)ckalloc(sizeof(TestAsyncHandler));
+ asyncPtr->command = (char *)ckalloc(strlen(argv[2]) + 1);
strcpy(asyncPtr->command, argv[2]);
Tcl_MutexLock(&asyncTestMutex);
asyncPtr->id = nextId;
@@ -1060,6 +1060,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;
@@ -1095,6 +1097,7 @@ TestcmdinfoCmd(
const char **argv) /* Argument strings. */
{
Tcl_CmdInfo info;
+ (void)dummy;
if (argc != 3) {
Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
@@ -1165,6 +1168,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;
}
@@ -1177,6 +1183,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;
}
@@ -1227,6 +1236,7 @@ TestcmdtokenCmd(
Tcl_Command token;
int *l;
char buf[30];
+ (void)dummy;
if (argc != 3) {
Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
@@ -1290,6 +1300,7 @@ TestcmdtraceCmd(
{
Tcl_DString buffer;
int result;
+ (void)dummy;
if (argc != 3) {
Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
@@ -1387,6 +1398,10 @@ CmdTraceProc(
{
Tcl_DString *bufPtr = (Tcl_DString *) clientData;
int i;
+ (void)interp;
+ (void)level;
+ (void)cmdProc;
+ (void)cmdClientData;
Tcl_DStringAppendElement(bufPtr, command);
@@ -1399,7 +1414,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
@@ -1410,6 +1425,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
@@ -1421,7 +1444,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 */
@@ -1430,6 +1453,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));
@@ -1483,6 +1511,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);
@@ -1508,13 +1538,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);
@@ -1530,13 +1563,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) {
@@ -1575,6 +1611,7 @@ TestdcallCmd(
const char **argv) /* Argument strings. */
{
int i, id;
+ (void)dummy;
delInterp = Tcl_CreateInterp();
Tcl_DStringInit(&delString);
@@ -1641,6 +1678,7 @@ TestdelCmd(
{
DelCmd *dPtr;
Tcl_Interp *slave;
+ (void)dummy;
if (argc != 4) {
Tcl_AppendResult(interp, "wrong # args", NULL);
@@ -1652,9 +1690,9 @@ TestdelCmd(
return TCL_ERROR;
}
- dPtr = ckalloc(sizeof(DelCmd));
+ dPtr = (DelCmd*)ckalloc(sizeof(DelCmd));
dPtr->interp = interp;
- dPtr->deleteCmd = ckalloc(strlen(argv[3]) + 1);
+ dPtr->deleteCmd = (char *)ckalloc(strlen(argv[3]) + 1);
strcpy(dPtr->deleteCmd, argv[3]);
Tcl_CreateCommand(slave, argv[2], DelCmdProc, dPtr,
@@ -1670,6 +1708,8 @@ DelCmdProc(
const char **argv) /* Argument strings. */
{
DelCmd *dPtr = (DelCmd *) clientData;
+ (void)argc;
+ (void)argv;
Tcl_AppendResult(interp, dPtr->deleteCmd, NULL);
ckfree(dPtr->deleteCmd);
@@ -1681,7 +1721,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);
@@ -1709,11 +1749,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);
@@ -1745,7 +1787,7 @@ TestdelassocdataCmd(
*/
static int
-TestdoubledigitsObjCmd(void *unused,
+TestdoubledigitsObjCmd(void *dummy,
/* NULL */
Tcl_Interp* interp,
/* Tcl interpreter */
@@ -1777,6 +1819,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?");
@@ -1843,6 +1886,7 @@ TestdstringCmd(
const char **argv) /* Argument strings. */
{
int count;
+ (void)dummy;
if (argc < 2) {
wrongNumArgs:
@@ -1886,7 +1930,7 @@ TestdstringCmd(
} else if (strcmp(argv[2], "staticlarge") == 0) {
Tcl_AppendResult(interp, "first0 first1 first2 first3 first4 first5 first6 first7 first8 first9\nsecond0 second1 second2 second3 second4 second5 second6 second7 second8 second9\nthird0 third1 third2 third3 third4 third5 third6 third7 third8 third9\nfourth0 fourth1 fourth2 fourth3 fourth4 fourth5 fourth6 fourth7 fourth8 fourth9\nfifth0 fifth1 fifth2 fifth3 fifth4 fifth5 fifth6 fifth7 fifth8 fifth9\nsixth0 sixth1 sixth2 sixth3 sixth4 sixth5 sixth6 sixth7 sixth8 sixth9\nseventh0 seventh1 seventh2 seventh3 seventh4 seventh5 seventh6 seventh7 seventh8 seventh9\n", NULL);
} else if (strcmp(argv[2], "free") == 0) {
- char *s = ckalloc(100);
+ char *s = (char *)ckalloc(100);
strcpy(s, "This is a malloc-ed string");
Tcl_SetResult(interp, s, TCL_DYNAMIC);
} else if (strcmp(argv[2], "special") == 0) {
@@ -1938,9 +1982,9 @@ TestdstringCmd(
* Tcl_DStringGetResult handles freeProc's other than free.
*/
-static void SpecialFree(blockPtr)
- char *blockPtr; /* Block to free. */
-{
+static void SpecialFree(
+ char *blockPtr /* Block to free. */
+) {
ckfree(blockPtr - 16);
}
@@ -1979,6 +2023,7 @@ TestencodingObjCmd(
enum options {
ENC_CREATE, ENC_DELETE
};
+ (void)dummy;
if (Tcl_GetIndexFromObj(interp, objv[1], optionStrings, "option", 0,
&index) != TCL_OK) {
@@ -1992,15 +2037,15 @@ TestencodingObjCmd(
if (objc != 5) {
return TCL_ERROR;
}
- encodingPtr = ckalloc(sizeof(TclEncoding));
+ encodingPtr = (TclEncoding*)ckalloc(sizeof(TclEncoding));
encodingPtr->interp = interp;
string = Tcl_GetStringFromObj(objv[3], &length);
- encodingPtr->toUtfCmd = ckalloc(length + 1);
+ encodingPtr->toUtfCmd = (char *)ckalloc(length + 1);
memcpy(encodingPtr->toUtfCmd, string, length + 1);
string = Tcl_GetStringFromObj(objv[4], &length);
- encodingPtr->fromUtfCmd = ckalloc(length + 1);
+ encodingPtr->fromUtfCmd = (char *)ckalloc(length + 1);
memcpy(encodingPtr->fromUtfCmd, string, length + 1);
string = Tcl_GetStringFromObj(objv[2], &length);
@@ -2045,6 +2090,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);
@@ -2077,6 +2125,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);
@@ -2098,7 +2149,7 @@ static void
EncodingFreeProc(
void *clientData) /* ClientData associated with type. */
{
- TclEncoding *encodingPtr = clientData;
+ TclEncoding *encodingPtr = (TclEncoding *)clientData;
ckfree(encodingPtr->toUtfCmd);
ckfree(encodingPtr->fromUtfCmd);
@@ -2131,6 +2182,7 @@ TestevalexObjCmd(
{
int length, flags;
const char *script;
+ (void)dummy;
flags = 0;
if (objc == 3) {
@@ -2175,6 +2227,7 @@ TestevalobjvObjCmd(
Tcl_Obj *const objv[]) /* Argument objects. */
{
int evalGlobal;
+ (void)dummy;
if (objc < 3) {
Tcl_WrongNumArgs(interp, 1, objv, "global word ?word ...?");
@@ -2218,7 +2271,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 */
@@ -2238,6 +2291,7 @@ TesteventObjCmd(
TCL_QUEUE_MARK
};
TestEvent *ev; /* Event to be queued */
+ (void)dummy;
if (objc < 2) {
Tcl_WrongNumArgs(interp, 1, objv, "subcommand ?arg ...?");
@@ -2257,7 +2311,7 @@ TesteventObjCmd(
"position specifier", TCL_EXACT, &posIndex) != TCL_OK) {
return TCL_ERROR;
}
- ev = ckalloc(sizeof(TestEvent));
+ ev = (TestEvent *)ckalloc(sizeof(TestEvent));
ev->header.proc = TesteventProc;
ev->header.nextPtr = NULL;
ev->interp = interp;
@@ -2311,6 +2365,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,
@@ -2397,12 +2452,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],
@@ -2473,7 +2529,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. */
@@ -2481,6 +2537,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],
@@ -2516,7 +2573,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. */
@@ -2524,6 +2581,7 @@ TestexprlongobjCmd(
long exprResult;
char buf[4 + TCL_INTEGER_SPACE];
int result;
+ (void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "expression");
@@ -2558,7 +2616,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. */
@@ -2566,6 +2624,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],
@@ -2602,7 +2661,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. */
@@ -2610,6 +2669,7 @@ TestexprdoubleobjCmd(
double exprResult;
char buf[4 + TCL_DOUBLE_SPACE];
int result;
+ (void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "expression");
@@ -2644,11 +2704,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);
@@ -2676,12 +2738,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?");
@@ -2743,12 +2806,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],
@@ -2781,13 +2845,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();
@@ -2828,6 +2893,7 @@ TestinterpdeleteCmd(
const char **argv) /* Argument strings. */
{
Tcl_Interp *slaveToDelete;
+ (void)dummy;
if (argc != 2) {
Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
@@ -2886,6 +2952,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],
@@ -3115,7 +3182,7 @@ TestlinkCmd(
if (strcmp(argv[5], "-") == 0) {
stringVar = NULL;
} else {
- stringVar = ckalloc(strlen(argv[5]) + 1);
+ stringVar = (char *)ckalloc(strlen(argv[5]) + 1);
strcpy(stringVar, argv[5]);
}
}
@@ -3222,7 +3289,7 @@ TestlinkCmd(
if (strcmp(argv[5], "-") == 0) {
stringVar = NULL;
} else {
- stringVar = ckalloc(strlen(argv[5]) + 1);
+ stringVar = (char *)ckalloc(strlen(argv[5]) + 1);
strcpy(stringVar, argv[5]);
}
Tcl_UpdateLinkedVar(interp, "string");
@@ -3331,7 +3398,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. */
@@ -3355,6 +3422,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");
@@ -3449,14 +3517,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
@@ -3465,6 +3532,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.
@@ -3512,8 +3580,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;
+
ckfree(clientData);
}
@@ -3536,7 +3606,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. */
@@ -3544,6 +3614,7 @@ TestparserObjCmd(
const char *script;
int length, dummy;
Tcl_Parse parse;
+ (void)dummy1;
if (objc != 3) {
Tcl_WrongNumArgs(interp, 1, objv, "script length");
@@ -3592,7 +3663,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. */
@@ -3600,6 +3671,7 @@ TestexprparserObjCmd(
const char *script;
int length, dummy;
Tcl_Parse parse;
+ (void)dummy1;
if (objc != 3) {
Tcl_WrongNumArgs(interp, 1, objv, "expr length");
@@ -3739,12 +3811,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");
@@ -3780,7 +3853,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. */
@@ -3788,6 +3861,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");
@@ -3843,12 +3917,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;
}
@@ -3872,13 +3950,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");
@@ -3937,6 +4016,7 @@ TestregexpObjCmd(
REGEXP_XFLAGS,
REGEXP_LAST
};
+ (void)dummy;
indices = 0;
about = 0;
@@ -4243,6 +4323,11 @@ TestreturnObjCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
+ (void)dummy;
+ (void)interp;
+ (void)objc;
+ (void)objv;
+
return TCL_RETURN;
}
@@ -4266,13 +4351,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],
@@ -4280,7 +4366,7 @@ TestsetassocdataCmd(
return TCL_ERROR;
}
- buf = ckalloc(strlen(argv[2]) + 1);
+ buf = (char *)ckalloc(strlen(argv[2]) + 1);
strcpy(buf, argv[2]);
/*
@@ -4317,13 +4403,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();
@@ -4372,6 +4459,7 @@ TeststaticpkgCmd(
const char **argv) /* Argument strings. */
{
int safe, loaded;
+ (void)dummy;
if (argc != 4) {
Tcl_AppendResult(interp, "wrong # arguments: should be \"",
@@ -4424,6 +4512,7 @@ TesttranslatefilenameCmd(
{
Tcl_DString buffer;
const char *result;
+ (void)dummy;
if (argc != 2) {
Tcl_AppendResult(interp, "wrong # arguments: should be \"",
@@ -4465,6 +4554,7 @@ TestupvarCmd(
const char **argv) /* Argument strings. */
{
int flags = 0;
+ (void)dummy;
if ((argc != 5) && (argc != 6)) {
Tcl_AppendResult(interp, "wrong # arguments: should be \"",
@@ -4517,6 +4607,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;
@@ -4570,6 +4662,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;
}
@@ -4594,7 +4688,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. */
@@ -4602,6 +4696,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],
@@ -4672,6 +4767,8 @@ TestpanicCmd(
const char **argv) /* Argument strings. */
{
char *argString;
+ (void)dummy;
+ (void)interp;
/*
* Put the arguments into a var args structure
@@ -4695,6 +4792,7 @@ TestfileCmd(
int force, i, j, result;
Tcl_Obj *error = NULL;
const char *subcmd;
+ (void)dummy;
if (argc < 3) {
return TCL_ERROR;
@@ -4779,6 +4877,7 @@ TestgetvarfullnameCmd(
Tcl_Namespace *namespacePtr;
Tcl_CallFrame *framePtr;
Tcl_Var variable;
+ (void)dummy;
if (objc != 3) {
Tcl_WrongNumArgs(interp, 1, objv, "name scope");
@@ -4843,10 +4942,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;
@@ -4855,12 +4954,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 = ckalloc(sizeof(Tcl_Obj));
+ objPtr = (Tcl_Obj *)ckalloc(sizeof(Tcl_Obj));
ckfree(objPtr);
}
Tcl_GetTime(&stop);
@@ -4869,10 +4971,10 @@ GetTimesObjCmd(
/* alloc 5000 times */
fprintf(stderr, "alloc 5000 6 word items\n");
- objv = ckalloc(5000 * sizeof(Tcl_Obj *));
+ objv = (Tcl_Obj **)ckalloc(5000 * sizeof(Tcl_Obj *));
Tcl_GetTime(&start);
for (i = 0; i < 5000; i++) {
- objv[i] = ckalloc(sizeof(Tcl_Obj));
+ objv[i] = (Tcl_Obj *)ckalloc(sizeof(Tcl_Obj));
}
Tcl_GetTime(&stop);
timePer = (stop.sec - start.sec)*1000000 + (stop.usec - start.usec);
@@ -5022,11 +5124,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;
}
@@ -5049,11 +5156,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;
}
@@ -5074,13 +5186,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");
@@ -5114,12 +5227,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?");
@@ -5134,7 +5248,7 @@ TestpurebytesobjObjCmd(
if (objc == 2) {
const char *s = Tcl_GetString(objv[1]);
objPtr->length = objv[1]->length;
- objPtr->bytes = ckalloc(objPtr->length + 1);
+ objPtr->bytes = (char *)ckalloc(objPtr->length + 1);
memcpy(objPtr->bytes, s, objPtr->length);
objPtr->bytes[objPtr->length] = 0;
}
@@ -5161,13 +5275,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");
@@ -5300,6 +5415,7 @@ TestsaveresultCmd(
enum options {
RESULT_APPEND, RESULT_DYNAMIC, RESULT_FREE, RESULT_OBJECT, RESULT_SMALL
};
+ (void)dummy;
/*
* Parse arguments
@@ -5327,7 +5443,7 @@ TestsaveresultCmd(
Tcl_AppendResult(interp, "append result", NULL);
break;
case RESULT_FREE: {
- char *buf = ckalloc(200);
+ char *buf = (char *)ckalloc(200);
strcpy(buf, "free result");
Tcl_SetResult(interp, buf, TCL_DYNAMIC);
@@ -5394,6 +5510,7 @@ static void
TestsaveresultFree(
char *blockPtr)
{
+ (void)blockPtr;
freeCount++;
}
@@ -5421,6 +5538,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());
@@ -5482,9 +5602,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;
}
/*
@@ -5511,8 +5636,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;
}
/*
@@ -5535,7 +5665,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. */
@@ -5551,6 +5681,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],
@@ -5649,7 +5780,7 @@ TestChannelCmd(
/* Remember the channel in the pool of detached channels */
- det = ckalloc(sizeof(TestChannel));
+ det = (TestChannel *)ckalloc(sizeof(TestChannel));
det->chan = chan;
det->nextPtr = firstDetached;
firstDetached = det;
@@ -5841,7 +5972,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;
}
@@ -5882,7 +6013,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;
@@ -5939,7 +6070,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;
@@ -6015,6 +6146,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],
@@ -6047,7 +6179,7 @@ TestChannelEventCmd(
return TCL_ERROR;
}
- esPtr = ckalloc(sizeof(EventScriptRecord));
+ esPtr = (EventScriptRecord *)ckalloc(sizeof(EventScriptRecord));
esPtr->nextPtr = statePtr->scriptRecordPtr;
statePtr->scriptRecordPtr = esPtr;
@@ -6217,13 +6349,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],
@@ -6291,6 +6424,7 @@ TestWrongNumArgsObjCmd(
{
int i, length;
const char *msg;
+ (void)dummy;
if (objc < 3) {
/*
@@ -6349,6 +6483,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");
@@ -6401,6 +6536,7 @@ TestFilesystemObjCmd(
{
int res, boolVal;
const char *msg;
+ (void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "boolean");
@@ -6473,7 +6609,7 @@ TestReportFreeInternalRep(
}
}
-static ClientData
+static void *
TestReportDupInternalRep(
void *clientData)
{
@@ -6730,10 +6866,12 @@ TestReportUtime(
static int
TestReportNormalizePath(
- Tcl_Interp *interp,
+ Tcl_Interp *dummy,
Tcl_Obj *pathPtr,
int nextCheckpoint)
{
+ (void)dummy;
+
TestReport("normalizepath", pathPtr, NULL);
return nextCheckpoint;
}
@@ -6741,9 +6879,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;
@@ -6777,6 +6916,7 @@ TestSimpleFilesystemObjCmd(
{
int res, boolVal;
const char *msg;
+ (void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "boolean");
@@ -6930,11 +7070,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;
@@ -6953,11 +7095,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;
@@ -6975,11 +7119,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;
@@ -7025,6 +7171,7 @@ TestcpuidCmd(
int status, index, i;
int regs[4];
Tcl_Obj *regsObjs[4];
+ (void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "eax");
@@ -7053,7 +7200,7 @@ TestcpuidCmd(
static int
TestHashSystemHashCmd(
- void *clientData,
+ void *dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
@@ -7065,6 +7212,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;
@@ -7134,6 +7282,8 @@ TestgetintCmd(
int argc,
const char **argv)
{
+ (void)dummy;
+
if (argc < 2) {
Tcl_AppendResult(interp, "wrong # args", NULL);
return TCL_ERROR;
@@ -7161,6 +7311,9 @@ TestlongsizeCmd(
int argc,
const char **argv)
{
+ (void)dummy;
+ (void)argv;
+
if (argc != 1) {
Tcl_AppendResult(interp, "wrong # args", NULL);
return TCL_ERROR;
@@ -7176,6 +7329,7 @@ NREUnwind_callback(
int result)
{
int none;
+ (void)result;
if (data[0] == INT2PTR(-1)) {
Tcl_NRAddCallback(interp, NREUnwind_callback, &none, INT2PTR(-1),
@@ -7198,11 +7352,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.
@@ -7216,7 +7373,7 @@ TestNREUnwind(
static int
TestNRELevels(
- void *clientData,
+ void *dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
@@ -7227,6 +7384,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;
@@ -7280,6 +7440,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
@@ -7568,11 +7731,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;
@@ -7601,11 +7766,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;
@@ -7647,6 +7814,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) {
@@ -7678,6 +7846,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:
@@ -7765,6 +7935,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.
*/
@@ -7852,14 +8028,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 = ckalloc(sizeof(MyResolvedVarInfo));
+ MyResolvedVarInfo *resVarInfo = (MyResolvedVarInfo *)ckalloc(sizeof(MyResolvedVarInfo));
resVarInfo->vInfo.fetchProc = MyCompiledVarFetch;
resVarInfo->vInfo.deleteProc = MyCompiledVarFree;
@@ -7874,7 +8054,7 @@ InterpCompiledVarResolver(
static int
TestInterpResolverCmd(
- void *clientData,
+ void *dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
@@ -7884,6 +8064,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 94ec34a..cfe7886 100644
--- a/generic/tclTestObj.c
+++ b/generic/tclTestObj.c
@@ -42,28 +42,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;
@@ -158,7 +158,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 */
@@ -174,6 +174,7 @@ TestbignumobjCmd(
const char *string;
mp_int bignumValue;
Tcl_Obj **varPtr;
+ (void)dummy;
if (objc < 3) {
Tcl_WrongNumArgs(interp, 1, objv, "option ?arg ...?");
@@ -357,7 +358,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. */
@@ -365,6 +366,7 @@ TestbooleanobjCmd(
int varIndex, boolValue;
const char *index, *subCmd;
Tcl_Obj **varPtr;
+ (void)dummy;
if (objc < 3) {
wrongNumArgs:
@@ -457,7 +459,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. */
@@ -466,6 +468,7 @@ TestdoubleobjCmd(
double doubleValue;
const char *index, *subCmd, *string;
Tcl_Obj **varPtr;
+ (void)dummy;
if (objc < 3) {
wrongNumArgs:
@@ -575,7 +578,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. */
@@ -583,6 +586,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
*/
@@ -592,6 +596,7 @@ TestindexobjCmd(
int index; /* Selected index into table. */
};
struct IndexRep *indexRep;
+ (void)dummy;
if ((objc == 3) && (strcmp(Tcl_GetString(objv[1]),
"check") == 0)) {
@@ -606,7 +611,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);
@@ -628,7 +633,7 @@ TestindexobjCmd(
return TCL_ERROR;
}
- argv = ckalloc((objc-3) * sizeof(char *));
+ argv = (const char **)ckalloc((objc-3) * sizeof(char *));
for (i = 4; i < objc; i++) {
argv[i-4] = Tcl_GetString(objv[i]);
}
@@ -664,7 +669,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. */
@@ -673,6 +678,7 @@ TestintobjCmd(
Tcl_WideInt wideValue;
const char *index, *subCmd, *string;
Tcl_Obj **varPtr;
+ (void)dummy;
if (objc < 3) {
wrongNumArgs:
@@ -868,7 +874,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 */
@@ -891,6 +897,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...?");
@@ -965,7 +972,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. */
@@ -974,6 +981,7 @@ TestobjCmd(
const char *index, *subCmd, *string;
const Tcl_ObjType *targetType;
Tcl_Obj **varPtr;
+ (void)dummy;
if (objc < 2) {
wrongNumArgs:
@@ -1177,7 +1185,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. */
@@ -1193,6 +1201,7 @@ TeststringobjCmd(
"set", "set2", "setlength", "maxchars", "appendself",
"appendself2", NULL
};
+ (void)dummy;
if (objc < 3) {
wrongNumArgs:
@@ -1295,7 +1304,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;
@@ -1349,7 +1358,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 11e841f..b6ac741 100644
--- a/generic/tclTestProcBodyObj.c
+++ b/generic/tclTestProcBodyObj.c
@@ -45,9 +45,9 @@ typedef struct CmdTable {
* Declarations for functions defined in this file.
*/
-static int ProcBodyTestProcObjCmd(ClientData dummy,
+static int ProcBodyTestProcObjCmd(void *dummy,
Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]);
-static int ProcBodyTestCheckObjCmd(ClientData dummy,
+static int ProcBodyTestCheckObjCmd(void *dummy,
Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]);
static int ProcBodyTestInitInternal(Tcl_Interp *interp, int isSafe);
static int RegisterCommand(Tcl_Interp* interp,
@@ -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 661ac2f..6d59c66 100644
--- a/generic/tclThread.c
+++ b/generic/tclThread.c
@@ -164,7 +164,7 @@ RememberSyncObject(
if (recPtr->num >= recPtr->max) {
recPtr->max += 8;
- newList = ckalloc(recPtr->max * sizeof(void *));
+ newList = (void **)ckalloc(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 8dfe014..df685eb 100644
--- a/generic/tclThreadAlloc.c
+++ b/generic/tclThreadAlloc.c
@@ -162,7 +162,7 @@ static __thread Cache *tcachePtr;
#else
# define GETCACHE(cachePtr) \
do { \
- (cachePtr) = TclpGetAllocCache(); \
+ (cachePtr) = (Cache*)TclpGetAllocCache(); \
if ((cachePtr) == NULL) { \
(cachePtr) = GetCache(); \
} \
@@ -209,9 +209,9 @@ GetCache(void)
* Get this thread's cache, allocating if necessary.
*/
- cachePtr = TclpGetAllocCache();
+ cachePtr = (Cache*)TclpGetAllocCache();
if (cachePtr == NULL) {
- cachePtr = TclpSysAlloc(sizeof(Cache), 0);
+ cachePtr = (Cache*)TclpSysAlloc(sizeof(Cache), 0);
if (cachePtr == NULL) {
Tcl_Panic("alloc: could not allocate new cache");
}
@@ -246,7 +246,7 @@ void
TclFreeAllocCache(
void *arg)
{
- Cache *cachePtr = arg;
+ Cache *cachePtr = (Cache*)arg;
Cache **nextPtrPtr;
unsigned int bucket;
@@ -337,7 +337,7 @@ TclpAlloc(
#endif
if (size > MAXALLOC) {
bucket = NBUCKETS;
- blockPtr = TclpSysAlloc(size, 0);
+ blockPtr = (Block *)TclpSysAlloc(size, 0);
if (blockPtr != NULL) {
cachePtr->totalAssigned += reqSize;
}
@@ -491,7 +491,7 @@ TclpRealloc(
} else if (size > MAXALLOC) {
cachePtr->totalAssigned -= blockPtr->blockReqSize;
cachePtr->totalAssigned += reqSize;
- blockPtr = TclpSysRealloc(blockPtr, size);
+ blockPtr = (Block*)TclpSysRealloc(blockPtr, size);
if (blockPtr == NULL) {
return NULL;
}
@@ -510,7 +510,7 @@ TclpRealloc(
memcpy(newPtr, ptr, reqSize);
TclpFree(ptr);
}
- return newPtr;
+ return (char *)newPtr;
}
/*
@@ -563,7 +563,7 @@ TclThreadAllocObj(void)
Tcl_Obj *newObjsPtr;
cachePtr->numObjects = numMove = NOBJALLOC;
- newObjsPtr = TclpSysAlloc(sizeof(Tcl_Obj) * numMove, 0);
+ newObjsPtr = (Tcl_Obj *)TclpSysAlloc(sizeof(Tcl_Obj) * numMove, 0);
if (newObjsPtr == NULL) {
Tcl_Panic("alloc: could not allocate %d new objects", numMove);
}
@@ -582,7 +582,7 @@ TclThreadAllocObj(void)
*/
objPtr = cachePtr->firstObjPtr;
- cachePtr->firstObjPtr = objPtr->internalRep.twoPtrValue.ptr1;
+ cachePtr->firstObjPtr = (Tcl_Obj *)objPtr->internalRep.twoPtrValue.ptr1;
cachePtr->numObjects--;
return objPtr;
}
@@ -721,9 +721,9 @@ MoveObjs(
*/
while (--numMove) {
- objPtr = objPtr->internalRep.twoPtrValue.ptr1;
+ objPtr = (Tcl_Obj *)objPtr->internalRep.twoPtrValue.ptr1;
}
- fromPtr->firstObjPtr = objPtr->internalRep.twoPtrValue.ptr1;
+ fromPtr->firstObjPtr = (Tcl_Obj *)objPtr->internalRep.twoPtrValue.ptr1;
/*
* Move all objects as a block - they are already linked to each other, we
@@ -766,7 +766,7 @@ PutObjs(
} else {
do {
lastPtr = firstPtr;
- firstPtr = firstPtr->internalRep.twoPtrValue.ptr1;
+ firstPtr = (Tcl_Obj *)firstPtr->internalRep.twoPtrValue.ptr1;
} while (--keep > 0);
lastPtr->internalRep.twoPtrValue.ptr1 = NULL;
}
@@ -875,6 +875,8 @@ UnlockBucket(
Cache *cachePtr,
int bucket)
{
+ (void)cachePtr;
+
Tcl_MutexUnlock(bucketInfo[bucket].lockPtr);
}
@@ -1032,7 +1034,7 @@ GetBlocks(
if (blockPtr == NULL) {
size = MAXALLOC;
- blockPtr = TclpSysAlloc(size, 0);
+ blockPtr = (Block*)TclpSysAlloc(size, 0);
if (blockPtr == NULL) {
return 0;
}
@@ -1147,7 +1149,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 5c70a62..0aff0a7 100644
--- a/generic/tclThreadJoin.c
+++ b/generic/tclThreadJoin.c
@@ -230,7 +230,7 @@ TclRememberJoinableThread(
{
JoinableThread *threadPtr;
- threadPtr = ckalloc(sizeof(JoinableThread));
+ threadPtr = (JoinableThread *)ckalloc(sizeof(JoinableThread));
threadPtr->id = id;
threadPtr->done = 0;
threadPtr->waitedUpon = 0;
diff --git a/generic/tclThreadStorage.c b/generic/tclThreadStorage.c
index b56ec80..99e6bac 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), 0);
+ tsdTablePtr = (TSDTable *)TclpSysAlloc(sizeof(TSDTable), 0);
if (tsdTablePtr == NULL) {
Tcl_Panic("unable to allocate TSDTable");
}
tsdTablePtr->allocated = 8;
tsdTablePtr->tablePtr =
- TclpSysAlloc(sizeof(void *) * tsdTablePtr->allocated, 0);
+ (void **)TclpSysAlloc(sizeof(void *) * tsdTablePtr->allocated, 0);
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 e9b1107..7fc748e 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(
ckfree(errorProcString);
}
proc = Tcl_GetString(objv[2]);
- errorProcString = ckalloc(strlen(proc) + 1);
+ errorProcString = (char *)ckalloc(strlen(proc) + 1);
strcpy(errorProcString, proc);
Tcl_MutexUnlock(&threadMutex);
return TCL_OK;
@@ -556,9 +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 = ckalloc(strlen(ctrlPtr->script) + 1);
+ threadEvalScript = (char *)ckalloc(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 = ckalloc(sizeof(ThreadEvent));
- threadEventPtr->script = ckalloc(strlen(script) + 1);
+ threadEventPtr = (ThreadEvent*)ckalloc(sizeof(ThreadEvent));
+ threadEventPtr->script = (char *)ckalloc(strlen(script) + 1);
strcpy(threadEventPtr->script, script);
if (!wait) {
resultPtr = threadEventPtr->resultPtr = NULL;
} else {
- resultPtr = ckalloc(sizeof(ThreadEventResult));
+ resultPtr = (ThreadEventResult *)ckalloc(sizeof(ThreadEventResult));
threadEventPtr->resultPtr = resultPtr;
/*
@@ -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 = ckalloc(strlen(result) + 1);
+ resultPtr->result = (char *)ckalloc(strlen(result) + 1);
strcpy(resultPtr->result, result);
if (errorCode != NULL) {
- resultPtr->errorCode = ckalloc(strlen(errorCode) + 1);
+ resultPtr->errorCode = (char *)ckalloc(strlen(errorCode) + 1);
strcpy(resultPtr->errorCode, errorCode);
}
if (errorInfo != NULL) {
- resultPtr->errorInfo = ckalloc(strlen(errorInfo) + 1);
+ resultPtr->errorInfo = (char *)ckalloc(strlen(errorInfo) + 1);
strcpy(resultPtr->errorInfo, errorInfo);
}
Tcl_ConditionNotify(&resultPtr->done);
@@ -1073,7 +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) {
ckfree(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) {
ckfree(((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 = ckalloc(strlen(msg) + 1);
+ resultPtr->result = (char *)ckalloc(strlen(msg) + 1);
strcpy(resultPtr->result, msg);
resultPtr->code = TCL_ERROR;
Tcl_ConditionNotify(&resultPtr->done);
diff --git a/generic/tclTimer.c b/generic/tclTimer.c
index 7e04b3e..55466cc 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 = ckalloc(sizeof(TimerHandler));
+ timerHandlerPtr = (TimerHandler *)ckalloc(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 = ckalloc(sizeof(Tcl_Event));
+ timerEvPtr = (Tcl_Event *)ckalloc(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 = ckalloc(sizeof(IdleHandler));
+ idlePtr = (IdleHandler *)ckalloc(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 = ckalloc(sizeof(AfterAssocData));
+ assocPtr = (AfterAssocData *)ckalloc(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 = ckalloc(sizeof(AfterInfo));
+ afterPtr = (AfterInfo *)ckalloc(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 = ckalloc(sizeof(AfterInfo));
+ afterPtr = (AfterInfo *)ckalloc(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 52ac5da..736a640 100644
--- a/generic/tclTomMathDecls.h
+++ b/generic/tclTomMathDecls.h
@@ -56,6 +56,9 @@
# define MODULE_SCOPE extern
#endif
+#ifdef __cplusplus
+extern "C" {
+#endif
MODULE_SCOPE mp_err TclBN_s_mp_add_d(const mp_int *a, mp_digit b, mp_int *c);
MODULE_SCOPE mp_ord TclBN_s_mp_cmp_d(const mp_int *a, mp_digit b);
MODULE_SCOPE mp_err TclBN_s_mp_div_d(const mp_int *a, mp_digit b, mp_int *c, mp_digit *d);
@@ -66,7 +69,9 @@ MODULE_SCOPE mp_err TclBN_s_mp_mul_d(const mp_int *a, mp_digit b, mp_int *c);
MODULE_SCOPE void TclBN_s_mp_reverse(unsigned char *s, size_t len);
MODULE_SCOPE void TclBN_s_mp_set(mp_int *a, mp_digit b);
MODULE_SCOPE mp_err TclBN_s_mp_sub_d(const mp_int *a, mp_digit b, mp_int *c);
-
+#ifdef __cplusplus
+}
+#endif
/* Rename the global symbols in libtommath to avoid linkage conflicts */
diff --git a/generic/tclTrace.c b/generic/tclTrace.c
index 1106e37..a7d0c72 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 ...?");
@@ -324,7 +325,7 @@ Tcl_TraceObjCmd(
resultListPtr = Tcl_NewObj();
name = Tcl_GetString(objv[2]);
FOREACH_VAR_TRACE(interp, name, clientData) {
- TraceVarInfo *tvarPtr = clientData;
+ TraceVarInfo *tvarPtr = (TraceVarInfo *)clientData;
char *q = ops;
pairObjPtr = Tcl_NewListObj(0, NULL);
@@ -468,7 +469,7 @@ TraceExecutionObjCmd(
command = TclGetStringFromObj(objv[5], &commandLength);
length = (size_t) commandLength;
if ((enum traceOptions) optionIndex == TRACE_ADD) {
- TraceCommandInfo *tcmdPtr = ckalloc(
+ TraceCommandInfo *tcmdPtr = (TraceCommandInfo *)ckalloc(
offsetof(TraceCommandInfo, command) + 1 + length);
tcmdPtr->flags = flags;
@@ -508,7 +509,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
@@ -577,7 +578,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
@@ -705,7 +706,7 @@ TraceCommandObjCmd(
command = TclGetStringFromObj(objv[5], &commandLength);
length = (size_t) commandLength;
if ((enum traceOptions) optionIndex == TRACE_ADD) {
- TraceCommandInfo *tcmdPtr = ckalloc(
+ TraceCommandInfo *tcmdPtr = (TraceCommandInfo *)ckalloc(
offsetof(TraceCommandInfo, command) + 1 + length);
tcmdPtr->flags = flags;
@@ -741,7 +742,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,
@@ -780,7 +781,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
@@ -908,7 +909,7 @@ TraceVariableObjCmd(
command = TclGetStringFromObj(objv[5], &commandLength);
length = (size_t) commandLength;
if ((enum traceOptions) optionIndex == TRACE_ADD) {
- CombinedTraceVarInfo *ctvarPtr = ckalloc(
+ CombinedTraceVarInfo *ctvarPtr = (CombinedTraceVarInfo *)ckalloc(
offsetof(CombinedTraceVarInfo, traceCmdInfo.command)
+ 1 + length);
@@ -939,7 +940,7 @@ TraceVariableObjCmd(
name = Tcl_GetString(objv[3]);
FOREACH_VAR_TRACE(interp, name, clientData) {
- TraceVarInfo *tvarPtr = clientData;
+ TraceVarInfo *tvarPtr = (TraceVarInfo *)clientData;
if ((tvarPtr->length == length)
&& ((tvarPtr->flags
@@ -970,7 +971,7 @@ TraceVariableObjCmd(
name = Tcl_GetString(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
@@ -1049,6 +1050,7 @@ Tcl_CommandTraceInfo(
{
Command *cmdPtr;
CommandTrace *tracePtr;
+ (void)flags;
cmdPtr = (Command *) Tcl_FindCommand(interp, cmdName, NULL,
TCL_LEAVE_ERR_MSG);
@@ -1125,7 +1127,7 @@ Tcl_TraceCommand(
* Set up trace information.
*/
- tracePtr = ckalloc(sizeof(CommandTrace));
+ tracePtr = (CommandTrace *)ckalloc(sizeof(CommandTrace));
tracePtr->traceProc = proc;
tracePtr->clientData = clientData;
tracePtr->flags = flags &
@@ -1290,7 +1292,7 @@ TraceCommandProc(
int flags) /* OR-ed bits giving operation and other
* information. */
{
- TraceCommandInfo *tcmdPtr = clientData;
+ TraceCommandInfo *tcmdPtr = (TraceCommandInfo *)clientData;
int code;
Tcl_DString cmd;
@@ -1436,6 +1438,7 @@ TclCheckExecutionTraces(
int curLevel;
int traceCode = TCL_OK;
Tcl_InterpState state = NULL;
+ (void)numChars;
if (cmdPtr->tracePtr == NULL) {
return traceCode;
@@ -1468,7 +1471,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;
@@ -1609,7 +1612,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;
@@ -1688,7 +1691,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';
@@ -1724,7 +1727,7 @@ static void
CommandObjTraceDeleted(
ClientData clientData)
{
- TraceCommandInfo *tcmdPtr = clientData;
+ TraceCommandInfo *tcmdPtr = (TraceCommandInfo *)clientData;
if (tcmdPtr->refCount-- <= 1) {
ckfree(tcmdPtr);
@@ -1768,10 +1771,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) {
/*
@@ -1919,10 +1923,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 = ckalloc(len);
+ tcmdPtr->startCmd = (char *)ckalloc(len);
memcpy(tcmdPtr->startCmd, command, len);
tcmdPtr->refCount++;
tcmdPtr->stepTrace = Tcl_CreateObjTrace(interp, 0,
@@ -1974,7 +1978,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;
@@ -2166,7 +2170,7 @@ Tcl_CreateObjTrace(
iPtr->tracesForbiddingInline++;
}
- tracePtr = ckalloc(sizeof(Trace));
+ tracePtr = (Trace *)ckalloc(sizeof(Trace));
tracePtr->level = level;
tracePtr->proc = proc;
tracePtr->clientData = clientData;
@@ -2229,7 +2233,7 @@ Tcl_CreateTrace(
* command. */
ClientData clientData) /* Arbitrary value word to pass to proc. */
{
- StringTraceData *data = ckalloc(sizeof(StringTraceData));
+ StringTraceData *data = (StringTraceData *)ckalloc(sizeof(StringTraceData));
data->clientData = clientData;
data->proc = proc;
@@ -2263,7 +2267,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;
@@ -2664,7 +2668,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)) {
@@ -2708,7 +2712,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)) {
@@ -2946,7 +2950,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;
@@ -3105,7 +3109,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) {
@@ -3206,7 +3210,7 @@ Tcl_TraceVar2(
VarTrace *tracePtr;
int result;
- tracePtr = ckalloc(sizeof(VarTrace));
+ tracePtr = (VarTrace *)ckalloc(sizeof(VarTrace));
tracePtr->traceProc = proc;
tracePtr->clientData = clientData;
tracePtr->flags = flags;
@@ -3300,7 +3304,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 c9eb966..b736d5d 100644
--- a/generic/tclUtil.c
+++ b/generic/tclUtil.c
@@ -876,7 +876,7 @@ Tcl_SplitList(
size = TclMaxListLength(list, -1, &end) + 1;
length = end - list;
- argv = ckalloc((size * sizeof(char *)) + length + 1);
+ argv = (const char **)ckalloc((size * sizeof(char *)) + length + 1);
for (i = 0, p = ((char *) argv) + size*sizeof(char *);
*list != 0; i++) {
@@ -1581,7 +1581,7 @@ Tcl_Merge(
*/
if (argc == 0) {
- result = ckalloc(1);
+ result = (char *)ckalloc(1);
result[0] = '\0';
return result;
}
@@ -1593,7 +1593,7 @@ Tcl_Merge(
if (argc <= LOCAL_SIZE) {
flagPtr = localFlags;
} else {
- flagPtr = ckalloc(argc);
+ flagPtr = (char *)ckalloc(argc);
}
for (i = 0; i < argc; i++) {
flagPtr[i] = ( i ? TCL_DONT_QUOTE_HASH : 0 );
@@ -1611,7 +1611,7 @@ Tcl_Merge(
* Pass two: copy into the result area.
*/
- result = ckalloc(bytesNeeded);
+ result = (char *)ckalloc(bytesNeeded);
dst = result;
for (i = 0; i < argc; i++) {
flagPtr[i] |= ( i ? TCL_DONT_QUOTE_HASH : 0 );
@@ -2016,7 +2016,7 @@ Tcl_Concat(
* All element bytes + (argc - 1) spaces + 1 terminating NULL.
*/
- result = ckalloc(bytesNeeded + argc);
+ result = (char *)ckalloc(bytesNeeded + argc);
for (p = result, i = 0; i < argc; i++) {
int triml, trimr, elemLength;
@@ -2479,6 +2479,7 @@ TclByteArrayMatch(
{
const unsigned char *stringEnd, *patternEnd;
unsigned char p;
+ (void)flags;
stringEnd = string + strLen;
patternEnd = pattern + ptnLen;
@@ -2751,7 +2752,7 @@ Tcl_DStringAppend(
if (newSize >= dsPtr->spaceAvl) {
dsPtr->spaceAvl = newSize * 2;
if (dsPtr->string == dsPtr->staticSpace) {
- char *newString = ckalloc(dsPtr->spaceAvl);
+ char *newString = (char *)ckalloc(dsPtr->spaceAvl);
memcpy(newString, dsPtr->string, dsPtr->length);
dsPtr->string = newString;
@@ -2764,7 +2765,7 @@ Tcl_DStringAppend(
offset = bytes - dsPtr->string;
}
- dsPtr->string = ckrealloc(dsPtr->string, dsPtr->spaceAvl);
+ dsPtr->string = (char *)ckrealloc(dsPtr->string, dsPtr->spaceAvl);
if (offset >= 0) {
bytes = dsPtr->string + offset;
@@ -2854,7 +2855,7 @@ Tcl_DStringAppendElement(
if (newSize >= dsPtr->spaceAvl) {
dsPtr->spaceAvl = newSize * 2;
if (dsPtr->string == dsPtr->staticSpace) {
- char *newString = ckalloc(dsPtr->spaceAvl);
+ char *newString = (char *)ckalloc(dsPtr->spaceAvl);
memcpy(newString, dsPtr->string, dsPtr->length);
dsPtr->string = newString;
@@ -2867,7 +2868,7 @@ Tcl_DStringAppendElement(
offset = element - dsPtr->string;
}
- dsPtr->string = ckrealloc(dsPtr->string, dsPtr->spaceAvl);
+ dsPtr->string = (char *)ckrealloc(dsPtr->string, dsPtr->spaceAvl);
if (offset >= 0) {
element = dsPtr->string + offset;
@@ -2948,12 +2949,12 @@ Tcl_DStringSetLength(
dsPtr->spaceAvl = length + 1;
}
if (dsPtr->string == dsPtr->staticSpace) {
- char *newString = ckalloc(dsPtr->spaceAvl);
+ char *newString = (char *)ckalloc(dsPtr->spaceAvl);
memcpy(newString, dsPtr->string, dsPtr->length);
dsPtr->string = newString;
} else {
- dsPtr->string = ckrealloc(dsPtr->string, dsPtr->spaceAvl);
+ dsPtr->string = (char *)ckrealloc(dsPtr->string, dsPtr->spaceAvl);
}
}
dsPtr->length = length;
@@ -3105,7 +3106,7 @@ Tcl_DStringGetResult(
dsPtr->string = iPtr->result;
dsPtr->spaceAvl = dsPtr->length+1;
} else {
- dsPtr->string = ckalloc(dsPtr->length+1);
+ dsPtr->string = (char *)ckalloc(dsPtr->length+1);
memcpy(dsPtr->string, iPtr->result, dsPtr->length+1);
iPtr->freeProc(iPtr->result);
}
@@ -3116,7 +3117,7 @@ Tcl_DStringGetResult(
dsPtr->string = dsPtr->staticSpace;
dsPtr->spaceAvl = TCL_DSTRING_STATIC_SIZE;
} else {
- dsPtr->string = ckalloc(dsPtr->length+1);
+ dsPtr->string = (char *)ckalloc(dsPtr->length+1);
dsPtr->spaceAvl = dsPtr->length + 1;
}
memcpy(dsPtr->string, iPtr->result, dsPtr->length+1);
@@ -3263,9 +3264,7 @@ Tcl_DStringEndSublist(
void
Tcl_PrintDouble(
- Tcl_Interp *interp, /* Interpreter whose tcl_precision variable
- * used to be used to control printing. It's
- * ignored now. */
+ 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. */
@@ -3275,7 +3274,8 @@ Tcl_PrintDouble(
int signum;
char *digits;
char *end;
- int *precisionPtr = Tcl_GetThreadData(&precisionKey, sizeof(int));
+ int *precisionPtr = (int *)Tcl_GetThreadData(&precisionKey, sizeof(int));
+ (void)dummy;
/*
* Handle NaN.
@@ -3449,7 +3449,7 @@ TclPrecTraceProc(
{
Tcl_Obj *value;
Tcl_WideInt prec;
- int *precisionPtr = Tcl_GetThreadData(&precisionKey, sizeof(int));
+ int *precisionPtr = (int *)Tcl_GetThreadData(&precisionKey, sizeof(int));
/*
* If the variable is unset, then recreate the trace.
@@ -4230,7 +4230,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);
@@ -4260,10 +4260,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 = ckalloc(sizeof(Tcl_HashTable));
+ *tablePtrPtr = (Tcl_HashTable *)ckalloc(sizeof(Tcl_HashTable));
Tcl_CreateThreadExitHandler(FreeThreadHash, *tablePtrPtr);
Tcl_InitHashTable(*tablePtrPtr, TCL_ONE_WORD_KEYS);
}
@@ -4288,7 +4288,7 @@ static void
FreeThreadHash(
ClientData clientData)
{
- Tcl_HashTable *tablePtr = clientData;
+ Tcl_HashTable *tablePtr = (Tcl_HashTable *)clientData;
ClearHash(tablePtr);
Tcl_DeleteHashTable(tablePtr);
@@ -4310,7 +4310,7 @@ static void
FreeProcessGlobalValue(
ClientData clientData)
{
- ProcessGlobalValue *pgvPtr = clientData;
+ ProcessGlobalValue *pgvPtr = (ProcessGlobalValue *)clientData;
pgvPtr->epoch++;
pgvPtr->numBytes = 0;
@@ -4359,7 +4359,7 @@ TclSetProcessGlobalValue(
}
bytes = TclGetString(newValue);
pgvPtr->numBytes = newValue->length;
- pgvPtr->value = ckalloc(pgvPtr->numBytes + 1);
+ pgvPtr->value = (char *)ckalloc(pgvPtr->numBytes + 1);
memcpy(pgvPtr->value, bytes, pgvPtr->numBytes + 1);
if (pgvPtr->encoding) {
Tcl_FreeEncoding(pgvPtr->encoding);
@@ -4423,7 +4423,7 @@ TclGetProcessGlobalValue(
Tcl_DStringLength(&native), &newValue);
Tcl_DStringFree(&native);
ckfree(pgvPtr->value);
- pgvPtr->value = ckalloc(Tcl_DStringLength(&newValue) + 1);
+ pgvPtr->value = (char *)ckalloc(Tcl_DStringLength(&newValue) + 1);
memcpy(pgvPtr->value, Tcl_DStringValue(&newValue),
Tcl_DStringLength(&newValue) + 1);
Tcl_DStringFree(&newValue);
@@ -4473,7 +4473,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 4849839..2c2f967 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 *
@@ -1000,7 +1000,7 @@ TclLookupSimpleVar(
tablePtr = varFramePtr->varTablePtr;
if (create) {
if (tablePtr == NULL) {
- tablePtr = ckalloc(sizeof(TclVarHashTable));
+ tablePtr = (TclVarHashTable *)ckalloc(sizeof(TclVarHashTable));
TclInitVarHashTable(tablePtr, NULL);
varFramePtr->varTablePtr = tablePtr;
}
@@ -1534,6 +1534,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);
@@ -2707,7 +2708,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) {
@@ -2734,7 +2735,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);
}
}
@@ -2830,6 +2831,7 @@ Tcl_UnsetObjCmd(
{
int i, flags = TCL_LEAVE_ERR_MSG;
const char *name;
+ (void)dummy;
if (objc == 1) {
/*
@@ -2900,6 +2902,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 ...?");
@@ -2966,6 +2969,7 @@ Tcl_LappendObjCmd(
int numElems, createdNewObj;
Var *varPtr, *arrayPtr;
int result;
+ (void)dummy;
if (objc < 2) {
Tcl_WrongNumArgs(interp, 1, objv, "varName ?value ...?");
@@ -3173,7 +3177,7 @@ ArrayForObjCmd(
static int
ArrayForNRCmd(
- ClientData dummy,
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp,
int objc,
Tcl_Obj *const *objv)
@@ -3182,6 +3186,7 @@ ArrayForNRCmd(
ArraySearch *searchPtr = NULL;
Var *varPtr;
int isArray, numVars;
+ (void)dummy;
/*
* array for {k v} a body
@@ -3221,7 +3226,7 @@ ArrayForNRCmd(
* Make a new array search, put it on the stack.
*/
- searchPtr = ckalloc(sizeof(ArraySearch));
+ searchPtr = (ArraySearch *)ckalloc(sizeof(ArraySearch));
ArrayPopulateSearch(interp, arrayNameObj, varPtr, searchPtr);
/*
@@ -3249,10 +3254,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;
@@ -3372,7 +3377,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,
@@ -3404,7 +3409,7 @@ ArrayPopulateSearch(
static int
ArrayStartSearchCmd(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
@@ -3412,6 +3417,7 @@ ArrayStartSearchCmd(
Var *varPtr;
int isArray;
ArraySearch *searchPtr;
+ (void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "arrayName");
@@ -3430,7 +3436,7 @@ ArrayStartSearchCmd(
* Make a new array search with a free name.
*/
- searchPtr = ckalloc(sizeof(ArraySearch));
+ searchPtr = (ArraySearch *)ckalloc(sizeof(ArraySearch));
ArrayPopulateSearch(interp, objv[1], varPtr, searchPtr);
Tcl_SetObjResult(interp, searchPtr->name);
return TCL_OK;
@@ -3471,7 +3477,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;
@@ -3500,7 +3506,7 @@ ArrayDoneSearch(
/* ARGSUSED */
static int
ArrayAnyMoreCmd(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
@@ -3510,6 +3516,7 @@ ArrayAnyMoreCmd(
Tcl_Obj *varNameObj, *searchObj;
int gotValue, isArray;
ArraySearch *searchPtr;
+ (void)dummy;
if (objc != 3) {
Tcl_WrongNumArgs(interp, 1, objv, "arrayName searchId");
@@ -3579,7 +3586,7 @@ ArrayAnyMoreCmd(
/* ARGSUSED */
static int
ArrayNextElementCmd(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
@@ -3588,6 +3595,7 @@ ArrayNextElementCmd(
Tcl_Obj *varNameObj, *searchObj;
ArraySearch *searchPtr;
int isArray;
+ (void)dummy;
if (objc != 3) {
Tcl_WrongNumArgs(interp, 1, objv, "arrayName searchId");
@@ -3660,7 +3668,7 @@ ArrayNextElementCmd(
/* ARGSUSED */
static int
ArrayDoneSearchCmd(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
@@ -3670,6 +3678,7 @@ ArrayDoneSearchCmd(
Tcl_Obj *varNameObj, *searchObj;
ArraySearch *searchPtr;
int isArray;
+ (void)dummy;
if (objc != 3) {
Tcl_WrongNumArgs(interp, 1, objv, "arrayName searchId");
@@ -3721,13 +3730,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");
@@ -3762,7 +3772,7 @@ ArrayExistsCmd(
/* ARGSUSED */
static int
ArrayGetCmd(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
@@ -3773,6 +3783,7 @@ ArrayGetCmd(
Tcl_HashSearch search;
const char *pattern;
int i, count, result, isArray;
+ (void)dummy;
switch (objc) {
case 2:
@@ -3922,7 +3933,7 @@ ArrayGetCmd(
/* ARGSUSED */
static int
ArrayNamesCmd(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
@@ -3936,6 +3947,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?");
@@ -4090,7 +4102,7 @@ TclFindArrayPtrElements(
/* ARGSUSED */
static int
ArraySetCmd(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
@@ -4099,6 +4111,7 @@ ArraySetCmd(
Tcl_Obj *arrayElemObj;
Var *varPtr, *arrayPtr;
int result, i;
+ (void)dummy;
if (objc != 3) {
Tcl_WrongNumArgs(interp, 1, objv, "arrayName list");
@@ -4266,7 +4279,7 @@ ArraySetCmd(
/* ARGSUSED */
static int
ArraySizeCmd(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
@@ -4275,6 +4288,7 @@ ArraySizeCmd(
Tcl_HashSearch search;
Var *varPtr2;
int isArray, size = 0;
+ (void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "arrayName");
@@ -4326,7 +4340,7 @@ ArraySizeCmd(
/* ARGSUSED */
static int
ArrayStatsCmd(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
@@ -4335,6 +4349,7 @@ ArrayStatsCmd(
Tcl_Obj *varNameObj;
char *stats;
int isArray;
+ (void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "arrayName");
@@ -4381,7 +4396,7 @@ ArrayStatsCmd(
/* ARGSUSED */
static int
ArrayUnsetCmd(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
@@ -4392,6 +4407,7 @@ ArrayUnsetCmd(
const char *pattern;
const int unsetFlags = 0; /* Should this be TCL_LEAVE_ERR_MSG? */
int isArray;
+ (void)dummy;
switch (objc) {
case 2:
@@ -5017,6 +5033,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.
@@ -5122,6 +5139,7 @@ Tcl_VariableObjCmd(
Tcl_Obj *varValuePtr;
int i, result;
Tcl_Obj *varNamePtr, *tailPtr;
+ (void)dummy;
for (i=1 ; i<objc ; i+=2) {
/*
@@ -5253,6 +5271,7 @@ Tcl_UpvarObjCmd(
CallFrame *framePtr;
int result, hasLevel;
Tcl_Obj *levelObj;
+ (void)dummy;
if (objc < 3) {
Tcl_WrongNumArgs(interp, 1, objv,
@@ -5359,14 +5378,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;
@@ -5418,7 +5437,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);
@@ -5488,7 +5507,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) {
@@ -5685,7 +5704,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;
@@ -6071,6 +6090,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
@@ -6257,6 +6277,7 @@ TclInfoGlobalsCmd(
Tcl_HashSearch search;
Var *varPtr;
Tcl_Obj *listPtr, *varNamePtr, *patternPtr;
+ (void)dummy;
if (objc == 1) {
pattern = NULL;
@@ -6347,6 +6368,7 @@ TclInfoLocalsCmd(
{
Interp *iPtr = (Interp *) interp;
Tcl_Obj *patternPtr, *listPtr;
+ (void)dummy;
if (objc == 1) {
patternPtr = NULL;
@@ -6491,7 +6513,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) {
@@ -6558,11 +6580,12 @@ AllocVarEntry(
Tcl_HashTable *tablePtr, /* Hash table. */
void *keyPtr) /* Key to store in the hash table entry. */
{
- Tcl_Obj *objPtr = keyPtr;
+ Tcl_Obj *objPtr = (Tcl_Obj *)keyPtr;
Tcl_HashEntry *hPtr;
Var *varPtr;
+ (void)tablePtr;
- varPtr = ckalloc(sizeof(VarInHash));
+ varPtr = (Var *)ckalloc(sizeof(VarInHash));
varPtr->flags = VAR_IN_HASHTABLE;
varPtr->value.objPtr = NULL;
VarHashRefCount(varPtr) = 1;
@@ -6598,7 +6621,7 @@ CompareVarKeys(
void *keyPtr, /* New key to compare. */
Tcl_HashEntry *hPtr) /* Existing key to compare. */
{
- Tcl_Obj *objPtr1 = keyPtr;
+ Tcl_Obj *objPtr1 = (Tcl_Obj *)keyPtr;
Tcl_Obj *objPtr2 = hPtr->key.objPtr;
const char *p1, *p2;
int l1, l2;
@@ -6646,7 +6669,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. */
@@ -6658,6 +6681,7 @@ ArrayDefaultCmd(
Tcl_Obj *arrayNameObj, *defaultValueObj;
Var *varPtr, *arrayPtr;
int isArray, option;
+ (void)dummy;
/*
* Parse arguments.
@@ -6792,7 +6816,7 @@ void
TclInitArrayVar(
Var *arrayPtr)
{
- ArrayVarHashTable *tablePtr = ckalloc(sizeof(ArrayVarHashTable));
+ ArrayVarHashTable *tablePtr = (ArrayVarHashTable *)ckalloc(sizeof(ArrayVarHashTable));
/*
* Mark the variable as an array.
diff --git a/generic/tclZipfs.c b/generic/tclZipfs.c
index 0b741b7..ae0c0c5 100644
--- a/generic/tclZipfs.c
+++ b/generic/tclZipfs.c
@@ -847,7 +847,7 @@ ZipFSLookup(
hPtr = Tcl_FindHashEntry(&ZipFS.fileHash, filename);
if (hPtr) {
- z = Tcl_GetHashValue(hPtr);
+ z = (ZipEntry *)Tcl_GetHashValue(hPtr);
}
return z;
}
@@ -935,7 +935,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 */
@@ -1105,7 +1105,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;
@@ -1134,7 +1134,7 @@ ZipFSOpenArchive(
ZIPFS_POSIX_ERROR(interp, "seek error");
goto error;
}
- zf->ptrToFree = zf->data = attemptckalloc(zf->length);
+ zf->ptrToFree = zf->data = (unsigned char *)attemptckalloc(zf->length);
if (!zf->ptrToFree) {
ZIPFS_ERROR(interp, "out of memory");
if (interp) {
@@ -1163,13 +1163,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");
@@ -1265,7 +1265,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);
@@ -1274,7 +1274,7 @@ ZipFSCatalogFilesystem(
ZipFSCloseArchive(interp, zf0);
return TCL_ERROR;
}
- zf = attemptckalloc(sizeof(ZipFile) + strlen(mountPoint) + 1);
+ zf = (ZipFile *)attemptckalloc(sizeof(ZipFile) + strlen(mountPoint) + 1);
if (!zf) {
if (interp) {
Tcl_AppendResult(interp, "out of memory", (char *) NULL);
@@ -1287,11 +1287,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 = ckalloc(zf->nameLength + 1);
+ zf->name = (char *)ckalloc(zf->nameLength + 1);
memcpy(zf->name, zipname, zf->nameLength + 1);
zf->entries = NULL;
zf->topEnts = NULL;
@@ -1310,7 +1310,7 @@ ZipFSCatalogFilesystem(
if (mountPoint[0] != '\0') {
hPtr = Tcl_CreateHashEntry(&ZipFS.fileHash, mountPoint, &isNew);
if (isNew) {
- z = ckalloc(sizeof(ZipEntry));
+ z = (ZipEntry *)ckalloc(sizeof(ZipEntry));
Tcl_SetHashValue(hPtr, z);
z->tnext = NULL;
@@ -1324,7 +1324,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;
}
@@ -1405,7 +1405,7 @@ ZipFSCatalogFilesystem(
}
Tcl_DStringSetLength(&fpBuf, 0);
fullpath = CanonicalPath(mountPoint, path, &fpBuf, 1);
- z = ckalloc(sizeof(ZipEntry));
+ z = (ZipEntry *)ckalloc(sizeof(ZipEntry));
z->name = NULL;
z->tnext = NULL;
z->depth = CountSlashes(fullpath);
@@ -1437,7 +1437,7 @@ ZipFSCatalogFilesystem(
ckfree(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)) {
@@ -1459,7 +1459,7 @@ ZipFSCatalogFilesystem(
if (!isNew) {
break;
}
- zd = ckalloc(sizeof(ZipEntry));
+ zd = (ZipEntry *)ckalloc(sizeof(ZipEntry));
zd->name = NULL;
zd->tnext = NULL;
zd->depth = CountSlashes(dir);
@@ -1473,7 +1473,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)) {
@@ -1559,7 +1559,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);
}
@@ -1596,7 +1596,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;
}
@@ -1673,7 +1673,7 @@ TclZipfs_Mount(
return TCL_ERROR;
}
}
- zf = attemptckalloc(sizeof(ZipFile) + strlen(mountPoint) + 1);
+ zf = (ZipFile *)attemptckalloc(sizeof(ZipFile) + strlen(mountPoint) + 1);
if (!zf) {
if (interp) {
Tcl_AppendResult(interp, "out of memory", (char *) NULL);
@@ -1754,7 +1754,7 @@ TclZipfs_MountBuffer(
* Have both a mount point and data to mount there.
*/
- zf = attemptckalloc(sizeof(ZipFile) + strlen(mountPoint) + 1);
+ zf = (ZipFile *)attemptckalloc(sizeof(ZipFile) + strlen(mountPoint) + 1);
if (!zf) {
if (interp) {
Tcl_AppendResult(interp, "out of memory", (char *) NULL);
@@ -1765,7 +1765,7 @@ TclZipfs_MountBuffer(
zf->isMemBuffer = 1;
zf->length = datalen;
if (copy) {
- zf->data = attemptckalloc(datalen);
+ zf->data = (unsigned char *)attemptckalloc(datalen);
if (!zf->data) {
if (interp) {
Tcl_AppendResult(interp, "out of memory", (char *) NULL);
@@ -1835,7 +1835,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;
@@ -1888,6 +1888,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?");
@@ -1925,6 +1927,7 @@ ZipFSMountBufferObjCmd(
const char *mountPoint; /* Mount point path. */
unsigned char *data;
int length;
+ (void)dummy;
if (objc > 3) {
Tcl_WrongNumArgs(interp, 1, objv, "?mountpoint? ?data?");
@@ -1974,6 +1977,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;
}
@@ -2001,6 +2008,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;
@@ -2034,6 +2043,7 @@ ZipFSMkKeyObjCmd(
{
int len, i = 0;
char *pw, passBuf[264];
+ (void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "password");
@@ -2373,7 +2383,7 @@ ZipAddFile(
return TCL_ERROR;
}
- z = ckalloc(sizeof(ZipEntry));
+ z = (ZipEntry *)ckalloc(sizeof(ZipEntry));
Tcl_SetHashValue(hPtr, z);
z->name = NULL;
z->tnext = NULL;
@@ -2388,7 +2398,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;
/*
@@ -2563,7 +2573,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++;
@@ -2724,7 +2734,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);
@@ -2779,7 +2789,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);
ckfree(z);
Tcl_DeleteHashEntry(hPtr);
}
@@ -2811,6 +2821,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;
@@ -2831,6 +2843,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;
@@ -2868,6 +2882,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?");
@@ -2889,6 +2905,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;
@@ -2930,6 +2948,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?");
@@ -2985,6 +3004,7 @@ ZipFSExistsObjCmd(
char *filename;
int exists;
Tcl_DString ds;
+ (void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "filename");
@@ -3037,6 +3057,7 @@ ZipFSInfoObjCmd(
{
char *filename;
ZipEntry *z;
+ (void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "filename");
@@ -3090,6 +3111,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?");
@@ -3119,7 +3141,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,
@@ -3129,7 +3151,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,
@@ -3139,7 +3161,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));
@@ -3282,6 +3304,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();
@@ -3314,7 +3340,8 @@ ZipChannelClose(
void *instanceData,
Tcl_Interp *dummy) /* Current interpreter. */
{
- ZipChannel *info = instanceData;
+ ZipChannel *info = (ZipChannel *)instanceData;
+ (void)dummy;
if (info->iscompr && info->ubuf) {
ckfree(info->ubuf);
@@ -3326,7 +3353,7 @@ ZipChannelClose(
}
if (info->isWriting) {
ZipEntry *z = info->zipEntryPtr;
- unsigned char *newdata = attemptckrealloc(info->ubuf, info->numRead);
+ unsigned char *newdata = (unsigned char *)attemptckrealloc(info->ubuf, info->numRead);
if (newdata) {
if (z->data) {
@@ -3574,6 +3601,9 @@ ZipChannelWatchChannel(
void *instanceData,
int mask)
{
+ (void)instanceData;
+ (void)mask;
+
return;
}
@@ -3600,6 +3630,10 @@ ZipChannelGetFile(
int direction,
void **handlePtr)
{
+ (void)instanceData;
+ (void)direction;
+ (void)handlePtr;
+
return TCL_ERROR;
}
@@ -3631,6 +3665,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)))) {
@@ -3687,7 +3722,7 @@ ZipChannelOpen(
} else {
flags = TCL_WRITABLE;
}
- info = attemptckalloc(sizeof(ZipChannel));
+ info = (ZipChannel *)attemptckalloc(sizeof(ZipChannel));
if (!info) {
ZIPFS_ERROR(interp, "out of memory");
if (interp) {
@@ -3705,7 +3740,7 @@ ZipChannelOpen(
info->maxWrite = ZipFS.wrmax;
info->iscompr = 0;
info->isEncrypted = 0;
- info->ubuf = attemptckalloc(info->maxWrite);
+ info->ubuf = (unsigned char *)attemptckalloc(info->maxWrite);
if (!info->ubuf) {
merror0:
if (info->ubuf) {
@@ -3763,7 +3798,7 @@ ZipChannelOpen(
unsigned int j;
stream.avail_in -= 12;
- cbuf = attemptckalloc(stream.avail_in);
+ cbuf = (unsigned char *)attemptckalloc(stream.avail_in);
if (!cbuf) {
goto merror0;
}
@@ -3863,7 +3898,7 @@ ZipChannelOpen(
stream.avail_in = z->numCompressedBytes;
if (info->isEncrypted) {
stream.avail_in -= 12;
- ubuf = attemptckalloc(stream.avail_in);
+ ubuf = (unsigned char *)attemptckalloc(stream.avail_in);
if (!ubuf) {
info->ubuf = NULL;
goto merror;
@@ -3876,7 +3911,7 @@ ZipChannelOpen(
} else {
stream.next_in = info->ubuf;
}
- stream.next_out = info->ubuf = attemptckalloc(info->numBytes);
+ stream.next_out = info->ubuf = (unsigned char *)attemptckalloc(info->numBytes);
if (!info->ubuf) {
merror:
if (ubuf) {
@@ -4153,6 +4188,8 @@ static Tcl_Obj *
ZipFSFilesystemSeparatorProc(
Tcl_Obj *pathPtr)
{
+ (void)pathPtr;
+
return Tcl_NewStringObj("/", -1);
}
@@ -4190,6 +4227,7 @@ ZipFSMatchInDirectoryProc(
size_t len;
char *pat, *prefix, *path;
Tcl_DString dsPref;
+ (void)dummy;
if (!normPathPtr) {
return -1;
@@ -4237,7 +4275,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;
@@ -4288,7 +4326,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)) {
@@ -4308,7 +4346,7 @@ ZipFSMatchInDirectoryProc(
}
l = strlen(pattern);
- pat = ckalloc(len + l + 2);
+ pat = (char *)ckalloc(len + l + 2);
memcpy(pat, path, len);
while ((len > 1) && (pat[len - 1] == '/')) {
--len;
@@ -4321,7 +4359,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))) {
@@ -4375,6 +4413,7 @@ ZipFSPathInFilesystemProc(
int ret = -1;
size_t len;
char *path;
+ (void)dummy;
pathPtr = Tcl_FSGetNormalizedPath(NULL, pathPtr);
if (!pathPtr) {
@@ -4397,7 +4436,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;
@@ -4476,6 +4515,9 @@ ZipFSFileAttrStringsProc(
"-permissions",
NULL,
};
+ (void)pathPtr;
+ (void)objPtrRef;
+
return attrs;
}
@@ -4577,6 +4619,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);
@@ -4600,6 +4646,7 @@ static Tcl_Obj *
ZipFSFilesystemPathTypeProc(
Tcl_Obj *pathPtr)
{
+ (void)pathPtr;
return Tcl_NewStringObj("zip", -1);
}
@@ -4892,10 +4939,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);
@@ -4995,6 +5043,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 49f1c39..23cea39 100644
--- a/generic/tclZlib.c
+++ b/generic/tclZlib.c
@@ -699,7 +699,7 @@ Tcl_ZlibStreamInit(
case TCL_ZLIB_FORMAT_GZIP:
wbits = WBITS_GZIP;
if (dictObj) {
- gzHeaderPtr = ckalloc(sizeof(GzipHeader));
+ gzHeaderPtr = (GzipHeader *)ckalloc(sizeof(GzipHeader));
memset(gzHeaderPtr, 0, sizeof(GzipHeader));
if (GenerateHeader(interp, dictObj, gzHeaderPtr,
NULL) != TCL_OK) {
@@ -733,7 +733,7 @@ Tcl_ZlibStreamInit(
break;
case TCL_ZLIB_FORMAT_GZIP:
wbits = WBITS_GZIP;
- gzHeaderPtr = ckalloc(sizeof(GzipHeader));
+ gzHeaderPtr = (GzipHeader *)ckalloc(sizeof(GzipHeader));
memset(gzHeaderPtr, 0, sizeof(GzipHeader));
gzHeaderPtr->header.name = (Bytef *)
gzHeaderPtr->nativeFilenameBuf;
@@ -759,7 +759,7 @@ Tcl_ZlibStreamInit(
" TCL_ZLIB_STREAM_INFLATE");
}
- zshPtr = ckalloc(sizeof(ZlibStreamHandle));
+ zshPtr = (ZlibStreamHandle *)ckalloc(sizeof(ZlibStreamHandle));
zshPtr->interp = interp;
zshPtr->mode = mode;
zshPtr->format = format;
@@ -886,7 +886,7 @@ static void
ZlibStreamCmdDelete(
void *cd)
{
- ZlibStreamHandle *zshPtr = cd;
+ ZlibStreamHandle *zshPtr = (ZlibStreamHandle *)cd;
zshPtr->cmd = NULL;
ZlibStreamCleanup(zshPtr);
@@ -1233,7 +1233,7 @@ Tcl_ZlibStreamPut(
if (outSize > BUFFER_SIZE_LIMIT) {
outSize = BUFFER_SIZE_LIMIT;
}
- dataTmp = ckalloc(outSize);
+ dataTmp = (char *)ckalloc(outSize);
while (1) {
e = Deflate(&zshPtr->stream, dataTmp, outSize, flush, &toStore);
@@ -1267,7 +1267,7 @@ Tcl_ZlibStreamPut(
if (outSize < BUFFER_SIZE_LIMIT) {
outSize = BUFFER_SIZE_LIMIT;
/* There may be *lots* of data left to output... */
- dataTmp = ckrealloc(dataTmp, outSize);
+ dataTmp = (char *)ckrealloc(dataTmp, outSize);
}
}
@@ -1752,10 +1752,10 @@ Tcl_ZlibInflate(
if (gzipHeaderDictObj) {
headerPtr = &header;
memset(headerPtr, 0, sizeof(gz_header));
- nameBuf = ckalloc(MAXPATHLEN);
+ nameBuf = (char *)ckalloc(MAXPATHLEN);
header.name = (Bytef *) nameBuf;
header.name_max = MAXPATHLEN - 1;
- commentBuf = ckalloc(MAX_COMMENT_LEN);
+ commentBuf = (char *)ckalloc(MAX_COMMENT_LEN);
header.comment = (Bytef *) commentBuf;
header.comm_max = MAX_COMMENT_LEN - 1;
}
@@ -1920,7 +1920,7 @@ Tcl_ZlibAdler32(
static int
ZlibCmd(
- void *notUsed,
+ void *dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
@@ -1939,6 +1939,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 ?...?");
@@ -2521,7 +2522,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[] = {
@@ -2647,7 +2648,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[] = {
@@ -2771,7 +2772,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[] = {
@@ -2860,7 +2861,7 @@ ZlibStreamHeaderCmd(
int objc,
Tcl_Obj *const objv[])
{
- ZlibStreamHandle *zshPtr = cd;
+ ZlibStreamHandle *zshPtr = (ZlibStreamHandle *)cd;
Tcl_Obj *resultObj;
if (objc != 2) {
@@ -2897,7 +2898,7 @@ ZlibTransformClose(
void *instanceData,
Tcl_Interp *interp)
{
- ZlibChannelData *cd = instanceData;
+ ZlibChannelData *cd = (ZlibChannelData *)instanceData;
int e, written, result = TCL_OK;
/*
@@ -2990,7 +2991,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;
@@ -3104,7 +3105,7 @@ ZlibTransformOutput(
int toWrite,
int *errorCodePtr)
{
- ZlibChannelData *cd = instanceData;
+ ZlibChannelData *cd = (ZlibChannelData *)instanceData;
Tcl_DriverOutputProc *outProc =
Tcl_ChannelOutputProc(Tcl_GetChannelType(cd->parent));
int e, produced;
@@ -3225,7 +3226,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";
@@ -3338,7 +3339,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";
@@ -3456,7 +3457,7 @@ ZlibTransformWatch(
void *instanceData,
int mask)
{
- ZlibChannelData *cd = instanceData;
+ ZlibChannelData *cd = (ZlibChannelData *)instanceData;
Tcl_DriverWatchProc *watchProc;
/*
@@ -3479,7 +3480,7 @@ ZlibTransformEventHandler(
void *instanceData,
int interestMask)
{
- ZlibChannelData *cd = instanceData;
+ ZlibChannelData *cd = (ZlibChannelData *)instanceData;
ZlibTransformEventTimerKill(cd);
return interestMask;
@@ -3499,7 +3500,7 @@ static void
ZlibTransformTimerRun(
void *clientData)
{
- ZlibChannelData *cd = clientData;
+ ZlibChannelData *cd = (ZlibChannelData *)clientData;
cd->timer = NULL;
Tcl_NotifyChannel(cd->chan, TCL_READABLE);
@@ -3522,7 +3523,7 @@ ZlibTransformGetHandle(
int direction,
void **handlePtr)
{
- ZlibChannelData *cd = instanceData;
+ ZlibChannelData *cd = (ZlibChannelData *)instanceData;
return Tcl_GetChannelHandle(cd->parent, direction, handlePtr);
}
@@ -3542,7 +3543,7 @@ ZlibTransformBlockMode(
void *instanceData,
int mode)
{
- ZlibChannelData *cd = instanceData;
+ ZlibChannelData *cd = (ZlibChannelData *)instanceData;
if (mode == TCL_MODE_NONBLOCKING) {
cd->flags |= ASYNC;
@@ -3592,7 +3593,7 @@ ZlibStackChannelTransform(
* dictionary (not dictObj!) to use if
* necessary. */
{
- ZlibChannelData *cd = ckalloc(sizeof(ZlibChannelData));
+ ZlibChannelData *cd = (ZlibChannelData *)ckalloc(sizeof(ZlibChannelData));
Tcl_Channel chan;
int wbits = 0;
@@ -3652,7 +3653,7 @@ ZlibStackChannelTransform(
goto error;
}
cd->inAllocated = DEFAULT_BUFFER_SIZE;
- cd->inBuffer = ckalloc(cd->inAllocated);
+ cd->inBuffer = (char *)ckalloc(cd->inAllocated);
if (cd->flags & IN_HEADER) {
if (inflateGetHeader(&cd->inStream, &cd->inHeader.header) != Z_OK) {
goto error;
@@ -3669,7 +3670,7 @@ ZlibStackChannelTransform(
goto error;
}
cd->outAllocated = DEFAULT_BUFFER_SIZE;
- cd->outBuffer = ckalloc(cd->outAllocated);
+ cd->outBuffer = (char *)ckalloc(cd->outAllocated);
if (cd->flags & OUT_HEADER) {
if (deflateSetHeader(&cd->outStream, &cd->outHeader.header) != Z_OK) {
goto error;
diff --git a/libtommath/tommath_private.h b/libtommath/tommath_private.h
index 5123f53..138d39e 100644
--- a/libtommath/tommath_private.h
+++ b/libtommath/tommath_private.h
@@ -194,6 +194,9 @@ MP_STATIC_ASSERT(prec_geq_min_prec, MP_PREC >= MP_MIN_PREC)
/* random number source */
extern MP_PRIVATE mp_err(*s_mp_rand_source)(void *out, size_t size);
+#ifdef __cplusplus
+extern "C" {
+#endif
/* lowlevel functions, do not call! */
MP_PRIVATE mp_bool s_mp_get_bit(const mp_int *a, unsigned int b);
MP_PRIVATE mp_err s_mp_add(const mp_int *a, const mp_int *b, mp_int *c) MP_WUR;
@@ -249,6 +252,10 @@ MP_DEPRECATED(s_mp_toom_mul) mp_err mp_toom_mul(const mp_int *a, const mp_int *b
MP_DEPRECATED(s_mp_toom_sqr) mp_err mp_toom_sqr(const mp_int *a, mp_int *b);
MP_DEPRECATED(s_mp_reverse) void bn_reverse(unsigned char *s, int len);
+#ifdef __cplusplus
+}
+#endif
+
#ifndef TCL_WITH_EXTERNAL_TOMMATH
#undef mp_sqr
#define mp_sqr TclBN_mp_sqr
diff --git a/macosx/tclMacOSXBundle.c b/macosx/tclMacOSXBundle.c
index dad3733..81d8d04 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 6ff60aa..06ad180 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 b21130b..1523400 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 = ckalloc(sizeof(FileHandler));
+ filePtr = (FileHandler *)ckalloc(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 = ckalloc(sizeof(FileHandlerEvent));
+ FileHandlerEvent *fileEvPtr = (FileHandlerEvent *)ckalloc(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 f5558a2..035bbb2 100755
--- a/unix/configure
+++ b/unix/configure
@@ -5036,7 +5036,15 @@ 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 -Wpointer-arith"
+ case "${CC}" in
+ *++)
+ ;;
+ *)
+ CFLAGS_WARNING="${CFLAGS_WARNING} -Wc++-compat -Wdeclaration-after-statement"
+ ;;
+ esac
+
else
diff --git a/unix/tcl.m4 b/unix/tcl.m4
index 2547d1e..271bd03 100644
--- a/unix/tcl.m4
+++ b/unix/tcl.m4
@@ -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 4961ef5..e164e7e 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 = ckalloc(sizeof(*newPedPtr));
+ newPedPtr = (struct PlatformEventData *)ckalloc(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 = ckalloc(sizeof(*filePtr));
+ filePtr = (FileHandler *)ckalloc(sizeof(FileHandler));
#ifdef HAVE_EVENTFD
tsdPtr->triggerEventFd = eventfd(0, EFD_CLOEXEC | EFD_NONBLOCK);
if (tsdPtr->triggerEventFd <= 0) {
@@ -391,7 +393,7 @@ PlatformEventsInit(void)
PlatformEventsControl(filePtr, tsdPtr, EPOLL_CTL_ADD, 1);
if (!tsdPtr->readyEvents) {
tsdPtr->maxReadyEvents = 512;
- tsdPtr->readyEvents = ckalloc(
+ tsdPtr->readyEvents = (struct epoll_event *)ckalloc(
tsdPtr->maxReadyEvents * sizeof(tsdPtr->readyEvents[0]));
}
LIST_INIT(&tsdPtr->firstReadyFileHandlerPtr);
@@ -550,7 +552,7 @@ Tcl_CreateFileHandler(
}
}
if (filePtr == NULL) {
- filePtr = ckalloc(sizeof(FileHandler));
+ filePtr = (FileHandler *)ckalloc(sizeof(FileHandler));
filePtr->fd = fd;
filePtr->readyMask = 0;
filePtr->nextPtr = tsdPtr->firstFileHandlerPtr;
@@ -733,7 +735,7 @@ Tcl_WaitForEvent(
*/
if (filePtr->readyMask == 0) {
- FileHandlerEvent *fileEvPtr =
+ FileHandlerEvent *fileEvPtr = (FileHandlerEvent *)
ckalloc(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 *)
ckalloc(sizeof(FileHandlerEvent));
fileEvPtr->header.proc = FileHandlerEventProc;
diff --git a/unix/tclKqueueNotfy.c b/unix/tclKqueueNotfy.c
index 99d794e..e2ff4f4 100644
--- a/unix/tclKqueueNotfy.c
+++ b/unix/tclKqueueNotfy.c
@@ -222,7 +222,7 @@ PlatformEventsControl(
struct stat fdStat;
if (isNew) {
- newPedPtr = ckalloc(sizeof(*newPedPtr));
+ newPedPtr = (struct PlatformEventData *)ckalloc(sizeof(struct PlatformEventData));
newPedPtr->filePtr = filePtr;
newPedPtr->tsdPtr = tsdPtr;
filePtr->pedPtr = newPedPtr;
@@ -409,13 +409,13 @@ PlatformEventsInit(void)
} else if (fcntl(tsdPtr->eventsFd, F_SETFD, FD_CLOEXEC) == -1) {
Tcl_Panic("fcntl: %s", strerror(errno));
}
- filePtr = ckalloc(sizeof(*filePtr));
+ filePtr = (FileHandler *)ckalloc(sizeof(FileHandler));
filePtr->fd = tsdPtr->triggerPipe[0];
filePtr->mask = TCL_READABLE;
PlatformEventsControl(filePtr, tsdPtr, EV_ADD, 1);
if (!tsdPtr->readyEvents) {
tsdPtr->maxReadyEvents = 512;
- tsdPtr->readyEvents = ckalloc(
+ tsdPtr->readyEvents = (struct kevent *)ckalloc(
tsdPtr->maxReadyEvents * sizeof(tsdPtr->readyEvents[0]));
}
LIST_INIT(&tsdPtr->firstReadyFileHandlerPtr);
@@ -580,7 +580,7 @@ Tcl_CreateFileHandler(
}
}
if (filePtr == NULL) {
- filePtr = ckalloc(sizeof(FileHandler));
+ filePtr = (FileHandler *)ckalloc(sizeof(FileHandler));
filePtr->fd = fd;
filePtr->readyMask = 0;
filePtr->nextPtr = tsdPtr->firstFileHandlerPtr;
@@ -768,7 +768,7 @@ Tcl_WaitForEvent(
*/
if (filePtr->readyMask == 0) {
- FileHandlerEvent *fileEvPtr =
+ FileHandlerEvent *fileEvPtr = (FileHandlerEvent *)
ckalloc(sizeof(FileHandlerEvent));
fileEvPtr->header.proc = FileHandlerEventProc;
@@ -828,7 +828,7 @@ Tcl_WaitForEvent(
*/
if (filePtr->readyMask == 0) {
- FileHandlerEvent *fileEvPtr =
+ FileHandlerEvent *fileEvPtr = (FileHandlerEvent *)
ckalloc(sizeof(FileHandlerEvent));
fileEvPtr->header.proc = FileHandlerEventProc;
diff --git a/unix/tclLoadDl.c b/unix/tclLoadDl.c
index 7b85a67..052aa07 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 = ckalloc(sizeof(*newHandle));
+ newHandle = (Tcl_LoadHandle)ckalloc(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", 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 e998bf9..9d4e99c 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, Tcl_GetString(pathPtr),
-1, &ds);
@@ -258,7 +258,7 @@ TclpDlopen(
module = NSLinkModule(dyldObjFileImage, nativePath, nsflags);
NSDestroyObjectFileImage(dyldObjFileImage);
if (module) {
- modulePtr = ckalloc(sizeof(Tcl_DyldModuleHandle));
+ modulePtr = (Tcl_DyldModuleHandle *)ckalloc(sizeof(Tcl_DyldModuleHandle));
modulePtr->module = module;
modulePtr->nextPtr = NULL;
} else {
@@ -278,13 +278,13 @@ TclpDlopen(
|| dyldLibHeader || modulePtr
#endif /* TCL_DYLD_USE_NSMODULE */
) {
- dyldLoadHandle = ckalloc(sizeof(Tcl_DyldLoadHandle));
+ dyldLoadHandle = (Tcl_DyldLoadHandle *)ckalloc(sizeof(Tcl_DyldLoadHandle));
dyldLoadHandle->dlHandle = dlHandle;
#if TCL_DYLD_USE_NSMODULE || defined(TCL_LOAD_FROM_MEMORY)
dyldLoadHandle->dyldLibHeader = dyldLibHeader;
dyldLoadHandle->modulePtr = modulePtr;
#endif /* TCL_DYLD_USE_NSMODULE || TCL_LOAD_FROM_MEMORY */
- newHandle = ckalloc(sizeof(*newHandle));
+ newHandle = (Tcl_LoadHandle)ckalloc(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 = ckalloc(sizeof(Tcl_DyldModuleHandle));
+ modulePtr = (Tcl_DyldModuleHandle *)ckalloc(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 = ckalloc(sizeof(Tcl_DyldModuleHandle));
+ modulePtr = (Tcl_DyldModuleHandle *)ckalloc(sizeof(Tcl_DyldModuleHandle));
modulePtr->module = module;
modulePtr->nextPtr = NULL;
- dyldLoadHandle = ckalloc(sizeof(Tcl_DyldLoadHandle));
+ dyldLoadHandle = (Tcl_DyldLoadHandle *)ckalloc(sizeof(Tcl_DyldLoadHandle));
dyldLoadHandle->dlHandle = NULL;
dyldLoadHandle->dyldLibHeader = NULL;
dyldLoadHandle->modulePtr = modulePtr;
- newHandle = ckalloc(sizeof(*newHandle));
+ newHandle = (Tcl_LoadHandle)ckalloc(sizeof(*newHandle));
newHandle->clientData = dyldLoadHandle;
newHandle->findSymbolProcPtr = &FindSymbol;
newHandle->unloadFileProcPtr = &UnloadFile;
diff --git a/unix/tclLoadNext.c b/unix/tclLoadNext.c
index eb0affa..8c62784 100644
--- a/unix/tclLoadNext.c
+++ b/unix/tclLoadNext.c
@@ -101,7 +101,7 @@ TclpDlopen(
}
NXCloseMemory(errorStream, NX_FREEBUFFER);
- newHandle = ckalloc(sizeof(Tcl_LoadHandle));
+ newHandle = (Tcl_LoadHandle) ckalloc(sizeof(*newHandle));
newHandle->clientData = INT2PTR(1);
newHandle->findSymbolProcPtr = &FindSymbol;
newHandle->unloadFileProcPtr = &UnloadFile;
diff --git a/unix/tclLoadOSF.c b/unix/tclLoadOSF.c
index 377ed28..bbcaa66 100644
--- a/unix/tclLoadOSF.c
+++ b/unix/tclLoadOSF.c
@@ -128,7 +128,7 @@ TclpDlopen(
} else {
pkg++;
}
- newHandle = ckalloc(sizeof(*newHandle));
+ newHandle = (Tcl_LoadHandle)ckalloc(sizeof(*newHandle));
newHandle->clientData = pkg;
newHandle->findSymbolProcPtr = &FindSymbol;
newHandle->unloadFileProcPtr = &UnloadFile;
diff --git a/unix/tclLoadShl.c b/unix/tclLoadShl.c
index 4be3d7b..a92ddf5 100644
--- a/unix/tclLoadShl.c
+++ b/unix/tclLoadShl.c
@@ -97,7 +97,7 @@ TclpDlopen(
fileName, Tcl_PosixError(interp)));
return TCL_ERROR;
}
- newHandle = ckalloc(sizeof(*newHandle));
+ newHandle = (Tcl_LoadHandle)ckalloc(sizeof(*newHandle));
newHandle->clientData = handle;
newHandle->findSymbolProcPtr = &FindSymbol;
newHandle->unloadFileProcPtr = *unloadProcPtr = &UnloadFile;
diff --git a/unix/tclSelectNotfy.c b/unix/tclSelectNotfy.c
index 585cd80..a7788a6 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 = ckalloc(sizeof(FileHandler));
+ filePtr = (FileHandler *)ckalloc(sizeof(FileHandler));
filePtr->fd = fd;
filePtr->readyMask = 0;
filePtr->nextPtr = tsdPtr->firstFileHandlerPtr;
@@ -880,7 +886,7 @@ Tcl_WaitForEvent(
if (filePtr->readyMask == 0) {
FileHandlerEvent *fileEvPtr =
- ckalloc(sizeof(FileHandlerEvent));
+ (FileHandlerEvent *)ckalloc(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 5e757ee..2dc5f46 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;
unsigned int 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;
unsigned int 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 = ckalloc(sizeof(TtyState));
+ fsPtr = (TtyState *)ckalloc(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. */
{
@@ -1790,13 +1791,13 @@ Tcl_MakeFileChannel(
&& (sockaddrLen > 0)
&& (sockaddr.sa_family == AF_INET
|| sockaddr.sa_family == AF_INET6)) {
- return TclpMakeTcpClientChannelMode(INT2PTR(fd), mode);
+ return (Tcl_Channel)TclpMakeTcpClientChannelMode(INT2PTR(fd), mode);
} else {
channelTypePtr = &fileChannelType;
sprintf(channelName, "file%d", fd);
}
- fsPtr = ckalloc(sizeof(TtyState));
+ fsPtr = (TtyState *)ckalloc(sizeof(TtyState));
fsPtr->fileState.fd = fd;
fsPtr->fileState.validMask = mode | TCL_EXCEPTION;
fsPtr->fileState.channel = Tcl_CreateChannel(channelTypePtr, channelName,
@@ -1927,18 +1928,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) {
@@ -2022,10 +2024,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 e0a826c..c4ee1d5 100644
--- a/unix/tclUnixCompat.c
+++ b/unix/tclUnixCompat.c
@@ -118,10 +118,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 */
@@ -201,7 +201,7 @@ TclpGetPwNam(
if (tsdPtr->pbuflen < 1) {
tsdPtr->pbuflen = 1024;
}
- tsdPtr->pbuf = ckalloc(tsdPtr->pbuflen);
+ tsdPtr->pbuf = (char *)ckalloc(tsdPtr->pbuflen);
Tcl_CreateThreadExitHandler(FreePwBuf, NULL);
}
while (1) {
@@ -214,7 +214,7 @@ TclpGetPwNam(
return NULL;
}
tsdPtr->pbuflen *= 2;
- tsdPtr->pbuf = ckrealloc(tsdPtr->pbuf, tsdPtr->pbuflen);
+ tsdPtr->pbuf = (char *)ckrealloc(tsdPtr->pbuf, tsdPtr->pbuflen);
}
return (pwPtr != NULL ? &tsdPtr->pwd : NULL);
@@ -281,7 +281,7 @@ TclpGetPwUid(
if (tsdPtr->pbuflen < 1) {
tsdPtr->pbuflen = 1024;
}
- tsdPtr->pbuf = ckalloc(tsdPtr->pbuflen);
+ tsdPtr->pbuf = (char *)ckalloc(tsdPtr->pbuflen);
Tcl_CreateThreadExitHandler(FreePwBuf, NULL);
}
while (1) {
@@ -294,7 +294,7 @@ TclpGetPwUid(
return NULL;
}
tsdPtr->pbuflen *= 2;
- tsdPtr->pbuf = ckrealloc(tsdPtr->pbuf, tsdPtr->pbuflen);
+ tsdPtr->pbuf = (char *)ckrealloc(tsdPtr->pbuf, tsdPtr->pbuflen);
}
return (pwPtr != NULL ? &tsdPtr->pwd : NULL);
@@ -336,9 +336,10 @@ TclpGetPwUid(
#ifdef NEED_PW_CLEANER
static void
FreePwBuf(
- ClientData ignored)
+ ClientData dummy)
{
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
+ (void)dummy;
ckfree(tsdPtr->pbuf);
}
@@ -384,7 +385,7 @@ TclpGetGrNam(
if (tsdPtr->gbuflen < 1) {
tsdPtr->gbuflen = 1024;
}
- tsdPtr->gbuf = ckalloc(tsdPtr->gbuflen);
+ tsdPtr->gbuf = (char*)ckalloc(tsdPtr->gbuflen);
Tcl_CreateThreadExitHandler(FreeGrBuf, NULL);
}
while (1) {
@@ -397,7 +398,7 @@ TclpGetGrNam(
return NULL;
}
tsdPtr->gbuflen *= 2;
- tsdPtr->gbuf = ckrealloc(tsdPtr->gbuf, tsdPtr->gbuflen);
+ tsdPtr->gbuf = (char *)ckrealloc(tsdPtr->gbuf, tsdPtr->gbuflen);
}
return (grPtr != NULL ? &tsdPtr->grp : NULL);
@@ -464,7 +465,7 @@ TclpGetGrGid(
if (tsdPtr->gbuflen < 1) {
tsdPtr->gbuflen = 1024;
}
- tsdPtr->gbuf = ckalloc(tsdPtr->gbuflen);
+ tsdPtr->gbuf = (char*)ckalloc(tsdPtr->gbuflen);
Tcl_CreateThreadExitHandler(FreeGrBuf, NULL);
}
while (1) {
@@ -477,7 +478,7 @@ TclpGetGrGid(
return NULL;
}
tsdPtr->gbuflen *= 2;
- tsdPtr->gbuf = ckrealloc(tsdPtr->gbuf, tsdPtr->gbuflen);
+ tsdPtr->gbuf = (char *)ckrealloc(tsdPtr->gbuf, tsdPtr->gbuflen);
}
return (grPtr != NULL ? &tsdPtr->grp : NULL);
@@ -519,9 +520,10 @@ TclpGetGrGid(
#ifdef NEED_GR_CLEANER
static void
FreeGrBuf(
- ClientData ignored)
+ ClientData dummy)
{
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
+ (void)dummy;
ckfree(tsdPtr->gbuf);
}
diff --git a/unix/tclUnixFCmd.c b/unix/tclUnixFCmd.c
index 62fd9f8..9018bd1 100644
--- a/unix/tclUnixFCmd.c
+++ b/unix/tclUnixFCmd.c
@@ -113,16 +113,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,
@@ -145,7 +137,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",
@@ -167,7 +158,6 @@ const char *const tclpFileAttrStrings[] = {
NULL
};
-MODULE_SCOPE const TclFileAttrProcs tclpFileAttrProcs[];
const TclFileAttrProcs tclpFileAttrProcs[] = {
#if defined(__CYGWIN__)
{GetUnixFileAttributes, SetUnixFileAttributes},
@@ -331,8 +321,8 @@ TclpObjRenameFile(
Tcl_Obj *srcPathPtr,
Tcl_Obj *destPathPtr)
{
- return DoRenameFile(Tcl_FSGetNativePath(srcPathPtr),
- Tcl_FSGetNativePath(destPathPtr));
+ return DoRenameFile((const char *)Tcl_FSGetNativePath(srcPathPtr),
+ (const char *)Tcl_FSGetNativePath(destPathPtr));
}
static int
@@ -447,14 +437,14 @@ TclpObjCopyFile(
Tcl_Obj *srcPathPtr,
Tcl_Obj *destPathPtr)
{
- const char *src = Tcl_FSGetNativePath(srcPathPtr);
+ const char *src = (const char *)Tcl_FSGetNativePath(srcPathPtr);
Tcl_StatBuf srcStatBuf;
if (TclOSlstat(src, &srcStatBuf) != 0) { /* INTL: Native. */
return TCL_ERROR;
}
- return DoCopyFile(src, Tcl_FSGetNativePath(destPathPtr), &srcStatBuf);
+ return DoCopyFile(src, (const char *)Tcl_FSGetNativePath(destPathPtr), &srcStatBuf);
}
static int
@@ -610,7 +600,7 @@ TclUnixCopyFile(
if (blockSize <= 0) {
blockSize = DEFAULT_COPY_BLOCK_SIZE;
}
- buffer = ckalloc(blockSize);
+ buffer = (char *)ckalloc(blockSize);
while (1) {
nread = (size_t) read(srcFd, buffer, blockSize);
if ((nread == (size_t) -1) || (nread == 0)) {
@@ -709,7 +699,7 @@ int
TclpObjCreateDirectory(
Tcl_Obj *pathPtr)
{
- return DoCreateDirectory(Tcl_FSGetNativePath(pathPtr));
+ return DoCreateDirectory((const char *)Tcl_FSGetNativePath(pathPtr));
}
static int
@@ -1240,7 +1230,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(). */
@@ -1248,6 +1238,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) {
@@ -1296,6 +1289,7 @@ CopyFileAtts(
{
struct utimbuf tval;
mode_t newMode;
+ (void)src;
newMode = statBufPtr->st_mode
& (S_ISUID | S_ISGID | S_IRWXU | S_IRWXG | S_IRWXO);
@@ -1354,6 +1348,7 @@ GetGroupAttribute(
Tcl_StatBuf statBuf;
struct group *groupPtr;
int result;
+ (void)objIndex;
result = TclpObjStat(fileName, &statBuf);
@@ -1408,6 +1403,7 @@ GetOwnerAttribute(
Tcl_StatBuf statBuf;
struct passwd *pwPtr;
int result;
+ (void)objIndex;
result = TclpObjStat(fileName, &statBuf);
@@ -1459,6 +1455,7 @@ GetPermissionsAttribute(
{
Tcl_StatBuf statBuf;
int result;
+ (void)objIndex;
result = TclpObjStat(fileName, &statBuf);
@@ -1502,6 +1499,7 @@ SetGroupAttribute(
Tcl_WideInt gid;
int result;
const char *native;
+ (void)objIndex;
if (Tcl_GetWideIntFromObj(NULL, attributePtr, &gid) != TCL_OK) {
Tcl_DString ds;
@@ -1528,7 +1526,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) {
@@ -1568,6 +1566,7 @@ SetOwnerAttribute(
Tcl_WideInt uid;
int result;
const char *native;
+ (void)objIndex;
if (Tcl_GetWideIntFromObj(NULL, attributePtr, &uid) != TCL_OK) {
Tcl_DString ds;
@@ -1594,7 +1593,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) {
@@ -1637,6 +1636,7 @@ SetPermissionsAttribute(
const char *native;
const char *modeStringPtr = TclGetString(attributePtr);
int scanned = TclParseAllWhiteSpace(modeStringPtr, -1);
+ (void)objIndex;
/*
* First supply support for octal number format
@@ -1688,7 +1688,7 @@ SetPermissionsAttribute(
}
}
- native = Tcl_FSGetNativePath(fileName);
+ native = (const char *)Tcl_FSGetNativePath(fileName);
result = chmod(native, newMode); /* INTL: Native. */
if (result != 0) {
if (interp != NULL) {
@@ -1749,7 +1749,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 */
{
@@ -1758,6 +1758,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
@@ -1936,7 +1937,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
@@ -1955,6 +1956,7 @@ TclpObjNormalizePath(
#ifndef NO_REALPATH
char normPath[MAXPATHLEN];
#endif
+ (void)dummy;
currentPathEndPosition = path + nextCheckpoint;
if (*currentPathEndPosition == '/') {
@@ -1967,7 +1969,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,
@@ -2169,7 +2171,7 @@ TclUnixOpenTemporaryFile(
Tcl_Obj *extensionObj,
Tcl_Obj *resultingNameObj)
{
- Tcl_DString template, tmp;
+ Tcl_DString templ, tmp;
const char *string;
int fd;
@@ -2179,46 +2181,46 @@ TclUnixOpenTemporaryFile(
if (dirObj) {
string = TclGetString(dirObj);
- Tcl_UtfToExternalDString(NULL, string, dirObj->length, &template);
+ Tcl_UtfToExternalDString(NULL, string, dirObj->length, &templ);
} else {
- Tcl_DStringInit(&template);
- Tcl_DStringAppend(&template, DefaultTempDir(), -1); /* INTL: native */
+ Tcl_DStringInit(&templ);
+ Tcl_DStringAppend(&templ, DefaultTempDir(), -1); /* INTL: native */
}
- TclDStringAppendLiteral(&template, "/");
+ TclDStringAppendLiteral(&templ, "/");
if (basenameObj) {
string = TclGetString(basenameObj);
Tcl_UtfToExternalDString(NULL, string, basenameObj->length, &tmp);
- TclDStringAppendDString(&template, &tmp);
+ TclDStringAppendDString(&templ, &tmp);
Tcl_DStringFree(&tmp);
} else {
- TclDStringAppendLiteral(&template, "tcl");
+ TclDStringAppendLiteral(&templ, "tcl");
}
- TclDStringAppendLiteral(&template, "_XXXXXX");
+ TclDStringAppendLiteral(&templ, "_XXXXXX");
#ifdef HAVE_MKSTEMPS
if (extensionObj) {
string = TclGetString(extensionObj);
Tcl_UtfToExternalDString(NULL, string, extensionObj->length, &tmp);
- TclDStringAppendDString(&template, &tmp);
- fd = mkstemps(Tcl_DStringValue(&template), Tcl_DStringLength(&tmp));
+ TclDStringAppendDString(&templ, &tmp);
+ fd = mkstemps(Tcl_DStringValue(&templ), Tcl_DStringLength(&tmp));
Tcl_DStringFree(&tmp);
} else
#endif
{
- fd = mkstemp(Tcl_DStringValue(&template));
+ fd = mkstemp(Tcl_DStringValue(&templ));
}
if (fd == -1) {
- Tcl_DStringFree(&template);
+ Tcl_DStringFree(&templ);
return -1;
}
if (resultingNameObj) {
- Tcl_ExternalToUtfDString(NULL, Tcl_DStringValue(&template),
- Tcl_DStringLength(&template), &tmp);
+ Tcl_ExternalToUtfDString(NULL, Tcl_DStringValue(&templ),
+ Tcl_DStringLength(&templ), &tmp);
Tcl_SetStringObj(resultingNameObj, Tcl_DStringValue(&tmp),
Tcl_DStringLength(&tmp));
Tcl_DStringFree(&tmp);
@@ -2229,10 +2231,10 @@ TclUnixOpenTemporaryFile(
* this!
*/
- unlink(Tcl_DStringValue(&template));
+ unlink(Tcl_DStringValue(&templ));
errno = 0;
}
- Tcl_DStringFree(&template);
+ Tcl_DStringFree(&templ);
return fd;
}
@@ -2292,7 +2294,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"
@@ -2304,37 +2306,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;
}
@@ -2342,9 +2344,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);
}
@@ -2366,11 +2368,11 @@ winPathFromObj(
Tcl_Obj *fileName)
{
int size;
- const char *native = Tcl_FSGetNativePath(fileName);
+ const char *native = (const char *)Tcl_FSGetNativePath(fileName);
WCHAR *winPath;
size = cygwin_conv_path(1, native, NULL, 0);
- winPath = ckalloc(size);
+ winPath = (WCHAR *)ckalloc(size);
cygwin_conv_path(1, native, winPath, size);
return winPath;
@@ -2505,6 +2507,7 @@ GetUnixFileAttributes(
{
Tcl_StatBuf statBuf;
int result;
+ (void)objIndex;
result = TclpObjStat(fileName, &statBuf);
@@ -2547,6 +2550,7 @@ SetUnixFileAttributes(
Tcl_StatBuf statBuf;
int result, readonly;
const char *native;
+ (void)objIndex;
if (Tcl_GetBooleanFromObj(interp, attributePtr, &readonly) != TCL_OK) {
return TCL_ERROR;
@@ -2569,7 +2573,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 ca3bccf..9f4eb77 100644
--- a/unix/tclUnixFile.c
+++ b/unix/tclUnixFile.c
@@ -44,6 +44,8 @@ TclpFindExecutable(
int 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 = ckalloc(strlen(buffer) + 1);
+ char *newCd = (char*)ckalloc(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;
}
@@ -982,7 +986,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;
}
@@ -1018,6 +1022,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 = ckalloc(len);
+ nativePathPtr = (char *)ckalloc(len);
memcpy(nativePathPtr, Tcl_DStringValue(&ds), len);
Tcl_DStringFree(&ds);
@@ -1157,7 +1162,7 @@ TclNativeDupInternalRep(
len = (strlen((const char*) clientData) + 1) * sizeof(char);
- copy = ckalloc(len);
+ copy = (char *)ckalloc(len);
memcpy(copy, clientData, len);
return copy;
}
@@ -1183,7 +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 218813f..0e61e85 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] = {
@@ -540,7 +546,7 @@ TclpInitLibraryPath(
*encodingPtr = Tcl_GetEncoding(NULL, NULL);
str = TclGetString(pathPtr);
*lengthPtr = pathPtr->length;
- *valuePtr = ckalloc(*lengthPtr + 1);
+ *valuePtr = (char *)ckalloc(*lengthPtr + 1);
memcpy(*valuePtr, str, *lengthPtr + 1);
Tcl_DecrRefCount(pathPtr);
}
@@ -1059,6 +1065,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 93faec8..31d9671 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 = ckalloc(sizeof(PipeState));
+ PipeState *statePtr = (PipeState *)ckalloc(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 d253101..4b79677 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 57735da..31095bd 100644
--- a/unix/tclUnixSock.c
+++ b/unix/tclUnixSock.c
@@ -66,7 +66,7 @@ struct TcpState {
Tcl_TcpAcceptProc *acceptProc;
/* Proc to call on accept. */
- ClientData acceptProcData; /* The data for the accept proc. */
+ void *acceptProcData; /* The data for the accept proc. */
/*
* Only needed for client sockets
@@ -130,24 +130,24 @@ struct TcpState {
*/
static int TcpConnect(Tcl_Interp *interp, TcpState *state);
-static void TcpAccept(ClientData data, int mask);
-static int TcpBlockModeProc(ClientData data, int mode);
-static int TcpCloseProc(ClientData instanceData,
+static void TcpAccept(void *data, int mask);
+static int TcpBlockModeProc(void *data, int mode);
+static int TcpCloseProc(void *instanceData,
Tcl_Interp *interp);
-static int TcpClose2Proc(ClientData instanceData,
+static int TcpClose2Proc(void *instanceData,
Tcl_Interp *interp, int flags);
-static int TcpGetHandleProc(ClientData instanceData,
- int direction, ClientData *handlePtr);
-static int TcpGetOptionProc(ClientData instanceData,
+static int TcpGetHandleProc(void *instanceData,
+ int direction, void **handlePtr);
+static int TcpGetOptionProc(void *instanceData,
Tcl_Interp *interp, const char *optionName,
Tcl_DString *dsPtr);
-static int TcpInputProc(ClientData instanceData, char *buf,
+static int TcpInputProc(void *instanceData, char *buf,
int toRead, int *errorCode);
-static int TcpOutputProc(ClientData instanceData,
+static int TcpOutputProc(void *instanceData,
const char *buf, int toWrite, int *errorCode);
-static void TcpWatchProc(ClientData instanceData, int mask);
+static void TcpWatchProc(void *instanceData, int mask);
static int WaitForConnect(TcpState *statePtr, int *errorCodePtr);
-static void WrapNotify(ClientData clientData, int mask);
+static void WrapNotify(void *clientData, int mask);
/*
* This structure describes the channel type structure for TCP socket
@@ -239,7 +239,7 @@ InitializeHostName(
char *dot = strchr(u.nodename, '.');
if (dot != NULL) {
- char *node = ckalloc(dot - u.nodename + 1);
+ char *node = (char *)ckalloc(dot - u.nodename + 1);
memcpy(node, u.nodename, dot - u.nodename);
node[dot - u.nodename] = '\0';
@@ -283,11 +283,11 @@ InitializeHostName(
*encodingPtr = Tcl_GetEncoding(NULL, NULL);
if (native) {
*lengthPtr = strlen(native);
- *valuePtr = ckalloc(*lengthPtr + 1);
+ *valuePtr = (char *)ckalloc(*lengthPtr + 1);
memcpy(*valuePtr, native, *lengthPtr + 1);
} else {
*lengthPtr = 0;
- *valuePtr = ckalloc(1);
+ *valuePtr = (char *)ckalloc(1);
*valuePtr[0] = '\0';
}
}
@@ -334,8 +334,10 @@ Tcl_GetHostName(void)
int
TclpHasSockets(
- Tcl_Interp *interp) /* Not used. */
+ Tcl_Interp *dummy) /* Not used. */
{
+ (void)dummy;
+
return TCL_OK;
}
@@ -381,12 +383,12 @@ TclpFinalizeSockets(void)
/* ARGSUSED */
static int
TcpBlockModeProc(
- ClientData instanceData, /* Socket state. */
+ void *instanceData, /* Socket state. */
int mode) /* The mode to set. Can be one of
* TCL_MODE_BLOCKING or
* TCL_MODE_NONBLOCKING. */
{
- TcpState *statePtr = instanceData;
+ TcpState *statePtr = (TcpState *)instanceData;
if (mode == TCL_MODE_BLOCKING) {
CLEAR_BITS(statePtr->flags, TCP_NONBLOCKING);
@@ -527,13 +529,13 @@ WaitForConnect(
/* ARGSUSED */
static int
TcpInputProc(
- ClientData instanceData, /* Socket state. */
+ void *instanceData, /* Socket state. */
char *buf, /* Where to store data read. */
int bufSize, /* How much space is available in the
* buffer? */
int *errorCodePtr) /* Where to store error code. */
{
- TcpState *statePtr = instanceData;
+ TcpState *statePtr = (TcpState *)instanceData;
int bytesRead;
*errorCodePtr = 0;
@@ -578,12 +580,12 @@ TcpInputProc(
static int
TcpOutputProc(
- ClientData instanceData, /* Socket state. */
+ void *instanceData, /* Socket state. */
const char *buf, /* The data buffer. */
int toWrite, /* How many bytes to write? */
int *errorCodePtr) /* Where to store error code. */
{
- TcpState *statePtr = instanceData;
+ TcpState *statePtr = (TcpState *)instanceData;
int written;
*errorCodePtr = 0;
@@ -620,12 +622,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
@@ -681,11 +684,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;
@@ -832,7 +835,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
@@ -840,7 +843,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);
@@ -998,7 +1001,7 @@ TcpGetOptionProc(
static void
WrapNotify(
- ClientData clientData,
+ void *clientData,
int mask)
{
TcpState *statePtr = (TcpState *) clientData;
@@ -1027,12 +1030,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) {
/*
@@ -1101,11 +1104,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;
@@ -1125,12 +1129,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);
}
/*
@@ -1172,6 +1178,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;
@@ -1182,7 +1189,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
@@ -1389,7 +1395,7 @@ Tcl_OpenTcpClient(
* Allocate a new TcpState for this socket.
*/
- statePtr = ckalloc(sizeof(TcpState));
+ statePtr = (TcpState *)ckalloc(sizeof(TcpState));
memset(statePtr, 0, sizeof(TcpState));
statePtr->flags = async ? TCP_ASYNC_CONNECT : 0;
statePtr->cachedBlocking = TCL_MODE_BLOCKING;
@@ -1436,7 +1442,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);
@@ -1468,7 +1474,7 @@ TclpMakeTcpClientChannelMode(
TcpState *statePtr;
char channelName[SOCK_CHAN_LENGTH];
- statePtr = ckalloc(sizeof(TcpState));
+ statePtr = (TcpState *)ckalloc(sizeof(TcpState));
memset(statePtr, 0, sizeof(TcpState));
statePtr->fds.fd = PTR2INT(sock);
statePtr->flags = 0;
@@ -1511,7 +1517,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 */
@@ -1691,14 +1697,14 @@ Tcl_OpenTcpServerEx(
* Allocate a new TcpState for this socket.
*/
- statePtr = ckalloc(sizeof(TcpState));
+ statePtr = (TcpState *)ckalloc(sizeof(TcpState));
memset(statePtr, 0, sizeof(TcpState));
statePtr->acceptProc = acceptProc;
statePtr->acceptProcData = acceptProcData;
sprintf(channelName, SOCK_TEMPLATE, (long) statePtr);
newfds = &statePtr->fds;
} else {
- newfds = ckalloc(sizeof(TcpFdList));
+ newfds = (TcpFdList *)ckalloc(sizeof(TcpFdList));
memset(newfds, (int) 0, sizeof(TcpFdList));
fds->next = newfds;
}
@@ -1759,16 +1765,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);
@@ -1783,7 +1790,7 @@ TcpAccept(
(void) fcntl(newsock, F_SETFD, FD_CLOEXEC);
- newSockState = ckalloc(sizeof(TcpState));
+ newSockState = (TcpState *)ckalloc(sizeof(TcpState));
memset(newSockState, 0, sizeof(TcpState));
newSockState->flags = 0;
newSockState->fds.fd = newsock;
diff --git a/unix/tclUnixTest.c b/unix/tclUnixTest.c
index 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 054a5d2..795c62c 100644
--- a/unix/tclUnixThrd.c
+++ b/unix/tclUnixThrd.c
@@ -577,7 +577,7 @@ Tcl_MutexLock(
* Double inside master lock check to avoid a race condition.
*/
- pmutexPtr = ckalloc(sizeof(PMutex));
+ pmutexPtr = (PMutex *)ckalloc(sizeof(PMutex));
PMutexInit(pmutexPtr);
*mutexPtr = (Tcl_Mutex) pmutexPtr;
TclRememberMutex(mutexPtr);
@@ -687,7 +687,7 @@ Tcl_ConditionWait(
*/
if (*condPtr == NULL) {
- pcondPtr = ckalloc(sizeof(pthread_cond_t));
+ pcondPtr = (pthread_cond_t *)ckalloc(sizeof(pthread_cond_t));
pthread_cond_init(pcondPtr, NULL);
*condPtr = (Tcl_Condition) pcondPtr;
TclRememberCondition(condPtr);
@@ -846,7 +846,7 @@ TclpNewAllocMutex(void)
AllocMutex *lockPtr;
PMutex *plockPtr;
- lockPtr = malloc(sizeof(AllocMutex));
+ lockPtr = (AllocMutex *)malloc(sizeof(AllocMutex));
if (lockPtr == NULL) {
Tcl_Panic("could not allocate lock");
}
@@ -917,7 +917,7 @@ TclpThreadCreateKey(void)
{
pthread_key_t *ptkeyPtr;
- ptkeyPtr = TclpSysAlloc(sizeof(pthread_key_t), 0);
+ ptkeyPtr = (pthread_key_t *)TclpSysAlloc(sizeof(pthread_key_t), 0);
if (NULL == ptkeyPtr) {
Tcl_Panic("unable to allocate thread key!");
}
@@ -933,7 +933,7 @@ void
TclpThreadDeleteKey(
void *keyPtr)
{
- pthread_key_t *ptkeyPtr = keyPtr;
+ pthread_key_t *ptkeyPtr = (pthread_key_t *)keyPtr;
if (pthread_key_delete(*ptkeyPtr)) {
Tcl_Panic("unable to delete key!");
@@ -947,7 +947,7 @@ TclpThreadSetMasterTSD(
void *tsdKeyPtr,
void *ptr)
{
- pthread_key_t *ptkeyPtr = tsdKeyPtr;
+ pthread_key_t *ptkeyPtr = (pthread_key_t *)tsdKeyPtr;
if (pthread_setspecific(*ptkeyPtr, ptr)) {
Tcl_Panic("unable to set master TSD value");
@@ -958,7 +958,7 @@ void *
TclpThreadGetMasterTSD(
void *tsdKeyPtr)
{
- pthread_key_t *ptkeyPtr = tsdKeyPtr;
+ pthread_key_t *ptkeyPtr = (pthread_key_t*)tsdKeyPtr;
return pthread_getspecific(*ptkeyPtr);
}
diff --git a/unix/tclUnixTime.c b/unix/tclUnixTime.c
index 1b90f6e..fb649d2 100644
--- a/unix/tclUnixTime.c
+++ b/unix/tclUnixTime.c
@@ -58,7 +58,7 @@ static void NativeGetTime(Tcl_Time *timebuf,
Tcl_GetTimeProc *tclGetTimeProcPtr = NativeGetTime;
Tcl_ScaleTimeProc *tclScaleTimeProcPtr = NativeScaleTime;
-ClientData tclTimeClientData = NULL;
+void *tclTimeClientData = NULL;
/*
*----------------------------------------------------------------------
@@ -511,6 +511,8 @@ NativeScaleTime(
Tcl_Time *timePtr,
ClientData clientData)
{
+ (void)timePtr;
+ (void)clientData;
/* Native scale is 1:1. Nothing is done */
}
@@ -534,9 +536,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;
@@ -578,7 +581,7 @@ SetTZIfNecessary(void)
} else {
ckfree(lastTZ);
}
- lastTZ = ckalloc(strlen(newTZ) + 1);
+ lastTZ = (char *)ckalloc(strlen(newTZ) + 1);
strcpy(lastTZ, newTZ);
}
Tcl_MutexUnlock(&tmMutex);
@@ -603,8 +606,9 @@ SetTZIfNecessary(void)
static void
CleanupMemory(
- ClientData ignored)
+ ClientData dummy)
{
+ (void)dummy;
ckfree(lastTZ);
}
#endif /* TCL_NO_DEPRECATED */
diff --git a/unix/tclXtNotify.c b/unix/tclXtNotify.c
index 26db9f2..490b739 100644
--- a/unix/tclXtNotify.c
+++ b/unix/tclXtNotify.c
@@ -359,7 +359,7 @@ CreateFileHandler(
}
}
if (filePtr == NULL) {
- filePtr = ckalloc(sizeof(FileHandler));
+ filePtr = (FileHandler *)ckalloc(sizeof(FileHandler));
filePtr->fd = fd;
filePtr->read = 0;
filePtr->write = 0;
@@ -525,7 +525,7 @@ FileProc(
*/
filePtr->readyMask |= mask;
- fileEvPtr = ckalloc(sizeof(FileHandlerEvent));
+ fileEvPtr = (FileHandlerEvent *)ckalloc(sizeof(FileHandlerEvent));
fileEvPtr->header.proc = FileHandlerEventProc;
fileEvPtr->fd = filePtr->fd;
Tcl_QueueEvent((Tcl_Event *) fileEvPtr, TCL_QUEUE_TAIL);
diff --git a/win/configure b/win/configure
index 71ca948..27e204b 100755
--- a/win/configure
+++ b/win/configure
@@ -4217,7 +4217,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 -Wpointer-arith"
LDFLAGS_DEBUG=
LDFLAGS_OPTIMIZE=
@@ -4226,7 +4226,7 @@ $as_echo "using shared flags" >&6; }
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/tcl.m4 b/win/tcl.m4
index 225cfdc..ca04f84 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 fa27756..0a47000 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
@@ -271,7 +273,7 @@ setargv(
# undef Tcl_Alloc
# undef Tcl_DbCkalloc
- argSpace = ckalloc(size * sizeof(char *)
+ argSpace = (TCHAR *)ckalloc(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 2fed58b..821ac35 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 = ckalloc(sizeof(MountPointMap));
- dlPtr2->volumeName = TclNativeDupInternalRep(Target);
+ dlPtr2 = (MountPointMap *)ckalloc(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 = ckalloc(sizeof(MountPointMap));
- dlPtr2->volumeName = TclNativeDupInternalRep((ClientData) mountPoint);
+ dlPtr2 = (MountPointMap *)ckalloc(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 b08db5d..d8c734c 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 = ckalloc(sizeof(FileEvent));
+ evPtr = (FileEvent *)ckalloc(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 = ckalloc(sizeof(FileInfo));
+ infoPtr = (FileInfo *)ckalloc(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 7de425b..9ba2ea0 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 = ckalloc(sizeof(ConsoleEvent));
+ ConsoleEvent *evPtr = (ConsoleEvent *)ckalloc(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(
ckfree(infoPtr->writeBuf);
}
infoPtr->writeBufLen = toWrite;
- infoPtr->writeBuf = ckalloc(toWrite);
+ infoPtr->writeBuf = (char *)ckalloc(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 = ckalloc(sizeof(ConsoleInfo));
+ infoPtr = (ConsoleInfo *)ckalloc(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 8885e33..b9a5342 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) {
@@ -1597,6 +1599,7 @@ ConvertFileNameFormat(
{
int pathc, i;
Tcl_Obj *splitPath;
+ (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], Tcl_GetString(fileName)));
diff --git a/win/tclWinFile.c b/win/tclWinFile.c
index 292bb43..1380217 100644
--- a/win/tclWinFile.c
+++ b/win/tclWinFile.c
@@ -938,7 +938,7 @@ TclpMatchInDirectory(
WIN32_FILE_ATTRIBUTE_DATA data;
const char *str = TclGetStringFromObj(norm, &len);
- native = Tcl_FSGetNativePath(pathPtr);
+ native = (const WCHAR *)Tcl_FSGetNativePath(pathPtr);
if (GetFileAttributesExW(native,
GetFileExInfoStandard, &data) != TRUE) {
@@ -979,7 +979,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;
}
@@ -1501,7 +1501,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;
@@ -1920,7 +1920,7 @@ TclpObjChdir(
int result;
const WCHAR *nativePath;
- nativePath = Tcl_FSGetNativePath(pathPtr);
+ nativePath = (const WCHAR *)Tcl_FSGetNativePath(pathPtr);
if (!nativePath) {
return -1;
@@ -2013,7 +2013,7 @@ TclpObjStat(
TclWinFlushDirtyChannels();
- return NativeStat(Tcl_FSGetNativePath(pathPtr), statPtr, 0);
+ return NativeStat((const WCHAR *)Tcl_FSGetNativePath(pathPtr), statPtr, 0);
}
/*
@@ -2207,7 +2207,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.
*/
@@ -2384,7 +2384,7 @@ TclpObjAccess(
Tcl_Obj *pathPtr,
int mode)
{
- return NativeAccess(Tcl_FSGetNativePath(pathPtr), mode);
+ return NativeAccess((const WCHAR *)Tcl_FSGetNativePath(pathPtr), mode);
}
int
@@ -2400,7 +2400,7 @@ TclpObjLstat(
TclWinFlushDirtyChannels();
- return NativeStat(Tcl_FSGetNativePath(pathPtr), statPtr, 1);
+ return NativeStat((const WCHAR *)Tcl_FSGetNativePath(pathPtr), statPtr, 1);
}
#ifdef S_IFLNK
@@ -2413,14 +2413,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;
@@ -2432,7 +2432,7 @@ TclpObjLink(
return NULL;
}
} else {
- const WCHAR *LinkSource = Tcl_FSGetNativePath(pathPtr);
+ const WCHAR *LinkSource = (const WCHAR *)Tcl_FSGetNativePath(pathPtr);
if (LinkSource == NULL) {
return NULL;
@@ -2481,13 +2481,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);
}
@@ -2541,7 +2541,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 */
@@ -2552,6 +2552,7 @@ TclpObjNormalizePath(
Tcl_Obj *temp = NULL;
int isDrive = 1;
Tcl_DString ds; /* Some workspace. */
+ (void)dummy;
Tcl_DStringInit(&dsNorm);
path = Tcl_GetString(pathPtr);
@@ -3114,7 +3115,7 @@ TclNativeCreateNativeRep(
* Overallocate 6 chars, making some room for extended paths
*/
- wp = nativePathPtr = ckalloc((len + 6) * sizeof(WCHAR));
+ wp = nativePathPtr = (WCHAR *)ckalloc((len + 6) * sizeof(WCHAR));
if (nativePathPtr==0) {
goto done;
}
@@ -3212,7 +3213,7 @@ TclNativeDupInternalRep(
len = sizeof(WCHAR) * (wcslen((const WCHAR *) clientData) + 1);
- copy = ckalloc(len);
+ copy = (char *)ckalloc(len);
memcpy(copy, clientData, len);
return copy;
}
@@ -3249,7 +3250,7 @@ TclpUtime(
FromCTime(tval->actime, &lastAccessTime);
FromCTime(tval->modtime, &lastModTime);
- native = Tcl_FSGetNativePath(pathPtr);
+ native = (const WCHAR *)Tcl_FSGetNativePath(pathPtr);
attr = GetFileAttributesW(native);
@@ -3300,7 +3301,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,
@@ -3328,7 +3329,7 @@ TclWinFileOwned(
bufsz = 0;
GetTokenInformation(token, TokenUser, NULL, 0, &bufsz);
if (bufsz) {
- buf = ckalloc(bufsz);
+ buf = (LPBYTE)ckalloc(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 09e98e2..803e466 100644
--- a/win/tclWinInit.c
+++ b/win/tclWinInit.c
@@ -157,7 +157,7 @@ TclpInitPlatform(void)
*/
handle = GetModuleHandleW(L"KERNEL32");
tclWinProcs.cancelSynchronousIo =
- (BOOL (WINAPI *)(HANDLE)) GetProcAddress(handle,
+ (BOOL (WINAPI *)(HANDLE))(void *)GetProcAddress(handle,
"CancelSynchronousIo");
}
@@ -226,7 +226,7 @@ TclpInitLibraryPath(
*encodingPtr = NULL;
bytes = TclGetStringFromObj(pathPtr, &length);
*lengthPtr = length++;
- *valuePtr = ckalloc(length);
+ *valuePtr = (char *)ckalloc(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 = ckalloc(*lengthPtr + 1);
+ *valuePtr = (char *)ckalloc(*lengthPtr + 1);
*encodingPtr = NULL;
memcpy(*valuePtr, name, *lengthPtr + 1);
}
@@ -411,7 +411,7 @@ InitializeSourceLibraryDir(
TclWinNoBackslash(name);
sprintf(end + 1, "../library");
*lengthPtr = strlen(name);
- *valuePtr = ckalloc(*lengthPtr + 1);
+ *valuePtr = (char *)ckalloc(*lengthPtr + 1);
*encodingPtr = NULL;
memcpy(*valuePtr, name, *lengthPtr + 1);
}
@@ -525,7 +525,7 @@ TclpSetVariables(
if (!osInfoInitialized) {
HMODULE handle = GetModuleHandleW(L"NTDLL");
int(__stdcall *getversion)(void *) =
- (int(__stdcall *)(void *)) GetProcAddress(handle, "RtlGetVersion");
+ (int(__stdcall *)(void *))(void *)GetProcAddress(handle, "RtlGetVersion");
osInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFOW);
if (!getversion || getversion(&osInfo)) {
GetVersionExW(&osInfo);
@@ -643,7 +643,7 @@ TclpFindVariable(
*/
length = strlen(name);
- nameUpper = ckalloc(length + 1);
+ nameUpper = (char *)ckalloc(length + 1);
memcpy(nameUpper, name, length+1);
Tcl_UtfToUpper(nameUpper);
diff --git a/win/tclWinLoad.c b/win/tclWinLoad.c
index b79a4ca..3f48f7c 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 = ckalloc(sizeof(struct Tcl_LoadHandle_));
+ handlePtr = (Tcl_LoadHandle)ckalloc(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 = ckalloc((nameLen+1) * sizeof(WCHAR));
+ dllDirectoryName = (WCHAR *)ckalloc((nameLen+1) * sizeof(WCHAR));
wcscpy(dllDirectoryName, name);
return TCL_OK;
}
diff --git a/win/tclWinPipe.c b/win/tclWinPipe.c
index 23ede6e..26f0b3e 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 = ckalloc(sizeof(PipeEvent));
+ evPtr = (PipeEvent *)ckalloc(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 = ckalloc(sizeof(WinFile));
+ filePtr = (WinFile *)ckalloc(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 = ckalloc(sizeof(PipeInfo));
+ PipeInfo *infoPtr = (PipeInfo *)ckalloc(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(
ckfree(infoPtr->writeBuf);
}
infoPtr->writeBufLen = toWrite;
- infoPtr->writeBuf = ckalloc(toWrite);
+ infoPtr->writeBuf = (char *)ckalloc(toWrite);
}
memcpy(infoPtr->writeBuf, buf, toWrite);
infoPtr->toWrite = toWrite;
@@ -2711,7 +2714,7 @@ TclWinAddProcess(
void *hProcess, /* Handle to process */
unsigned long id) /* Global process identifier */
{
- ProcInfo *procPtr = ckalloc(sizeof(ProcInfo));
+ ProcInfo *procPtr = (ProcInfo*)ckalloc(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) {
/*
@@ -3200,6 +3204,8 @@ TclpOpenTemporaryFile(
DWORD flags = FILE_ATTRIBUTE_TEMPORARY;
int length, counter, counter2;
Tcl_DString buf;
+ (void)dirObj;
+ (void)extensionObj;
if (!resultingNameObj) {
flags |= FILE_FLAG_DELETE_ON_CLOSE;
@@ -3286,9 +3292,9 @@ TclPipeThreadCreateTI(
{
TclPipeThreadInfo *pipeTI;
#ifndef _PTI_USE_CKALLOC
- pipeTI = malloc(sizeof(TclPipeThreadInfo));
+ pipeTI = (TclPipeThreadInfo *)malloc(sizeof(TclPipeThreadInfo));
#else
- pipeTI = ckalloc(sizeof(TclPipeThreadInfo));
+ pipeTI = (TclPipeThreadInfo *)ckalloc(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 e945055..a63fd8e 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 = ckalloc(sizeof(SerialEvent));
+ evPtr = (SerialEvent *)ckalloc(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(
ckfree(infoPtr->writeBuf);
}
infoPtr->writeBufLen = toWrite;
- infoPtr->writeBuf = ckalloc(toWrite);
+ infoPtr->writeBuf = (char *)ckalloc(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 = ckalloc(sizeof(SerialInfo));
+ infoPtr = (SerialInfo *)ckalloc(sizeof(SerialInfo));
memset(infoPtr, 0, sizeof(SerialInfo));
infoPtr->validMask = permissions;
diff --git a/win/tclWinSock.c b/win/tclWinSock.c
index 8f61b08..846f2e1 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 = ckalloc(*lengthPtr + 1);
+ *valuePtr = (char *)ckalloc(*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 = ckalloc(sizeof(SocketEvent));
+ evPtr = (SocketEvent *)ckalloc(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 = ckalloc(sizeof(TcpFdList));
+ statePtr->sockets = (TcpFdList *)ckalloc(sizeof(TcpFdList));
fds = statePtr->sockets;
} else {
/*
@@ -3000,7 +3009,7 @@ AddSocketInfoFd(
fds = fds->next;
}
- fds->next = ckalloc(sizeof(TcpFdList));
+ fds->next = (TcpFdList *)ckalloc(sizeof(TcpFdList));
fds = fds->next;
}
@@ -3033,7 +3042,7 @@ AddSocketInfoFd(
static TcpState *
NewSocketInfo(SOCKET socket)
{
- TcpState *statePtr = ckalloc(sizeof(TcpState));
+ TcpState *statePtr = (TcpState *)ckalloc(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,
@@ -3477,7 +3486,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 ac39678..bc3701d 100644
--- a/win/tclWinTest.c
+++ b/win/tclWinTest.c
@@ -105,7 +105,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. */
@@ -113,6 +113,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 ...");
@@ -181,7 +182,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. */
@@ -190,6 +191,7 @@ TestvolumetypeCmd(
int found;
char volType[VOL_BUF_SIZE];
const char *path;
+ (void)dummy;
if (objc > 2) {
Tcl_WrongNumArgs(interp, 1, objv, "?name?");
@@ -260,6 +262,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, "");
@@ -296,12 +299,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");
@@ -316,11 +320,13 @@ TestwinsleepCmd(
static int
TestSizeCmd(
- ClientData clientData, /* Unused */
+ ClientData dummy, /* Unused */
Tcl_Interp* interp, /* Tcl interpreter */
int objc, /* Parameter count */
Tcl_Obj *const * objv) /* Parameter vector */
{
+ (void)dummy;
+
if (objc != 2) {
goto syntax;
}
@@ -391,6 +397,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>");
@@ -494,7 +501,7 @@ TestplatformChmod(
goto done;
}
- secDesc = ckalloc(secDescLen);
+ secDesc = (BYTE *)ckalloc(secDescLen);
if (!GetFileSecurityA(nativePath, infoBits,
(PSECURITY_DESCRIPTOR) secDesc, secDescLen, &secDescLen2)
|| (secDescLen < secDescLen2)) {
@@ -506,7 +513,7 @@ TestplatformChmod(
* Get the World SID.
*/
- userSid = ckalloc(GetSidLengthRequired((UCHAR) 1));
+ userSid = (SID *)ckalloc(GetSidLengthRequired((UCHAR) 1));
InitializeSid(userSid, &userSidAuthority, (BYTE) 1);
*(GetSidSubAuthority(userSid, 0)) = SECURITY_WORLD_RID;
@@ -532,7 +539,7 @@ TestplatformChmod(
newAclSize = ACLSize.AclBytesInUse + sizeof(ACCESS_DENIED_ACE)
+ GetLengthSid(userSid) - sizeof(DWORD);
- newAcl = ckalloc(newAclSize);
+ newAcl = (PACL) ckalloc(newAclSize);
/*
* Initialize the new ACL.
@@ -659,6 +666,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 d649310..89f2b12 100644
--- a/win/tclWinThrd.c
+++ b/win/tclWinThrd.c
@@ -568,7 +568,7 @@ Tcl_MutexLock(
*/
if (*mutexPtr == NULL) {
- csPtr = ckalloc(sizeof(CRITICAL_SECTION));
+ csPtr = (CRITICAL_SECTION *)ckalloc(sizeof(CRITICAL_SECTION));
InitializeCriticalSection(csPtr);
*mutexPtr = (Tcl_Mutex)csPtr;
TclRememberMutex(mutexPtr);
@@ -711,7 +711,7 @@ Tcl_ConditionWait(
*/
if (*condPtr == NULL) {
- winCondPtr = ckalloc(sizeof(WinCondition));
+ winCondPtr = (WinCondition *)ckalloc(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, 0);
+ key = (DWORD *)TclpSysAlloc(sizeof *key, 0);
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 f18d63e..4a55c3f 100644
--- a/win/tclWinTime.c
+++ b/win/tclWinTime.c
@@ -98,7 +98,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,
@@ -414,8 +414,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.
*/
@@ -649,9 +652,10 @@ NativeGetMicroseconds(void)
static void
NativeGetTime(
Tcl_Time *timePtr,
- ClientData clientData)
+ ClientData dummy)
{
Tcl_WideInt usecSincePosixEpoch;
+ (void)dummy;
/*
* Try to use high resolution timer.
@@ -694,8 +698,10 @@ void TclWinResetTimerResolution(void);
static void
StopCalibration(
- ClientData unused) /* Client data is unused */
+ ClientData dummy) /* Client data is unused */
{
+ (void)dummy;
+
SetEvent(timeInfo.exitEvent);
/*
@@ -977,6 +983,7 @@ CalibrationThread(
{
FILETIME curFileTime;
DWORD waitResult;
+ (void)arg;
/*
* Get initial system time and performance counter.