summaryrefslogtreecommitdiffstats
path: root/unix/tkUnixSend.c
diff options
context:
space:
mode:
authordkf <dkf@noemail.net>2011-03-12 17:45:37 (GMT)
committerdkf <dkf@noemail.net>2011-03-12 17:45:37 (GMT)
commitfcac358b90566b1486dcd5006660f6554407a5aa (patch)
tree08a6b50f74f697e9ebc1f689f06d7318c0aa83a2 /unix/tkUnixSend.c
parentb3288baebce521001f60b872579018a4702115e4 (diff)
downloadtk-fcac358b90566b1486dcd5006660f6554407a5aa.zip
tk-fcac358b90566b1486dcd5006660f6554407a5aa.tar.gz
tk-fcac358b90566b1486dcd5006660f6554407a5aa.tar.bz2
Remove casts from uses of ckalloc/ckfree/... now that Tcl declares them to be
using useful casts internally. FossilOrigin-Name: 142e016e7b17277d81257da90477297eb9aaa05a
Diffstat (limited to 'unix/tkUnixSend.c')
-rw-r--r--unix/tkUnixSend.c28
1 files changed, 12 insertions, 16 deletions
diff --git a/unix/tkUnixSend.c b/unix/tkUnixSend.c
index 515be11..36069e0 100644
--- a/unix/tkUnixSend.c
+++ b/unix/tkUnixSend.c
@@ -268,7 +268,7 @@ RegOpen(
SendInit(interp, dispPtr);
}
- regPtr = (NameRegistry *) ckalloc(sizeof(NameRegistry));
+ regPtr = ckalloc(sizeof(NameRegistry));
regPtr->dispPtr = dispPtr;
regPtr->locked = 0;
regPtr->modified = 0;
@@ -475,7 +475,7 @@ RegAddName(
sprintf(id, "%x ", (unsigned) commWindow);
idLength = strlen(id);
newBytes = idLength + strlen(name) + 1;
- newProp = ckalloc((unsigned) (regPtr->propLength + newBytes));
+ newProp = ckalloc(regPtr->propLength + newBytes);
strcpy(newProp, id);
strcpy(newProp+idLength, name);
if (regPtr->property != NULL) {
@@ -549,7 +549,7 @@ RegClose(
ckfree(regPtr->property);
}
}
- ckfree((char *) regPtr);
+ ckfree(regPtr);
}
/*
@@ -635,7 +635,7 @@ ValidateName(
break;
}
}
- ckfree((char *) argv);
+ ckfree(argv);
}
} else {
result = 0;
@@ -819,7 +819,7 @@ Tk_SetAppName(
* the "send" command to the interpreter.
*/
- riPtr = (RegisteredInterp *) ckalloc(sizeof(RegisteredInterp));
+ riPtr = ckalloc(sizeof(RegisteredInterp));
riPtr->interp = interp;
riPtr->dispPtr = winPtr->dispPtr;
riPtr->nextPtr = tsdPtr->interpListPtr;
@@ -903,7 +903,7 @@ Tk_SetAppName(
RegAddName(regPtr, actualName, Tk_WindowId(dispPtr->commTkwin));
RegClose(regPtr);
- riPtr->name = (char *) ckalloc((unsigned) (strlen(actualName) + 1));
+ riPtr->name = ckalloc(strlen(actualName) + 1);
strcpy(riPtr->name, actualName);
if (actualName != name) {
Tcl_DStringFree(&dString);
@@ -1159,7 +1159,7 @@ Tk_SendCmd(
msg = "target application died";
}
pending.code = TCL_ERROR;
- pending.result = (char *) ckalloc((unsigned) (strlen(msg) + 1));
+ pending.result = ckalloc(strlen(msg) + 1);
strcpy(pending.result, msg);
pending.gotResponse = 1;
} else {
@@ -1681,19 +1681,16 @@ SendEventProc(
}
pcPtr->code = code;
if (resultString != NULL) {
- pcPtr->result =
- ckalloc((unsigned) (strlen(resultString) + 1));
+ pcPtr->result = ckalloc(strlen(resultString) + 1);
strcpy(pcPtr->result, resultString);
}
if (code == TCL_ERROR) {
if (errorInfo != NULL) {
- pcPtr->errorInfo =
- ckalloc((unsigned) (strlen(errorInfo) + 1));
+ pcPtr->errorInfo = ckalloc(strlen(errorInfo) + 1);
strcpy(pcPtr->errorInfo, errorInfo);
}
if (errorCode != NULL) {
- pcPtr->errorCode =
- ckalloc((unsigned) (strlen(errorCode) + 1));
+ pcPtr->errorCode = ckalloc(strlen(errorCode) + 1);
strcpy(pcPtr->errorCode, errorCode);
}
}
@@ -1782,8 +1779,7 @@ AppendErrorProc(
for (pcPtr = tsdPtr->pendingCommands; pcPtr != NULL;
pcPtr = pcPtr->nextPtr) {
if ((pcPtr == pendingPtr) && (pcPtr->result == NULL)) {
- pcPtr->result = (char *) ckalloc((unsigned)
- (strlen(pcPtr->target) + 50));
+ pcPtr->result = ckalloc(strlen(pcPtr->target) + 50);
sprintf(pcPtr->result, "no application named \"%s\"",
pcPtr->target);
pcPtr->code = TCL_ERROR;
@@ -1837,7 +1833,7 @@ DeleteProc(
}
}
}
- ckfree((char *) riPtr->name);
+ ckfree(riPtr->name);
riPtr->interp = NULL;
UpdateCommWindow(riPtr->dispPtr);
Tcl_EventuallyFree(riPtr, TCL_DYNAMIC);