Skip to content

Commit deb46c0

Browse files
author
jan.nijtmans
committed
Missing 'const'
2 parents 0cb215a + 3e1221e commit deb46c0

File tree

5 files changed

+15
-15
lines changed

5 files changed

+15
-15
lines changed

generic/tclClockFmt.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1380,7 +1380,7 @@ static TclStrIdxTree *
13801380
ClockMCGetMultiListIdxTree(
13811381
ClockFmtScnCmdArgs *opts,
13821382
int mcKey,
1383-
int *mcKeys)
1383+
const int *mcKeys)
13841384
{
13851385
TclStrIdxTree * idxTree;
13861386
Tcl_Obj *objPtr = TclClockMCGetIdx(opts, mcKey);
@@ -1481,11 +1481,11 @@ static int
14811481
StaticListSearch(
14821482
ClockFmtScnCmdArgs *opts,
14831483
DateInfo *info,
1484-
const char **lst,
1484+
const char *const *lst,
14851485
int *val)
14861486
{
14871487
size_t len;
1488-
const char **s = lst;
1488+
const char *const *s = lst;
14891489

14901490
while (*s != NULL) {
14911491
len = strlen(*s);
@@ -1535,7 +1535,7 @@ ClockScnToken_Month_Proc(
15351535
{
15361536
#if 0
15371537
/* currently unused, test purposes only */
1538-
static const char * months[] = {
1538+
static const char *const months[] = {
15391539
/* full */
15401540
"January", "February", "March",
15411541
"April", "May", "June",
@@ -1552,7 +1552,7 @@ ClockScnToken_Month_Proc(
15521552
}
15531553
yyMonth = (val % 12) + 1;
15541554
#else
1555-
static int monthsKeys[] = {MCLIT_MONTHS_FULL, MCLIT_MONTHS_ABBREV, 0};
1555+
static const int monthsKeys[] = {MCLIT_MONTHS_FULL, MCLIT_MONTHS_ABBREV, 0};
15561556

15571557
int ret, val;
15581558
int minLen, maxLen;
@@ -1583,7 +1583,7 @@ ClockScnToken_DayOfWeek_Proc(
15831583
DateInfo *info,
15841584
const ClockScanToken *tok)
15851585
{
1586-
static int dowKeys[] = {MCLIT_DAYS_OF_WEEK_ABBREV, MCLIT_DAYS_OF_WEEK_FULL, 0};
1586+
static const int dowKeys[] = {MCLIT_DAYS_OF_WEEK_ABBREV, MCLIT_DAYS_OF_WEEK_FULL, 0};
15871587

15881588
int ret, val;
15891589
int minLen, maxLen;

generic/tclIcu.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ static struct {
283283
TCL_DECLARE_MUTEX(icu_mutex);
284284

285285
/* Options used by multiple normalization functions */
286-
static const char *normalizationForms[] = {"nfc", "nfd", "nfkc", "nfkd", NULL};
286+
static const char *const normalizationForms[] = {"nfc", "nfd", "nfkc", "nfkd", NULL};
287287
typedef enum { MODE_NFC, MODE_NFD, MODE_NFKC, MODE_NFKD } NormalizationMode;
288288

289289

@@ -1003,7 +1003,7 @@ static int IcuParseConvertOptions(
10031003

10041004
/* Use GetIndexFromObj for option parsing so -failindex can be added later */
10051005

1006-
static const char *optNames[] = {"-profile", "-failindex", NULL};
1006+
static const char *const optNames[] = {"-profile", "-failindex", NULL};
10071007
enum { OPT_PROFILE, OPT_FAILINDEX } opt;
10081008
int i;
10091009
int strict = 1;
@@ -1166,7 +1166,7 @@ IcuNormalizeObjCmd(
11661166
int objc, /* Number of arguments. */
11671167
Tcl_Obj *const objv[]) /* Argument objects. */
11681168
{
1169-
static const char *optNames[] = {"-profile", "-mode", NULL};
1169+
static const char *const optNames[] = {"-profile", "-mode", NULL};
11701170
enum { OPT_PROFILE, OPT_MODE } opt;
11711171

11721172
if (objc < 2) {

generic/tclOODefineCmds.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1903,7 +1903,7 @@ TclOODefineDefnNsObjCmd(
19031903
int objc,
19041904
Tcl_Obj *const *objv)
19051905
{
1906-
static const char *kindList[] = {
1906+
static const char *const kindList[] = {
19071907
"-class",
19081908
"-instance",
19091909
NULL

generic/tclOOInfo.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1129,7 +1129,7 @@ InfoClassDefnNsCmd(
11291129
int objc,
11301130
Tcl_Obj *const objv[])
11311131
{
1132-
static const char *kindList[] = {
1132+
static const char *const kindList[] = {
11331133
"-class",
11341134
"-instance",
11351135
NULL

generic/tclTest.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1868,7 +1868,7 @@ TestdoubledigitsCmd(
18681868
int objc, /* Parameter count */
18691869
Tcl_Obj* const objv[]) /* Parameter vector */
18701870
{
1871-
static const char * const options[] = {
1871+
static const char *const options[] = {
18721872
"shortest",
18731873
"e",
18741874
"f",
@@ -3689,16 +3689,16 @@ TestlinkarrayCmd(
36893689
int objc, /* Number of arguments. */
36903690
Tcl_Obj *const objv[]) /* Argument objects. */
36913691
{
3692-
static const char *LinkOption[] = {
3692+
static const char *const LinkOption[] = {
36933693
"update", "remove", "create", NULL
36943694
};
36953695
enum LinkOptionEnum { LINK_UPDATE, LINK_REMOVE, LINK_CREATE } optionIndex;
3696-
static const char *LinkType[] = {
3696+
static const char *const LinkType[] = {
36973697
"char", "uchar", "short", "ushort", "int", "uint", "long", "ulong",
36983698
"wide", "uwide", "float", "double", "string", "char*", "binary", NULL
36993699
};
37003700
/* all values after TCL_LINK_CHARS_ARRAY are used as arrays (see below) */
3701-
static int LinkTypes[] = {
3701+
static const int LinkTypes[] = {
37023702
TCL_LINK_CHAR, TCL_LINK_UCHAR,
37033703
TCL_LINK_SHORT, TCL_LINK_USHORT, TCL_LINK_INT, TCL_LINK_UINT,
37043704
TCL_LINK_LONG, TCL_LINK_ULONG, TCL_LINK_WIDE_INT, TCL_LINK_WIDE_UINT,

0 commit comments

Comments
 (0)