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/tkGrid.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/tkGrid.c')
-rw-r--r-- | generic/tkGrid.c | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/generic/tkGrid.c b/generic/tkGrid.c index b5a439a..5014dad 100644 --- a/generic/tkGrid.c +++ b/generic/tkGrid.c @@ -1926,8 +1926,7 @@ ResolveConstraints( gridCount = MAX(constraintCount, slotCount); if (gridCount >= TYPICAL_SIZE) { - layoutPtr = (GridLayout *) - ckalloc(sizeof(GridLayout) * (1+gridCount)); + layoutPtr = ckalloc(sizeof(GridLayout) * (1+gridCount)); } else { layoutPtr = layoutData; } @@ -2049,12 +2048,12 @@ ResolveConstraints( * sizeof(UniformGroup); size_t newSize = (uniformGroupsAlloced + UNIFORM_PREALLOC) * sizeof(UniformGroup); - UniformGroup *newUG = (UniformGroup *) ckalloc(newSize); + UniformGroup *newUG = ckalloc(newSize); UniformGroup *oldUG = uniformGroupPtr; memcpy(newUG, oldUG, oldSize); if (oldUG != uniformPre) { - ckfree((char *) oldUG); + ckfree(oldUG); } uniformGroupPtr = newUG; uniformGroupsAlloced += UNIFORM_PREALLOC; @@ -2094,7 +2093,7 @@ ResolveConstraints( } if (uniformGroupPtr != uniformPre) { - ckfree((char *) uniformGroupPtr); + ckfree(uniformGroupPtr); } /* @@ -2364,7 +2363,7 @@ ResolveConstraints( --layoutPtr; if (layoutPtr != layoutData) { - ckfree((char *) layoutPtr); + ckfree(layoutPtr); } return requiredSize; } @@ -2412,7 +2411,7 @@ GetGrid( if (!isNew) { return Tcl_GetHashValue(hPtr); } - gridPtr = (Gridder *) ckalloc(sizeof(Gridder)); + gridPtr = ckalloc(sizeof(Gridder)); gridPtr->tkwin = tkwin; gridPtr->masterPtr = NULL; gridPtr->masterDataPtr = NULL; @@ -2619,14 +2618,14 @@ CheckSlotData( int newNumSlot = slot + PREALLOC; size_t oldSize = numSlot * sizeof(SlotInfo); size_t newSize = newNumSlot * sizeof(SlotInfo); - SlotInfo *newSI = (SlotInfo *) ckalloc(newSize); + SlotInfo *newSI = ckalloc(newSize); SlotInfo *oldSI = (slotType == ROW) ? masterPtr->masterDataPtr->rowPtr : masterPtr->masterDataPtr->columnPtr; memcpy(newSI, oldSI, oldSize); memset(newSI+numSlot, 0, newSize - oldSize); - ckfree((char *) oldSI); + ckfree(oldSI); if (slotType == ROW) { masterPtr->masterDataPtr->rowPtr = newSI; masterPtr->masterDataPtr->rowSpace = newNumSlot; @@ -2669,17 +2668,17 @@ InitMasterData( Gridder *masterPtr) { if (masterPtr->masterDataPtr == NULL) { - GridMaster *gridPtr = masterPtr->masterDataPtr = (GridMaster *) + GridMaster *gridPtr = masterPtr->masterDataPtr = ckalloc(sizeof(GridMaster)); size_t size = sizeof(SlotInfo) * TYPICAL_SIZE; gridPtr->columnEnd = 0; gridPtr->columnMax = 0; - gridPtr->columnPtr = (SlotInfo *) ckalloc(size); + gridPtr->columnPtr = ckalloc(size); gridPtr->columnSpace = TYPICAL_SIZE; gridPtr->rowEnd = 0; gridPtr->rowMax = 0; - gridPtr->rowPtr = (SlotInfo *) ckalloc(size); + gridPtr->rowPtr = ckalloc(size); gridPtr->rowSpace = TYPICAL_SIZE; gridPtr->startX = 0; gridPtr->startY = 0; @@ -2781,14 +2780,14 @@ DestroyGrid( if (gridPtr->masterDataPtr != NULL) { if (gridPtr->masterDataPtr->rowPtr != NULL) { - ckfree((char *) gridPtr->masterDataPtr -> rowPtr); + ckfree(gridPtr->masterDataPtr -> rowPtr); } if (gridPtr->masterDataPtr->columnPtr != NULL) { - ckfree((char *) gridPtr->masterDataPtr -> columnPtr); + ckfree(gridPtr->masterDataPtr -> columnPtr); } - ckfree((char *) gridPtr->masterDataPtr); + ckfree(gridPtr->masterDataPtr); } - ckfree((char *) gridPtr); + ckfree(gridPtr); } /* |