View | Details | Raw Unified | Return to bug 246163 | Differences between
and this patch

Collapse All | Expand All

(-)frink/Makefile (-4 / +2 lines)
Lines 4-17 Link Here
4
PORTNAME=	frink
4
PORTNAME=	frink
5
PORTVERSION=	2.2.2p4
5
PORTVERSION=	2.2.2p4
6
CATEGORIES=	devel
6
CATEGORIES=	devel
7
MASTER_SITES=	ftp://catless.ncl.ac.uk/pub/
7
MASTER_SITES=	https://BSDforge.com/projects/source/devel/frink/
8
8
9
MAINTAINER=	mi@aldan.algebra.com
9
MAINTAINER=	mi@aldan.algebra.com
10
COMMENT=	Tcl formatter and static tester
10
COMMENT=	Tcl formatter and static tester
11
11
12
BROKEN=		unfetchable
12
LICENSE_FILE=	${WRKSRC}/COPYRIGHT
13
DEPRECATED=	Broken for more than 6 months
14
EXPIRATION_DATE=	2020-05-05
15
13
16
WRKSRC=		${WRKDIR}/${PORTNAME}-2.2.2
14
WRKSRC=		${WRKDIR}/${PORTNAME}-2.2.2
17
USES=		uidfix
15
USES=		uidfix
(-)frink/files/Makefile.bsd (-2 / +2 lines)
Lines 1-9 Link Here
1
PROG=	frink
1
PROG=	frink
2
SRCS=	blocks.c config.c frink.c output.c tcl.c token.c util.c vars.c
2
SRCS=	blocks.c config.c frink.c output.c tcl.c token.c util.c vars.c
3
CFLAGS+=-I${.CURDIR}
3
CFLAGS+=-I${.CURDIR} -D HAVE_STDLIB_H=1
4
4
5
BINDIR=	${PREFIX}/bin
5
BINDIR=	${PREFIX}/bin
6
MANDIR=	${PREFIX}/man/man
6
MANDIR=	${PREFIX}/man/man
7
NO_MAN=	regretfully
7
MK_MAN=	no
8
8
9
.include <bsd.prog.mk>
9
.include <bsd.prog.mk>
(-)frink/files/patch-README (+20 lines)
Line 0 Link Here
1
--- README.orig	2020-05-26 18:54:17.353363000 -0700
2
+++ README	2020-05-26 18:55:41.853295000 -0700
3
@@ -32,7 +32,7 @@
4
           turn OFF processing code passed to the bind command.
5
 
6
    -c <n>
7
-          set further indent for continuations to n. default = 2
8
+          set further indent for continuations to n. default = 4
9
 
10
    -d
11
           remove braces in certain (safe) circumstances (default = OFF)
12
@@ -79,7 +79,7 @@
13
           turn on heuristic tests and warnings. (default = OFF)
14
 
15
    -i <n>
16
-          set indent for each level to n. default = 4
17
+          set indent for each level to n. default = 8
18
 
19
    -I
20
           Treat elseif and else the same way. (default = OFF)
(-)frink/files/patch-blocks.c (+28 lines)
Line 0 Link Here
1
--- blocks.c.orig	2020-05-26 00:31:46.870579000 -0700
2
+++ blocks.c	2020-05-26 14:13:00.579154000 -0700
3
@@ -32,7 +32,6 @@
4
 #endif
5
 
6
 extern List *blocks;
7
-extern void warnFor(Token*, char*, char*);
8
 
9
 Blox *pushBlock(Token *cmd, int infl, int lvl, int cond)
