summaryrefslogtreecommitdiffstats
path: root/generic/tkEntry.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2012-06-19 10:29:25 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2012-06-19 10:29:25 (GMT)
commit9389cc709a38a39f1dbd50e744342ee2590269f8 (patch)
tree71968a06df024ea74a2bc06c881ffd4d50c04891 /generic/tkEntry.c
parent8a539b981722705710128c18bb03787afa71847f (diff)
parente8469505b13e2af380977e581f42402073a2136f (diff)
downloadtk-9389cc709a38a39f1dbd50e744342ee2590269f8.zip
tk-9389cc709a38a39f1dbd50e744342ee2590269f8.tar.gz
tk-9389cc709a38a39f1dbd50e744342ee2590269f8.tar.bz2
SetOptions.3: minor doc fix
make various other tables const (all backported from Tk 8.6)
Diffstat (limited to 'generic/tkEntry.c')
-rw-r--r--generic/tkEntry.c76
1 files changed, 38 insertions, 38 deletions
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;