summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authornijtmans <nijtmans>2007-01-05 00:00:47 (GMT)
committernijtmans <nijtmans>2007-01-05 00:00:47 (GMT)
commit67771314a2fb4326cc411f74011c1d47edd3bfa5 (patch)
treeef0668274bd47be5de7af3d70163084f9e530aa3 /generic
parentb89f2e9fa3ed933c2d1599be0cdc0f4616ae17c7 (diff)
downloadtk-67771314a2fb4326cc411f74011c1d47edd3bfa5.zip
tk-67771314a2fb4326cc411f74011c1d47edd3bfa5.tar.gz
tk-67771314a2fb4326cc411f74011c1d47edd3bfa5.tar.bz2
various "const" additions, in line with TIP #27
fix bug #1627732
Diffstat (limited to 'generic')
-rw-r--r--generic/tk.h12
-rw-r--r--generic/tkButton.c50
-rw-r--r--generic/tkCanvWind.c4
-rw-r--r--generic/tkFrame.c4
-rw-r--r--generic/tkGrid.c4
-rw-r--r--generic/tkMenu.h4
-rw-r--r--generic/tkPack.c4
-rw-r--r--generic/tkPanedWindow.c4
-rw-r--r--generic/tkPlace.c4
-rw-r--r--generic/tkTextWind.c4
10 files changed, 47 insertions, 47 deletions
diff --git a/generic/tk.h b/generic/tk.h
index 6927370..560967a 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.92 2007/01/03 05:06:26 nijtmans Exp $
+ * RCS: @(#) $Id: tk.h,v 1.93 2007/01/05 00:00:50 nijtmans Exp $
*/
#ifndef _TK
@@ -163,11 +163,11 @@ typedef struct Tk_OptionSpec {
Tk_OptionType type; /* Type of option, such as TK_OPTION_COLOR;
* see definitions above. Last option in table
* must have type TK_OPTION_END. */
- char *optionName; /* Name used to specify option in Tcl
+ const char *optionName; /* Name used to specify option in Tcl
* commands. */
- char *dbName; /* Name for option in option database. */
- char *dbClass; /* Class for option in database. */
- char *defValue; /* Default value for option if not specified
+ const char *dbName; /* Name for option in option database. */
+ const char *dbClass; /* Class for option in database. */
+ const char *defValue; /* Default value for option if not specified
* in command line, the option database, or
* the system. */
int objOffset; /* Where in record to store a Tcl_Obj * that
@@ -223,7 +223,7 @@ typedef void (Tk_CustomOptionFreeProc) _ANSI_ARGS_((ClientData clientData,
Tk_Window tkwin, char *internalPtr));
typedef struct Tk_ObjCustomOption {
- char *name; /* Name of the custom option. */
+ const char *name; /* Name of the custom option. */
Tk_CustomOptionSetProc *setProc;
/* Function to use to set a record's option
* value from a Tcl_Obj */
diff --git a/generic/tkButton.c b/generic/tkButton.c
index 0af1702..8794b47 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.25 2007/01/03 04:10:54 nijtmans Exp $
+ * RCS: @(#) $Id: tkButton.c,v 1.26 2007/01/05 00:00:50 nijtmans Exp $
*/
#include "tkButton.h"
@@ -61,7 +61,7 @@ static const char *compoundStrings[] = {
* separate table for each of the four widget classes.
*/
-static const Tk_OptionSpec labelOptionSpecs[] = {
+static Tk_OptionSpec labelOptionSpecs[] = {
{TK_OPTION_BORDER, "-activebackground", "activeBackground", "Foreground",
DEF_BUTTON_ACTIVE_BG_COLOR, -1, Tk_Offset(TkButton, activeBorder),
0, (ClientData) DEF_BUTTON_ACTIVE_BG_MONO, 0},
@@ -146,7 +146,7 @@ static const Tk_OptionSpec labelOptionSpecs[] = {
{TK_OPTION_END, NULL, NULL, NULL, NULL, 0, 0, 0, 0}
};
-static const Tk_OptionSpec buttonOptionSpecs[] = {
+static Tk_OptionSpec buttonOptionSpecs[] = {
{TK_OPTION_BORDER, "-activebackground", "activeBackground", "Foreground",
DEF_BUTTON_ACTIVE_BG_COLOR, -1, Tk_Offset(TkButton, activeBorder),
0, (ClientData) DEF_BUTTON_ACTIVE_BG_MONO, 0},
@@ -247,7 +247,7 @@ static const Tk_OptionSpec buttonOptionSpecs[] = {
{TK_OPTION_END, NULL, NULL, NULL, NULL, 0, -1, 0, 0, 0}
};
-static const Tk_OptionSpec checkbuttonOptionSpecs[] = {
+static Tk_OptionSpec checkbuttonOptionSpecs[] = {
{TK_OPTION_BORDER, "-activebackground", "activeBackground", "Foreground",
DEF_BUTTON_ACTIVE_BG_COLOR, -1, Tk_Offset(TkButton, activeBorder),
0, (ClientData) DEF_BUTTON_ACTIVE_BG_MONO, 0},
@@ -360,7 +360,7 @@ static const Tk_OptionSpec checkbuttonOptionSpecs[] = {
{TK_OPTION_END, NULL, NULL, NULL, NULL, 0, -1, 0, 0, 0}
};
-static const Tk_OptionSpec radiobuttonOptionSpecs[] = {
+static Tk_OptionSpec radiobuttonOptionSpecs[] = {
{TK_OPTION_BORDER, "-activebackground", "activeBackground", "Foreground",
DEF_BUTTON_ACTIVE_BG_COLOR, -1, Tk_Offset(TkButton, activeBorder),
0, (ClientData) DEF_BUTTON_ACTIVE_BG_MONO, 0},
@@ -477,7 +477,7 @@ static const Tk_OptionSpec radiobuttonOptionSpecs[] = {
* such as TYPE_LABEL, to the option template for that class of widgets.
*/
-static const Tk_OptionSpec * const optionSpecs[] = {
+static Tk_OptionSpec * const optionSpecs[] = {
labelOptionSpecs,
buttonOptionSpecs,
checkbuttonOptionSpecs,
@@ -490,7 +490,7 @@ static const Tk_OptionSpec * const optionSpecs[] = {
* enumerated type used to dispatch the widget command.
*/
-static CONST char *commandNames[][8] = {
+static const char *commandNames[][8] = {
{"cget", "configure", NULL},
{"cget", "configure", "flash", "invoke", NULL},
{"cget", "configure", "deselect", "flash", "invoke", "select",
@@ -517,7 +517,7 @@ static enum command map[][8] = {
static void ButtonCmdDeletedProc(ClientData clientData);
static int ButtonCreate(ClientData clientData,
Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[], int type);
+ Tcl_Obj *const objv[], int type);
static void ButtonEventProc(ClientData clientData,
XEvent *eventPtr);
static void ButtonImageProc(ClientData clientData,
@@ -530,16 +530,16 @@ static void ButtonTristateImageProc(ClientData clientData,
int x, int y, int width, int height,
int imgWidth, int imgHeight);
static char * ButtonTextVarProc(ClientData clientData,
- Tcl_Interp *interp, CONST char *name1,
- CONST char *name2, int flags);
+ Tcl_Interp *interp, const char *name1,
+ const char *name2, int flags);
static char * ButtonVarProc(ClientData clientData,
- Tcl_Interp *interp, CONST char *name1,
- CONST char *name2, int flags);
+ Tcl_Interp *interp, const char *name1,
+ const char *name2, int flags);
static int ButtonWidgetObjCmd(ClientData clientData,
Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]);
+ Tcl_Obj *const objv[]);
static int ConfigureButton(Tcl_Interp *interp, TkButton *butPtr,
- int objc, Tcl_Obj *CONST objv[]);
+ int objc, Tcl_Obj *const objv[]);
static void DestroyButton(TkButton *butPtr);
/*
@@ -566,7 +566,7 @@ Tk_ButtonObjCmd(
ClientData clientData, /* Either NULL or pointer to option table. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument values. */
+ Tcl_Obj *const objv[]) /* Argument values. */
{
return ButtonCreate(clientData, interp, objc, objv, TYPE_BUTTON);
}
@@ -576,7 +576,7 @@ Tk_CheckbuttonObjCmd(
ClientData clientData, /* Either NULL or pointer to option table. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument values. */
+ Tcl_Obj *const objv[]) /* Argument values. */
{
return ButtonCreate(clientData, interp, objc, objv, TYPE_CHECK_BUTTON);
}
@@ -586,7 +586,7 @@ Tk_LabelObjCmd(
ClientData clientData, /* Either NULL or pointer to option table. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument values. */
+ Tcl_Obj *const objv[]) /* Argument values. */
{
return ButtonCreate(clientData, interp, objc, objv, TYPE_LABEL);
}
@@ -596,7 +596,7 @@ Tk_RadiobuttonObjCmd(
ClientData clientData, /* Either NULL or pointer to option table. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument values. */
+ Tcl_Obj *const objv[]) /* Argument values. */
{
return ButtonCreate(clientData, interp, objc, objv, TYPE_RADIO_BUTTON);
}
@@ -624,7 +624,7 @@ ButtonCreate(
ClientData clientData, /* NULL. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[], /* Argument values. */
+ Tcl_Obj *const objv[], /* Argument values. */
int type) /* Type of button to create: TYPE_LABEL,
* TYPE_BUTTON, TYPE_CHECK_BUTTON, or
* TYPE_RADIO_BUTTON. */
@@ -780,7 +780,7 @@ ButtonWidgetObjCmd(
ClientData clientData, /* Information about button widget. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument values. */
+ Tcl_Obj *const objv[]) /* Argument values. */
{
TkButton *butPtr = (TkButton *) clientData;
int index;
@@ -1029,7 +1029,7 @@ ConfigureButton(
register TkButton *butPtr, /* Information about widget; may or may
* not already have values for some fields. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument values. */
+ Tcl_Obj *const objv[]) /* Argument values. */
{
Tk_SavedOptions savedOptions;
Tcl_Obj *errorResult = NULL;
@@ -1589,8 +1589,8 @@ static char *
ButtonVarProc(
ClientData clientData, /* Information about button. */
Tcl_Interp *interp, /* Interpreter containing variable. */
- CONST char *name1, /* Name of variable. */
- CONST char *name2, /* Second part of variable name. */
+ const char *name1, /* Name of variable. */
+ const char *name2, /* Second part of variable name. */
int flags) /* Information about what happened. */
{
register TkButton *butPtr = (TkButton *) clientData;
@@ -1675,8 +1675,8 @@ static char *
ButtonTextVarProc(
ClientData clientData, /* Information about button. */
Tcl_Interp *interp, /* Interpreter containing variable. */
- CONST char *name1, /* Not used. */
- CONST char *name2, /* Not used. */
+ const char *name1, /* Not used. */
+ const char *name2, /* Not used. */
int flags) /* Information about what happened. */
{
TkButton *butPtr = (TkButton *) clientData;
diff --git a/generic/tkCanvWind.c b/generic/tkCanvWind.c
index 752dc00..27cf963 100644
--- a/generic/tkCanvWind.c
+++ b/generic/tkCanvWind.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: tkCanvWind.c,v 1.13 2006/05/12 18:17:48 das Exp $
+ * RCS: @(#) $Id: tkCanvWind.c,v 1.14 2007/01/05 00:00:51 nijtmans Exp $
*/
#include <stdio.h>
@@ -143,7 +143,7 @@ Tk_ItemType tkWindowType = {
* geometry manager):
*/
-static Tk_GeomMgr canvasGeomType = {
+static const Tk_GeomMgr canvasGeomType = {
"canvas", /* name */
WinItemRequestProc, /* requestProc */
WinItemLostSlaveProc, /* lostSlaveProc */
diff --git a/generic/tkFrame.c b/generic/tkFrame.c
index b7cb2bc..b0a591b 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.25 2007/01/03 05:06:26 nijtmans Exp $
+ * RCS: @(#) $Id: tkFrame.c,v 1.26 2007/01/05 00:00:50 nijtmans Exp $
*/
#include "default.h"
@@ -340,7 +340,7 @@ static Tk_ClassProcs frameClass = {
* geometry manager:
*/
-static Tk_GeomMgr frameGeomType = {
+static const Tk_GeomMgr frameGeomType = {
"labelframe", /* name */
FrameRequestProc, /* requestProc */
FrameLostSlaveProc /* lostSlaveProc */
diff --git a/generic/tkGrid.c b/generic/tkGrid.c
index fa3281b..6d625c0 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.44 2006/04/11 21:52:20 pspjuth Exp $
+ * RCS: @(#) $Id: tkGrid.c,v 1.45 2007/01/05 00:00:51 nijtmans Exp $
*/
#include "tkInt.h"
@@ -303,7 +303,7 @@ static void StickyToString(int flags, char *result);
static int StringToSticky(char *string);
static void Unlink(Gridder *gridPtr);
-static Tk_GeomMgr gridMgrType = {
+static const Tk_GeomMgr gridMgrType = {
"grid", /* name */
GridReqProc, /* requestProc */
GridLostSlaveProc, /* lostSlaveProc */
diff --git a/generic/tkMenu.h b/generic/tkMenu.h
index 1863c9d..0c726a0 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.11 2005/11/27 02:36:14 das Exp $
+ * RCS: @(#) $Id: tkMenu.h,v 1.12 2007/01/05 00:00:51 nijtmans Exp $
*/
#ifndef _TKMENU
@@ -546,7 +546,7 @@ MODULE_SCOPE void TkpDestroyMenu(TkMenu *menuPtr);
MODULE_SCOPE void TkpDestroyMenuEntry(TkMenuEntry *mEntryPtr);
MODULE_SCOPE void TkpDrawMenuEntry(TkMenuEntry *mePtr,
Drawable d, Tk_Font tkfont,
- CONST Tk_FontMetrics *menuMetricsPtr, int x,
+ const Tk_FontMetrics *menuMetricsPtr, int x,
int y, int width, int height, int strictMotif,
int drawArrow);
MODULE_SCOPE void TkpMenuInit(void);
diff --git a/generic/tkPack.c b/generic/tkPack.c
index 416d197..67074f7 100644
--- a/generic/tkPack.c
+++ b/generic/tkPack.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: tkPack.c,v 1.24 2005/11/17 10:57:35 dkf Exp $
+ * RCS: @(#) $Id: tkPack.c,v 1.25 2007/01/05 00:00:51 nijtmans Exp $
*/
#include "tkPort.h"
@@ -107,7 +107,7 @@ static void PackReqProc(ClientData clientData, Tk_Window tkwin);
static void PackLostSlaveProc(ClientData clientData,
Tk_Window tkwin);
-static Tk_GeomMgr packerType = {
+static const Tk_GeomMgr packerType = {
"pack", /* name */
PackReqProc, /* requestProc */
PackLostSlaveProc, /* lostSlaveProc */
diff --git a/generic/tkPanedWindow.c b/generic/tkPanedWindow.c
index 661e513..283061d 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.26 2007/01/03 05:06:25 nijtmans Exp $
+ * RCS: @(#) $Id: tkPanedWindow.c,v 1.27 2007/01/05 00:00:50 nijtmans Exp $
*/
#include "tkPort.h"
@@ -244,7 +244,7 @@ static int PanedWindowIdentifyCoords(PanedWindow *pwPtr,
#define ValidSashIndex(pwPtr, sash) \
(((sash) >= 0) && ((sash) < ((pwPtr)->numSlaves-1)))
-static Tk_GeomMgr panedWindowMgrType = {
+static const Tk_GeomMgr panedWindowMgrType = {
"panedwindow", /* name */
PanedWindowReqProc, /* requestProc */
PanedWindowLostSlaveProc, /* lostSlaveProc */
diff --git a/generic/tkPlace.c b/generic/tkPlace.c
index e3ec254..9effd23 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.19 2007/01/03 05:06:26 nijtmans Exp $
+ * RCS: @(#) $Id: tkPlace.c,v 1.20 2007/01/05 00:00:50 nijtmans Exp $
*/
#include "tkPort.h"
@@ -153,7 +153,7 @@ static void PlaceRequestProc(ClientData clientData,
static void PlaceLostSlaveProc(ClientData clientData,
Tk_Window tkwin);
-static Tk_GeomMgr placerType = {
+static const Tk_GeomMgr placerType = {
"place", /* name */
PlaceRequestProc, /* requestProc */
PlaceLostSlaveProc, /* lostSlaveProc */
diff --git a/generic/tkTextWind.c b/generic/tkTextWind.c
index 73d8973..4a577c8 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.18 2007/01/03 05:06:26 nijtmans Exp $
+ * RCS: @(#) $Id: tkTextWind.c,v 1.19 2007/01/05 00:00:51 nijtmans Exp $
*/
#include "tk.h"
@@ -28,7 +28,7 @@ static void EmbWinRequestProc(ClientData clientData,
static void EmbWinLostSlaveProc(ClientData clientData,
Tk_Window tkwin);
-static Tk_GeomMgr textGeomType = {
+static const Tk_GeomMgr textGeomType = {
"text", /* name */
EmbWinRequestProc, /* requestProc */
EmbWinLostSlaveProc, /* lostSlaveProc */