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 | a9b80c492179a73f008fd8cc5aa7e8a7b9e87bf9 (patch) | |
tree | 08a6b50f74f697e9ebc1f689f06d7318c0aa83a2 /win/tkWinKey.c | |
parent | d27c3b360cd9cb780be362ed6ce435776ca42fc1 (diff) | |
download | tk-a9b80c492179a73f008fd8cc5aa7e8a7b9e87bf9.zip tk-a9b80c492179a73f008fd8cc5aa7e8a7b9e87bf9.tar.gz tk-a9b80c492179a73f008fd8cc5aa7e8a7b9e87bf9.tar.bz2 |
Remove casts from uses of ckalloc/ckfree/... now that Tcl declares them to be
using useful casts internally.
Diffstat (limited to 'win/tkWinKey.c')
-rw-r--r-- | win/tkWinKey.c | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/win/tkWinKey.c b/win/tkWinKey.c index b537114..f8fce5e 100644 --- a/win/tkWinKey.c +++ b/win/tkWinKey.c @@ -504,12 +504,11 @@ TkpInitKeymapInfo( */ if (dispPtr->modKeyCodes != NULL) { - ckfree((char *) dispPtr->modKeyCodes); + ckfree(dispPtr->modKeyCodes); } dispPtr->numModKeyCodes = 0; arraySize = KEYCODE_ARRAY_SIZE; - dispPtr->modKeyCodes = (KeyCode *) ckalloc((unsigned) - (KEYCODE_ARRAY_SIZE * sizeof(KeyCode))); + dispPtr->modKeyCodes = ckalloc(KEYCODE_ARRAY_SIZE * sizeof(KeyCode)); for (i = 0, codePtr = modMapPtr->modifiermap; i < max; i++, codePtr++) { if (*codePtr == 0) { continue; @@ -532,11 +531,10 @@ TkpInitKeymapInfo( */ arraySize *= 2; - new = (KeyCode *) ckalloc((unsigned) - (arraySize * sizeof(KeyCode))); - memcpy((void *) new, (void *) dispPtr->modKeyCodes, - (dispPtr->numModKeyCodes * sizeof(KeyCode))); - ckfree((char *) dispPtr->modKeyCodes); + new = ckalloc(arraySize * sizeof(KeyCode)); + memcpy(new, dispPtr->modKeyCodes, + dispPtr->numModKeyCodes * sizeof(KeyCode)); + ckfree(dispPtr->modKeyCodes); dispPtr->modKeyCodes = new; } dispPtr->modKeyCodes[dispPtr->numModKeyCodes] = *codePtr; @@ -662,11 +660,10 @@ XModifierKeymap * XGetModifierMapping( Display *display) { - XModifierKeymap *map = (XModifierKeymap *) - ckalloc(sizeof(XModifierKeymap)); + XModifierKeymap *map = ckalloc(sizeof(XModifierKeymap)); map->max_keypermod = 1; - map->modifiermap = (KeyCode *) ckalloc(sizeof(KeyCode)*8); + map->modifiermap = ckalloc(sizeof(KeyCode) * 8); map->modifiermap[ShiftMapIndex] = VK_SHIFT; map->modifiermap[LockMapIndex] = VK_CAPITAL; map->modifiermap[ControlMapIndex] = VK_CONTROL; @@ -698,8 +695,8 @@ void XFreeModifiermap( XModifierKeymap *modmap) { - ckfree((char *) modmap->modifiermap); - ckfree((char *) modmap); + ckfree(modmap->modifiermap); + ckfree(modmap); } /* |