10
 {
11
@@ -62,7 +61,7 @@
12
 void delBlock(Blox *blp)
13
 {
14
     VarData *vp;
15
-    
16
+
17
     if (blp != (Blox *) 0)
18
     {
19
         while(blp->vars != noList)
20
@@ -144,7 +143,7 @@
21
 	    switch (vp->type)
22
 	    {
23
 	    case VARG:
24
-	    case VGLOBAL:  
25
+	    case VGLOBAL:
26
 	        break;
27
 
28
 	    case VFOR:
(-)frink/files/patch-blocks.h (+20 lines)
Line 0 Link Here
1
--- blocks.h.orig	2020-05-26 00:34:33.553700000 -0700
2
+++ blocks.h	2020-05-26 14:12:54.854044000 -0700
3
@@ -19,7 +19,7 @@
4
     Token	*name;
5
     int		level;
6
     int		unreachable;
7
-    
8
+
9
     int		result;
10
     int		infloop;
11
     int		returns;
12
@@ -33,7 +33,7 @@
13
 extern Blox *pushBlock(Token *, int, int, int);
14
 extern void delBlock(Blox *);
15
 extern void popBlock(int);
16
-extern int isUnreachable();
17
+extern int isUnreachable(void);
18
 extern void setUnreachable(int);
19
 
20
 #endif
(-)frink/files/patch-config.c (+117 lines)
Line 0 Link Here
1
--- config.c.orig	2020-05-26 00:35:52.107429000 -0700
2
+++ config.c	2020-05-26 14:12:48.821317000 -0700
3
@@ -29,14 +29,10 @@
4
 #include <malloc.h>
5
 #endif
6
 
7
-extern Token *tokenPop(Token **);
8
-extern void freeToken(Token *);
9
-extern void streamMore(Input *);
10
-
11
 List *config = noList;
12
 
13
 static struct {
14
-	char		*name;
15
+	const char	*name;
16
 	ParamType	code;
17
 } pvals[] ={
18
 	{"var",		PVAR},
19
@@ -71,10 +67,10 @@
20
 	{(char *) 0,	0}
21
 };
22
 
23
-void dumpPdata(ParamData *pt, FILE *op)
24
+static void dumpPdata(ParamData *pt, FILE *op)
25
 {
26
     int i;
27
-    char *pad;
28
+    const char *pad;
29
     List *lp;
30
 
31
     for (i=0; pvals[i].name != (char *) 0; i += 1)
32
@@ -104,7 +100,7 @@
33
 
34
 }
35
 
36
-void dumpConf(ConfigData *cp, FILE *op)
37
+void dumpConf(const ConfigData *cp, FILE *op)
38
 {
39
     List *plp;
40
 
41
@@ -118,7 +114,7 @@
42
     fprintf(op, "}\n");
43
 }
44
 
45
-static void pcode(ParamData *ppt, char *str)
46
+static void pcode(ParamData *ppt, const char *str)
47
 {
48
     int i;
49
 
50
@@ -171,8 +167,7 @@
51
     ParamData *ppt;
52
     SeqnData *sd;
53
     void *dp;
54
-    extern void dumpToken(Token *, FILE *);
55
-    
56
+
57
     ppt = newpdata();
58
     switch (tp->type)
59
     {
60
@@ -252,7 +247,7 @@
61
     freeToken(lp2);
62
 }
63
 
64
-static int handle(Token *line)
65
+static int confighandle(Token *line)
66
 {
67
     ConfigData *cpt;
68
     Token *hd, *tp;
69
@@ -306,11 +301,11 @@
70
     return 1;
71
 }
72
 
73
-void readconfig(char *str)
74
+void readconfig(const char *str)
75
 {
76
     FILE *fd;
77
     Input file;
78
-    
79
+
80
     if ((fd = fopen(str, "r")) == NULL)
81
     {
82
 	fprintf(stderr, "Warning: cannot open config file\n");
83
@@ -319,21 +314,21 @@
84
 /*
85
  * use the tokenising mechanism we already have to parse the config file
86
  */
87
-    file.text = (char *) malloc(64*1024);
88
+    file.atext = malloc(64*1024);
89
     file.stream = fd;
90
     file.tcall = file.texpr = 0;
91
     file.lineNumber = 1;
92
     file.lineStart = 1;
93
     streamMore(&file);
94
-    while(handle(collect(&file)))
95
+    while(confighandle(collect(&file)))
96
     {
97
         /* skip */
98
     }
99
-    free(file.text);  
100
+    free(file.atext);
101
     fclose(fd);
102
 }
103
 
104
-void stringconfig(char *str)
105
+void stringconfig(const char *str)
106
 {
107
     Input file;
108
 /*
109
@@ -346,7 +341,7 @@
110
     file.tcall = file.texpr = 0;
111
     file.lineNumber = 1;
112
     file.lineStart = 1;
113
-    while(handle(collect(&file)))
114
+    while(confighandle(collect(&file)))
115
     {
116
         /* skip */
117
     }
(-)frink/files/patch-flagvars.h (+32 lines)
Line 0 Link Here
1
--- flagvars.h.orig	2020-05-26 00:47:05.908959000 -0700
2
+++ flagvars.h	2020-05-26 14:12:42.993712000 -0700
3
@@ -10,11 +10,11 @@
4
  *========================================================================
5
  *
6
  */
7
- 
8
+
9
 extern int failed;
10
 
11
 extern int lineNumber;
12
-extern char *currentfile;
13
+extern const char *currentfile;
14
 
15
 extern int compout;
16
 extern int noquotes;
17
@@ -63,11 +63,11 @@
18
 extern int nocommand;
19
 extern int trystrings;
20
 
21
-extern char *style;
22
-extern char *pstyle;
23
-extern char *contString;
24
+extern const char *style;
25
+extern const char *pstyle;
26
+extern const char *contString;
27
 
28
-extern char *locale;
29
+extern const char *locale;
30
 extern FILE *msgfile;
31
 extern FILE *specfile;
32
 
(-)frink/files/patch-frink.c (+180 lines)
Line 0 Link Here
1
--- frink.c.orig	2020-05-26 00:30:19.435903000 -0700
2
+++ frink.c	2020-05-26 14:12:37.567178000 -0700
3
@@ -28,6 +28,7 @@
4
 #ifdef HAVE_STDLIB_H
5
 #include <stdlib.h>
6
 #endif
7
+#include <unistd.h>
8
 
9
 int failed	= 0;
10
 int lineNumber	= 0;
11
@@ -39,7 +40,7 @@
12
 int fascist	= 0;
13
 
14
 int compout	= 0;
15
-int resvsplit	= 0;
16
+static int resvsplit = 0;
17
 int noquotes	= 0;
18
 int spaceout	= 0;
19
 int trystrings	= 0;
20
@@ -51,8 +52,8 @@
21
 int tclX	= 0;
22
 int addSpaces	= 0;
23
 int width	= 80;
24
-int indent	= 4;
25
-int contdent	= 2;
26
+int indent	= 8;
27
+int contdent	= 4;
28
 int nocomments	= 0;
29
 int obfuscate	= 0;
30
 int tabsOn	= 1;
31
@@ -80,30 +81,21 @@
32
 int extract	= 0;
33
 int internat	= 0;
34
 
35
-char *style		= (char *) 0;
36
-char *pstyle		= (char *) 0;
37
-char *contString 	= "";
38
+const char *style	= NULL;
39
+const char *pstyle	= NULL;
40
+const char *contString 	= "";
41
 
42
-char *locale		= (char *) 0;
43
+const char *locale	= NULL;
44
 FILE *msgfile		= NULL;
45
 FILE *specfile		= NULL;
46
 
47
 int pragma		= 0;
48
 int praghold		= 0;
49
 
50
-char *currentfile	= (char *) 0;
51
+const char *currentfile	= NULL;
52
 
53
-List *skiplist = (List *) 0;
54
+List *skiplist = NULL;
55
 
56
-#ifndef __FreeBSD__
57
-extern int getopt(int, char*const*, const char*);
58
-#endif
59
-
60
-extern int optind;
61
-extern char *optarg;
62
-extern int fclose(FILE*);
63
-extern void readconfig(char *);
64
-extern void stringconfig(char *);
65
 extern void clearState(void);
66
 
67
 static void doVersion(void)
68
@@ -112,7 +104,7 @@
69
     exit(0);
70
 }
71
 
72
-static char *languages[] =
73
+static const char *languages[] =
74
 {
75
     "aa",	/* Afar	*/
76
     "ab",	/* Abkhazian	*/
77
@@ -256,7 +248,7 @@
78
     (char *) 0
79
 };
80
 
81
-static char *countries[] =
82
+static const char *countries[] =
83
 {
84
     "AF",	/* AFGHANISTAN */
85
     "AL",	/* ALBANIA */
86
@@ -500,11 +492,11 @@
87
     (char *) 0
88
 };
89
 
90
-static void checkLocale(char *v)
91
+static void checkLocale(const char *v)
92
 {
93
     int l, i, fnd = 0;;
94
 
95
-    for (i = 0; languages[i] != (char *) 0; i += 1)
96
+    for (i = 0; languages[i] != NULL; i += 1)
97
     {
98
 	if (strncmp(v, languages[i], 2) == 0)
99
 	{
100
@@ -593,7 +585,7 @@
101
 	"\n-K <f>	: specify file of extra code specs."
102
 	"\n-l	: try for one-liners (not yet implemented)"
103
 	"\n-m	: minimise the code by removing redundant spacing. default = OFF"
104
-	"\n-M   : warn if there is no -- on a switch statement. default = OFF" 
105
+	"\n-M   : warn if there is no -- on a switch statement. default = OFF"
106
 	"\n-n 	: do not generate tab characters (default = OFF)"
107
 	"\n-N	: do not put a newline out before elseif. (default = OFF)"
108
 	"\n-o	: obfuscate (not implemented yet) : default = OFF"
109
@@ -624,7 +616,7 @@
110
 	"\n");
111
 }
112
 
113
-void setOption(int flag, char *value)
114
+static void setOption(int flag, const char *value)
115
 {
116
     int not;
117
     switch (flag)
118
@@ -749,9 +741,10 @@
119
     }
120
 }
121
 
122
-static void readrc(char *file)
123
+static void readrc(const char *file)
124
 {
125
-    char *opts[50], buff[128], *cp;
126
+    const char *opts[50];
127
+    char buff[128], *cp;
128
     FILE *desc;
129
     int leng, i;
130
 
131
@@ -793,28 +786,24 @@
132
 
133
 static void process(FILE *desc)
134
 {
135
-    extern void flushOutput(void);
136
-    extern int handle(Token *line);
137
-    extern void streamMore(Input *);
138
-
139
     Input file;
140
 
141
-    file.text = (char *) malloc(64*1024);
142
+    file.atext = malloc(64*1024);
143
     file.stream = desc;
144
     file.tcall = file.texpr = 0;
145
     file.lineNumber = 1;
146
-    file.lineStart = 1;    
147
+    file.lineStart = 1;
148
     streamMore(&file);
149
     while (handle(collect(&file)))
150
     {
151
     }
152
     flushOutput();
153
-    free(file.text);
154
+    free(file.atext);
155
 }
156
 
157
 static void initCmds(void)
158
 {
159
-    static char *cmdspec =
160
+    static const char *cmdspec =
161
 	"set {{var 0x0017} {ctype? 0x0001}}\n"
162
 	"global {{varlist 0x0150}}\n"
163
 	"append {{var 0x0017} any args}\n"
164
@@ -867,7 +856,7 @@
165
 		" {{option copy delete rename} args}"
166
 		" {{option dirname executable exists extension isdirectory isfile nativename normalize owned pathtype readable readlink rootname size split tail type writable} any}"
167
 		" {{option join mkdir} any args}"
168
-		" {{option lstat stat} any {var 0x0001}}"		
169
+		" {{option lstat stat} any {var 0x0001}}"
170
 		" {{option volume}}"
171
 	    "}}\n"
172
 	"namespace {{| args"
173
@@ -969,7 +958,6 @@
174
 int main(int argc, char **argv)
175
 {
176
     FILE  *desc;
177
-    extern void initOutput(void);
178
 
179
     initCmds();
180
     findrc();
(-)frink/files/patch-indent (-23 lines)
Lines 1-23 Link Here
1
This patch sets frink's indentation defaults closer to the FreeBSD's
2
style(9) guidelines.
3
--- README	Thu Jun 21 10:49:12 2001
4
+++ README	Fri May 31 15:04:26 2002
5
@@ -33,3 +33,3 @@
6
    -c <n>
7
-          set further indent for continuations to n. default = 2
8
+          set further indent for continuations to n. default = 4
9
 
10
@@ -77,3 +77,3 @@
11
    -i <n>
12
-          set indent for each level to n. default = 4
13
+          set indent for each level to n. default = 8
14
 
15
--- frink.c	Thu Jun 21 10:49:12 2001
16
+++ frink.c	Fri May 31 15:05:31 2002
17
@@ -37,4 +37,4 @@
18
 int width	= 80;
19
-int indent	= 4;
20
-int contdent	= 2;
21
+int indent	= 8;
22
+int contdent	= 4;
23
 int nocomments	= 0;
(-)frink/files/patch-output.c (+92 lines)
Line 0 Link Here
1
--- output.c.orig	2020-05-26 08:39:53.678780000 -0700
2
+++ output.c	2020-05-26 14:12:23.444021000 -0700
3
@@ -43,10 +43,10 @@
4
 
5
 static TokenType olast	= HEAD;
6
 
7
-static Token nlToken	= {BLANK, CNSTWORD, 0, (char *) 0, 0, (Token *) 0, (Token *) 0};
8
-static Token startToken	= {START, CNSTWORD, 0, (char *) 0, 0, (Token *) 0, (Token *) 0};
9
-static Token contToken	= {CONT, CNSTWORD, 0, (char *) 0, 0, (Token *) 0, (Token *) 0};
10
-static Token spToken	= {SP, CNSTWORD, 0, " ", 1, (Token *) 0, (Token *) 0};
11
+static Token nlToken	= {.type = BLANK, .ckind = CNSTWORD};
12
+static Token startToken	= {.type = START, .ckind = CNSTWORD};
13
+static Token contToken	= {.type = CONT, .ckind = CNSTWORD};
14
+static Token spToken	= {.type = SP, .ckind = CNSTWORD, .text = " ", .length = 1};
15
 
16
 void initOutput(void)
17
 {
18
@@ -122,7 +122,7 @@
19
 	    bp1 = bp3;
20
 	}
21
     }
22
-    
23
+
24
     *bp1++ = '\0';
25
     return bp1;
26
 }
27
@@ -226,7 +226,7 @@
28
     }
29
 }
30
 
31
-static void printkn(char *txt, int length, int keepnl)
32
+static void printkn(const char *txt, int length, int keepnl)
33
 {
34
     char *cp;
35
     int l;
36
@@ -251,7 +251,7 @@
37
     }
38
 }
39
 
40
-static void printn(char *txt, int len)
41
+static void printn(const char *txt, int len)
42
 {
43
     if (!testonly)
44
     {
45
@@ -259,12 +259,12 @@
46
     }
47
 }
48
 
49
-static void print(char *txt)
50
+static void print(const char *txt)
51
 {
52
     printn(txt, strlen(txt));
53
 }
54
 
55
-static void brace(char *t)
56
+static void brace(const char *t)
57
 {
58
     char *cp, *bp;
59
     while ((cp = strpbrk(t, "{}")) != (char *) 0)
60
@@ -343,7 +343,7 @@
61
     case CONT :
62
     case ECONT :
63
     case NL :
64
-	break;	
65
+	break;
66
     default :
67
 	output(&spToken, 1);
68
     }
69
@@ -377,10 +377,10 @@
70
     if (qts) { printn("\"", 1); }
71
 }
72
 
73
-static Token dollarToken = {DOLLAR, CNSTWORD, 0, (char *) 0, 0, (Token *) 0, (Token *) 0};
74
-static Token endlineToken = {ENDLINE, CNSTWORD, 0, (char *) 0, 0, (Token *) 0, (Token *) 0};
75
-static Token lbrackToken = {LBRACK, CNSTWORD, 0, (char *) 0, 0, (Token *) 0, (Token *) 0};
76
-static Token rbrackToken = {RBRACK, CNSTWORD, 0, (char *) 0, 0, (Token *) 0, (Token *) 0};
77
+static Token dollarToken = {.type = DOLLAR, .ckind = CNSTWORD};
78
+static Token endlineToken = {.type = ENDLINE, .ckind = CNSTWORD};
79
+static Token lbrackToken = {.type = LBRACK, .ckind = CNSTWORD};
80
+static Token rbrackToken = {.type = RBRACK, .ckind = CNSTWORD};
81
 
82
 void output(Token *token, int compress)
83
 {
84
@@ -389,7 +389,7 @@
85
     if (token == noToken)
86
     {
87
     	return;
88
-    }    
89
+    }
90
     switch (token->type)
91
     {
92
     case SEMI:
(-)frink/files/patch-strdup (-22 lines)
Lines 1-22 Link Here
1
--- util.h	Wed Dec 11 17:21:48 2002
2
+++ util.h	Mon Feb 14 11:47:14 2005
3
@@ -58,5 +58,5 @@
4
 extern void lapply(List *, void(*)(void *));
5
 
6
-extern char *newString(char *);
7
+#define newString(t)	strdup(t)
8
 extern int doTest(enum Heuristics);
9
 
10
--- util.c	Wed Dec 11 18:07:50 2002
11
+++ util.c	Mon Feb 14 11:49:40 2005
12
@@ -105,10 +105,4 @@
13
 }
14
 
15
-char * newString(char *t)
16
-{
17
-    return strcpy(malloc(strlen(t)+1), t);
18
-}
19
-
20
-
21
 int doTest(enum Heuristics x)
22
 {
(-)frink/files/patch-tcl.c (+819 lines)
Line 0 Link Here
1
--- tcl.c.orig	2020-05-26 08:44:46.744170000 -0700
2
+++ tcl.c	2020-05-26 14:12:15.233919000 -0700
3
@@ -26,50 +26,42 @@
4
 static int nest[32]; /* = = class, 1 = namespace */
5
 static int inproc = 0;
6
 
7
-static Token lbraceToken	= {LBRACE, CNSTWORD, 0, (char *) 0, 0, (Token *) 0, (Token *) 0};
8
-static Token rbraceToken	= {RBRACE, CNSTWORD, 0, (char *) 0, 0, (Token *) 0, (Token *) 0};
9
-static Token xcontToken		= {XCONT, CNSTWORD, 0, (char *) 0, 0, (Token *) 0, (Token *) 0};
10
-static Token ostartToken	= {OSTART, CNSTWORD, 0, (char *) 0, 0, (Token *) 0, (Token *) 0};
11
-static Token startToken		= {START, CNSTWORD, 0, (char *) 0, 0, (Token *) 0, (Token *) 0};
12
-static Token contToken		= {CONT, CNSTWORD, 0, (char *) 0, 0, (Token *) 0, (Token *) 0};
13
-static Token econtToken		= {ECONT, CNSTWORD, 0, (char *) 0, 0, (Token *) 0, (Token *) 0};
14
-static Token emToken		= {EM, CNSTWORD, 0, (char *) 0, 0, (Token *) 0, (Token *) 0};
15
-static Token nospToken		= {NOSP, CNSTWORD, 0, (char *) 0, 0, (Token *) 0, (Token *) 0};
16
+static Token lbraceToken	= {.type = LBRACE, .ckind = CNSTWORD};
17
+static Token rbraceToken	= {.type = RBRACE, .ckind = CNSTWORD};
18
+static Token xcontToken		= {.type = XCONT, .ckind = CNSTWORD};
19
+static Token ostartToken	= {.type = OSTART, .ckind = CNSTWORD};
20
+static Token startToken		= {.type = START, .ckind = CNSTWORD};
21
+static Token contToken		= {.type = CONT, .ckind = CNSTWORD};
22
+static Token econtToken		= {.type = ECONT, .ckind = CNSTWORD};
23
+static Token emToken		= {.type = EM, .ckind = CNSTWORD};
24
+static Token nospToken		= {.type = NOSP, .ckind = CNSTWORD};
25
 static Token *olsToken		= &emToken;
26
-static Token spToken		= {SP, CNSTWORD, 0, (char *) 0, 0, (Token *) 0, (Token *) 0};
27
-static Token lbrackToken	= {LBRACK, CNSTWORD, 0, (char *) 0, 0, (Token *) 0, (Token *) 0};
28
-static Token rbrackToken	= {RBRACK, CNSTWORD, 0, (char *) 0, 0, (Token *) 0, (Token *) 0};
29
-static Token msgcatToken	= {CONST, CNSTWORD, 0, "::msgcat::mc", 12, (Token *) 0, (Token *) 0};
30
+static Token spToken		= {.type = SP, .ckind = CNSTWORD};
31
+static Token lbrackToken	= {.type = LBRACK, .ckind = CNSTWORD};
32
+static Token rbrackToken	= {.type = RBRACK, .ckind = CNSTWORD};
33
+static Token msgcatToken	= {.type = CONST, .ckind = CNSTWORD, .text = "::msgcat::mc", .length = 12};
34
 
35
-static Token dqStart		= {DQSTART, CNSTWORD, 0, (char *) 0, 0, noToken, noToken};
36
-static Token dqEnd		= {DQEND, CNSTWORD, 0, (char *) 0, 0, noToken, noToken};
37
-static Token thenToken		= {CONST, CNSTWORD, 0, "then", 4, noToken, noToken};
38
-static Token procToken		= {CONST, CNSTWORD, 0, "proc", 4, noToken, noToken};
39
-static Token elseToken		= {CONST, CNSTWORD, 0, "else", 4, noToken, noToken};
40
-static Token elseifToken	= {CONST, CNSTWORD, 0, "elseif", 6, noToken, noToken};
41
-static Token methodToken	= {CONST, CNSTWORD, 0, "method", 6, noToken, noToken};
42
-static Token semiToken		= {SEMI, CNSTWORD, 0, ";", 1, noToken, noToken};
43
-static Token argsToken		= {SEMI, CNSTWORD, 0, "args", 4, noToken, noToken};
44
-static Token argvToken		= {SEMI, CNSTWORD, 0, "argv", 4, noToken, noToken};
45
-static Token argv0Token		= {SEMI, CNSTWORD, 0, "argv0", 5, noToken, noToken};
46
-static Token platfToken		= {SEMI, CNSTWORD, 0, "tcl_platform", 12, noToken, noToken};
47
+static Token dqStart		= {.type = DQSTART, .ckind = CNSTWORD};
48
+static Token dqEnd		= {.type = DQEND, .ckind = CNSTWORD};
49
+static Token thenToken		= {.type = CONST, .ckind = CNSTWORD, .text = "then", .length = 4};
50
+static Token procToken		= {.type = CONST, .ckind = CNSTWORD, .text = "proc", .length = 4};
51
+static Token elseToken		= {.type = CONST, .ckind = CNSTWORD, .text = "else", .length = 4};
52
+static Token elseifToken	= {.type = CONST, .ckind = CNSTWORD, .text = "elseif", .length = 6};
53
+static Token methodToken	= {.type = CONST, .ckind = CNSTWORD, .text = "method", .length = 6};
54
+static Token semiToken		= {.type = SEMI, .ckind = CNSTWORD, .text = ";", .length = 1};
55
+static Token argsToken		= {.type = SEMI, .ckind = CNSTWORD, .text = "args", .length = 4};
56
+static Token argvToken		= {.type = SEMI, .ckind = CNSTWORD, .text = "argv", .length = 4};
57
+static Token argv0Token		= {.type = SEMI, .ckind = CNSTWORD, .text = "argv0", .length = 5};
58
+static Token platfToken		= {.type = SEMI, .ckind = CNSTWORD, .text = "tcl_platform", .length = 12};
59
 
60
 List *blocks  = noList;
61
 
62
-static CheckIt **noChecks = (CheckIt **) 0;
63
-
64
-extern void setIndent(void);
65
-extern void outdent(void);
66
-extern int isVarToken(Token *);
67
-extern int isSwitch(Token *);
68
-extern int isSingleCall(Token *, char *);
69
-extern int tokEqual(Token *, char *);
70
-
71
 /*
72
  * If there are no more tokens, print a useful message to the user and
73
  * exit.
74
  */
75
-void failIfNullToken(Token *token, char *part, char *command, int ln)
76
+static void failIfNullToken(const Token *token, const char *part,
77
+    const char *command, int ln)
78
 {
79
     char msg[1024];
80
 
81
@@ -77,11 +69,11 @@
82
     {
83
 	if (ln == 0)
84
 	{
85
-	    sprintf(msg, "Missing \"%s\" part in call of %s", part, command);
86
+	    snprintf(msg, sizeof msg, "Missing \"%s\" part in call of %s", part, command);
87
 	}
88
 	else
89
 	{
90
-	    sprintf(msg, "Missing \"%s\" part in call of %s, starting line %d",
91
+	    snprintf(msg, sizeof msg, "Missing \"%s\" part in call of %s, starting line %d",
92
 	      part, command, ln);
93
 	}
94
 	fail(token, msg);
95
@@ -92,7 +84,8 @@
96
  * If there are more tokens after this one, print a useful warning to
97
  * the user.
98
  */
99
-void warnIfArgsAfter(Token *token, char *part, char *command)
100
+static void warnIfArgsAfter(const Token *token, const char *part,
101
+    const char *command)
102
 {
103
     char msg[1024];
104
 
105
@@ -106,25 +99,25 @@
106
 	{
107
 	    if (*part != '\0')
108
 	    {
109
-		sprintf(msg, "Extra arguments after \"%s\" part in call of %s",
110
+		snprintf(msg, sizeof msg, "Extra arguments after \"%s\" part in call of %s",
111
 		  part, command);
112
 	    }
113
 	    else
114
 	    {
115
-		sprintf(msg, "Extra arguments in call of `%s'", command);
116
+		snprintf(msg, sizeof msg, "Extra arguments in call of `%s'", command);
117
 	    }
118
 	    warn(token, msg);
119
 	    if (token->next != noToken && token->next->text != (char *) 0 &&
120
 	      token->next->text[0] != '\0')
121
 	    {
122
-		sprintf(msg, "Extra token is `%s'", token->next->text);
123
+		snprintf(msg, sizeof msg, "Extra token is `%s'", token->next->text);
124
 		warn(token->next, msg);
125
 	    }
126
 	}
127
     }
128
 }
129
 
130
-void warnExpr(Token *cmd, char *txt)
131
+static void warnExpr(const Token *cmd, const char *txt)
132
 {
133
     if (doTest(HEXPR) && cmd != noToken && cmd->type != LIST)
134
     {
135
@@ -132,21 +125,14 @@
136
     }
137
 }
138
 
139
-void warnFor(Token *token, char *cmd, char *txt)
140
+void warnFor(const Token *token, const char *cmd, const char *txt)
141
 {
142
     char msg[1024];
143
 
144
-    sprintf(msg, txt, cmd);
145
+    snprintf(msg, sizeof msg, txt, cmd);
146
     warn(token, msg);
147
 }
148
 
149
-static void warnIFor(Token *token, int val, char *txt)
150
-{
151
-    char msg[1024];
152
-
153
-    sprintf(msg, txt, val);
154
-    warn(token, msg);
155
-}
156
 /*
157
  * reset various variables so that multiple file processing doesn't get
158
  * screwed up
159
@@ -170,7 +156,7 @@
160
     setVar(&platfToken, VGLOBAL, 1);
161
 }
162
 
163
-static int isNumber(char *cp)
164
+static int isNumber(const char *cp)
165
 {
166
     if (*cp == '-' || *cp == '+')
167
     {
168
@@ -184,12 +170,12 @@
169
         }
170
         cp++;
171
     }
172
-    return 1;    
173
+    return 1;
174
 }
175
 
176
-static int tokIsLevel(Token *tp)
177
+static int tokIsLevel(const Token *tp)
178
 {
179
-    char *cp;
180
+    const char *cp;
181
     if (tp == noToken || !(tp->type == CONST || tp->type == LIST) || tp->text == (char *) 0)
182
     {
183
 	return 0;
184
@@ -207,11 +193,11 @@
185
     return isNumber(cp);
186
 }
187
 
188
-static int oneLine(Token *seq, int semis)
189
+static int oneLine(const Token *seq, int semis)
190
 {
191
     while (seq != noToken)
192
     {
193
-	if (seq->type == SCOMMENT || seq->type == NL || 
194
+	if (seq->type == SCOMMENT || seq->type == NL ||
195
 	  (semis && seq->type == SEMI))
196
 	{
197
 	    return 0;
198
@@ -221,7 +207,7 @@
199
     return 1;
200
 }
201
 
202
-static int checkSpecial(char *val)
203
+static int checkSpecial(const char *val)
204
 {
205
     char ch;
206
 
207
@@ -238,17 +224,17 @@
208
     return 1;
209
 }
210
 
211
-static void checkUnquoted(Token *str)
212
+static void checkUnquoted(const Token *str)
213
 {
214
     char msg[128];
215
     if (noquotes && str->type == CONST && str->ckind == CNSTWORD && !isNumber(str->text))
216
     {
217
-        sprintf(msg, "Unquoted constant - \"%s\"", str->text);
218
+        snprintf(msg, sizeof msg, "Unquoted constant - \"%s\"", str->text);
219
         warn(str, msg);
220
     }
221
 }
222
 
223
-static void checkType(Token *cmd, int flags)
224
+static void checkType(const Token *cmd, int flags)
225
 {
226
     if (cmd->type == CONST)
227
     {
228
@@ -262,11 +248,11 @@
229
             {
230
                 warn(cmd, "Number expected!");
231
 	    }
232
-        }	
233
+        }
234
     }
235
 }
236
 
237
-static int single(Token * tp)
238
+static int single(const Token * tp)
239
 {
240
     if (tp != noToken && tp->next == noToken)
241
     {
242
@@ -285,13 +271,13 @@
243
     return 0;
244
 }
245
 
246
-static int sconstant(Token *tp)
247
+static int sconstant(const Token *tp)
248
 {
249
     return (tp != noToken && tp->next == noToken
250
 	&& (tp->type == CONST || tp->type == LIST) && !checkSpecial(tp->text));
251
 }
252
 
253
-static int constantString(Token * tp, int any)
254
+static int constantString(const Token * tp, int any)
255
 {
256
     Token *sq;
257
     if (tp == noToken) return 0;
258
@@ -299,7 +285,7 @@
259
     {
260
     case CONST :
261
 	return 1;
262
-    
263
+
264
     case LIST :
265
 	return any;
266
 
267
@@ -312,12 +298,12 @@
268
     }
269
 }
270
 
271
-void loopstart(int inf, int cond)
272
+static void loopstart(int inf, int cond)
273
 {
274
     pushBlock(noToken, inf, -1, cond);
275
 }
276
 
277
-void loopend(void)
278
+static void loopend(void)
279
 {
280
     Blox *bp = lpeek(blocks);
281
     int il = bp->infloop, su = (bp->breaks == 0);
282
@@ -329,7 +315,7 @@
283
     }
284
 }
285
 
286
-static void msgsave(Token *tp, int any)
287
+static void msgsave(const Token *tp, int any)
288
 {
289
     char filename[128];
290
 
291
@@ -362,10 +348,11 @@
292
     }
293
 }
294
 
295
-void sptclop(Token *hd)
296
+static void doUser(Token *hd, Token *cmd, const ConfigData *cpt, int nostart);
297
+
298
+static void sptclop(Token *hd)
299
 {
300
     List *cpt = config;
301
-    extern void doUser(Token *hd, Token *cmd, ConfigData *cpt, int nostart);
302
     ConfigData *cdp;
303
 
304
     while (cpt != noList)
305
@@ -453,7 +440,7 @@
306
 	    output(&rbraceToken, 0);
307
 	}
308
 	break;
309
-	
310
+
311
     case STRING :
312
         if (popcont) { blp = lpop(&blocks); } /* must evaluate in right context */
313
 	if (!trystrings)
314
@@ -528,7 +515,7 @@
315
     SPACEOUT	= 020
316
 } PressFlags;
317
 
318
-static void press(Token *v , PressFlags flags, CheckIt **checkp)
319
+static void press(Token *v , PressFlags flags)
320
 {
321
     Input *idx;
322
     Token *token = noToken, *lst = noToken;
323
@@ -601,7 +588,7 @@
324
 		switch (token->type)
325
 		{
326
 		case SEMI :
327
-		    if (flags && SEMIS)
328
+		    if (flags & SEMIS)
329
 		    {
330
 			output(&semiToken, 1);
331
 		    }
332
@@ -623,11 +610,11 @@
333
 	}
334
 	freeToken(lst);
335
 	break;
336
-	
337
+
338
     case SCOMMENT:
339
 	output(v, 1);
340
 	break;
341
-	
342
+
343
     case SEMI :
344
     case NL :
345
 	if (flags & SEMIS) { output(&semiToken, 1); }
346
@@ -640,7 +627,7 @@
347
     }
348
 }
349
 
350
-void etcetera(Token *cmd, int v)
351
+static void etcetera(Token *cmd, int v)
352
 {
353
     while (cmd != noToken)
354
     {
355
@@ -649,7 +636,7 @@
356
     }
357
 }
358
 
359
-void catbin(Token *tp)
360
+static void catbin(Token *tp)
361
 {
362
     int sem, oln;
363
     Token *sols;
364
@@ -692,7 +679,8 @@
365
     enum VarType vt;
366
     VarData *vp = (VarData *) 0;
367
     char msg[1024];
368
-    Token *ap = noToken, *ac;
369
+    Token *ap = noToken;
370
+    const Token *ac;
371
     int array = 0;
372
 
373
     if (isVarToken(cmd))
374
@@ -721,7 +709,7 @@
375
 	{
376
 	    array = 2 ;
377
 	}
378
-	
379
+
380
 	if (flags & VC_DECL)
381
 	{
382
 	    vp = declareVar(ac, vt, array);
383
@@ -828,7 +816,7 @@
384
     }
385
 }
386
 
387
-Token *doswitch(Token *cmd, Token *leadin)
388
+static Token *doswitch(Token *cmd, Token *leadin)
389
 {
390
     Token *tp, *bod;
391
     int ln = leadin->lineNo, eopt = 0, dflt = 0, srtp = 1;
392
@@ -951,7 +939,7 @@
393
     return noToken;
394
 }
395
 
396
-Token *doif(Token *cmd, Token *leadin)
397
+static Token *doif(Token *cmd, Token *leadin)
398
 {
399
     Token *tp, *then;
400
     int efl = ADDBRACES, ln = leadin->lineNo, cfl = ADDBRACES | PAREN;
401
@@ -963,7 +951,7 @@
402
     {
403
 	cfl |= SPACEOUT;
404
     }
405
-    press(cmd, cfl, noChecks);
406
+    press(cmd, cfl);
407
     if (putThen) { output(&thenToken, 0); }
408
     then = cmd->next;
409
     if (tokEqual(then, "then")) { then = then->next; }
410
@@ -979,7 +967,7 @@
411
 	tp = tp->next;
412
 	failIfNullToken(tp, "condition", "elseif", ln);
413
         warnExpr(tp, "elseif condition not braced.");
414
-	press(tp, efl | PAREN, noChecks);
415
+	press(tp, efl | PAREN);
416
 	tp = tp->next;
417
 	failIfNullToken(tp, "body", "elseif", ln);
418
 	body(tp, 0, 0);
419
@@ -1019,9 +1007,9 @@
420
 }
421
 
422
 
423
-int isNSName(Token *cmd)
424
+static int isNSName(const Token *cmd)
425
 {
426
-    char *cp;
427
+    const char *cp;
428
     int cols = 0;
429
 
430
     if (!constant(cmd) || cmd->text == (char *) 0) { return 0; }
431
@@ -1053,7 +1041,7 @@
432
     return 0;
433
 }
434
 
435
-static Token *doProc(Token *tag, Token *cmd, Token *leadin, int checkNS)
436
+static Token *doProc(Token *tag, Token *cmd, Token *leadin)
437
 {
438
     int ln = leadin->lineNo, inns;
439
     Token *token, *tok2, *tok3;
440
@@ -1071,7 +1059,7 @@
441
 	checkName(cmd, 1);
442
 	output(cmd, 1);
443
 	if ((inns = isNSName(cmd)))
444
-	{   
445
+	{
446
 	    nest[1] += 1;
447
 	}
448
         pr = pushBlock(cmd, 0, -1, 0);
449
@@ -1091,7 +1079,7 @@
450
 	        break;
451
 	    }
452
 	    /* CONSTANT STRING DROPS THROUGH */
453
-	
454
+
455
 	case LIST:
456
 	    output(&lbraceToken, 1);
457
 	    tok3 = token = tokacc(cmd, 0, 0);
458
@@ -1143,7 +1131,7 @@
459
 	    freeToken(tok3);
460
 	    output(&rbraceToken, 1);
461
 	    break;
462
-	
463
+
464
 	default:
465
 	    if (warndyn)
466
 	    {
467
@@ -1157,7 +1145,7 @@
468
 	failIfNullToken(cmd, "body", tag->text, ln);
469
 	body(cmd, 0, 1);
470
 	warnIfArgsAfter(cmd, "body", tag->text);
471
-	
472
+
473
 	pr = (Blox *) lpeek(blocks);
474
 	if (doTest(HRETURN) && !(pragma & NOTREACHED))
475
 	{
476
@@ -1176,15 +1164,15 @@
477
 
478
 static Token *doproc(Token *cmd, Token *leadin)
479
 {
480
-    return doProc(&procToken, cmd, leadin, 1);
481
+    return doProc(&procToken, cmd, leadin);
482
 }
483
 
484
 static Token *domethod(Token *cmd, Token *leadin)
485
 {
486
-    return doProc(&methodToken, cmd, leadin, 0);
487
+    return doProc(&methodToken, cmd, leadin);
488
 }
489
 
490
-static Token *dodestructor(Token *cmd, Token *leadin)
491
+static Token *dodestructor(Token *cmd, Token *leadin __attribute__((__unused__)))
492
 {
493
     if (!nest[0])
494
     {
495
@@ -1199,7 +1187,7 @@
496
     return noToken;
497
 }
498
 
499
-Token *doconstructor(Token *cmd, Token *leadin)
500
+static Token *doconstructor(Token *cmd, Token *leadin __attribute__((__unused__)))
501
 {
502
     if (!nest[0])
503
     {
504
@@ -1208,7 +1196,7 @@
505
     else
506
     {
507
 	failIfNullToken(cmd, "args", "constructor", 0);
508
-	press(cmd, NOBRACE | ADDBRACES, noChecks);
509
+	press(cmd, NOBRACE | ADDBRACES);
510
 	cmd = cmd->next;
511
 	failIfNullToken(cmd, "body", "constructor", 0);
512
 	body(cmd, 0, 0);
513
@@ -1217,7 +1205,7 @@
514
     return noToken;
515
 }
516
 
517
-Token *doreturn(Token *cmd, Token *leadin)
518
+static Token *doreturn(Token *cmd, Token *leadin)
519
 {
520
     Blox *pr = (Blox *) lpeek(blocks);
521
 
522
@@ -1256,7 +1244,7 @@
523
 	output(cmd, 1);
524
 	cmd = cmd->next;
525
     }
526
-    
527
+
528
     if (cmd != noToken)
529
     {
530
 	output(cmd, 1);
531
@@ -1266,7 +1254,7 @@
532
     return noToken;
533
 }
534
 
535
-Token *doregexp(Token *cmd, Token *leadin)
536
+static Token *doregexp(Token *cmd, Token *leadin)
537
 {
538
     int eopt = 0;
539
     int ln = cmd->lineNo, paramCount = 0;
540
@@ -1311,7 +1299,7 @@
541
     return noToken;
542
 }
543
 
544
-Token *doregsub(Token *cmd, Token *leadin)
545
+static Token *doregsub(Token *cmd, Token *leadin)
546
 {
547
     int eopt = 0;
548
     int ln = cmd->lineNo, paramCount = 0;
549
@@ -1335,7 +1323,7 @@
550
 	    cmd = cmd->next;
551
 	}
552
     }
553
-    
554
+
555
     failIfNullToken(cmd, "regexp", "regsub", ln);
556
     if (doTest(HREGEXP) && !eopt)
557
     { /* warn about missing -- only if the item could start with a - */
558
@@ -1360,7 +1348,7 @@
559
     return cmd->next;
560
 }
561
 
562
-Token *dobind(Token *cmd, Token *leadin)
563
+static Token *dobind(Token *cmd, Token *leadin __attribute__((__unused__)))
564
 {
565
     Token *np;
566
     if (!doBind || pragma & NOFORMAT)
567
@@ -1376,7 +1364,7 @@
568
 	    output(np, 1);
569
 	    if ((np->next) != noToken)
570
 	    { /* need to deactivate break outside a loop test. */
571
-		pushBlock(noToken, 0, -1, 0); 
572
+		pushBlock(noToken, 0, -1, 0);
573
 		catbin(np->next);
574
 		popBlock(0);
575
 		warnIfArgsAfter(np->next, "command", "bind");
576
@@ -1386,7 +1374,7 @@
577
     return noToken;
578
 }
579
 
580
-Token *doitcl_class(Token *cmd, Token *leadin)
581
+static Token *doitcl_class(Token *cmd, Token *leadin __attribute__((__unused__)))
582
 {
583
     failIfNullToken(cmd, "className", "itcl_class", 0);
584
     output(cmd, 1);
585
@@ -1399,7 +1387,7 @@
586
     return noToken;
587
 }
588
 
589
-Token *docvar(Token *cmd, Token *prt)
590
+static Token *docvar(Token *cmd, Token *prt)
591
 {
592
     if (!nest[0])
593
     {
594
@@ -1411,14 +1399,14 @@
595
 	output(cmd, 1);
596
 	if ((cmd = cmd->next) != noToken)
597
 	{
598
-	    press(cmd, NOBRACE | ADDBRACES, noChecks);
599
+	    press(cmd, NOBRACE | ADDBRACES);
600
 	    warnIfArgsAfter(cmd, "init", prt->text);
601
 	}
602
     }
603
     return noToken;
604
 }
605
 
606
-Token *dopublic(Token *cmd, Token *leadin)
607
+static Token *dopublic(Token *cmd, Token *leadin __attribute__((__unused__)))
608
 {
609
     if (!nest[0])
610
     {
611
@@ -1430,7 +1418,7 @@
612
 	output(cmd, 1);
613
 	if ((cmd = cmd->next) != noToken)
614
 	{
615
-	    press(cmd, NOBRACE | ADDBRACES, noChecks);
616
+	    press(cmd, NOBRACE | ADDBRACES);
617
 	    if ((cmd = cmd->next) != noToken)
618
 	    {
619
 		body(cmd, 0, 0);
620
@@ -1441,11 +1429,11 @@
621
     return noToken;
622
 }
623
 
624
-Token *doprotected(Token *cmd, Token *leadin) { return docvar(cmd, leadin); }
625
+static Token *doprotected(Token *cmd, Token *leadin) { return docvar(cmd, leadin); }
626
 
627
-Token *docommon(Token *cmd, Token *leadin) { return docvar(cmd, leadin); }
628
+static Token *docommon(Token *cmd, Token *leadin) { return docvar(cmd, leadin); }
629
 
630
-static void checkVar(Token *cmd, char *nm)
631
+static void checkVar(Token *cmd, const char *nm)
632
 {
633
     List *bp = blocks;
634
     Blox *xp;
635
@@ -1524,7 +1512,7 @@
636
     }
637
 }
638
 
639
-Token *doforeach(Token *cmd, Token *leadin)
640
+static Token *doforeach(Token *cmd, Token *leadin __attribute__((__unused__)))
641
 {
642
     failIfNullToken(cmd, "varName", "foreach", 0);
643
     loopstart(0, 0);
644
@@ -1534,7 +1522,7 @@
645
 	addForVars(cmd);
646
 	cmd = cmd->next;
647
 	failIfNullToken(cmd, "list", "foreach", 0);
648
-	press(cmd, NOBRACE, noChecks);
649
+	press(cmd, NOBRACE);
650
 	cmd = cmd->next;
651
     }
652
     while (cmd != noToken && cmd->next != noToken && cmd->next->type != SCOMMENT);
653
@@ -1546,7 +1534,7 @@
654
     return noToken;
655
 }
656
 
657
-Token *doloop(Token *cmd, Token *leadin)
658
+static Token *doloop(Token *cmd, Token *leadin __attribute__((__unused__)))
659
 {
660
     Token *tp;
661
     if (!tclX)
662
@@ -1556,15 +1544,15 @@
663
     else
664
     {
665
 	failIfNullToken(cmd, "var", "loop", 0);
666
-	press(cmd, NOBRACE | ADDBRACES, noChecks);	/* var */
667
+	press(cmd, NOBRACE | ADDBRACES);	/* var */
668
 	tp = cmd->next;
669
 	failIfNullToken(tp, "first", "loop", 0);
670
 	warnExpr(cmd, "Unbracketed loop \"first\"");
671
-	press(tp, ADDBRACES, noChecks);			/* first */
672
+	press(tp, ADDBRACES);			/* first */
673
 	tp = tp->next;
674
 	failIfNullToken(tp, "limit", "loop", 0);
675
 	warnExpr(cmd, "Unbracketed loop \"limit\"");
676
-	press(tp, ADDBRACES, noChecks);			/* limit */
677
+	press(tp, ADDBRACES);			/* limit */
678
 
679
 	tp = tp->next;
680
 	failIfNullToken(tp, "body", "loop", 0);
681
@@ -1572,7 +1560,7 @@
682
 	if (tp->next != noToken)
683
 	{
684
 	    warnExpr(cmd, "Unbracketed loop \"incr\"");
685
-	    press(tp, NOBRACE | ADDBRACES, noChecks);		/* incr */
686
+	    press(tp, NOBRACE | ADDBRACES);		/* incr */
687
 	    tp = tp->next;
688
 	}
689
 	loopstart(0, 0);
690
@@ -1582,9 +1570,9 @@
691
     }
692
     setUnreachable(0);
693
     return noToken;
694
-} 
695
+}
696
 
697
-Token *doexpr(Token *cmd, Token *leadin)
698
+static Token *doexpr(Token *cmd, Token *leadin __attribute__((__unused__)))
699
 {
700
     if (!doExpr)
701
     {
702
@@ -1599,7 +1587,7 @@
703
 	else if (cmd->next == noToken)
704
 	{
705
 	    warnExpr(cmd, "expr body not braced.");
706
-	    press(cmd, ADDBRACES | PAREN, noChecks); /* */
707
+	    press(cmd, ADDBRACES | PAREN); /* */
708
 	}
709
 	else
710
 	{
711
@@ -1610,7 +1598,7 @@
712
     return noToken;
713
 }
714
 
715
-Token *dounset(Token *cmd, Token *leadin)
716
+static Token *dounset(Token *cmd, Token *leadin)
717
 {
718
     int pCount = 1;
719
 
720
@@ -1641,7 +1629,7 @@
721
     return noToken;
722
 }
723
 
724
-Token *doupvar(Token *cmd, Token *leadin)
725
+static Token *doupvar(Token *cmd, Token *leadin)
726
 {
727
     int paramCount = 0;
728
     int ln = leadin->lineNo;
729
@@ -1672,7 +1660,7 @@
730
     return noToken;
731
 }
732
 
733
-Token *dovariable(Token *cmd, Token *leadin)
734
+static Token *dovariable(Token *cmd, Token *leadin)
735
 {
736
     int paramCount = 1;
737
 
738
@@ -1711,9 +1699,9 @@
739
     doexpr,		/* 6 */
740
     doforeach,		/* 7 */
741
     doif,		/* 8 */
742
-    0,			/* 9 */			
743
+    0,			/* 9 */
744
     doitcl_class,	/* 10 */
745
-    doloop,		/* 11 */			
746
+    doloop,		/* 11 */
747
     domethod,		/* 12 */
748
     doregsub,		/* 13 */
749
     doproc,		/* 14 */
750
@@ -1754,7 +1742,7 @@
751
     List *vlist;
752
 
753
     if (pdp->type == POCTYPE || pdp->type == PCTYPE) return 1;
754
-     
755
+
756
     vlist = pdp->values;
757
     while (vlist != noList)
758
     {
759
@@ -1776,7 +1764,7 @@
760
     return 0;
761
 }
762
 
763
-void doBasic(ConfigData *cpt, Token *hd, Token *cmd)
764
+static void doBasic(const ConfigData *cpt, Token *hd, Token *cmd)
765
 {
766
     List *sp, *llp, *lp;
767
     ParamData *pt, *pdp;
768
@@ -1850,7 +1838,7 @@
769
 	    }
770
 	    else
771
 	    {
772
-		press(cmd, NOBRACE | ADDBRACES | SEMIS, noChecks); /* */
773
+		press(cmd, NOBRACE | ADDBRACES | SEMIS); /* */
774
 	    }
775
 	    break;
776
 
777
@@ -1862,7 +1850,7 @@
778
 	    else
779
 	    {
780
 		warnExpr(cmd, "Unbracketed expression");
781
-		press(cmd, ptpar, noChecks); /* */
782
+		press(cmd, ptpar); /* */
783
 	    }
784
 	    break;
785
 
786
@@ -1883,7 +1871,7 @@
787
 		{
788
 		    ptpar |= SPACEOUT;
789
 		}
790
-		press(cmd, ptpar, noChecks);
791
+		press(cmd, ptpar);
792
 		loopstart(infloop, 1);
793
 	    }
794
 	    break;
795
@@ -2057,7 +2045,7 @@
796
 	    continue;
797
 
798
 	case PBLOCK:
799
-	    setUnreachable(1);	    
800
+	    setUnreachable(1);
801
 	    break;
802
 
803
         case PNONE :
804
@@ -2135,12 +2123,13 @@
805
 		blp->breaks += 1;
806
 	    }
807
 	}
808
-	
809
+
810
 	lp = lp->next;
811
     }
812
 }
813
 
814
-void doUser(Token *hd, Token *cmd, ConfigData *cpt, int nostart)
815
+static void doUser(Token *hd, Token *cmd,
816
+    const ConfigData *cpt, int nostart)
817
 {
818
     if (isUnreachable())
819
     {
(-)frink/files/patch-token.c (+466 lines)
Line 0 Link Here
1
--- token.c.orig	2020-05-26 13:32:58.747578000 -0700
2
+++ token.c	2020-05-26 14:12:09.730155000 -0700
3
@@ -31,8 +31,6 @@
4
 #include <malloc.h>
5
 #endif
6
 
7
-extern char *currentfile;
8
-
9
 typedef struct tbuff_s
10
 {
11
     char *buff;
12
@@ -77,7 +75,7 @@
13
     tp->buff[tp->length] ='\0';
14
 }
15
 
16
-static void catTB(TBuff *tp, char *str)
17
+static void catTB(TBuff *tp, const char *str)
18
 {
19
     while (*str)
20
     {
21
@@ -86,7 +84,7 @@
22
     capTB(tp);
23
 }
24
 
25
-static char *tokenName[] =
26
+static const char *tokenName[] =
27
 {
28
     "ENDF",
29
     "ENDLINE",
30
@@ -136,7 +134,7 @@
31
 static Token *callToken(Input *);
32
 static Token *varToken(Input *);
33
 
34
-Token *newToken(TokenType t)
35
+static Token *newToken(TokenType t)
36
 {
37
     Token *tp = malloc(sizeof(Token));
38
     tp->type = t;
39
@@ -149,9 +147,9 @@
40
     return tp;
41
 }
42
 
43
-void dumpToken(Token *tk, FILE *ops)
44
+void dumpToken(const Token *tk, FILE *ops)
45
 {
46
-    static char *cval [] =
47
+    static const char *cval [] =
48
     {
49
         "word", "string", "list"
50
     };
51
@@ -194,7 +192,7 @@
52
     }
53
 }
54
 
55
-void fail(Token *tp, char *msg)
56
+void fail(const Token *tp, const char *msg)
57
 {
58
     if (!compout)
59
     {
60
@@ -228,7 +226,7 @@
61
 }
62
 
63
 extern void makeTB(Token *hd, TBuff *tb);
64
- 
65
+
66
 static void makeFTB(Token *hd, TBuff *tb)
67
 {
68
     if (hd == noToken)
69
@@ -324,7 +322,7 @@
70
     if (hd != noToken) { makeTB(hd->next, tb); }
71
 }
72
 
73
-void warn(Token *tp, char *msg)
74
+void warn(const Token *tp, const char *msg)
75
 {
76
     Blox *blp = (Blox *) lpeek(blocks);
77
     TBuff *tbp = newTB(32);
78
@@ -333,7 +331,7 @@
79
     {
80
         fprintf(stderr, "***");
81
     }
82
-    if (currentfile != (char *) 0)
83
+    if (currentfile != NULL)
84
     {
85
         fprintf(stderr, " %s", currentfile);
86
     }
87
@@ -376,7 +374,7 @@
88
     failed = 1;
89
 }
90
 
91
-static void bwarn(int ln, char *msg)
92
+static void bwarn(int ln, const char *msg)
93
 {
94
     Token *tp = newToken(SP);
95
     tp->lineNo = ln;
96
@@ -390,7 +388,7 @@
97
     file->position = file->text;
98
     if (file->stream != NULL)
99
     {
100
-	file->remaining = fread(file->text, 1, 64*1024, file->stream);
101
+	file->remaining = fread(file->atext, 1, 64*1024, file->stream);
102
     }
103
 }
104
 
105
@@ -399,7 +397,7 @@
106
     return ch == ' ' || ch == '\t';
107
 }
108
 
109
-static char *skipblank(char *cp)
110
+static const char *skipblank(const char *cp)
111
 {
112
     while (isBlank(*cp))
113
     {
114
@@ -496,9 +494,9 @@
115
 {
116
     if (tp != noToken)
117
     {
118
-	if (tp->text != (char *) 0 && tp->text != tp->little)
119
+	if (tp->atext != tp->little)
120
 	{
121
-	    free(tp->text);
122
+	    free(tp->atext);
123
 	}
124
 	if (tp->sequence) freeToken(tp->sequence);
125
 	if (tp->next) freeToken(tp->next);
126
@@ -506,10 +504,10 @@
127
     }
128
 }
129
 
130
-static char *filterString(Token *tp, char *txt)
131
+static char *filterString(Token *tp, const char *txt)
132
 {
133
     char *cp = malloc(strlen(txt) + 1), *pt;
134
-    
135
+
136
     if (tp->type == CONST && tp->ckind != CNSTLIST)
137
     {
138
         pt = cp;
139
@@ -551,29 +549,13 @@
140
     file->tcall = 0;
141
     file->texpr = expr;
142
     file->lineNumber = tp->lineNo;
143
-    file->lineStart = 1;    
144
-    return file;
145
-}
146
-
147
-Input *ftokenise(char *txt, int length, int lineNo, int expr)
148
-{
149
-    Token *tmp = newToken(CONST); /* gash token for filterstring */
150
-    Input *file = (Input *) malloc(sizeof(Input));
151
-    file->remaining = length;
152
-    file->pushed = 0;
153
-    file->stream = NULL;
154
-    file->position = file->text = filterString(tmp, txt);
155
-    file->tcall = 0;
156
-    file->texpr = expr;
157
-    file->lineNumber = lineNo;
158
     file->lineStart = 1;
159
-    freeToken(tmp); 
160
     return file;
161
 }
162
 
163
 void untokenise(Input *file)
164
 {
165
-    free(file->text);
166
+    free(file->atext);
167
     free(file);
168
 }
169
 
170
@@ -606,17 +588,17 @@
171
     }
172
 }
173
 
174
-static Token *createToken(TokenType t, char *text, Token *nxt)
175
+static Token *createToken(TokenType t, const char *text, size_t len, Token *nxt)
176
 {
177
     Token *tp = newToken(t);
178
 
179
-    if ((tp->length = strlen(text)) < (sizeof(tp->little) - 1))
180
+    if ((tp->length = len) < (sizeof(tp->little) - 1))
181
     {
182
 	tp->text = strcpy(tp->little, text);
183
     }
184
     else
185
     {
186
-	tp->text = newString(text);
187
+	tp->text = strndup(text, len);
188
     }
189
     tp->next = nxt;
190
     return tp;
191
@@ -651,7 +633,7 @@
192
     while ((ch = chGet(file)) == ' ' || ch == '\t');
193
     push(file, ch);
194
     capTB(tb);
195
-    return makeToken(SP, tb, ln); 
196
+    return makeToken(SP, tb, ln);
197
 }
198
 
199
 static Token *listToken(Input *file, int term)
200
@@ -661,7 +643,7 @@
201
     TBuff *tb = newTB(bufSize);
202
     Token *tp;
203
     int bcount = 0, ln = file->lineNumber;
204
-    
205
+
206
     for (;;)
207
     {
208
       switch (ch = chCGet(file)) /* needs to be chCGet here */
209
@@ -714,12 +696,12 @@
210
 	}
211
     }
212
     return tp;
213
-    
214
+
215
 }
216
 
217
 static Token *handleSemi(Input*, char);
218
 
219
-Token *stringToken(Input *file, char lst, TokenType res, int term)
220
+static Token *stringToken(Input *file, char lst, TokenType res, int term)
221
 {
222
     int bufSize = 16*1024;
223
     Token *tp = newToken(res), *nt;
224
@@ -807,7 +789,7 @@
225
 	    }
226
 	}
227
     }
228
-    
229
+
230
     capTB(tb);
231
     if (res != ARRAY && tp->sequence == noToken)
232
     {
233
@@ -836,7 +818,7 @@
234
 }
235
 
236
 
237
-int tokEqual(Token *tp, char *val)
238
+int tokEqual(const Token *tp, const char *val)
239
 {
240
     if (tp != noToken)
241
     {
242
@@ -844,7 +826,7 @@
243
 	{
244
 	case CONST:
245
 	case LIST :
246
-	    return (tp->text != (char *) 0 && strcmp(tp->text, val) == 0);
247
+	    return (tp->text != NULL && strcmp(tp->text, val) == 0);
248
 	default:
249
 	    break;
250
 	}
251
@@ -852,7 +834,7 @@
252
     return 0;
253
 }
254
 
255
-int tokNEqual(Token *tp, char *val, int n)
256
+static int tokNEqual(const Token *tp, const char *val, int n)
257
 {
258
     if (tp != noToken)
259
     {
260
@@ -870,8 +852,8 @@
261
 
262
 static int isPragma(TBuff *tp)
263
 {
264
-    char *cp;
265
-    
266
+    const char *cp;
267
+
268
     cp = skipblank(tp->buff + 1); /* start after # character */
269
     return (strncmp(cp, "PRAGMA", 6) == 0 || strncmp(cp, "FRINK", 5) == 0);
270
 }
271
@@ -945,7 +927,7 @@
272
     char ch;
273
     Token *tp;
274
     TBuff *tb;
275
-    
276
+
277
     extern int trace;
278
 
279
     switch (ch = chGet(file))
280
@@ -1033,13 +1015,13 @@
281
  * 2) a list enclosed in {}
282
  * 3) a name followed by an array reference
283
  * 4) a namespace reference
284
- * 
285
+ *
286
  */
287
 static Token *varToken(Input *file)
288
 {
289
     Token *tp = newToken(VAR);
290
     int bufSize = 512, leng, sexpr, nsc;
291
-    
292
+
293
     char ch, ch2;
294
     TBuff *tb;
295
 
296
@@ -1128,7 +1110,7 @@
297
     Token *tp = (*conc)->sequence;
298
 
299
     tp->lineNo = (*conc)->lineNo;
300
-	
301
+
302
     if (tp->next == noToken)
303
     {
304
 	switch (tp->type)
305
@@ -1241,7 +1223,7 @@
306
     else
307
     {
308
 	freeTB(tb);
309
-	
310
+
311
     }
312
     concopt(&tp);
313
     return tp;
314
@@ -1251,7 +1233,7 @@
315
 {
316
     static struct pragma_s
317
     {
318
-        char		*text;
319
+        const char	*text;
320
 	enum Pragmas	value;
321
 	int		nextmode;
322
     } pragmas[] =
323
@@ -1263,11 +1245,11 @@
324
 	{ "set",		0,		2},
325
 	{ "unused",		0,		3},
326
 	{ "array",		0,		4},
327
-	{ (char *) 0,		0,		1},
328
+	{ NULL,			0,		1},
329
     };
330
     struct pragma_s *prp;
331
     int label, mode = 1;
332
-    char *cp;
333
+    const char *cp;
334
     Token *token, *chars = newToken(CONST);
335
     Input *pfile;
336
 
337
@@ -1327,7 +1309,7 @@
338
 		case 4: /* mark as an array */
339
 		    setVar(token, VLOCAL, 1);
340
 		    break;
341
-		    
342
+
343
 		}
344
 	        break;
345
 
346
@@ -1347,9 +1329,6 @@
347
 {
348
     Token *hd;
349
 
350
-    extern int tclop(Token*, Token*);
351
-    extern void comment(Token *);
352
-
353
     if (line == noToken)
354
     {
355
 	if (!minimise)
356
@@ -1566,7 +1545,7 @@
357
 	    handle(line);
358
 	    line = noToken;
359
 	    break;
360
-	    
361
+
362
 	default :
363
 	    tokenPush(&line, tokenPop(&lst));
364
 	    break;
365
@@ -1575,7 +1554,7 @@
366
     if (line != noToken) { handle(line); }
367
 }
368
 
369
-Token *accumulate(Input *file, int nl)
370
+static Token *accumulate(Input *file, int nl)
371
 {
372
     Token *line = noToken, *hd = noToken;
373
     TokenType last = NL;
374
@@ -1652,16 +1631,16 @@
375
     return lp;
376
 }
377
 
378
-static int chkVarToken(Token *token)
379
+static int chkVarToken(const Token *token)
380
 {
381
     return (token != noToken &&
382
 	(token->type == VAR || token->type == CALL || token->type == CONC
383
 	 || token->type == STRING));
384
 }
385
 
386
-int isVarToken(Token *token)
387
+int isVarToken(const Token *token)
388
 {
389
-    char *cp;
390
+    const char *cp;
391
     TBuff *tb;
392
 
393
     if (token != noToken && token->type == CONC)
394
@@ -1694,7 +1673,7 @@
395
     return chkVarToken(token);
396
 }
397
 
398
-int isSingleCall(Token *token, char *proc)
399
+int isSingleCall(const Token *token, const char *proc)
400
 {
401
     if (token != noToken)
402
     {
403
@@ -1715,7 +1694,7 @@
404
     return 0;
405
 }
406
 
407
-int isSwitch(Token *token)
408
+int isSwitch(const Token *token)
409
 {
410
     if (token != noToken)
411
     {
412
@@ -1727,7 +1706,7 @@
413
 	    {
414
 	        break;
415
 	    }
416
-	/* ********** DROP THROUGH ************** */    
417
+	/* ********** DROP THROUGH ************** */
418
 	case LIST :
419
 	case CONST:
420
 	    return tokNEqual(token, "-", 1);
421
@@ -1739,14 +1718,15 @@
422
     return 0;
423
 }
424
 
425
-Token *isArray(Token *tp)
426
+Token *isArray(const Token *tp)
427
 {
428
     Token *res = noToken;
429
     TBuff *tbp = (TBuff *) 0;
430
-    char *txt, *cp, ch;
431
+    const char *txt, *cp;
432
+    char ch;
433
     int len;
434
 
435
-    if (tp != noToken && (tp->text != (char *) 0 || tp->type == CONC))
436
+    if (tp != noToken && (tp->text != NULL || tp->type == CONC))
437
     {
438
 	switch (tp->type)
439
 	{
440
@@ -1770,15 +1750,13 @@
441
 	if (txt[len-1] == ')' && *txt != '(')
442
 	{ /* could be an array reference.... */
443
 	    cp = txt;
444
-	
445
+
446
 	    for(;;)
447
 	    {
448
 	        ch = *cp;
449
 	        if (ch == '(')
450
 		{
451
-		    *cp = '\0';
452
-		    res = createToken(CONST, txt, noToken);
453
-		    *cp = '(';
454
+		    res = createToken(CONST, txt, cp - txt, noToken);
455
 		    break;
456
 		}
457
 		if (ch == '\0') { break; }
458
@@ -1790,7 +1768,7 @@
459
     return res;
460
 }
461
 
462
-int constant(Token *tp)
463
+int constant(const Token *tp)
464
 {
465
     return (tp != noToken && (tp->type == CONST || tp->type == LIST));
466
 }
(-)frink/files/patch-token.h (+59 lines)
Line 0 Link Here
1
--- token.h.orig	2020-05-26 13:56:04.802699000 -0700
2
+++ token.h	2020-05-26 14:02:07.352346000 -0700
3
@@ -18,11 +18,14 @@
4
 
5
 typedef struct input_s
6
 {
7
-    char *position;
8
+    const char *position;
9
     int	 remaining;
10
     int  pushed;
11
     char back[16];
12
-    char *text;
13
+    union {
14
+        const char *text; /* Use const in most cases */
15
+	char *atext;
16
+    };
17
     FILE *stream;
18
     int tcall;
19
     int texpr;
20
@@ -48,8 +51,11 @@
21
     TokenType type;
22
     ConstType ckind;
23
     int isconc;
24
-    char *text;
25
-    int length;
26
+    union {
27
+        const char *text;
28
+        char *atext;
29
+    };
30
+    size_t length;
31
     struct token_s *sequence;
32
     struct token_s *next;
33
     char little[32];
34
@@ -69,12 +75,21 @@
35
 extern void lprocess(Token*, int);
36
 extern void makeCall(Token*, Token*);
37
 extern void body(Token *, int, int);
38
+extern void comment(Token *);
39
 
40
 extern void output(Token *, int);
41
 extern void blank(void);
42
-extern void warn(Token *, char *);
43
-extern void fail(Token *, char *);
44
+extern void warn(const Token *, const char *);
45
+extern void fail(const Token *, const char *);
46
 
47
-extern Token *isArray(Token *);
48
-extern int constant(Token *tp);
49
+extern Token *isArray(const Token *);
50
+extern int constant(const Token *tp);
51
+extern int tclop(Token *hd, Token *line);
52
+extern void streamMore(Input *file);
53
+extern int handle(Token *line);
54
+extern void sprocess(Token *lst, int nls);
55
+extern void dumpToken(const Token *tk, FILE *ops);
56
+extern Token *tokenPop(Token **);
57
+extern void freeToken(Token *);
58
+
59
 #endif
(-)frink/files/patch-util.c (+15 lines)
Line 0 Link Here
1
--- util.c.orig	2020-05-26 14:15:00.831701000 -0700
2
+++ util.c	2020-05-26 14:15:43.796315000 -0700
3
@@ -104,12 +104,6 @@
4
     }
5
 }
6
 
7
-char * newString(char *t)
8
-{
9
-    return strcpy(malloc(strlen(t)+1), t);
10
-}
11
-
12
-
13
 int doTest(enum Heuristics x)
14
 {
15
    extern int pragma;
(-)frink/files/patch-util.h (+11 lines)
Line 0 Link Here
1
--- util.h.orig	2020-05-26 14:13:44.649927000 -0700
2
+++ util.h	2020-05-26 14:14:39.051711000 -0700
3
@@ -57,7 +57,7 @@
4
 extern void ldel(List **, int);
5
 extern void lapply(List *, void(*)(void *));
6
 
7
-extern char *newString(char *);
8
+#define newString(t)	strdup(t)
9
 extern int doTest(enum Heuristics);
10
 
11
 #endif
(-)frink/files/patch-vars.c (+101 lines)
Line 0 Link Here
1
--- vars.c.orig	2020-05-26 14:03:10.718181000 -0700
2
+++ vars.c	2020-05-26 14:11:58.946515000 -0700
3
@@ -32,11 +32,9 @@
4
 #include <malloc.h>
5
 #endif
6
 
7
-extern void warnFor(Token*, char*, char*);
8
-
9
 void checkName(Token *cmd, int dynm)
10
 {
11
-    static char *badNames[] =
12
+    static const char *badNames[] =
13
     {
14
 	".",
15
 	"after",
16
@@ -158,7 +156,8 @@
17
 	"wm",
18
         (char *) 0
19
     };
20
-    char **bnp = badNames, msgb[256];
21
+    const char **bnp = badNames;
22
+    char msgb[256];
23
 
24
     if (cmd != noToken)
25
     {
26
@@ -172,7 +171,7 @@
27
 	        {
28
 	            if (strcmp(cmd->text, *bnp) == 0)
29
 		    {
30
-			
31
+
32
 		        warn(cmd, strcat(strcat(strcpy(msgb, "name clashes with the\" "), *bnp), "\" command"));
33
 		        break;
34
 		    }
35
@@ -198,7 +197,7 @@
36
     }
37
 }
38
 
39
-static VarData *newVar(char *name, enum VarType type)
40
+static VarData *newVar(const char *name, enum VarType type)
41
 {
42
     VarData *blp = (VarData *) malloc(sizeof(VarData));
43
 
44
@@ -211,7 +210,7 @@
45
     return blp;
46
 }
47
 
48
-static VarData *addVar(char *name, enum VarType type, int array)
49
+static VarData *addVar(const char *name, enum VarType type, int array)
50
 {
51
     VarData *vp = newVar(name, type);
52
 
53
@@ -220,11 +219,11 @@
54
     return vp;
55
 }
56
 
57
-VarData *varKnown(char *name)
58
+VarData *varKnown(const char *name)
59
 {
60
     List *blp = blocks;
61
     List *lp;
62
-    
63
+
64
     while (blp != noList)
65
     {
66
         lp = ((Blox *) lpeek(blp))->vars;
67
@@ -245,10 +244,10 @@
68
     return (VarData *) 0;
69
 }
70
 
71
-VarData *declareVar(Token *nm, enum VarType type, int array)
72
+VarData *declareVar(const Token *nm, enum VarType type, int array)
73
 {
74
     VarData *vp = varKnown(nm->text);
75
-    
76
+
77
     if (vp != (VarData *) 0)
78
     {
79
 	if (vp->type != type && type != VLOCAL)
80
@@ -268,10 +267,10 @@
81
     return addVar(nm->text, type, array);
82
 }
83
 
84
-VarData *useVar(Token *nm, enum VarType type, int array)
85
+VarData *useVar(const Token *nm, enum VarType type, int array)
86
 {
87
     VarData *vp;
88
-    
89
+
90
     if (nm->length == 0) { return (VarData *) 0; }
91
     vp = varKnown(nm->text);
92
     if (vp != (VarData *) 0 && array != 2)
93
@@ -298,7 +297,7 @@
94
     return vp;
95
 }
96
 
97
-VarData *setVar(Token *nm, enum VarType type, int array)
98
+VarData *setVar(const Token *nm, enum VarType type, int array)
99
 {
100
     VarData *vp;
101
 
(-)frink/files/patch-vars.h (+25 lines)
Line 0 Link Here
1
--- vars.h.orig	2020-05-26 14:09:37.505782000 -0700
2
+++ vars.h	2020-05-26 14:11:43.732683000 -0700
3
@@ -11,7 +11,7 @@
4
  *
5
  */
6
 
7
-#ifndef FRINK_VARS_h
8
+#ifndef FRINK_VARS_H
9
 #define FRINK_VARS_H
10
 
11
 enum VarType
12
@@ -46,9 +46,9 @@
13
 
14
 
15
 extern void checkName(Token *, int);
16
-extern VarData *varKnown(char *);
17
-extern VarData *declareVar(Token *, enum VarType, int);
18
-extern VarData *useVar(Token *, enum VarType, int);
19
-extern VarData *setVar(Token *, enum VarType, int);
20
+extern VarData *varKnown(const char *);
21
+extern VarData *declareVar(const Token *, enum VarType, int);
22
+extern VarData *useVar(const Token *, enum VarType, int);
23
+extern VarData *setVar(const Token *, enum VarType, int);
24
 
25
 #endif

Return to bug 246163