diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2023-10-11 15:13:23 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2023-10-11 15:13:23 (GMT) |
commit | b70b51b1bea45124cf9ff403a61ca34930a6e55b (patch) | |
tree | c583f61b43ce0dcd137b7ae649038489e57b1d9a /generic | |
parent | 328e924abfea5c6b0c952b9443f18c3df8c68dc5 (diff) | |
parent | b53d86acf913b7508a1ac1b0d328fbacf4fa94ff (diff) | |
download | tk-b70b51b1bea45124cf9ff403a61ca34930a6e55b.zip tk-b70b51b1bea45124cf9ff403a61ca34930a6e55b.tar.gz tk-b70b51b1bea45124cf9ff403a61ca34930a6e55b.tar.bz2 |
Fix [d96974d99d]: Functions passed to Tcl_EventuallyFree() must be declared/defined as Tcl_FreeProc
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tkBusy.c | 12 | ||||
-rw-r--r-- | generic/tkCanvas.c | 6 | ||||
-rw-r--r-- | generic/tkEntry.c | 8 | ||||
-rw-r--r-- | generic/tkFrame.c | 10 | ||||
-rw-r--r-- | generic/tkGrid.c | 6 | ||||
-rw-r--r-- | generic/tkImage.c | 9 | ||||
-rw-r--r-- | generic/tkListbox.c | 8 | ||||
-rw-r--r-- | generic/tkMenu.c | 16 | ||||
-rw-r--r-- | generic/tkPack.c | 6 | ||||
-rw-r--r-- | generic/tkSquare.c | 4 |
10 files changed, 42 insertions, 43 deletions
diff --git a/generic/tkBusy.c b/generic/tkBusy.c index 5c5fb85..00ba73e 100644 --- a/generic/tkBusy.c +++ b/generic/tkBusy.c @@ -45,7 +45,7 @@ static void BusyCustodyProc(ClientData clientData, static int ConfigureBusy(Tcl_Interp *interp, Busy *busyPtr, int objc, Tcl_Obj *const objv[]); static Busy * CreateBusy(Tcl_Interp *interp, Tk_Window tkRef); -static void DestroyBusy(void *dataPtr); +static Tcl_FreeProc DestroyBusy; static void DoConfigureNotify(Tk_FakeWin *winPtr); static inline Tk_Window FirstChild(Tk_Window parent); static Busy * GetBusy(Tcl_Interp *interp, @@ -137,7 +137,7 @@ BusyCustodyProc( busyPtr); TkpHideBusyWindow(busyPtr); busyPtr->tkBusy = NULL; - Tcl_EventuallyFree(busyPtr, (Tcl_FreeProc *)DestroyBusy); + Tcl_EventuallyFree(busyPtr, DestroyBusy); } /* @@ -262,7 +262,7 @@ RefWinEventProc( * Arrange for the busy structure to be removed at a proper time. */ - Tcl_EventuallyFree(busyPtr, (Tcl_FreeProc *)DestroyBusy); + Tcl_EventuallyFree(busyPtr, DestroyBusy); break; case ConfigureNotify: @@ -333,7 +333,7 @@ RefWinEventProc( static void DestroyBusy( - void *data) /* Busy window structure record */ + char *data) /* Busy window structure record */ { Busy *busyPtr = (Busy *)data; @@ -383,7 +383,7 @@ BusyEventProc( if (eventPtr->type == DestroyNotify) { busyPtr->tkBusy = NULL; - Tcl_EventuallyFree(busyPtr, (Tcl_FreeProc *)DestroyBusy); + Tcl_EventuallyFree(busyPtr, DestroyBusy); } } @@ -901,7 +901,7 @@ Tk_BusyObjCmd( return TCL_ERROR; } TkpHideBusyWindow(busyPtr); - Tcl_EventuallyFree(busyPtr, (Tcl_FreeProc *)DestroyBusy); + Tcl_EventuallyFree(busyPtr, DestroyBusy); return TCL_OK; case BUSY_HOLD: diff --git a/generic/tkCanvas.c b/generic/tkCanvas.c index b80c197..aaac122 100644 --- a/generic/tkCanvas.c +++ b/generic/tkCanvas.c @@ -267,7 +267,7 @@ static void CanvasWorldChanged(ClientData instanceData); static int ConfigureCanvas(Tcl_Interp *interp, TkCanvas *canvasPtr, int objc, Tcl_Obj *const *objv, int flags); -static void DestroyCanvas(void *memPtr); +static Tcl_FreeProc DestroyCanvas; static void DisplayCanvas(ClientData clientData); static void DoItem(Tcl_Obj *accumObj, Tk_Item *itemPtr, Tk_Uid tag); @@ -2168,7 +2168,7 @@ CanvasWidgetCmd( static void DestroyCanvas( - void *memPtr) /* Info about canvas widget. */ + char *memPtr) /* Info about canvas widget. */ { TkCanvas *canvasPtr = (TkCanvas *)memPtr; Tk_Item *itemPtr; @@ -2730,7 +2730,7 @@ CanvasEventProc( if (canvasPtr->flags & REDRAW_PENDING) { Tcl_CancelIdleCall(DisplayCanvas, canvasPtr); } - Tcl_EventuallyFree(canvasPtr, (Tcl_FreeProc *) DestroyCanvas); + Tcl_EventuallyFree(canvasPtr, DestroyCanvas); } else if (eventPtr->type == ConfigureNotify) { canvasPtr->flags |= UPDATE_SCROLLBARS; diff --git a/generic/tkEntry.c b/generic/tkEntry.c index 86b79ac..4c342d1 100644 --- a/generic/tkEntry.c +++ b/generic/tkEntry.c @@ -396,7 +396,7 @@ static const char *const selElementNames[] = { static int ConfigureEntry(Tcl_Interp *interp, Entry *entryPtr, int objc, Tcl_Obj *const objv[]); static int DeleteChars(Entry *entryPtr, int index, int count); -static void DestroyEntry(void *memPtr); +static Tcl_FreeProc DestroyEntry; static void DisplayEntry(ClientData clientData); static void EntryBlinkProc(ClientData clientData); static void EntryCmdDeletedProc(ClientData clientData); @@ -1021,9 +1021,9 @@ EntryWidgetObjCmd( static void DestroyEntry( - void *memPtr) /* Info about entry widget. */ + char *memPtr) /* Info about entry widget. */ { - Entry *entryPtr = memPtr; + Entry *entryPtr = (Entry *)memPtr; /* * Free up all the stuff that requires special handling, then let @@ -2498,7 +2498,7 @@ EntryEventProc( if (entryPtr->flags & REDRAW_PENDING) { Tcl_CancelIdleCall(DisplayEntry, clientData); } - Tcl_EventuallyFree(clientData, (Tcl_FreeProc *) DestroyEntry); + Tcl_EventuallyFree(clientData, DestroyEntry); } break; case ConfigureNotify: diff --git a/generic/tkFrame.c b/generic/tkFrame.c index 4d69c16..c8e9bfd 100644 --- a/generic/tkFrame.c +++ b/generic/tkFrame.c @@ -308,7 +308,7 @@ static int ConfigureFrame(Tcl_Interp *interp, Frame *framePtr, static int CreateFrame(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[], enum FrameType type, const char *appName); -static void DestroyFrame(void *memPtr); +static Tcl_FreeProc DestroyFrame; static void DestroyFramePartly(Frame *framePtr); static void DisplayFrame(ClientData clientData); static void FrameCmdDeletedProc(ClientData clientData); @@ -857,10 +857,10 @@ FrameWidgetObjCmd( static void DestroyFrame( - void *memPtr) /* Info about frame widget. */ + char *memPtr) /* Info about frame widget. */ { - Frame *framePtr = memPtr; - Labelframe *labelframePtr = memPtr; + Frame *framePtr = (Frame *)memPtr; + Labelframe *labelframePtr = (Labelframe *)memPtr; if (framePtr->type == TYPE_LABELFRAME) { Tk_FreeTextLayout(labelframePtr->textLayout); @@ -1676,7 +1676,7 @@ FrameEventProc( Tcl_CancelIdleCall(DisplayFrame, framePtr); } Tcl_CancelIdleCall(MapFrame, framePtr); - Tcl_EventuallyFree(framePtr, (Tcl_FreeProc *) DestroyFrame); + Tcl_EventuallyFree(framePtr, DestroyFrame); } else if (eventPtr->type == FocusIn) { if (eventPtr->xfocus.detail != NotifyInferior) { framePtr->flags |= GOT_FOCUS; diff --git a/generic/tkGrid.c b/generic/tkGrid.c index ac6b59b..f1e06ba 100644 --- a/generic/tkGrid.c +++ b/generic/tkGrid.c @@ -262,7 +262,7 @@ static int CheckSlotData(Gridder *containerPtr, int slot, int slotType, int checkOnly); static int ConfigureContent(Tcl_Interp *interp, Tk_Window tkwin, int objc, Tcl_Obj *const objv[]); -static void DestroyGrid(void *memPtr); +static Tcl_FreeProc DestroyGrid; static Gridder * GetGrid(Tk_Window tkwin); static int GridAnchorCommand(Tk_Window tkwin, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); @@ -2807,7 +2807,7 @@ Unlink( static void DestroyGrid( - void *memPtr) /* Info about window that is now dead. */ + char *memPtr) /* Info about window that is now dead. */ { Gridder *gridPtr = (Gridder *)memPtr; @@ -2890,7 +2890,7 @@ GridStructureProc( Tcl_CancelIdleCall(ArrangeGrid, gridPtr); } gridPtr->tkwin = NULL; - Tcl_EventuallyFree(gridPtr, (Tcl_FreeProc *)DestroyGrid); + Tcl_EventuallyFree(gridPtr, DestroyGrid); } else if (eventPtr->type == MapNotify) { if ((gridPtr->contentPtr != NULL) && !(gridPtr->flags & REQUESTED_RELAYOUT)) { diff --git a/generic/tkImage.c b/generic/tkImage.c index 8cd5519..d1681c9 100644 --- a/generic/tkImage.c +++ b/generic/tkImage.c @@ -86,7 +86,7 @@ static Tcl_ThreadDataKey dataKey; */ static void ImageTypeThreadExitProc(ClientData clientData); -static void DeleteImage(ImageModel *modelPtr); +static Tcl_FreeProc DeleteImage; static void EventuallyDeleteImage(ImageModel *modelPtr, int forgetImageHashNow); @@ -406,7 +406,7 @@ Tk_ImageObjCmd( if (modelPtr->deleted) { goto alreadyDeleted; } - DeleteImage(modelPtr); + DeleteImage((char *)modelPtr); } break; case IMAGE_NAMES: @@ -958,10 +958,11 @@ Tk_DeleteImage( static void DeleteImage( - ImageModel *modelPtr) /* Pointer to main data structure for image. */ + char *blockPtr) /* Pointer to main data structure for image. */ { Image *imagePtr; Tk_ImageType *typePtr; + ImageModel *modelPtr = (ImageModel *)blockPtr; typePtr = modelPtr->typePtr; modelPtr->typePtr = NULL; @@ -1015,7 +1016,7 @@ EventuallyDeleteImage( } if (!modelPtr->deleted) { modelPtr->deleted = 1; - Tcl_EventuallyFree(modelPtr, (Tcl_FreeProc *) DeleteImage); + Tcl_EventuallyFree(modelPtr, DeleteImage); } } diff --git a/generic/tkListbox.c b/generic/tkListbox.c index 64b16ee..f97a9c8 100644 --- a/generic/tkListbox.c +++ b/generic/tkListbox.c @@ -389,7 +389,7 @@ static int ConfigureListboxItem(Tcl_Interp *interp, Tcl_Obj *const objv[], int index); static int ListboxDeleteSubCmd(Listbox *listPtr, int first, int last); -static void DestroyListbox(void *memPtr); +static Tcl_FreeProc DestroyListbox; static void DestroyListboxOptionTables(ClientData clientData, Tcl_Interp *interp); static void DisplayListbox(ClientData clientData); @@ -1436,9 +1436,9 @@ ListboxGetItemAttributes( static void DestroyListbox( - void *memPtr) /* Info about listbox widget. */ + char *memPtr) /* Info about listbox widget. */ { - Listbox *listPtr = memPtr; + Listbox *listPtr = (Listbox *)memPtr; Tcl_HashEntry *entry; Tcl_HashSearch search; @@ -2619,7 +2619,7 @@ ListboxEventProc( if (listPtr->flags & REDRAW_PENDING) { Tcl_CancelIdleCall(DisplayListbox, clientData); } - Tcl_EventuallyFree(clientData, (Tcl_FreeProc *) DestroyListbox); + Tcl_EventuallyFree(clientData, DestroyListbox); } } else if (eventPtr->type == ConfigureNotify) { int vertSpace; diff --git a/generic/tkMenu.c b/generic/tkMenu.c index 95a3b95..7ca930b 100644 --- a/generic/tkMenu.c +++ b/generic/tkMenu.c @@ -333,7 +333,7 @@ static void DeleteMenuCloneEntries(TkMenu *menuPtr, static void DestroyMenuHashTable(ClientData clientData, Tcl_Interp *interp); static void DestroyMenuInstance(TkMenu *menuPtr); -static void DestroyMenuEntry(void *memPtr); +static Tcl_FreeProc DestroyMenuEntry; static int GetIndexFromCoords(Tcl_Interp *interp, TkMenu *menuPtr, const char *string, int *indexPtr); @@ -1176,8 +1176,7 @@ DestroyMenuInstance( * for menu entries (i+1)...numEntries. */ - Tcl_EventuallyFree(menuPtr->entries[i], - (Tcl_FreeProc*)DestroyMenuEntry); + Tcl_EventuallyFree(menuPtr->entries[i], DestroyMenuEntry); menuPtr->numEntries = i; } if (menuPtr->entries != NULL) { @@ -1376,9 +1375,9 @@ UnhookCascadeEntry( static void DestroyMenuEntry( - void *memPtr) /* Pointer to entry to be freed. */ + char *memPtr) /* Pointer to entry to be freed. */ { - TkMenuEntry *mePtr = memPtr; + TkMenuEntry *mePtr = (TkMenuEntry *)memPtr; TkMenu *menuPtr = mePtr->menuPtr; if (menuPtr->postedCascade == mePtr) { @@ -1617,7 +1616,7 @@ ConfigureMenu( } else if ((menuListPtr->numEntries > 0) && (menuListPtr->entries[0]->type == TEAROFF_ENTRY)) { - Tcl_EventuallyFree(menuListPtr->entries[0], (Tcl_FreeProc *) DestroyMenuEntry); + Tcl_EventuallyFree(menuListPtr->entries[0], DestroyMenuEntry); for (i = 0; i < menuListPtr->numEntries - 1; i++) { menuListPtr->entries[i] = menuListPtr->entries[i + 1]; @@ -2385,8 +2384,7 @@ MenuAddOrInsert( for (errorMenuPtr = menuPtr->masterMenuPtr; errorMenuPtr != NULL; errorMenuPtr = errorMenuPtr->nextInstancePtr) { - Tcl_EventuallyFree(errorMenuPtr->entries[index], - (Tcl_FreeProc *) DestroyMenuEntry); + Tcl_EventuallyFree(errorMenuPtr->entries[index], DestroyMenuEntry); for (i = index; i < errorMenuPtr->numEntries - 1; i++) { errorMenuPtr->entries[i] = errorMenuPtr->entries[i + 1]; errorMenuPtr->entries[i]->index = i; @@ -3521,7 +3519,7 @@ DeleteMenuCloneEntries( for (menuListPtr = menuPtr->masterMenuPtr; menuListPtr != NULL; menuListPtr = menuListPtr->nextInstancePtr) { for (i = last; i >= first; i--) { - Tcl_EventuallyFree(menuListPtr->entries[i], (Tcl_FreeProc *) DestroyMenuEntry); + Tcl_EventuallyFree(menuListPtr->entries[i], DestroyMenuEntry); } for (i = last + 1; i < menuListPtr->numEntries; i++) { j = i - numDeleted; diff --git a/generic/tkPack.c b/generic/tkPack.c index b3b7228..1412a9d 100644 --- a/generic/tkPack.c +++ b/generic/tkPack.c @@ -120,7 +120,7 @@ static const Tk_GeomMgr packerType = { static void ArrangePacking(ClientData clientData); static int ConfigureContent(Tcl_Interp *interp, Tk_Window tkwin, int objc, Tcl_Obj *const objv[]); -static void DestroyPacker(void *memPtr); +static Tcl_FreeProc DestroyPacker; static Packer * GetPacker(Tk_Window tkwin); static int PackAfter(Tcl_Interp *interp, Packer *prevPtr, Packer *containerPtr, int objc,Tcl_Obj *const objv[]); @@ -1388,7 +1388,7 @@ Unlink( static void DestroyPacker( - void *memPtr) /* Info about packed window that is now + char *memPtr) /* Info about packed window that is now * dead. */ { Packer *packPtr = (Packer *)memPtr; @@ -1465,7 +1465,7 @@ PackStructureProc( Tcl_CancelIdleCall(ArrangePacking, packPtr); } packPtr->tkwin = NULL; - Tcl_EventuallyFree(packPtr, (Tcl_FreeProc *) DestroyPacker); + Tcl_EventuallyFree(packPtr, DestroyPacker); } else if (eventPtr->type == MapNotify) { /* * When a container gets mapped, must redo the geometry computation so diff --git a/generic/tkSquare.c b/generic/tkSquare.c index 61f86c5..8445930 100644 --- a/generic/tkSquare.c +++ b/generic/tkSquare.c @@ -98,7 +98,7 @@ static const Tk_OptionSpec optionSpecs[] = { static void SquareDeletedProc(ClientData clientData); static int SquareConfigure(Tcl_Interp *interp, Square *squarePtr); -static void SquareDestroy(void *memPtr); +static Tcl_FreeProc SquareDestroy; static void SquareDisplay(ClientData clientData); static void KeepInWindow(Square *squarePtr); static void SquareObjEventProc(ClientData clientData, @@ -410,7 +410,7 @@ SquareObjEventProc( if (squarePtr->updatePending) { Tcl_CancelIdleCall(SquareDisplay, squarePtr); } - Tcl_EventuallyFree(squarePtr, (Tcl_FreeProc *) SquareDestroy); + Tcl_EventuallyFree(squarePtr, SquareDestroy); } } |