Skip to content

Commit

Permalink
Merge 8.7
Browse files Browse the repository at this point in the history
  • Loading branch information
jan.nijtmans committed Feb 16, 2024
2 parents 2892911 + 2d5bd25 commit 520853a
Show file tree
Hide file tree
Showing 12 changed files with 63 additions and 63 deletions.
4 changes: 2 additions & 2 deletions generic/tkCanvas.c
Original file line number Diff line number Diff line change
Expand Up @@ -609,9 +609,9 @@ DefaultRotateImplementation(
for (i=0 ; i<objc ; i++) {
Tcl_DecrRefCount(newObjv[i]);
}
ckfree((char *) newObjv);
ckfree((void *)newObjv);
}
ckfree((char *) coordv);
ckfree((void *)coordv);
}

/*
Expand Down
2 changes: 1 addition & 1 deletion generic/tkCmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ TkFreeBindingTags(
* have to be freed.
*/

ckfree((char *)p);
ckfree((void *)p);
}
}
ckfree(winPtr->tagPtr);
Expand Down
4 changes: 2 additions & 2 deletions generic/tkDList.h
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ static void \
LT##_Free(struct ElemType *elem) \
{ \
LT##_Remove(elem); \
ckfree((void *) elem); \
ckfree((void *)elem); \
} \
\
__TK_DLIST_UNUSED \
Expand Down Expand Up @@ -508,7 +508,7 @@ LT##_Clear(LT *head) \
assert(head); \
for (p = head->first; p; p = next) { \
next = LT##_Next(p); \
ckfree((void *) p); \
ckfree((void *)p); \
} \
LT##_Init(head); \
} \
Expand Down
16 changes: 8 additions & 8 deletions generic/tkEntry.c
Original file line number Diff line number Diff line change
Expand Up @@ -1051,7 +1051,7 @@ DestroyEntry(
* Tk_FreeOptions handle all the standard option-related stuff.
*/

ckfree(entryPtr->string);
ckfree((void *)entryPtr->string);
if (entryPtr->textVarName != NULL) {
Tcl_UntraceVar2(entryPtr->interp, entryPtr->textVarName,
NULL, TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS,
Expand All @@ -1066,7 +1066,7 @@ DestroyEntry(
}
Tcl_DeleteTimerHandler(entryPtr->insertBlinkHandler);
if (entryPtr->displayString != entryPtr->string) {
ckfree((char *)entryPtr->displayString);
ckfree((void *)entryPtr->displayString);
}
if (entryPtr->type == TK_SPINBOX) {
Spinbox *sbPtr = (Spinbox *) entryPtr;
Expand Down Expand Up @@ -1980,7 +1980,7 @@ EntryComputeGeometry(
char *p;

if (entryPtr->displayString != entryPtr->string) {
ckfree((char *)entryPtr->displayString);
ckfree((void *)entryPtr->displayString);
entryPtr->displayString = entryPtr->string;
entryPtr->numDisplayBytes = entryPtr->numBytes;
}
Expand Down Expand Up @@ -2188,7 +2188,7 @@ InsertChars(
return TCL_OK;
}

ckfree((char *)string);
ckfree((void *)string);
entryPtr->string = newStr;

/*
Expand Down Expand Up @@ -2294,7 +2294,7 @@ DeleteChars(
}

ckfree(toDelete);
ckfree((char *)entryPtr->string);
ckfree((void *)entryPtr->string);
entryPtr->string = newStr;
entryPtr->numChars -= count;
entryPtr->numBytes -= byteCount;
Expand Down Expand Up @@ -2484,13 +2484,13 @@ EntrySetValue(

if (entryPtr->flags & VALIDATE_ABORT) {
entryPtr->flags &= ~VALIDATE_ABORT;
ckfree((char *)value);
ckfree((void *)value);
return;
}
}

oldSource = entryPtr->string;
ckfree((char *)entryPtr->string);
ckfree((void *)entryPtr->string);

if (malloced) {
entryPtr->string = value;
Expand Down Expand Up @@ -3273,7 +3273,7 @@ EntryTextVarProc(
entryPtr->textVarName,
TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS,
EntryTextVarProc, probe);
if (probe == (void *)entryPtr) {
if (probe == entryPtr) {
break;
}
} while (probe);
Expand Down
4 changes: 2 additions & 2 deletions generic/tkImgPhoto.c
Original file line number Diff line number Diff line change
Expand Up @@ -245,13 +245,13 @@ PhotoFormatThreadExitProc(
while (tsdPtr->formatList != NULL) {
freePtr = tsdPtr->formatList;
tsdPtr->formatList = tsdPtr->formatList->nextPtr;
ckfree((char *)freePtr->name);
ckfree((void *)freePtr->name);
ckfree(freePtr);
}
while (tsdPtr->formatListVersion3 != NULL) {
freePtrVersion3 = tsdPtr->formatListVersion3;
tsdPtr->formatListVersion3 = tsdPtr->formatListVersion3->nextPtr;
ckfree((char *)freePtrVersion3->name);
ckfree((void *)freePtrVersion3->name);
ckfree(freePtrVersion3);
}
}
Expand Down
8 changes: 4 additions & 4 deletions generic/tkOldConfig.c
Original file line number Diff line number Diff line change
Expand Up @@ -719,9 +719,9 @@ FormatConfigInfo(
result = Tcl_Merge(5, argv);
if (freeProc != NULL) {
if (freeProc == TCL_DYNAMIC) {
ckfree((char *) argv[4]);
ckfree((void *)argv[4]);
} else {
freeProc((char *) argv[4]);
freeProc((void *)argv[4]);
}
}
return result;
Expand Down Expand Up @@ -942,9 +942,9 @@ Tk_ConfigureValue(
Tcl_SetObjResult(interp, Tcl_NewStringObj(result, TCL_INDEX_NONE));
if (freeProc != NULL) {
if (freeProc == TCL_DYNAMIC) {
ckfree((char *)result);
ckfree((void *)result);
} else {
freeProc((char *)result);
freeProc((void *)result);
}
}
return TCL_OK;
Expand Down
2 changes: 1 addition & 1 deletion generic/ttk/ttkImage.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ struct TtkImageSpec {
Ttk_StateSpec *states; /* array[mapCount] of states ... */
Tk_Image *images; /* ... per-state images to use */
Tk_ImageChangedProc *imageChanged;
ClientData imageChangedClientData;
void *imageChangedClientData;
};

/* NullImageChanged --
Expand Down
2 changes: 1 addition & 1 deletion generic/ttk/ttkProgress.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ static const Tk_OptionSpec ProgressbarOptionSpecs[] =
0, ProgressbarModeStrings, 0 },
{TK_OPTION_STRING_TABLE, "-orient", "orient", "Orient",
"horizontal", offsetof(Progressbar,progress.orientObj), TCL_INDEX_NONE,
0, (void *)ttkOrientStrings, STYLE_CHANGED },
0, ttkOrientStrings, STYLE_CHANGED },
{TK_OPTION_INT, "-phase", "phase", "Phase",
"0", offsetof(Progressbar,progress.phaseObj), TCL_INDEX_NONE,
0, 0, 0 },
Expand Down
58 changes: 29 additions & 29 deletions unix/tkUnixSysTray.c
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,9 @@ typedef struct {
* Forward declarations for procedures defined in this file.
*/

static int TrayIconCreateCmd(ClientData cd, Tcl_Interp *interp,
static int TrayIconCreateCmd(void *cd, Tcl_Interp *interp,
int objc, Tcl_Obj *const objv[]);
static int TrayIconObjectCmd(ClientData cd, Tcl_Interp *interp,
static int TrayIconObjectCmd(void *cd, Tcl_Interp *interp,
int objc, Tcl_Obj *const objv[]);
static int TrayIconConfigureMethod(DockIcon *icon, Tcl_Interp* interp,
int objc, Tcl_Obj *const objv[],
Expand All @@ -210,7 +210,7 @@ static int PostBalloon(DockIcon* icon, const char * utf8msg,
static void CancelBalloon(DockIcon* icon, int msgid);
static int QueryTrayOrientation(DockIcon* icon);

static void TrayIconDeleteProc(ClientData cd );
static void TrayIconDeleteProc(void *cd );
static Atom DockSelectionAtomFor(Tk_Window tkwin);
static void DockToManager(DockIcon *icon);
static void CreateTrayIconWindow(DockIcon *icon);
Expand All @@ -220,14 +220,14 @@ static void TrayIconForceImageChange(DockIcon* icon);
static void TrayIconUpdate(DockIcon* icon, int mask);

static void EventuallyRedrawIcon(DockIcon* icon);
static void DisplayIcon(ClientData cd);
static void DisplayIcon(void *cd);

static void RetargetEvent(DockIcon *icon, XEvent *ev);

static void TrayIconEvent(ClientData cd, XEvent* ev);
static void UserIconEvent(ClientData cd, XEvent* ev);
static void TrayIconWrapperEvent(ClientData cd, XEvent* ev);
static int IconGenericHandler(ClientData cd, XEvent *ev);
static void TrayIconEvent(void *cd, XEvent* ev);
static void UserIconEvent(void *cd, XEvent* ev);
static void TrayIconWrapperEvent(void *cd, XEvent* ev);
static int IconGenericHandler(void *cd, XEvent *ev);

int Tktray_Init (Tcl_Interp* interp );

Expand All @@ -249,7 +249,7 @@ int Tktray_Init (Tcl_Interp* interp );

static int
TrayIconObjectCmd(
ClientData cd,
void *cd,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
Expand Down Expand Up @@ -611,7 +611,7 @@ CreateTrayIconWindow(
Tk_CreateEventHandler(icon->drawingWin,ExposureMask|StructureNotifyMask|
ButtonPressMask|ButtonReleaseMask|
EnterWindowMask|LeaveWindowMask|PointerMotionMask,
TrayIconEvent,(ClientData)icon);
TrayIconEvent, icon);
if(icon->bestVisual) {
Tk_SetWindowVisual(icon->drawingWin,icon->bestVisual,
32,icon->bestColormap);
Expand All @@ -627,7 +627,7 @@ CreateTrayIconWindow(

attr.override_redirect = True;
Tk_ChangeWindowAttributes(wrapper,CWOverrideRedirect,&attr);
Tk_CreateEventHandler(wrapper,StructureNotifyMask,TrayIconWrapperEvent,(ClientData)icon);
Tk_CreateEventHandler(wrapper,StructureNotifyMask,TrayIconWrapperEvent, icon);
if (!icon->bestVisual) {
Tk_SetWindowBackgroundPixmap(wrapper, ParentRelative);
} else {
Expand Down Expand Up @@ -744,7 +744,7 @@ TrayIconRequestSize(

static void
TrayIconImageChanged(
ClientData cd,
void *cd,
int x,
int y,
int w,
Expand Down Expand Up @@ -829,7 +829,7 @@ TrayIconForceImageChange(
if (icon->image) {
int w,h;
Tk_SizeOfImage(icon->image,&w,&h);
TrayIconImageChanged((ClientData)icon,0,0,w,h,w,h);
TrayIconImageChanged(icon, 0, 0, w, h, w, h);
}
}

Expand All @@ -856,7 +856,7 @@ EventuallyRedrawIcon(
if (icon->drawingWin && icon->myManager) { /* don't redraw invisible icon */
if (!(icon->flags & ICON_FLAG_REDRAW_PENDING)) { /* don't schedule multiple redraw ops */
icon->flags |= ICON_FLAG_REDRAW_PENDING;
Tcl_DoWhenIdle(DisplayIcon,(ClientData)icon);
Tcl_DoWhenIdle(DisplayIcon, icon);
}
}
}
Expand All @@ -879,7 +879,7 @@ EventuallyRedrawIcon(

static void
DisplayIcon(
ClientData cd)
void *cd)
{
DockIcon *icon = (DockIcon*)cd;
int w = icon->imageWidth, h = icon->imageHeight;
Expand Down Expand Up @@ -910,7 +910,7 @@ DisplayIcon(
Tcl_InterpState saved
= Tcl_SaveInterpState(icon->interp, TCL_OK);
icon->imageVisualInstance = Tk_GetImage(icon->interp,icon->drawingWin,
icon->imageString, IgnoreImageChange,(ClientData)NULL);
icon->imageString, IgnoreImageChange, NULL);
Tcl_RestoreInterpState(icon->interp,saved);
}
if (icon->photo && !icon->offscreenImage) {
Expand Down Expand Up @@ -1072,7 +1072,7 @@ RetargetEvent(

static void
TrayIconWrapperEvent(
ClientData cd,
void *cd,
XEvent* ev)
{
/* Some embedders, like Docker, add icon windows to save set
Expand Down Expand Up @@ -1125,7 +1125,7 @@ TrayIconWrapperEvent(

static void
TrayIconEvent(
ClientData cd,
void *cd,
XEvent* ev)
{
DockIcon *icon = (DockIcon*)cd;
Expand All @@ -1147,7 +1147,7 @@ TrayIconEvent(
if (icon->myManager) {
Tk_SendVirtualEvent(icon->tkwin,Tk_GetUid("IconDestroy"), NULL);
}
Tcl_CancelIdleCall(DisplayIcon,(ClientData)icon);
Tcl_CancelIdleCall(DisplayIcon, icon);
icon->flags &= ~ICON_FLAG_REDRAW_PENDING;
icon->drawingWin = NULL;
icon->requestedWidth = 0; /* trigger re-request on recreation */
Expand Down Expand Up @@ -1196,18 +1196,18 @@ TrayIconEvent(

static void
UserIconEvent(
ClientData cd,
void *cd,
XEvent* ev)
{
DockIcon *icon = (DockIcon*)cd;

switch (ev->type) {

case DestroyNotify:
Tk_DeleteGenericHandler(IconGenericHandler, (ClientData)icon);
Tk_DeleteGenericHandler(IconGenericHandler, icon);
if(icon->drawingWin) {
icon->visible = 0;
Tcl_CancelIdleCall(DisplayIcon,(ClientData)icon);
Tcl_CancelIdleCall(DisplayIcon, icon);
icon->flags &= ~ICON_FLAG_REDRAW_PENDING;
Tk_DestroyWindow(icon->drawingWin);
}
Expand Down Expand Up @@ -1365,7 +1365,7 @@ CancelBalloon(

static int
IconGenericHandler(
ClientData cd,
void *cd,
XEvent *ev)
{
DockIcon *icon = (DockIcon*)cd;
Expand Down Expand Up @@ -1522,7 +1522,7 @@ TrayIconConfigureMethod(
if (mask & ICON_CONF_IMAGE) {
if (icon->imageString) {
newImage = Tk_GetImage(interp, icon->tkwin, icon->imageString,
TrayIconImageChanged, (ClientData)icon);
TrayIconImageChanged, icon);
if (!newImage) {
Tk_RestoreSavedOptions(&saved);
return TCL_ERROR; /* msg by Tk_GetImage */
Expand Down Expand Up @@ -1563,7 +1563,7 @@ TrayIconConfigureMethod(

static void
TrayIconDeleteProc(
ClientData cd )
void *cd )
{
DockIcon *icon = (DockIcon *)cd;
Tk_DestroyWindow(icon->tkwin);
Expand All @@ -1587,7 +1587,7 @@ TrayIconDeleteProc(

static int
TrayIconCreateCmd(
ClientData cd,
void *cd,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
Expand Down Expand Up @@ -1627,7 +1627,7 @@ TrayIconCreateCmd(

/* Early tracking of DestroyNotify is essential */
Tk_CreateEventHandler(icon->tkwin,StructureNotifyMask,
UserIconEvent,(ClientData)icon);
UserIconEvent, icon);

/* Now try setting options */
icon->options = Tk_CreateOptionTable(interp,IconOptionSpec);
Expand All @@ -1652,7 +1652,7 @@ TrayIconCreateCmd(
XSelectInput(Tk_Display(icon->tkwin),icon->trayManager, StructureNotifyMask);
}

Tk_CreateGenericHandler(IconGenericHandler, (ClientData)icon);
Tk_CreateGenericHandler(IconGenericHandler, icon);

if (objc>3) {
if (TrayIconConfigureMethod(icon, interp, objc-2, objv+2,
Expand All @@ -1662,7 +1662,7 @@ TrayIconCreateCmd(
}

icon->widgetCmd = Tcl_CreateObjCommand(interp, Tcl_GetString(objv[1]),
TrayIconObjectCmd, (ClientData)icon, TrayIconDeleteProc);
TrayIconObjectCmd, icon, TrayIconDeleteProc);

/* Sometimes a command just can't be created... */
if (!icon->widgetCmd) {
Expand Down
Loading

0 comments on commit 520853a

Please sign in to comment.