diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2011-03-12 17:45:37 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2011-03-12 17:45:37 (GMT) |
commit | e0b895874d5fa39f6d4134b407e930b80ee3ecd7 (patch) | |
tree | 08a6b50f74f697e9ebc1f689f06d7318c0aa83a2 /generic/tkPanedWindow.c | |
parent | 77d7867fd5b20233f0fa9163bd8a44d2ac274b0e (diff) | |
download | tk-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/tkPanedWindow.c')
-rw-r--r-- | generic/tkPanedWindow.c | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/generic/tkPanedWindow.c b/generic/tkPanedWindow.c index 3df5024..7b05815 100644 --- a/generic/tkPanedWindow.c +++ b/generic/tkPanedWindow.c @@ -401,7 +401,7 @@ Tk_PanedWindowObjCmd( * easy access to it in the future. */ - pwOpts = (OptionTables *) ckalloc(sizeof(OptionTables)); + pwOpts = ckalloc(sizeof(OptionTables)); /* * Set up an exit handler to free the optionTables struct. @@ -424,7 +424,7 @@ Tk_PanedWindowObjCmd( * Allocate and initialize the widget record. */ - pwPtr = (PanedWindow *) ckalloc(sizeof(PanedWindow)); + pwPtr = ckalloc(sizeof(PanedWindow)); memset((void *)pwPtr, 0, (sizeof(PanedWindow))); pwPtr->tkwin = tkwin; pwPtr->display = Tk_Display(tkwin); @@ -878,7 +878,7 @@ ConfigureSlaves( * structures may already have existed, some may be new. */ - inserts = (Slave **)ckalloc(sizeof(Slave *) * (firstOptionArg - 2)); + inserts = ckalloc(sizeof(Slave *) * (firstOptionArg - 2)); insertIndex = 0; /* @@ -945,7 +945,7 @@ ConfigureSlaves( * out with their "natural" dimensions. */ - slavePtr = (Slave *) ckalloc(sizeof(Slave)); + slavePtr = ckalloc(sizeof(Slave)); memset(slavePtr, 0, sizeof(Slave)); Tk_InitOptions(interp, (char *)slavePtr, pwPtr->slaveOpts, pwPtr->tkwin); @@ -984,8 +984,8 @@ ConfigureSlaves( * Allocate the new slaves array, then copy the slaves into it, in order. */ - i = sizeof(Slave *) * (pwPtr->numSlaves+numNewSlaves); - newSlaves = (Slave **)ckalloc((unsigned) i); + i = sizeof(Slave *) * (pwPtr->numSlaves + numNewSlaves); + newSlaves = ckalloc(i); memset(newSlaves, 0, (size_t) i); if (index == -1) { /* @@ -1028,8 +1028,8 @@ ConfigureSlaves( * Make the new slaves array the paned window's slave array, and clean up. */ - ckfree((void *)pwPtr->slaves); - ckfree((void *)inserts); + ckfree(pwPtr->slaves); + ckfree(inserts); pwPtr->slaves = newSlaves; /* @@ -1539,11 +1539,11 @@ DestroyPanedWindow( Tk_ManageGeometry(pwPtr->slaves[i]->tkwin, NULL, NULL); Tk_FreeConfigOptions((char *) pwPtr->slaves[i], pwPtr->slaveOpts, pwPtr->tkwin); - ckfree((char *) pwPtr->slaves[i]); + ckfree(pwPtr->slaves[i]); pwPtr->slaves[i] = NULL; } if (pwPtr->slaves) { - ckfree((char *) pwPtr->slaves); + ckfree(pwPtr->slaves); } /* @@ -1644,7 +1644,7 @@ PanedWindowLostSlaveProc( SlaveStructureProc, slavePtr); Tk_UnmapWindow(slavePtr->tkwin); slavePtr->tkwin = NULL; - ckfree((char *) slavePtr); + ckfree(slavePtr); ComputeGeometry(pwPtr); } @@ -2080,7 +2080,7 @@ SlaveStructureProc( if (eventPtr->type == DestroyNotify) { Unlink(slavePtr); slavePtr->tkwin = NULL; - ckfree((char *) slavePtr); + ckfree(slavePtr); ComputeGeometry(pwPtr); } } @@ -2286,8 +2286,7 @@ DestroyOptionTables( ClientData clientData, /* Pointer to the OptionTables struct */ Tcl_Interp *interp) /* Pointer to the calling interp */ { - ckfree((char *) clientData); - return; + ckfree(clientData); } /* |