From 2469ec79a7eedc59f089fe069bb239daaf988a82 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 5 May 2022 15:10:37 +0000 Subject: Code cleanup, mainly eliminating unnecessary type-casts --- generic/tkButton.c | 10 +-- generic/tkConfig.c | 180 ++++++++++++++++++++++--------------------- generic/tkMenu.c | 12 +-- generic/tkMenubutton.c | 22 +++--- generic/tkPanedWindow.c | 106 ++++++++++++------------- generic/ttk/ttkButton.c | 6 +- generic/ttk/ttkEntry.c | 2 +- generic/ttk/ttkNotebook.c | 4 +- generic/ttk/ttkPanedwindow.c | 2 +- generic/ttk/ttkProgress.c | 4 +- generic/ttk/ttkScale.c | 4 +- generic/ttk/ttkScrollbar.c | 2 +- generic/ttk/ttkSeparator.c | 2 +- generic/ttk/ttkTreeview.c | 2 +- 14 files changed, 180 insertions(+), 178 deletions(-) diff --git a/generic/tkButton.c b/generic/tkButton.c index 78bb5e1..515c848 100644 --- a/generic/tkButton.c +++ b/generic/tkButton.c @@ -271,8 +271,8 @@ static const Tk_OptionSpec checkbuttonOptionSpecs[] = { DEF_BUTTON_COMMAND, Tk_Offset(TkButton, commandPtr), -1, TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING_TABLE, "-compound", "compound", "Compound", - DEF_BUTTON_COMPOUND, -1, Tk_Offset(TkButton, compound), 0, - tkCompoundStrings, 0}, + DEF_BUTTON_COMPOUND, -1, Tk_Offset(TkButton, compound), + 0, tkCompoundStrings, 0}, {TK_OPTION_CURSOR, "-cursor", "cursor", "Cursor", DEF_BUTTON_CURSOR, -1, Tk_Offset(TkButton, cursor), TK_OPTION_NULL_OK, 0, 0}, @@ -307,14 +307,14 @@ static const Tk_OptionSpec checkbuttonOptionSpecs[] = { {TK_OPTION_JUSTIFY, "-justify", "justify", "Justify", DEF_BUTTON_JUSTIFY, -1, Tk_Offset(TkButton, justify), 0, 0, 0}, {TK_OPTION_RELIEF, "-offrelief", "offRelief", "OffRelief", - DEF_BUTTON_RELIEF, -1, Tk_Offset(TkButton, offRelief), 0, 0, 0}, + DEF_BUTTON_RELIEF, -1, Tk_Offset(TkButton, offRelief), 0, 0, 0}, {TK_OPTION_STRING, "-offvalue", "offValue", "Value", DEF_BUTTON_OFF_VALUE, Tk_Offset(TkButton, offValuePtr), -1, 0, 0, 0}, {TK_OPTION_STRING, "-onvalue", "onValue", "Value", DEF_BUTTON_ON_VALUE, Tk_Offset(TkButton, onValuePtr), -1, 0, 0, 0}, {TK_OPTION_RELIEF, "-overrelief", "overRelief", "OverRelief", - DEF_BUTTON_OVER_RELIEF, -1, Tk_Offset(TkButton, overRelief), - TK_OPTION_NULL_OK, 0, 0}, + DEF_BUTTON_OVER_RELIEF, -1, Tk_Offset(TkButton, overRelief), + TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_PIXELS, "-padx", "padX", "Pad", tkDefLabelPadx, Tk_Offset(TkButton, padXPtr), Tk_Offset(TkButton, padX), 0, 0, 0}, diff --git a/generic/tkConfig.c b/generic/tkConfig.c index 5639de4..37495d1 100644 --- a/generic/tkConfig.c +++ b/generic/tkConfig.c @@ -1863,110 +1863,112 @@ GetObjectForOption( * *recordPtr. */ Tk_Window tkwin) /* Window corresponding to recordPtr. */ { - Tcl_Obj *objPtr; - char *internalPtr; /* Points to internal value of option in - * record. */ - - internalPtr = recordPtr + optionPtr->specPtr->internalOffset; - objPtr = NULL; - switch (optionPtr->specPtr->type) { - case TK_OPTION_BOOLEAN: - objPtr = Tcl_NewIntObj(*((int *)internalPtr)); - break; - case TK_OPTION_INT: - objPtr = Tcl_NewIntObj(*((int *)internalPtr)); - break; - case TK_OPTION_DOUBLE: - objPtr = Tcl_NewDoubleObj(*((double *)internalPtr)); - break; - case TK_OPTION_STRING: - objPtr = Tcl_NewStringObj(*((char **)internalPtr), -1); - break; - case TK_OPTION_STRING_TABLE: - objPtr = Tcl_NewStringObj(((char **) optionPtr->specPtr->clientData)[ - *((int *) internalPtr)], -1); - break; - case TK_OPTION_COLOR: { - XColor *colorPtr = *((XColor **)internalPtr); + Tcl_Obj *objPtr = NULL; + char *internalPtr; /* Points to internal value of option in record. */ + + if (optionPtr->specPtr->internalOffset >= 0) { + internalPtr = recordPtr + optionPtr->specPtr->internalOffset; + switch (optionPtr->specPtr->type) { + case TK_OPTION_BOOLEAN: + objPtr = Tcl_NewIntObj(*((int *)internalPtr)); + break; + case TK_OPTION_INT: + objPtr = Tcl_NewIntObj(*((int *)internalPtr)); + break; + case TK_OPTION_DOUBLE: + objPtr = Tcl_NewDoubleObj(*((double *)internalPtr)); + break; + case TK_OPTION_STRING: + objPtr = Tcl_NewStringObj(*((char **)internalPtr), -1); + break; + case TK_OPTION_STRING_TABLE: + if (*((int *) internalPtr) >= 0) { + objPtr = Tcl_NewStringObj(((char **) optionPtr->specPtr->clientData)[ + *((int *) internalPtr)], -1); + } + break; + case TK_OPTION_COLOR: { + XColor *colorPtr = *((XColor **)internalPtr); - if (colorPtr != NULL) { - objPtr = Tcl_NewStringObj(Tk_NameOfColor(colorPtr), -1); + if (colorPtr != NULL) { + objPtr = Tcl_NewStringObj(Tk_NameOfColor(colorPtr), -1); + } + break; } - break; - } - case TK_OPTION_FONT: { - Tk_Font tkfont = *((Tk_Font *)internalPtr); + case TK_OPTION_FONT: { + Tk_Font tkfont = *((Tk_Font *)internalPtr); - if (tkfont != NULL) { - objPtr = Tcl_NewStringObj(Tk_NameOfFont(tkfont), -1); + if (tkfont != NULL) { + objPtr = Tcl_NewStringObj(Tk_NameOfFont(tkfont), -1); + } + break; } - break; - } - case TK_OPTION_STYLE: { - Tk_Style style = *((Tk_Style *)internalPtr); + case TK_OPTION_STYLE: { + Tk_Style style = *((Tk_Style *)internalPtr); - if (style != NULL) { - objPtr = Tcl_NewStringObj(Tk_NameOfStyle(style), -1); + if (style != NULL) { + objPtr = Tcl_NewStringObj(Tk_NameOfStyle(style), -1); + } + break; } - break; - } - case TK_OPTION_BITMAP: { - Pixmap pixmap = *((Pixmap *)internalPtr); + case TK_OPTION_BITMAP: { + Pixmap pixmap = *((Pixmap *)internalPtr); - if (pixmap != None) { - objPtr = Tcl_NewStringObj( - Tk_NameOfBitmap(Tk_Display(tkwin), pixmap), -1); + if (pixmap != None) { + objPtr = Tcl_NewStringObj( + Tk_NameOfBitmap(Tk_Display(tkwin), pixmap), -1); + } + break; } - break; - } - case TK_OPTION_BORDER: { - Tk_3DBorder border = *((Tk_3DBorder *)internalPtr); + case TK_OPTION_BORDER: { + Tk_3DBorder border = *((Tk_3DBorder *)internalPtr); - if (border != NULL) { - objPtr = Tcl_NewStringObj(Tk_NameOf3DBorder(border), -1); + if (border != NULL) { + objPtr = Tcl_NewStringObj(Tk_NameOf3DBorder(border), -1); + } + break; } - break; - } - case TK_OPTION_RELIEF: - objPtr = Tcl_NewStringObj(Tk_NameOfRelief(*((int *)internalPtr)), -1); - break; - case TK_OPTION_CURSOR: { - Tk_Cursor cursor = *((Tk_Cursor *)internalPtr); + case TK_OPTION_RELIEF: + objPtr = Tcl_NewStringObj(Tk_NameOfRelief(*((int *)internalPtr)), -1); + break; + case TK_OPTION_CURSOR: { + Tk_Cursor cursor = *((Tk_Cursor *)internalPtr); - if (cursor != NULL) { - objPtr = Tcl_NewStringObj( - Tk_NameOfCursor(Tk_Display(tkwin), cursor), -1); + if (cursor != NULL) { + objPtr = Tcl_NewStringObj( + Tk_NameOfCursor(Tk_Display(tkwin), cursor), -1); + } + break; } - break; - } - case TK_OPTION_JUSTIFY: - objPtr = Tcl_NewStringObj(Tk_NameOfJustify( - *((Tk_Justify *)internalPtr)), -1); - break; - case TK_OPTION_ANCHOR: - objPtr = Tcl_NewStringObj(Tk_NameOfAnchor( - *((Tk_Anchor *) internalPtr)), -1); - break; - case TK_OPTION_PIXELS: - objPtr = Tcl_NewIntObj(*((int *)internalPtr)); - break; - case TK_OPTION_WINDOW: { - tkwin = *((Tk_Window *)internalPtr); + case TK_OPTION_JUSTIFY: + objPtr = Tcl_NewStringObj(Tk_NameOfJustify( + *((Tk_Justify *)internalPtr)), -1); + break; + case TK_OPTION_ANCHOR: + objPtr = Tcl_NewStringObj(Tk_NameOfAnchor( + *((Tk_Anchor *)internalPtr)), -1); + break; + case TK_OPTION_PIXELS: + objPtr = Tcl_NewIntObj(*((int *)internalPtr)); + break; + case TK_OPTION_WINDOW: { + tkwin = *((Tk_Window *)internalPtr); - if (tkwin != NULL) { - objPtr = Tcl_NewStringObj(Tk_PathName(tkwin), -1); + if (tkwin != NULL) { + objPtr = Tcl_NewStringObj(Tk_PathName(tkwin), -1); + } + break; } - break; - } - case TK_OPTION_CUSTOM: { - const Tk_ObjCustomOption *custom = optionPtr->extra.custom; + case TK_OPTION_CUSTOM: { + const Tk_ObjCustomOption *custom = optionPtr->extra.custom; - objPtr = custom->getProc(custom->clientData, tkwin, recordPtr, - optionPtr->specPtr->internalOffset); - break; - } - default: - Tcl_Panic("bad option type in GetObjectForOption"); + objPtr = custom->getProc(custom->clientData, tkwin, recordPtr, + optionPtr->specPtr->internalOffset); + break; + } + default: + Tcl_Panic("bad option type in GetObjectForOption"); + } } if (objPtr == NULL) { objPtr = Tcl_NewObj(); diff --git a/generic/tkMenu.c b/generic/tkMenu.c index f11505d..2c82f7d 100644 --- a/generic/tkMenu.c +++ b/generic/tkMenu.c @@ -149,8 +149,8 @@ static const Tk_OptionSpec tkBasicMenuEntryConfigSpecs[] = { Tk_Offset(TkMenuEntry, labelPtr), -1, 0, NULL, 0}, {TK_OPTION_STRING_TABLE, "-state", NULL, NULL, DEF_MENU_ENTRY_STATE, - -1, Tk_Offset(TkMenuEntry, state), 0, - (ClientData) menuStateStrings, 0}, + -1, Tk_Offset(TkMenuEntry, state), + 0, menuStateStrings, 0}, {TK_OPTION_INT, "-underline", NULL, NULL, DEF_MENU_ENTRY_UNDERLINE, -1, Tk_Offset(TkMenuEntry, underline), 0, NULL, 0}, {TK_OPTION_END, NULL, NULL, NULL, 0, 0, 0, 0, NULL, 0} @@ -219,8 +219,8 @@ static const Tk_OptionSpec tkTearoffEntryConfigSpecs[] = { DEF_MENU_ENTRY_BG, Tk_Offset(TkMenuEntry, borderPtr), -1, TK_OPTION_NULL_OK, NULL, 0}, {TK_OPTION_STRING_TABLE, "-state", NULL, NULL, - DEF_MENU_ENTRY_STATE, -1, Tk_Offset(TkMenuEntry, state), 0, - (ClientData) menuStateStrings, 0}, + DEF_MENU_ENTRY_STATE, -1, Tk_Offset(TkMenuEntry, state), + 0, menuStateStrings, 0}, {TK_OPTION_END, NULL, NULL, NULL, 0, 0, 0, 0, NULL, 0} }; @@ -293,8 +293,8 @@ static const Tk_OptionSpec tkMenuConfigSpecs[] = { DEF_MENU_TITLE, Tk_Offset(TkMenu, titlePtr), -1, TK_OPTION_NULL_OK, NULL, 0}, {TK_OPTION_STRING_TABLE, "-type", "type", "Type", - DEF_MENU_TYPE, Tk_Offset(TkMenu, menuTypePtr), -1, 0, - (ClientData) menuTypeStrings, 0}, + DEF_MENU_TYPE, Tk_Offset(TkMenu, menuTypePtr), -1, + 0, menuTypeStrings, 0}, {TK_OPTION_END, NULL, NULL, NULL, 0, 0, 0, 0, NULL, 0} }; diff --git a/generic/tkMenubutton.c b/generic/tkMenubutton.c index 091fe09..d05c246 100644 --- a/generic/tkMenubutton.c +++ b/generic/tkMenubutton.c @@ -47,18 +47,18 @@ static const Tk_OptionSpec optionSpecs[] = { (ClientData) DEF_MENUBUTTON_ACTIVE_BG_MONO, 0}, {TK_OPTION_COLOR, "-activeforeground", "activeForeground", "Background", DEF_MENUBUTTON_ACTIVE_FG_COLOR, -1, - Tk_Offset(TkMenuButton, activeFg), - 0, DEF_MENUBUTTON_ACTIVE_FG_MONO, 0}, + Tk_Offset(TkMenuButton, activeFg), + 0, DEF_MENUBUTTON_ACTIVE_FG_MONO, 0}, {TK_OPTION_ANCHOR, "-anchor", "anchor", "Anchor", DEF_MENUBUTTON_ANCHOR, -1, Tk_Offset(TkMenuButton, anchor), 0, 0, 0}, {TK_OPTION_BORDER, "-background", "background", "Background", DEF_MENUBUTTON_BG_COLOR, -1, Tk_Offset(TkMenuButton, normalBorder), 0, DEF_MENUBUTTON_BG_MONO, 0}, - {TK_OPTION_SYNONYM, "-bd", NULL, NULL, NULL, 0, -1, 0, - (ClientData) "-borderwidth", 0}, - {TK_OPTION_SYNONYM, "-bg", NULL, NULL, NULL, 0, -1, 0, - (ClientData) "-background", 0}, + {TK_OPTION_SYNONYM, "-bd", NULL, NULL, NULL, 0, -1, + 0, "-borderwidth", 0}, + {TK_OPTION_SYNONYM, "-bg", NULL, NULL, NULL, 0, -1, + 0, "-background", 0}, {TK_OPTION_BITMAP, "-bitmap", "bitmap", "Bitmap", DEF_MENUBUTTON_BITMAP, -1, Tk_Offset(TkMenuButton, bitmap), TK_OPTION_NULL_OK, 0, 0}, @@ -75,8 +75,8 @@ static const Tk_OptionSpec optionSpecs[] = { "DisabledForeground", DEF_MENUBUTTON_DISABLED_FG_COLOR, -1, Tk_Offset(TkMenuButton, disabledFg), TK_OPTION_NULL_OK, (ClientData) DEF_MENUBUTTON_DISABLED_FG_MONO, 0}, - {TK_OPTION_SYNONYM, "-fg", "foreground", NULL, NULL, 0, -1, 0, - (ClientData) "-foreground", 0}, + {TK_OPTION_SYNONYM, "-fg", "foreground", NULL, NULL, 0, -1, + 0, "-foreground", 0}, {TK_OPTION_FONT, "-font", "font", "Font", DEF_MENUBUTTON_FONT, -1, Tk_Offset(TkMenuButton, tkfont), 0, 0, 0}, {TK_OPTION_COLOR, "-foreground", "foreground", "Foreground", @@ -114,8 +114,8 @@ static const Tk_OptionSpec optionSpecs[] = { DEF_MENUBUTTON_RELIEF, -1, Tk_Offset(TkMenuButton, relief), 0, 0, 0}, {TK_OPTION_STRING_TABLE, "-compound", "compound", "Compound", - DEF_BUTTON_COMPOUND, -1, Tk_Offset(TkMenuButton, compound), 0, - tkCompoundStrings, 0}, + DEF_BUTTON_COMPOUND, -1, Tk_Offset(TkMenuButton, compound), + 0, tkCompoundStrings, 0}, {TK_OPTION_STRING_TABLE, "-state", "state", "State", DEF_MENUBUTTON_STATE, -1, Tk_Offset(TkMenuButton, state), 0, tkStateStrings, 0}, @@ -129,7 +129,7 @@ static const Tk_OptionSpec optionSpecs[] = { Tk_Offset(TkMenuButton, textVarName), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_INT, "-underline", "underline", "Underline", DEF_MENUBUTTON_UNDERLINE, -1, Tk_Offset(TkMenuButton, underline), - 0, 0, 0}, + 0, 0, 0}, {TK_OPTION_STRING, "-width", "width", "Width", DEF_MENUBUTTON_WIDTH, -1, Tk_Offset(TkMenuButton, widthString), 0, 0, 0}, diff --git a/generic/tkPanedWindow.c b/generic/tkPanedWindow.c index 06a42d4..89a18f9 100644 --- a/generic/tkPanedWindow.c +++ b/generic/tkPanedWindow.c @@ -275,92 +275,92 @@ static const Tk_ObjCustomOption stickyOption = { static const Tk_OptionSpec optionSpecs[] = { {TK_OPTION_BORDER, "-background", "background", "Background", - DEF_PANEDWINDOW_BG_COLOR, -1, Tk_Offset(PanedWindow, background), 0, - DEF_PANEDWINDOW_BG_MONO, 0}, + DEF_PANEDWINDOW_BG_COLOR, -1, Tk_Offset(PanedWindow, background), 0, + DEF_PANEDWINDOW_BG_MONO, 0}, {TK_OPTION_SYNONYM, "-bd", NULL, NULL, - NULL, 0, -1, 0, "-borderwidth", 0}, + NULL, 0, -1, 0, "-borderwidth", 0}, {TK_OPTION_SYNONYM, "-bg", NULL, NULL, - NULL, 0, -1, 0, "-background", 0}, + NULL, 0, -1, 0, "-background", 0}, {TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth", - DEF_PANEDWINDOW_BORDERWIDTH, -1, Tk_Offset(PanedWindow, borderWidth), - 0, 0, GEOMETRY}, + DEF_PANEDWINDOW_BORDERWIDTH, -1, Tk_Offset(PanedWindow, borderWidth), + 0, 0, GEOMETRY}, {TK_OPTION_CURSOR, "-cursor", "cursor", "Cursor", - DEF_PANEDWINDOW_CURSOR, -1, Tk_Offset(PanedWindow, cursor), - TK_OPTION_NULL_OK, 0, 0}, + DEF_PANEDWINDOW_CURSOR, -1, Tk_Offset(PanedWindow, cursor), + TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_PIXELS, "-handlepad", "handlePad", "HandlePad", - DEF_PANEDWINDOW_HANDLEPAD, -1, Tk_Offset(PanedWindow, handlePad), - 0, 0, GEOMETRY}, + DEF_PANEDWINDOW_HANDLEPAD, -1, Tk_Offset(PanedWindow, handlePad), + 0, 0, GEOMETRY}, {TK_OPTION_PIXELS, "-handlesize", "handleSize", "HandleSize", - DEF_PANEDWINDOW_HANDLESIZE, Tk_Offset(PanedWindow, handleSizePtr), - Tk_Offset(PanedWindow, handleSize), 0, 0, GEOMETRY}, + DEF_PANEDWINDOW_HANDLESIZE, Tk_Offset(PanedWindow, handleSizePtr), + Tk_Offset(PanedWindow, handleSize), 0, 0, GEOMETRY}, {TK_OPTION_PIXELS, "-height", "height", "Height", - DEF_PANEDWINDOW_HEIGHT, Tk_Offset(PanedWindow, heightPtr), - Tk_Offset(PanedWindow, height), TK_OPTION_NULL_OK, 0, GEOMETRY}, + DEF_PANEDWINDOW_HEIGHT, Tk_Offset(PanedWindow, heightPtr), + Tk_Offset(PanedWindow, height), TK_OPTION_NULL_OK, 0, GEOMETRY}, {TK_OPTION_BOOLEAN, "-opaqueresize", "opaqueResize", "OpaqueResize", - DEF_PANEDWINDOW_OPAQUERESIZE, -1, - Tk_Offset(PanedWindow, resizeOpaque), 0, 0, 0}, + DEF_PANEDWINDOW_OPAQUERESIZE, -1, + Tk_Offset(PanedWindow, resizeOpaque), 0, 0, 0}, {TK_OPTION_STRING_TABLE, "-orient", "orient", "Orient", - DEF_PANEDWINDOW_ORIENT, -1, Tk_Offset(PanedWindow, orient), - 0, orientStrings, GEOMETRY}, + DEF_PANEDWINDOW_ORIENT, -1, Tk_Offset(PanedWindow, orient), + 0, orientStrings, GEOMETRY}, {TK_OPTION_BORDER, "-proxybackground", "proxyBackground", "ProxyBackground", - 0, -1, Tk_Offset(PanedWindow, proxyBackground), TK_OPTION_NULL_OK, - (ClientData) DEF_PANEDWINDOW_BG_MONO, 0}, + 0, -1, Tk_Offset(PanedWindow, proxyBackground), + TK_OPTION_NULL_OK, (ClientData) DEF_PANEDWINDOW_BG_MONO, 0}, {TK_OPTION_PIXELS, "-proxyborderwidth", "proxyBorderWidth", "ProxyBorderWidth", - DEF_PANEDWINDOW_PROXYBORDER, Tk_Offset(PanedWindow, proxyBorderWidthPtr), - Tk_Offset(PanedWindow, proxyBorderWidth), 0, 0, GEOMETRY}, + DEF_PANEDWINDOW_PROXYBORDER, Tk_Offset(PanedWindow, proxyBorderWidthPtr), + Tk_Offset(PanedWindow, proxyBorderWidth), 0, 0, GEOMETRY}, {TK_OPTION_RELIEF, "-proxyrelief", "proxyRelief", "Relief", - 0, -1, Tk_Offset(PanedWindow, proxyRelief), - TK_OPTION_NULL_OK, 0, 0}, + 0, -1, Tk_Offset(PanedWindow, proxyRelief), + TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_RELIEF, "-relief", "relief", "Relief", - DEF_PANEDWINDOW_RELIEF, -1, Tk_Offset(PanedWindow, relief), 0, 0, 0}, + DEF_PANEDWINDOW_RELIEF, -1, Tk_Offset(PanedWindow, relief), 0, 0, 0}, {TK_OPTION_CURSOR, "-sashcursor", "sashCursor", "Cursor", - DEF_PANEDWINDOW_SASHCURSOR, -1, Tk_Offset(PanedWindow, sashCursor), - TK_OPTION_NULL_OK, 0, 0}, + DEF_PANEDWINDOW_SASHCURSOR, -1, Tk_Offset(PanedWindow, sashCursor), + TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_PIXELS, "-sashpad", "sashPad", "SashPad", - DEF_PANEDWINDOW_SASHPAD, -1, Tk_Offset(PanedWindow, sashPad), - 0, 0, GEOMETRY}, + DEF_PANEDWINDOW_SASHPAD, -1, Tk_Offset(PanedWindow, sashPad), + 0, 0, GEOMETRY}, {TK_OPTION_RELIEF, "-sashrelief", "sashRelief", "Relief", - DEF_PANEDWINDOW_SASHRELIEF, -1, Tk_Offset(PanedWindow, sashRelief), - 0, 0, 0}, + DEF_PANEDWINDOW_SASHRELIEF, -1, Tk_Offset(PanedWindow, sashRelief), + 0, 0, 0}, {TK_OPTION_PIXELS, "-sashwidth", "sashWidth", "Width", - DEF_PANEDWINDOW_SASHWIDTH, Tk_Offset(PanedWindow, sashWidthPtr), - Tk_Offset(PanedWindow, sashWidth), 0, 0, GEOMETRY}, + DEF_PANEDWINDOW_SASHWIDTH, Tk_Offset(PanedWindow, sashWidthPtr), + Tk_Offset(PanedWindow, sashWidth), 0, 0, GEOMETRY}, {TK_OPTION_BOOLEAN, "-showhandle", "showHandle", "ShowHandle", - DEF_PANEDWINDOW_SHOWHANDLE, -1, Tk_Offset(PanedWindow, showHandle), - 0, 0, GEOMETRY}, + DEF_PANEDWINDOW_SHOWHANDLE, -1, Tk_Offset(PanedWindow, showHandle), + 0, 0, GEOMETRY}, {TK_OPTION_PIXELS, "-width", "width", "Width", - DEF_PANEDWINDOW_WIDTH, Tk_Offset(PanedWindow, widthPtr), - Tk_Offset(PanedWindow, width), TK_OPTION_NULL_OK, 0, GEOMETRY}, + DEF_PANEDWINDOW_WIDTH, Tk_Offset(PanedWindow, widthPtr), + Tk_Offset(PanedWindow, width), TK_OPTION_NULL_OK, 0, GEOMETRY}, {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, 0, 0, 0, 0} }; static const Tk_OptionSpec paneOptionSpecs[] = { {TK_OPTION_WINDOW, "-after", NULL, NULL, - DEF_PANEDWINDOW_PANE_AFTER, -1, Tk_Offset(Pane, after), - TK_OPTION_NULL_OK, 0, 0}, + DEF_PANEDWINDOW_PANE_AFTER, -1, Tk_Offset(Pane, after), + TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_WINDOW, "-before", NULL, NULL, - DEF_PANEDWINDOW_PANE_BEFORE, -1, Tk_Offset(Pane, before), - TK_OPTION_NULL_OK, 0, 0}, + DEF_PANEDWINDOW_PANE_BEFORE, -1, Tk_Offset(Pane, before), + TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_PIXELS, "-height", NULL, NULL, - DEF_PANEDWINDOW_PANE_HEIGHT, Tk_Offset(Pane, heightPtr), - Tk_Offset(Pane, height), TK_OPTION_NULL_OK, 0, 0}, + DEF_PANEDWINDOW_PANE_HEIGHT, Tk_Offset(Pane, heightPtr), + Tk_Offset(Pane, height), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_BOOLEAN, "-hide", "hide", "Hide", - DEF_PANEDWINDOW_PANE_HIDE, -1, Tk_Offset(Pane, hide), 0,0,GEOMETRY}, + DEF_PANEDWINDOW_PANE_HIDE, -1, Tk_Offset(Pane, hide), 0,0,GEOMETRY}, {TK_OPTION_PIXELS, "-minsize", NULL, NULL, - DEF_PANEDWINDOW_PANE_MINSIZE, -1, Tk_Offset(Pane, minSize), 0, 0, 0}, + DEF_PANEDWINDOW_PANE_MINSIZE, -1, Tk_Offset(Pane, minSize), 0, 0, 0}, {TK_OPTION_PIXELS, "-padx", NULL, NULL, - DEF_PANEDWINDOW_PANE_PADX, -1, Tk_Offset(Pane, padx), 0, 0, 0}, + DEF_PANEDWINDOW_PANE_PADX, -1, Tk_Offset(Pane, padx), 0, 0, 0}, {TK_OPTION_PIXELS, "-pady", NULL, NULL, - DEF_PANEDWINDOW_PANE_PADY, -1, Tk_Offset(Pane, pady), 0, 0, 0}, + DEF_PANEDWINDOW_PANE_PADY, -1, Tk_Offset(Pane, pady), 0, 0, 0}, {TK_OPTION_CUSTOM, "-sticky", NULL, NULL, - DEF_PANEDWINDOW_PANE_STICKY, -1, Tk_Offset(Pane, sticky), 0, - &stickyOption, 0}, + DEF_PANEDWINDOW_PANE_STICKY, -1, Tk_Offset(Pane, sticky), + 0, &stickyOption, 0}, {TK_OPTION_STRING_TABLE, "-stretch", "stretch", "Stretch", - DEF_PANEDWINDOW_PANE_STRETCH, -1, Tk_Offset(Pane, stretch), 0, - (ClientData) stretchStrings, 0}, + DEF_PANEDWINDOW_PANE_STRETCH, -1, Tk_Offset(Pane, stretch), + 0, stretchStrings, 0}, {TK_OPTION_PIXELS, "-width", NULL, NULL, - DEF_PANEDWINDOW_PANE_WIDTH, Tk_Offset(Pane, widthPtr), - Tk_Offset(Pane, width), TK_OPTION_NULL_OK, 0, 0}, + DEF_PANEDWINDOW_PANE_WIDTH, Tk_Offset(Pane, widthPtr), + Tk_Offset(Pane, width), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, 0, 0, 0, 0} }; diff --git a/generic/ttk/ttkButton.c b/generic/ttk/ttkButton.c index 6a7eae7..92edea2 100644 --- a/generic/ttk/ttkButton.c +++ b/generic/ttk/ttkButton.c @@ -81,7 +81,7 @@ static Tk_OptionSpec BaseOptionSpecs[] = */ {TK_OPTION_STRING_TABLE, "-compound", "compound", "Compound", NULL, Tk_Offset(Base,base.compoundObj), -1, - TK_OPTION_NULL_OK, (void *)ttkCompoundStrings, + TK_OPTION_NULL_OK, ttkCompoundStrings, GEOMETRY_CHANGED }, {TK_OPTION_STRING, "-padding", "padding", "Pad", NULL, Tk_Offset(Base,base.paddingObj), -1, @@ -326,7 +326,7 @@ static Tk_OptionSpec ButtonOptionSpecs[] = "", Tk_Offset(Button, button.commandObj), -1, 0,0,0}, {TK_OPTION_STRING_TABLE, "-default", "default", "Default", "normal", Tk_Offset(Button, button.defaultStateObj), -1, - 0, (void *)ttkDefaultStrings, DEFAULTSTATE_CHANGED}, + 0, ttkDefaultStrings, DEFAULTSTATE_CHANGED}, WIDGET_TAKEFOCUS_TRUE, WIDGET_INHERIT_OPTIONS(BaseOptionSpecs) @@ -819,7 +819,7 @@ static Tk_OptionSpec MenubuttonOptionSpecs[] = "", Tk_Offset(Menubutton, menubutton.menuObj), -1, 0,0,0}, {TK_OPTION_STRING_TABLE, "-direction", "direction", "Direction", "below", Tk_Offset(Menubutton, menubutton.directionObj), -1, - 0, (void *)directionStrings, GEOMETRY_CHANGED}, + 0, directionStrings, GEOMETRY_CHANGED}, WIDGET_TAKEFOCUS_TRUE, WIDGET_INHERIT_OPTIONS(BaseOptionSpecs) diff --git a/generic/ttk/ttkEntry.c b/generic/ttk/ttkEntry.c index 025a0f6..c43189c 100644 --- a/generic/ttk/ttkEntry.c +++ b/generic/ttk/ttkEntry.c @@ -174,7 +174,7 @@ static Tk_OptionSpec EntryOptionSpecs[] = { TK_OPTION_NULL_OK,0,TEXTVAR_CHANGED}, {TK_OPTION_STRING_TABLE, "-validate", "validate", "Validate", "none", -1, Tk_Offset(Entry, entry.validate), - 0, (void *) validateStrings, 0}, + 0, validateStrings, 0}, {TK_OPTION_STRING, "-validatecommand", "validateCommand", "ValidateCommand", NULL, -1, Tk_Offset(Entry, entry.validateCmd), TK_OPTION_NULL_OK, 0, 0}, diff --git a/generic/ttk/ttkNotebook.c b/generic/ttk/ttkNotebook.c index 24dea7b..e31b186 100644 --- a/generic/ttk/ttkNotebook.c +++ b/generic/ttk/ttkNotebook.c @@ -60,14 +60,14 @@ static Tk_OptionSpec TabOptionSpecs[] = { {TK_OPTION_STRING_TABLE, "-state", "", "", "normal", -1,Tk_Offset(Tab,state), - 0, (void *)TabStateStrings, 0 }, + 0, TabStateStrings, 0 }, {TK_OPTION_STRING, "-text", "text", "Text", "", Tk_Offset(Tab,textObj), -1, 0,0,GEOMETRY_CHANGED }, {TK_OPTION_STRING, "-image", "image", "Image", NULL/*default*/, Tk_Offset(Tab,imageObj), -1, TK_OPTION_NULL_OK,0,GEOMETRY_CHANGED }, {TK_OPTION_STRING_TABLE, "-compound", "compound", "Compound", NULL, Tk_Offset(Tab,compoundObj), -1, - TK_OPTION_NULL_OK, (void *)ttkCompoundStrings, GEOMETRY_CHANGED }, + TK_OPTION_NULL_OK, ttkCompoundStrings, GEOMETRY_CHANGED }, {TK_OPTION_INT, "-underline", "underline", "Underline", "-1", Tk_Offset(Tab,underlineObj), -1, 0,0,GEOMETRY_CHANGED }, {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, 0, 0, 0, 0 } diff --git a/generic/ttk/ttkPanedwindow.c b/generic/ttk/ttkPanedwindow.c index 8563c07..ab67377 100644 --- a/generic/ttk/ttkPanedwindow.c +++ b/generic/ttk/ttkPanedwindow.c @@ -77,7 +77,7 @@ typedef struct { static Tk_OptionSpec PanedOptionSpecs[] = { {TK_OPTION_STRING_TABLE, "-orient", "orient", "Orient", "vertical", Tk_Offset(Paned,paned.orientObj), Tk_Offset(Paned,paned.orient), - 0, (void *)ttkOrientStrings, READONLY_OPTION|STYLE_CHANGED }, + 0, ttkOrientStrings, READONLY_OPTION|STYLE_CHANGED }, {TK_OPTION_INT, "-width", "width", "Width", "0", -1,Tk_Offset(Paned,paned.width), 0, 0, GEOMETRY_CHANGED }, diff --git a/generic/ttk/ttkProgress.c b/generic/ttk/ttkProgress.c index f65cb08..2a0ef4a 100644 --- a/generic/ttk/ttkProgress.c +++ b/generic/ttk/ttkProgress.c @@ -46,14 +46,14 @@ static Tk_OptionSpec ProgressbarOptionSpecs[] = { {TK_OPTION_STRING_TABLE, "-orient", "orient", "Orient", "horizontal", Tk_Offset(Progressbar,progress.orientObj), -1, - 0, (void *)ttkOrientStrings, STYLE_CHANGED }, + 0, ttkOrientStrings, STYLE_CHANGED }, {TK_OPTION_PIXELS, "-length", "length", "Length", DEF_PROGRESSBAR_LENGTH, Tk_Offset(Progressbar,progress.lengthObj), -1, 0, 0, GEOMETRY_CHANGED }, {TK_OPTION_STRING_TABLE, "-mode", "mode", "ProgressMode", "determinate", Tk_Offset(Progressbar,progress.modeObj), Tk_Offset(Progressbar,progress.mode), - 0, (void *)ProgressbarModeStrings, 0 }, + 0, ProgressbarModeStrings, 0 }, {TK_OPTION_DOUBLE, "-maximum", "maximum", "Maximum", "100", Tk_Offset(Progressbar,progress.maximumObj), -1, 0, 0, 0 }, diff --git a/generic/ttk/ttkScale.c b/generic/ttk/ttkScale.c index a4b2a4e..9b9e4d2 100644 --- a/generic/ttk/ttkScale.c +++ b/generic/ttk/ttkScale.c @@ -60,8 +60,8 @@ static Tk_OptionSpec ScaleOptionSpecs[] = 0,0,0}, {TK_OPTION_STRING_TABLE, "-orient", "orient", "Orient", "horizontal", Tk_Offset(Scale,scale.orientObj), - Tk_Offset(Scale,scale.orient), 0, - (void *)ttkOrientStrings, STYLE_CHANGED }, + Tk_Offset(Scale,scale.orient), + 0, ttkOrientStrings, STYLE_CHANGED }, {TK_OPTION_DOUBLE, "-from", "from", "From", "0", Tk_Offset(Scale,scale.fromObj), -1, 0, 0, 0}, diff --git a/generic/ttk/ttkScrollbar.c b/generic/ttk/ttkScrollbar.c index 5ffd671..af2f0b0 100644 --- a/generic/ttk/ttkScrollbar.c +++ b/generic/ttk/ttkScrollbar.c @@ -39,7 +39,7 @@ static Tk_OptionSpec ScrollbarOptionSpecs[] = {TK_OPTION_STRING_TABLE, "-orient", "orient", "Orient", "vertical", Tk_Offset(Scrollbar,scrollbar.orientObj), Tk_Offset(Scrollbar,scrollbar.orient), - 0, (void *)ttkOrientStrings, STYLE_CHANGED }, + 0, ttkOrientStrings, STYLE_CHANGED }, WIDGET_TAKEFOCUS_FALSE, WIDGET_INHERIT_OPTIONS(ttkCoreOptionSpecs) diff --git a/generic/ttk/ttkSeparator.c b/generic/ttk/ttkSeparator.c index a0ae596..6e305fe 100644 --- a/generic/ttk/ttkSeparator.c +++ b/generic/ttk/ttkSeparator.c @@ -26,7 +26,7 @@ static Tk_OptionSpec SeparatorOptionSpecs[] = { {TK_OPTION_STRING_TABLE, "-orient", "orient", "Orient", "horizontal", Tk_Offset(Separator,separator.orientObj), Tk_Offset(Separator,separator.orient), - 0, (void *)ttkOrientStrings, STYLE_CHANGED }, + 0, ttkOrientStrings, STYLE_CHANGED }, WIDGET_TAKEFOCUS_FALSE, WIDGET_INHERIT_OPTIONS(ttkCoreOptionSpecs) diff --git a/generic/ttk/ttkTreeview.c b/generic/ttk/ttkTreeview.c index 23bc3eb..b37273b 100644 --- a/generic/ttk/ttkTreeview.c +++ b/generic/ttk/ttkTreeview.c @@ -448,7 +448,7 @@ static Tk_OptionSpec TreeviewOptionSpecs[] = { {TK_OPTION_STRING_TABLE, "-selectmode", "selectMode", "SelectMode", "extended", Tk_Offset(Treeview,tree.selectModeObj), -1, - 0,(ClientData)SelectModeStrings,0 }, + 0,SelectModeStrings,0 }, {TK_OPTION_PIXELS, "-height", "height", "Height", DEF_TREE_ROWS, Tk_Offset(Treeview,tree.heightObj), -1, -- cgit v0.12