summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
Diffstat (limited to 'generic')
-rw-r--r--generic/regc_lex.c38
-rw-r--r--generic/regcomp.c24
-rw-r--r--generic/tclCmdMZ.c4
-rw-r--r--generic/tclCompExpr.c18
-rw-r--r--generic/tclCompile.c2
-rw-r--r--generic/tclDate.c12
-rw-r--r--generic/tclExecute.c2
-rw-r--r--generic/tclGetDate.y12
-rw-r--r--generic/tclIO.c2
-rw-r--r--generic/tclIOCmd.c2
-rw-r--r--generic/tclIOGT.c1
-rw-r--r--generic/tclIOUtil.c1
-rw-r--r--generic/tclTest.c2
13 files changed, 61 insertions, 59 deletions
diff --git a/generic/regc_lex.c b/generic/regc_lex.c
index 588718d..99497b9 100644
--- a/generic/regc_lex.c
+++ b/generic/regc_lex.c
@@ -195,8 +195,8 @@ struct vars *v;
static VOID
lexnest(v, beginp, endp)
struct vars *v;
-chr *beginp; /* start of interpolation */
-chr *endp; /* one past end of interpolation */
+CONST chr *beginp; /* start of interpolation */
+CONST chr *endp; /* one past end of interpolation */
{
assert(v->savenow == NULL); /* only one level of nesting */
v->savenow = v->now;
@@ -208,47 +208,47 @@ chr *endp; /* one past end of interpolation */
/*
* string constants to interpolate as expansions of things like \d
*/
-static chr backd[] = { /* \d */
+static CONST chr backd[] = { /* \d */
CHR('['), CHR('['), CHR(':'),
CHR('d'), CHR('i'), CHR('g'), CHR('i'), CHR('t'),
CHR(':'), CHR(']'), CHR(']')
};
-static chr backD[] = { /* \D */
+static CONST chr backD[] = { /* \D */
CHR('['), CHR('^'), CHR('['), CHR(':'),
CHR('d'), CHR('i'), CHR('g'), CHR('i'), CHR('t'),
CHR(':'), CHR(']'), CHR(']')
};
-static chr brbackd[] = { /* \d within brackets */
+static CONST chr brbackd[] = { /* \d within brackets */
CHR('['), CHR(':'),
CHR('d'), CHR('i'), CHR('g'), CHR('i'), CHR('t'),
CHR(':'), CHR(']')
};
-static chr backs[] = { /* \s */
+static CONST chr backs[] = { /* \s */
CHR('['), CHR('['), CHR(':'),
CHR('s'), CHR('p'), CHR('a'), CHR('c'), CHR('e'),
CHR(':'), CHR(']'), CHR(']')
};
-static chr backS[] = { /* \S */
+static CONST chr backS[] = { /* \S */
CHR('['), CHR('^'), CHR('['), CHR(':'),
CHR('s'), CHR('p'), CHR('a'), CHR('c'), CHR('e'),
CHR(':'), CHR(']'), CHR(']')
};
-static chr brbacks[] = { /* \s within brackets */
+static CONST chr brbacks[] = { /* \s within brackets */
CHR('['), CHR(':'),
CHR('s'), CHR('p'), CHR('a'), CHR('c'), CHR('e'),
CHR(':'), CHR(']')
};
-static chr backw[] = { /* \w */
+static CONST chr backw[] = { /* \w */
CHR('['), CHR('['), CHR(':'),
CHR('a'), CHR('l'), CHR('n'), CHR('u'), CHR('m'),
CHR(':'), CHR(']'), CHR('_'), CHR(']')
};
-static chr backW[] = { /* \W */
+static CONST chr backW[] = { /* \W */
CHR('['), CHR('^'), CHR('['), CHR(':'),
CHR('a'), CHR('l'), CHR('n'), CHR('u'), CHR('m'),
CHR(':'), CHR(']'), CHR('_'), CHR(']')
};
-static chr brbackw[] = { /* \w within brackets */
+static CONST chr brbackw[] = { /* \w within brackets */
CHR('['), CHR(':'),
CHR('a'), CHR('l'), CHR('n'), CHR('u'), CHR('m'),
CHR(':'), CHR(']'), CHR('_')
@@ -660,13 +660,13 @@ lexescape(v)
struct vars *v;
{
chr c;
- static chr alert[] = {
+ static CONST chr alert[] = {
CHR('a'), CHR('l'), CHR('e'), CHR('r'), CHR('t')
};
- static chr esc[] = {
+ static CONST chr esc[] = {
CHR('E'), CHR('S'), CHR('C')
};
- chr *save;
+ CONST chr *save;
assert(v->cflags&REG_ADVF);
@@ -979,7 +979,7 @@ static VOID
skip(v)
struct vars *v;
{
- chr *start = v->now;
+ CONST chr *start = v->now;
assert(v->cflags&REG_EXPANDED);
@@ -1018,10 +1018,10 @@ newline()
^ #endif
*/
#ifdef REG_DEBUG
-static chr *
+static CONST chr *
ch()
{
- static chr chstr[] = { CHR('c'), CHR('h'), CHR('\0') };
+ static CONST chr chstr[] = { CHR('c'), CHR('h'), CHR('\0') };
return chstr;
}
@@ -1036,8 +1036,8 @@ ch()
static chr
chrnamed(v, startp, endp, lastresort)
struct vars *v;
-chr *startp; /* start of name */
-chr *endp; /* just past end of name */
+CONST chr *startp; /* start of name */
+CONST chr *endp; /* just past end of name */
pchr lastresort; /* what to return if name lookup fails */
{
celt c;
diff --git a/generic/regcomp.c b/generic/regcomp.c
index c239d8b..a1fe5bc 100644
--- a/generic/regcomp.c
+++ b/generic/regcomp.c
@@ -52,7 +52,7 @@ static VOID repeat _ANSI_ARGS_((struct vars *, struct state *, struct state *, i
static VOID bracket _ANSI_ARGS_((struct vars *, struct state *, struct state *));
static VOID cbracket _ANSI_ARGS_((struct vars *, struct state *, struct state *));
static VOID brackpart _ANSI_ARGS_((struct vars *, struct state *, struct state *));
-static chr *scanplain _ANSI_ARGS_((struct vars *));
+static CONST chr *scanplain _ANSI_ARGS_((struct vars *));
static VOID onechr _ANSI_ARGS_((struct vars *, pchr, struct state *, struct state *));
static VOID dovec _ANSI_ARGS_((struct vars *, struct cvec *, struct state *, struct state *));
static celt nextleader _ANSI_ARGS_((struct vars *, pchr, pchr));
@@ -76,7 +76,7 @@ static char *stid _ANSI_ARGS_((struct subre *, char *, size_t));
/* === regc_lex.c === */
static VOID lexstart _ANSI_ARGS_((struct vars *));
static VOID prefixes _ANSI_ARGS_((struct vars *));
-static VOID lexnest _ANSI_ARGS_((struct vars *, chr *, chr *));
+static VOID lexnest _ANSI_ARGS_((struct vars *, CONST chr *, CONST chr *));
static VOID lexword _ANSI_ARGS_((struct vars *));
static int next _ANSI_ARGS_((struct vars *));
static int lexescape _ANSI_ARGS_((struct vars *));
@@ -85,9 +85,9 @@ static int brenext _ANSI_ARGS_((struct vars *, pchr));
static VOID skip _ANSI_ARGS_((struct vars *));
static chr newline _ANSI_ARGS_((NOPARMS));
#ifdef REG_DEBUG
-static chr *ch _ANSI_ARGS_((NOPARMS));
+static CONST chr *ch _ANSI_ARGS_((NOPARMS));
#endif
-static chr chrnamed _ANSI_ARGS_((struct vars *, chr *, chr *, pchr));
+static chr chrnamed _ANSI_ARGS_((struct vars *, CONST chr *, CONST chr *, pchr));
/* === regc_color.c === */
static VOID initcm _ANSI_ARGS_((struct vars *, struct colormap *));
static VOID freecm _ANSI_ARGS_((struct colormap *));
@@ -190,10 +190,10 @@ static int casecmp _ANSI_ARGS_((CONST chr *, CONST chr *, size_t));
/* internal variables, bundled for easy passing around */
struct vars {
regex_t *re;
- chr *now; /* scan pointer into string */
- chr *stop; /* end of string */
- chr *savenow; /* saved now and stop for "subroutine call" */
- chr *savestop;
+ CONST chr *now; /* scan pointer into string */
+ CONST chr *stop; /* end of string */
+ CONST chr *savenow; /* saved now and stop for "subroutine call" */
+ CONST chr *savestop;
int err; /* error code (0 if none) */
int cflags; /* copy of compile flags */
int lasttype; /* type of previous token */
@@ -1357,8 +1357,8 @@ struct state *rp;
celt startc;
celt endc;
struct cvec *cv;
- chr *startp;
- chr *endp;
+ CONST chr *startp;
+ CONST chr *endp;
chr c[1];
/* parse something, get rid of special cases, take shortcuts */
@@ -1458,11 +1458,11 @@ struct state *rp;
* to look past the final bracket of the [. etc.
^ static chr *scanplain(struct vars *);
*/
-static chr * /* just after end of sequence */
+static CONST chr * /* just after end of sequence */
scanplain(v)
struct vars *v;
{
- chr *endp;
+ CONST chr *endp;
assert(SEE(COLLEL) || SEE(ECLASS) || SEE(CCLASS));
NEXT();
diff --git a/generic/tclCmdMZ.c b/generic/tclCmdMZ.c
index fb15062..4ada397 100644
--- a/generic/tclCmdMZ.c
+++ b/generic/tclCmdMZ.c
@@ -115,10 +115,10 @@ Tcl_TraceTypeObjCmd TclTraceExecutionObjCmd;
static CONST char *traceTypeOptions[] = {
"execution", "command", "variable", (char*) NULL
};
-static Tcl_TraceTypeObjCmd* traceSubCmds[] = {
+static Tcl_TraceTypeObjCmd *CONST traceSubCmds[] = {
TclTraceExecutionObjCmd,
TclTraceCommandObjCmd,
- TclTraceVariableObjCmd,
+ TclTraceVariableObjCmd
};
/*
diff --git a/generic/tclCompExpr.c b/generic/tclCompExpr.c
index 68533c5..6bac221 100644
--- a/generic/tclCompExpr.c
+++ b/generic/tclCompExpr.c
@@ -101,19 +101,19 @@ static int opTableInitialized = 0; /* 0 means not yet initialized. */
TCL_DECLARE_MUTEX(opMutex)
typedef struct OperatorDesc {
- char *name; /* Name of the operator. */
+ CONST char *name; /* Name of the operator. */
int numOperands; /* Number of operands. 0 if the operator
* requires special handling. */
int instruction; /* Instruction opcode for the operator.
* Ignored if numOperands is 0. */
} OperatorDesc;
-static OperatorDesc operatorTable[] = {
+static CONST OperatorDesc operatorTable[] = {
{"*", 2, INST_MULT},
{"/", 2, INST_DIV},
{"%", 2, INST_MOD},
- {"+", 0},
- {"-", 0},
+ {"+", 0, 0},
+ {"-", 0, 0},
{"<<", 2, INST_LSHIFT},
{">>", 2, INST_RSHIFT},
{"<", 2, INST_LT},
@@ -125,14 +125,14 @@ static OperatorDesc operatorTable[] = {
{"&", 2, INST_BITAND},
{"^", 2, INST_BITXOR},
{"|", 2, INST_BITOR},
- {"&&", 0},
- {"||", 0},
- {"?", 0},
+ {"&&", 0, 0},
+ {"||", 0, 0},
+ {"?", 0, 0},
{"!", 1, INST_LNOT},
{"~", 1, INST_BITNOT},
{"eq", 2, INST_STR_EQ},
{"ne", 2, INST_STR_NEQ},
- {NULL}
+ {NULL, 0, 0}
};
/*
@@ -343,7 +343,7 @@ CompileSubExpr(exprTokenPtr, infoPtr, envPtr)
Tcl_Interp *interp = infoPtr->interp;
Tcl_Token *tokenPtr, *endPtr = NULL; /* silence gcc 4 warning */
Tcl_Token *afterSubexprPtr;
- OperatorDesc *opDescPtr;
+ CONST OperatorDesc *opDescPtr;
Tcl_HashEntry *hPtr;
CONST char *operator;
Tcl_DString opBuf;
diff --git a/generic/tclCompile.c b/generic/tclCompile.c
index e281a0a..1ec7c58 100644
--- a/generic/tclCompile.c
+++ b/generic/tclCompile.c
@@ -267,7 +267,7 @@ InstructionDesc tclInstructionTable[] = {
* stacked objs: stktop is old value, next is new element value, next
* come (operand-2) indices; pushes the new value.
*/
- {0}
+ {0, 0, 0, 0, {OPERAND_NONE}}
};
/*
diff --git a/generic/tclDate.c b/generic/tclDate.c
index 7354a6f..b64a792 100644
--- a/generic/tclDate.c
+++ b/generic/tclDate.c
@@ -189,7 +189,7 @@ static int TclDatemaxdepth = YYMAXDEPTH;
/*
* Month and day table.
*/
-static TABLE MonthDayTable[] = {
+static CONST TABLE MonthDayTable[] = {
{ "january", tMONTH, 1 },
{ "february", tMONTH, 2 },
{ "march", tMONTH, 3 },
@@ -220,7 +220,7 @@ static TABLE MonthDayTable[] = {
/*
* Time units table.
*/
-static TABLE UnitsTable[] = {
+static CONST TABLE UnitsTable[] = {
{ "year", tMONTH_UNIT, 12 },
{ "month", tMONTH_UNIT, 1 },
{ "fortnight", tDAY_UNIT, 14 },
@@ -237,7 +237,7 @@ static TABLE UnitsTable[] = {
/*
* Assorted relative-time words.
*/
-static TABLE OtherTable[] = {
+static CONST TABLE OtherTable[] = {
{ "tomorrow", tDAY_UNIT, 1 },
{ "yesterday", tDAY_UNIT, -1 },
{ "today", tDAY_UNIT, 0 },
@@ -269,7 +269,7 @@ static TABLE OtherTable[] = {
* The timezone table. (Note: This table was modified to not use any floating
* point constants to work around an SGI compiler bug).
*/
-static TABLE TimezoneTable[] = {
+static CONST TABLE TimezoneTable[] = {
{ "gmt", tZONE, HOUR( 0) }, /* Greenwich Mean */
{ "ut", tZONE, HOUR( 0) }, /* Universal (Coordinated) */
{ "utc", tZONE, HOUR( 0) },
@@ -353,7 +353,7 @@ static TABLE TimezoneTable[] = {
/*
* Military timezone table.
*/
-static TABLE MilitaryTable[] = {
+static CONST TABLE MilitaryTable[] = {
{ "a", tZONE, HOUR( 1) },
{ "b", tZONE, HOUR( 2) },
{ "c", tZONE, HOUR( 3) },
@@ -655,7 +655,7 @@ LookupWord(buff)
{
register char *p;
register char *q;
- register TABLE *tp;
+ register CONST TABLE *tp;
int i;
int abbrev;
diff --git a/generic/tclExecute.c b/generic/tclExecute.c
index 9f01cbb..3ca1b63 100644
--- a/generic/tclExecute.c
+++ b/generic/tclExecute.c
@@ -453,7 +453,7 @@ BuiltinFunc tclBuiltinFuncTable[] = {
{"round", 1, {TCL_EITHER}, ExprRoundFunc, 0},
{"srand", 1, {TCL_INT}, ExprSrandFunc, 0},
{"wide", 1, {TCL_EITHER}, ExprWideFunc, 0},
- {0},
+ {0, 0, {TCL_INT}, 0, 0},
};
/*
diff --git a/generic/tclGetDate.y b/generic/tclGetDate.y
index 7db4a35..d210526 100644
--- a/generic/tclGetDate.y
+++ b/generic/tclGetDate.y
@@ -408,7 +408,7 @@ o_merid : /* NULL */ {
/*
* Month and day table.
*/
-static TABLE MonthDayTable[] = {
+static CONST TABLE MonthDayTable[] = {
{ "january", tMONTH, 1 },
{ "february", tMONTH, 2 },
{ "march", tMONTH, 3 },
@@ -439,7 +439,7 @@ static TABLE MonthDayTable[] = {
/*
* Time units table.
*/
-static TABLE UnitsTable[] = {
+static CONST TABLE UnitsTable[] = {
{ "year", tMONTH_UNIT, 12 },
{ "month", tMONTH_UNIT, 1 },
{ "fortnight", tDAY_UNIT, 14 },
@@ -456,7 +456,7 @@ static TABLE UnitsTable[] = {
/*
* Assorted relative-time words.
*/
-static TABLE OtherTable[] = {
+static CONST TABLE OtherTable[] = {
{ "tomorrow", tDAY_UNIT, 1 },
{ "yesterday", tDAY_UNIT, -1 },
{ "today", tDAY_UNIT, 0 },
@@ -488,7 +488,7 @@ static TABLE OtherTable[] = {
* The timezone table. (Note: This table was modified to not use any floating
* point constants to work around an SGI compiler bug).
*/
-static TABLE TimezoneTable[] = {
+static CONST TABLE TimezoneTable[] = {
{ "gmt", tZONE, HOUR( 0) }, /* Greenwich Mean */
{ "ut", tZONE, HOUR( 0) }, /* Universal (Coordinated) */
{ "utc", tZONE, HOUR( 0) },
@@ -572,7 +572,7 @@ static TABLE TimezoneTable[] = {
/*
* Military timezone table.
*/
-static TABLE MilitaryTable[] = {
+static CONST TABLE MilitaryTable[] = {
{ "a", tZONE, HOUR( 1) },
{ "b", tZONE, HOUR( 2) },
{ "c", tZONE, HOUR( 3) },
@@ -874,7 +874,7 @@ LookupWord(buff)
{
register char *p;
register char *q;
- register TABLE *tp;
+ register CONST TABLE *tp;
int i;
int abbrev;
diff --git a/generic/tclIO.c b/generic/tclIO.c
index 15ac94f..a1d5447 100644
--- a/generic/tclIO.c
+++ b/generic/tclIO.c
@@ -7596,7 +7596,7 @@ Tcl_FileEventObjCmd(clientData, interp, objc, objv)
int modeIndex; /* Index of mode argument. */
int mask;
static CONST char *modeOptions[] = {"readable", "writable", NULL};
- static int maskArray[] = {TCL_READABLE, TCL_WRITABLE};
+ static CONST int maskArray[] = {TCL_READABLE, TCL_WRITABLE};
if ((objc != 3) && (objc != 4)) {
Tcl_WrongNumArgs(interp, 1, objv, "channelId event ?script?");
diff --git a/generic/tclIOCmd.c b/generic/tclIOCmd.c
index 7d54156..2b3a5a8 100644
--- a/generic/tclIOCmd.c
+++ b/generic/tclIOCmd.c
@@ -421,7 +421,7 @@ Tcl_SeekObjCmd(clientData, interp, objc, objv)
static CONST char *originOptions[] = {
"start", "current", "end", (char *) NULL
};
- static int modeArray[] = {SEEK_SET, SEEK_CUR, SEEK_END};
+ static CONST int modeArray[] = {SEEK_SET, SEEK_CUR, SEEK_END};
if ((objc != 3) && (objc != 4)) {
Tcl_WrongNumArgs(interp, 1, objv, "channelId offset ?origin?");
diff --git a/generic/tclIOGT.c b/generic/tclIOGT.c
index 0cd9c67..8699b39 100644
--- a/generic/tclIOGT.c
+++ b/generic/tclIOGT.c
@@ -143,6 +143,7 @@ static Tcl_ChannelType transformChannelType = {
NULL, /* Flush proc. */
TransformNotifyProc, /* Handling of events bubbling up */
TransformWideSeekProc, /* Wide seek proc */
+ NULL
};
/*
diff --git a/generic/tclIOUtil.c b/generic/tclIOUtil.c
index 1dfd4ba..d50f2e3 100644
--- a/generic/tclIOUtil.c
+++ b/generic/tclIOUtil.c
@@ -469,6 +469,7 @@ static FilesystemRecord nativeFilesystemRecord = {
NULL,
&tclNativeFilesystem,
1,
+ NULL,
NULL
};
diff --git a/generic/tclTest.c b/generic/tclTest.c
index 194f110..b61213d 100644
--- a/generic/tclTest.c
+++ b/generic/tclTest.c
@@ -2777,7 +2777,7 @@ TestlocaleCmd(clientData, interp, objc, objv)
"ctype", "numeric", "time", "collate", "monetary",
"all", NULL
};
- static int lcTypes[] = {
+ static CONST int lcTypes[] = {
LC_CTYPE, LC_NUMERIC, LC_TIME, LC_COLLATE, LC_MONETARY,
LC_ALL
};