summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authornijtmans <nijtmans>2008-10-17 23:18:37 (GMT)
committernijtmans <nijtmans>2008-10-17 23:18:37 (GMT)
commitf9bdfaa967982fbe680e45cd3a3f9873a71ebe8f (patch)
tree44f5a027c41b824d344a2113ff678351840eaaec /generic
parent803826de028dcbb2cb0ff3392c7801bf3f5c83e9 (diff)
downloadtk-f9bdfaa967982fbe680e45cd3a3f9873a71ebe8f.zip
tk-f9bdfaa967982fbe680e45cd3a3f9873a71ebe8f.tar.gz
tk-f9bdfaa967982fbe680e45cd3a3f9873a71ebe8f.tar.bz2
Add "const" to many internal
const tables, so those will be put by the C-compiler in the TEXT segment in stead of the DATA segment. This makes those table sharable in shared libraries.
Diffstat (limited to 'generic')
-rw-r--r--generic/tk.h6
-rw-r--r--generic/tkBind.c18
-rw-r--r--generic/tkButton.c14
-rw-r--r--generic/tkCanvas.c10
-rw-r--r--generic/tkClipboard.c10
-rw-r--r--generic/tkCmds.c16
-rw-r--r--generic/tkConsole.c8
-rw-r--r--generic/tkEntry.c16
-rw-r--r--generic/tkFocus.c6
-rw-r--r--generic/tkFrame.c4
-rw-r--r--generic/tkGet.c6
-rw-r--r--generic/tkGrab.c6
-rw-r--r--generic/tkGrid.c10
-rw-r--r--generic/tkImage.c4
-rw-r--r--generic/tkImgBmap.c4
-rw-r--r--generic/tkImgGIF.c4
-rw-r--r--generic/tkImgPhoto.c8
-rw-r--r--generic/tkListbox.c10
-rw-r--r--generic/tkMenu.c18
-rw-r--r--generic/tkMenu.h4
-rw-r--r--generic/tkMenubutton.c10
-rw-r--r--generic/tkMessage.c4
-rw-r--r--generic/tkOption.c4
-rw-r--r--generic/tkPack.c8
-rw-r--r--generic/tkPanedWindow.c8
-rw-r--r--generic/tkPlace.c10
-rw-r--r--generic/tkScale.c8
-rw-r--r--generic/tkSelect.c12
-rw-r--r--generic/tkSquare.c4
-rw-r--r--generic/tkTest.c8
-rw-r--r--generic/tkText.c16
-rw-r--r--generic/tkTextDisp.c8
-rw-r--r--generic/tkTextImage.c4
-rw-r--r--generic/tkTextMark.c4
-rw-r--r--generic/tkTextTag.c8
-rw-r--r--generic/tkTextWind.c6
36 files changed, 151 insertions, 153 deletions
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 {