diff options
author | Kenneth G Raeburn <raeburn@mit.edu> | 1991-01-08 21:37:57 +0000 |
---|---|---|
committer | Kenneth G Raeburn <raeburn@mit.edu> | 1991-01-08 21:37:57 +0000 |
commit | 7f65dcf9395311cf8aec1233d3332f0c0c770f88 (patch) | |
tree | 7219e848d64d9ab6714577d2f99a71bbe1613e32 | |
parent | 3c1530f6e09ee6025cd910db761feb6d7c39ba6d (diff) |
Made statically defined chaaracter classes "const".
-rw-r--r-- | zwgc/formatter.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/zwgc/formatter.c b/zwgc/formatter.c index 59627f5..f834b30 100644 --- a/zwgc/formatter.c +++ b/zwgc/formatter.c @@ -26,6 +26,10 @@ static char rcsid_formatter_c[] = "$Id$"; #include "formatter.h" #include "text_operations.h" +#if !defined(__STDC__) && !defined(const) +#define const +#endif + static int pure_text_length(), env_length(); #ifdef notdef @@ -49,7 +53,7 @@ static character_class atsign_set = { /* '@' = 0x40 */ }; #endif -static character_class paren_set = { /* '(' = 0x28, ')' = 0x29 */ +static const character_class paren_set = { /* '(' = 0x28, ')' = 0x29 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0, @@ -68,7 +72,7 @@ static character_class paren_set = { /* '(' = 0x28, ')' = 0x29 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }; -static character_class sbracket_set = { /* '[' = 0x5b, ']' = 0x5d */ +static const character_class sbracket_set = { /* '[' = 0x5b, ']' = 0x5d */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, @@ -87,7 +91,7 @@ static character_class sbracket_set = { /* '[' = 0x5b, ']' = 0x5d */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }; -static character_class abracket_set = { /* '<' = 0x3c, '>' = 0x3e */ +static const character_class abracket_set = { /* '<' = 0x3c, '>' = 0x3e */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, @@ -106,7 +110,7 @@ static character_class abracket_set = { /* '<' = 0x3c, '>' = 0x3e */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }; -static character_class cbracket_set = { /* '{' = 0x7b, '}' = 0x7d */ +static const character_class cbracket_set = { /* '{' = 0x7b, '}' = 0x7d */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, @@ -125,7 +129,7 @@ static character_class cbracket_set = { /* '{' = 0x7b, '}' = 0x7d */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }; -static character_class allbracket_set = { +static const character_class allbracket_set = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0, @@ -144,7 +148,7 @@ static character_class allbracket_set = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }; -static character_class allmaskable_set = { +static const character_class allmaskable_set = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0, @@ -167,9 +171,9 @@ static char brackets[]="()<>[]{}@"; static char *openbracket[]={"@<","@<","@[","@[","@{","@{","@(","@(","@("}; static char *closebracket[]={">",">","]","]","}","}",")",")",")"}; -int not_contains(str, set) +static int not_contains(str, set) string str; - character_class set; + const character_class set; { while (*str && ! set[*str]) str++; return (! *str); |