diff options
Diffstat (limited to 'unix/tkUnixSend.c')
-rw-r--r-- | unix/tkUnixSend.c | 57 |
1 files changed, 27 insertions, 30 deletions
diff --git a/unix/tkUnixSend.c b/unix/tkUnixSend.c index 1ee4bba..03d124f 100644 --- a/unix/tkUnixSend.c +++ b/unix/tkUnixSend.c @@ -269,7 +269,7 @@ RegOpen( handler = Tk_CreateErrorHandler(dispPtr->display, -1, -1, -1, NULL, NULL); - regPtr = ckalloc(sizeof(NameRegistry)); + regPtr = (NameRegistry *)ckalloc(sizeof(NameRegistry)); regPtr->dispPtr = dispPtr; regPtr->locked = 0; regPtr->modified = 0; @@ -479,7 +479,7 @@ RegAddName( sprintf(id, "%x ", (unsigned) commWindow); idLength = strlen(id); newBytes = idLength + strlen(name) + 1; - newProp = ckalloc(regPtr->propLength + newBytes); + newProp = (char *)ckalloc(regPtr->propLength + newBytes); strcpy(newProp, id); strcpy(newProp+idLength, name); if (regPtr->property != NULL) { @@ -808,7 +808,7 @@ Tk_SetAppName( const char *actualName; Tcl_DString dString; int offset, i; - ThreadSpecificData *tsdPtr = + ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); interp = winPtr->mainPtr->interp; @@ -830,7 +830,7 @@ Tk_SetAppName( * the "send" command to the interpreter. */ - riPtr = ckalloc(sizeof(RegisteredInterp)); + riPtr = (RegisteredInterp *)ckalloc(sizeof(RegisteredInterp)); riPtr->interp = interp; riPtr->dispPtr = winPtr->dispPtr; riPtr->nextPtr = tsdPtr->interpListPtr; @@ -914,7 +914,7 @@ Tk_SetAppName( RegAddName(regPtr, actualName, Tk_WindowId(dispPtr->commTkwin)); RegClose(regPtr); - riPtr->name = ckalloc(strlen(actualName) + 1); + riPtr->name = (char *)ckalloc(strlen(actualName) + 1); strcpy(riPtr->name, actualName); if (actualName != name) { Tcl_DStringFree(&dString); @@ -943,7 +943,7 @@ Tk_SetAppName( int Tk_SendObjCmd( - ClientData clientData, /* Information about sender (only dispPtr + TCL_UNUSED(void *), /* Information about sender (only dispPtr * field is used). */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ @@ -958,7 +958,7 @@ Tk_SendObjCmd( TkWindow *winPtr; Window commWindow; PendingCommand pending; - register RegisteredInterp *riPtr; + RegisteredInterp *riPtr; const char *destName; int result, index, async, i, firstArg; Tk_RestrictProc *prevProc; @@ -967,7 +967,7 @@ Tk_SendObjCmd( Tcl_Time timeout; NameRegistry *regPtr; Tcl_DString request; - ThreadSpecificData *tsdPtr = + ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); Tcl_Interp *localInterp; /* Used when the interpreter to send the * command to is within the same process. */ @@ -1175,7 +1175,7 @@ Tk_SendObjCmd( msg = "target application died"; } pending.code = TCL_ERROR; - pending.result = ckalloc(strlen(msg) + 1); + pending.result = (char *)ckalloc(strlen(msg) + 1); strcpy(pending.result, msg); pending.gotResponse = 1; } else { @@ -1356,7 +1356,7 @@ TkSendCleanup( static int SendInit( - Tcl_Interp *interp, /* Interpreter to use for error reporting (no + TCL_UNUSED(Tcl_Interp *), /* Interpreter to use for error reporting (no * errors are ever returned, but the * interpreter is needed anyway). */ TkDisplay *dispPtr) /* Display to initialize. */ @@ -1419,14 +1419,14 @@ SendEventProc( ClientData clientData, /* Display information. */ XEvent *eventPtr) /* Information about event. */ { - TkDisplay *dispPtr = clientData; + TkDisplay *dispPtr = (TkDisplay *)clientData; char *propInfo, **propInfoPtr = &propInfo; const char *p; int result, actualFormat; unsigned long numItems, bytesAfter; Atom actualType; Tcl_Interp *remoteInterp; /* Interp in which to execute the command. */ - ThreadSpecificData *tsdPtr = + ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); if ((eventPtr->xproperty.atom != dispPtr->commProperty) @@ -1698,16 +1698,16 @@ SendEventProc( } pcPtr->code = code; if (resultString != NULL) { - pcPtr->result = ckalloc(strlen(resultString) + 1); + pcPtr->result = (char *)ckalloc(strlen(resultString) + 1); strcpy(pcPtr->result, resultString); } if (code == TCL_ERROR) { if (errorInfo != NULL) { - pcPtr->errorInfo = ckalloc(strlen(errorInfo) + 1); + pcPtr->errorInfo = (char *)ckalloc(strlen(errorInfo) + 1); strcpy(pcPtr->errorInfo, errorInfo); } if (errorCode != NULL) { - pcPtr->errorCode = ckalloc(strlen(errorCode) + 1); + pcPtr->errorCode = (char *)ckalloc(strlen(errorCode) + 1); strcpy(pcPtr->errorCode, errorCode); } } @@ -1774,15 +1774,14 @@ AppendPropCarefully( * operation above. */ - /* ARGSUSED */ static int AppendErrorProc( ClientData clientData, /* Command to mark complete, or NULL. */ - XErrorEvent *errorPtr) /* Information about error. */ + TCL_UNUSED(XErrorEvent *)) /* Information about error. */ { - PendingCommand *pendingPtr = clientData; - register PendingCommand *pcPtr; - ThreadSpecificData *tsdPtr = + PendingCommand *pendingPtr = (PendingCommand *)clientData; + PendingCommand *pcPtr; + ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); if (pendingPtr == NULL) { @@ -1796,7 +1795,7 @@ AppendErrorProc( for (pcPtr = tsdPtr->pendingCommands; pcPtr != NULL; pcPtr = pcPtr->nextPtr) { if ((pcPtr == pendingPtr) && (pcPtr->result == NULL)) { - pcPtr->result = ckalloc(strlen(pcPtr->target) + 50); + pcPtr->result = (char *)ckalloc(strlen(pcPtr->target) + 50); sprintf(pcPtr->result, "no application named \"%s\"", pcPtr->target); pcPtr->code = TCL_ERROR; @@ -1829,10 +1828,10 @@ DeleteProc( ClientData clientData) /* Info about registration, passed as * ClientData. */ { - RegisteredInterp *riPtr = clientData; - register RegisteredInterp *riPtr2; + RegisteredInterp *riPtr = (RegisteredInterp *)clientData; + RegisteredInterp *riPtr2; NameRegistry *regPtr; - ThreadSpecificData *tsdPtr = + ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); regPtr = RegOpen(riPtr->interp, riPtr->dispPtr, 1); @@ -1874,11 +1873,10 @@ DeleteProc( *---------------------------------------------------------------------- */ - /* ARGSUSED */ static Tk_RestrictAction SendRestrictProc( - ClientData clientData, /* Not used. */ - register XEvent *eventPtr) /* Event that just arrived. */ + TCL_UNUSED(void *), /* Not used. */ + XEvent *eventPtr) /* Event that just arrived. */ { TkDisplay *dispPtr; @@ -1921,7 +1919,7 @@ UpdateCommWindow( { Tcl_DString names; RegisteredInterp *riPtr; - ThreadSpecificData *tsdPtr = + ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); Tcl_DStringInit(&names); @@ -1954,7 +1952,6 @@ UpdateCommWindow( *---------------------------------------------------------------------- */ - /* ARGSUSED */ int TkpTestsendCmd( ClientData clientData, /* Main window for application. */ @@ -1968,7 +1965,7 @@ TkpTestsendCmd( static const char *const testsendOptions[] = { "bogus", "prop", "serial", NULL }; - TkWindow *winPtr = clientData; + TkWindow *winPtr = (TkWindow *)clientData; Tk_ErrorHandler handler; int index; |