summaryrefslogtreecommitdiffstats
path: root/generic/tkEntry.c
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2011-03-12 17:45:37 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2011-03-12 17:45:37 (GMT)
commite0b895874d5fa39f6d4134b407e930b80ee3ecd7 (patch)
tree08a6b50f74f697e9ebc1f689f06d7318c0aa83a2 /generic/tkEntry.c
parent77d7867fd5b20233f0fa9163bd8a44d2ac274b0e (diff)
downloadtk-e0b895874d5fa39f6d4134b407e930b80ee3ecd7.zip
tk-e0b895874d5fa39f6d4134b407e930b80ee3ecd7.tar.gz
tk-e0b895874d5fa39f6d4134b407e930b80ee3ecd7.tar.bz2
Remove casts from uses of ckalloc/ckfree/... now that Tcl declares them to be
using useful casts internally.
Diffstat (limited to 'generic/tkEntry.c')
-rw-r--r--generic/tkEntry.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/generic/tkEntry.c b/generic/tkEntry.c
index 93f14a2..1db3888 100644
--- a/generic/tkEntry.c
+++ b/generic/tkEntry.c
@@ -509,7 +509,7 @@ Tk_EntryObjCmd(
* initialized as memset covers the rest.
*/
- entryPtr = (Entry *) ckalloc(sizeof(Entry));
+ entryPtr = ckalloc(sizeof(Entry));
memset(entryPtr, 0, sizeof(Entry));
entryPtr->tkwin = tkwin;
@@ -1016,7 +1016,7 @@ DestroyEntry(
* Tk_FreeOptions handle all the standard option-related stuff.
*/
- ckfree((char *)entryPtr->string);
+ ckfree(entryPtr->string);
if (entryPtr->textVarName != NULL) {
Tcl_UntraceVar(entryPtr->interp, entryPtr->textVarName,
TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS,
@@ -1031,7 +1031,7 @@ DestroyEntry(
}
Tcl_DeleteTimerHandler(entryPtr->insertBlinkHandler);
if (entryPtr->displayString != entryPtr->string) {
- ckfree((char *)entryPtr->displayString);
+ ckfree(entryPtr->displayString);
}
if (entryPtr->type == TK_SPINBOX) {
Spinbox *sbPtr = (Spinbox *) entryPtr;
@@ -1050,7 +1050,7 @@ DestroyEntry(
Tcl_Release(entryPtr->tkwin);
entryPtr->tkwin = NULL;
- ckfree((char *) entryPtr);
+ ckfree(entryPtr);
}
/*
@@ -1874,7 +1874,7 @@ EntryComputeGeometry(
char *p;
if (entryPtr->displayString != entryPtr->string) {
- ckfree((char *)entryPtr->displayString);
+ ckfree(entryPtr->displayString);
entryPtr->displayString = entryPtr->string;
entryPtr->numDisplayBytes = entryPtr->numBytes;
}
@@ -1900,7 +1900,7 @@ EntryComputeGeometry(
size = Tcl_UniCharToUtf(ch, buf);
entryPtr->numDisplayBytes = entryPtr->numChars * size;
- p = (char *) ckalloc((unsigned) (entryPtr->numDisplayBytes + 1));
+ p = ckalloc(entryPtr->numDisplayBytes + 1);
entryPtr->displayString = p;
for (i = entryPtr->numChars; --i >= 0; ) {
@@ -2017,7 +2017,7 @@ InsertChars(
}
newByteCount = entryPtr->numBytes + byteCount + 1;
- newStr = ckalloc((unsigned) newByteCount);
+ newStr = ckalloc(newByteCount);
memcpy(newStr, string, byteIndex);
strcpy(newStr + byteIndex, value);
strcpy(newStr + byteIndex + byteCount, string + byteIndex);
@@ -2030,7 +2030,7 @@ InsertChars(
return;
}
- ckfree((char *)string);
+ ckfree(string);
entryPtr->string = newStr;
/*
@@ -2117,11 +2117,11 @@ DeleteChars(
byteCount = Tcl_UtfAtIndex(string + byteIndex, count) - (string+byteIndex);
newByteCount = entryPtr->numBytes + 1 - byteCount;
- newStr = ckalloc((unsigned) newByteCount);
+ newStr = ckalloc(newByteCount);
memcpy(newStr, string, (size_t) byteIndex);
strcpy(newStr + byteIndex, string + byteIndex + byteCount);
- toDelete = ckalloc((unsigned) (byteCount + 1));
+ toDelete = ckalloc(byteCount + 1);
memcpy(toDelete, string + byteIndex, (size_t) byteCount);
toDelete[byteCount] = '\0';
@@ -2135,7 +2135,7 @@ DeleteChars(
}
ckfree(toDelete);
- ckfree((char *)entryPtr->string);
+ ckfree(entryPtr->string);
entryPtr->string = newStr;
entryPtr->numChars -= count;
entryPtr->numBytes -= byteCount;
@@ -2293,7 +2293,7 @@ EntrySetValue(
* during validation
*/
- char *tmp = (char *) ckalloc((unsigned) (valueLen + 1));
+ char *tmp = ckalloc(valueLen + 1);
strcpy(tmp, value);
value = tmp;
@@ -2311,18 +2311,18 @@ EntrySetValue(
if (entryPtr->flags & VALIDATE_ABORT) {
entryPtr->flags &= ~VALIDATE_ABORT;
- ckfree((char *)value);
+ ckfree(value);
return;
}
}
oldSource = entryPtr->string;
- ckfree((char *)entryPtr->string);
+ ckfree(entryPtr->string);
if (malloced) {
entryPtr->string = value;
} else {
- char *tmp = ckalloc((unsigned) (valueLen + 1));
+ char *tmp = ckalloc(valueLen + 1);
strcpy(tmp, value);
entryPtr->string = tmp;
@@ -3526,7 +3526,7 @@ Tk_SpinboxObjCmd(
* initialized as memset covers the rest.
*/
- sbPtr = (Spinbox *) ckalloc(sizeof(Spinbox));
+ sbPtr = ckalloc(sizeof(Spinbox));
entryPtr = (Entry *) sbPtr;
memset(sbPtr, 0, sizeof(Spinbox));