From 71807b8a629a1628286b5dd2858f0e3df2ada2fa Mon Sep 17 00:00:00 2001 From: dkf Date: Tue, 17 Apr 2007 14:36:49 +0000 Subject: Eliminate use of (VOID*) casts when calling memset or memcpy. --- generic/tkCanvas.c | 5 ++--- generic/tkEntry.c | 6 +++--- generic/tkOption.c | 12 ++++++------ generic/tkSelect.c | 4 ++-- 4 files changed, 13 insertions(+), 14 deletions(-) diff --git a/generic/tkCanvas.c b/generic/tkCanvas.c index ac1b4f0..d420a8b 100644 --- a/generic/tkCanvas.c +++ b/generic/tkCanvas.c @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkCanvas.c,v 1.40 2005/11/27 02:36:13 das Exp $ + * RCS: @(#) $Id: tkCanvas.c,v 1.41 2007/04/17 14:36:49 dkf Exp $ */ /* #define USE_OLD_TAG_SEARCH 1 */ @@ -3837,8 +3837,7 @@ DoItem( itemPtr->tagSpace += 5; newTagPtr = (Tk_Uid *) ckalloc((unsigned) (itemPtr->tagSpace * sizeof(Tk_Uid))); - memcpy((VOID *) newTagPtr, (VOID *) itemPtr->tagPtr, - (itemPtr->numTags * sizeof(Tk_Uid))); + memcpy(newTagPtr, itemPtr->tagPtr, itemPtr->numTags * sizeof(Tk_Uid)); if (itemPtr->tagPtr != itemPtr->staticTagSpace) { ckfree((char *) itemPtr->tagPtr); } diff --git a/generic/tkEntry.c b/generic/tkEntry.c index 2f19050..0ef4bc8 100644 --- a/generic/tkEntry.c +++ b/generic/tkEntry.c @@ -14,7 +14,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkEntry.c,v 1.42 2007/01/03 05:06:26 nijtmans Exp $ + * RCS: @(#) $Id: tkEntry.c,v 1.43 2007/04/17 14:36:49 dkf Exp $ */ #include "tkInt.h" @@ -509,7 +509,7 @@ Tk_EntryObjCmd( */ entryPtr = (Entry *) ckalloc(sizeof(Entry)); - memset((VOID *) entryPtr, 0, sizeof(Entry)); + memset(entryPtr, 0, sizeof(Entry)); entryPtr->tkwin = tkwin; entryPtr->display = Tk_Display(tkwin); @@ -3523,7 +3523,7 @@ Tk_SpinboxObjCmd( sbPtr = (Spinbox *) ckalloc(sizeof(Spinbox)); entryPtr = (Entry *) sbPtr; - memset((VOID *) sbPtr, 0, sizeof(Spinbox)); + memset(sbPtr, 0, sizeof(Spinbox)); entryPtr->tkwin = tkwin; entryPtr->display = Tk_Display(tkwin); diff --git a/generic/tkOption.c b/generic/tkOption.c index 1a7cb04..b26e57e 100644 --- a/generic/tkOption.c +++ b/generic/tkOption.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkOption.c,v 1.18 2006/03/30 01:39:07 hobbs Exp $ + * RCS: @(#) $Id: tkOption.c,v 1.19 2007/04/17 14:36:49 dkf Exp $ */ #include "tkPort.h" @@ -1195,8 +1195,8 @@ ExtendArray( newPtr->arraySize = 2*arrayPtr->arraySize; newPtr->numUsed = arrayPtr->numUsed; newPtr->nextToUse = &newPtr->els[newPtr->numUsed]; - memcpy((VOID *) newPtr->els, (VOID *) arrayPtr->els, - (arrayPtr->arraySize*sizeof(Element))); + memcpy(newPtr->els, arrayPtr->els, + arrayPtr->arraySize * sizeof(Element)); ckfree((char *) arrayPtr); arrayPtr = newPtr; } @@ -1316,9 +1316,9 @@ SetupStacks( StackLevel *newLevels; newLevels = (StackLevel *) ckalloc((unsigned) - (tsdPtr->numLevels*2*sizeof(StackLevel))); - memcpy((VOID *) newLevels, (VOID *) tsdPtr->levels, - (tsdPtr->numLevels*sizeof(StackLevel))); + (tsdPtr->numLevels * 2 * sizeof(StackLevel))); + memcpy(newLevels, tsdPtr->levels, + tsdPtr->numLevels * sizeof(StackLevel)); ckfree((char *) tsdPtr->levels); tsdPtr->numLevels *= 2; tsdPtr->levels = newLevels; diff --git a/generic/tkSelect.c b/generic/tkSelect.c index c35a47c..dca3d1c 100644 --- a/generic/tkSelect.c +++ b/generic/tkSelect.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkSelect.c,v 1.19 2005/11/22 11:16:25 dkf Exp $ + * RCS: @(#) $Id: tkSelect.c,v 1.20 2007/04/17 14:36:49 dkf Exp $ */ #include "tkInt.h" @@ -1387,7 +1387,7 @@ HandleTclCommand( objPtr = Tcl_GetObjResult(interp); string = Tcl_GetStringFromObj(objPtr, &length); count = (length > maxBytes) ? maxBytes : length; - memcpy((VOID *) buffer, (VOID *) string, (size_t) count); + memcpy(buffer, string, (size_t) count); buffer[count] = '\0'; /* -- cgit v0.12