summaryrefslogtreecommitdiffstats
path: root/generic/tclIOCmd.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2020-02-28 12:46:42 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2020-02-28 12:46:42 (GMT)
commit4af90e27e5e22978b56d6cb5d0d1ecd90af0f48f (patch)
treed5db4ca8a1fecbd63d9e72730fad2f404367daff /generic/tclIOCmd.c
parent63994a73e3f641451b26f48f697b6a069863751c (diff)
parent52e543c5691a60c3ef802fecf1ae08e7efcf19b7 (diff)
downloadtcl-4af90e27e5e22978b56d6cb5d0d1ecd90af0f48f.zip
tcl-4af90e27e5e22978b56d6cb5d0d1ecd90af0f48f.tar.gz
tcl-4af90e27e5e22978b56d6cb5d0d1ecd90af0f48f.tar.bz2
Merge 8.7
Diffstat (limited to 'generic/tclIOCmd.c')
-rw-r--r--generic/tclIOCmd.c62
1 files changed, 41 insertions, 21 deletions
diff --git a/generic/tclIOCmd.c b/generic/tclIOCmd.c
index 342c730..2e492b8 100644
--- a/generic/tclIOCmd.c
+++ b/generic/tclIOCmd.c
@@ -71,9 +71,10 @@ static void UnregisterTcpServerInterpCleanupProc(
static void
FinalizeIOCmdTSD(
- ClientData clientData) /* Not used. */
+ ClientData dummy) /* Not used. */
{
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
+ (void)dummy;
if (tsdPtr->stdoutObjPtr != NULL) {
Tcl_DecrRefCount(tsdPtr->stdoutObjPtr);
@@ -113,6 +114,7 @@ Tcl_PutsObjCmd(
int newline; /* Add a newline at end? */
int result; /* Result of puts operation. */
int mode; /* Mode in which channel is opened. */
+ (void)dummy;
switch (objc) {
case 2: /* [puts $x] */
@@ -224,6 +226,7 @@ Tcl_FlushObjCmd(
Tcl_Obj *chanObjPtr;
Tcl_Channel chan; /* The channel to flush on. */
int mode;
+ (void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "channelId");
@@ -291,6 +294,7 @@ Tcl_GetsObjCmd(
int mode; /* Mode in which channel is opened. */
Tcl_Obj *linePtr, *chanObjPtr;
int code = TCL_OK;
+ (void)dummy;
if ((objc != 2) && (objc != 3)) {
Tcl_WrongNumArgs(interp, 1, objv, "channelId ?varName?");
@@ -377,6 +381,7 @@ Tcl_ReadObjCmd(
int charactersRead; /* How many characters were read? */
int mode; /* Mode in which channel is opened. */
Tcl_Obj *resultPtr, *chanObjPtr;
+ (void)dummy;
if ((objc != 2) && (objc != 3)) {
Interp *iPtr;
@@ -496,7 +501,7 @@ Tcl_ReadObjCmd(
/* ARGSUSED */
int
Tcl_SeekObjCmd(
- ClientData clientData, /* Not used. */
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
@@ -510,6 +515,7 @@ Tcl_SeekObjCmd(
"start", "current", "end", NULL
};
static const int modeArray[] = {SEEK_SET, SEEK_CUR, SEEK_END};
+ (void)dummy;
if ((objc != 3) && (objc != 4)) {
Tcl_WrongNumArgs(interp, 1, objv, "channelId offset ?origin?");
@@ -572,7 +578,7 @@ Tcl_SeekObjCmd(
/* ARGSUSED */
int
Tcl_TellObjCmd(
- ClientData clientData, /* Not used. */
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
@@ -580,6 +586,7 @@ Tcl_TellObjCmd(
Tcl_Channel chan; /* The channel to tell on. */
Tcl_WideInt newLoc;
int code;
+ (void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "channelId");
@@ -635,7 +642,7 @@ Tcl_TellObjCmd(
/* ARGSUSED */
int
Tcl_CloseObjCmd(
- ClientData clientData, /* Not used. */
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
@@ -645,6 +652,7 @@ Tcl_CloseObjCmd(
"read", "write", NULL
};
static const int dirArray[] = {TCL_CLOSE_READ, TCL_CLOSE_WRITE};
+ (void)dummy;
if ((objc != 2) && (objc != 3)) {
Tcl_WrongNumArgs(interp, 1, objv, "channelId ?direction?");
@@ -744,7 +752,7 @@ Tcl_CloseObjCmd(
/* ARGSUSED */
int
Tcl_FconfigureObjCmd(
- ClientData clientData, /* Not used. */
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
@@ -752,6 +760,7 @@ Tcl_FconfigureObjCmd(
const char *optionName, *valueName;
Tcl_Channel chan; /* The channel to set a mode on. */
int i; /* Iterate over arg-value pairs. */
+ (void)dummy;
if ((objc < 2) || (((objc % 2) == 1) && (objc != 3))) {
Tcl_WrongNumArgs(interp, 1, objv, "channelId ?-option value ...?");
@@ -820,12 +829,13 @@ Tcl_FconfigureObjCmd(
/* ARGSUSED */
int
Tcl_EofObjCmd(
- ClientData unused, /* Not used. */
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
Tcl_Channel chan;
+ (void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "channelId");
@@ -878,6 +888,7 @@ Tcl_ExecObjCmd(
enum options {
EXEC_IGNORESTDERR, EXEC_KEEPNEWLINE, EXEC_LAST
};
+ (void)dummy;
/*
* Check for any leading option arguments.
@@ -925,7 +936,7 @@ Tcl_ExecObjCmd(
*/
argc = objc - skip;
- argv = TclStackAlloc(interp, (argc + 1) * sizeof(char *));
+ argv = (const char **)TclStackAlloc(interp, (argc + 1) * sizeof(char *));
/*
* Copy the string conversions of each (post option) object into the
@@ -1028,13 +1039,14 @@ Tcl_ExecObjCmd(
/* ARGSUSED */
int
Tcl_FblockedObjCmd(
- ClientData unused, /* Not used. */
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
Tcl_Channel chan;
int mode;
+ (void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "channelId");
@@ -1075,7 +1087,7 @@ Tcl_FblockedObjCmd(
/* ARGSUSED */
int
Tcl_OpenObjCmd(
- ClientData notUsed, /* Not used. */
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
@@ -1083,6 +1095,7 @@ Tcl_OpenObjCmd(
int pipeline, prot;
const char *modeString, *what;
Tcl_Channel chan;
+ (void)dummy;
if ((objc < 2) || (objc > 4)) {
Tcl_WrongNumArgs(interp, 1, objv, "fileName ?access? ?permissions?");
@@ -1201,15 +1214,16 @@ static void
TcpAcceptCallbacksDeleteProc(
ClientData clientData, /* Data which was passed when the assocdata
* was registered. */
- Tcl_Interp *interp) /* Interpreter being deleted - not used. */
+ Tcl_Interp *dummy) /* Interpreter being deleted - not used. */
{
- Tcl_HashTable *hTblPtr = clientData;
+ Tcl_HashTable *hTblPtr = (Tcl_HashTable *)clientData;
Tcl_HashEntry *hPtr;
Tcl_HashSearch hSearch;
+ (void)dummy;
for (hPtr = Tcl_FirstHashEntry(hTblPtr, &hSearch);
hPtr != NULL; hPtr = Tcl_NextHashEntry(&hSearch)) {
- AcceptCallback *acceptCallbackPtr = Tcl_GetHashValue(hPtr);
+ AcceptCallback *acceptCallbackPtr = (AcceptCallback *)Tcl_GetHashValue(hPtr);
acceptCallbackPtr->interp = NULL;
}
@@ -1251,10 +1265,10 @@ RegisterTcpServerInterpCleanup(
Tcl_HashEntry *hPtr; /* Entry for this record. */
int isNew; /* Is the entry new? */
- hTblPtr = Tcl_GetAssocData(interp, "tclTCPAcceptCallbacks", NULL);
+ hTblPtr = (Tcl_HashTable *)Tcl_GetAssocData(interp, "tclTCPAcceptCallbacks", NULL);
if (hTblPtr == NULL) {
- hTblPtr = Tcl_Alloc(sizeof(Tcl_HashTable));
+ hTblPtr = (Tcl_HashTable *)Tcl_Alloc(sizeof(Tcl_HashTable));
Tcl_InitHashTable(hTblPtr, TCL_ONE_WORD_KEYS);
Tcl_SetAssocData(interp, "tclTCPAcceptCallbacks",
TcpAcceptCallbacksDeleteProc, hTblPtr);
@@ -1297,7 +1311,7 @@ UnregisterTcpServerInterpCleanupProc(
Tcl_HashTable *hTblPtr;
Tcl_HashEntry *hPtr;
- hTblPtr = Tcl_GetAssocData(interp, "tclTCPAcceptCallbacks", NULL);
+ hTblPtr = (Tcl_HashTable *)Tcl_GetAssocData(interp, "tclTCPAcceptCallbacks", NULL);
if (hTblPtr == NULL) {
return;
}
@@ -1335,7 +1349,7 @@ AcceptCallbackProc(
char *address, /* Address of client that was accepted. */
int port) /* Port of client that was accepted. */
{
- AcceptCallback *acceptCallbackPtr = callbackData;
+ AcceptCallback *acceptCallbackPtr = (AcceptCallback *)callbackData;
/*
* Check if the callback is still valid; the interpreter may have gone
@@ -1421,7 +1435,7 @@ TcpServerCloseProc(
ClientData callbackData) /* The data passed in the call to
* Tcl_CreateCloseHandler. */
{
- AcceptCallback *acceptCallbackPtr = callbackData;
+ AcceptCallback *acceptCallbackPtr = (AcceptCallback *)callbackData;
/* The actual data. */
if (acceptCallbackPtr->interp != NULL) {
@@ -1451,7 +1465,7 @@ TcpServerCloseProc(
int
Tcl_SocketObjCmd(
- ClientData notUsed, /* Not used. */
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
@@ -1470,6 +1484,7 @@ Tcl_SocketObjCmd(
const char *host, *port, *myaddr = NULL;
Tcl_Obj *script = NULL;
Tcl_Channel chan;
+ (void)dummy;
if (TclpHasSockets(interp) != TCL_OK) {
return TCL_ERROR;
@@ -1625,7 +1640,7 @@ Tcl_SocketObjCmd(
port = TclGetString(objv[a]);
if (server) {
- AcceptCallback *acceptCallbackPtr = Tcl_Alloc(sizeof(AcceptCallback));
+ AcceptCallback *acceptCallbackPtr = (AcceptCallback *)Tcl_Alloc(sizeof(AcceptCallback));
Tcl_IncrRefCount(script);
acceptCallbackPtr->script = script;
@@ -1704,6 +1719,7 @@ Tcl_FcopyObjCmd(
Tcl_Obj *cmdPtr;
static const char *const switches[] = { "-size", "-command", NULL };
enum { FcopySize, FcopyCommand };
+ (void)dummy;
if ((objc < 3) || (objc > 7) || (objc == 4) || (objc == 6)) {
Tcl_WrongNumArgs(interp, 1, objv,
@@ -1789,7 +1805,7 @@ Tcl_FcopyObjCmd(
/* ARGSUSED */
static int
ChanPendingObjCmd(
- ClientData unused, /* Not used. */
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
@@ -1798,6 +1814,7 @@ ChanPendingObjCmd(
int index, mode;
static const char *const options[] = {"input", "output", NULL};
enum options {PENDING_INPUT, PENDING_OUTPUT};
+ (void)dummy;
if (objc != 3) {
Tcl_WrongNumArgs(interp, 1, objv, "mode channelId");
@@ -1858,6 +1875,7 @@ ChanTruncateObjCmd(
{
Tcl_Channel chan;
Tcl_WideInt length;
+ (void)dummy;
if ((objc < 2) || (objc > 3)) {
Tcl_WrongNumArgs(interp, 1, objv, "channelId ?length?");
@@ -1932,6 +1950,7 @@ ChanPipeObjCmd(
Tcl_Channel rchan, wchan;
const char *channelNames[2];
Tcl_Obj *resultPtr;
+ (void)dummy;
if (objc != 1) {
Tcl_WrongNumArgs(interp, 1, objv, "");
@@ -1975,11 +1994,12 @@ ChanPipeObjCmd(
int
TclChannelNamesCmd(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
{
+ (void)dummy;
if (objc < 1 || objc > 2) {
Tcl_WrongNumArgs(interp, 1, objv, "?pattern?");
return TCL_ERROR;