diff options
Diffstat (limited to 'generic/regc_locale.c')
-rw-r--r-- | generic/regc_locale.c | 118 |
1 files changed, 59 insertions, 59 deletions
diff --git a/generic/regc_locale.c b/generic/regc_locale.c index ef8ecdc..cd98942 100644 --- a/generic/regc_locale.c +++ b/generic/regc_locale.c @@ -12,9 +12,9 @@ /* ASCII character-name table */ -static CONST struct cname { - CONST char *name; - CONST char code; +static const struct cname { + const char *name; + const char code; } cnames[] = { {"NUL", '\0'}, {"SOH", '\001'}, @@ -133,7 +133,7 @@ typedef struct crange { * Unicode: alphabetic characters. */ -static CONST crange alphaRangeTable[] = { +static const crange alphaRangeTable[] = { {0x0041, 0x005a}, {0x0061, 0x007a}, {0x00c0, 0x00d6}, {0x00d8, 0x00f6}, {0x00f8, 0x02c1}, {0x02c6, 0x02d1}, {0x02e0, 0x02e4}, {0x0370, 0x0374}, {0x037a, 0x037d}, {0x0388, 0x038a}, {0x038e, 0x03a1}, {0x03a3, 0x03f5}, @@ -200,7 +200,7 @@ static CONST crange alphaRangeTable[] = { #define NUM_ALPHA_RANGE (sizeof(alphaRangeTable)/sizeof(crange)) -static CONST chr alphaCharTable[] = { +static const chr alphaCharTable[] = { 0x00aa, 0x00b5, 0x00ba, 0x02ec, 0x02ee, 0x0376, 0x0377, 0x0386, 0x038c, 0x0559, 0x066e, 0x066f, 0x06d5, 0x06e5, 0x06e6, 0x06ee, 0x06ef, 0x06ff, 0x0710, 0x07b1, 0x07f4, 0x07f5, 0x07fa, 0x081a, 0x0824, 0x0828, 0x093d, @@ -227,14 +227,14 @@ static CONST chr alphaCharTable[] = { * Unicode: control characters. */ -static CONST crange controlRangeTable[] = { +static const crange controlRangeTable[] = { {0x007f, 0x009f}, {0x0600, 0x0603}, {0x200b, 0x200f}, {0x202a, 0x202e}, {0x2060, 0x2064}, {0x206a, 0x206f}, {0xe000, 0xf8ff}, {0xfff9, 0xfffb} }; #define NUM_CONTROL_RANGE (sizeof(controlRangeTable)/sizeof(crange)) -static CONST chr controlCharTable[] = { +static const chr controlCharTable[] = { 0x00ad, 0x06dd, 0x070f, 0x17b4, 0x17b5, 0xfeff }; @@ -244,7 +244,7 @@ static CONST chr controlCharTable[] = { * Unicode: decimal digit characters. */ -static CONST crange digitRangeTable[] = { +static const crange digitRangeTable[] = { {0x0030, 0x0039}, {0x0660, 0x0669}, {0x06f0, 0x06f9}, {0x07c0, 0x07c9}, {0x0966, 0x096f}, {0x09e6, 0x09ef}, {0x0a66, 0x0a6f}, {0x0ae6, 0x0aef}, {0x0b66, 0x0b6f}, {0x0be6, 0x0bef}, {0x0c66, 0x0c6f}, {0x0ce6, 0x0cef}, @@ -266,7 +266,7 @@ static CONST crange digitRangeTable[] = { * Unicode: punctuation characters. */ -static CONST crange punctRangeTable[] = { +static const crange punctRangeTable[] = { {0x0021, 0x0023}, {0x0025, 0x002a}, {0x002c, 0x002f}, {0x005b, 0x005d}, {0x055a, 0x055f}, {0x066a, 0x066d}, {0x0700, 0x070d}, {0x07f7, 0x07f9}, {0x0830, 0x083e}, {0x0f04, 0x0f12}, {0x0f3a, 0x0f3d}, {0x0fd0, 0x0fd4}, @@ -284,7 +284,7 @@ static CONST crange punctRangeTable[] = { #define NUM_PUNCT_RANGE (sizeof(punctRangeTable)/sizeof(crange)) -static CONST chr punctCharTable[] = { +static const chr punctCharTable[] = { 0x003a, 0x003b, 0x003f, 0x0040, 0x005f, 0x007b, 0x007d, 0x00a1, 0x00ab, 0x00b7, 0x00bb, 0x00bf, 0x037e, 0x0387, 0x0589, 0x058a, 0x05be, 0x05c0, 0x05c3, 0x05c6, 0x05f3, 0x05f4, 0x0609, 0x060a, 0x060c, 0x060d, 0x061b, @@ -305,13 +305,13 @@ static CONST chr punctCharTable[] = { * Unicode: white space characters. */ -static CONST crange spaceRangeTable[] = { +static const crange spaceRangeTable[] = { {0x0009, 0x000d}, {0x2000, 0x200a} }; #define NUM_SPACE_RANGE (sizeof(spaceRangeTable)/sizeof(crange)) -static CONST chr spaceCharTable[] = { +static const chr spaceCharTable[] = { 0x0020, 0x00a0, 0x1680, 0x180e, 0x2028, 0x2029, 0x202f, 0x205f, 0x3000 }; @@ -321,7 +321,7 @@ static CONST chr spaceCharTable[] = { * Unicode: lowercase characters. */ -static CONST crange lowerRangeTable[] = { +static const crange lowerRangeTable[] = { {0x0061, 0x007a}, {0x00df, 0x00f6}, {0x00f8, 0x00ff}, {0x017e, 0x0180}, {0x0199, 0x019b}, {0x01bd, 0x01bf}, {0x0233, 0x0239}, {0x024f, 0x0293}, {0x0295, 0x02af}, {0x037b, 0x037d}, {0x03ac, 0x03ce}, {0x03d5, 0x03d7}, @@ -337,7 +337,7 @@ static CONST crange lowerRangeTable[] = { #define NUM_LOWER_RANGE (sizeof(lowerRangeTable)/sizeof(crange)) -static CONST chr lowerCharTable[] = { +static const chr lowerCharTable[] = { 0x00aa, 0x00b5, 0x00ba, 0x0101, 0x0103, 0x0105, 0x0107, 0x0109, 0x010b, 0x010d, 0x010f, 0x0111, 0x0113, 0x0115, 0x0117, 0x0119, 0x011b, 0x011d, 0x011f, 0x0121, 0x0123, 0x0125, 0x0127, 0x0129, 0x012b, 0x012d, 0x012f, @@ -408,7 +408,7 @@ static CONST chr lowerCharTable[] = { * Unicode: uppercase characters. */ -static CONST crange upperRangeTable[] = { +static const crange upperRangeTable[] = { {0x0041, 0x005a}, {0x00c0, 0x00d6}, {0x00d8, 0x00de}, {0x0189, 0x018b}, {0x018e, 0x0191}, {0x0196, 0x0198}, {0x01b1, 0x01b3}, {0x01f6, 0x01f8}, {0x0243, 0x0246}, {0x0388, 0x038a}, {0x0391, 0x03a1}, {0x03a3, 0x03ab}, @@ -423,7 +423,7 @@ static CONST crange upperRangeTable[] = { #define NUM_UPPER_RANGE (sizeof(upperRangeTable)/sizeof(crange)) -static CONST chr upperCharTable[] = { +static const chr upperCharTable[] = { 0x0100, 0x0102, 0x0104, 0x0106, 0x0108, 0x010a, 0x010c, 0x010e, 0x0110, 0x0112, 0x0114, 0x0116, 0x0118, 0x011a, 0x011c, 0x011e, 0x0120, 0x0122, 0x0124, 0x0126, 0x0128, 0x012a, 0x012c, 0x012e, 0x0130, 0x0132, 0x0134, @@ -494,7 +494,7 @@ static CONST chr upperCharTable[] = { * Unicode: unicode print characters excluding space. */ -static CONST crange graphRangeTable[] = { +static const crange graphRangeTable[] = { {0x0021, 0x007e}, {0x00a1, 0x00ac}, {0x00ae, 0x0377}, {0x037a, 0x037e}, {0x0384, 0x038a}, {0x038e, 0x03a1}, {0x03a3, 0x0527}, {0x0531, 0x0556}, {0x0559, 0x055f}, {0x0561, 0x0587}, {0x0591, 0x05c7}, {0x05d0, 0x05ea}, @@ -575,7 +575,7 @@ static CONST crange graphRangeTable[] = { #define NUM_GRAPH_RANGE (sizeof(graphRangeTable)/sizeof(crange)) -static CONST chr graphCharTable[] = { +static const chr graphCharTable[] = { 0x038c, 0x0589, 0x058a, 0x085e, 0x098f, 0x0990, 0x09b2, 0x09c7, 0x09c8, 0x09d7, 0x09dc, 0x09dd, 0x0a0f, 0x0a10, 0x0a32, 0x0a33, 0x0a35, 0x0a36, 0x0a38, 0x0a39, 0x0a3c, 0x0a47, 0x0a48, 0x0a51, 0x0a5e, 0x0ab2, 0x0ab3, @@ -600,18 +600,18 @@ static CONST chr graphCharTable[] = { /* - element - map collating-element name to celt - ^ static celt element(struct vars *, CONST chr *, CONST chr *); + ^ static celt element(struct vars *, const chr *, const chr *); */ static celt -element(v, startp, endp) - struct vars *v; /* context */ - CONST chr *startp; /* points to start of name */ - CONST chr *endp; /* points just past end of name */ +element( + struct vars *v, /* context */ + const chr *startp, /* points to start of name */ + const chr *endp) /* points just past end of name */ { - CONST struct cname *cn; + const struct cname *cn; size_t len; Tcl_DString ds; - CONST char *np; + const char *np; /* * Generic: one-chr names stand for themselves. @@ -654,11 +654,11 @@ element(v, startp, endp) ^ static struct cvec *range(struct vars *, celt, celt, int); */ static struct cvec * -range(v, a, b, cases) - struct vars *v; /* context */ - celt a; /* range start */ - celt b; /* range end, might equal a */ - int cases; /* case-independent? */ +range( + struct vars *v, /* context */ + celt a, /* range start */ + celt b, /* range end, might equal a */ + int cases) /* case-independent? */ { int nchrs; struct cvec *cv; @@ -711,8 +711,8 @@ range(v, a, b, cases) ^ static int before(celt, celt); */ static int /* predicate */ -before(x, y) - celt x, y; /* collating elements */ +before( + celt x, celt y) /* collating elements */ { if (x < y) { return 1; @@ -726,11 +726,11 @@ before(x, y) ^ static struct cvec *eclass(struct vars *, celt, int); */ static struct cvec * -eclass(v, c, cases) - struct vars *v; /* context */ - celt c; /* Collating element representing - * the equivalence class. */ - int cases; /* all cases? */ +eclass( + struct vars *v, /* context */ + celt c, /* Collating element representing the + * equivalence class. */ + int cases) /* all cases? */ { struct cvec *cv; @@ -765,27 +765,27 @@ eclass(v, c, cases) /* - cclass - supply cvec for a character class * Must include case counterparts on request. - ^ static struct cvec *cclass(struct vars *, CONST chr *, CONST chr *, int); + ^ static struct cvec *cclass(struct vars *, const chr *, const chr *, int); */ static struct cvec * -cclass(v, startp, endp, cases) - struct vars *v; /* context */ - CONST chr *startp; /* where the name starts */ - CONST chr *endp; /* just past the end of the name */ - int cases; /* case-independent? */ +cclass( + struct vars *v, /* context */ + const chr *startp, /* where the name starts */ + const chr *endp, /* just past the end of the name */ + int cases) /* case-independent? */ { size_t len; struct cvec *cv = NULL; Tcl_DString ds; - CONST char *np; - CONST char *CONST *namePtr; + const char *np; + const char *const *namePtr; int i, index; /* * The following arrays define the valid character class names. */ - static CONST char *CONST classNames[] = { + static const char *const classNames[] = { "alnum", "alpha", "ascii", "blank", "cntrl", "digit", "graph", "lower", "print", "punct", "space", "upper", "xdigit", NULL }; @@ -1004,9 +1004,9 @@ cclass(v, startp, endp, cases) ^ static struct cvec *allcases(struct vars *, pchr); */ static struct cvec * -allcases(v, pc) - struct vars *v; /* context */ - pchr pc; /* character to get case equivs of */ +allcases( + struct vars *v, /* context */ + pchr pc) /* character to get case equivs of */ { struct cvec *cv; chr c = (chr)pc; @@ -1035,12 +1035,12 @@ allcases(v, pc) * Note that it does not need to report anything except equal/unequal. * Note also that the length is exact, and the comparison should not * stop at embedded NULs! - ^ static int cmp(CONST chr *, CONST chr *, size_t); + ^ static int cmp(const chr *, const chr *, size_t); */ -static int /* 0 for equal, nonzero for unequal */ -cmp(x, y, len) - CONST chr *x, *y; /* strings to compare */ - size_t len; /* exact length of comparison */ +static int /* 0 for equal, nonzero for unequal */ +cmp( + const chr *x, const chr *y, /* strings to compare */ + size_t len) /* exact length of comparison */ { return memcmp(VS(x), VS(y), len*sizeof(chr)); } @@ -1051,12 +1051,12 @@ cmp(x, y, len) * Note that it does not need to report anything except equal/unequal. * Note also that the length is exact, and the comparison should not * stop at embedded NULs! - ^ static int casecmp(CONST chr *, CONST chr *, size_t); + ^ static int casecmp(const chr *, const chr *, size_t); */ -static int /* 0 for equal, nonzero for unequal */ -casecmp(x, y, len) - CONST chr *x, *y; /* strings to compare */ - size_t len; /* exact length of comparison */ +static int /* 0 for equal, nonzero for unequal */ +casecmp( + const chr *x, const chr *y, /* strings to compare */ + size_t len) /* exact length of comparison */ { for (; len > 0; len--, x++, y++) { if ((*x!=*y) && (Tcl_UniCharToLower(*x) != Tcl_UniCharToLower(*y))) { |