diff options
author | nijtmans@users.sourceforge.net <jan.nijtmans> | 2012-06-19 10:29:25 (GMT) |
---|---|---|
committer | nijtmans@users.sourceforge.net <jan.nijtmans> | 2012-06-19 10:29:25 (GMT) |
commit | 535f333caf6ab0fb1ac3781ec38d59b2687d87da (patch) | |
tree | 71968a06df024ea74a2bc06c881ffd4d50c04891 | |
parent | 83daa8bd44342d161d880468d63e046f9298dc31 (diff) | |
parent | 54873af19f269ce0bf55cb91d31e0ff4aa43eb29 (diff) | |
download | tk-535f333caf6ab0fb1ac3781ec38d59b2687d87da.zip tk-535f333caf6ab0fb1ac3781ec38d59b2687d87da.tar.gz tk-535f333caf6ab0fb1ac3781ec38d59b2687d87da.tar.bz2 |
SetOptions.3: minor doc fix
make various other tables const
(all backported from Tk 8.6)
-rw-r--r-- | doc/SetOptions.3 | 41 | ||||
-rw-r--r-- | generic/tkButton.c | 20 | ||||
-rw-r--r-- | generic/tkConfig.c | 26 | ||||
-rw-r--r-- | generic/tkEntry.c | 76 | ||||
-rw-r--r-- | generic/tkListbox.c | 4 | ||||
-rw-r--r-- | generic/tkMenu.c | 40 | ||||
-rw-r--r-- | generic/tkMenubutton.c | 30 | ||||
-rw-r--r-- | generic/tkPanedWindow.c | 36 | ||||
-rw-r--r-- | generic/tkScale.c | 24 | ||||
-rw-r--r-- | generic/tkStyle.c | 40 | ||||
-rw-r--r-- | generic/tkTest.c | 76 | ||||
-rw-r--r-- | generic/tkText.c | 194 |
12 files changed, 300 insertions, 307 deletions
diff --git a/doc/SetOptions.3 b/doc/SetOptions.3 index 6ce3db0..bd1d8ab 100644 --- a/doc/SetOptions.3 +++ b/doc/SetOptions.3 @@ -243,7 +243,6 @@ The \fBTk_Offset\fR macro is provided as a safe way of generating the Tk_OptionSpec structures. It takes two arguments: the name of a type of record, and the name of a field in that record. It returns the byte offset of the named field in records of the given type. - .SH "TEMPLATES" .PP The array of Tk_OptionSpec structures passed to \fBTk_CreateOptionTable\fR @@ -262,7 +261,7 @@ typedef struct { int \fIflags\fR; ClientData \fIclientData\fR; int \fItypeMask\fR; -} Tk_OptionSpec; +} \fBTk_OptionSpec\fR; .CE The \fItype\fR field indicates what kind of configuration option this is (e.g. \fBTK_OPTION_COLOR\fR for a color value, or \fBTK_OPTION_INT\fR for @@ -434,15 +433,14 @@ suitable for passing to \fBTcl_GetIndexFromObj\fR. The value must be one of the strings in the table, or a unique abbreviation of one of the strings. The internal form is an integer giving the index into the table of the matching string, like the return value -from \fBTcl_GetStringFromObj\fR. +from \fBTcl_GetStringFromObj\fR. .TP \fBTK_OPTION_SYNONYM\fR This type is used to provide alternative names for an option (for example, \fB\-bg\fR is often used as a synonym for \fB\-background\fR). -The \fBclientData\fR field is a (char *) pointer that gives -the name of another option in the same table. Whenever the -synonym option is used, the information from the other option -will be used instead. +The \fBclientData\fR field is a string that gives the name of another +option in the same table. Whenever the synonym option is used, the +information from the other option will be used instead. .TP \fBTK_OPTION_WINDOW\fR The value must be a window path name. The internal form is a @@ -450,7 +448,6 @@ The value must be a window path name. The internal form is a This option type requires \fItkwin\fR to be supplied to procedures such as \fBTk_SetOptions\fR (in order to identify the application), and it supports the \fBTK_OPTION_NULL_OK\fR flag. - .SH "STORAGE MANAGEMENT ISSUES" .PP If a field of a widget record has its offset stored in the \fIobjOffset\fR @@ -474,7 +471,6 @@ However, the widget code is responsible for storing NULL or \fBNone\fR in all pointer and token fields before invoking \fBTk_InitOptions\fR. This is needed to allow proper cleanup in the rare case where an error occurs in \fBTk_InitOptions\fR. - .SH "OBJOFFSET VS. INTERNALOFFSET" .PP In most cases it is simplest to use the \fIinternalOffset\fR field of @@ -505,7 +501,6 @@ To implement a new type of option, you can use \fBTK_OPTION_STRING\fR as the type in the Tk_OptionSpec structure and set the \fIobjOffset\fR field but not the \fIinternalOffset\fR field. Then, after calling \fBTk_SetOptions\fR, convert the object to internal form yourself. - .SH "CUSTOM OPTION TYPES" .PP Applications can extend the built-in configuration types with @@ -520,33 +515,33 @@ typedef struct Tk_ObjCustomOption { Tk_CustomOptionRestoreProc *\fIrestoreProc\fR; Tk_CustomOptionFreeProc *\fIfreeProc\fR; ClientData \fIclientData\fR; -} Tk_ObjCustomOption; +} \fBTk_ObjCustomOption\fR; -typedef int Tk_CustomOptionSetProc( +typedef int \fBTk_CustomOptionSetProc\fR( ClientData \fIclientData\fR, - Tcl_Interp *\fIinterp\fR, - Tk_Window \fItkwin\fR, + Tcl_Interp *\fIinterp\fR, + Tk_Window \fItkwin\fR, Tcl_Obj **\fIvaluePtr\fR, char *\fIrecordPtr\fR, int \fIinternalOffset\fR, - char *\fIsaveInternalPtr\fR, + char *\fIsaveInternalPtr\fR, int \fIflags\fR); -typedef Tcl_Obj *Tk_CustomOptionGetProc( +typedef Tcl_Obj *\fBTk_CustomOptionGetProc\fR( ClientData \fIclientData\fR, - Tk_Window \fItkwin\fR, + Tk_Window \fItkwin\fR, char *\fIrecordPtr\fR, int \fIinternalOffset\fR); -typedef void Tk_CustomOptionRestoreProc( +typedef void \fBTk_CustomOptionRestoreProc\fR( ClientData \fIclientData\fR, - Tk_Window \fItkwin\fR, - char *\fIinternalPtr\fR, + Tk_Window \fItkwin\fR, + char *\fIinternalPtr\fR, char *\fIsaveInternalPtr\fR); -typedef void Tk_CustomOptionFreeProc( +typedef void \fBTk_CustomOptionFreeProc\fR( ClientData \fIclientData\fR, - Tk_Window \fItkwin\fR, + Tk_Window \fItkwin\fR, char *\fIinternalPtr\fR); .CE .PP @@ -645,8 +640,6 @@ structure. \fITkwin\fR is a copy of the \fItkwin\fR argument to is a pointer to the location where the internal representation of the option value is stored. The \fIfreeProc\fR must free any storage associated with the option. \fIFreeProc\fR has no return value. - - .SH KEYWORDS anchor, bitmap, boolean, border, color, configuration option, cursor, double, font, integer, justify, diff --git a/generic/tkButton.c b/generic/tkButton.c index 4e3c06c..9e3a08d 100644 --- a/generic/tkButton.c +++ b/generic/tkButton.c @@ -26,14 +26,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 }; @@ -42,7 +42,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 }; @@ -51,7 +51,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 }; @@ -62,7 +62,7 @@ char tkDefButtonBorderWidth[TCL_INTEGER_SPACE] = DEF_BUTTON_BORDER_WIDTH; * separate table for each of the four widget classes. */ -static Tk_OptionSpec labelOptionSpecs[] = { +static const 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}, @@ -147,7 +147,7 @@ static Tk_OptionSpec labelOptionSpecs[] = { {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, 0, 0, 0} }; -static Tk_OptionSpec buttonOptionSpecs[] = { +static const 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}, @@ -248,7 +248,7 @@ static Tk_OptionSpec buttonOptionSpecs[] = { {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, -1, 0, 0, 0} }; -static Tk_OptionSpec checkbuttonOptionSpecs[] = { +static const 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}, @@ -361,7 +361,7 @@ static Tk_OptionSpec checkbuttonOptionSpecs[] = { {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, -1, 0, 0, 0} }; -static Tk_OptionSpec radiobuttonOptionSpecs[] = { +static const 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}, @@ -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 const Tk_OptionSpec *const optionSpecs[] = { labelOptionSpecs, buttonOptionSpecs, checkbuttonOptionSpecs, @@ -637,7 +637,7 @@ ButtonCreate( Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); if (!tsdPtr->defaultsInitialized) { - TkpButtonSetDefaults(optionSpecs[type]); + TkpButtonSetDefaults(NULL); tsdPtr->defaultsInitialized = 1; } diff --git a/generic/tkConfig.c b/generic/tkConfig.c index ed47210..f2eaa33 100644 --- a/generic/tkConfig.c +++ b/generic/tkConfig.c @@ -48,7 +48,7 @@ */ typedef struct TkOption { - CONST Tk_OptionSpec *specPtr; + const Tk_OptionSpec *specPtr; /* The original spec from the template passed * to Tk_CreateOptionTable.*/ Tk_Uid dbNameUID; /* The Uid form of the option database @@ -121,7 +121,7 @@ static Tcl_Obj * GetConfigList(char *recordPtr, Option *optionPtr, Tk_Window tkwin); static Tcl_Obj * GetObjectForOption(char *recordPtr, Option *optionPtr, Tk_Window tkwin); -static Option * GetOption(CONST char *name, OptionTable *tablePtr); +static Option * GetOption(const char *name, OptionTable *tablePtr); static Option * GetOptionFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr, OptionTable *tablePtr); static int ObjectIsEmpty(Tcl_Obj *objPtr); @@ -164,7 +164,7 @@ Tk_OptionTable Tk_CreateOptionTable( Tcl_Interp *interp, /* Interpreter associated with the application * in which this table will be used. */ - CONST Tk_OptionSpec *templatePtr) + const Tk_OptionSpec *templatePtr) /* Static information about the configuration * options. */ { @@ -172,7 +172,7 @@ Tk_CreateOptionTable( Tcl_HashEntry *hashEntryPtr; int newEntry; OptionTable *tablePtr; - CONST Tk_OptionSpec *specPtr, *specPtr2; + const Tk_OptionSpec *specPtr, *specPtr2; Option *optionPtr; int numOptions, i; @@ -632,7 +632,7 @@ DoObjConfig( Tk_SavedOption internal; /* Used to save the old internal * representation of the value if * savedOptionPtr is NULL. */ - CONST Tk_OptionSpec *specPtr; + const Tk_OptionSpec *specPtr; int nullOK; /* @@ -733,7 +733,7 @@ DoObjConfig( int newValue; if (Tcl_GetIndexFromObj(interp, valuePtr, - (CONST char **) optionPtr->specPtr->clientData, + (const char **) optionPtr->specPtr->clientData, optionPtr->specPtr->optionName+1, 0, &newValue) != TCL_OK) { return TCL_ERROR; } @@ -1028,13 +1028,13 @@ ObjectIsEmpty( static Option * GetOption( - CONST char *name, /* String balue to be looked up in the option + const char *name, /* String balue to be looked up in the option * table. */ OptionTable *tablePtr) /* Table in which to look up name. */ { Option *bestPtr, *optionPtr; OptionTable *tablePtr2; - CONST char *p1, *p2; + const char *p1, *p2; int count; /* @@ -1182,9 +1182,9 @@ GetOptionFromObj( *---------------------------------------------------------------------- */ -CONST Tk_OptionSpec * +const Tk_OptionSpec * TkGetOptionSpec( - CONST char *name, /* String value to be looked up. */ + const char *name, /* String value to be looked up. */ Tk_OptionTable optionTable) /* Table in which to look up name. */ { Option *optionPtr; @@ -1260,7 +1260,7 @@ Tk_SetOptions( char *recordPtr, /* The record to configure. */ Tk_OptionTable optionTable, /* Describes valid options. */ int objc, /* The number of elements in objv. */ - Tcl_Obj *CONST objv[], /* Contains one or more name-value pairs. */ + Tcl_Obj *const objv[], /* Contains one or more name-value pairs. */ Tk_Window tkwin, /* Window associated with the thing being * configured; needed for some options (such * as colors). */ @@ -1383,7 +1383,7 @@ Tk_RestoreSavedOptions( * record. */ char *internalPtr; /* Points to internal value of option in * record. */ - CONST Tk_OptionSpec *specPtr; + const Tk_OptionSpec *specPtr; /* * Be sure to restore the options in the opposite order they were set. @@ -1573,7 +1573,7 @@ Tk_FreeConfigOptions( int count; Tcl_Obj **oldPtrPtr, *oldPtr; char *oldInternalPtr; - CONST Tk_OptionSpec *specPtr; + const Tk_OptionSpec *specPtr; for (tablePtr = (OptionTable *) optionTable; tablePtr != NULL; tablePtr = tablePtr->nextPtr) { diff --git a/generic/tkEntry.c b/generic/tkEntry.c index 8b00a6f..26311a3 100644 --- a/generic/tkEntry.c +++ b/generic/tkEntry.c @@ -35,7 +35,7 @@ #define DOUBLES_EQ(d1, d2) (fabs((d1) - (d2)) < MIN_DBL_VAL) -static CONST char *stateStrings[] = { +static const char *const stateStrings[] = { "disabled", "normal", "readonly", NULL }; @@ -43,7 +43,7 @@ static CONST char *stateStrings[] = { * Definitions for -validate option values: */ -static CONST char *validateStrings[] = { +static const char *const validateStrings[] = { "all", "key", "focus", "focusin", "focusout", "none", NULL }; enum validateType { @@ -317,7 +317,7 @@ static const Tk_OptionSpec sbOptSpec[] = { * dispatch the entry widget command. */ -static CONST char *entryCmdNames[] = { +static const char *entryCmdNames[] = { "bbox", "cget", "configure", "delete", "get", "icursor", "index", "insert", "scan", "selection", "validate", "xview", NULL }; @@ -328,7 +328,7 @@ enum entryCmd { COMMAND_SCAN, COMMAND_SELECTION, COMMAND_VALIDATE, COMMAND_XVIEW }; -static CONST char *selCmdNames[] = { +static const char *selCmdNames[] = { "adjust", "clear", "from", "present", "range", "to", NULL }; @@ -343,7 +343,7 @@ enum selCmd { * dispatch the spinbox widget command. */ -static CONST char *sbCmdNames[] = { +static const char *sbCmdNames[] = { "bbox", "cget", "configure", "delete", "get", "icursor", "identify", "index", "insert", "invoke", "scan", "selection", "set", "validate", "xview", NULL @@ -356,7 +356,7 @@ enum sbCmd { SB_CMD_SET, SB_CMD_VALIDATE, SB_CMD_XVIEW }; -static CONST char *sbSelCmdNames[] = { +static const char *sbSelCmdNames[] = { "adjust", "clear", "element", "from", "present", "range", "to", NULL }; @@ -374,7 +374,7 @@ enum sbselCmd { * modify them, you must modify the strings here. */ -static CONST char *selElementNames[] = { +static const char *selElementNames[] = { "none", "buttondown", "buttonup", NULL, "entry" }; @@ -390,7 +390,7 @@ static CONST char *selElementNames[] = { */ static int ConfigureEntry(Tcl_Interp *interp, Entry *entryPtr, - int objc, Tcl_Obj *CONST objv[], int flags); + int objc, Tcl_Obj *const objv[], int flags); static void DeleteChars(Entry *entryPtr, int index, int count); static void DestroyEntry(char *memPtr); static void DisplayEntry(ClientData clientData); @@ -405,25 +405,25 @@ static int EntryFetchSelection(ClientData clientData, int offset, static void EntryLostSelection(ClientData clientData); static void EventuallyRedraw(Entry *entryPtr); static void EntryScanTo(Entry *entryPtr, int y); -static void EntrySetValue(Entry *entryPtr, CONST char *value); +static void EntrySetValue(Entry *entryPtr, const char *value); static void EntrySelectTo(Entry *entryPtr, int index); static char * EntryTextVarProc(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 void EntryUpdateScrollbar(Entry *entryPtr); static int EntryValidate(Entry *entryPtr, char *cmd); static int EntryValidateChange(Entry *entryPtr, char *change, - CONST char *newStr, int index, int type); -static void ExpandPercents(Entry *entryPtr, CONST char *before, - CONST char *change, CONST char *newStr, int index, + const char *newStr, int index, int type); +static void ExpandPercents(Entry *entryPtr, const char *before, + const char *change, const char *newStr, int index, int type, Tcl_DString *dsPtr); static void EntryValueChanged(Entry *entryPtr, - CONST char *newValue); + const char *newValue); static void EntryVisibleRange(Entry *entryPtr, double *firstPtr, double *lastPtr); static int EntryWidgetObjCmd(ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static void EntryWorldChanged(ClientData instanceData); static int GetEntryIndex(Tcl_Interp *interp, Entry *entryPtr, char *string, int *indexPtr); @@ -435,7 +435,7 @@ static void InsertChars(Entry *entryPtr, int index, char *string); static int SpinboxWidgetObjCmd(ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int GetSpinboxElement(Spinbox *sbPtr, int x, int y); static int SpinboxInvoke(Tcl_Interp *interp, Spinbox *sbPtr, int element); @@ -474,7 +474,7 @@ Tk_EntryObjCmd( ClientData clientData, /* NULL. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { register Entry *entryPtr; Tk_OptionTable optionTable; @@ -585,7 +585,7 @@ EntryWidgetObjCmd( ClientData clientData, /* Information about entry widget. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { Entry *entryPtr = (Entry *) clientData; int cmdIndex, selIndex, result; @@ -1080,7 +1080,7 @@ ConfigureEntry( Entry *entryPtr, /* Information about widget; may or may not * already have values for some fields. */ int objc, /* Number of valid entries in argv. */ - Tcl_Obj *CONST objv[], /* Argument objects. */ + Tcl_Obj *const objv[], /* Argument objects. */ int flags) /* Flags to pass to Tk_ConfigureWidget. */ { Tk_SavedOptions savedOptions; @@ -1294,7 +1294,7 @@ ConfigureEntry( */ if (entryPtr->textVarName != NULL) { - CONST char *value; + const char *value; value = Tcl_GetVar(interp, entryPtr->textVarName, TCL_GLOBAL_ONLY); if (value == NULL) { @@ -2010,7 +2010,7 @@ InsertChars( ptrdiff_t byteIndex; size_t byteCount, newByteCount; int oldChars, charsAdded; - CONST char *string; + const char *string; char *newStr; string = entryPtr->string; @@ -2106,7 +2106,7 @@ DeleteChars( int count) /* How many characters to delete. */ { int byteIndex, byteCount, newByteCount; - CONST char *string; + const char *string; char *newStr, *toDelete; if ((index + count) > entryPtr->numChars) { @@ -2218,7 +2218,7 @@ DeleteChars( static void EntryValueChanged( Entry *entryPtr, /* Entry whose value just changed. */ - CONST char *newValue) /* If this value is not NULL, we first force + const char *newValue) /* If this value is not NULL, we first force * the value of the entry to this. */ { if (newValue != NULL) { @@ -2278,9 +2278,9 @@ EntryValueChanged( static void EntrySetValue( Entry *entryPtr, /* Entry whose value is to be changed. */ - CONST char *value) /* New text to display in entry. */ + const char *value) /* New text to display in entry. */ { - CONST char *oldSource; + const char *oldSource; int valueLen, malloced = 0; if (strcmp(value, entryPtr->string) == 0) { @@ -2752,8 +2752,8 @@ EntryFetchSelection( { Entry *entryPtr = (Entry *) clientData; int byteCount; - CONST char *string; - CONST char *selStart, *selEnd; + const char *string; + const char *selStart, *selEnd; if ((entryPtr->selectFirst < 0) || !(entryPtr->exportSelection)) { return -1; @@ -3068,12 +3068,12 @@ static char * EntryTextVarProc( 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. */ { Entry *entryPtr = (Entry *) clientData; - CONST char *value; + const char *value; if (entryPtr->flags & ENTRY_DELETED) { /* @@ -3198,7 +3198,7 @@ EntryValidateChange( register Entry *entryPtr, /* Entry that needs validation. */ char *change, /* Characters to be added/deleted * (NUL-terminated string). */ - CONST char *newValue, /* Potential new value of entry string */ + const char *newValue, /* Potential new value of entry string */ int index, /* index of insert/delete, -1 otherwise */ int type) /* forced, delete, insert, focusin or * focusout */ @@ -3332,12 +3332,12 @@ EntryValidateChange( static void ExpandPercents( register Entry *entryPtr, /* Entry that needs validation. */ - register CONST char *before, + register const char *before, /* Command containing percent expressions to * be replaced. */ - CONST char *change, /* Characters to added/deleted (NUL-terminated + const char *change, /* Characters to added/deleted (NUL-terminated * string). */ - CONST char *newValue, /* Potential new value of entry string */ + const char *newValue, /* Potential new value of entry string */ int index, /* index of insert/delete */ int type, /* INSERT or DELETE */ Tcl_DString *dsPtr) /* Dynamic string in which to append new @@ -3346,7 +3346,7 @@ ExpandPercents( int spaceNeeded, cvtFlags; /* Used to substitute string as proper Tcl * list element. */ int number, length; - register CONST char *string; + register const char *string; Tcl_UniChar ch; char numStorage[2*TCL_INTEGER_SPACE]; @@ -3499,7 +3499,7 @@ Tk_SpinboxObjCmd( ClientData clientData, /* NULL. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { register Entry *entryPtr; register Spinbox *sbPtr; @@ -3630,7 +3630,7 @@ SpinboxWidgetObjCmd( ClientData clientData, /* Information about spinbox widget. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { Entry *entryPtr = (Entry *) clientData; Spinbox *sbPtr = (Spinbox *) clientData; diff --git a/generic/tkListbox.c b/generic/tkListbox.c index aab7494..d803d7b 100644 --- a/generic/tkListbox.c +++ b/generic/tkListbox.c @@ -211,7 +211,7 @@ enum state { STATE_DISABLED, STATE_NORMAL }; -static CONST char *stateStrings[] = { +static const char *const stateStrings[] = { "disabled", "normal", NULL }; @@ -219,7 +219,7 @@ enum activeStyle { ACTIVE_STYLE_DOTBOX, ACTIVE_STYLE_NONE, ACTIVE_STYLE_UNDERLINE }; -static CONST char *activeStyleStrings[] = { +static const char *const activeStyleStrings[] = { "dotbox", "none", "underline", NULL }; diff --git a/generic/tkMenu.c b/generic/tkMenu.c index e7e6bb8..064eaca 100644 --- a/generic/tkMenu.c +++ b/generic/tkMenu.c @@ -229,7 +229,7 @@ static const Tk_OptionSpec tkTearoffEntryConfigSpecs[] = { {TK_OPTION_END} }; -static const Tk_OptionSpec *specsArray[] = { +static const Tk_OptionSpec *const specsArray[] = { tkCascadeEntryConfigSpecs, tkCheckButtonEntryConfigSpecs, tkBasicMenuEntryConfigSpecs, tkRadioButtonEntryConfigSpecs, tkSeparatorEntryConfigSpecs, tkTearoffEntryConfigSpecs @@ -308,7 +308,7 @@ static const Tk_OptionSpec tkMenuConfigSpecs[] = { * with MenuWidgetObjCmd. */ -static CONST char *menuOptions[] = { +static const char *menuOptions[] = { "activate", "add", "cget", "clone", "configure", "delete", "entrycget", "entryconfigure", "index", "insert", "invoke", "post", "postcascade", "type", "unpost", "xposition", "yposition", NULL @@ -327,12 +327,12 @@ enum options { static int CloneMenu(TkMenu *menuPtr, Tcl_Obj *newMenuName, Tcl_Obj *newMenuTypeString); static int ConfigureMenu(Tcl_Interp *interp, TkMenu *menuPtr, - int objc, Tcl_Obj *CONST objv[]); + int objc, Tcl_Obj *const objv[]); static int ConfigureMenuCloneEntries(Tcl_Interp *interp, TkMenu *menuPtr, int index, - int objc, Tcl_Obj *CONST objv[]); + int objc, Tcl_Obj *const objv[]); static int ConfigureMenuEntry(TkMenuEntry *mePtr, - int objc, Tcl_Obj *CONST objv[]); + int objc, Tcl_Obj *const objv[]); static void DeleteMenuCloneEntries(TkMenu *menuPtr, int first, int last); static void DestroyMenuHashTable(ClientData clientData, @@ -347,17 +347,17 @@ static int MenuDoXPosition(Tcl_Interp *interp, TkMenu *menuPtr, Tcl_Obj *objPtr); static int MenuAddOrInsert(Tcl_Interp *interp, TkMenu *menuPtr, Tcl_Obj *indexPtr, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int MenuCmd(ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]); + int objc, Tcl_Obj *const objv[]); static void MenuCmdDeletedProc(ClientData clientData); static TkMenuEntry * MenuNewEntry(TkMenu *menuPtr, int index, int type); static char * MenuVarProc(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 MenuWidgetObjCmd(ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static void MenuWorldChanged(ClientData instanceData); static int PostProcessEntry(TkMenuEntry *mePtr); static void RecursivelyDeleteMenu(TkMenu *menuPtr); @@ -454,7 +454,7 @@ MenuCmd( ClientData clientData, /* Main window associated with interpreter. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument strings. */ + Tcl_Obj *const objv[]) /* Argument strings. */ { Tk_Window tkwin = Tk_MainWindow(interp); Tk_Window newWin; @@ -462,7 +462,7 @@ MenuCmd( TkMenuReferences *menuRefPtr; int i, index, toplevel; char *windowName; - static CONST char *typeStringList[] = {"-type", NULL}; + static const char *typeStringList[] = {"-type", NULL}; TkMenuOptionTables *optionTablesPtr = (TkMenuOptionTables *) clientData; if (objc < 2) { @@ -667,7 +667,7 @@ MenuWidgetObjCmd( ClientData clientData, /* Information about menu widget. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument strings. */ + Tcl_Obj *const objv[]) /* Argument strings. */ { register TkMenu *menuPtr = (TkMenu *) clientData; register TkMenuEntry *mePtr; @@ -1553,7 +1553,7 @@ ConfigureMenu( register TkMenu *menuPtr, /* Information about widget; may or may not * already have values for some fields. */ int objc, /* Number of valid entries in argv. */ - Tcl_Obj *CONST objv[]) /* Arguments. */ + Tcl_Obj *const objv[]) /* Arguments. */ { int i; TkMenu *menuListPtr, *cleanupPtr; @@ -1919,7 +1919,7 @@ ConfigureMenuEntry( register TkMenuEntry *mePtr,/* Information about menu entry; may or may * not already have values for some fields. */ int objc, /* Number of valid entries in argv. */ - Tcl_Obj *CONST objv[]) /* Arguments. */ + Tcl_Obj *const objv[]) /* Arguments. */ { TkMenu *menuPtr = mePtr->menuPtr; Tk_SavedOptions errorStruct; @@ -1984,7 +1984,7 @@ ConfigureMenuCloneEntries( TkMenu *menuPtr, /* Information about whole menu. */ int index, /* Index of mePtr within menuPtr's entries. */ int objc, /* Number of valid entries in argv. */ - Tcl_Obj *CONST objv[]) /* Arguments. */ + Tcl_Obj *const objv[]) /* Arguments. */ { TkMenuEntry *mePtr; TkMenu *menuListPtr; @@ -2353,7 +2353,7 @@ MenuAddOrInsert( Tcl_Obj *indexPtr, /* Object describing index at which to insert. * NULL means insert at end. */ int objc, /* Number of elements in objv. */ - Tcl_Obj *CONST objv[]) /* Arguments to command: first arg is type of + Tcl_Obj *const objv[]) /* Arguments to command: first arg is type of * entry, others are config options. */ { int type, index; @@ -2491,13 +2491,13 @@ static char * MenuVarProc( ClientData clientData, /* Information about menu entry. */ Tcl_Interp *interp, /* Interpreter containing variable. */ - CONST char *name1, /* First part of variable's name. */ - CONST char *name2, /* Second part of variable's name. */ + const char *name1, /* First part of variable's name. */ + const char *name2, /* Second part of variable's name. */ int flags) /* Describes what just happened. */ { TkMenuEntry *mePtr = (TkMenuEntry *) clientData; TkMenu *menuPtr; - CONST char *value; + const char *value; char *name; char *onValue; diff --git a/generic/tkMenubutton.c b/generic/tkMenubutton.c index cb1727e..94ac8b2 100644 --- a/generic/tkMenubutton.c +++ b/generic/tkMenubutton.c @@ -20,7 +20,7 @@ * is used together with the "enum direction" declaration in tkMenubutton.h. */ -static CONST char *directionStrings[] = { +static const char *const directionStrings[] = { "above", "below", "flush", "left", "right", NULL }; @@ -29,7 +29,7 @@ static CONST char *directionStrings[] = { * used together with the "enum state" declaration in tkMenubutton.h. */ -static CONST char *stateStrings[] = { +static const char *const stateStrings[] = { "active", "disabled", "normal", NULL }; @@ -38,7 +38,7 @@ static CONST char *stateStrings[] = { * is used with the "enum compound" declaration in tkMenuButton.h */ -static CONST char *compoundStrings[] = { +static const char *const compoundStrings[] = { "bottom", "center", "left", "none", "right", "top", NULL }; @@ -151,7 +151,7 @@ static const Tk_OptionSpec optionSpecs[] = { * dispatch the scale widget command. */ -static CONST char *commandNames[] = { +static const char *commandNames[] = { "cget", "configure", NULL }; @@ -170,14 +170,14 @@ static void MenuButtonImageProc(ClientData clientData, int x, int y, int width, int height, int imgWidth, int imgHeight); static char * MenuButtonTextVarProc(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 MenuButtonWidgetObjCmd(ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int ConfigureMenuButton(Tcl_Interp *interp, TkMenuButton *mbPtr, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static void DestroyMenuButton(char *memPtr); /* @@ -203,7 +203,7 @@ Tk_MenubuttonObjCmd( ClientData clientData, /* NULL. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { register TkMenuButton *mbPtr; Tk_OptionTable optionTable; @@ -333,7 +333,7 @@ MenuButtonWidgetObjCmd( ClientData clientData, /* Information about button widget. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { register TkMenuButton *mbPtr = (TkMenuButton *) clientData; int result, index; @@ -484,7 +484,7 @@ ConfigureMenuButton( /* Information about widget; may or may not * already have values for some fields. */ int objc, /* Number of valid entries in objv. */ - Tcl_Obj *CONST objv[]) /* Arguments. */ + Tcl_Obj *const objv[]) /* Arguments. */ { Tk_SavedOptions savedOptions; Tcl_Obj *errorResult = NULL; @@ -614,7 +614,7 @@ ConfigureMenuButton( * Set up a trace to watch for any changes in it, create the variable * if it doesn't exist, and fetch its current value. */ - CONST char *value; + const char *value; value = Tcl_GetVar(interp, mbPtr->textVarName, TCL_GLOBAL_ONLY); if (value == NULL) { @@ -865,12 +865,12 @@ static char * MenuButtonTextVarProc( 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 TkMenuButton *mbPtr = (TkMenuButton *) clientData; - CONST char *value; + const char *value; unsigned len; /* diff --git a/generic/tkPanedWindow.c b/generic/tkPanedWindow.c index 9029265..cf3611f 100644 --- a/generic/tkPanedWindow.c +++ b/generic/tkPanedWindow.c @@ -35,7 +35,7 @@ * The following table defines the legal values for the -orient option. */ -static CONST char *orientStrings[] = { +static const char *const orientStrings[] = { "horizontal", "vertical", NULL }; @@ -45,7 +45,7 @@ enum orient { ORIENT_HORIZONTAL, ORIENT_VERTICAL }; * The following table defines the legal values for the -stretch option. */ -static const char *stretchStrings[] = { +static const char *const stretchStrings[] = { "always", "first", "last", "middle", "never", NULL }; @@ -181,11 +181,11 @@ typedef struct PanedWindow { int Tk_PanedWindowObjCmd(ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static void PanedWindowCmdDeletedProc(ClientData clientData); static int ConfigurePanedWindow(Tcl_Interp *interp, PanedWindow *pwPtr, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static void DestroyPanedWindow(PanedWindow *pwPtr); static void DisplayPanedWindow(ClientData clientData); static void PanedWindowEventProc(ClientData clientData, @@ -195,7 +195,7 @@ static void ProxyWindowEventProc(ClientData clientData, static void DisplayProxyWindow(ClientData clientData); static void PanedWindowWorldChanged(ClientData instanceData); static int PanedWindowWidgetObjCmd(ClientData clientData, - Tcl_Interp *, int objc, Tcl_Obj * CONST objv[]); + Tcl_Interp *, int objc, Tcl_Obj * const objv[]); static void PanedWindowLostSlaveProc(ClientData clientData, Tk_Window tkwin); static void PanedWindowReqProc(ClientData clientData, @@ -207,14 +207,14 @@ static void SlaveStructureProc(ClientData clientData, XEvent *eventPtr); static int PanedWindowSashCommand(PanedWindow *pwPtr, Tcl_Interp *interp, int objc, - Tcl_Obj * CONST objv[]); + Tcl_Obj * const objv[]); static int PanedWindowProxyCommand(PanedWindow *pwPtr, Tcl_Interp *interp, int objc, - Tcl_Obj * CONST objv[]); + Tcl_Obj * const objv[]); static void ComputeGeometry(PanedWindow *pwPtr); static int ConfigureSlaves(PanedWindow *pwPtr, Tcl_Interp *interp, int objc, - Tcl_Obj * CONST objv[]); + Tcl_Obj * const objv[]); static void DestroyOptionTables(ClientData clientData, Tcl_Interp *interp); static int SetSticky(ClientData clientData, Tcl_Interp *interp, @@ -258,7 +258,7 @@ static const Tk_GeomMgr panedWindowMgrType = { * the custom "-sticky" option for slave windows. */ -static Tk_ObjCustomOption stickyOption = { +static const Tk_ObjCustomOption stickyOption = { "sticky", /* name */ SetSticky, /* setProc */ GetSticky, /* getProc */ @@ -371,7 +371,7 @@ Tk_PanedWindowObjCmd( ClientData clientData, /* NULL. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj * CONST objv[]) /* Argument objects. */ + Tcl_Obj * const objv[]) /* Argument objects. */ { PanedWindow *pwPtr; Tk_Window tkwin, parent; @@ -518,11 +518,11 @@ PanedWindowWidgetObjCmd( ClientData clientData, /* Information about square widget. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj * CONST objv[]) /* Argument objects. */ + Tcl_Obj * const objv[]) /* Argument objects. */ { PanedWindow *pwPtr = (PanedWindow *) clientData; int result = TCL_OK; - static CONST char *optionStrings[] = { + static const char *optionStrings[] = { "add", "cget", "configure", "forget", "identify", "panecget", "paneconfigure", "panes", "proxy", "sash", NULL }; @@ -744,7 +744,7 @@ ConfigureSlaves( PanedWindow *pwPtr, /* Information about paned window. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { int i, firstOptionArg, j, found, doubleBw, index, numNewSlaves, haveLoc; int insertIndex; @@ -1064,9 +1064,9 @@ PanedWindowSashCommand( PanedWindow *pwPtr, /* Pointer to paned window information. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { - static CONST char *sashOptionStrings[] = { + static const char *sashOptionStrings[] = { "coord", "dragto", "mark", "place", NULL }; enum sashOptions { @@ -1215,7 +1215,7 @@ ConfigurePanedWindow( Tcl_Interp *interp, /* Used for error reporting. */ PanedWindow *pwPtr, /* Information about widget. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument values. */ + Tcl_Obj *const objv[]) /* Argument values. */ { Tk_SavedOptions savedOptions; int typemask = 0; @@ -2755,9 +2755,9 @@ PanedWindowProxyCommand( PanedWindow *pwPtr, /* Pointer to paned window information. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { - static CONST char *optionStrings[] = { + static const char *optionStrings[] = { "coord", "forget", "place", NULL }; enum options { diff --git a/generic/tkScale.c b/generic/tkScale.c index 91e04eb..28e5b16 100644 --- a/generic/tkScale.c +++ b/generic/tkScale.c @@ -26,7 +26,7 @@ * used together with the "enum orient" declaration in tkScale.h. */ -static CONST char *orientStrings[] = { +static const char *const orientStrings[] = { "horizontal", "vertical", NULL }; @@ -35,7 +35,7 @@ static CONST char *orientStrings[] = { * used together with the "enum state" declaration in tkScale.h. */ -static CONST char *stateStrings[] = { +static const char *const stateStrings[] = { "active", "disabled", "normal", NULL }; @@ -140,7 +140,7 @@ static const Tk_OptionSpec optionSpecs[] = { * scale widget command. */ -static CONST char *commandNames[] = { +static const char *commandNames[] = { "cget", "configure", "coords", "get", "identify", "set", NULL }; @@ -156,17 +156,17 @@ enum command { static void ComputeFormat(TkScale *scalePtr); static void ComputeScaleGeometry(TkScale *scalePtr); static int ConfigureScale(Tcl_Interp *interp, TkScale *scalePtr, - int objc, Tcl_Obj *CONST objv[]); + int objc, Tcl_Obj *const objv[]); static void DestroyScale(char *memPtr); static void ScaleCmdDeletedProc(ClientData clientData); static void ScaleEventProc(ClientData clientData, XEvent *eventPtr); static char * ScaleVarProc(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 ScaleWidgetObjCmd(ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static void ScaleWorldChanged(ClientData instanceData); static void ScaleSetVariable(TkScale *scalePtr); @@ -202,7 +202,7 @@ Tk_ScaleObjCmd( 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. */ { register TkScale *scalePtr; Tk_OptionTable optionTable; @@ -328,7 +328,7 @@ ScaleWidgetObjCmd( ClientData clientData, /* Information about scale widget. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument strings. */ + Tcl_Obj *const objv[]) /* Argument strings. */ { TkScale *scalePtr = (TkScale *) clientData; Tcl_Obj *objPtr; @@ -555,7 +555,7 @@ ConfigureScale( register TkScale *scalePtr, /* Information about widget; may or may not * already have values for some fields. */ int objc, /* Number of valid entries in objv. */ - Tcl_Obj *CONST objv[]) /* Argument values. */ + Tcl_Obj *const objv[]) /* Argument values. */ { Tk_SavedOptions savedOptions; Tcl_Obj *errorResult = NULL; @@ -1171,8 +1171,8 @@ static char * ScaleVarProc( 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 TkScale *scalePtr = (TkScale *) clientData; diff --git a/generic/tkStyle.c b/generic/tkStyle.c index 80d4e59..dd3b2e8 100644 --- a/generic/tkStyle.c +++ b/generic/tkStyle.c @@ -24,7 +24,7 @@ typedef struct StyledWidgetSpec { * structure. */ Tk_OptionTable optionTable; /* Option table for the widget class using the * element. */ - CONST Tk_OptionSpec **optionsPtr; + const Tk_OptionSpec **optionsPtr; /* Table of option spec pointers, matching the * option list provided during element * registration. Malloc'd. */ @@ -58,7 +58,7 @@ typedef struct StyledElement { */ typedef struct StyleEngine { - CONST char *name; /* Name of engine. Points to a hash key. */ + const char *name; /* Name of engine. Points to a hash key. */ StyledElement *elements; /* Table of widget element descriptors. Each * element is indexed by a unique system-wide * ID. Table grows dynamically as new elements @@ -75,7 +75,7 @@ typedef struct StyleEngine { */ typedef struct Style { - CONST char *name; /* Name of style. Points to a hash key. */ + const char *name; /* Name of style. Points to a hash key. */ StyleEngine *enginePtr; /* Style engine of which the style is an * instance. */ ClientData clientData; /* Data provided during registration. */ @@ -86,7 +86,7 @@ typedef struct Style { */ typedef struct Element { - CONST char *name; /* Name of element. Points to a hash key. */ + const char *name; /* Name of element. Points to a hash key. */ int id; /* Id of element. */ int genericId; /* Id of generic element. */ int created; /* Boolean, whether the element was created @@ -120,7 +120,7 @@ static Tcl_ThreadDataKey dataKey; * Forward declarations for functions defined later in this file: */ -static int CreateElement(CONST char *name, int create); +static int CreateElement(const char *name, int create); static void DupStyleObjProc(Tcl_Obj *srcObjPtr, Tcl_Obj *dupObjPtr); static void FreeElement(Element *elementPtr); @@ -132,13 +132,13 @@ static StyledElement * GetStyledElement(StyleEngine *enginePtr, int elementId); static StyledWidgetSpec*GetWidgetSpec(StyledElement *elementPtr, Tk_OptionTable optionTable); -static void InitElement(Element *elementPtr, CONST char *name, +static void InitElement(Element *elementPtr, const char *name, int id, int genericId, int created); -static void InitStyle(Style *stylePtr, CONST char *name, +static void InitStyle(Style *stylePtr, const char *name, StyleEngine *enginePtr, ClientData clientData); static void InitStyledElement(StyledElement *elementPtr); static void InitStyleEngine(StyleEngine *enginePtr, - CONST char *name, StyleEngine *parentPtr); + const char *name, StyleEngine *parentPtr); static void InitWidgetSpec(StyledWidgetSpec *widgetSpecPtr, StyledElement *elementPtr, Tk_OptionTable optionTable); @@ -303,7 +303,7 @@ TkStylePkgFree( Tk_StyleEngine Tk_RegisterStyleEngine( - CONST char *name, /* Name of the engine to create. NULL or empty + const char *name, /* Name of the engine to create. NULL or empty * means the default system engine. */ Tk_StyleEngine parent) /* The engine's parent. NULL means the default * system engine. */ @@ -359,7 +359,7 @@ Tk_RegisterStyleEngine( static void InitStyleEngine( StyleEngine *enginePtr, /* Points to an uninitialized engine. */ - CONST char *name, /* Name of the registered engine. NULL or empty + const char *name, /* Name of the registered engine. NULL or empty * means the default system engine. Usually * points to the hash key. */ StyleEngine *parentPtr) /* The engine's parent. NULL means the default @@ -454,7 +454,7 @@ FreeStyleEngine( Tk_StyleEngine Tk_GetStyleEngine( - CONST char *name) /* Name of the engine to retrieve. NULL or + const char *name) /* Name of the engine to retrieve. NULL or * empty means the default system engine. */ { ThreadSpecificData *tsdPtr = (ThreadSpecificData *) @@ -492,7 +492,7 @@ Tk_GetStyleEngine( static void InitElement( Element *elementPtr, /* Points to an uninitialized element.*/ - CONST char *name, /* Name of the registered element. Usually + const char *name, /* Name of the registered element. Usually * points to the hash key. */ int id, /* Unique element ID. */ int genericId, /* ID of generic element. -1 means none. */ @@ -602,7 +602,7 @@ FreeStyledElement( static int CreateElement( - CONST char *name, /* Name of the element. */ + const char *name, /* Name of the element. */ int create) /* Boolean, whether the element is being created * explicitly (being registered) or implicitly (by a * derived element). */ @@ -689,7 +689,7 @@ CreateElement( int Tk_GetElementId( - CONST char *name) /* Name of the element. */ + const char *name) /* Name of the element. */ { ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); @@ -910,7 +910,7 @@ InitWidgetSpec( { int i, nbOptions; Tk_ElementOptionSpec *elementOptionPtr; - CONST Tk_OptionSpec *widgetOptionPtr; + const Tk_OptionSpec *widgetOptionPtr; widgetSpecPtr->elementPtr = elementPtr; widgetSpecPtr->optionTable = optionTable; @@ -928,7 +928,7 @@ InitWidgetSpec( * Build the widget option list. */ - widgetSpecPtr->optionsPtr = (CONST Tk_OptionSpec **) + widgetSpecPtr->optionsPtr = (const Tk_OptionSpec **) ckalloc(sizeof(Tk_OptionSpec *) * nbOptions); for (i = 0, elementOptionPtr = elementPtr->specPtr->options; i < nbOptions; i++, elementOptionPtr++) { @@ -1230,7 +1230,7 @@ Tk_DrawElement( Tk_Style Tk_CreateStyle( - CONST char *name, /* Name of the style to create. NULL or empty + const char *name, /* Name of the style to create. NULL or empty * means the default system style. */ Tk_StyleEngine engine, /* The style engine. */ ClientData clientData) /* Private data passed as is to engine code. */ @@ -1288,7 +1288,7 @@ Tk_CreateStyle( *--------------------------------------------------------------------------- */ -CONST char * +const char * Tk_NameOfStyle( Tk_Style style) /* Style whose name is desired. */ { @@ -1316,7 +1316,7 @@ Tk_NameOfStyle( static void InitStyle( Style *stylePtr, /* Points to an uninitialized style. */ - CONST char *name, /* Name of the registered style. NULL or empty + const char *name, /* Name of the registered style. NULL or empty * means the default system style. Usually * points to the hash key. */ StyleEngine *enginePtr, /* The style engine. */ @@ -1348,7 +1348,7 @@ InitStyle( Tk_Style Tk_GetStyle( Tcl_Interp *interp, /* Interp for error return. */ - CONST char *name) /* Name of the style to retrieve. NULL or empty + const char *name) /* Name of the style to retrieve. NULL or empty * means the default system style. */ { ThreadSpecificData *tsdPtr = (ThreadSpecificData *) diff --git a/generic/tkTest.c b/generic/tkTest.c index 71368f3..307ca34 100644 --- a/generic/tkTest.c +++ b/generic/tkTest.c @@ -59,7 +59,7 @@ typedef struct TImageInstance { */ static int ImageCreate(Tcl_Interp *interp, - char *name, int argc, Tcl_Obj *CONST objv[], + char *name, int argc, Tcl_Obj *const objv[], Tk_ImageType *typePtr, Tk_ImageMaster master, ClientData *clientDataPtr); static ClientData ImageGet(Tk_Window tkwin, ClientData clientData); @@ -101,7 +101,7 @@ static NewApp *newAppPtr = NULL;/* First in list of all new interpreters. */ extern int SquareObjCmd(ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj * CONST objv[]); + Tcl_Obj * const objv[]); typedef struct CBinding { Tcl_Interp *interp; @@ -142,39 +142,39 @@ static int CBindingEvalProc(ClientData clientData, static void CBindingFreeProc(ClientData clientData); int Tktest_Init(Tcl_Interp *interp); static int ImageCmd(ClientData dummy, - Tcl_Interp *interp, int argc, CONST char **argv); + Tcl_Interp *interp, int argc, const char **argv); static int TestcbindCmd(ClientData dummy, - Tcl_Interp *interp, int argc, CONST char **argv); + Tcl_Interp *interp, int argc, const char **argv); static int TestbitmapObjCmd(ClientData dummy, Tcl_Interp *interp, int objc, - Tcl_Obj * CONST objv[]); + Tcl_Obj * const objv[]); static int TestborderObjCmd(ClientData dummy, Tcl_Interp *interp, int objc, - Tcl_Obj * CONST objv[]); + Tcl_Obj * const objv[]); static int TestcolorObjCmd(ClientData dummy, Tcl_Interp *interp, int objc, - Tcl_Obj * CONST objv[]); + Tcl_Obj * const objv[]); static int TestcursorObjCmd(ClientData dummy, Tcl_Interp *interp, int objc, - Tcl_Obj * CONST objv[]); + Tcl_Obj * const objv[]); static int TestdeleteappsCmd(ClientData dummy, - Tcl_Interp *interp, int argc, CONST char **argv); + Tcl_Interp *interp, int argc, const char **argv); static int TestfontObjCmd(ClientData dummy, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int TestmakeexistCmd(ClientData dummy, - Tcl_Interp *interp, int argc, CONST char **argv); + Tcl_Interp *interp, int argc, const char **argv); #if !(defined(__WIN32__) || defined(MAC_OSX_TK)) static int TestmenubarCmd(ClientData dummy, - Tcl_Interp *interp, int argc, CONST char **argv); + Tcl_Interp *interp, int argc, const char **argv); #endif #if defined(__WIN32__) || defined(MAC_OSX_TK) static int TestmetricsCmd(ClientData dummy, - Tcl_Interp *interp, int argc, CONST char **argv); + Tcl_Interp *interp, int argc, const char **argv); #endif static int TestobjconfigObjCmd(ClientData dummy, Tcl_Interp *interp, int objc, - Tcl_Obj * CONST objv[]); + Tcl_Obj * const objv[]); static int CustomOptionSet(ClientData clientData, Tcl_Interp *interp, Tk_Window tkwin, Tcl_Obj **value, char *recordPtr, @@ -189,15 +189,15 @@ static void CustomOptionRestore(ClientData clientData, static void CustomOptionFree(ClientData clientData, Tk_Window tkwin, char *internalPtr); static int TestpropCmd(ClientData dummy, - Tcl_Interp *interp, int argc, CONST char **argv); + Tcl_Interp *interp, int argc, const char **argv); #if !(defined(__WIN32__) || defined(MAC_OSX_TK)) static int TestwrapperCmd(ClientData dummy, - Tcl_Interp *interp, int argc, CONST char **argv); + Tcl_Interp *interp, int argc, const char **argv); #endif static void TrivialCmdDeletedProc(ClientData clientData); static int TrivialConfigObjCmd(ClientData dummy, Tcl_Interp *interp, int objc, - Tcl_Obj * CONST objv[]); + Tcl_Obj * const objv[]); static void TrivialEventProc(ClientData clientData, XEvent *eventPtr); @@ -332,7 +332,7 @@ TestcbindCmd( ClientData clientData, /* Main window for application. */ Tcl_Interp *interp, /* Current interpreter. */ int argc, /* Number of arguments. */ - CONST char **argv) /* Argument strings. */ + const char **argv) /* Argument strings. */ { TkWindow *winPtr; Tk_Window tkwin; @@ -440,7 +440,7 @@ TestbitmapObjCmd( ClientData clientData, /* Main window for application. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { if (objc < 2) { @@ -475,7 +475,7 @@ TestborderObjCmd( ClientData clientData, /* Main window for application. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { if (objc < 2) { @@ -510,7 +510,7 @@ TestcolorObjCmd( ClientData clientData, /* Main window for application. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { if (objc < 2) { Tcl_WrongNumArgs(interp, 1, objv, "color"); @@ -544,7 +544,7 @@ TestcursorObjCmd( ClientData clientData, /* Main window for application. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { if (objc < 2) { Tcl_WrongNumArgs(interp, 1, objv, "cursor"); @@ -579,7 +579,7 @@ TestdeleteappsCmd( ClientData clientData, /* Main window for application. */ Tcl_Interp *interp, /* Current interpreter. */ int argc, /* Number of arguments. */ - CONST char **argv) /* Argument strings. */ + const char **argv) /* Argument strings. */ { NewApp *nextPtr; @@ -616,9 +616,9 @@ TestobjconfigObjCmd( ClientData clientData, /* Main window for application. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { - static CONST char *options[] = { + static const char *options[] = { "alltypes", "chain1", "chain2", "configerror", "delete", "info", "internal", "new", "notenoughparams", "twowindows", NULL }; @@ -631,7 +631,7 @@ TestobjconfigObjCmd( /* Holds pointers to option tables created by * commands below; indexed with same values as * "options" array. */ - static Tk_ObjCustomOption CustomOption = { + static const Tk_ObjCustomOption CustomOption = { "custom option", CustomOptionSet, CustomOptionGet, @@ -970,7 +970,7 @@ TestobjconfigObjCmd( char *custom; } InternalRecord; InternalRecord *recordPtr; - static const char *internalStringTable[] = { + static const char *const internalStringTable[] = { "one", "two", "three", "four", NULL }; static const Tk_OptionSpec internalSpecs[] = { @@ -1247,10 +1247,10 @@ TrivialConfigObjCmd( ClientData clientData, /* Main window for application. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { int result = TCL_OK; - static CONST char *options[] = { + static const char *options[] = { "cget", "configure", "csave", NULL }; enum { @@ -1430,9 +1430,9 @@ TestfontObjCmd( ClientData clientData, /* Main window for application. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { - static CONST char *options[] = {"counts", "subfonts", NULL}; + static const char *options[] = {"counts", "subfonts", NULL}; enum option {COUNTS, SUBFONTS}; int index; Tk_Window tkwin; @@ -1491,7 +1491,7 @@ ImageCreate( * image. */ char *name, /* Name to use for image. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[], /* Argument strings for options (doesn't + Tcl_Obj *const objv[], /* Argument strings for options (doesn't * include image name or type). */ Tk_ImageType *typePtr, /* Pointer to our type record (not used). */ Tk_ImageMaster master, /* Token for image, to be used by us in later @@ -1556,7 +1556,7 @@ ImageCmd( ClientData clientData, /* Main window for application. */ Tcl_Interp *interp, /* Current interpreter. */ int argc, /* Number of arguments. */ - CONST char **argv) /* Argument strings. */ + const char **argv) /* Argument strings. */ { TImageMaster *timPtr = (TImageMaster *) clientData; int x, y, width, height; @@ -1777,7 +1777,7 @@ TestmakeexistCmd( ClientData clientData, /* Main window for application. */ Tcl_Interp *interp, /* Current interpreter. */ int argc, /* Number of arguments. */ - CONST char **argv) /* Argument strings. */ + const char **argv) /* Argument strings. */ { Tk_Window mainWin = (Tk_Window) clientData; int i; @@ -1819,7 +1819,7 @@ TestmenubarCmd( ClientData clientData, /* Main window for application. */ Tcl_Interp *interp, /* Current interpreter. */ int argc, /* Number of arguments. */ - CONST char **argv) /* Argument strings. */ + const char **argv) /* Argument strings. */ { #ifdef __UNIX__ Tk_Window mainWin = (Tk_Window) clientData; @@ -1888,7 +1888,7 @@ TestmetricsCmd( ClientData clientData, /* Main window for application. */ Tcl_Interp *interp, /* Current interpreter. */ int argc, /* Number of arguments. */ - CONST char **argv) /* Argument strings. */ + const char **argv) /* Argument strings. */ { char buf[TCL_INTEGER_SPACE]; int val; @@ -1961,7 +1961,7 @@ TestpropCmd( ClientData clientData, /* Main window for application. */ Tcl_Interp *interp, /* Current interpreter. */ int argc, /* Number of arguments. */ - CONST char **argv) /* Argument strings. */ + const char **argv) /* Argument strings. */ { Tk_Window mainWin = (Tk_Window) clientData; int result, actualFormat; @@ -2041,7 +2041,7 @@ TestwrapperCmd( ClientData clientData, /* Main window for application. */ Tcl_Interp *interp, /* Current interpreter. */ int argc, /* Number of arguments. */ - CONST char **argv) /* Argument strings. */ + const char **argv) /* Argument strings. */ { TkWindow *winPtr, *wrapperPtr; Tk_Window tkwin; diff --git a/generic/tkText.c b/generic/tkText.c index 6156dd4..f3e1c26 100644 --- a/generic/tkText.c +++ b/generic/tkText.c @@ -48,7 +48,7 @@ * table below. */ -static const char *stateStrings[] = { +static const char *const stateStrings[] = { "disabled", "normal", NULL }; @@ -58,7 +58,7 @@ static const char *stateStrings[] = { * table below. */ -static const char *wrapStrings[] = { +static const char *const wrapStrings[] = { "char", "none", "word", NULL }; @@ -68,7 +68,7 @@ static const char *wrapStrings[] = { * the string table below. */ -static const char *tabStyleStrings[] = { +static const char *const tabStyleStrings[] = { "tabular", "wordprocessor", NULL }; @@ -96,7 +96,7 @@ static void RestoreLineStartEnd(ClientData clientData, char *oldInternalPtr); static int ObjectIsEmpty(Tcl_Obj *objPtr); -static Tk_ObjCustomOption lineOption = { +static const Tk_ObjCustomOption lineOption = { "line", /* name */ SetLineStartEnd, /* setProc */ GetLineStartEnd, /* getProc */ @@ -329,13 +329,13 @@ int tkTextDebug = 0; */ static int ConfigureText(Tcl_Interp *interp, - TkText *textPtr, int objc, Tcl_Obj *CONST objv[]); + TkText *textPtr, int objc, Tcl_Obj *const objv[]); static int DeleteIndexRange(TkSharedText *sharedPtr, - TkText *textPtr, CONST TkTextIndex *indexPtr1, - CONST TkTextIndex *indexPtr2, int viewUpdate); -static int CountIndices(CONST TkText *textPtr, - CONST TkTextIndex *indexPtr1, - CONST TkTextIndex *indexPtr2, + TkText *textPtr, const TkTextIndex *indexPtr1, + const TkTextIndex *indexPtr2, int viewUpdate); +static int CountIndices(const TkText *textPtr, + const TkTextIndex *indexPtr1, + const TkTextIndex *indexPtr2, TkTextCountType type); static void DestroyText(TkText *textPtr); static int InsertChars(TkSharedText *sharedTextPtr, @@ -344,58 +344,58 @@ static int InsertChars(TkSharedText *sharedTextPtr, static void TextBlinkProc(ClientData clientData); static void TextCmdDeletedProc(ClientData clientData); static int CreateWidget(TkSharedText *sharedPtr, Tk_Window tkwin, - Tcl_Interp *interp, CONST TkText *parent, - int objc, Tcl_Obj *CONST objv[]); + Tcl_Interp *interp, const TkText *parent, + int objc, Tcl_Obj *const objv[]); static void TextEventProc(ClientData clientData, XEvent *eventPtr); static int TextFetchSelection(ClientData clientData, int offset, char *buffer, int maxBytes); -static int TextIndexSortProc(CONST void *first, - CONST void *second); +static int TextIndexSortProc(const void *first, + const void *second); static int TextInsertCmd(TkSharedText *sharedTextPtr, TkText *textPtr, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[], - CONST TkTextIndex *indexPtr, int viewUpdate); + int objc, Tcl_Obj *const objv[], + const TkTextIndex *indexPtr, int viewUpdate); static int TextReplaceCmd(TkText *textPtr, Tcl_Interp *interp, - CONST TkTextIndex *indexFromPtr, - CONST TkTextIndex *indexToPtr, - int objc, Tcl_Obj *CONST objv[], int viewUpdate); + const TkTextIndex *indexFromPtr, + const TkTextIndex *indexToPtr, + int objc, Tcl_Obj *const objv[], int viewUpdate); static int TextSearchCmd(TkText *textPtr, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]); + int objc, Tcl_Obj *const objv[]); static int TextEditCmd(TkText *textPtr, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]); + int objc, Tcl_Obj *const objv[]); static int TextWidgetObjCmd(ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]); + int objc, Tcl_Obj *const objv[]); static int SharedTextObjCmd(ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]); + int objc, Tcl_Obj *const objv[]); static void TextWorldChangedCallback(ClientData instanceData); static void TextWorldChanged(TkText *textPtr, int mask); static int TextDumpCmd(TkText *textPtr, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]); + int objc, Tcl_Obj *const objv[]); static int DumpLine(Tcl_Interp *interp, TkText *textPtr, int what, TkTextLine *linePtr, int start, int end, int lineno, Tcl_Obj *command); static int DumpSegment(TkText *textPtr, Tcl_Interp *interp, - CONST char *key, CONST char *value, - Tcl_Obj *command, CONST TkTextIndex *index, + const char *key, const char *value, + Tcl_Obj *command, const TkTextIndex *index, int what); static int TextEditUndo(TkText *textPtr); static int TextEditRedo(TkText *textPtr); -static Tcl_Obj * TextGetText(CONST TkText *textPtr, - CONST TkTextIndex *index1, - CONST TkTextIndex *index2, int visibleOnly); +static Tcl_Obj * TextGetText(const TkText *textPtr, + const TkTextIndex *index1, + const TkTextIndex *index2, int visibleOnly); static void GenerateModifiedEvent(TkText *textPtr); static void UpdateDirtyFlag(TkSharedText *sharedPtr); static void TextPushUndoAction(TkText *textPtr, Tcl_Obj *undoString, int insert, - CONST TkTextIndex *index1Ptr, - CONST TkTextIndex *index2Ptr); -static int TextSearchIndexInLine(CONST SearchSpec *searchSpecPtr, + const TkTextIndex *index1Ptr, + const TkTextIndex *index2Ptr); +static int TextSearchIndexInLine(const SearchSpec *searchSpecPtr, TkTextLine *linePtr, int byteIndex); static int TextPeerCmd(TkText *textPtr, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]); + int objc, Tcl_Obj *const objv[]); static TkUndoProc TextUndoRedoCallback; /* @@ -441,7 +441,7 @@ Tk_TextObjCmd( ClientData clientData, /* Main window associated with interpreter. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { Tk_Window tkwin = (Tk_Window) clientData; @@ -479,10 +479,10 @@ CreateWidget( TkSharedText *sharedPtr, /* Shared widget info, or NULL. */ Tk_Window tkwin, /* Main window associated with interpreter. */ Tcl_Interp *interp, /* Current interpreter. */ - CONST TkText *parent, /* If non-NULL then take default start, end + const TkText *parent, /* If non-NULL then take default start, end * from this parent. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { register TkText *textPtr; Tk_OptionTable optionTable; @@ -680,13 +680,13 @@ TextWidgetObjCmd( ClientData clientData, /* Information about text widget. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { register TkText *textPtr = (TkText *) clientData; int result = TCL_OK; int index; - static CONST char *optionStrings[] = { + static const char *optionStrings[] = { "bbox", "cget", "compare", "configure", "count", "debug", "delete", "dlineinfo", "dump", "edit", "get", "image", "index", "insert", "mark", "peer", "replace", "scan", "search", "see", "tag", "window", @@ -714,7 +714,7 @@ TextWidgetObjCmd( switch ((enum options) index) { case TEXT_BBOX: { int x, y, width, height; - CONST TkTextIndex *indexPtr; + const TkTextIndex *indexPtr; if (objc != 3) { Tcl_WrongNumArgs(interp, 2, objv, "index"); @@ -758,8 +758,8 @@ TextWidgetObjCmd( break; case TEXT_COMPARE: { int relation, value; - CONST char *p; - CONST TkTextIndex *index1Ptr, *index2Ptr; + const char *p; + const TkTextIndex *index1Ptr, *index2Ptr; if (objc != 5) { Tcl_WrongNumArgs(interp, 2, objv, "index1 op index2"); @@ -819,7 +819,7 @@ TextWidgetObjCmd( } break; case TEXT_COUNT: { - CONST TkTextIndex *indexFromPtr, *indexToPtr; + const TkTextIndex *indexFromPtr, *indexToPtr; int i, found = 0, update = 0; Tcl_Obj *objPtr = NULL; @@ -842,7 +842,7 @@ TextWidgetObjCmd( for (i = 2; i < objc-2; i++) { int value, length; - CONST char *option = Tcl_GetStringFromObj(objv[i], &length); + const char *option = Tcl_GetStringFromObj(objv[i], &length); char c; if (length < 2 || option[0] != '-') { @@ -881,7 +881,7 @@ TextWidgetObjCmd( } if (compare > 0) { - CONST TkTextIndex *tmpPtr = indexFromPtr; + const TkTextIndex *tmpPtr = indexFromPtr; indexFromPtr = indexToPtr; indexToPtr = tmpPtr; @@ -1054,7 +1054,7 @@ TextWidgetObjCmd( * Simple case requires no predetermination of indices. */ - CONST TkTextIndex *indexPtr1, *indexPtr2; + const TkTextIndex *indexPtr1, *indexPtr2; /* * Parse the starting and stopping indices. @@ -1100,7 +1100,7 @@ TextWidgetObjCmd( */ for (i = 0; i < objc; i++) { - CONST TkTextIndex *indexPtr = + const TkTextIndex *indexPtr = TkTextGetIndexFromObj(interp, textPtr, objv[i]); if (indexPtr == NULL) { @@ -1191,7 +1191,7 @@ TextWidgetObjCmd( break; case TEXT_DLINEINFO: { int x, y, width, height, base; - CONST TkTextIndex *indexPtr; + const TkTextIndex *indexPtr; if (objc != 3) { Tcl_WrongNumArgs(interp, 2, objv, "index"); @@ -1226,7 +1226,7 @@ TextWidgetObjCmd( case TEXT_GET: { Tcl_Obj *objPtr = NULL; int i, found = 0, visible = 0; - CONST char *name; + const char *name; int length; if (objc < 3) { @@ -1257,7 +1257,7 @@ TextWidgetObjCmd( } for (; i < objc; i += 2) { - CONST TkTextIndex *index1Ptr, *index2Ptr; + const TkTextIndex *index1Ptr, *index2Ptr; TkTextIndex index2; index1Ptr = TkTextGetIndexFromObj(interp, textPtr, objv[i]); @@ -1321,7 +1321,7 @@ TextWidgetObjCmd( result = TkTextImageCmd(textPtr, interp, objc, objv); break; case TEXT_INDEX: { - CONST TkTextIndex *indexPtr; + const TkTextIndex *indexPtr; if (objc != 3) { Tcl_WrongNumArgs(interp, 2, objv, "index"); @@ -1338,7 +1338,7 @@ TextWidgetObjCmd( break; } case TEXT_INSERT: { - CONST TkTextIndex *indexPtr; + const TkTextIndex *indexPtr; if (objc < 4) { Tcl_WrongNumArgs(interp, 2, objv, @@ -1364,7 +1364,7 @@ TextWidgetObjCmd( result = TextPeerCmd(textPtr, interp, objc, objv); break; case TEXT_REPLACE: { - CONST TkTextIndex *indexFromPtr, *indexToPtr; + const TkTextIndex *indexFromPtr, *indexToPtr; if (objc < 5) { Tcl_WrongNumArgs(interp, 2, objv, @@ -1523,13 +1523,13 @@ SharedTextObjCmd( ClientData clientData, /* Information about shared test B-tree. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { register TkSharedText *sharedPtr = (TkSharedText *) clientData; int result = TCL_OK; int index; - static CONST char *optionStrings[] = { + static const char *optionStrings[] = { "delete", "insert", NULL }; enum options { @@ -1629,12 +1629,12 @@ TextPeerCmd( TkText *textPtr, /* Information about text widget. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { Tk_Window tkwin = textPtr->tkwin; int index; - static CONST char *peerOptionStrings[] = { + static const char *peerOptionStrings[] = { "create", "names", NULL }; enum peerOptions { @@ -1703,12 +1703,12 @@ static int TextReplaceCmd( TkText *textPtr, /* Information about text widget. */ Tcl_Interp *interp, /* Current interpreter. */ - CONST TkTextIndex *indexFromPtr, + const TkTextIndex *indexFromPtr, /* Index from which to replace. */ - CONST TkTextIndex *indexToPtr, + const TkTextIndex *indexToPtr, /* Index to which to replace. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[], /* Argument objects. */ + Tcl_Obj *const objv[], /* Argument objects. */ int viewUpdate) /* Update vertical view if set. */ { /* @@ -1773,8 +1773,8 @@ TextReplaceCmd( static int TextIndexSortProc( - CONST void *first, /* Elements to be compared. */ - CONST void *second) + const void *first, /* Elements to be compared. */ + const void *second) { TkTextIndex *pair1 = (TkTextIndex *) first; TkTextIndex *pair2 = (TkTextIndex *) second; @@ -1991,7 +1991,7 @@ ConfigureText( register TkText *textPtr, /* Information about widget; may or may not * already have values for some fields. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { Tk_SavedOptions savedOptions; int oldExport = textPtr->exportSelection; @@ -2532,7 +2532,7 @@ InsertChars( int resetViewCount; int pixels[2*PIXEL_CLIENTS]; - CONST char *string = Tcl_GetStringFromObj(stringPtr, &length); + const char *string = Tcl_GetStringFromObj(stringPtr, &length); if (sharedTextPtr == NULL) { sharedTextPtr = textPtr->sharedTextPtr; @@ -2664,9 +2664,9 @@ TextPushUndoAction( TkText *textPtr, /* Overall information about text widget. */ Tcl_Obj *undoString, /* New text. */ int insert, /* 1 if insert, else delete. */ - CONST TkTextIndex *index1Ptr, + const TkTextIndex *index1Ptr, /* Index describing first location. */ - CONST TkTextIndex *index2Ptr) + const TkTextIndex *index2Ptr) /* Index describing second location. */ { TkUndoSubAtom *iAtom, *dAtom; @@ -2888,11 +2888,11 @@ TextUndoRedoCallback( static int CountIndices( - CONST TkText *textPtr, /* Overall information about text widget. */ - CONST TkTextIndex *indexPtr1, + const TkText *textPtr, /* Overall information about text widget. */ + const TkTextIndex *indexPtr1, /* Index describing location of first * character to delete. */ - CONST TkTextIndex *indexPtr2, + const TkTextIndex *indexPtr2, /* Index describing location of last character * to delete. NULL means just delete the one * character given by indexPtr1. */ @@ -2945,10 +2945,10 @@ static int DeleteIndexRange( TkSharedText *sharedTextPtr,/* Shared portion of peer widgets. */ TkText *textPtr, /* Overall information about text widget. */ - CONST TkTextIndex *indexPtr1, + const TkTextIndex *indexPtr1, /* Index describing location of first * character (or other entity) to delete. */ - CONST TkTextIndex *indexPtr2, + const TkTextIndex *indexPtr2, /* Index describing location of last * character (or other entity) to delete. * NULL means just delete the one character @@ -3554,8 +3554,8 @@ TextInsertCmd( TkText *textPtr, /* Information about text widget. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[], /* Argument objects. */ - CONST TkTextIndex *indexPtr,/* Index at which to insert. */ + Tcl_Obj *const objv[], /* Argument objects. */ + const TkTextIndex *indexPtr,/* Index at which to insert. */ int viewUpdate) /* Update the view if set. */ { TkTextIndex index1, index2; @@ -3599,7 +3599,7 @@ TextInsertCmd( int i; for (i = 0; i < numTags; i++) { - CONST char *strTag = Tcl_GetString(tagNamePtrs[i]); + const char *strTag = Tcl_GetString(tagNamePtrs[i]); TkBTreeTag(&index1, &index2, TkTextCreateTag(textPtr, strTag, NULL), 1); @@ -3633,12 +3633,12 @@ TextSearchCmd( TkText *textPtr, /* Information about text widget. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { int i, argsLeft, code; SearchSpec searchSpec; - static CONST char *switchStrings[] = { + static const char *switchStrings[] = { "--", "-all", "-backwards", "-count", "-elide", "-exact", "-forwards", "-hidden", "-nocase", "-nolinestop", "-overlap", "-regexp", "-strictlimits", NULL @@ -3850,7 +3850,7 @@ TextSearchGetLineIndex( int *offsetPosPtr) /* For returning the text offset in the * line. */ { - CONST TkTextIndex *indexPtr; + const TkTextIndex *indexPtr; int line; TkText *textPtr = (TkText *) searchSpecPtr->clientData; @@ -3909,7 +3909,7 @@ TextSearchGetLineIndex( static int TextSearchIndexInLine( - CONST SearchSpec *searchSpecPtr, + const SearchSpec *searchSpecPtr, /* Search parameters. */ TkTextLine *linePtr, /* The line we're looking at. */ int byteIndex) /* Index into the line. */ @@ -4129,7 +4129,7 @@ TextSearchFoundMatch( */ if (searchSpecPtr->exact) { - CONST char *startOfLine = Tcl_GetString(theLine); + const char *startOfLine = Tcl_GetString(theLine); numChars = Tcl_NumUtfChars(startOfLine + matchOffset, matchLength); } else { @@ -4340,7 +4340,7 @@ TkTextGetTabs( /* * Map these strings to TkTextTabAlign values. */ - static CONST char *tabOptionStrings[] = { + static const char *tabOptionStrings[] = { "left", "right", "center", "numeric", NULL }; @@ -4492,7 +4492,7 @@ TextDumpCmd( register TkText *textPtr, /* Information about text widget. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. Someone else has already + Tcl_Obj *const objv[]) /* Argument objects. Someone else has already * parsed this command enough to know that * objv[1] is "dump". */ { @@ -4510,7 +4510,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 *optStrings[] = { "-all", "-command", "-image", "-mark", "-tag", "-text", "-window", NULL }; @@ -4882,10 +4882,10 @@ static int DumpSegment( TkText *textPtr, Tcl_Interp *interp, - CONST char *key, /* Segment type key. */ - CONST char *value, /* Segment value. */ + const char *key, /* Segment type key. */ + const char *value, /* Segment value. */ Tcl_Obj *command, /* Script callback. */ - CONST TkTextIndex *index, /* index with line/byte position info. */ + const TkTextIndex *index, /* index with line/byte position info. */ int what) /* Look for TK_DUMP_INDEX bit. */ { char buffer[TK_POS_CHARS]; @@ -4897,7 +4897,7 @@ DumpSegment( Tcl_AppendElement(interp, buffer); return 0; } else { - CONST char *argv[4]; + const char *argv[4]; char *list; int oldStateEpoch = TkBTreeEpoch(textPtr->sharedTextPtr->tree); @@ -5034,11 +5034,11 @@ TextEditCmd( TkText *textPtr, /* Information about text widget. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { int index; - static CONST char *editOptionStrings[] = { + static const char *editOptionStrings[] = { "modified", "redo", "reset", "separator", "undo", NULL }; enum editOptions { @@ -5168,10 +5168,10 @@ TextEditCmd( static Tcl_Obj * TextGetText( - CONST TkText *textPtr, /* Information about text widget. */ - CONST TkTextIndex *indexPtr1, + const TkText *textPtr, /* Information about text widget. */ + const TkTextIndex *indexPtr1, /* Get text from this index... */ - CONST TkTextIndex *indexPtr2, + const TkTextIndex *indexPtr2, /* ...to this index. */ int visibleOnly) /* If non-zero, then only return non-elided * characters. */ @@ -5362,7 +5362,7 @@ SearchPerform( */ if (toPtr != NULL) { - CONST TkTextIndex *indexToPtr, *indexFromPtr; + const TkTextIndex *indexToPtr, *indexFromPtr; TkText *textPtr = (TkText *) searchSpecPtr->clientData; indexToPtr = TkTextGetIndexFromObj(interp, textPtr, toPtr); @@ -5456,7 +5456,7 @@ SearchCore( Tcl_Obj *theLine; int alreadySearchOffset = -1; - CONST char *pattern = NULL; /* For exact searches only. */ + const char *pattern = NULL; /* For exact searches only. */ int firstNewLine = -1; /* For exact searches only. */ Tcl_RegExp regexp = NULL; /* For regexp searches only. */ @@ -5514,7 +5514,7 @@ SearchCore( */ if (searchSpecPtr->exact) { - CONST char *nl; + const char *nl; /* * We only need to set the matchLength once for exact searches, and we @@ -5651,11 +5651,11 @@ SearchCore( if (searchSpecPtr->exact) { int maxExtraLines = 0; - CONST char *startOfLine = Tcl_GetString(theLine); + const char *startOfLine = Tcl_GetString(theLine); do { Tcl_UniChar ch; - CONST char *p; + const char *p; int lastFullLine = lastOffset; if (firstNewLine == -1) { @@ -5680,7 +5680,7 @@ SearchCore( * match. */ - CONST char c = pattern[0]; + const char c = pattern[0]; if (alreadySearchOffset != -1) { p = startOfLine + alreadySearchOffset; @@ -6626,7 +6626,7 @@ TkpTesttextCmd( ClientData clientData, /* Main window for application. */ Tcl_Interp *interp, /* Current interpreter. */ int argc, /* Number of arguments. */ - CONST char **argv) /* Argument strings. */ + const char **argv) /* Argument strings. */ { TkText *textPtr; size_t len; |