From dc847a1c2f0f52c7ba66b37b9cc7a3d4316726a7 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 12 May 2022 22:01:40 +0000 Subject: More alphabetizing Tk options. More type-cast improvements --- generic/tkButton.c | 24 +++++++++++------------ generic/tkCanvas.c | 8 ++++---- generic/tkCmds.c | 24 +++++++++++------------ generic/tkEntry.c | 26 ++++++++++++------------ generic/tkEntry.h | 2 +- generic/tkFont.c | 6 +++--- generic/tkListbox.c | 8 ++++---- generic/tkMenu.c | 16 +++++++-------- generic/tkMenu.h | 6 +++--- generic/tkMenubutton.c | 8 ++++---- generic/tkMessage.c | 4 ++-- generic/tkPack.c | 4 ++-- generic/tkPlace.c | 4 ++-- generic/tkScale.c | 6 +++--- generic/tkTest.c | 50 +++++++++++++++++++++++------------------------ generic/tkText.c | 8 ++++---- generic/tkTextDisp.c | 6 +++--- generic/tkTextTag.c | 12 ++++++------ generic/ttk/ttkNotebook.c | 4 ++-- generic/ttk/ttkTheme.c | 2 +- generic/ttk/ttkTreeview.c | 14 ++++++------- generic/ttk/ttkWidget.h | 2 +- macosx/tkMacOSXBitmap.c | 8 ++++---- macosx/tkMacOSXDialog.c | 32 +++++++++++++++--------------- macosx/tkMacOSXNotify.c | 4 ++-- macosx/tkMacOSXPrint.c | 2 +- macosx/tkMacOSXTest.c | 10 +++++----- tests/choosedir.test | 2 +- tests/entry.test | 2 +- tests/filebox.test | 4 ++-- tests/font.test | 4 ++-- tests/listbox.test | 2 +- tests/menu.test | 4 ++-- tests/pack.test | 2 +- tests/place.test | 2 +- tests/spinbox.test | 2 +- tests/textDisp.test | 2 +- win/tkWinGDI.c | 6 +++--- 38 files changed, 166 insertions(+), 166 deletions(-) diff --git a/generic/tkButton.c b/generic/tkButton.c index fea4724..430c336 100644 --- a/generic/tkButton.c +++ b/generic/tkButton.c @@ -90,7 +90,7 @@ static const Tk_OptionSpec labelOptionSpecs[] = { {TK_OPTION_COLOR, "-disabledforeground", "disabledForeground", "DisabledForeground", DEF_BUTTON_DISABLED_FG_COLOR, TCL_INDEX_NONE, offsetof(TkButton, disabledFg), TK_OPTION_NULL_OK, - (ClientData) DEF_BUTTON_DISABLED_FG_MONO, 0}, + DEF_BUTTON_DISABLED_FG_MONO, 0}, {TK_OPTION_SYNONYM, "-fg", "foreground", NULL, NULL, 0, TCL_INDEX_NONE, 0, "-foreground", 0}, {TK_OPTION_FONT, "-font", "font", "Font", @@ -102,7 +102,7 @@ static const Tk_OptionSpec labelOptionSpecs[] = { {TK_OPTION_BORDER, "-highlightbackground", "highlightBackground", "HighlightBackground", DEF_BUTTON_HIGHLIGHT_BG_COLOR, TCL_INDEX_NONE, offsetof(TkButton, highlightBorder), 0, - (ClientData) DEF_BUTTON_HIGHLIGHT_BG_MONO, 0}, + DEF_BUTTON_HIGHLIGHT_BG_MONO, 0}, {TK_OPTION_COLOR, "-highlightcolor", "highlightColor", "HighlightColor", DEF_BUTTON_HIGHLIGHT, TCL_INDEX_NONE, offsetof(TkButton, highlightColorPtr), 0, 0, 0}, @@ -181,7 +181,7 @@ static const Tk_OptionSpec buttonOptionSpecs[] = { {TK_OPTION_COLOR, "-disabledforeground", "disabledForeground", "DisabledForeground", DEF_BUTTON_DISABLED_FG_COLOR, TCL_INDEX_NONE, offsetof(TkButton, disabledFg), TK_OPTION_NULL_OK, - (ClientData) DEF_BUTTON_DISABLED_FG_MONO, 0}, + DEF_BUTTON_DISABLED_FG_MONO, 0}, {TK_OPTION_SYNONYM, "-fg", "foreground", NULL, NULL, 0, TCL_INDEX_NONE, 0, "-foreground", 0}, {TK_OPTION_FONT, "-font", "font", "Font", @@ -193,7 +193,7 @@ static const Tk_OptionSpec buttonOptionSpecs[] = { {TK_OPTION_BORDER, "-highlightbackground", "highlightBackground", "HighlightBackground", DEF_BUTTON_HIGHLIGHT_BG_COLOR, TCL_INDEX_NONE, offsetof(TkButton, highlightBorder), 0, - (ClientData) DEF_BUTTON_HIGHLIGHT_BG_MONO, 0}, + DEF_BUTTON_HIGHLIGHT_BG_MONO, 0}, {TK_OPTION_COLOR, "-highlightcolor", "highlightColor", "HighlightColor", DEF_BUTTON_HIGHLIGHT, TCL_INDEX_NONE, offsetof(TkButton, highlightColorPtr), 0, 0, 0}, @@ -279,7 +279,7 @@ static const Tk_OptionSpec checkbuttonOptionSpecs[] = { {TK_OPTION_COLOR, "-disabledforeground", "disabledForeground", "DisabledForeground", DEF_BUTTON_DISABLED_FG_COLOR, TCL_INDEX_NONE, offsetof(TkButton, disabledFg), TK_OPTION_NULL_OK, - (ClientData) DEF_BUTTON_DISABLED_FG_MONO, 0}, + DEF_BUTTON_DISABLED_FG_MONO, 0}, {TK_OPTION_SYNONYM, "-fg", "foreground", NULL, NULL, 0, TCL_INDEX_NONE, 0, "-foreground", 0}, {TK_OPTION_FONT, "-font", "font", "Font", @@ -291,7 +291,7 @@ static const Tk_OptionSpec checkbuttonOptionSpecs[] = { {TK_OPTION_BORDER, "-highlightbackground", "highlightBackground", "HighlightBackground", DEF_BUTTON_HIGHLIGHT_BG_COLOR, TCL_INDEX_NONE, offsetof(TkButton, highlightBorder), 0, - (ClientData) DEF_BUTTON_HIGHLIGHT_BG_MONO, 0}, + DEF_BUTTON_HIGHLIGHT_BG_MONO, 0}, {TK_OPTION_COLOR, "-highlightcolor", "highlightColor", "HighlightColor", DEF_BUTTON_HIGHLIGHT, TCL_INDEX_NONE, offsetof(TkButton, highlightColorPtr), 0, 0, 0}, @@ -392,7 +392,7 @@ static const Tk_OptionSpec radiobuttonOptionSpecs[] = { {TK_OPTION_COLOR, "-disabledforeground", "disabledForeground", "DisabledForeground", DEF_BUTTON_DISABLED_FG_COLOR, TCL_INDEX_NONE, offsetof(TkButton, disabledFg), TK_OPTION_NULL_OK, - (ClientData) DEF_BUTTON_DISABLED_FG_MONO, 0}, + DEF_BUTTON_DISABLED_FG_MONO, 0}, {TK_OPTION_SYNONYM, "-fg", "foreground", NULL, NULL, 0, TCL_INDEX_NONE, 0, "-foreground", 0}, {TK_OPTION_FONT, "-font", "font", "Font", @@ -404,7 +404,7 @@ static const Tk_OptionSpec radiobuttonOptionSpecs[] = { {TK_OPTION_BORDER, "-highlightbackground", "highlightBackground", "HighlightBackground", DEF_BUTTON_HIGHLIGHT_BG_COLOR, TCL_INDEX_NONE, offsetof(TkButton, highlightBorder), 0, - (ClientData) DEF_BUTTON_HIGHLIGHT_BG_MONO, 0}, + DEF_BUTTON_HIGHLIGHT_BG_MONO, 0}, {TK_OPTION_COLOR, "-highlightcolor", "highlightColor", "HighlightColor", DEF_BUTTON_HIGHLIGHT, TCL_INDEX_NONE, offsetof(TkButton, highlightColorPtr), 0, 0, 0}, @@ -1617,14 +1617,14 @@ ButtonVarProc( if (flags & TCL_TRACE_UNSETS) { butPtr->flags &= ~(SELECTED | TRISTATED); if (!Tcl_InterpDeleted(interp)) { - ClientData probe = NULL; + void *probe = NULL; do { probe = Tcl_VarTraceInfo(interp, Tcl_GetString(butPtr->selVarNamePtr), TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, ButtonVarProc, probe); - if (probe == (ClientData)butPtr) { + if (probe == (void *)butPtr) { break; } } while (probe); @@ -1736,14 +1736,14 @@ ButtonTextVarProc( * the variable we have stored in butPtr->textVarNamePtr ? */ - ClientData probe = NULL; + void *probe = NULL; do { probe = Tcl_VarTraceInfo(interp, Tcl_GetString(butPtr->textVarNamePtr), TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, ButtonTextVarProc, probe); - if (probe == (ClientData)butPtr) { + if (probe == (void *)butPtr) { break; } } while (probe); diff --git a/generic/tkCanvas.c b/generic/tkCanvas.c index 14f6f96..ed9f2b6 100644 --- a/generic/tkCanvas.c +++ b/generic/tkCanvas.c @@ -1917,7 +1917,7 @@ CanvasWidgetCmd( case CANV_SCAN: { int x, y, gain = 10; static const char *const optionStrings[] = { - "mark", "dragto", NULL + "dragto", "mark", NULL }; if (objc < 5) { @@ -1926,8 +1926,8 @@ CanvasWidgetCmd( } else if (Tcl_GetIndexFromObj(interp, objv[2], optionStrings, "scan option", 0, &idx) != TCL_OK) { result = TCL_ERROR; - } else if ((objc != 5) && (objc != 5+idx)) { - Tcl_WrongNumArgs(interp, 3, objv, idx?"x y ?gain?":"x y"); + } else if ((objc != 5) && (objc != 6-idx)) { + Tcl_WrongNumArgs(interp, 3, objv, idx?"x y":"x y ?gain?"); result = TCL_ERROR; } else if ((Tcl_GetIntFromObj(interp, objv[3], &x) != TCL_OK) || (Tcl_GetIntFromObj(interp, objv[4], &y) != TCL_OK)){ @@ -1935,7 +1935,7 @@ CanvasWidgetCmd( } else if ((objc == 6) && (Tcl_GetIntFromObj(interp, objv[5], &gain) != TCL_OK)) { result = TCL_ERROR; - } else if (!idx) { + } else if (idx) { canvasPtr->scanX = x; canvasPtr->scanXOrigin = canvasPtr->xOrigin; canvasPtr->scanY = y; diff --git a/generic/tkCmds.c b/generic/tkCmds.c index 4fb06b2..b4c6cc6 100644 --- a/generic/tkCmds.c +++ b/generic/tkCmds.c @@ -185,10 +185,10 @@ Tk_BindObjCmd( if (winPtr == NULL) { return TCL_ERROR; } - object = (ClientData) winPtr->pathName; + object = winPtr->pathName; } else { winPtr = (TkWindow *)clientData; - object = (ClientData) Tk_GetUid(string); + object = (void *) Tk_GetUid(string); } /* @@ -267,10 +267,10 @@ TkBindEventProc( XEvent *eventPtr) /* Information about event. */ { #define MAX_OBJS 20 - ClientData objects[MAX_OBJS], *objPtr; + void *objects[MAX_OBJS], **objPtr; TkWindow *topLevPtr; TkSizeT i, count; - const char *p; + char *p; Tcl_HashEntry *hPtr; if ((winPtr->mainPtr == NULL) || (winPtr->mainPtr->bindingTable == NULL)) { @@ -288,7 +288,7 @@ TkBindEventProc( objPtr = (void **)ckalloc(winPtr->numTags * sizeof(void *)); } for (i = 0; i < winPtr->numTags; i++) { - p = (const char *)winPtr->tagPtr[i]; + p = (char *)winPtr->tagPtr[i]; if (*p == '.') { hPtr = Tcl_FindHashEntry(&winPtr->mainPtr->nameTable, p); if (hPtr != NULL) { @@ -297,12 +297,12 @@ TkBindEventProc( p = NULL; } } - objPtr[i] = (ClientData) p; + objPtr[i] = p; } count = winPtr->numTags; } else { - objPtr[0] = (ClientData) winPtr->pathName; - objPtr[1] = (ClientData) winPtr->classUid; + objPtr[0] = winPtr->pathName; + objPtr[1] = (void *)winPtr->classUid; for (topLevPtr = winPtr; (topLevPtr != NULL) && !(topLevPtr->flags & TK_TOP_HIERARCHY); topLevPtr = topLevPtr->parentPtr) { @@ -310,11 +310,11 @@ TkBindEventProc( } if ((winPtr != topLevPtr) && (topLevPtr != NULL)) { count = 4; - objPtr[2] = (ClientData) topLevPtr->pathName; + objPtr[2] = topLevPtr->pathName; } else { count = 3; } - objPtr[count-1] = (ClientData) Tk_GetUid("all"); + objPtr[count-1] = (void *) Tk_GetUid("all"); } Tk_BindEvent(winPtr->mainPtr->bindingTable, eventPtr, (Tk_Window) winPtr, count, objPtr); @@ -415,9 +415,9 @@ Tk_BindtagsObjCmd( copy = (char *)ckalloc(strlen(p) + 1); strcpy(copy, p); - winPtr->tagPtr[i] = (ClientData) copy; + winPtr->tagPtr[i] = copy; } else { - winPtr->tagPtr[i] = (ClientData) Tk_GetUid(p); + winPtr->tagPtr[i] = (void *)Tk_GetUid(p); } } return TCL_OK; diff --git a/generic/tkEntry.c b/generic/tkEntry.c index 28ad727..26e4d86 100644 --- a/generic/tkEntry.c +++ b/generic/tkEntry.c @@ -77,7 +77,7 @@ static const Tk_OptionSpec entryOptSpec[] = { {TK_OPTION_BORDER, "-disabledbackground", "disabledBackground", "DisabledBackground", DEF_ENTRY_DISABLED_BG_COLOR, TCL_INDEX_NONE, offsetof(Entry, disabledBorder), TK_OPTION_NULL_OK, - (ClientData) DEF_ENTRY_DISABLED_BG_MONO, 0}, + DEF_ENTRY_DISABLED_BG_MONO, 0}, {TK_OPTION_COLOR, "-disabledforeground", "disabledForeground", "DisabledForeground", DEF_ENTRY_DISABLED_FG, TCL_INDEX_NONE, offsetof(Entry, dfgColorPtr), TK_OPTION_NULL_OK, 0, 0}, @@ -103,7 +103,7 @@ static const Tk_OptionSpec entryOptSpec[] = { {TK_OPTION_PIXELS, "-insertborderwidth", "insertBorderWidth", "BorderWidth", DEF_ENTRY_INSERT_BD_COLOR, TCL_INDEX_NONE, offsetof(Entry, insertBorderWidth), 0, - (ClientData) DEF_ENTRY_INSERT_BD_MONO, 0}, + DEF_ENTRY_INSERT_BD_MONO, 0}, {TK_OPTION_INT, "-insertofftime", "insertOffTime", "OffTime", DEF_ENTRY_INSERT_OFF_TIME, TCL_INDEX_NONE, offsetof(Entry, insertOffTime), 0, 0, 0}, @@ -122,12 +122,12 @@ static const Tk_OptionSpec entryOptSpec[] = { DEF_ENTRY_PLACEHOLDER, TCL_INDEX_NONE, offsetof(Entry, placeholderString), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_COLOR, "-placeholderforeground", "placeholderForeground", - "PlaceholderForeground", DEF_ENTRY_PLACEHOLDERFG, TCL_INDEX_NONE, - offsetof(Entry, placeholderColorPtr), 0, 0, 0}, + "PlaceholderForeground", DEF_ENTRY_PLACEHOLDERFG, TCL_INDEX_NONE, + offsetof(Entry, placeholderColorPtr), 0, 0, 0}, {TK_OPTION_BORDER, "-readonlybackground", "readonlyBackground", "ReadonlyBackground", DEF_ENTRY_READONLY_BG_COLOR, TCL_INDEX_NONE, offsetof(Entry, readonlyBorder), TK_OPTION_NULL_OK, - (ClientData) DEF_ENTRY_READONLY_BG_MONO, 0}, + DEF_ENTRY_READONLY_BG_MONO, 0}, {TK_OPTION_RELIEF, "-relief", "relief", "Relief", DEF_ENTRY_RELIEF, TCL_INDEX_NONE, offsetof(Entry, relief), 0, 0, 0}, {TK_OPTION_BORDER, "-selectbackground", "selectBackground", "Foreground", @@ -216,7 +216,7 @@ static const Tk_OptionSpec sbOptSpec[] = { {TK_OPTION_BORDER, "-disabledbackground", "disabledBackground", "DisabledBackground", DEF_ENTRY_DISABLED_BG_COLOR, TCL_INDEX_NONE, offsetof(Entry, disabledBorder), TK_OPTION_NULL_OK, - (ClientData) DEF_ENTRY_DISABLED_BG_MONO, 0}, + DEF_ENTRY_DISABLED_BG_MONO, 0}, {TK_OPTION_COLOR, "-disabledforeground", "disabledForeground", "DisabledForeground", DEF_ENTRY_DISABLED_FG, TCL_INDEX_NONE, offsetof(Entry, dfgColorPtr), TK_OPTION_NULL_OK, 0, 0}, @@ -249,7 +249,7 @@ static const Tk_OptionSpec sbOptSpec[] = { {TK_OPTION_PIXELS, "-insertborderwidth", "insertBorderWidth", "BorderWidth", DEF_ENTRY_INSERT_BD_COLOR, TCL_INDEX_NONE, offsetof(Entry, insertBorderWidth), 0, - (ClientData) DEF_ENTRY_INSERT_BD_MONO, 0}, + DEF_ENTRY_INSERT_BD_MONO, 0}, {TK_OPTION_INT, "-insertofftime", "insertOffTime", "OffTime", DEF_ENTRY_INSERT_OFF_TIME, TCL_INDEX_NONE, offsetof(Entry, insertOffTime), 0, 0, 0}, @@ -275,7 +275,7 @@ static const Tk_OptionSpec sbOptSpec[] = { {TK_OPTION_BORDER, "-readonlybackground", "readonlyBackground", "ReadonlyBackground", DEF_ENTRY_READONLY_BG_COLOR, TCL_INDEX_NONE, offsetof(Entry, readonlyBorder), TK_OPTION_NULL_OK, - (ClientData) DEF_ENTRY_READONLY_BG_MONO, 0}, + DEF_ENTRY_READONLY_BG_MONO, 0}, {TK_OPTION_INT, "-repeatdelay", "repeatDelay", "RepeatDelay", DEF_SPINBOX_REPEAT_DELAY, TCL_INDEX_NONE, offsetof(Spinbox, repeatDelay), 0, 0, 0}, @@ -387,7 +387,7 @@ enum sbselCmd { */ static const char *const selElementNames[] = { - "none", "buttondown", "buttonup", NULL, "entry" + "buttondown", "buttonup", "none", NULL, "entry" }; /* @@ -784,7 +784,7 @@ EntryWidgetObjCmd( EntryScanTo(entryPtr, x); } else { Tcl_SetObjResult(interp, Tcl_ObjPrintf( - "bad scan option \"%s\": must be mark or dragto", + "bad scan option \"%s\": must be dragto or mark", minorCmd)); Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "INDEX", "scan option", minorCmd, NULL); @@ -3267,14 +3267,14 @@ EntryTextVarProc( if (flags & TCL_TRACE_UNSETS) { if (!Tcl_InterpDeleted(interp) && entryPtr->textVarName) { - ClientData probe = NULL; + void *probe = NULL; do { probe = Tcl_VarTraceInfo(interp, entryPtr->textVarName, TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, EntryTextVarProc, probe); - if (probe == (ClientData)entryPtr) { + if (probe == (void *)entryPtr) { break; } } while (probe); @@ -4059,7 +4059,7 @@ SpinboxWidgetObjCmd( EntryScanTo(entryPtr, x); } else { Tcl_SetObjResult(interp, Tcl_ObjPrintf( - "bad scan option \"%s\": must be mark or dragto", + "bad scan option \"%s\": must be dragto or mark", minorCmd)); Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "INDEX", "scan option", minorCmd, NULL); diff --git a/generic/tkEntry.h b/generic/tkEntry.h index fe0f2f7..939206b 100644 --- a/generic/tkEntry.h +++ b/generic/tkEntry.h @@ -296,7 +296,7 @@ enum state { */ enum selelement { - SEL_NONE, SEL_BUTTONDOWN, SEL_BUTTONUP, SEL_NULL, SEL_ENTRY + SEL_BUTTONDOWN, SEL_BUTTONUP, SEL_NONE, SEL_NULL, SEL_ENTRY }; /* diff --git a/generic/tkFont.c b/generic/tkFont.c index 18821df..74c617f 100644 --- a/generic/tkFont.c +++ b/generic/tkFont.c @@ -744,7 +744,7 @@ Tk_FontObjCmd( int skip, i; const TkFontMetrics *fmPtr; static const char *const switches[] = { - "-ascent", "-descent", "-linespace", "-fixed", NULL + "-ascent", "-descent", "-fixed", "-linespace", NULL }; skip = TkGetDisplayOf(interp, objc - 3, objv + 3, &tkwin); @@ -778,8 +778,8 @@ Tk_FontObjCmd( switch (index) { case 0: i = fmPtr->ascent; break; case 1: i = fmPtr->descent; break; - case 2: i = fmPtr->ascent + fmPtr->descent; break; - case 3: i = fmPtr->fixed; break; + case 2: i = fmPtr->fixed; break; + case 3: i = fmPtr->ascent + fmPtr->descent; break; } Tcl_SetObjResult(interp, Tcl_NewWideIntObj(i)); } diff --git a/generic/tkListbox.c b/generic/tkListbox.c index c9ccdfe..10ab4ee 100644 --- a/generic/tkListbox.c +++ b/generic/tkListbox.c @@ -366,10 +366,10 @@ enum selcommand { }; static const char *const scanCommandNames[] = { - "mark", "dragto", NULL + "dragto", "mark", NULL }; enum scancommand { - SCAN_MARK, SCAN_DRAGTO + SCAN_DRAGTO, SCAN_MARK }; static const char *const indexNames[] = { @@ -3451,14 +3451,14 @@ ListboxListVarProc( if (flags & TCL_TRACE_UNSETS) { if (!Tcl_InterpDeleted(interp) && listPtr->listVarName) { - ClientData probe = NULL; + void *probe = NULL; do { probe = Tcl_VarTraceInfo(interp, listPtr->listVarName, TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, ListboxListVarProc, probe); - if (probe == (ClientData)listPtr) { + if (probe == (void *)listPtr) { break; } } while (probe); diff --git a/generic/tkMenu.c b/generic/tkMenu.c index 1e9fa40..c1696f4 100644 --- a/generic/tkMenu.c +++ b/generic/tkMenu.c @@ -233,27 +233,27 @@ static const Tk_OptionSpec *specsArray[] = { */ static const char *const menuTypeStrings[] = { - "normal", "tearoff", "menubar", NULL + "menubar", "normal", "tearoff", NULL }; static const Tk_OptionSpec tkMenuConfigSpecs[] = { {TK_OPTION_BORDER, "-activebackground", "activeBackground", "Foreground", DEF_MENU_ACTIVE_BG_COLOR, offsetof(TkMenu, activeBorderPtr), TCL_INDEX_NONE, 0, - (ClientData) DEF_MENU_ACTIVE_BG_MONO, 0}, + DEF_MENU_ACTIVE_BG_MONO, 0}, {TK_OPTION_PIXELS, "-activeborderwidth", "activeBorderWidth", "BorderWidth", DEF_MENU_ACTIVE_BORDER_WIDTH, offsetof(TkMenu, activeBorderWidthPtr), TCL_INDEX_NONE, 0, NULL, 0}, {TK_OPTION_COLOR, "-activeforeground", "activeForeground", "Background", DEF_MENU_ACTIVE_FG_COLOR, offsetof(TkMenu, activeFgPtr), TCL_INDEX_NONE, 0, - (ClientData) DEF_MENU_ACTIVE_FG_MONO, 0}, + DEF_MENU_ACTIVE_FG_MONO, 0}, {TK_OPTION_RELIEF, "-activerelief", "activeRelief", "Relief", DEF_MENU_ACTIVE_RELIEF, offsetof(TkMenu, activeReliefPtr), TCL_INDEX_NONE, 0, NULL, 0}, {TK_OPTION_BORDER, "-background", "background", "Background", DEF_MENU_BG_COLOR, offsetof(TkMenu, borderPtr), TCL_INDEX_NONE, 0, - (ClientData) DEF_MENU_BG_MONO, 0}, + DEF_MENU_BG_MONO, 0}, {TK_OPTION_SYNONYM, "-bd", NULL, NULL, NULL, 0, TCL_INDEX_NONE, 0, "-borderwidth", 0}, {TK_OPTION_SYNONYM, "-bg", NULL, NULL, @@ -267,7 +267,7 @@ static const Tk_OptionSpec tkMenuConfigSpecs[] = { {TK_OPTION_COLOR, "-disabledforeground", "disabledForeground", "DisabledForeground", DEF_MENU_DISABLED_FG_COLOR, offsetof(TkMenu, disabledFgPtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK, - (ClientData) DEF_MENU_DISABLED_FG_MONO, 0}, + DEF_MENU_DISABLED_FG_MONO, 0}, {TK_OPTION_SYNONYM, "-fg", NULL, NULL, NULL, 0, TCL_INDEX_NONE, 0, "-foreground", 0}, {TK_OPTION_FONT, "-font", "font", "Font", @@ -281,7 +281,7 @@ static const Tk_OptionSpec tkMenuConfigSpecs[] = { DEF_MENU_RELIEF, offsetof(TkMenu, reliefPtr), TCL_INDEX_NONE, 0, NULL, 0}, {TK_OPTION_COLOR, "-selectcolor", "selectColor", "Background", DEF_MENU_SELECT_COLOR, offsetof(TkMenu, indicatorFgPtr), TCL_INDEX_NONE, 0, - (ClientData) DEF_MENU_SELECT_MONO, 0}, + DEF_MENU_SELECT_MONO, 0}, {TK_OPTION_STRING, "-takefocus", "takeFocus", "TakeFocus", DEF_MENU_TAKE_FOCUS, offsetof(TkMenu, takeFocusPtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK, NULL, 0}, @@ -2511,14 +2511,14 @@ MenuVarProc( */ if (flags & TCL_TRACE_UNSETS) { - ClientData probe = NULL; + void *probe = NULL; mePtr->entryFlags &= ~ENTRY_SELECTED; do { probe = Tcl_VarTraceInfo(interp, name, TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, MenuVarProc, probe); - if (probe == (ClientData)mePtr) { + if (probe == (void *)mePtr) { break; } } while (probe); diff --git a/generic/tkMenu.h b/generic/tkMenu.h index cc19b92..d53dc5f 100644 --- a/generic/tkMenu.h +++ b/generic/tkMenu.h @@ -461,9 +461,9 @@ typedef struct TkMenuReferences { */ #define UNKNOWN_TYPE -1 -#define MAIN_MENU 0 -#define TEAROFF_MENU 1 -#define MENUBAR 2 +#define MENUBAR 0 +#define MAIN_MENU 1 +#define TEAROFF_MENU 2 /* * Various geometry definitions: diff --git a/generic/tkMenubutton.c b/generic/tkMenubutton.c index 9a79bee..1843780 100644 --- a/generic/tkMenubutton.c +++ b/generic/tkMenubutton.c @@ -43,7 +43,7 @@ static const Tk_OptionSpec optionSpecs[] = { {TK_OPTION_BORDER, "-activebackground", "activeBackground", "Foreground", DEF_MENUBUTTON_ACTIVE_BG_COLOR, TCL_INDEX_NONE, offsetof(TkMenuButton, activeBorder), 0, - (ClientData) DEF_MENUBUTTON_ACTIVE_BG_MONO, 0}, + DEF_MENUBUTTON_ACTIVE_BG_MONO, 0}, {TK_OPTION_COLOR, "-activeforeground", "activeForeground", "Background", DEF_MENUBUTTON_ACTIVE_FG_COLOR, TCL_INDEX_NONE, offsetof(TkMenuButton, activeFg), @@ -73,7 +73,7 @@ static const Tk_OptionSpec optionSpecs[] = { {TK_OPTION_COLOR, "-disabledforeground", "disabledForeground", "DisabledForeground", DEF_MENUBUTTON_DISABLED_FG_COLOR, TCL_INDEX_NONE, offsetof(TkMenuButton, disabledFg), TK_OPTION_NULL_OK, - (ClientData) DEF_MENUBUTTON_DISABLED_FG_MONO, 0}, + DEF_MENUBUTTON_DISABLED_FG_MONO, 0}, {TK_OPTION_SYNONYM, "-fg", "foreground", NULL, NULL, 0, TCL_INDEX_NONE, 0, "-foreground", 0}, {TK_OPTION_FONT, "-font", "font", "Font", @@ -870,14 +870,14 @@ MenuButtonTextVarProc( if (flags & TCL_TRACE_UNSETS) { if (!Tcl_InterpDeleted(interp) && mbPtr->textVarName) { - ClientData probe = NULL; + void *probe = NULL; do { probe = Tcl_VarTraceInfo(interp, mbPtr->textVarName, TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, MenuButtonTextVarProc, probe); - if (probe == (ClientData)mbPtr) { + if (probe == (void *)mbPtr) { break; } } while (probe); diff --git a/generic/tkMessage.c b/generic/tkMessage.c index 90d92ea..a5c3a2f 100644 --- a/generic/tkMessage.c +++ b/generic/tkMessage.c @@ -848,14 +848,14 @@ MessageTextVarProc( if (flags & TCL_TRACE_UNSETS) { if (!Tcl_InterpDeleted(interp) && msgPtr->textVarName) { - ClientData probe = NULL; + void *probe = NULL; do { probe = Tcl_VarTraceInfo(interp, msgPtr->textVarName, TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, MessageTextVarProc, probe); - if (probe == (ClientData)msgPtr) { + if (probe == (void *)msgPtr) { break; } } while (probe); diff --git a/generic/tkPack.c b/generic/tkPack.c index ffb24f0..05a530c 100644 --- a/generic/tkPack.c +++ b/generic/tkPack.c @@ -13,9 +13,9 @@ #include "tkInt.h" -typedef enum {TOP, BOTTOM, LEFT, RIGHT} Side; +typedef enum {BOTTOM, LEFT, RIGHT, TOP} Side; static const char *const sideNames[] = { - "top", "bottom", "left", "right", NULL + "bottom", "left", "right", "top", NULL }; /* diff --git a/generic/tkPlace.c b/generic/tkPlace.c index a4fc18a..cde51a7 100644 --- a/generic/tkPlace.c +++ b/generic/tkPlace.c @@ -25,10 +25,10 @@ */ static const char *const borderModeStrings[] = { - "inside", "outside", "ignore", NULL + "inside", "ignore", "outside", NULL }; -typedef enum {BM_INSIDE, BM_OUTSIDE, BM_IGNORE} BorderMode; +typedef enum {BM_INSIDE, BM_IGNORE, BM_OUTSIDE} BorderMode; /* * For each window whose geometry is managed by the placer there is a diff --git a/generic/tkScale.c b/generic/tkScale.c index 56d13f0..8245f97 100644 --- a/generic/tkScale.c +++ b/generic/tkScale.c @@ -66,7 +66,7 @@ static const Tk_OptionSpec optionSpecs[] = { DEF_SCALE_FONT, TCL_INDEX_NONE, offsetof(TkScale, tkfont), 0, 0, 0}, {TK_OPTION_COLOR, "-foreground", "foreground", "Foreground", DEF_SCALE_FG_COLOR, TCL_INDEX_NONE, offsetof(TkScale, textColorPtr), 0, - (ClientData) DEF_SCALE_FG_MONO, 0}, + DEF_SCALE_FG_MONO, 0}, {TK_OPTION_DOUBLE, "-from", "from", "From", DEF_SCALE_FROM, TCL_INDEX_NONE, offsetof(TkScale, fromValue), 0, 0, 0}, {TK_OPTION_BORDER, "-highlightbackground", "highlightBackground", @@ -1350,14 +1350,14 @@ ScaleVarProc( if (flags & TCL_TRACE_UNSETS) { if (!Tcl_InterpDeleted(interp) && scalePtr->varNamePtr) { - ClientData probe = NULL; + void *probe = NULL; do { probe = Tcl_VarTraceInfo(interp, Tcl_GetString(scalePtr->varNamePtr), TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, ScaleVarProc, probe); - if (probe == (ClientData)scalePtr) { + if (probe == (void *)scalePtr) { break; } } while (probe); diff --git a/generic/tkTest.c b/generic/tkTest.c index 68b5a36..e566777 100644 --- a/generic/tkTest.c +++ b/generic/tkTest.c @@ -253,42 +253,42 @@ Tktest_Init( Tcl_CreateObjCommand(interp, "square", SquareObjCmd, NULL, NULL); Tcl_CreateObjCommand(interp, "testbitmap", TestbitmapObjCmd, - (ClientData) Tk_MainWindow(interp), NULL); + Tk_MainWindow(interp), NULL); Tcl_CreateObjCommand(interp, "testborder", TestborderObjCmd, - (ClientData) Tk_MainWindow(interp), NULL); + Tk_MainWindow(interp), NULL); Tcl_CreateObjCommand(interp, "testcolor", TestcolorObjCmd, - (ClientData) Tk_MainWindow(interp), NULL); + Tk_MainWindow(interp), NULL); Tcl_CreateObjCommand(interp, "testcursor", TestcursorObjCmd, - (ClientData) Tk_MainWindow(interp), NULL); + Tk_MainWindow(interp), NULL); Tcl_CreateObjCommand(interp, "testdeleteapps", TestdeleteappsObjCmd, - (ClientData) Tk_MainWindow(interp), NULL); + Tk_MainWindow(interp), NULL); Tcl_CreateObjCommand(interp, "testembed", TkpTestembedCmd, - (ClientData) Tk_MainWindow(interp), NULL); + Tk_MainWindow(interp), NULL); Tcl_CreateObjCommand(interp, "testobjconfig", TestobjconfigObjCmd, - (ClientData) Tk_MainWindow(interp), NULL); + Tk_MainWindow(interp), NULL); Tcl_CreateObjCommand(interp, "testfont", TestfontObjCmd, - (ClientData) Tk_MainWindow(interp), NULL); + Tk_MainWindow(interp), NULL); Tcl_CreateObjCommand(interp, "testmakeexist", TestmakeexistObjCmd, - (ClientData) Tk_MainWindow(interp), NULL); + Tk_MainWindow(interp), NULL); Tcl_CreateObjCommand(interp, "testprop", TestpropObjCmd, - (ClientData) Tk_MainWindow(interp), NULL); + Tk_MainWindow(interp), NULL); Tcl_CreateObjCommand(interp, "testprintf", TestprintfObjCmd, NULL, NULL); Tcl_CreateObjCommand(interp, "testtext", TkpTesttextCmd, - (ClientData) Tk_MainWindow(interp), NULL); + Tk_MainWindow(interp), NULL); Tcl_CreateObjCommand(interp, "testphotostringmatch", - TestPhotoStringMatchCmd, (ClientData) Tk_MainWindow(interp), + TestPhotoStringMatchCmd, Tk_MainWindow(interp), NULL); #if defined(_WIN32) Tcl_CreateObjCommand(interp, "testmetrics", TestmetricsObjCmd, - (ClientData) Tk_MainWindow(interp), NULL); + Tk_MainWindow(interp), NULL); #elif !defined(__CYGWIN__) && !defined(MAC_OSX_TK) Tcl_CreateObjCommand(interp, "testmenubar", TestmenubarObjCmd, - (ClientData) Tk_MainWindow(interp), NULL); + Tk_MainWindow(interp), NULL); Tcl_CreateObjCommand(interp, "testsend", TkpTestsendCmd, - (ClientData) Tk_MainWindow(interp), NULL); + Tk_MainWindow(interp), NULL); Tcl_CreateObjCommand(interp, "testwrapper", TestwrapperObjCmd, - (ClientData) Tk_MainWindow(interp), NULL); + Tk_MainWindow(interp), NULL); #endif /* _WIN32 */ /* @@ -367,7 +367,7 @@ TestbitmapObjCmd( static int TestborderObjCmd( - TCL_UNUSED(ClientData), /* Main window for application. */ + TCL_UNUSED(void *), /* Main window for application. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ @@ -683,9 +683,9 @@ TestobjconfigObjCmd( if (result == TCL_OK) { recordPtr->header.widgetCmd = Tcl_CreateObjCommand(interp, Tcl_GetString(objv[2]), TrivialConfigObjCmd, - (ClientData) recordPtr, TrivialCmdDeletedProc); + recordPtr, TrivialCmdDeletedProc); Tk_CreateEventHandler(tkwin, StructureNotifyMask, - TrivialEventProc, (ClientData) recordPtr); + TrivialEventProc, recordPtr); result = Tk_SetOptions(interp, recordPtr, optionTable, objc-3, objv+3, tkwin, NULL, NULL); if (result != TCL_OK) { @@ -731,9 +731,9 @@ TestobjconfigObjCmd( if (result == TCL_OK) { recordPtr->header.widgetCmd = Tcl_CreateObjCommand(interp, Tcl_GetString(objv[2]), TrivialConfigObjCmd, - (ClientData) recordPtr, TrivialCmdDeletedProc); + recordPtr, TrivialCmdDeletedProc); Tk_CreateEventHandler(tkwin, StructureNotifyMask, - TrivialEventProc, (ClientData) recordPtr); + TrivialEventProc, recordPtr); Tcl_SetObjResult(interp, objv[2]); } break; @@ -753,7 +753,7 @@ TestobjconfigObjCmd( "-oneAgain", "oneAgain", "OneAgain", "one again", offsetof(ExtensionWidgetRecord, extension5ObjPtr), TCL_INDEX_NONE, 0, NULL, 0}, {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, TCL_INDEX_NONE, 0, - (ClientData) baseSpecs, 0} + baseSpecs, 0} }; Tk_OptionTable optionTable; @@ -784,9 +784,9 @@ TestobjconfigObjCmd( if (result == TCL_OK) { recordPtr->header.widgetCmd = Tcl_CreateObjCommand(interp, Tcl_GetString(objv[2]), TrivialConfigObjCmd, - (ClientData) recordPtr, TrivialCmdDeletedProc); + recordPtr, TrivialCmdDeletedProc); Tk_CreateEventHandler(tkwin, StructureNotifyMask, - TrivialEventProc, (ClientData) recordPtr); + TrivialEventProc, recordPtr); Tcl_SetObjResult(interp, objv[2]); } break; @@ -1024,7 +1024,7 @@ TestobjconfigObjCmd( if (result == TCL_OK) { recordPtr->header.widgetCmd = Tcl_CreateObjCommand(interp, Tcl_GetString(objv[2]), TrivialConfigObjCmd, - (ClientData) recordPtr, TrivialCmdDeletedProc); + recordPtr, TrivialCmdDeletedProc); } else { Tk_FreeConfigOptions(recordPtr, recordPtr->header.optionTable, (Tk_Window) NULL); diff --git a/generic/tkText.c b/generic/tkText.c index 57f1dec..deeeec8 100644 --- a/generic/tkText.c +++ b/generic/tkText.c @@ -169,7 +169,7 @@ static const Tk_OptionSpec optionSpecs[] = { {TK_OPTION_PIXELS, "-insertborderwidth", "insertBorderWidth", "BorderWidth", DEF_TEXT_INSERT_BD_COLOR, TCL_INDEX_NONE, offsetof(TkText, insertBorderWidth), 0, - (ClientData) DEF_TEXT_INSERT_BD_MONO, 0}, + DEF_TEXT_INSERT_BD_MONO, 0}, {TK_OPTION_INT, "-insertofftime", "insertOffTime", "OffTime", DEF_TEXT_INSERT_OFF_TIME, TCL_INDEX_NONE, offsetof(TkText, insertOffTime), 0, 0, 0}, @@ -1533,7 +1533,7 @@ TextWidgetObjCmd( textPtr->afterSyncCmd = cmd; } else { textPtr->afterSyncCmd = cmd; - Tcl_DoWhenIdle(TkTextRunAfterSyncCmd, (ClientData) textPtr); + Tcl_DoWhenIdle(TkTextRunAfterSyncCmd, textPtr); } break; } else if (objc != 2) { @@ -5599,13 +5599,13 @@ TkTextRunAfterSyncCmd( return; } - Tcl_Preserve((ClientData) textPtr->interp); + Tcl_Preserve(textPtr->interp); code = Tcl_EvalObjEx(textPtr->interp, textPtr->afterSyncCmd, TCL_EVAL_GLOBAL); if (code == TCL_ERROR) { Tcl_AddErrorInfo(textPtr->interp, "\n (text sync)"); Tcl_BackgroundException(textPtr->interp, TCL_ERROR); } - Tcl_Release((ClientData) textPtr->interp); + Tcl_Release(textPtr->interp); Tcl_DecrRefCount(textPtr->afterSyncCmd); textPtr->afterSyncCmd = NULL; } diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c index 2301f49..303c3d5 100644 --- a/generic/tkTextDisp.c +++ b/generic/tkTextDisp.c @@ -3087,14 +3087,14 @@ AsyncUpdateLineMetrics( if (textPtr->afterSyncCmd) { int code; Tcl_CancelIdleCall(TkTextRunAfterSyncCmd, textPtr); - Tcl_Preserve((ClientData) textPtr->interp); + Tcl_Preserve(textPtr->interp); code = Tcl_EvalObjEx(textPtr->interp, textPtr->afterSyncCmd, TCL_EVAL_GLOBAL); if (code == TCL_ERROR) { Tcl_AddErrorInfo(textPtr->interp, "\n (text sync)"); Tcl_BackgroundException(textPtr->interp, TCL_ERROR); } - Tcl_Release((ClientData) textPtr->interp); + Tcl_Release(textPtr->interp); Tcl_DecrRefCount(textPtr->afterSyncCmd); textPtr->afterSyncCmd = NULL; } @@ -6459,7 +6459,7 @@ TkTextScanCmd( dInfoPtr->scanMarkY = y; } else { Tcl_SetObjResult(interp, Tcl_ObjPrintf( - "bad scan option \"%s\": must be mark or dragto", + "bad scan option \"%s\": must be dragto or mark", Tcl_GetString(objv[2]))); Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "INDEX", "scan option", Tcl_GetString(objv[2]), NULL); diff --git a/generic/tkTextTag.c b/generic/tkTextTag.c index e5b77f4..9d4e874 100644 --- a/generic/tkTextTag.c +++ b/generic/tkTextTag.c @@ -257,7 +257,7 @@ TkTextTagCmd( if (fifth[0] == 0) { return Tk_DeleteBinding(interp, textPtr->sharedTextPtr->bindingTable, - (ClientData) tagPtr->name, Tcl_GetString(objv[4])); + (void *) tagPtr->name, Tcl_GetString(objv[4])); } if (fifth[0] == '+') { fifth++; @@ -265,7 +265,7 @@ TkTextTagCmd( } mask = Tk_CreateBinding(interp, textPtr->sharedTextPtr->bindingTable, - (ClientData) tagPtr->name, Tcl_GetString(objv[4]), fifth, + (void *) tagPtr->name, Tcl_GetString(objv[4]), fifth, append); if (mask == 0) { return TCL_ERROR; @@ -276,7 +276,7 @@ TkTextTagCmd( |EnterWindowMask|LeaveWindowMask|KeyPressMask |KeyReleaseMask|PointerMotionMask|VirtualEventMask)) { Tk_DeleteBinding(interp, textPtr->sharedTextPtr->bindingTable, - (ClientData) tagPtr->name, Tcl_GetString(objv[4])); + (void *) tagPtr->name, Tcl_GetString(objv[4])); Tcl_SetObjResult(interp, Tcl_NewStringObj( "requested illegal events; only key, button, motion," " enter, leave, and virtual events may be used", -1)); @@ -288,7 +288,7 @@ TkTextTagCmd( command = Tk_GetBinding(interp, textPtr->sharedTextPtr->bindingTable, - (ClientData) tagPtr->name, Tcl_GetString(objv[4])); + (void *) tagPtr->name, Tcl_GetString(objv[4])); if (command == NULL) { const char *string = Tcl_GetString(Tcl_GetObjResult(interp)); @@ -307,7 +307,7 @@ TkTextTagCmd( } } else { Tk_GetAllBindings(interp, textPtr->sharedTextPtr->bindingTable, - (ClientData) tagPtr->name); + (void *) tagPtr->name); } break; case TAG_CGET: @@ -1147,7 +1147,7 @@ TkTextDeleteTag( if (textPtr->sharedTextPtr->bindingTable != NULL) { Tk_DeleteAllBindings(textPtr->sharedTextPtr->bindingTable, - (ClientData) tagPtr->name); + (void *) tagPtr->name); } } diff --git a/generic/ttk/ttkNotebook.c b/generic/ttk/ttkNotebook.c index ff30ed1..318c4e0 100644 --- a/generic/ttk/ttkNotebook.c +++ b/generic/ttk/ttkNotebook.c @@ -16,9 +16,9 @@ #define DEFAULT_MIN_TAB_WIDTH 24 -static const char *const TabStateStrings[] = { "normal", "disabled", "hidden", 0 }; +static const char *const TabStateStrings[] = { "disabled", "hidden", "normal", 0 }; typedef enum { - TAB_STATE_NORMAL, TAB_STATE_DISABLED, TAB_STATE_HIDDEN + TAB_STATE_DISABLED, TAB_STATE_HIDDEN, TAB_STATE_NORMAL } TAB_STATE; typedef struct diff --git a/generic/ttk/ttkTheme.c b/generic/ttk/ttkTheme.c index a4ad79b..bf72b8a 100644 --- a/generic/ttk/ttkTheme.c +++ b/generic/ttk/ttkTheme.c @@ -1615,7 +1615,7 @@ static int StyleLayoutCmd( * Use the current theme if $theme is omitted. */ static int StyleThemeStylesCmd( - TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) + TCL_UNUSED(void *), Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { Ttk_Theme themePtr; diff --git a/generic/ttk/ttkTreeview.c b/generic/ttk/ttkTreeview.c index 543a10d..8e57e39 100644 --- a/generic/ttk/ttkTreeview.c +++ b/generic/ttk/ttkTreeview.c @@ -822,10 +822,10 @@ static int TreeviewInitColumns(Tcl_Interp *interp, Treeview *tv) InitColumn(tv->tree.columns + i); Tk_InitOptions( - interp, (ClientData)(tv->tree.columns + i), + interp, tv->tree.columns + i, tv->tree.columnOptionTable, tv->core.tkwin); Tk_InitOptions( - interp, (ClientData)(tv->tree.columns + i), + interp, tv->tree.columns + i, tv->tree.headingOptionTable, tv->core.tkwin); Tcl_IncrRefCount(columnName); tv->tree.columns[i].idObj = columnName; @@ -1294,10 +1294,10 @@ static void TreeviewInitialize(Tcl_Interp *interp, void *recordPtr) tv->tree.column0.idObj = Tcl_NewStringObj("#0", 2); Tcl_IncrRefCount(tv->tree.column0.idObj); Tk_InitOptions( - interp, (ClientData)(&tv->tree.column0), + interp, &tv->tree.column0, tv->tree.columnOptionTable, tv->core.tkwin); Tk_InitOptions( - interp, (ClientData)(&tv->tree.column0), + interp, &tv->tree.column0, tv->tree.headingOptionTable, tv->core.tkwin); Tcl_InitHashTable(&tv->tree.items, TCL_STRING_KEYS); @@ -1308,7 +1308,7 @@ static void TreeviewInitialize(Tcl_Interp *interp, void *recordPtr) /* Create root item "": */ tv->tree.root = NewItem(); - Tk_InitOptions(interp, (ClientData)tv->tree.root, + Tk_InitOptions(interp, tv->tree.root, tv->tree.itemOptionTable, tv->core.tkwin); tv->tree.root->tagset = Ttk_GetTagSetFromObj(NULL, tv->tree.tagTable, NULL); tv->tree.root->entryPtr = Tcl_CreateHashEntry(&tv->tree.items, "", &unused); @@ -1344,7 +1344,7 @@ static void TreeviewCleanup(void *recordPtr) TreeviewFreeColumns(tv); if (tv->tree.displayColumns) - ckfree((ClientData)tv->tree.displayColumns); + ckfree(tv->tree.displayColumns); foreachHashEntry(&tv->tree.items, FreeItemCB); Tcl_DeleteHashTable(&tv->tree.items); @@ -3169,7 +3169,7 @@ static int TreeviewInsertCommand( */ newItem = NewItem(); Tk_InitOptions( - interp, (ClientData)newItem, tv->tree.itemOptionTable, tv->core.tkwin); + interp, newItem, tv->tree.itemOptionTable, tv->core.tkwin); newItem->tagset = Ttk_GetTagSetFromObj(NULL, tv->tree.tagTable, NULL); if (ConfigureItem(interp, tv, newItem, objc, objv) != TCL_OK) { Tcl_DeleteHashEntry(entryPtr); diff --git a/generic/ttk/ttkWidget.h b/generic/ttk/ttkWidget.h index 4b6bd0f..dbe073e 100644 --- a/generic/ttk/ttkWidget.h +++ b/generic/ttk/ttkWidget.h @@ -109,7 +109,7 @@ MODULE_SCOPE int TtkWidgetConstructorObjCmd( #define RegisterWidget(interp, name, specPtr) \ Tcl_CreateObjCommand(interp, name, \ - TtkWidgetConstructorObjCmd, (ClientData)specPtr,NULL) + TtkWidgetConstructorObjCmd, (void *)specPtr,NULL) /* WIDGET_TAKEFOCUS_TRUE -- * WIDGET_TAKEFOCUS_FALSE -- diff --git a/macosx/tkMacOSXBitmap.c b/macosx/tkMacOSXBitmap.c index e26c5bb..abf0211 100644 --- a/macosx/tkMacOSXBitmap.c +++ b/macosx/tkMacOSXBitmap.c @@ -59,12 +59,12 @@ typedef struct { } IconBitmap; static const char *const iconBitmapOptionStrings[] = { - "-file", "-fileType", "-osType", "-systemType", "-namedImage", - "-imageFile", NULL + "-file", "-fileType", "-imageFile", "-namedImage", "-osType", + "-systemType", NULL }; enum iconBitmapOptions { - ICON_FILE, ICON_FILETYPE, ICON_OSTYPE, ICON_SYSTEMTYPE, ICON_NAMEDIMAGE, - ICON_IMAGEFILE, + ICON_FILE, ICON_FILETYPE, ICON_IMAGEFILE, ICON_NAMEDIMAGE, ICON_OSTYPE, + ICON_SYSTEMTYPE }; diff --git a/macosx/tkMacOSXDialog.c b/macosx/tkMacOSXDialog.c index 33d677a..03d3cf2 100644 --- a/macosx/tkMacOSXDialog.c +++ b/macosx/tkMacOSXDialog.c @@ -68,32 +68,32 @@ enum colorOptions { }; static const char *const openOptionStrings[] = { - "-defaultextension", "-filetypes", "-initialdir", "-initialfile", - "-message", "-multiple", "-parent", "-title", "-typevariable", - "-command", NULL + "-command", "-defaultextension", "-filetypes", "-initialdir", + "-initialfile", "-message", "-multiple", "-parent", "-title", + "-typevariable", NULL }; enum openOptions { - OPEN_DEFAULT, OPEN_FILETYPES, OPEN_INITDIR, OPEN_INITFILE, - OPEN_MESSAGE, OPEN_MULTIPLE, OPEN_PARENT, OPEN_TITLE, - OPEN_TYPEVARIABLE, OPEN_COMMAND, + OPEN_COMMAND, OPEN_DEFAULT, OPEN_FILETYPES, OPEN_INITDIR, + OPEN_INITFILE, OPEN_MESSAGE, OPEN_MULTIPLE, OPEN_PARENT, OPEN_TITLE, + OPEN_TYPEVARIABLE }; static const char *const saveOptionStrings[] = { - "-defaultextension", "-filetypes", "-initialdir", "-initialfile", - "-message", "-parent", "-title", "-typevariable", "-command", - "-confirmoverwrite", NULL + "-command", "-confirmoverwrite", "-defaultextension", "-filetypes", + "-initialdir", "-initialfile", "-message", "-parent", "-title", + "-typevariable", NULL }; enum saveOptions { - SAVE_DEFAULT, SAVE_FILETYPES, SAVE_INITDIR, SAVE_INITFILE, - SAVE_MESSAGE, SAVE_PARENT, SAVE_TITLE, SAVE_TYPEVARIABLE, SAVE_COMMAND, - SAVE_CONFIRMOW + SAVE_COMMAND, SAVE_CONFIRMOW, SAVE_DEFAULT, SAVE_FILETYPES, + SAVE_INITDIR, SAVE_INITFILE, SAVE_MESSAGE, SAVE_PARENT, SAVE_TITLE, + SAVE_TYPEVARIABLE }; static const char *const chooseOptionStrings[] = { - "-initialdir", "-message", "-mustexist", "-parent", "-title", "-command", + "-command", "-initialdir", "-message", "-mustexist", "-parent", "-title", NULL }; enum chooseOptions { - CHOOSE_INITDIR, CHOOSE_MESSAGE, CHOOSE_MUSTEXIST, CHOOSE_PARENT, - CHOOSE_TITLE, CHOOSE_COMMAND, + CHOOSE_COMMAND, CHOOSE_INITDIR, CHOOSE_MESSAGE, CHOOSE_MUSTEXIST, + CHOOSE_PARENT, CHOOSE_TITLE }; typedef struct { Tcl_Interp *interp; @@ -107,7 +107,7 @@ static const char *const alertOptionStrings[] = { }; enum alertOptions { ALERT_DEFAULT, ALERT_DETAIL, ALERT_ICON, ALERT_MESSAGE, ALERT_PARENT, - ALERT_TITLE, ALERT_TYPE, ALERT_COMMAND, + ALERT_TITLE, ALERT_TYPE, ALERT_COMMAND }; typedef struct { Tcl_Interp *interp; diff --git a/macosx/tkMacOSXNotify.c b/macosx/tkMacOSXNotify.c index bc30949..293e7ea 100644 --- a/macosx/tkMacOSXNotify.c +++ b/macosx/tkMacOSXNotify.c @@ -441,7 +441,7 @@ static Tcl_TimerToken ticker = NULL; static void Heartbeat( - TCL_UNUSED(ClientData)) + TCL_UNUSED(void *)) { if (ticker) { @@ -520,7 +520,7 @@ TkMacOSXEventsSetupProc( */ static void TkMacOSXEventsCheckProc( - TCL_UNUSED(ClientData), + TCL_UNUSED(void *), int flags) { NSString *runloopMode = [[NSRunLoop currentRunLoop] currentMode]; diff --git a/macosx/tkMacOSXPrint.c b/macosx/tkMacOSXPrint.c index 2a2aa86..fdb66aa 100644 --- a/macosx/tkMacOSXPrint.c +++ b/macosx/tkMacOSXPrint.c @@ -341,7 +341,7 @@ FinishPrint( int MacPrint_Init(Tcl_Interp * interp) { NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; - Tcl_CreateObjCommand(interp, "::tk::print::_print", StartPrint, (ClientData) NULL, (Tcl_CmdDeleteProc * ) NULL); + Tcl_CreateObjCommand(interp, "::tk::print::_print", StartPrint, NULL, NULL); [pool release]; return TCL_OK; } diff --git a/macosx/tkMacOSXTest.c b/macosx/tkMacOSXTest.c index 26d68d9..a8d770b 100644 --- a/macosx/tkMacOSXTest.c +++ b/macosx/tkMacOSXTest.c @@ -278,12 +278,12 @@ InjectKeyEventObjCmd( Tcl_Obj *const objv[]) { static const char *const optionStrings[] = { - "press", "release", "flagschanged", NULL}; - NSUInteger types[3] = {NSKeyDown, NSKeyUp, NSFlagsChanged}; + "flagschanged", "press", "release", NULL}; + NSUInteger types[3] = {NSFlagsChanged, NSKeyDown, NSKeyUp}; static const char *const argStrings[] = { - "-shift", "-control", "-option", "-command", "-function", "-x", "-y", NULL}; - enum args {KEYEVENT_SHIFT, KEYEVENT_CONTROL, KEYEVENT_OPTION, KEYEVENT_COMMAND, - KEYEVENT_FUNCTION, KEYEVENT_X, KEYEVENT_Y}; + "-command", "-control", "-function", "-option", "-shift", "-x", "-y", NULL}; + enum args {KEYEVENT_COMMAND, KEYEVENT_CONTROL, KEYEVENT_FUNCTION, KEYEVENT_OPTION, + KEYEVENT_SHIFT, KEYEVENT_X, KEYEVENT_Y}; int i, index, keysym, mods = 0, x = 0, y = 0; NSString *chars = nil, *unmod = nil, *upper, *lower; NSEvent *keyEvent; diff --git a/tests/choosedir.test b/tests/choosedir.test index 7e66756..5ddc2e7 100644 --- a/tests/choosedir.test +++ b/tests/choosedir.test @@ -102,7 +102,7 @@ test choosedir-1.5.1 {tk_chooseDirectory command} -constraints notAqua -body { } -returnCodes error -result {bad option "-foo": must be -initialdir, -mustexist, -parent, or -title} test choosedir-1.5.2 {tk_chooseDirectory command} -constraints aqua -body { tk_chooseDirectory -foo bar -} -returnCodes error -result {bad option "-foo": must be -initialdir, -message, -mustexist, -parent, -title, or -command} +} -returnCodes error -result {bad option "-foo": must be -command, -initialdir, -message, -mustexist, -parent, or -title} test choosedir-1.6 {tk_chooseDirectory command} -body { tk_chooseDirectory -parent foo.bar } -returnCodes error -result {bad window path name "foo.bar"} diff --git a/tests/entry.test b/tests/entry.test index cd26264..b7a5593 100644 --- a/tests/entry.test +++ b/tests/entry.test @@ -1115,7 +1115,7 @@ test entry-3.44 {EntryWidgetCmd procedure, "scan" widget command} -setup { .e scan foobar 20 } -cleanup { destroy .e -} -returnCodes error -result {bad scan option "foobar": must be mark or dragto} +} -returnCodes error -result {bad scan option "foobar": must be dragto or mark} test entry-3.45 {EntryWidgetCmd procedure, "scan" widget command} -setup { entry .e pack .e ; update idletasks diff --git a/tests/filebox.test b/tests/filebox.test index cdf3224..f46c906 100644 --- a/tests/filebox.test +++ b/tests/filebox.test @@ -110,9 +110,9 @@ if {$tcl_platform(platform) == "unix"} { } set unknownOptionsMsg(tk_getOpenFile,notAqua) {bad option "-foo": must be -defaultextension, -filetypes, -initialdir, -initialfile, -multiple, -parent, -title, or -typevariable} -set unknownOptionsMsg(tk_getOpenFile,aqua) {bad option "-foo": must be -defaultextension, -filetypes, -initialdir, -initialfile, -message, -multiple, -parent, -title, -typevariable, or -command} +set unknownOptionsMsg(tk_getOpenFile,aqua) {bad option "-foo": must be -command, -defaultextension, -filetypes, -initialdir, -initialfile, -message, -multiple, -parent, -title, or -typevariable} set unknownOptionsMsg(tk_getSaveFile,notAqua) {bad option "-foo": must be -confirmoverwrite, -defaultextension, -filetypes, -initialdir, -initialfile, -parent, -title, or -typevariable} -set unknownOptionsMsg(tk_getSaveFile,aqua) {bad option "-foo": must be -defaultextension, -filetypes, -initialdir, -initialfile, -message, -parent, -title, -typevariable, -command, or -confirmoverwrite} +set unknownOptionsMsg(tk_getSaveFile,aqua) {bad option "-foo": must be -command, -confirmoverwrite, -defaultextension, -filetypes, -initialdir, -initialfile, -message, -parent, -title, or -typevariable} set tmpFile "filebox.tmp" makeFile { diff --git a/tests/font.test b/tests/font.test index dca3106..b4071d9 100644 --- a/tests/font.test +++ b/tests/font.test @@ -440,7 +440,7 @@ test font-10.4 {font command: metrics: arguments} -body { test font-10.5 {font command: metrics: arguments} -body { # (objc - skip) > 4) when skip == 2 font metrics xyz -displayof . abc -} -returnCodes error -result {bad metric "abc": must be -ascent, -descent, -linespace, or -fixed} +} -returnCodes error -result {bad metric "abc": must be -ascent, -descent, -fixed, or -linespace} test font-10.6 {font command: metrics: bad font} -constraints noExceed -body { # (tkfont == NULL) font metrics "\{xyz" @@ -457,7 +457,7 @@ test font-10.7 {font command: metrics: get all metrics} -setup { test font-10.8 {font command: metrics: bad metric} -body { # (Tcl_GetIndexFromObj() != TCL_OK) font metrics $fixed -xyz -} -returnCodes error -result {bad metric "-xyz": must be -ascent, -descent, -linespace, or -fixed} +} -returnCodes error -result {bad metric "-xyz": must be -ascent, -descent, -fixed, or -linespace} test font-10.9 {font command: metrics: get individual metrics} -body { font metrics $fixed -ascent font metrics $fixed -descent diff --git a/tests/listbox.test b/tests/listbox.test index f5418da..6b32297 100644 --- a/tests/listbox.test +++ b/tests/listbox.test @@ -816,7 +816,7 @@ test listbox-3.78 {ListboxWidgetCmd procedure, "scan" option} -constraints { } -result {{0.249364 0.427481} {0.0714286 0.428571}} test listbox-3.79 {ListboxWidgetCmd procedure, "scan" option} -body { .l scan foo 2 4 -} -returnCodes error -result {bad option "foo": must be mark or dragto} +} -returnCodes error -result {bad option "foo": must be dragto or mark} test listbox-3.80 {ListboxWidgetCmd procedure, "see" option} -body { .l see } -returnCodes error -result {wrong # args: should be ".l see index"} diff --git a/tests/menu.test b/tests/menu.test index 85746b8..c18a274 100644 --- a/tests/menu.test +++ b/tests/menu.test @@ -3305,7 +3305,7 @@ test menu-20.5 {CloneMenu} -setup { } -body { menu .m1 .m1 clone .m2 foo -} -returnCodes error -result {bad menu type "foo": must be normal, tearoff, or menubar} +} -returnCodes error -result {bad menu type "foo": must be menubar, normal, or tearoff} test menu-20.6 {CloneMenu - hooking up bookeeping ptrs} -setup { deleteWindows } -body { @@ -4002,7 +4002,7 @@ test menu-39.1 {empty -type - bug be8f5b9fc2} -setup { menu .m -type {} } -cleanup { destroy .m -} -returnCodes error -result {ambiguous type "": must be normal, tearoff, or menubar} +} -returnCodes error -result {ambiguous type "": must be menubar, normal, or tearoff} # cleanup diff --git a/tests/pack.test b/tests/pack.test index a17de62..f85369d 100644 --- a/tests/pack.test +++ b/tests/pack.test @@ -1263,7 +1263,7 @@ test pack-12.29 {command options and errors} -setup { pack forget .pack.a .pack.b .pack.c .pack.d } -body { pack .pack.a -side bac -} -returnCodes error -result {bad side "bac": must be top, bottom, left, or right} +} -returnCodes error -result {bad side "bac": must be bottom, left, right, or top} test pack-12.30 {command options and errors} -setup { pack forget .pack.a .pack.b .pack.c .pack.d } -body { diff --git a/tests/place.test b/tests/place.test index 49edeb0..af54043 100644 --- a/tests/place.test +++ b/tests/place.test @@ -416,7 +416,7 @@ test place-10.3 {ConfigureContent} -setup { place .foo -bordermode j } -cleanup { destroy .foo -} -returnCodes error -result {bad bordermode "j": must be inside, outside, or ignore} +} -returnCodes error -result {bad bordermode "j": must be inside, ignore, or outside} test place-10.4 {ConfigureContent} -setup { destroy .foo } -body { diff --git a/tests/spinbox.test b/tests/spinbox.test index c73e31e..cf92877 100644 --- a/tests/spinbox.test +++ b/tests/spinbox.test @@ -1452,7 +1452,7 @@ test spinbox-3.44 {SpinboxWidgetCmd procedure, "scan" widget command} -setup { .e scan foobar 20 } -cleanup { destroy .e -} -returnCodes error -result {bad scan option "foobar": must be mark or dragto} +} -returnCodes error -result {bad scan option "foobar": must be dragto or mark} test spinbox-3.45 {SpinboxWidgetCmd procedure, "scan" widget command} -setup { spinbox .e pack .e diff --git a/tests/textDisp.test b/tests/textDisp.test index da8c1d2..df72060 100644 --- a/tests/textDisp.test +++ b/tests/textDisp.test @@ -2371,7 +2371,7 @@ test textDisp-17.4 {TkTextScanCmd procedure} { } {1 {expected integer but got "bogus"}} test textDisp-17.5 {TkTextScanCmd procedure} { list [catch {.t scan stupid 123 456} msg] $msg -} {1 {bad scan option "stupid": must be mark or dragto}} +} {1 {bad scan option "stupid": must be dragto or mark}} test textDisp-17.6 {TkTextScanCmd procedure} {textfonts} { .t yview 1.0 .t xview moveto 0 diff --git a/win/tkWinGDI.c b/win/tkWinGDI.c index 9daca0f..1c29770 100644 --- a/win/tkWinGDI.c +++ b/win/tkWinGDI.c @@ -3538,13 +3538,13 @@ int Winprint_Init( */ namespacePtr = Tcl_CreateNamespace(interp, gdiName, - (ClientData) NULL, (Tcl_NamespaceDeleteProc *) NULL); + NULL, (Tcl_NamespaceDeleteProc *) NULL); for (i=0; i