diff options
51 files changed, 397 insertions, 347 deletions
@@ -1,3 +1,53 @@ +2008-10-15 Jan Nijtmans <nijtmans@users.sf.net> + + * generic/tk.h: Add "const" to many internal + * generic/tkBind.c: const tables, so those will be + * generic/tkButton.c: put by the C-compiler in the + * generic/tkCanvas.c: TEXT segment in stead of the + * generic/tkClipboard.c: DATA segment. This makes those + * generic/tkCmds.c: table sharable in shared libraries. + * generic/tkConsole.c: + * generic/tkEntry.c: + * generic/tkFocus.c: + * generic/tkFrame.c: + * generic/tkGet.c: + * generic/tkGrab.c: + * generic/tkGrid.c: + * generic/tkImage.c: + * generic/tkImgBmap.c: + * generic/tkImgGIF.c: + * generic/tkImgPhoto.c: + * generic/tkListbox.c: + * generic/tkMenu.c: + * generic/tkMenu.h: + * generic/tkMenubutton.c: + * generic/tkMessage.c: + * generic/tkOption.c: + * generic/tkPack.c: + * generic/tkPanedWindow.c: + * generic/tkPlace.c: + * generic/tkScale.c: + * generic/tkSelect.c: + * generic/tkSquare.c: + * generic/tkTest.c: + * generic/tkText.c: + * generic/tkTextDisp.c: + * generic/tkTextMark.c: + * generic/tkTextTag.c: + * generic/tkTextWind.c: + * macosx/tkMacOSXDialog.c: + * macosx/tkMacOSXSend.c: + * macosx/tkMacOSXWin.c: + * unix/tkUnixFont.c: + * unix/tkUnixWm.c: + * win/tkWinButton.c: + * win/tkWinColor.c: + * win/tkWinDialog.c: + * win/tkWinMenu.c: + * win/tkWinSend.c: + * win/tkWinWm.c: + * xlib/xcolors.c: + 2008-10-17 Pat Thoyts <patthoyts@users.sourceforge.net> * library/ttk/scale.tcl: Implemented keyboard bindings for ttk::scale diff --git a/generic/tk.h b/generic/tk.h index 7fc6677..d8eb505 100644 --- a/generic/tk.h +++ b/generic/tk.h @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tk.h,v 1.117 2008/09/03 06:01:51 dgp Exp $ + * RCS: @(#) $Id: tk.h,v 1.118 2008/10/17 23:18:37 nijtmans Exp $ */ #ifndef _TK @@ -1006,7 +1006,7 @@ typedef void Tk_ItemDCharsProc (Tk_Canvas canvas, Tk_Item *itemPtr, #ifndef __NO_OLD_CONFIG typedef struct Tk_ItemType { - char *name; /* The name of this type of item, such as + CONST char *name; /* The name of this type of item, such as * "line". */ int itemSize; /* Total amount of space needed for item's * record. */ @@ -1201,7 +1201,7 @@ typedef int (Tk_ImagePostscriptProc) (ClientData clientData, */ struct Tk_ImageType { - char *name; /* Name of image type. */ + CONST char *name; /* Name of image type. */ Tk_ImageCreateProc *createProc; /* Procedure to call to create a new image of * this type. */ diff --git a/generic/tkBind.c b/generic/tkBind.c index b949e42..c4de660 100644 --- a/generic/tkBind.c +++ b/generic/tkBind.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkBind.c,v 1.46 2008/07/23 23:24:23 nijtmans Exp $ + * RCS: @(#) $Id: tkBind.c,v 1.47 2008/10/17 23:18:37 nijtmans Exp $ */ #include "tkInt.h" @@ -355,7 +355,7 @@ typedef struct BindInfo { #ifdef REDO_KEYSYM_LOOKUP typedef struct { - char *name; /* Name of keysym. */ + const char *name; /* Name of keysym. */ KeySym value; /* Numeric identifier for keysym. */ } KeySymInfo; static KeySymInfo keyArray[] = { @@ -384,7 +384,7 @@ TCL_DECLARE_MUTEX(bindMutex) */ typedef struct { - char *name; /* Name of modifier. */ + const char *name; /* Name of modifier. */ int mask; /* Button/modifier mask value, such as * Button1Mask. */ int flags; /* Various flags; see below for @@ -408,7 +408,7 @@ typedef struct { #define QUADRUPLE 4 #define MULT_CLICKS 7 -static ModInfo modArray[] = { +static const ModInfo modArray[] = { {"Control", ControlMask, 0}, {"Shift", ShiftMask, 0}, {"Lock", LockMask, 0}, @@ -453,7 +453,7 @@ static Tcl_HashTable modTable; */ typedef struct { - char *name; /* Name of event. */ + const char *name; /* Name of event. */ int type; /* Event type for X, such as ButtonPress. */ int eventMask; /* Mask bits (for XSelectInput) for this event * type. */ @@ -738,7 +738,7 @@ TkBindInit( Tcl_MutexLock(&bindMutex); if (!initialized) { Tcl_HashEntry *hPtr; - ModInfo *modPtr; + const ModInfo *modPtr; EventInfo *eiPtr; int newEntry; @@ -2731,7 +2731,7 @@ Tk_EventObjCmd( Tk_Window tkwin; VirtualEventTable *vetPtr; TkBindInfo bindInfo; - static const char *optionStrings[] = { + static const char *const optionStrings[] = { "add", "delete", "generate", "info", NULL }; @@ -3298,7 +3298,7 @@ HandleEventGenerate( TkWindow *mainPtr; unsigned long eventMask; Tcl_Obj *userDataObj; - static const char *fieldStrings[] = { + static const char *const fieldStrings[] = { "-when", "-above", "-borderwidth", "-button", "-count", "-data", "-delta", "-detail", "-focus", "-height", @@ -4429,7 +4429,7 @@ GetPatternString( Pattern *patPtr; char c, buffer[TCL_INTEGER_SPACE]; int patsLeft, needMods; - ModInfo *modPtr; + const ModInfo *modPtr; EventInfo *eiPtr; /* diff --git a/generic/tkButton.c b/generic/tkButton.c index 616a861..6bae8b7 100644 --- a/generic/tkButton.c +++ b/generic/tkButton.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkButton.c,v 1.30 2008/10/05 18:22:21 dkf Exp $ + * RCS: @(#) $Id: tkButton.c,v 1.31 2008/10/17 23:18:37 nijtmans Exp $ */ #include "tkInt.h" @@ -28,14 +28,14 @@ static Tcl_ThreadDataKey dataKey; * tkButton.h. */ -static const char *classNames[] = {"Label", "Button", "Checkbutton", "Radiobutton"}; +static const char *const classNames[] = {"Label", "Button", "Checkbutton", "Radiobutton"}; /* * The following table defines the legal values for the -default option. It is * used together with the "enum defaultValue" declaration in tkButton.h. */ -static const char *defaultStrings[] = { +static const char *const defaultStrings[] = { "active", "disabled", "normal", NULL }; @@ -44,7 +44,7 @@ static const char *defaultStrings[] = { * It is used together with the "enum state" declaration in tkButton.h. */ -static const char *stateStrings[] = { +static const char *const stateStrings[] = { "active", "disabled", "normal", NULL }; @@ -53,7 +53,7 @@ static const char *stateStrings[] = { * It is used with the "enum compound" declaration in tkButton.h */ -static const char *compoundStrings[] = { +static const char *const compoundStrings[] = { "bottom", "center", "left", "none", "right", "top", NULL }; @@ -478,7 +478,7 @@ static Tk_OptionSpec radiobuttonOptionSpecs[] = { * such as TYPE_LABEL, to the option template for that class of widgets. */ -static Tk_OptionSpec * const optionSpecs[] = { +static Tk_OptionSpec *const optionSpecs[] = { labelOptionSpecs, buttonOptionSpecs, checkbuttonOptionSpecs, @@ -491,7 +491,7 @@ static Tk_OptionSpec * const optionSpecs[] = { * enumerated type used to dispatch the widget command. */ -static const char *commandNames[][8] = { +static const char *const commandNames[][8] = { {"cget", "configure", NULL}, {"cget", "configure", "flash", "invoke", NULL}, {"cget", "configure", "deselect", "flash", "invoke", "select", diff --git a/generic/tkCanvas.c b/generic/tkCanvas.c index 97fd093..423167b 100644 --- a/generic/tkCanvas.c +++ b/generic/tkCanvas.c @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkCanvas.c,v 1.52 2008/10/11 06:47:25 dkf Exp $ + * RCS: @(#) $Id: tkCanvas.c,v 1.53 2008/10/17 23:18:37 nijtmans Exp $ */ /* #define USE_OLD_TAG_SEARCH 1 */ @@ -542,7 +542,7 @@ CanvasWidgetCmd( #endif /* USE_OLD_TAG_SEARCH */ int index; - static const char *optionStrings[] = { + static const char *const optionStrings[] = { "addtag", "bbox", "bind", "canvasx", "canvasy", "cget", "configure", "coords", "create", "dchars", "delete", "dtag", @@ -1601,7 +1601,7 @@ CanvasWidgetCmd( } case CANV_SCAN: { int x, y, gain = 10; - static const char *optionStrings[] = { + static const char *const optionStrings[] = { "mark", "dragto", NULL }; @@ -1645,7 +1645,7 @@ CanvasWidgetCmd( } case CANV_SELECT: { int index, optionindex; - static const char *optionStrings[] = { + static const char *const optionStrings[] = { "adjust", "clear", "from", "item", "to", NULL }; enum options { @@ -3992,7 +3992,7 @@ FindItems( Tk_Item *itemPtr; Tk_Uid uid; int index, result; - static const char *optionStrings[] = { + static const char *const optionStrings[] = { "above", "all", "below", "closest", "enclosed", "overlapping", "withtag", NULL }; diff --git a/generic/tkClipboard.c b/generic/tkClipboard.c index 6e0057b..ce49319 100644 --- a/generic/tkClipboard.c +++ b/generic/tkClipboard.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkClipboard.c,v 1.20 2008/07/23 23:24:23 nijtmans Exp $ + * RCS: @(#) $Id: tkClipboard.c,v 1.21 2008/10/17 23:18:37 nijtmans Exp $ */ #include "tkInt.h" @@ -425,7 +425,7 @@ Tk_ClipboardObjCmd( Tk_Window tkwin = (Tk_Window) clientData; char *path = NULL; Atom selection; - static const char *optionStrings[] = { "append", "clear", "get", NULL }; + static const char *const optionStrings[] = { "append", "clear", "get", NULL }; enum options { CLIPBOARD_APPEND, CLIPBOARD_CLEAR, CLIPBOARD_GET }; int index, i; @@ -445,7 +445,7 @@ Tk_ClipboardObjCmd( char *targetName = NULL; char *formatName = NULL; char *string; - static const char *appendOptionStrings[] = { + static const char *const appendOptionStrings[] = { "-displayof", "-format", "-type", NULL }; enum appendOptions { APPEND_DISPLAYOF, APPEND_FORMAT, APPEND_TYPE }; @@ -516,7 +516,7 @@ Tk_ClipboardObjCmd( Tcl_GetString(objv[i])); } case CLIPBOARD_CLEAR: { - static const char *clearOptionStrings[] = { "-displayof", NULL }; + static const char *const clearOptionStrings[] = { "-displayof", NULL }; enum clearOptions { CLEAR_DISPLAYOF }; int subIndex; @@ -548,7 +548,7 @@ Tk_ClipboardObjCmd( Tcl_DString selBytes; int result; char *string; - static const char *getOptionStrings[] = { + static const char *const getOptionStrings[] = { "-displayof", "-type", NULL }; enum getOptions { APPEND_DISPLAYOF, APPEND_TYPE }; diff --git a/generic/tkCmds.c b/generic/tkCmds.c index d3dc9a4..64896c5 100644 --- a/generic/tkCmds.c +++ b/generic/tkCmds.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkCmds.c,v 1.44 2008/10/05 21:25:07 dkf Exp $ + * RCS: @(#) $Id: tkCmds.c,v 1.45 2008/10/17 23:18:37 nijtmans Exp $ */ #include "tkInt.h" @@ -61,7 +61,7 @@ Tk_BellObjCmd( int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - static const char *bellOptions[] = { + static const char *const bellOptions[] = { "-displayof", "-nice", NULL }; enum options { TK_BELL_DISPLAYOF, TK_BELL_NICE }; @@ -612,7 +612,7 @@ Tk_TkObjCmd( { int index; Tk_Window tkwin; - static const char *optionStrings[] = { + static const char *const optionStrings[] = { "appname", "caret", "scaling", "useinputmethods", "windowingsystem", "inactive", NULL }; @@ -661,7 +661,7 @@ Tk_TkObjCmd( Tcl_Obj *objPtr; TkCaret *caretPtr; Tk_Window window; - static const char *caretStrings[] = { + static const char *const caretStrings[] = { "-x", "-y", "-height", NULL }; enum caretOptions { @@ -916,7 +916,7 @@ Tk_TkwaitObjCmd( Tk_Window tkwin = (Tk_Window) clientData; int done, index; int code = TCL_OK; - static const char *optionStrings[] = { + static const char *const optionStrings[] = { "variable", "visibility", "window", NULL }; enum options { @@ -1101,7 +1101,7 @@ Tk_UpdateObjCmd( int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - static const char *updateOptions[] = {"idletasks", NULL}; + static const char *const updateOptions[] = {"idletasks", NULL}; int flags, index; TkDisplay *dispPtr; int code = TCL_OK; @@ -1213,7 +1213,7 @@ Tk_WinfoObjCmd( {StaticGray, "staticgray"}, {-1, NULL} }; - static const char *optionStrings[] = { + static const char *const optionStrings[] = { "cells", "children", "class", "colormapfull", "depth", "geometry", "height", "id", "ismapped", "manager", "name", "parent", @@ -1752,7 +1752,7 @@ Tk_WmObjCmd( Tk_Window tkwin; TkWindow *winPtr; - static const char *optionStrings[] = { + static const char *const optionStrings[] = { "aspect", "client", "command", "deiconify", "focusmodel", "frame", "geometry", "grid", "group", "iconbitmap", "iconify", "iconmask", diff --git a/generic/tkConsole.c b/generic/tkConsole.c index 5d0ba6e..a6825ea 100644 --- a/generic/tkConsole.c +++ b/generic/tkConsole.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkConsole.c,v 1.37 2008/04/27 22:38:56 dkf Exp $ + * RCS: @(#) $Id: tkConsole.c,v 1.38 2008/10/17 23:18:37 nijtmans Exp $ */ #include "tk.h" @@ -114,7 +114,7 @@ ShouldUseConsoleChannel( DWORD consoleParams; DWORD fileType; int mode; - char *bufMode; + const char *bufMode; HANDLE handle; switch (type) { @@ -673,7 +673,7 @@ ConsoleObjCmd( Tcl_Obj *const objv[]) /* Argument objects */ { int index, result; - static const char *options[] = {"eval", "hide", "show", "title", NULL}; + static const char *const options[] = {"eval", "hide", "show", "title", NULL}; enum option {CON_EVAL, CON_HIDE, CON_SHOW, CON_TITLE}; Tcl_Obj *cmd = NULL; ConsoleInfo *info = (ConsoleInfo *) clientData; @@ -760,7 +760,7 @@ InterpreterObjCmd( Tcl_Obj *const objv[]) /* Argument objects */ { int index, result = TCL_OK; - static const char *options[] = {"eval", "record", NULL}; + static const char *const options[] = {"eval", "record", NULL}; enum option {OTHER_EVAL, OTHER_RECORD}; ConsoleInfo *info = clientData; Tcl_Interp *otherInterp = info->interp; diff --git a/generic/tkEntry.c b/generic/tkEntry.c index e41577e..fdb8eb3 100644 --- a/generic/tkEntry.c +++ b/generic/tkEntry.c @@ -14,7 +14,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkEntry.c,v 1.52 2008/10/09 21:49:44 dkf Exp $ + * RCS: @(#) $Id: tkEntry.c,v 1.53 2008/10/17 23:18:37 nijtmans Exp $ */ #include "tkInt.h" @@ -37,7 +37,7 @@ #define DOUBLES_EQ(d1, d2) (fabs((d1) - (d2)) < MIN_DBL_VAL) -static char *stateStrings[] = { +static char *const stateStrings[] = { "disabled", "normal", "readonly", NULL }; @@ -45,7 +45,7 @@ static char *stateStrings[] = { * Definitions for -validate option values: */ -static char *validateStrings[] = { +static char *const validateStrings[] = { "all", "key", "focus", "focusin", "focusout", "none", NULL }; enum validateType { @@ -319,7 +319,7 @@ static const Tk_OptionSpec sbOptSpec[] = { * dispatch the entry widget command. */ -static const char *entryCmdNames[] = { +static const char *const entryCmdNames[] = { "bbox", "cget", "configure", "delete", "get", "icursor", "index", "insert", "scan", "selection", "validate", "xview", NULL }; @@ -330,7 +330,7 @@ enum entryCmd { COMMAND_SCAN, COMMAND_SELECTION, COMMAND_VALIDATE, COMMAND_XVIEW }; -static const char *selCmdNames[] = { +static const char *const selCmdNames[] = { "adjust", "clear", "from", "present", "range", "to", NULL }; @@ -345,7 +345,7 @@ enum selCmd { * dispatch the spinbox widget command. */ -static const char *sbCmdNames[] = { +static const char *const sbCmdNames[] = { "bbox", "cget", "configure", "delete", "get", "icursor", "identify", "index", "insert", "invoke", "scan", "selection", "set", "validate", "xview", NULL @@ -358,7 +358,7 @@ enum sbCmd { SB_CMD_SET, SB_CMD_VALIDATE, SB_CMD_XVIEW }; -static const char *sbSelCmdNames[] = { +static const char *const sbSelCmdNames[] = { "adjust", "clear", "element", "from", "present", "range", "to", NULL }; @@ -376,7 +376,7 @@ enum sbselCmd { * modify them, you must modify the strings here. */ -static const char *selElementNames[] = { +static const char *const selElementNames[] = { "none", "buttondown", "buttonup", NULL, "entry" }; diff --git a/generic/tkFocus.c b/generic/tkFocus.c index 980a8e0..767244d 100644 --- a/generic/tkFocus.c +++ b/generic/tkFocus.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkFocus.c,v 1.17 2008/04/27 22:38:56 dkf Exp $ + * RCS: @(#) $Id: tkFocus.c,v 1.18 2008/10/17 23:18:37 nijtmans Exp $ */ #include "tkInt.h" @@ -120,7 +120,7 @@ Tk_FocusObjCmd( int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - static const char *focusOptions[] = { + static const char *const focusOptions[] = { "-displayof", "-force", "-lastfor", NULL }; Tk_Window tkwin = clientData; @@ -1113,7 +1113,7 @@ TkFocusSplit(winPtr) * See if current focusWin is child of the new toplevel. */ - for (subWinPtr = tlFocusPtr->focusWinPtr; + for (subWinPtr = tlFocusPtr->focusWinPtr; subWinPtr && subWinPtr != winPtr && subWinPtr != topLevelPtr; subWinPtr = subWinPtr->parentPtr) { /* EMPTY */ diff --git a/generic/tkFrame.c b/generic/tkFrame.c index 1ef67fa..1bf96b0 100644 --- a/generic/tkFrame.c +++ b/generic/tkFrame.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkFrame.c,v 1.33 2008/07/23 23:24:21 nijtmans Exp $ + * RCS: @(#) $Id: tkFrame.c,v 1.34 2008/10/17 23:18:37 nijtmans Exp $ */ #include "default.h" @@ -702,7 +702,7 @@ FrameWidgetObjCmd( int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - static const char *frameOptions[] = { + static const char *const frameOptions[] = { "cget", "configure", NULL }; enum options { diff --git a/generic/tkGet.c b/generic/tkGet.c index 807f9c2..de6b5fe 100644 --- a/generic/tkGet.c +++ b/generic/tkGet.c @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkGet.c,v 1.14 2008/04/27 22:38:56 dkf Exp $ + * RCS: @(#) $Id: tkGet.c,v 1.15 2008/10/17 23:18:37 nijtmans Exp $ */ #include "tkInt.h" @@ -37,10 +37,10 @@ static void FreeUidThreadExitProc(ClientData clientData); * used by Tk_GetAnchorFromObj and Tk_GetJustifyFromObj. */ -static const char *anchorStrings[] = { +static const char *const anchorStrings[] = { "n", "ne", "e", "se", "s", "sw", "w", "nw", "center", NULL }; -static const char *justifyStrings[] = { +static const char *const justifyStrings[] = { "left", "right", "center", NULL }; diff --git a/generic/tkGrab.c b/generic/tkGrab.c index 5ae15d3..d07c197 100644 --- a/generic/tkGrab.c +++ b/generic/tkGrab.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkGrab.c,v 1.15 2008/07/23 23:24:23 nijtmans Exp $ + * RCS: @(#) $Id: tkGrab.c,v 1.16 2008/10/17 23:18:37 nijtmans Exp $ */ #include "tkInt.h" @@ -191,10 +191,10 @@ Tk_GrabObjCmd( char *arg; int index; int len; - static const char *optionStrings[] = { + static const char *const optionStrings[] = { "current", "release", "set", "status", NULL }; - static const char *flagStrings[] = { + static const char *const flagStrings[] = { "-global", NULL }; enum options { diff --git a/generic/tkGrid.c b/generic/tkGrid.c index e11125e..e2e1ef0 100644 --- a/generic/tkGrid.c +++ b/generic/tkGrid.c @@ -8,7 +8,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkGrid.c,v 1.49 2008/07/23 23:24:23 nijtmans Exp $ + * RCS: @(#) $Id: tkGrid.c,v 1.50 2008/10/17 23:18:37 nijtmans Exp $ */ #include "tkInt.h" @@ -334,7 +334,7 @@ Tk_GridObjCmd( Tcl_Obj *const objv[]) /* Argument objects. */ { Tk_Window tkwin = clientData; - static const char *optionStrings[] = { + static const char *const optionStrings[] = { "anchor", "bbox", "columnconfigure", "configure", "forget", "info", "location", "propagate", "remove", "rowconfigure", "size", "slaves", NULL @@ -931,7 +931,7 @@ GridRowColumnConfigureCommand( int ok; /* temporary TCL result code */ int i, j, first, last; char *string; - static const char *optionStrings[] = { + static const char *const optionStrings[] = { "-minsize", "-pad", "-uniform", "-weight", NULL }; enum options { @@ -1306,7 +1306,7 @@ GridSlavesCommand( Gridder *slavePtr; int i, value, index; int row = -1, column = -1; - static const char *optionStrings[] = { + static const char *const optionStrings[] = { "-column", "-row", NULL }; enum options { SLAVES_COLUMN, SLAVES_ROW }; @@ -2885,7 +2885,7 @@ ConfigureSlaves( char *lastWindow; /* Use this window to base current row/col * on */ int numSkip; /* Number of 'x' found */ - static const char *optionStrings[] = { + static const char *const optionStrings[] = { "-column", "-columnspan", "-in", "-ipadx", "-ipady", "-padx", "-pady", "-row", "-rowspan", "-sticky", NULL }; diff --git a/generic/tkImage.c b/generic/tkImage.c index db6352c..0fb673b 100644 --- a/generic/tkImage.c +++ b/generic/tkImage.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkImage.c,v 1.38 2008/10/05 18:22:21 dkf Exp $ + * RCS: @(#) $Id: tkImage.c,v 1.39 2008/10/17 23:18:37 nijtmans Exp $ */ #include "tkInt.h" @@ -156,7 +156,7 @@ Tk_ImageObjCmd( int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument strings. */ { - static const char *imageOptions[] = { + static const char *const imageOptions[] = { "create", "delete", "height", "inuse", "names", "type", "types", "width", NULL }; diff --git a/generic/tkImgBmap.c b/generic/tkImgBmap.c index 2540e66..395b5a6 100644 --- a/generic/tkImgBmap.c +++ b/generic/tkImgBmap.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkImgBmap.c,v 1.24 2008/07/23 23:24:21 nijtmans Exp $ + * RCS: @(#) $Id: tkImgBmap.c,v 1.25 2008/10/17 23:18:37 nijtmans Exp $ */ #include "tkInt.h" @@ -745,7 +745,7 @@ ImgBmapCmd( int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - static const char *bmapOptions[] = {"cget", "configure", NULL}; + static const char *const bmapOptions[] = {"cget", "configure", NULL}; BitmapMaster *masterPtr = clientData; int index; diff --git a/generic/tkImgGIF.c b/generic/tkImgGIF.c index 69a0c85..0d130f8 100644 --- a/generic/tkImgGIF.c +++ b/generic/tkImgGIF.c @@ -32,7 +32,7 @@ * This file also contains code from miGIF. See lower down in file for the * applicable copyright notice for that portion. * - * RCS: @(#) $Id: tkImgGIF.c,v 1.44 2008/04/27 22:38:56 dkf Exp $ + * RCS: @(#) $Id: tkImgGIF.c,v 1.45 2008/10/17 23:18:37 nijtmans Exp $ */ #include "tkInt.h" @@ -264,7 +264,7 @@ FileReadGIF( int bitPixel; unsigned char colorMap[MAXCOLORMAPSIZE][4]; int transparent = -1; - static const char *optionStrings[] = { + static const char *const optionStrings[] = { "-index", NULL }; GIFImageConfig gifConf, *gifConfPtr = &gifConf; diff --git a/generic/tkImgPhoto.c b/generic/tkImgPhoto.c index 993ae46..b09682d 100644 --- a/generic/tkImgPhoto.c +++ b/generic/tkImgPhoto.c @@ -17,7 +17,7 @@ * Department of Computer Science, * Australian National University. * - * RCS: @(#) $Id: tkImgPhoto.c,v 1.82 2008/10/05 18:22:21 dkf Exp $ + * RCS: @(#) $Id: tkImgPhoto.c,v 1.83 2008/10/17 23:18:37 nijtmans Exp $ */ #include "tkImgPhoto.h" @@ -398,7 +398,7 @@ ImgPhotoCmd( int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - static const char *photoOptions[] = { + static const char *const photoOptions[] = { "blank", "cget", "configure", "copy", "data", "get", "put", "read", "redither", "transparency", "write", NULL }; @@ -1125,7 +1125,7 @@ ImgPhotoCmd( return TCL_OK; case PHOTO_TRANS: { - static const char *photoTransOptions[] = { + static const char *const photoTransOptions[] = { "get", "set", NULL }; enum transOptions { @@ -1510,7 +1510,7 @@ ParseSubcommandOptions( * constants. */ - static const char *compositingRules[] = { + static const char *const compositingRules[] = { "overlay", "set", NULL }; diff --git a/generic/tkListbox.c b/generic/tkListbox.c index 94be1fb..b35d6ea 100644 --- a/generic/tkListbox.c +++ b/generic/tkListbox.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkListbox.c,v 1.49 2008/10/09 21:21:03 dgp Exp $ + * RCS: @(#) $Id: tkListbox.c,v 1.50 2008/10/17 23:18:37 nijtmans Exp $ */ #include "default.h" @@ -340,7 +340,7 @@ static const Tk_OptionSpec itemAttrOptionSpecs[] = { * dispatch the listbox widget command. */ -static const char *commandNames[] = { +static const char *const commandNames[] = { "activate", "bbox", "cget", "configure", "curselection", "delete", "get", "index", "insert", "itemcget", "itemconfigure", "nearest", "scan", "see", "selection", "size", "xview", "yview", NULL @@ -353,21 +353,21 @@ enum command { COMMAND_SIZE, COMMAND_XVIEW, COMMAND_YVIEW }; -static const char *selCommandNames[] = { +static const char *const selCommandNames[] = { "anchor", "clear", "includes", "set", NULL }; enum selcommand { SELECTION_ANCHOR, SELECTION_CLEAR, SELECTION_INCLUDES, SELECTION_SET }; -static const char *scanCommandNames[] = { +static const char *const scanCommandNames[] = { "mark", "dragto", NULL }; enum scancommand { SCAN_MARK, SCAN_DRAGTO }; -static const char *indexNames[] = { +static const char *const indexNames[] = { "active", "anchor", "end", NULL }; enum indices { diff --git a/generic/tkMenu.c b/generic/tkMenu.c index fb04861..8ae6518 100644 --- a/generic/tkMenu.c +++ b/generic/tkMenu.c @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkMenu.c,v 1.44 2008/10/05 18:22:21 dkf Exp $ + * RCS: @(#) $Id: tkMenu.c,v 1.45 2008/10/17 23:18:37 nijtmans Exp $ */ /* @@ -99,9 +99,9 @@ TCL_DECLARE_MUTEX(menuMutex) * to update code in TkpMenuInit that changes the font string entry. */ -char *tkMenuStateStrings[] = {"active", "normal", "disabled", NULL}; +static const char *const menuStateStrings[] = {"active", "normal", "disabled", NULL}; -static const char *menuEntryTypeStrings[] = { +static const char *const menuEntryTypeStrings[] = { "cascade", "checkbutton", "command", "radiobutton", "separator", NULL }; @@ -110,7 +110,7 @@ static const char *menuEntryTypeStrings[] = { * is used with the "enum compound" declaration in tkMenu.h */ -static char *compoundStrings[] = { +static char *const compoundStrings[] = { "bottom", "center", "left", "none", "right", "top", NULL }; @@ -157,7 +157,7 @@ static const Tk_OptionSpec tkBasicMenuEntryConfigSpecs[] = { {TK_OPTION_STRING_TABLE, "-state", NULL, NULL, DEF_MENU_ENTRY_STATE, -1, Tk_Offset(TkMenuEntry, state), 0, - (ClientData) tkMenuStateStrings}, + (ClientData) menuStateStrings}, {TK_OPTION_INT, "-underline", NULL, NULL, DEF_MENU_ENTRY_UNDERLINE, -1, Tk_Offset(TkMenuEntry, underline)}, {TK_OPTION_END} @@ -227,7 +227,7 @@ static const Tk_OptionSpec tkTearoffEntryConfigSpecs[] = { Tk_Offset(TkMenuEntry, borderPtr), -1, TK_OPTION_NULL_OK}, {TK_OPTION_STRING_TABLE, "-state", NULL, NULL, DEF_MENU_ENTRY_STATE, -1, Tk_Offset(TkMenuEntry, state), 0, - (ClientData) tkMenuStateStrings}, + (ClientData) menuStateStrings}, {TK_OPTION_END} }; @@ -241,7 +241,7 @@ static const Tk_OptionSpec *specsArray[] = { * Menu type strings for use with Tcl_GetIndexFromObj. */ -static const char *menuTypeStrings[] = { +static const char *const menuTypeStrings[] = { "normal", "tearoff", "menubar", NULL }; @@ -310,7 +310,7 @@ static const Tk_OptionSpec tkMenuConfigSpecs[] = { * with MenuWidgetObjCmd. */ -static const char *menuOptions[] = { +static const char *const menuOptions[] = { "activate", "add", "cget", "clone", "configure", "delete", "entrycget", "entryconfigure", "index", "insert", "invoke", "post", "postcascade", "type", "unpost", "xposition", "yposition", NULL @@ -455,7 +455,7 @@ MenuCmd( TkMenuReferences *menuRefPtr; int i, index, toplevel; char *windowName; - static const char *typeStringList[] = {"-type", NULL}; + static const char *const typeStringList[] = {"-type", NULL}; TkMenuOptionTables *optionTablesPtr = clientData; if (objc < 2) { diff --git a/generic/tkMenu.h b/generic/tkMenu.h index 642958a..015b89b 100644 --- a/generic/tkMenu.h +++ b/generic/tkMenu.h @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkMenu.h,v 1.14 2007/12/13 15:24:16 dgp Exp $ + * RCS: @(#) $Id: tkMenu.h,v 1.15 2008/10/17 23:18:37 nijtmans Exp $ */ #ifndef _TKMENU @@ -241,8 +241,6 @@ typedef struct TkMenuEntry { * Menu states */ -MODULE_SCOPE char *tkMenuStateStrings[]; - #define ENTRY_ACTIVE 0 #define ENTRY_NORMAL 1 #define ENTRY_DISABLED 2 diff --git a/generic/tkMenubutton.c b/generic/tkMenubutton.c index a5bc369..dc8ac61 100644 --- a/generic/tkMenubutton.c +++ b/generic/tkMenubutton.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkMenubutton.c,v 1.22 2008/10/05 18:22:21 dkf Exp $ + * RCS: @(#) $Id: tkMenubutton.c,v 1.23 2008/10/17 23:18:37 nijtmans Exp $ */ #include "tkInt.h" @@ -22,7 +22,7 @@ * is used together with the "enum direction" declaration in tkMenubutton.h. */ -static char *directionStrings[] = { +static const char *const directionStrings[] = { "above", "below", "flush", "left", "right", NULL }; @@ -31,7 +31,7 @@ static char *directionStrings[] = { * used together with the "enum state" declaration in tkMenubutton.h. */ -static char *stateStrings[] = { +static const char *const stateStrings[] = { "active", "disabled", "normal", NULL }; @@ -40,7 +40,7 @@ static char *stateStrings[] = { * is used with the "enum compound" declaration in tkMenuButton.h */ -static char *compoundStrings[] = { +static const char *const compoundStrings[] = { "bottom", "center", "left", "none", "right", "top", NULL }; @@ -153,7 +153,7 @@ static const Tk_OptionSpec optionSpecs[] = { * dispatch the scale widget command. */ -static const char *commandNames[] = { +static const char *const commandNames[] = { "cget", "configure", NULL }; diff --git a/generic/tkMessage.c b/generic/tkMessage.c index 1db8e5d..760c144 100644 --- a/generic/tkMessage.c +++ b/generic/tkMessage.c @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkMessage.c,v 1.21 2008/07/23 23:24:23 nijtmans Exp $ + * RCS: @(#) $Id: tkMessage.c,v 1.22 2008/10/17 23:18:37 nijtmans Exp $ */ #include "default.h" @@ -307,7 +307,7 @@ MessageWidgetObjCmd( Tcl_Obj *const objv[]) /* Argument strings. */ { register Message *msgPtr = clientData; - static const char *optionStrings[] = { "cget", "configure", NULL }; + static const char *const optionStrings[] = { "cget", "configure", NULL }; enum options { MESSAGE_CGET, MESSAGE_CONFIGURE }; int index; int result = TCL_OK; diff --git a/generic/tkOption.c b/generic/tkOption.c index b5a147e..3688709 100644 --- a/generic/tkOption.c +++ b/generic/tkOption.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkOption.c,v 1.26 2008/08/21 09:43:53 dkf Exp $ + * RCS: @(#) $Id: tkOption.c,v 1.27 2008/10/17 23:18:37 nijtmans Exp $ */ #include "tkInt.h" @@ -621,7 +621,7 @@ Tk_OptionObjCmd( ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); - static const char *optionCmds[] = { + static const char *const optionCmds[] = { "add", "clear", "get", "readfile", NULL }; diff --git a/generic/tkPack.c b/generic/tkPack.c index a266fba..d7e192e 100644 --- a/generic/tkPack.c +++ b/generic/tkPack.c @@ -10,13 +10,13 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkPack.c,v 1.28 2008/04/27 22:38:56 dkf Exp $ + * RCS: @(#) $Id: tkPack.c,v 1.29 2008/10/17 23:18:37 nijtmans Exp $ */ #include "tkInt.h" typedef enum {TOP, BOTTOM, LEFT, RIGHT} Side; -static const char *sideNames[] = { +static const char *const sideNames[] = { "top", "bottom", "left", "right", NULL }; @@ -191,7 +191,7 @@ Tk_PackObjCmd( { Tk_Window tkwin = clientData; char *argv2; - static const char *optionStrings[] = { + static const char *const optionStrings[] = { /* after, append, before and unpack are deprecated */ "after", "append", "before", "unpack", "configure", "forget", "info", "propagate", "slaves", NULL }; @@ -1448,7 +1448,7 @@ ConfigureSlaves( Tk_Window other, slave, parent, ancestor; int i, j, numWindows, tmp, positionGiven; char *string; - static const char *optionStrings[] = { + static const char *const optionStrings[] = { "-after", "-anchor", "-before", "-expand", "-fill", "-in", "-ipadx", "-ipady", "-padx", "-pady", "-side", NULL }; enum options { diff --git a/generic/tkPanedWindow.c b/generic/tkPanedWindow.c index 105af9e..d9b5cad 100644 --- a/generic/tkPanedWindow.c +++ b/generic/tkPanedWindow.c @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkPanedWindow.c,v 1.34 2008/10/05 18:22:21 dkf Exp $ + * RCS: @(#) $Id: tkPanedWindow.c,v 1.35 2008/10/17 23:18:37 nijtmans Exp $ */ #include "default.h" @@ -524,7 +524,7 @@ PanedWindowWidgetObjCmd( { PanedWindow *pwPtr = clientData; int result = TCL_OK; - static const char *optionStrings[] = { + static const char *const optionStrings[] = { "add", "cget", "configure", "forget", "identify", "panecget", "paneconfigure", "panes", "proxy", "sash", NULL }; @@ -1068,7 +1068,7 @@ PanedWindowSashCommand( int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - static const char *sashOptionStrings[] = { + static const char *const sashOptionStrings[] = { "coord", "dragto", "mark", "place", NULL }; enum sashOptions { @@ -2759,7 +2759,7 @@ PanedWindowProxyCommand( int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - static const char *optionStrings[] = { + static const char *const optionStrings[] = { "coord", "forget", "place", NULL }; enum options { diff --git a/generic/tkPlace.c b/generic/tkPlace.c index 007c052..649d490 100644 --- a/generic/tkPlace.c +++ b/generic/tkPlace.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkPlace.c,v 1.25 2008/04/27 22:38:56 dkf Exp $ + * RCS: @(#) $Id: tkPlace.c,v 1.26 2008/10/17 23:18:37 nijtmans Exp $ */ #include "tkInt.h" @@ -215,7 +215,7 @@ Tk_PlaceObjCmd( char *string; TkDisplay *dispPtr; Tk_OptionTable optionTable; - static const char *optionStrings[] = { + static const char *const optionStrings[] = { "configure", "forget", "info", "slaves", NULL }; enum options { PLACE_CONFIGURE, PLACE_FORGET, PLACE_INFO, PLACE_SLAVES }; @@ -509,7 +509,7 @@ UnlinkSlave( } } } - + if (masterPtr->abortPtr != NULL) { *masterPtr->abortPtr = 1; } @@ -861,11 +861,11 @@ RecomputePlacement( * placement operation. */ masterPtr->flags &= ~PARENT_RECONFIG_PENDING; - + /* * Abort any nested call to RecomputePlacement for this window, since * we'll do everything necessary here, and set up so this call - * can be aborted if necessary. + * can be aborted if necessary. */ if (masterPtr->abortPtr != NULL) { diff --git a/generic/tkScale.c b/generic/tkScale.c index 2519a8b..d42d4de 100644 --- a/generic/tkScale.c +++ b/generic/tkScale.c @@ -16,7 +16,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkScale.c,v 1.30 2008/07/23 23:24:23 nijtmans Exp $ + * RCS: @(#) $Id: tkScale.c,v 1.31 2008/10/17 23:18:37 nijtmans Exp $ */ #include "default.h" @@ -28,7 +28,7 @@ * used together with the "enum orient" declaration in tkScale.h. */ -static char *orientStrings[] = { +static const char *const orientStrings[] = { "horizontal", "vertical", NULL }; @@ -37,7 +37,7 @@ static char *orientStrings[] = { * used together with the "enum state" declaration in tkScale.h. */ -static char *stateStrings[] = { +static const char *const stateStrings[] = { "active", "disabled", "normal", NULL }; @@ -142,7 +142,7 @@ static const Tk_OptionSpec optionSpecs[] = { * scale widget command. */ -static const char *commandNames[] = { +static const char *const commandNames[] = { "cget", "configure", "coords", "get", "identify", "set", NULL }; diff --git a/generic/tkSelect.c b/generic/tkSelect.c index 7f3f9df..c2a78ca 100644 --- a/generic/tkSelect.c +++ b/generic/tkSelect.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkSelect.c,v 1.23 2008/10/05 18:22:21 dkf Exp $ + * RCS: @(#) $Id: tkSelect.c,v 1.24 2008/10/17 23:18:37 nijtmans Exp $ */ #include "tkInt.h" @@ -679,7 +679,7 @@ Tk_SelectionObjCmd( char *selName = NULL, *string; int count, index; Tcl_Obj **objs; - static const char *optionStrings[] = { + static const char *const optionStrings[] = { "clear", "get", "handle", "own", NULL }; enum options { @@ -698,7 +698,7 @@ Tk_SelectionObjCmd( switch ((enum options) index) { case SELECTION_CLEAR: { - static const char *clearOptionStrings[] = { + static const char *const clearOptionStrings[] = { "-displayof", "-selection", NULL }; enum clearOptions { CLEAR_DISPLAYOF, CLEAR_SELECTION }; @@ -757,7 +757,7 @@ Tk_SelectionObjCmd( char *targetName = NULL; Tcl_DString selBytes; int result; - static const char *getOptionStrings[] = { + static const char *const getOptionStrings[] = { "-displayof", "-selection", "-type", NULL }; enum getOptions { GET_DISPLAYOF, GET_SELECTION, GET_TYPE }; @@ -832,7 +832,7 @@ Tk_SelectionObjCmd( char *formatName = NULL; register CommandInfo *cmdInfoPtr; int cmdLength; - static const char *handleOptionStrings[] = { + static const char *const handleOptionStrings[] = { "-format", "-selection", "-type", NULL }; enum handleOptions { @@ -920,7 +920,7 @@ Tk_SelectionObjCmd( register LostCommand *lostPtr; char *script = NULL; int cmdLength; - static const char *ownOptionStrings[] = { + static const char *const ownOptionStrings[] = { "-command", "-displayof", "-selection", NULL }; enum ownOptions { OWN_COMMAND, OWN_DISPLAYOF, OWN_SELECTION }; diff --git a/generic/tkSquare.c b/generic/tkSquare.c index 9a830f4..50292d1 100644 --- a/generic/tkSquare.c +++ b/generic/tkSquare.c @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkSquare.c,v 1.12 2008/07/23 23:24:21 nijtmans Exp $ + * RCS: @(#) $Id: tkSquare.c,v 1.13 2008/10/17 23:18:37 nijtmans Exp $ */ #if 0 @@ -224,7 +224,7 @@ SquareWidgetObjCmd( { Square *squarePtr = clientData; int result = TCL_OK; - static const char *squareOptions[] = {"cget", "configure", NULL}; + static const char *const squareOptions[] = {"cget", "configure", NULL}; enum { SQUARE_CGET, SQUARE_CONFIGURE }; diff --git a/generic/tkTest.c b/generic/tkTest.c index 515e27e..2f233e7 100644 --- a/generic/tkTest.c +++ b/generic/tkTest.c @@ -13,7 +13,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkTest.c,v 1.38 2008/10/05 18:22:21 dkf Exp $ + * RCS: @(#) $Id: tkTest.c,v 1.39 2008/10/17 23:18:37 nijtmans Exp $ */ #include "tkInt.h" @@ -620,7 +620,7 @@ TestobjconfigObjCmd( int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - static const char *options[] = { + static const char *const options[] = { "alltypes", "chain1", "chain2", "configerror", "delete", "info", "internal", "new", "notenoughparams", "twowindows", NULL }; @@ -1252,7 +1252,7 @@ TrivialConfigObjCmd( Tcl_Obj *const objv[]) /* Argument objects. */ { int result = TCL_OK; - static const char *options[] = { + static const char *const options[] = { "cget", "configure", "csave", NULL }; enum { @@ -1434,7 +1434,7 @@ TestfontObjCmd( int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - static const char *options[] = {"counts", "subfonts", NULL}; + static const char *const options[] = {"counts", "subfonts", NULL}; enum option {COUNTS, SUBFONTS}; int index; Tk_Window tkwin; diff --git a/generic/tkText.c b/generic/tkText.c index 13b3fae..21ac016 100644 --- a/generic/tkText.c +++ b/generic/tkText.c @@ -13,7 +13,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkText.c,v 1.81 2008/07/23 23:24:22 nijtmans Exp $ + * RCS: @(#) $Id: tkText.c,v 1.82 2008/10/17 23:18:37 nijtmans Exp $ */ #include "default.h" @@ -685,7 +685,7 @@ TextWidgetObjCmd( int result = TCL_OK; int index; - static const char *optionStrings[] = { + static const char *const optionStrings[] = { "bbox", "cget", "compare", "configure", "count", "debug", "delete", "dlineinfo", "dump", "edit", "get", "image", "index", "insert", "mark", "peer", "replace", "scan", "search", "see", "tag", "window", @@ -1536,7 +1536,7 @@ SharedTextObjCmd( int result = TCL_OK; int index; - static const char *optionStrings[] = { + static const char *const optionStrings[] = { "delete", "insert", NULL }; enum options { @@ -1641,7 +1641,7 @@ TextPeerCmd( Tk_Window tkwin = textPtr->tkwin; int index; - static const char *peerOptionStrings[] = { + static const char *const peerOptionStrings[] = { "create", "names", NULL }; enum peerOptions { @@ -3575,7 +3575,7 @@ TextSearchCmd( int i, argsLeft, code; SearchSpec searchSpec; - static const char *switchStrings[] = { + static const char *const switchStrings[] = { "--", "-all", "-backwards", "-count", "-elide", "-exact", "-forwards", "-hidden", "-nocase", "-nolinestop", "-overlap", "-regexp", "-strictlimits", NULL @@ -4277,7 +4277,7 @@ TkTextGetTabs( /* * Map these strings to TkTextTabAlign values. */ - static const char *tabOptionStrings[] = { + static const char *const tabOptionStrings[] = { "left", "right", "center", "numeric", NULL }; @@ -4449,7 +4449,7 @@ TextDumpCmd( #define TK_DUMP_IMG 0x10 #define TK_DUMP_ALL (TK_DUMP_TEXT|TK_DUMP_MARK|TK_DUMP_TAG| \ TK_DUMP_WIN|TK_DUMP_IMG) - static const char *optStrings[] = { + static const char *const optStrings[] = { "-all", "-command", "-image", "-mark", "-tag", "-text", "-window", NULL }; @@ -4960,7 +4960,7 @@ TextEditCmd( { int index; - static const char *editOptionStrings[] = { + static const char *const editOptionStrings[] = { "modified", "redo", "reset", "separator", "undo", NULL }; enum editOptions { diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c index 995b3e8..89da5e4 100644 --- a/generic/tkTextDisp.c +++ b/generic/tkTextDisp.c @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkTextDisp.c,v 1.69 2008/04/27 22:38:58 dkf Exp $ + * RCS: @(#) $Id: tkTextDisp.c,v 1.70 2008/10/17 23:18:37 nijtmans Exp $ */ #include "tkInt.h" @@ -2726,7 +2726,7 @@ DisplayLineBackground( rightX2 + xOffset, y, sValuePtr->borderWidth, sValuePtr->borderWidth, 1, sValuePtr->relief); Tk_3DHorizontalBevel(textPtr->tkwin, pixmap, sValuePtr->border, - leftX + xOffset, y, rightX2 + sValuePtr->borderWidth - + leftX + xOffset, y, rightX2 + sValuePtr->borderWidth - leftX, sValuePtr->borderWidth, leftXIn, 0, 1, sValuePtr->relief); } @@ -8167,13 +8167,13 @@ TextGetScrollInfoObj( int *intPtr) /* Filled in with number of pages or lines or * pixels to scroll, if any. */ { - static const char *subcommands[] = { + static const char *const subcommands[] = { "moveto", "scroll", NULL }; enum viewSubcmds { VIEW_MOVETO, VIEW_SCROLL }; - static const char *units[] = { + static const char *const units[] = { "units", "pages", "pixels", NULL }; enum viewUnits { diff --git a/generic/tkTextImage.c b/generic/tkTextImage.c index ce786ed..9e9867c 100644 --- a/generic/tkTextImage.c +++ b/generic/tkTextImage.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkTextImage.c,v 1.23 2008/07/23 23:24:23 nijtmans Exp $ + * RCS: @(#) $Id: tkTextImage.c,v 1.24 2008/10/17 23:18:37 nijtmans Exp $ */ #include "tkPort.h" @@ -130,7 +130,7 @@ TkTextImageCmd( int idx; register TkTextSegment *eiPtr; TkTextIndex index; - static const char *optionStrings[] = { + static const char *const optionStrings[] = { "cget", "configure", "create", "names", NULL }; enum opts { diff --git a/generic/tkTextMark.c b/generic/tkTextMark.c index b53b755..d162c6f 100644 --- a/generic/tkTextMark.c +++ b/generic/tkTextMark.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkTextMark.c,v 1.21 2008/07/23 23:24:23 nijtmans Exp $ + * RCS: @(#) $Id: tkTextMark.c,v 1.22 2008/10/17 23:18:37 nijtmans Exp $ */ #include "tkInt.h" @@ -106,7 +106,7 @@ TkTextMarkCmd( TkTextIndex index; const Tk_SegType *newTypePtr; int optionIndex; - static const char *markOptionStrings[] = { + static const char *const markOptionStrings[] = { "gravity", "names", "next", "previous", "set", "unset", NULL }; enum markOptions { diff --git a/generic/tkTextTag.c b/generic/tkTextTag.c index c1e3e13..bcfd91b 100644 --- a/generic/tkTextTag.c +++ b/generic/tkTextTag.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkTextTag.c,v 1.29 2008/07/23 23:24:23 nijtmans Exp $ + * RCS: @(#) $Id: tkTextTag.c,v 1.30 2008/10/17 23:18:37 nijtmans Exp $ */ #include "default.h" @@ -25,7 +25,7 @@ * a whole is not. */ -static char *wrapStrings[] = { +static const char *const wrapStrings[] = { "char", "none", "word", "", NULL }; @@ -36,7 +36,7 @@ static char *wrapStrings[] = { * widget as a whole is not. */ -static char *tabStyleStrings[] = { +static const char *const tabStyleStrings[] = { "tabular", "wordprocessor", "", NULL }; @@ -132,7 +132,7 @@ TkTextTagCmd( * parsed this command enough to know that * objv[1] is "tag". */ { - static const char *tagOptionStrings[] = { + static const char *const tagOptionStrings[] = { "add", "bind", "cget", "configure", "delete", "lower", "names", "nextrange", "prevrange", "raise", "ranges", "remove", NULL }; diff --git a/generic/tkTextWind.c b/generic/tkTextWind.c index 3f5f88f..0e97d92 100644 --- a/generic/tkTextWind.c +++ b/generic/tkTextWind.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkTextWind.c,v 1.24 2008/07/23 23:24:23 nijtmans Exp $ + * RCS: @(#) $Id: tkTextWind.c,v 1.25 2008/10/17 23:18:37 nijtmans Exp $ */ #include "tkPort.h" @@ -87,7 +87,7 @@ static const Tk_SegType tkTextEmbWindowType = { * Definitions for alignment values: */ -static char *alignStrings[] = { +static const char *const alignStrings[] = { "baseline", "bottom", "center", "top", NULL }; @@ -143,7 +143,7 @@ TkTextWindowCmd( * objv[1] is "window". */ { int optionIndex; - static const char *windOptionStrings[] = { + static const char *const windOptionStrings[] = { "cget", "configure", "create", "names", NULL }; enum windOptions { diff --git a/macosx/tkMacOSXDialog.c b/macosx/tkMacOSXDialog.c index da7dbf8..7cba460 100644 --- a/macosx/tkMacOSXDialog.c +++ b/macosx/tkMacOSXDialog.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkMacOSXDialog.c,v 1.38 2008/09/02 16:10:54 das Exp $ + * RCS: @(#) $Id: tkMacOSXDialog.c,v 1.39 2008/10/17 23:18:38 nijtmans Exp $ */ #include "tkMacOSXPrivate.h" @@ -105,7 +105,7 @@ static int fileDlgInited = 0; static NavObjectFilterUPP openFileFilterUPP; static NavEventUPP openFileEventUPP; - + /* *---------------------------------------------------------------------- * @@ -139,7 +139,7 @@ Tk_ChooseColorObjCmd( CMProfileRef prof; NColorPickerInfo cpinfo; static RGBColor color = {0xffff, 0xffff, 0xffff}; - static const char *optionStrings[] = { + static const char *const optionStrings[] = { "-initialcolor", "-parent", "-title", NULL }; enum options { @@ -227,7 +227,7 @@ Tk_ChooseColorObjCmd( end: return result; } - + /* *---------------------------------------------------------------------- * @@ -262,7 +262,7 @@ Tk_GetOpenFileObjCmd( char *initialFile = NULL, *initialDir = NULL; Tcl_Obj *typeVariablePtr = NULL; const char *initialtype = NULL; - static const char *openOptionStrings[] = { + static const char *const openOptionStrings[] = { "-defaultextension", "-filetypes", "-initialdir", "-initialfile", "-message", "-multiple", "-parent", "-title", "-typevariable", NULL }; @@ -389,7 +389,7 @@ Tk_GetOpenFileObjCmd( } return result; } - + /* *---------------------------------------------------------------------- * @@ -420,7 +420,7 @@ Tk_GetSaveFileObjCmd( FSRef dirRef; CFStringRef title = NULL, message = NULL; OpenFileData ofd; - static const char *saveOptionStrings[] = { + static const char *const saveOptionStrings[] = { "-defaultextension", "-filetypes", "-initialdir", "-initialfile", "-message", "-parent", "-title", "-typevariable", NULL }; @@ -514,7 +514,7 @@ Tk_GetSaveFileObjCmd( } return result; } - + /* *---------------------------------------------------------------------- * @@ -546,7 +546,7 @@ Tk_ChooseDirectoryObjCmd( FSRef dirRef; CFStringRef message = NULL, title = NULL; OpenFileData ofd; - static const char *chooseOptionStrings[] = { + static const char *const chooseOptionStrings[] = { "-initialdir", "-message", "-mustexist", "-parent", "-title", NULL }; enum chooseOptions { @@ -620,7 +620,7 @@ Tk_ChooseDirectoryObjCmd( } return result; } - + /* *---------------------------------------------------------------------- * @@ -705,7 +705,7 @@ HandleInitialDirectory( } return result; } - + /* *---------------------------------------------------------------------- * @@ -729,7 +729,7 @@ InitFileDialogs(void) openFileFilterUPP = NewNavObjectFilterUPP(OpenFileFilterProc); openFileEventUPP = NewNavEventUPP(OpenEventProc); } - + /* *---------------------------------------------------------------------- * @@ -1010,7 +1010,7 @@ NavServicesGetFile( } return result; } - + /* *---------------------------------------------------------------------- * @@ -1095,7 +1095,7 @@ OpenEventProc( break; } } - + /* *---------------------------------------------------------------------- * @@ -1192,7 +1192,7 @@ OpenFileFilterProc( } return (result == MATCHED); } - + /* *---------------------------------------------------------------------- * @@ -1309,7 +1309,7 @@ MatchOneType( return UNMATCHED; } - + /* *---------------------------------------------------------------------- * @@ -1348,7 +1348,7 @@ TkAboutDlg(void) DisposeDialog(aboutDlog); SelectWindow(ActiveNonFloatingWindow()); } - + /* *---------------------------------------------------------------------- * @@ -1385,18 +1385,18 @@ Tk_MessageBoxObjCmd( int defaultNativeButtonIndex; /* 1, 2, 3: right to left */ int typeIndex, i, indexDefaultOption = 0, result = TCL_ERROR; - static const char *movableAlertStrings[] = { + static const char *const movableAlertStrings[] = { "-default", "-detail", "-icon", "-message", "-parent", "-title", "-type", NULL }; - static const char *movableTypeStrings[] = { + static const char *const movableTypeStrings[] = { "abortretryignore", "ok", "okcancel", "retrycancel", "yesno", "yesnocancel", NULL }; - static const char *movableButtonStrings[] = { + static const char *const movableButtonStrings[] = { "abort", "retry", "ignore", "ok", "cancel", "yes", "no", NULL }; - static const char *movableIconStrings[] = { + static const char *const movableIconStrings[] = { "error", "info", "question", "warning", NULL }; enum movableAlertOptions { @@ -1671,7 +1671,7 @@ Tk_MessageBoxObjCmd( } return result; } - + /* *---------------------------------------------------------------------- * diff --git a/macosx/tkMacOSXSend.c b/macosx/tkMacOSXSend.c index 39c6543..52da21a 100644 --- a/macosx/tkMacOSXSend.c +++ b/macosx/tkMacOSXSend.c @@ -30,7 +30,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkMacOSXSend.c,v 1.10 2008/07/23 23:24:44 nijtmans Exp $ + * RCS: @(#) $Id: tkMacOSXSend.c,v 1.11 2008/10/17 23:18:38 nijtmans Exp $ */ #include "tkMacOSXInt.h" @@ -327,7 +327,7 @@ Tk_SendObjCmd( int objc, /* Number of arguments */ Tcl_Obj *const objv[]) /* The arguments */ { - const char *sendOptions[] = {"-async", "-displayof", "-", NULL}; + const char *const sendOptions[] = {"-async", "-displayof", "-", NULL}; char *stringRep, *destName; int async = 0; int i, index, firstArg; diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c index 0e3544d..5e4c9b3 100644 --- a/macosx/tkMacOSXWm.c +++ b/macosx/tkMacOSXWm.c @@ -13,7 +13,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkMacOSXWm.c,v 1.69 2008/10/08 15:39:13 dgp Exp $ + * RCS: @(#) $Id: tkMacOSXWm.c,v 1.70 2008/10/17 23:18:38 nijtmans Exp $ */ #include "tkMacOSXPrivate.h" @@ -37,7 +37,7 @@ typedef enum { _WMATT_LAST_ATTRIBUTE } WmAttribute; -static const char *WmAttributeNames[] = { +static const char *const WmAttributeNames[] = { "-alpha", "-fullscreen", "-modified", "-notify", "-titlepath", "-topmost", "-transparent", NULL @@ -211,7 +211,7 @@ static void GetMaxSize(TkWindow *winPtr, int *maxWidthPtr, int *maxHeightPtr); static void RemapWindows(TkWindow *winPtr, MacDrawable *parentWin); - + /* *---------------------------------------------------------------------- * @@ -307,7 +307,7 @@ TkWmNewWindow( Tk_ManageGeometry((Tk_Window) winPtr, &wmMgrType, (ClientData) 0); } - + /* *---------------------------------------------------------------------- * @@ -406,7 +406,7 @@ TkWmMapWindow( XMapWindow(winPtr->display, winPtr->window); } - + /* *---------------------------------------------------------------------- * @@ -431,7 +431,7 @@ TkWmUnmapWindow( { XUnmapWindow(winPtr->display, winPtr->window); } - + /* *---------------------------------------------------------------------- * @@ -499,7 +499,7 @@ TkWmDeadWindow( ckfree((char *) wmPtr); winPtr->wmInfoPtr = NULL; } - + /* *---------------------------------------------------------------------- * @@ -525,7 +525,7 @@ TkWmSetClass( { return; } - + /* *---------------------------------------------------------------------- * @@ -552,7 +552,7 @@ Tk_WmObjCmd( Tcl_Obj *const objv[]) /* Argument objects. */ { Tk_Window tkwin = (Tk_Window) clientData; - static const char *optionStrings[] = { + static const char *const optionStrings[] = { "aspect", "attributes", "client", "colormapwindows", "command", "deiconify", "focusmodel", "forget", "frame", "geometry", "grid", "group", @@ -686,7 +686,7 @@ Tk_WmObjCmd( /* This should not happen */ return TCL_ERROR; } - + /* *---------------------------------------------------------------------- * @@ -755,7 +755,7 @@ WmAspectCmd( WmUpdateGeom(wmPtr, winPtr); return TCL_OK; } - + /* *---------------------------------------------------------------------- * @@ -931,7 +931,7 @@ WmSetAttribute( } return TCL_OK; } - + /* *---------------------------------------------------------------------- * @@ -1006,7 +1006,7 @@ WmGetAttribute( } return result; } - + /* *---------------------------------------------------------------------- * @@ -1078,7 +1078,7 @@ WmAttributesCmd( } return TCL_OK; } - + /* *---------------------------------------------------------------------- * @@ -1133,7 +1133,7 @@ WmClientCmd( strcpy(wmPtr->clientMachine, argv3); return TCL_OK; } - + /* *---------------------------------------------------------------------- * @@ -1221,7 +1221,7 @@ WmColormapwindowsCmd( return TCL_OK; } - + /* *---------------------------------------------------------------------- * @@ -1281,7 +1281,7 @@ WmCommandCmd( wmPtr->cmdArgv = cmdArgv; return TCL_OK; } - + /* *---------------------------------------------------------------------- * @@ -1327,7 +1327,7 @@ WmDeiconifyCmd( ZoomState : NormalState); return TCL_OK; } - + /* *---------------------------------------------------------------------- * @@ -1354,7 +1354,7 @@ WmFocusmodelCmd( Tcl_Obj *const objv[]) /* Argument objects. */ { register WmInfo *wmPtr = winPtr->wmInfoPtr; - static const char *optionStrings[] = { + static const char *const optionStrings[] = { "active", "passive", NULL }; enum options { OPT_ACTIVE, OPT_PASSIVE }; @@ -1381,7 +1381,7 @@ WmFocusmodelCmd( } return TCL_OK; } - + /* *---------------------------------------------------------------------- * @@ -1443,7 +1443,7 @@ WmForgetCmd( return TCL_OK; #endif } - + /* *---------------------------------------------------------------------- * @@ -1485,7 +1485,7 @@ WmFrameCmd( Tcl_SetResult(interp, buf, TCL_VOLATILE); return TCL_OK; } - + /* *---------------------------------------------------------------------- * @@ -1548,7 +1548,7 @@ WmGeometryCmd( } return ParseGeometry(interp, argv3, winPtr); } - + /* *---------------------------------------------------------------------- * @@ -1638,7 +1638,7 @@ WmGridCmd( WmUpdateGeom(wmPtr, winPtr); return TCL_OK; } - + /* *---------------------------------------------------------------------- * @@ -1701,7 +1701,7 @@ WmGroupCmd( } return TCL_OK; } - + /* *---------------------------------------------------------------------- * @@ -1769,7 +1769,7 @@ WmIconbitmapCmd( } return TCL_OK; } - + /* *---------------------------------------------------------------------- * @@ -1823,7 +1823,7 @@ WmIconifyCmd( TkpWmSetState(winPtr, IconicState); return TCL_OK; } - + /* *---------------------------------------------------------------------- * @@ -1880,7 +1880,7 @@ WmIconmaskCmd( } return TCL_OK; } - + /* *---------------------------------------------------------------------- * @@ -1932,7 +1932,7 @@ WmIconnameCmd( } return TCL_OK; } - + /* *---------------------------------------------------------------------- * @@ -1998,7 +1998,7 @@ WmIconphotoCmd( return TCL_OK; } - + /* *---------------------------------------------------------------------- * @@ -2054,7 +2054,7 @@ WmIconpositionCmd( } return TCL_OK; } - + /* *---------------------------------------------------------------------- * @@ -2137,7 +2137,7 @@ WmIconwindowCmd( } return TCL_OK; } - + /* *---------------------------------------------------------------------- * @@ -2199,7 +2199,7 @@ WmManageCmd( return TCL_OK; #endif } - + /* *---------------------------------------------------------------------- * @@ -2250,7 +2250,7 @@ WmMaxsizeCmd( WmUpdateGeom(wmPtr, winPtr); return TCL_OK; } - + /* *---------------------------------------------------------------------- * @@ -2301,7 +2301,7 @@ WmMinsizeCmd( WmUpdateGeom(wmPtr, winPtr); return TCL_OK; } - + /* *---------------------------------------------------------------------- * @@ -2347,7 +2347,7 @@ WmOverrideredirectCmd( ApplyMasterOverrideChanges(winPtr, NULL); return TCL_OK; } - + /* *---------------------------------------------------------------------- * @@ -2374,7 +2374,7 @@ WmPositionfromCmd( Tcl_Obj *const objv[]) /* Argument objects. */ { register WmInfo *wmPtr = winPtr->wmInfoPtr; - static const char *optionStrings[] = { + static const char *const optionStrings[] = { "program", "user", NULL }; enum options { OPT_PROGRAM, OPT_USER }; @@ -2411,7 +2411,7 @@ WmPositionfromCmd( WmUpdateGeom(wmPtr, winPtr); return TCL_OK; } - + /* *---------------------------------------------------------------------- * @@ -2503,7 +2503,7 @@ WmProtocolCmd( } return TCL_OK; } - + /* *---------------------------------------------------------------------- * @@ -2579,7 +2579,7 @@ WmResizableCmd( oldAttributes, 1); return TCL_OK; } - + /* *---------------------------------------------------------------------- * @@ -2606,7 +2606,7 @@ WmSizefromCmd( Tcl_Obj *const objv[]) /* Argument objects. */ { register WmInfo *wmPtr = winPtr->wmInfoPtr; - static const char *optionStrings[] = { + static const char *const optionStrings[] = { "program", "user", NULL }; enum options { OPT_PROGRAM, OPT_USER }; @@ -2644,7 +2644,7 @@ WmSizefromCmd( WmUpdateGeom(wmPtr, winPtr); return TCL_OK; } - + /* *---------------------------------------------------------------------- * @@ -2671,7 +2671,7 @@ WmStackorderCmd( Tcl_Obj *const objv[]) /* Argument objects. */ { TkWindow **windows, **window_ptr; - static const char *optionStrings[] = { + static const char *const optionStrings[] = { "isabove", "isbelow", NULL }; enum options { OPT_ISABOVE, OPT_ISBELOW }; @@ -2762,7 +2762,7 @@ WmStackorderCmd( } return TCL_OK; } - + /* *---------------------------------------------------------------------- * @@ -2789,7 +2789,7 @@ WmStateCmd( Tcl_Obj *const objv[]) /* Argument objects. */ { register WmInfo *wmPtr = winPtr->wmInfoPtr; - static const char *optionStrings[] = { + static const char *const optionStrings[] = { "normal", "iconic", "withdrawn", "zoomed", NULL }; enum options { OPT_NORMAL, OPT_ICONIC, OPT_WITHDRAWN, OPT_ZOOMED }; @@ -2866,7 +2866,7 @@ WmStateCmd( } return TCL_OK; } - + /* *---------------------------------------------------------------------- * @@ -2912,7 +2912,7 @@ WmTitleCmd( } return TCL_OK; } - + /* *---------------------------------------------------------------------- * @@ -2997,7 +2997,7 @@ WmTransientCmd( ApplyMasterOverrideChanges(winPtr, NULL); return TCL_OK; } - + /* *---------------------------------------------------------------------- * @@ -3053,7 +3053,7 @@ WmUpdateGeom( wmPtr->flags |= WM_UPDATE_PENDING; } } - + /* *---------------------------------------------------------------------- * @@ -3159,7 +3159,7 @@ Tk_SetGrid( wmPtr->flags |= WM_UPDATE_PENDING; } } - + /* *---------------------------------------------------------------------- * @@ -3216,7 +3216,7 @@ Tk_UnsetGrid( wmPtr->flags |= WM_UPDATE_PENDING; } } - + /* *---------------------------------------------------------------------- * @@ -3266,7 +3266,7 @@ TopLevelEventProc( Tcl_Panic("recieved unwanted reparent event"); } } - + /* *---------------------------------------------------------------------- * @@ -3301,7 +3301,7 @@ TopLevelReqProc( wmPtr->flags |= WM_UPDATE_PENDING; } } - + /* *---------------------------------------------------------------------- * @@ -3520,7 +3520,7 @@ UpdateGeometryInfo( wmPtr->flags &= ~WM_SYNC_PENDING; } } - + /* *---------------------------------------------------------------------- * @@ -3546,7 +3546,7 @@ UpdateSizeHints( wmPtr->flags &= ~WM_UPDATE_SIZE_HINTS; } - + /* *---------------------------------------------------------------------- * @@ -3687,7 +3687,7 @@ ParseGeometry( Tcl_AppendResult(interp, "bad geometry specifier \"", string, "\"", NULL); return TCL_ERROR; } - + /* *---------------------------------------------------------------------- * @@ -3783,7 +3783,7 @@ Tk_GetRootCoords( *xPtr = x; *yPtr = y; } - + /* *---------------------------------------------------------------------- * @@ -3903,7 +3903,7 @@ Tk_CoordsToWindow( } return (Tk_Window) winPtr; } - + /* *---------------------------------------------------------------------- * @@ -3996,7 +3996,7 @@ Tk_TopCoordsToWindow( *newY = y; return (Tk_Window) winPtr; } - + /* *---------------------------------------------------------------------- * @@ -4063,7 +4063,7 @@ UpdateVRootGeometry( goto noVRoot; } } - + /* *---------------------------------------------------------------------- * @@ -4120,7 +4120,7 @@ Tk_GetVRootGeometry( *widthPtr = wmPtr->vRootWidth; *heightPtr = wmPtr->vRootHeight; } - + /* *---------------------------------------------------------------------- * @@ -4174,7 +4174,7 @@ Tk_MoveToplevelWindow( UpdateGeometryInfo(winPtr); } } - + /* *---------------------------------------------------------------------- * @@ -4288,7 +4288,7 @@ TkWmRestackToplevel( SendBehind(macWindow, otherMacWindow); } } - + /* *---------------------------------------------------------------------- * @@ -4379,7 +4379,7 @@ TkWmAddToColormapWindows( * we don't support colormaps. If we did they would be installed here. */ } - + /* *---------------------------------------------------------------------- * @@ -4448,7 +4448,7 @@ TkWmRemoveFromColormapWindows( } } } - + /* *---------------------------------------------------------------------- * @@ -4476,7 +4476,7 @@ TkGetPointerCoords( { XQueryPointer(NULL, None, NULL, NULL, xPtr, yPtr, NULL, NULL, NULL); } - + /* *---------------------------------------------------------------------- * @@ -4535,7 +4535,7 @@ InitialWindowBounds( geometry->right = wmPtr->x + winPtr->changes.width; geometry->bottom = wmPtr->y + winPtr->changes.height; } - + /* *---------------------------------------------------------------------- * @@ -4575,7 +4575,7 @@ TkMacOSXResizable( return true; } } - + /* *---------------------------------------------------------------------- * @@ -4697,7 +4697,7 @@ TkMacOSXGrowToplevel( } return false; } - + /* *---------------------------------------------------------------------- * @@ -4735,7 +4735,7 @@ TkSetWMName( CFRelease(title); } } - + /* *---------------------------------------------------------------------- * @@ -4762,7 +4762,7 @@ TkGetTransientMaster( } return None; } - + /* *---------------------------------------------------------------------- * @@ -4794,7 +4794,7 @@ TkMacOSXGetXWindow( } return (Window) Tcl_GetHashValue(hPtr); } - + /* *---------------------------------------------------------------------- * @@ -4853,7 +4853,7 @@ TkMacOSXIsWindowZoomed( return IsWindowInStandardState(TkMacOSXDrawableWindow(winPtr->window), &idealSize, NULL); } - + /* *---------------------------------------------------------------------- * @@ -4937,7 +4937,7 @@ TkMacOSXZoomToplevel( (zoomPart == inZoomIn ? NormalState : ZoomState); return true; } - + /* *---------------------------------------------------------------------- * @@ -4964,7 +4964,7 @@ TkUnsupported1ObjCmd( int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - static const char *subcmds[] = { + static const char *const subcmds[] = { "style", NULL }; enum SubCmds { @@ -5005,7 +5005,7 @@ TkUnsupported1ObjCmd( /* won't be reached */ return TCL_ERROR; } - + /* *---------------------------------------------------------------------- * @@ -5207,7 +5207,7 @@ WmWinStyle( } return TCL_OK; } - + /* *---------------------------------------------------------------------- * @@ -5245,7 +5245,7 @@ TkpMakeMenuWindow( winPtr->wmInfoPtr->flags |= WM_HEIGHT_NOT_RESIZABLE; } } - + /* *---------------------------------------------------------------------- * @@ -5396,7 +5396,7 @@ TkMacOSXMakeRealWindowExist( } #endif /* TK_MAC_DEBUG_WINDOWS */ } - + /* *---------------------------------------------------------------------- * @@ -5432,7 +5432,7 @@ TkMacOSXRegisterOffScreenWindow( } Tcl_SetHashValue(valueHashPtr, window); } - + /* *---------------------------------------------------------------------- * @@ -5466,7 +5466,7 @@ TkMacOSXUnregisterMacWindow( Tcl_DeleteHashEntry(entryPtr); } } - + /* *---------------------------------------------------------------------- * @@ -5498,7 +5498,7 @@ TkMacOSXSetScrollbarGrow( winPtr->privatePtr->toplevel->winPtr->wmInfoPtr->scrollWinPtr = NULL; } } - + /* *---------------------------------------------------------------------- * @@ -5531,7 +5531,7 @@ TkWmFocusToplevel( } return winPtr; } - + /* *---------------------------------------------------------------------- * @@ -5561,7 +5561,7 @@ TkpGetWrapperWindow( } return winPtr; } - + /* *---------------------------------------------------------------------- * @@ -5621,7 +5621,7 @@ TkpWmSetState( TkMacOSXZoomToplevel(macWin, inZoomOut); } } - + /* *---------------------------------------------------------------------- * @@ -5651,7 +5651,7 @@ TkpIsWindowFloating( GetWindowClass(wRef, &class); return (class == kFloatingWindowClass); } - + /* *---------------------------------------------------------------------- * @@ -5674,7 +5674,7 @@ TkMacOSXWindowClass( { return winPtr->wmInfoPtr->macClass; } - + /* *-------------------------------------------------------------- * @@ -5709,7 +5709,7 @@ TkMacOSXWindowOffset( *xOffset = winPtr->wmInfoPtr->xInParent; *yOffset = winPtr->wmInfoPtr->yInParent; } - + /* *---------------------------------------------------------------------- * @@ -5735,7 +5735,7 @@ TkpGetMS(void) Tcl_GetTime(&now); return (long) now.sec * 1000 + now.usec / 1000; } - + /* *---------------------------------------------------------------------- * @@ -5763,7 +5763,7 @@ XSetInputFocus( * Don't need to do a thing. Tk manages the focus for us. */ } - + /* *---------------------------------------------------------------------- * @@ -5809,7 +5809,7 @@ TkpChangeFocus( return NextRequest(winPtr->display); } - + /* *---------------------------------------------------------------------- * @@ -5856,7 +5856,7 @@ WmStackorderToplevelWrapperMap( WmStackorderToplevelWrapperMap(childPtr, display, table); } } - + /* *---------------------------------------------------------------------- * @@ -5935,7 +5935,7 @@ TkWmStackorderToplevel( Tcl_DeleteHashTable(&table); return windows; } - + /* *---------------------------------------------------------------------- * @@ -6026,7 +6026,7 @@ ApplyWindowClassAttributeChanges( + strWidths.bottom; } } - + /* *---------------------------------------------------------------------- * @@ -6092,7 +6092,7 @@ ApplyMasterOverrideChanges( } } } - + /* *---------------------------------------------------------------------- * @@ -6146,7 +6146,7 @@ WmGetWindowGroup( } return group; } - + /* *---------------------------------------------------------------------- * @@ -6231,7 +6231,7 @@ TkMacOSXMakeFullscreen( TkMacOSXEnterExitFullscreen(winPtr, IsWindowActive(window)); return result; } - + /* *---------------------------------------------------------------------- * @@ -6279,7 +6279,7 @@ TkMacOSXEnterExitFullscreen( } } } - + /* *---------------------------------------------------------------------- * @@ -6376,7 +6376,7 @@ GetMinSize( *minWidthPtr = minWidth; *minHeightPtr = minHeight; } - + /* *---------------------------------------------------------------------- * @@ -6432,7 +6432,7 @@ GetMaxSize( *maxHeightPtr = maxHeight; } } - + /* *---------------------------------------------------------------------- * @@ -6478,7 +6478,7 @@ RemapWindows( RemapWindows(childPtr, (MacDrawable *) winPtr->window); } } - + /* * Local Variables: * fill-column: 78 diff --git a/unix/tkUnixFont.c b/unix/tkUnixFont.c index 7409f2f..55cc2f3 100644 --- a/unix/tkUnixFont.c +++ b/unix/tkUnixFont.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkUnixFont.c,v 1.35 2008/10/05 18:22:21 dkf Exp $ + * RCS: @(#) $Id: tkUnixFont.c,v 1.36 2008/10/17 23:18:53 nijtmans Exp $ */ #include "tkUnixInt.h" @@ -21,7 +21,7 @@ * The preferred font encodings. */ -static const char *encodingList[] = { +static const char *const encodingList[] = { "iso8859-1", "jis0208", "jis0212", NULL }; @@ -628,7 +628,7 @@ UtfToUcs2beProc( return result; } #endif /* WORDS_BIGENDIAN */ - + /* *--------------------------------------------------------------------------- * diff --git a/unix/tkUnixWm.c b/unix/tkUnixWm.c index 7c02a8a..ae5729d 100644 --- a/unix/tkUnixWm.c +++ b/unix/tkUnixWm.c @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkUnixWm.c,v 1.62 2008/10/08 15:39:13 dgp Exp $ + * RCS: @(#) $Id: tkUnixWm.c,v 1.63 2008/10/17 23:18:53 nijtmans Exp $ */ #include "tkUnixInt.h" @@ -55,7 +55,7 @@ typedef enum { _WMATT_LAST_ATTRIBUTE } WmAttribute; -static const char *WmAttributeNames[] = { +static const char *const WmAttributeNames[] = { "-alpha", "-topmost", "-zoomed", "-fullscreen", NULL }; @@ -1736,7 +1736,7 @@ WmFocusmodelCmd( Tcl_Obj *const objv[]) /* Argument objects. */ { register WmInfo *wmPtr = winPtr->wmInfoPtr; - static const char *optionStrings[] = { + static const char *const optionStrings[] = { "active", "passive", NULL }; enum options { OPT_ACTIVE, OPT_PASSIVE }; @@ -2872,7 +2872,7 @@ WmPositionfromCmd( Tcl_Obj *const objv[]) /* Argument objects. */ { register WmInfo *wmPtr = winPtr->wmInfoPtr; - static const char *optionStrings[] = { + static const char *const optionStrings[] = { "program", "user", NULL }; enum options { OPT_PROGRAM, OPT_USER }; @@ -3101,7 +3101,7 @@ WmSizefromCmd( Tcl_Obj *const objv[]) /* Argument objects. */ { register WmInfo *wmPtr = winPtr->wmInfoPtr; - static const char *optionStrings[] = { + static const char *const optionStrings[] = { "program", "user", NULL }; enum options { OPT_PROGRAM, OPT_USER }; @@ -3166,7 +3166,7 @@ WmStackorderCmd( Tcl_Obj *const objv[]) /* Argument objects. */ { TkWindow **windows, **window_ptr; - static const char *optionStrings[] = { + static const char *const optionStrings[] = { "isabove", "isbelow", NULL }; enum options { OPT_ISABOVE, OPT_ISBELOW }; @@ -3286,7 +3286,7 @@ WmStateCmd( Tcl_Obj *const objv[]) /* Argument objects. */ { register WmInfo *wmPtr = winPtr->wmInfoPtr; - static const char *optionStrings[] = { + static const char *const optionStrings[] = { "normal", "iconic", "withdrawn", NULL }; enum options { OPT_NORMAL, OPT_ICONIC, OPT_WITHDRAWN }; diff --git a/win/tkWinButton.c b/win/tkWinButton.c index 5a348b1..41f8b84 100644 --- a/win/tkWinButton.c +++ b/win/tkWinButton.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkWinButton.c,v 1.34 2007/12/14 15:56:09 patthoyts Exp $ + * RCS: @(#) $Id: tkWinButton.c,v 1.35 2008/10/17 23:18:38 nijtmans Exp $ */ #define OEMRESOURCE @@ -258,7 +258,7 @@ CreateProc( { Window window; HWND parent; - char *class; + const char *class; WinButton *butPtr = (WinButton *)instanceData; parent = Tk_GetHWND(parentWin); diff --git a/win/tkWinColor.c b/win/tkWinColor.c index 1972695..2d68384 100644 --- a/win/tkWinColor.c +++ b/win/tkWinColor.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkWinColor.c,v 1.11 2007/01/11 15:35:40 dkf Exp $ + * RCS: @(#) $Id: tkWinColor.c,v 1.12 2008/10/17 23:18:38 nijtmans Exp $ */ #include "tkWinInt.h" @@ -33,7 +33,7 @@ typedef struct WinColor { */ typedef struct { - char *name; + const char *name; int index; } SystemColorEntry; diff --git a/win/tkWinCursor.c b/win/tkWinCursor.c index b35a2c8..99a7ffd 100644 --- a/win/tkWinCursor.c +++ b/win/tkWinCursor.c @@ -8,7 +8,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkWinCursor.c,v 1.16 2008/04/27 22:39:14 dkf Exp $ + * RCS: @(#) $Id: tkWinCursor.c,v 1.17 2008/10/17 23:18:38 nijtmans Exp $ */ #include "tkWinInt.h" @@ -39,7 +39,7 @@ typedef struct { */ static struct CursorName { - char *name; + const char *name; LPCTSTR id; } cursorNames[] = { {"starting", IDC_APPSTARTING}, @@ -71,7 +71,7 @@ static struct CursorName { #define TK_DEFAULT_CURSOR IDC_ARROW - + /* *---------------------------------------------------------------------- * @@ -171,7 +171,7 @@ TkGetCursorByName( return (TkCursor *) cursorPtr; } } - + /* *---------------------------------------------------------------------- * @@ -200,7 +200,7 @@ TkCreateCursorFromData( { return NULL; } - + /* *---------------------------------------------------------------------- * @@ -224,7 +224,7 @@ TkpFreeCursor( { /* TkWinCursor *winCursorPtr = (TkWinCursor *) cursorPtr; */ } - + /* *---------------------------------------------------------------------- * @@ -259,7 +259,7 @@ TkpSetCursor( SetCursor(hcursor); } } - + /* * Local Variables: * mode: c diff --git a/win/tkWinDialog.c b/win/tkWinDialog.c index c55fb2a..871eeee 100644 --- a/win/tkWinDialog.c +++ b/win/tkWinDialog.c @@ -8,7 +8,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkWinDialog.c,v 1.53 2008/10/05 18:22:22 dkf Exp $ + * RCS: @(#) $Id: tkWinDialog.c,v 1.54 2008/10/17 23:18:38 nijtmans Exp $ * */ @@ -299,7 +299,7 @@ Tk_ChooseColorObjCmd( static int inited = 0; static COLORREF dwCustColors[16]; static long oldColor; /* the color selected last time */ - static const char *optionStrings[] = { + static const char *const optionStrings[] = { "-initialcolor", "-parent", "-title", NULL }; enum options { @@ -579,15 +579,15 @@ GetFileNameW( Tcl_Encoding unicodeEncoding = TkWinGetUnicodeEncoding(); ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); - static const char *saveOptionStrings[] = { + static const char *const saveOptionStrings[] = { "-defaultextension", "-filetypes", "-initialdir", "-initialfile", "-parent", "-title", "-typevariable", NULL }; - static const char *openOptionStrings[] = { + static const char *const openOptionStrings[] = { "-defaultextension", "-filetypes", "-initialdir", "-initialfile", "-multiple", "-parent", "-title", "-typevariable", NULL }; - const char **optionStrings; + const char *const *optionStrings; enum options { FILE_DEFAULT, FILE_TYPES, FILE_INITDIR, FILE_INITFILE, @@ -1023,15 +1023,15 @@ GetFileNameA( Tcl_DString extString, filterString, dirString, titleString; ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); - static const char *saveOptionStrings[] = { + static const char *const saveOptionStrings[] = { "-defaultextension", "-filetypes", "-initialdir", "-initialfile", "-parent", "-title", "-typevariable", NULL }; - static const char *openOptionStrings[] = { + static const char *const openOptionStrings[] = { "-defaultextension", "-filetypes", "-initialdir", "-initialfile", "-multiple", "-parent", "-title", "-typevariable", NULL }; - const char **optionStrings; + const char *const *optionStrings; enum options { FILE_DEFAULT, FILE_TYPES, FILE_INITDIR, FILE_INITFILE, @@ -1485,7 +1485,7 @@ MakeFilter( /* * Use "All Files (*.*) as the default filter if none is specified */ - char *defaultFilter = "All Files (*.*)"; + const char *defaultFilter = "All Files (*.*)"; p = filterStr = (char*)ckalloc(30 * sizeof(char)); @@ -1527,7 +1527,7 @@ MakeFilter( for (filterPtr = flist.filters, p = filterStr; filterPtr; filterPtr = filterPtr->next) { - char *sep; + const char *sep; FileFilterClause *clausePtr; /* @@ -1691,7 +1691,7 @@ Tk_ChooseDirectoryObjCmd( TCHAR saveDir[MAX_PATH]; Tcl_DString titleString; /* UTF Title */ Tcl_DString initDirString; /* Initial directory */ - static const char *optionStrings[] = { + static const char *const optionStrings[] = { "-initialdir", "-mustexist", "-parent", "-title", NULL }; enum options { @@ -2066,7 +2066,7 @@ Tk_MessageBoxObjCmd( int defaultBtn, icon, type; int i, oldMode, winCode; UINT flags; - static const char *optionStrings[] = { + static const char *const optionStrings[] = { "-default", "-detail", "-icon", "-message", "-parent", "-title", "-type", NULL }; diff --git a/win/tkWinImage.c b/win/tkWinImage.c index 37e4351..1aa9c20 100644 --- a/win/tkWinImage.c +++ b/win/tkWinImage.c @@ -8,7 +8,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkWinImage.c,v 1.11 2007/01/12 10:41:23 dkf Exp $ + * RCS: @(#) $Id: tkWinImage.c,v 1.12 2008/10/17 23:18:38 nijtmans Exp $ */ #include "tkWinInt.h" @@ -641,7 +641,7 @@ XGetImage( imagePtr = XGetImageZPixmap(display, d, x, y, width, height, plane_mask, format); } else { - char *errMsg = NULL; + const char *errMsg = NULL; char infoBuf[sizeof(BITMAPINFO) + sizeof(RGBQUAD)]; BITMAPINFO *infoPtr = (BITMAPINFO*)infoBuf; diff --git a/win/tkWinMenu.c b/win/tkWinMenu.c index 2e077b8..727c0c4 100644 --- a/win/tkWinMenu.c +++ b/win/tkWinMenu.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkWinMenu.c,v 1.59 2007/12/13 15:28:56 dgp Exp $ + * RCS: @(#) $Id: tkWinMenu.c,v 1.60 2008/10/17 23:18:38 nijtmans Exp $ */ #define OEMRESOURCE @@ -452,9 +452,9 @@ GetEntryText( strcpy(itemText, "( )"); } else { int i; - char *label = (mePtr->labelPtr == NULL) ? "" + const char *label = (mePtr->labelPtr == NULL) ? "" : Tcl_GetString(mePtr->labelPtr); - char *accel = (mePtr->accelPtr == NULL) ? "" + const char *accel = (mePtr->accelPtr == NULL) ? "" : Tcl_GetString(mePtr->accelPtr); const char *p, *next; Tcl_DString itemString; diff --git a/win/tkWinSend.c b/win/tkWinSend.c index 84b37ac..10cd181 100644 --- a/win/tkWinSend.c +++ b/win/tkWinSend.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkWinSend.c,v 1.17 2008/10/05 18:22:22 dkf Exp $ + * RCS: @(#) $Id: tkWinSend.c,v 1.18 2008/10/17 23:18:38 nijtmans Exp $ */ #include "tkInt.h" @@ -68,7 +68,9 @@ static void CmdDeleteProc(ClientData clientData); static void InterpDeleteProc(ClientData clientData, Tcl_Interp *interp); #endif +#ifdef TK_SEND_ENABLED_ON_WINDOWS static void RevokeObjectRegistration(RegisteredInterp *riPtr); +#endif static HRESULT BuildMoniker(const char *name, LPMONIKER *pmk); #ifdef TK_SEND_ENABLED_ON_WINDOWS static HRESULT RegisterInterp(const char *name, @@ -88,7 +90,7 @@ static Tcl_EventProc SendEventProc; #else #define TRACE 1 ? ((void)0) : SendTrace #endif - + /* *-------------------------------------------------------------- * @@ -189,7 +191,7 @@ Tk_SetAppName( return (const char *) riPtr->name; #endif /* TK_SEND_ENABLED_ON_WINDOWS */ } - + /* *---------------------------------------------------------------------- * @@ -295,7 +297,7 @@ TkGetInterpNames( return result; #endif /* TK_SEND_ENABLED_ON_WINDOWS */ } - + /* *-------------------------------------------------------------- * @@ -324,7 +326,7 @@ Tk_SendObjCmd( enum { SEND_ASYNC, SEND_DISPLAYOF, SEND_LAST }; - static const char *sendOptions[] = { + static const char *const sendOptions[] = { "-async", "-displayof", "--", NULL }; int result = TCL_OK; @@ -387,7 +389,7 @@ Tk_SendObjCmd( return result; } - + /* *-------------------------------------------------------------- * @@ -456,7 +458,7 @@ FindInterpreterObject( } return result; } - + /* *-------------------------------------------------------------- * @@ -511,8 +513,7 @@ CmdDeleteProc( ckfree(clientData); } -#endif - + /* *-------------------------------------------------------------- * @@ -556,7 +557,8 @@ RevokeObjectRegistration( riPtr->name = NULL; } } - +#endif + /* * ---------------------------------------------------------------------- * @@ -583,7 +585,7 @@ InterpDeleteProc( CoUninitialize(); } #endif - + /* * ---------------------------------------------------------------------- * @@ -626,7 +628,7 @@ BuildMoniker( } return hr; } - + /* * ---------------------------------------------------------------------- * @@ -704,7 +706,7 @@ RegisterInterp( return hr; } #endif - + /* * ---------------------------------------------------------------------- * @@ -812,7 +814,7 @@ Send( return (SUCCEEDED(hr) ? TCL_OK : TCL_ERROR); } - + /* * ---------------------------------------------------------------------- * @@ -862,7 +864,7 @@ Win32ErrorObj( return errPtr; } - + /* * ---------------------------------------------------------------------- * @@ -926,7 +928,7 @@ SetExcepInfo( } } } - + /* * ---------------------------------------------------------------------- * @@ -970,7 +972,7 @@ TkWinSend_QueueCommand( return 0; } - + /* * ---------------------------------------------------------------------- * @@ -1007,7 +1009,7 @@ SendEventProc( return 1; /* 1 to indicate the event has been handled */ } - + /* * ---------------------------------------------------------------------- * @@ -1038,7 +1040,7 @@ SendTrace( OutputDebugString(buffer); va_end(args); } - + /* * Local Variables: * mode: c diff --git a/win/tkWinWm.c b/win/tkWinWm.c index f9346eb..004397d 100644 --- a/win/tkWinWm.c +++ b/win/tkWinWm.c @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkWinWm.c,v 1.130 2008/10/06 21:57:21 patthoyts Exp $ + * RCS: @(#) $Id: tkWinWm.c,v 1.131 2008/10/17 23:18:38 nijtmans Exp $ */ #include "tkWinInt.h" @@ -2830,7 +2830,7 @@ Tk_WmObjCmd( Tcl_Obj *const objv[]) /* Argument objects. */ { Tk_Window tkwin = clientData; - static const char *optionStrings[] = { + static const char *const optionStrings[] = { "aspect", "attributes", "client", "colormapwindows", "command", "deiconify", "focusmodel", "forget", "frame", "geometry", "grid", "group", "iconbitmap", @@ -3642,7 +3642,7 @@ WmFocusmodelCmd( Tcl_Obj *const objv[]) /* Argument objects. */ { register WmInfo *wmPtr = winPtr->wmInfoPtr; - static const char *optionStrings[] = { + static const char *const optionStrings[] = { "active", "passive", NULL }; enum options { @@ -4796,7 +4796,7 @@ WmPositionfromCmd( Tcl_Obj *const objv[]) /* Argument objects. */ { register WmInfo *wmPtr = winPtr->wmInfoPtr; - static const char *optionStrings[] = { + static const char *const optionStrings[] = { "program", "user", NULL }; enum options { @@ -5013,7 +5013,7 @@ WmSizefromCmd( Tcl_Obj *const objv[]) /* Argument objects. */ { register WmInfo *wmPtr = winPtr->wmInfoPtr; - static const char *optionStrings[] = { + static const char *const optionStrings[] = { "program", "user", NULL }; enum options { @@ -5079,7 +5079,7 @@ WmStackorderCmd( Tcl_Obj *const objv[]) /* Argument objects. */ { TkWindow **windows, **window_ptr; - static const char *optionStrings[] = { + static const char *const optionStrings[] = { "isabove", "isbelow", NULL }; enum options { @@ -5197,7 +5197,7 @@ WmStateCmd( Tcl_Obj *const objv[]) /* Argument objects. */ { register WmInfo *wmPtr = winPtr->wmInfoPtr; - static const char *optionStrings[] = { + static const char *const optionStrings[] = { "normal", "iconic", "withdrawn", "zoomed", NULL }; enum options { @@ -8457,7 +8457,7 @@ TkpWinToplevelDetachWindow( *---------------------------------------------------------------------- */ -static void +static void RemapWindows( TkWindow *winPtr, HWND parentHWND) diff --git a/xlib/xcolors.c b/xlib/xcolors.c index 0120579..4122b86 100644 --- a/xlib/xcolors.c +++ b/xlib/xcolors.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: xcolors.c,v 1.7 2007/01/02 23:39:40 dkf Exp $ + * RCS: @(#) $Id: xcolors.c,v 1.8 2008/10/17 23:18:38 nijtmans Exp $ */ #include <tkInt.h> @@ -34,11 +34,11 @@ static int FindColor(const char *name, XColor *colorPtr); */ typedef struct { - char *name; + const char *name; unsigned char red, green, blue; } XColorEntry; -static XColorEntry xColors[] = { +static const XColorEntry xColors[] = { { "alice blue", 240, 248, 255 }, { "AliceBlue", 240, 248, 255 }, { "antique white", 250, 235, 215 }, @@ -825,7 +825,7 @@ FindColor( */ if (numXColors == 0) { - XColorEntry *ePtr; + const XColorEntry *ePtr; for (ePtr = xColors; ePtr->name != NULL; ePtr++) { numXColors++; } |