summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog36
-rw-r--r--generic/tk3d.c4
-rw-r--r--generic/tkBind.c6
-rw-r--r--generic/tkButton.c4
-rw-r--r--generic/tkCanvas.c10
-rw-r--r--generic/tkClipboard.c15
-rw-r--r--generic/tkCmds.c14
-rw-r--r--generic/tkConfig.c4
-rw-r--r--generic/tkEntry.c20
-rw-r--r--generic/tkFocus.c7
-rw-r--r--generic/tkFont.c8
-rw-r--r--generic/tkFrame.c4
-rw-r--r--generic/tkGet.c11
-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.c4
-rw-r--r--generic/tkListbox.c10
-rw-r--r--generic/tkMenu.c18
-rw-r--r--generic/tkMenubutton.c4
-rw-r--r--generic/tkMessage.c4
-rw-r--r--generic/tkOption.c4
-rw-r--r--generic/tkPack.c10
-rw-r--r--generic/tkPlace.c7
-rw-r--r--generic/tkScale.c4
-rw-r--r--generic/tkSelect.c24
-rw-r--r--generic/tkTest.c10
29 files changed, 162 insertions, 108 deletions
diff --git a/ChangeLog b/ChangeLog
index 69c6371..962beba 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,41 @@
2002-01-16 Don Porter <dgp@users.sourceforge.net>
+ * generic/tk3d.c (Tk_GetReliefFromObj):
+ * generic/tkBind.c (Tk_EventObjCmd,HandleEventGenerate):
+ * generic/tkButton.c (ButtonWidgetObjCmd):
+ * generic/tkCanvas.c (CanvasWidgetCmd,FindItems):
+ * generic/tkClipboard.c (Tk_ClipboardObjCmd):
+ * generic/tkCmds.c (Tk_BellObjCmd,Tk_TkObjCmd,Tk_TkwaitObjCmd,
+ Tk_UpdateObjCmd,Tk_WinfoObjCmd,Tk_WmObjCmd):
+ * generic/tkConfig.c (DoObjConfig):
+ * generic/tkEntry.c (EntryWidgetObjCmd,SpinboxWidgetObjCmd):
+ * generic/tkFocus.c (Tk_FocusObjCmd):
+ * generic/tkFont.c (Tk_FocusObjCmd,ConfigAttributesObj):
+ * generic/tkFrame.c (Tk_FrameObjCmd):
+ * generic/tkGet.c (Tk_GetAnchorFromObj,Tk_GetJustifyFromObj):
+ * generic/tkGrab.c (Tk_GrabObjCmd):
+ * generic/tkGrid.c (Tk_GridObjCmd,GridRowColumnConfigureCommand,
+ GridSlavesCommand,ConfigureSlaves):
+ * generic/tkImage.c (Tk_ImageObjCmd):
+ * generic/tkImgBmap.c (ImgBmapCmd):
+ * generic/tkImgGIF.c (FileReadGIF):
+ * generic/tkImgPhoto.c (ImgPhotoCmd):
+ * generic/tkListbox.c (ListboxWidgetObjCmd,ListboxSelectionSubCmd,
+ GetListboxIndex):
+ * generic/tkMenu.c (MenuWidgetObjCmd,MenuAddOrInsert,MenuCmd,
+ ConfigureMenu,CloneMenu):
+ * generic/tkMenubutton.c (MenuButtonWidgetObjCmd):
+ * generic/tkMessage.c (MessageWidgetObjCmd):
+ * generic/tkOption.c (Tk_OptionObjCmd):
+ * generic/tkPack.c (Tk_PackObjCmd,ConfigureSlaves):
+ * generic/tkPlace.c (Tk_PlaceObjCmd):
+ * generic/tkScale.c (ScaleWidgetObjCmd):
+ * generic/tkSelect.c (Tk_SelectionObjCmd):
+ * generic/tkTest.c (TestobjconfigObjCmd,TrivialConfigObjCmd,
+ TestfontObjCmd): Updates to handle change in type of tablePtr
+ argument of Tcl_GetIndexFromObj(Struct) from (char **) to
+ (CONST char **). [TIP 27] [Patch 504705]
+
* generic/tkCanvText.c (GetSelText):
* generic/tkEntry.c (Entry{FetchSelection,Setvalue},ExpandPercents):
* generic/tkSelect.c (HandleTclCommand):
diff --git a/generic/tk3d.c b/generic/tk3d.c
index 4106745..5e3be12 100644
--- a/generic/tk3d.c
+++ b/generic/tk3d.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: tk3d.c,v 1.11 2001/08/15 15:44:35 dkf Exp $
+ * RCS: @(#) $Id: tk3d.c,v 1.12 2002/01/17 05:13:11 dgp Exp $
*/
#include "tk3d.h"
@@ -20,7 +20,7 @@
* used by Tk_GetReliefFromObj.
*/
-static char *reliefStrings[] = {"flat", "groove", "raised",
+static CONST char *reliefStrings[] = {"flat", "groove", "raised",
"ridge", "solid", "sunken",
(char *) NULL};
diff --git a/generic/tkBind.c b/generic/tkBind.c
index 398c59e..77592a9 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.19 2002/01/04 16:35:04 dgp Exp $
+ * RCS: @(#) $Id: tkBind.c,v 1.20 2002/01/17 05:13:11 dgp Exp $
*/
#include "tkPort.h"
@@ -2617,7 +2617,7 @@ Tk_EventObjCmd(clientData, interp, objc, objv)
Tk_Window tkwin;
VirtualEventTable *vetPtr;
TkBindInfo bindInfo;
- static char *optionStrings[] = {
+ static CONST char *optionStrings[] = {
"add", "delete", "generate", "info",
NULL
};
@@ -3186,7 +3186,7 @@ HandleEventGenerate(interp, mainWin, objc, objv)
Tk_Window tkwin, tkwin2;
TkWindow *mainPtr;
unsigned long eventMask;
- static char *fieldStrings[] = {
+ static CONST char *fieldStrings[] = {
"-when", "-above", "-borderwidth", "-button",
"-count", "-delta", "-detail", "-focus",
"-height",
diff --git a/generic/tkButton.c b/generic/tkButton.c
index dca60a4..33a0f42 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.14 2001/12/28 01:23:47 hobbs Exp $
+ * RCS: @(#) $Id: tkButton.c,v 1.15 2002/01/17 05:13:11 dgp Exp $
*/
#include "tkButton.h"
@@ -481,7 +481,7 @@ static Tk_OptionSpec *optionSpecs[] = {
* into a single enumerated type used to dispatch the widget command.
*/
-static char *commandNames[][8] = {
+static CONST char *commandNames[][8] = {
{"cget", "configure", (char *) NULL},
{"cget", "configure", "flash", "invoke", (char *) NULL},
{"cget", "configure", "deselect", "flash", "invoke", "select",
diff --git a/generic/tkCanvas.c b/generic/tkCanvas.c
index 48cd329..e77c0f9 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.16 2001/04/03 04:40:31 hobbs Exp $
+ * RCS: @(#) $Id: tkCanvas.c,v 1.17 2002/01/17 05:13:11 dgp Exp $
*/
/* #define USE_OLD_TAG_SEARCH 1 */
@@ -527,7 +527,7 @@ CanvasWidgetCmd(clientData, interp, argc, argv)
#endif /* USE_OLD_TAG_SEARCH */
int index;
- static char *optionStrings[] = {
+ static CONST char *optionStrings[] = {
"addtag", "bbox", "bind", "canvasx",
"canvasy", "cget", "configure", "coords",
"create", "dchars", "delete", "dtag",
@@ -1620,7 +1620,7 @@ CanvasWidgetCmd(clientData, interp, argc, argv)
}
case CANV_SCAN: {
int x, y, gain=10;
- static char *optionStrings[] = {
+ static CONST char *optionStrings[] = {
"mark", "dragto", NULL
};
@@ -1668,7 +1668,7 @@ CanvasWidgetCmd(clientData, interp, argc, argv)
}
case CANV_SELECT: {
int index, optionindex;
- static char *optionStrings[] = {
+ static CONST char *optionStrings[] = {
"adjust", "clear", "from", "item", "to", NULL
};
enum options {
@@ -3972,7 +3972,7 @@ FindItems(interp, canvasPtr, argc, argv, newTag, first, searchPtrPtr)
Tk_Item *itemPtr;
Tk_Uid uid;
int index;
- static char *optionStrings[] = {
+ static CONST char *optionStrings[] = {
"above", "all", "below", "closest",
"enclosed", "overlapping", "withtag", NULL
};
diff --git a/generic/tkClipboard.c b/generic/tkClipboard.c
index 426af71..9558d0c 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.7 2000/08/01 18:52:45 ericm Exp $
+ * RCS: @(#) $Id: tkClipboard.c,v 1.8 2002/01/17 05:13:11 dgp Exp $
*/
#include "tkInt.h"
@@ -434,7 +434,7 @@ Tk_ClipboardObjCmd(clientData, interp, objc, objv)
Tk_Window tkwin = (Tk_Window) clientData;
char *path = NULL;
Atom selection;
- static char *optionStrings[] = { "append", "clear", "get", NULL };
+ static CONST char *optionStrings[] = { "append", "clear", "get", NULL };
enum options { CLIPBOARD_APPEND, CLIPBOARD_CLEAR, CLIPBOARD_GET };
int index, i;
@@ -454,8 +454,9 @@ Tk_ClipboardObjCmd(clientData, interp, objc, objv)
char *targetName = NULL;
char *formatName = NULL;
char *string;
- static char *appendOptionStrings[] = { "-displayof", "-format",
- "-type", NULL };
+ static CONST char *appendOptionStrings[] = {
+ "-displayof", "-format", "-type", NULL
+ };
enum appendOptions { APPEND_DISPLAYOF, APPEND_FORMAT,
APPEND_TYPE };
int subIndex, length;
@@ -525,7 +526,7 @@ Tk_ClipboardObjCmd(clientData, interp, objc, objv)
Tcl_GetString(objv[i]));
}
case CLIPBOARD_CLEAR: {
- static char *clearOptionStrings[] = { "-displayof", NULL };
+ static CONST char *clearOptionStrings[] = { "-displayof", NULL };
enum clearOptions { CLEAR_DISPLAYOF };
int subIndex;
if (objc != 2 && objc != 4) {
@@ -556,7 +557,9 @@ Tk_ClipboardObjCmd(clientData, interp, objc, objv)
Tcl_DString selBytes;
int result;
char *string;
- static char *getOptionStrings[] = { "-displayof", "-type", NULL };
+ static CONST char *getOptionStrings[] = {
+ "-displayof", "-type", NULL
+ };
enum getOptions { APPEND_DISPLAYOF, APPEND_TYPE };
int subIndex;
diff --git a/generic/tkCmds.c b/generic/tkCmds.c
index 2149d58..572868c 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.20 2001/09/21 21:19:02 hobbs Exp $
+ * RCS: @(#) $Id: tkCmds.c,v 1.21 2002/01/17 05:13:11 dgp Exp $
*/
#include "tkPort.h"
@@ -63,7 +63,7 @@ Tk_BellObjCmd(clientData, interp, objc, objv)
int objc; /* Number of arguments. */
Tcl_Obj *CONST objv[]; /* Argument objects. */
{
- static char *bellOptions[] = {"-displayof", "-nice", (char *) NULL};
+ static CONST char *bellOptions[] = {"-displayof", "-nice", (char *) NULL};
enum options { TK_BELL_DISPLAYOF, TK_BELL_NICE };
Tk_Window tkwin = (Tk_Window) clientData;
int i, index, nice = 0;
@@ -617,7 +617,7 @@ Tk_TkObjCmd(clientData, interp, objc, objv)
{
int index;
Tk_Window tkwin;
- static char *optionStrings[] = {
+ static CONST char *optionStrings[] = {
"appname", "scaling", "useinputmethods", NULL
};
enum options {
@@ -757,7 +757,7 @@ Tk_TkwaitObjCmd(clientData, interp, objc, objv)
{
Tk_Window tkwin = (Tk_Window) clientData;
int done, index;
- static char *optionStrings[] = { "variable", "visibility", "window",
+ static CONST char *optionStrings[] = { "variable", "visibility", "window",
(char *) NULL };
enum options { TKWAIT_VARIABLE, TKWAIT_VISIBILITY, TKWAIT_WINDOW };
@@ -919,7 +919,7 @@ Tk_UpdateObjCmd(clientData, interp, objc, objv)
int objc; /* Number of arguments. */
Tcl_Obj *CONST objv[]; /* Argument objects. */
{
- static char *updateOptions[] = {"idletasks", (char *) NULL};
+ static CONST char *updateOptions[] = {"idletasks", (char *) NULL};
int flags, index;
TkDisplay *dispPtr;
@@ -1007,7 +1007,7 @@ Tk_WinfoObjCmd(clientData, interp, objc, objv)
{StaticGray, "staticgray"},
{-1, NULL}
};
- static char *optionStrings[] = {
+ static CONST char *optionStrings[] = {
"cells", "children", "class", "colormapfull",
"depth", "geometry", "height", "id",
"ismapped", "manager", "name", "parent",
@@ -1598,7 +1598,7 @@ Tk_WmObjCmd(clientData, interp, objc, objv)
Tk_Window tkwin;
TkWindow *winPtr;
- static char *optionStrings[] = {
+ static CONST char *optionStrings[] = {
"aspect", "client", "command", "deiconify",
"focusmodel", "frame", "geometry", "grid",
"group", "iconbitmap", "iconify", "iconmask",
diff --git a/generic/tkConfig.c b/generic/tkConfig.c
index ab8b55f..e82b2ed 100644
--- a/generic/tkConfig.c
+++ b/generic/tkConfig.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: tkConfig.c,v 1.15 2001/08/15 15:44:36 dkf Exp $
+ * RCS: @(#) $Id: tkConfig.c,v 1.16 2002/01/17 05:13:11 dgp Exp $
*/
/*
@@ -743,7 +743,7 @@ DoObjConfig(interp, recordPtr, optionPtr, valuePtr, tkwin, savedOptionPtr)
int new;
if (Tcl_GetIndexFromObj(interp, valuePtr,
- (char **) optionPtr->specPtr->clientData,
+ (CONST char **) optionPtr->specPtr->clientData,
optionPtr->specPtr->optionName+1, 0, &new) != TCL_OK) {
return TCL_ERROR;
}
diff --git a/generic/tkEntry.c b/generic/tkEntry.c
index 55dc56b..a2a2a24 100644
--- a/generic/tkEntry.c
+++ b/generic/tkEntry.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: tkEntry.c,v 1.24 2002/01/17 03:35:00 dgp Exp $
+ * RCS: @(#) $Id: tkEntry.c,v 1.25 2002/01/17 05:13:11 dgp Exp $
*/
#include "tkInt.h"
@@ -597,7 +597,7 @@ static Tk_OptionSpec sbOptSpec[] = {
* enumerated types used to dispatch the entry widget command.
*/
-static char *entryCmdNames[] = {
+static CONST char *entryCmdNames[] = {
"bbox", "cget", "configure", "delete", "get", "icursor", "index",
"insert", "scan", "selection", "validate", "xview", (char *) NULL
};
@@ -608,7 +608,7 @@ enum entryCmd {
COMMAND_SCAN, COMMAND_SELECTION, COMMAND_VALIDATE, COMMAND_XVIEW
};
-static char *selCmdNames[] = {
+static CONST char *selCmdNames[] = {
"adjust", "clear", "from", "present", "range", "to", (char *) NULL
};
@@ -623,7 +623,7 @@ enum selCmd {
* enumerated types used to dispatch the spinbox widget command.
*/
-static char *sbCmdNames[] = {
+static CONST char *sbCmdNames[] = {
"bbox", "cget", "configure", "delete", "get", "icursor", "identify",
"index", "insert", "invoke", "scan", "selection", "set",
"validate", "xview", (char *) NULL
@@ -636,7 +636,7 @@ enum sbCmd {
SB_CMD_SET, SB_CMD_VALIDATE, SB_CMD_XVIEW
};
-static char *sbSelCmdNames[] = {
+static CONST char *sbSelCmdNames[] = {
"adjust", "clear", "element", "from", "present", "range", "to",
(char *) NULL
};
@@ -650,7 +650,7 @@ enum sbselCmd {
* Extra for selection of elements
*/
-static char *selElementNames[] = {
+static CONST char *selElementNames[] = {
"none", "buttondown", "buttonup", (char *) NULL, "entry"
};
enum selelement {
@@ -3959,7 +3959,8 @@ SpinboxWidgetObjCmd(clientData, interp, objc, objv)
}
elem = GetSpinboxElement(sbPtr, x, y);
if (elem != SEL_NONE) {
- Tcl_SetResult(interp, selElementNames[elem], TCL_VOLATILE);
+ Tcl_SetStringObj(Tcl_GetObjResult(interp),
+ selElementNames[elem], -1);
}
break;
}
@@ -4187,9 +4188,8 @@ SpinboxWidgetObjCmd(clientData, interp, objc, objv)
goto error;
}
if (objc == 3) {
- Tcl_SetResult(interp,
- selElementNames[sbPtr->selElement],
- TCL_VOLATILE);
+ Tcl_SetStringObj(Tcl_GetObjResult(interp),
+ selElementNames[sbPtr->selElement], -1);
} else {
int lastElement = sbPtr->selElement;
diff --git a/generic/tkFocus.c b/generic/tkFocus.c
index 44756ef..1d91495 100644
--- a/generic/tkFocus.c
+++ b/generic/tkFocus.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: tkFocus.c,v 1.5 1999/08/10 16:58:37 hobbs Exp $
+ * RCS: @(#) $Id: tkFocus.c,v 1.6 2002/01/17 05:13:11 dgp Exp $
*/
#include "tkInt.h"
@@ -121,8 +121,9 @@ Tk_FocusObjCmd(clientData, interp, objc, objv)
int objc; /* Number of arguments. */
Tcl_Obj *CONST objv[]; /* Argument objects. */
{
- static char *focusOptions[] = {"-displayof", "-force", "-lastfor",
- (char *) NULL};
+ static CONST char *focusOptions[] = {
+ "-displayof", "-force", "-lastfor", (char *) NULL
+ };
Tk_Window tkwin = (Tk_Window) clientData;
TkWindow *winPtr = (TkWindow *) clientData;
TkWindow *newPtr, *focusWinPtr, *topLevelPtr;
diff --git a/generic/tkFont.c b/generic/tkFont.c
index ded3745..2643b1f 100644
--- a/generic/tkFont.c
+++ b/generic/tkFont.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: tkFont.c,v 1.12 2001/08/15 15:44:36 dkf Exp $
+ * RCS: @(#) $Id: tkFont.c,v 1.13 2002/01/17 05:13:11 dgp Exp $
*/
#include "tkPort.h"
@@ -168,7 +168,7 @@ static TkStateMap xlfdSetwidthMap[] = {
* when configuring a set of font attributes.
*/
-static char *fontOpt[] = {
+static CONST char *fontOpt[] = {
"-family",
"-size",
"-weight",
@@ -479,7 +479,7 @@ Tk_FontObjCmd(clientData, interp, objc, objv)
int index;
Tk_Window tkwin;
TkFontInfo *fiPtr;
- static char *optionStrings[] = {
+ static CONST char *optionStrings[] = {
"actual", "configure", "create", "delete",
"families", "measure", "metrics", "names",
NULL
@@ -684,7 +684,7 @@ Tk_FontObjCmd(clientData, interp, objc, objv)
Tk_Font tkfont;
int skip, index, i;
CONST TkFontMetrics *fmPtr;
- static char *switches[] = {
+ static CONST char *switches[] = {
"-ascent", "-descent", "-linespace", "-fixed", NULL
};
diff --git a/generic/tkFrame.c b/generic/tkFrame.c
index 55dfc8f..bebc3b5 100644
--- a/generic/tkFrame.c
+++ b/generic/tkFrame.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: tkFrame.c,v 1.10 2001/09/26 21:36:19 pspjuth Exp $
+ * RCS: @(#) $Id: tkFrame.c,v 1.11 2002/01/17 05:13:11 dgp Exp $
*/
#include "default.h"
@@ -718,7 +718,7 @@ FrameWidgetObjCmd(clientData, interp, objc, objv)
int objc; /* Number of arguments. */
Tcl_Obj *CONST objv[]; /* Argument objects. */
{
- static char *frameOptions[] = {
+ static CONST char *frameOptions[] = {
"cget", "configure", (char *) NULL
};
enum options {
diff --git a/generic/tkGet.c b/generic/tkGet.c
index dd920be..7beeff7 100644
--- a/generic/tkGet.c
+++ b/generic/tkGet.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: tkGet.c,v 1.6 1999/12/14 06:52:28 hobbs Exp $
+ * RCS: @(#) $Id: tkGet.c,v 1.7 2002/01/17 05:13:11 dgp Exp $
*/
#include "tkInt.h"
@@ -37,9 +37,12 @@ static Tcl_ThreadDataKey dataKey;
* used by Tk_GetAnchorFromObj and Tk_GetJustifyFromObj.
*/
-static char *anchorStrings[] = {"n", "ne", "e", "se", "s", "sw", "w", "nw",
- "center", (char *) NULL};
-static char *justifyStrings[] = {"left", "right", "center", (char *) NULL};
+static CONST char *anchorStrings[] = {
+ "n", "ne", "e", "se", "s", "sw", "w", "nw", "center", (char *) NULL
+};
+static CONST char *justifyStrings[] = {
+ "left", "right", "center", (char *) NULL
+};
/*
diff --git a/generic/tkGrab.c b/generic/tkGrab.c
index e5b7fcf..8c16927 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.6 2000/09/06 19:02:16 hobbs Exp $
+ * RCS: @(#) $Id: tkGrab.c,v 1.7 2002/01/17 05:13:11 dgp Exp $
*/
#include "tkPort.h"
@@ -202,10 +202,10 @@ Tk_GrabObjCmd(clientData, interp, objc, objv)
char *arg;
int index;
int len;
- static char *optionStrings[] = { "current", "release",
+ static CONST char *optionStrings[] = { "current", "release",
"set", "status", (char *) NULL };
- static char *flagStrings[] = { "-global", (char *) NULL };
+ static CONST char *flagStrings[] = { "-global", (char *) NULL };
enum options { GRABCMD_CURRENT, GRABCMD_RELEASE,
GRABCMD_SET, GRABCMD_STATUS };
diff --git a/generic/tkGrid.c b/generic/tkGrid.c
index 9b387da..3d2fb40 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.19 2002/01/04 16:35:04 dgp Exp $
+ * RCS: @(#) $Id: tkGrid.c,v 1.20 2002/01/17 05:13:11 dgp Exp $
*/
#include "tkInt.h"
@@ -333,7 +333,7 @@ Tk_GridObjCmd(clientData, interp, objc, objv)
Tcl_Obj *CONST objv[]; /* Argument objects. */
{
Tk_Window tkwin = (Tk_Window) clientData;
- static char *optionStrings[] = {
+ static CONST char *optionStrings[] = {
"bbox", "columnconfigure", "configure", "forget",
"info", "location", "propagate", "remove",
"rowconfigure", "size", "slaves", (char *) NULL };
@@ -849,7 +849,7 @@ GridRowColumnConfigureCommand(tkwin, interp, objc, objv)
int ok; /* temporary TCL result code */
int i, j;
char *string;
- static char *optionStrings[] = {
+ static CONST char *optionStrings[] = {
"-minsize", "-pad", "-uniform", "-weight", (char *) NULL };
enum options { ROWCOL_MINSIZE, ROWCOL_PAD, ROWCOL_UNIFORM, ROWCOL_WEIGHT };
int index;
@@ -1117,7 +1117,7 @@ GridSlavesCommand(tkwin, interp, objc, objv)
Gridder *slavePtr;
int i, value;
int row = -1, column = -1;
- static char *optionStrings[] = {
+ static CONST char *optionStrings[] = {
"-column", "-row", (char *) NULL };
enum options { SLAVES_COLUMN, SLAVES_ROW };
int index;
@@ -2536,7 +2536,7 @@ ConfigureSlaves(interp, tkwin, objc, objv)
char *lastWindow; /* use this window to base current
* Row/col on */
int numSkip; /* number of 'x' found */
- static char *optionStrings[] = {
+ static CONST char *optionStrings[] = {
"-column", "-columnspan", "-in", "-ipadx", "-ipady",
"-padx", "-pady", "-row", "-rowspan", "-sticky",
(char *) NULL };
diff --git a/generic/tkImage.c b/generic/tkImage.c
index b629816..bdd6cc7 100644
--- a/generic/tkImage.c
+++ b/generic/tkImage.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: tkImage.c,v 1.12 2001/04/12 12:30:42 dkf Exp $
+ * RCS: @(#) $Id: tkImage.c,v 1.13 2002/01/17 05:13:11 dgp Exp $
*/
#include "tkInt.h"
@@ -160,7 +160,7 @@ Tk_ImageObjCmd(clientData, interp, objc, objv)
int objc; /* Number of arguments. */
Tcl_Obj *CONST objv[]; /* Argument strings. */
{
- static char *imageOptions[] = {
+ static CONST char *imageOptions[] = {
"create", "delete", "height", "inuse", "names", "type", "types",
"width", (char *) NULL
};
diff --git a/generic/tkImgBmap.c b/generic/tkImgBmap.c
index 8f03e74..847d4b8 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.12 2001/07/14 15:53:53 drh Exp $
+ * RCS: @(#) $Id: tkImgBmap.c,v 1.13 2002/01/17 05:13:11 dgp Exp $
*/
#include "tkInt.h"
@@ -761,7 +761,7 @@ ImgBmapCmd(clientData, interp, objc, objv)
int objc; /* Number of arguments. */
Tcl_Obj *CONST objv[]; /* Argument objects. */
{
- static char *bmapOptions[] = {"cget", "configure", (char *) NULL};
+ static CONST char *bmapOptions[] = {"cget", "configure", (char *) NULL};
BitmapMaster *masterPtr = (BitmapMaster *) clientData;
int code, index;
diff --git a/generic/tkImgGIF.c b/generic/tkImgGIF.c
index 108c7ad..5b79558 100644
--- a/generic/tkImgGIF.c
+++ b/generic/tkImgGIF.c
@@ -29,7 +29,7 @@
* | provided "as is" without express or implied warranty. |
* +-------------------------------------------------------------------+
*
- * RCS: @(#) $Id: tkImgGIF.c,v 1.18 2001/09/14 20:35:58 andreas_kupries Exp $
+ * RCS: @(#) $Id: tkImgGIF.c,v 1.19 2002/01/17 05:13:11 dgp Exp $
*/
/*
@@ -249,7 +249,7 @@ FileReadGIF(interp, chan, fileName, format, imageHandle, destX, destY,
int bitPixel;
unsigned char colorMap[MAXCOLORMAPSIZE][4];
int transparent = -1;
- static char *optionStrings[] = {
+ static CONST char *optionStrings[] = {
"-index", NULL
};
diff --git a/generic/tkImgPhoto.c b/generic/tkImgPhoto.c
index 59391a7..bfbd254 100644
--- a/generic/tkImgPhoto.c
+++ b/generic/tkImgPhoto.c
@@ -15,7 +15,7 @@
* Department of Computer Science,
* Australian National University.
*
- * RCS: @(#) $Id: tkImgPhoto.c,v 1.25 2001/12/07 04:17:25 chengyemao Exp $
+ * RCS: @(#) $Id: tkImgPhoto.c,v 1.26 2002/01/17 05:13:11 dgp Exp $
*/
#include "tkInt.h"
@@ -563,7 +563,7 @@ ImgPhotoCmd(clientData, interp, objc, objv)
Tcl_Obj *CONST objv[]; /* Argument objects. */
{
int oldformat = 0;
- static char *photoOptions[] = {
+ static CONST char *photoOptions[] = {
"blank", "cget", "configure", "copy", "data", "get", "put",
"read", "redither", "write", (char *) NULL
};
diff --git a/generic/tkListbox.c b/generic/tkListbox.c
index a939479..fc4c223 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.22 2001/08/29 23:22:24 hobbs Exp $
+ * RCS: @(#) $Id: tkListbox.c,v 1.23 2002/01/17 05:13:11 dgp Exp $
*/
#include "tkPort.h"
@@ -321,7 +321,7 @@ static Tk_OptionSpec itemAttrOptionSpecs[] = {
* commands) and map the indexes into the string tables into
* enumerated types used to dispatch the listbox widget command.
*/
-static char *commandNames[] = {
+static CONST char *commandNames[] = {
"activate", "bbox", "cget", "configure", "curselection", "delete", "get",
"index", "insert", "itemcget", "itemconfigure", "nearest", "scan",
"see", "selection", "size", "xview", "yview",
@@ -336,7 +336,7 @@ enum command {
COMMAND_SIZE, COMMAND_XVIEW, COMMAND_YVIEW
};
-static char *selCommandNames[] = {
+static CONST char *selCommandNames[] = {
"anchor", "clear", "includes", "set", (char *) NULL
};
@@ -344,7 +344,7 @@ enum selcommand {
SELECTION_ANCHOR, SELECTION_CLEAR, SELECTION_INCLUDES, SELECTION_SET
};
-static char *scanCommandNames[] = {
+static CONST char *scanCommandNames[] = {
"mark", "dragto", (char *) NULL
};
@@ -352,7 +352,7 @@ enum scancommand {
SCAN_MARK, SCAN_DRAGTO
};
-static char *indexNames[] = {
+static CONST char *indexNames[] = {
"active", "anchor", "end", (char *)NULL
};
diff --git a/generic/tkMenu.c b/generic/tkMenu.c
index ff50130..ff45455 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.13 2001/10/12 13:30:31 tmh Exp $
+ * RCS: @(#) $Id: tkMenu.c,v 1.14 2002/01/17 05:13:11 dgp Exp $
*/
/*
@@ -105,8 +105,10 @@ TCL_DECLARE_MUTEX(menuMutex)
char *tkMenuStateStrings[] = {"active", "normal", "disabled", (char *) NULL};
-static char *menuEntryTypeStrings[] = {"cascade", "checkbutton", "command",
- "radiobutton", "separator", (char *) NULL};
+static CONST char *menuEntryTypeStrings[] = {
+ "cascade", "checkbutton", "command", "radiobutton", "separator",
+ (char *) NULL
+};
/*
* The following table defines the legal values for the -compound option.
@@ -243,7 +245,7 @@ static Tk_OptionSpec *specsArray[] = {
* Menu type strings for use with Tcl_GetIndexFromObj.
*/
-static char *menuTypeStrings[] = {"normal", "tearoff", "menubar",
+static CONST char *menuTypeStrings[] = {"normal", "tearoff", "menubar",
(char *) NULL};
Tk_OptionSpec tkMenuConfigSpecs[] = {
@@ -311,7 +313,7 @@ Tk_OptionSpec tkMenuConfigSpecs[] = {
* along with MenuWidgetObjCmd.
*/
-static char *menuOptions[] = {
+static CONST char *menuOptions[] = {
"activate", "add", "cget", "clone", "configure", "delete", "entrycget",
"entryconfigure", "index", "insert", "invoke", "post", "postcascade",
"type", "unpost", "yposition", (char *) NULL
@@ -463,7 +465,7 @@ MenuCmd(clientData, interp, objc, objv)
int i, index;
int toplevel;
char *windowName;
- static char *typeStringList[] = {"-type", (char *) NULL};
+ static CONST char *typeStringList[] = {"-type", (char *) NULL};
TkMenuOptionTables *optionTablesPtr = (TkMenuOptionTables *) clientData;
if (objc < 2) {
@@ -1012,9 +1014,9 @@ MenuWidgetObjCmd(clientData, interp, objc, objv)
if (menuPtr->entries[index]->type == TEAROFF_ENTRY) {
Tcl_SetResult(interp, "tearoff", TCL_STATIC);
} else {
- Tcl_SetResult(interp,
+ Tcl_SetStringObj(Tcl_GetObjResult(interp),
menuEntryTypeStrings[menuPtr->entries[index]->type],
- TCL_STATIC);
+ -1);
}
break;
}
diff --git a/generic/tkMenubutton.c b/generic/tkMenubutton.c
index 28d82a9..05559d7 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.8 2001/10/12 13:30:31 tmh Exp $
+ * RCS: @(#) $Id: tkMenubutton.c,v 1.9 2002/01/17 05:13:11 dgp Exp $
*/
#include "tkMenubutton.h"
@@ -155,7 +155,7 @@ static Tk_OptionSpec optionSpecs[] = {
* to dispatch the scale widget command.
*/
-static char *commandNames[] = {
+static CONST char *commandNames[] = {
"cget", "configure", (char *) NULL
};
diff --git a/generic/tkMessage.c b/generic/tkMessage.c
index 1e82ba5..051ee57 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.10 2001/08/29 23:22:24 hobbs Exp $
+ * RCS: @(#) $Id: tkMessage.c,v 1.11 2002/01/17 05:13:11 dgp Exp $
*/
#include "tkPort.h"
@@ -313,7 +313,7 @@ MessageWidgetObjCmd(clientData, interp, objc, objv)
Tcl_Obj *CONST objv[]; /* Argument strings. */
{
register Message *msgPtr = (Message *) clientData;
- static char *optionStrings[] = { "cget", "configure", (char *) NULL };
+ static CONST char *optionStrings[] = { "cget", "configure", (char *) NULL };
enum options { MESSAGE_CGET, MESSAGE_CONFIGURE };
int index;
int result = TCL_OK;
diff --git a/generic/tkOption.c b/generic/tkOption.c
index d0cb8bc..f9d9935 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.8 2000/05/30 17:35:19 ericm Exp $
+ * RCS: @(#) $Id: tkOption.c,v 1.9 2002/01/17 05:13:11 dgp Exp $
*/
#include "tkPort.h"
@@ -638,7 +638,7 @@ Tk_OptionObjCmd(clientData, interp, objc, objv)
ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
- static char *optionCmds[] = {
+ static CONST char *optionCmds[] = {
"add", "clear", "get", "readfile", NULL
};
diff --git a/generic/tkPack.c b/generic/tkPack.c
index a8757b0..8033b7b 100644
--- a/generic/tkPack.c
+++ b/generic/tkPack.c
@@ -10,14 +10,16 @@
* 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.14 2001/11/23 02:06:57 das Exp $
+ * RCS: @(#) $Id: tkPack.c,v 1.15 2002/01/17 05:13:11 dgp Exp $
*/
#include "tkPort.h"
#include "tkInt.h"
typedef enum {TOP, BOTTOM, LEFT, RIGHT} Side;
-static char *sideNames[] = {"top", "bottom", "left", "right", (char *) NULL };
+static CONST char *sideNames[] = {
+ "top", "bottom", "left", "right", (char *) NULL
+};
/* For each window that the packer cares about (either because
* the window is managed by the packer or because the window
@@ -201,7 +203,7 @@ Tk_PackObjCmd(clientData, interp, objc, objv)
{
Tk_Window tkwin = (Tk_Window) clientData;
char *argv2;
- static char *optionStrings[] = {
+ static CONST char *optionStrings[] = {
/* after, append, before and unpack are deprecated */
"after", "append", "before", "unpack",
"configure", "forget", "info", "propagate", "slaves", (char *) NULL };
@@ -1550,7 +1552,7 @@ ConfigureSlaves(interp, tkwin, objc, objv)
Tk_Window other, slave, parent, ancestor;
int i, j, numWindows, tmp, positionGiven;
char *string;
- static char *optionStrings[] = {
+ static CONST char *optionStrings[] = {
"-after", "-anchor", "-before", "-expand", "-fill",
"-in", "-ipadx", "-ipady", "-padx", "-pady", "-side", (char *) NULL };
enum options {
diff --git a/generic/tkPlace.c b/generic/tkPlace.c
index 746581a..4913b40 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.10 2001/09/26 20:25:17 pspjuth Exp $
+ * RCS: @(#) $Id: tkPlace.c,v 1.11 2002/01/17 05:13:11 dgp Exp $
*/
#include "tkPort.h"
@@ -209,8 +209,9 @@ Tk_PlaceObjCmd(clientData, interp, objc, objv)
char *string;
TkDisplay *dispPtr;
Tk_OptionTable optionTable;
- static char *optionStrings[] = { "configure", "forget", "info", "slaves",
- (char *) NULL };
+ static CONST char *optionStrings[] = {
+ "configure", "forget", "info", "slaves", (char *) NULL
+ };
enum options { PLACE_CONFIGURE, PLACE_FORGET, PLACE_INFO, PLACE_SLAVES };
int index;
diff --git a/generic/tkScale.c b/generic/tkScale.c
index 1be68ec..dea11f0 100644
--- a/generic/tkScale.c
+++ b/generic/tkScale.c
@@ -18,7 +18,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.14 2001/08/29 23:22:24 hobbs Exp $
+ * RCS: @(#) $Id: tkScale.c,v 1.15 2002/01/17 05:13:11 dgp Exp $
*/
#include "tkPort.h"
@@ -147,7 +147,7 @@ static Tk_OptionSpec optionSpecs[] = {
* to dispatch the scale widget command.
*/
-static char *commandNames[] = {
+static CONST char *commandNames[] = {
"cget", "configure", "coords", "get", "identify", "set", (char *) NULL
};
diff --git a/generic/tkSelect.c b/generic/tkSelect.c
index 71b73d0..ed718a3 100644
--- a/generic/tkSelect.c
+++ b/generic/tkSelect.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: tkSelect.c,v 1.9 2002/01/17 03:35:00 dgp Exp $
+ * RCS: @(#) $Id: tkSelect.c,v 1.10 2002/01/17 05:13:11 dgp Exp $
*/
#include "tkInt.h"
@@ -690,8 +690,9 @@ Tk_SelectionObjCmd(clientData, interp, objc, objv)
char *selName = NULL, *string;
int count, index;
Tcl_Obj **objs;
- static char *optionStrings[] = { "clear", "get", "handle", "own",
- (char *) NULL };
+ static CONST char *optionStrings[] = {
+ "clear", "get", "handle", "own", (char *) NULL
+ };
enum options { SELECTION_CLEAR, SELECTION_GET, SELECTION_HANDLE,
SELECTION_OWN };
@@ -707,8 +708,9 @@ Tk_SelectionObjCmd(clientData, interp, objc, objv)
switch ((enum options) index) {
case SELECTION_CLEAR: {
- static char *clearOptionStrings[] = { "-displayof", "-selection",
- (char *) NULL };
+ static CONST char *clearOptionStrings[] = {
+ "-displayof", "-selection", (char *) NULL
+ };
enum clearOptions { CLEAR_DISPLAYOF, CLEAR_SELECTION };
int clearIndex;
@@ -764,8 +766,9 @@ Tk_SelectionObjCmd(clientData, interp, objc, objv)
char *targetName = NULL;
Tcl_DString selBytes;
int result;
- static char *getOptionStrings[] = { "-displayof", "-selection",
- "-type", (char *) NULL };
+ static CONST char *getOptionStrings[] = {
+ "-displayof", "-selection", "-type", (char *) NULL
+ };
enum getOptions { GET_DISPLAYOF, GET_SELECTION, GET_TYPE };
int getIndex;
@@ -837,8 +840,9 @@ Tk_SelectionObjCmd(clientData, interp, objc, objv)
char *formatName = NULL;
register CommandInfo *cmdInfoPtr;
int cmdLength;
- static char *handleOptionStrings[] = { "-format", "-selection",
- "-type", (char *) NULL };
+ static CONST char *handleOptionStrings[] = {
+ "-format", "-selection", "-type", (char *) NULL
+ };
enum handleOptions { HANDLE_FORMAT, HANDLE_SELECTION,
HANDLE_TYPE };
int handleIndex;
@@ -923,7 +927,7 @@ Tk_SelectionObjCmd(clientData, interp, objc, objv)
register LostCommand *lostPtr;
char *script = NULL;
int cmdLength;
- static char *ownOptionStrings[] = {
+ static CONST char *ownOptionStrings[] = {
"-command", "-displayof", "-selection", (char *) NULL
};
enum ownOptions { OWN_COMMAND, OWN_DISPLAYOF, OWN_SELECTION };
diff --git a/generic/tkTest.c b/generic/tkTest.c
index b047b2d..afc882d 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.15 2000/10/30 20:04:16 ericm Exp $
+ * RCS: @(#) $Id: tkTest.c,v 1.16 2002/01/17 05:13:11 dgp Exp $
*/
#include "tkInt.h"
@@ -631,7 +631,7 @@ TestobjconfigObjCmd(clientData, interp, objc, objv)
int objc; /* Number of arguments. */
Tcl_Obj *CONST objv[]; /* Argument objects. */
{
- static char *options[] = {"alltypes", "chain1", "chain2",
+ static CONST char *options[] = {"alltypes", "chain1", "chain2",
"configerror", "delete", "info", "internal", "new",
"notenoughparams", "twowindows", (char *) NULL};
enum {
@@ -1354,7 +1354,9 @@ TrivialConfigObjCmd(clientData, interp, objc, objv)
Tcl_Obj *CONST objv[]; /* Argument objects. */
{
int result = TCL_OK;
- static char *options[] = {"cget", "configure", "csave", (char *) NULL};
+ static CONST char *options[] = {
+ "cget", "configure", "csave", (char *) NULL
+ };
enum {
CGET, CONFIGURE, CSAVE
};
@@ -1538,7 +1540,7 @@ TestfontObjCmd(clientData, interp, objc, objv)
int objc; /* Number of arguments. */
Tcl_Obj *CONST objv[]; /* Argument objects. */
{
- static char *options[] = {"counts", "subfonts", (char *) NULL};
+ static CONST char *options[] = {"counts", "subfonts", (char *) NULL};
enum option {COUNTS, SUBFONTS};
int index;
Tk_Window tkwin;