Skip to content

Commit

Permalink
Merge 9.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jan.nijtmans committed Feb 16, 2024
2 parents 84a6b6d + 520853a commit 42f8c29
Show file tree
Hide file tree
Showing 35 changed files with 1,817 additions and 1,451 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
4 changes: 2 additions & 2 deletions generic/tkCmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ Tk_BindtagsObjCmd(
} else {
for (i = 0; i < winPtr->numTags; i++) {
Tcl_ListObjAppendElement(NULL, listPtr,
Tcl_NewStringObj(winPtr->tagPtr[i], TCL_INDEX_NONE));
Tcl_NewStringObj((const char *)winPtr->tagPtr[i], TCL_INDEX_NONE));
}
}
Tcl_SetObjResult(interp, listPtr);
Expand Down 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((char *)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
2 changes: 1 addition & 1 deletion generic/tkError.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ Tk_CreateErrorHandler(
Tk_ErrorProc *errorProc, /* Procedure to invoke when a matching error
* occurs. NULL means just ignore matching
* errors. */
ClientData clientData) /* Arbitrary value to pass to errorProc. */
void *clientData) /* Arbitrary value to pass to errorProc. */
{
TkErrorHandler *errorPtr;
TkDisplay *dispPtr;
Expand Down
2 changes: 1 addition & 1 deletion generic/tkImage.c
Original file line number Diff line number Diff line change
Expand Up @@ -930,7 +930,7 @@ Tk_DeleteImage(
if (hPtr == NULL) {
return;
}
DeleteImage(Tcl_GetHashValue(hPtr));
DeleteImage((char *)Tcl_GetHashValue(hPtr));
}

/*
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/tkText.c
Original file line number Diff line number Diff line change
Expand Up @@ -9993,7 +9993,7 @@ static void
RunAfterSyncCmd(
void *clientData) /* Information about text widget. */
{
TkText *textPtr = (TkText *) clientData;
TkText *textPtr = (TkText *)clientData;

if (!(textPtr->flags & DESTROYED)) {
if (TkTextPendingSync(textPtr)) {
Expand Down
2 changes: 1 addition & 1 deletion generic/tkUndo.c
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ TkUndoSubAtom *
TkUndoMakeSubAtom(
TkUndoProc *funcPtr, /* Callback function to perform the
* undo/redo. */
ClientData clientData, /* Data to pass to the callback function. */
void *clientData, /* Data to pass to the callback function. */
Tcl_Obj *actionScript, /* Additional Tcl data to pass to the callback
* function (may be NULL). */
TkUndoSubAtom *subAtomList) /* Add to the end of this list of actions if
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
2 changes: 1 addition & 1 deletion library/console.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,7 @@ proc ::tk::ConsoleBind {w} {
tk::ConsoleInsert %W %A
}
bind Console <F9> {
eval destroy [winfo child .]
destroy {*}[winfo children .]
source -encoding utf-8 [file join $tk_library console.tcl]
}
bind Console <Command-q> {
Expand Down
2 changes: 1 addition & 1 deletion library/demos/rolodex
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ exec wish "$0" ${1+"$@"}

package require tk

foreach i [winfo child .] {
foreach i [winfo children .] {
catch {destroy $i}
}

Expand Down
2 changes: 1 addition & 1 deletion library/demos/widget
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ exec wish "$0" ${1+"$@"}
package require tk
package require msgcat

eval destroy [winfo child .]
destroy {*}[winfo children .]
set tk_demoDirectory [file join [pwd] [file dirname [info script]]]
::msgcat::mcload $tk_demoDirectory
namespace import ::msgcat::mc
Expand Down
3 changes: 0 additions & 3 deletions library/ttk/fonts.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,6 @@
# There does not appear to be any recommendations for fixed-width fonts.
#
# X11:
# Need a way to tell if Xft is enabled or not.
# For now, assume patch #971980 applied.
#
# "Classic" look used Helvetica bold for everything except
# for entry widgets, which use Helvetica medium.
# Most other toolkits use medium weight for all UI elements,
Expand Down
4 changes: 2 additions & 2 deletions tests/color.test
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ test color-2.11 {Tk_GetColor, 6 hex digits, last one invalid} -body {
} -returnCodes error -result {invalid color name "#12345g"}

test color-3.1 {Tk_FreeColor procedure, reference counting} colorsFree {
eval destroy [winfo child .t]
destroy {*}[winfo children .t]
mkColors .t.c 40 6 0 240 240 0 -6 0 0 0 -40
pack .t.c
mkColors .t.c2 20 1 250 0 0 -10 0 0 0 0 0
Expand All @@ -223,7 +223,7 @@ test color-3.1 {Tk_FreeColor procedure, reference counting} colorsFree {
lappend result [colorsFree .t]
} {0 1}
test color-3.2 {Tk_FreeColor procedure, flushing stressed cmap information} colorsFree {
eval destroy [winfo child .t]
destroy {*}[winfo children .t]
mkColors .t.c 40 6 0 240 240 0 -6 0 0 0 -40
pack .t.c
mkColors .t.c2 20 1 250 0 0 -10 0 0 0 0 0
Expand Down
2 changes: 1 addition & 1 deletion tests/grid.test
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ proc grid_reset {{test ?} {top .}} {
gets stdin
}
}
eval destroy [winfo children $top]
destroy {*}[winfo children $top]
update
foreach {cols rows} [grid size .] {}
for {set i 0} {$i <= $cols} {incr i} {
Expand Down
4 changes: 2 additions & 2 deletions tests/message.test
Original file line number Diff line number Diff line change
Expand Up @@ -404,15 +404,15 @@ test message-2.2 {Tk_MessageObjCmd procedure} -body {
} -returnCodes {error} -result {bad window path name "foo"}
test message-2.3 {Tk_MessageObjCmd procedure} -body {
catch {message foo}
winfo child .
winfo children .
} -result {}

test message-2.4 {Tk_MessageObjCmd procedure} -body {
message .s -gorp dump
} -returnCodes {error} -result {unknown option "-gorp"}
test message-2.5 {Tk_MessageObjCmd procedure} -body {
catch {message .s -gorp dump}
winfo child .
winfo children .
} -result {}


Expand Down
6 changes: 3 additions & 3 deletions tests/pack.test
Original file line number Diff line number Diff line change
Expand Up @@ -1556,7 +1556,7 @@ test pack-17.2 {PackLostContentProc procedure} -setup {
test pack-18.1.1 {unmap content when container unmapped} -constraints {
macOrUnix failsOnUbuntu failsOnXQuarz
} -setup {
destroy {*}[winfo child .pack]
destroy {*}[winfo children .pack]
# adjust the position of .pack before test to avoid a screen switch
# that occurs with window managers that have desktops four times as big
# as the screen (screen switch causes scale and other tests to fail).
Expand All @@ -1579,7 +1579,7 @@ test pack-18.1.1 {unmap content when container unmapped} -constraints {
test pack-18.1.2 {unmap content when container unmapped} -constraints {
win
} -setup {
destroy {*}[winfo child .pack]
destroy {*}[winfo children .pack]
# adjust the position of .pack before test to avoid a screen switch
# that occurs with window managers that have desktops four times as big
# as the screen (screen switch causes scale and other tests to fail).
Expand All @@ -1600,7 +1600,7 @@ test pack-18.1.2 {unmap content when container unmapped} -constraints {
} -result {1 0 200 75 1}

test pack-18.2 {unmap content when container unmapped} -constraints {failsOnUbuntu failsOnXQuarz} -setup {
destroy {*}[winfo child .pack]
destroy {*}[winfo children .pack]
# adjust the position of .pack before test to avoid a screen switch
# that occurs with window managers that have desktops four times as big
# as the screen (screen switch causes scale and other tests to fail).
Expand Down
4 changes: 1 addition & 3 deletions tests/raise.test
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@ namespace import -force tcltest::test
# make it easy to detect differences in order.

proc raise_setup {} {
foreach i [winfo child .raise] {
destroy $i
}
destroy {*}[winfo children .raise]
update idletasks
foreach i {a b c d e} {
label .raise.$i -text $i -relief raised -bd 2
Expand Down
4 changes: 2 additions & 2 deletions tests/scale.test
Original file line number Diff line number Diff line change
Expand Up @@ -328,14 +328,14 @@ test scale-2.2 {Tk_ScaleCmd procedure} -body {
} -returnCodes error -result {bad window path name "foo"}
test scale-2.3 {Tk_ScaleCmd procedure} -body {
catch {scale foo}
winfo child .
winfo children .
} -result {}
test scale-2.4 {Tk_ScaleCmd procedure} -body {
scale .s -gorp dumb
} -returnCodes error -result {unknown option "-gorp"}
test scale-2.5 {Tk_ScaleCmd procedure} -body {
catch {scale .s -gorp dumb}
winfo child .
winfo children .
} -result {}


Expand Down
2 changes: 1 addition & 1 deletion tests/ttk/ttk.test
Original file line number Diff line number Diff line change
Expand Up @@ -675,7 +675,7 @@ test ttk-16.2 {ttk::style theme styles - theme exists} -body {
} -result 1


eval destroy [winfo children .]
destroy {*}[winfo children .]

tcltest::cleanupTests

Expand Down
Loading

0 comments on commit 42f8c29

Please sign in to comment.