From owner-svn-ports-all@freebsd.org Wed Sep 30 18:15:41 2020 Return-Path: Delivered-To: svn-ports-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 53AAE42D73D; Wed, 30 Sep 2020 18:15:41 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C1kvd1qBTz4c3w; Wed, 30 Sep 2020 18:15:41 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1DBC023D1F; Wed, 30 Sep 2020 18:15:41 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08UIFeVw094573; Wed, 30 Sep 2020 18:15:40 GMT (envelope-from se@FreeBSD.org) Received: (from se@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08UIFcO8094560; Wed, 30 Sep 2020 18:15:38 GMT (envelope-from se@FreeBSD.org) Message-Id: <202009301815.08UIFcO8094560@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: se set sender to se@FreeBSD.org using -f From: =?UTF-8?Q?Stefan_E=c3=9fer?= Date: Wed, 30 Sep 2020 18:15:38 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r550728 - in head/devel/frink: . files X-SVN-Group: ports-head X-SVN-Commit-Author: se X-SVN-Commit-Paths: in head/devel/frink: . files X-SVN-Commit-Revision: 550728 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Sep 2020 18:15:41 -0000 Author: se Date: Wed Sep 30 18:15:38 2020 New Revision: 550728 URL: https://svnweb.freebsd.org/changeset/ports/550728 Log: Fix build by casting from pointer to integer through size_t Added: head/devel/frink/files/patch-README (contents, props changed) head/devel/frink/files/patch-blocks.c (contents, props changed) head/devel/frink/files/patch-blocks.h (contents, props changed) head/devel/frink/files/patch-config.c (contents, props changed) head/devel/frink/files/patch-flagvars.h (contents, props changed) head/devel/frink/files/patch-frink.c (contents, props changed) head/devel/frink/files/patch-frink.h (contents, props changed) head/devel/frink/files/patch-output.c (contents, props changed) head/devel/frink/files/patch-tcl.c (contents, props changed) head/devel/frink/files/patch-token.c (contents, props changed) head/devel/frink/files/patch-token.h (contents, props changed) head/devel/frink/files/patch-util.c (contents, props changed) head/devel/frink/files/patch-util.h (contents, props changed) head/devel/frink/files/patch-vars.c (contents, props changed) head/devel/frink/files/patch-vars.h (contents, props changed) Deleted: head/devel/frink/files/patch-indent head/devel/frink/files/patch-strdup head/devel/frink/files/patch-warnings Modified: head/devel/frink/Makefile Modified: head/devel/frink/Makefile ============================================================================== --- head/devel/frink/Makefile Wed Sep 30 17:29:41 2020 (r550727) +++ head/devel/frink/Makefile Wed Sep 30 18:15:38 2020 (r550728) @@ -3,7 +3,7 @@ PORTNAME= frink PORTVERSION= 2.2.2p4 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= devel MASTER_SITES= https://BSDforge.COM/projects/source/devel/frink/ @@ -15,9 +15,10 @@ LICENSE_NAME= The University of Newcastle upon Tyne LICENSE_FILE= ${WRKSRC}/COPYRIGHT LICENSE_PERMS= auto-accept -WRKSRC= ${WRKDIR}/${PORTNAME}-2.2.2 USES= uidfix MAKEFILE= ${FILESDIR}/Makefile.bsd + +WRKSRC= ${WRKDIR}/${PORTNAME}-2.2.2 OPTIONS_DEFINE= DOCS Added: head/devel/frink/files/patch-README ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/devel/frink/files/patch-README Wed Sep 30 18:15:38 2020 (r550728) @@ -0,0 +1,20 @@ +--- README.orig 2002-09-11 08:46:00 UTC ++++ README +@@ -32,7 +32,7 @@ + turn OFF processing code passed to the bind command. + + -c +- set further indent for continuations to n. default = 2 ++ set further indent for continuations to n. default = 4 + + -d + remove braces in certain (safe) circumstances (default = OFF) +@@ -79,7 +79,7 @@ + turn on heuristic tests and warnings. (default = OFF) + + -i +- set indent for each level to n. default = 4 ++ set indent for each level to n. default = 8 + + -I + Treat elseif and else the same way. (default = OFF) Added: head/devel/frink/files/patch-blocks.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/devel/frink/files/patch-blocks.c Wed Sep 30 18:15:38 2020 (r550728) @@ -0,0 +1,10 @@ +--- blocks.c.orig 2004-01-22 13:58:26 UTC ++++ blocks.c +@@ -32,7 +32,6 @@ + #endif + + extern List *blocks; +-extern void warnFor(Token*, char*, char*); + + Blox *pushBlock(Token *cmd, int infl, int lvl, int cond) + { Added: head/devel/frink/files/patch-blocks.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/devel/frink/files/patch-blocks.h Wed Sep 30 18:15:38 2020 (r550728) @@ -0,0 +1,11 @@ +--- blocks.h.orig 2002-12-11 22:22:09 UTC ++++ blocks.h +@@ -33,7 +33,7 @@ typedef struct block_s + extern Blox *pushBlock(Token *, int, int, int); + extern void delBlock(Blox *); + extern void popBlock(int); +-extern int isUnreachable(); ++extern int isUnreachable(void); + extern void setUnreachable(int); + + #endif Added: head/devel/frink/files/patch-config.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/devel/frink/files/patch-config.c Wed Sep 30 18:15:38 2020 (r550728) @@ -0,0 +1,126 @@ +--- config.c.orig 2002-12-13 09:56:37 UTC ++++ config.c +@@ -29,14 +29,10 @@ + #include + #endif + +-extern Token *tokenPop(Token **); +-extern void freeToken(Token *); +-extern void streamMore(Input *); +- + List *config = noList; + + static struct { +- char *name; ++ const char *name; + ParamType code; + } pvals[] ={ + {"var", PVAR}, +@@ -71,10 +67,10 @@ static struct { + {(char *) 0, 0} + }; + +-void dumpPdata(ParamData *pt, FILE *op) ++static void dumpPdata(ParamData *pt, FILE *op) + { + int i; +- char *pad; ++ const char *pad; + List *lp; + + for (i=0; pvals[i].name != (char *) 0; i += 1) +@@ -91,7 +87,7 @@ void dumpPdata(ParamData *pt, FILE *op) + { + while (lp != noList) + { +- fprintf(op, "%x ", (int) lp->item); ++ fprintf(op, "%x ", (int)(size_t) lp->item); + lp = lp->next; + } + fprintf(op, "}"); +@@ -104,7 +100,7 @@ void dumpPdata(ParamData *pt, FILE *op) + + } + +-void dumpConf(ConfigData *cp, FILE *op) ++void dumpConf(const ConfigData *cp, FILE *op) + { + List *plp; + +@@ -118,7 +114,7 @@ void dumpConf(ConfigData *cp, FILE *op) + fprintf(op, "}\n"); + } + +-static void pcode(ParamData *ppt, char *str) ++static void pcode(ParamData *ppt, const char *str) + { + int i; + +@@ -171,8 +167,7 @@ static void param(Token *tp, List **plist) + ParamData *ppt; + SeqnData *sd; + void *dp; +- extern void dumpToken(Token *, FILE *); +- ++ + ppt = newpdata(); + switch (tp->type) + { +@@ -252,7 +247,7 @@ static void parlist(Token *tp, List **plist) + freeToken(lp2); + } + +-static int handle(Token *line) ++static int confighandle(Token *line) + { + ConfigData *cpt; + Token *hd, *tp; +@@ -306,11 +301,11 @@ static int handle(Token *line) + return 1; + } + +-void readconfig(char *str) ++void readconfig(const char *str) + { + FILE *fd; + Input file; +- ++ + if ((fd = fopen(str, "r")) == NULL) + { + fprintf(stderr, "Warning: cannot open config file\n"); +@@ -319,21 +314,21 @@ void readconfig(char *str) + /* + * use the tokenising mechanism we already have to parse the config file + */ +- file.text = (char *) malloc(64*1024); ++ file.atext = malloc(64*1024); + file.stream = fd; + file.tcall = file.texpr = 0; + file.lineNumber = 1; + file.lineStart = 1; + streamMore(&file); +- while(handle(collect(&file))) ++ while(confighandle(collect(&file))) + { + /* skip */ + } +- free(file.text); ++ free(file.atext); + fclose(fd); + } + +-void stringconfig(char *str) ++void stringconfig(const char *str) + { + Input file; + /* +@@ -346,7 +341,7 @@ void stringconfig(char *str) + file.tcall = file.texpr = 0; + file.lineNumber = 1; + file.lineStart = 1; +- while(handle(collect(&file))) ++ while(confighandle(collect(&file))) + { + /* skip */ + } Added: head/devel/frink/files/patch-flagvars.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/devel/frink/files/patch-flagvars.h Wed Sep 30 18:15:38 2020 (r550728) @@ -0,0 +1,27 @@ +--- flagvars.h.orig 2002-12-11 22:22:22 UTC ++++ flagvars.h +@@ -14,7 +14,7 @@ + extern int failed; + + extern int lineNumber; +-extern char *currentfile; ++extern const char *currentfile; + + extern int compout; + extern int noquotes; +@@ -63,11 +63,11 @@ extern int noheuristics; + extern int nocommand; + extern int trystrings; + +-extern char *style; +-extern char *pstyle; +-extern char *contString; ++extern const char *style; ++extern const char *pstyle; ++extern const char *contString; + +-extern char *locale; ++extern const char *locale; + extern FILE *msgfile; + extern FILE *specfile; + Added: head/devel/frink/files/patch-frink.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/devel/frink/files/patch-frink.c Wed Sep 30 18:15:38 2020 (r550728) @@ -0,0 +1,148 @@ +--- frink.c.orig 2003-10-02 20:18:05 UTC ++++ frink.c +@@ -28,6 +28,7 @@ + #ifdef HAVE_STDLIB_H + #include + #endif ++#include + + int failed = 0; + int lineNumber = 0; +@@ -39,7 +40,7 @@ int warndyn = 0; + int fascist = 0; + + int compout = 0; +-int resvsplit = 0; ++static int resvsplit = 0; + int noquotes = 0; + int spaceout = 0; + int trystrings = 0; +@@ -80,30 +81,21 @@ int nonlelsif = 0; + int extract = 0; + int internat = 0; + +-char *style = (char *) 0; +-char *pstyle = (char *) 0; +-char *contString = ""; ++const char *style = NULL; ++const char *pstyle = NULL; ++const char *contString = ""; + +-char *locale = (char *) 0; ++const char *locale = NULL; + FILE *msgfile = NULL; + FILE *specfile = NULL; + + int pragma = 0; + int praghold = 0; + +-char *currentfile = (char *) 0; ++const char *currentfile = NULL; + +-List *skiplist = (List *) 0; ++List *skiplist = NULL; + +-#ifndef __FreeBSD__ +-extern int getopt(int, char*const*, const char*); +-#endif +- +-extern int optind; +-extern char *optarg; +-extern int fclose(FILE*); +-extern void readconfig(char *); +-extern void stringconfig(char *); + extern void clearState(void); + + static void doVersion(void) +@@ -112,7 +104,7 @@ static void doVersion(void) + exit(0); + } + +-static char *languages[] = ++static const char *languages[] = + { + "aa", /* Afar */ + "ab", /* Abkhazian */ +@@ -256,7 +248,7 @@ static char *languages[] = + (char *) 0 + }; + +-static char *countries[] = ++static const char *countries[] = + { + "AF", /* AFGHANISTAN */ + "AL", /* ALBANIA */ +@@ -500,11 +492,11 @@ static char *countries[] = + (char *) 0 + }; + +-static void checkLocale(char *v) ++static void checkLocale(const char *v) + { + int l, i, fnd = 0;; + +- for (i = 0; languages[i] != (char *) 0; i += 1) ++ for (i = 0; languages[i] != NULL; i += 1) + { + if (strncmp(v, languages[i], 2) == 0) + { +@@ -624,7 +616,7 @@ static void usage(void) + "\n"); + } + +-void setOption(int flag, char *value) ++static void setOption(int flag, const char *value) + { + int not; + switch (flag) +@@ -749,9 +741,10 @@ static void setStyle(void) + } + } + +-static void readrc(char *file) ++static void readrc(const char *file) + { +- char *opts[50], buff[128], *cp; ++ const char *opts[50]; ++ char buff[128], *cp; + FILE *desc; + int leng, i; + +@@ -793,13 +786,9 @@ static void findrc(void) + + static void process(FILE *desc) + { +- extern void flushOutput(void); +- extern int handle(Token *line); +- extern void streamMore(Input *); +- + Input file; + +- file.text = (char *) malloc(64*1024); ++ file.atext = malloc(64*1024); + file.stream = desc; + file.tcall = file.texpr = 0; + file.lineNumber = 1; +@@ -809,12 +798,12 @@ static void process(FILE *desc) + { + } + flushOutput(); +- free(file.text); ++ free(file.atext); + } + + static void initCmds(void) + { +- static char *cmdspec = ++ static const char *cmdspec = + "set {{var 0x0017} {ctype? 0x0001}}\n" + "global {{varlist 0x0150}}\n" + "append {{var 0x0017} any args}\n" +@@ -969,7 +958,6 @@ static void initCmds(void) + int main(int argc, char **argv) + { + FILE *desc; +- extern void initOutput(void); + + initCmds(); + findrc(); Added: head/devel/frink/files/patch-frink.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/devel/frink/files/patch-frink.h Wed Sep 30 18:15:38 2020 (r550728) @@ -0,0 +1,20 @@ +--- frink.h.orig 2004-01-22 14:01:52 UTC ++++ frink.h +@@ -99,3 +99,17 @@ extern List *config; + + extern List *skiplist; + extern List *blocks; ++ ++void dumpConf(const ConfigData *, FILE*); ++void readconfig(const char *fileName); ++void stringconfig(const char *line); ++void initOutput(void); ++void setIndent(void); ++void outdent(void); ++int isVarToken(const Token *); ++int isSwitch(const Token *); ++int isSingleCall(const Token *, const char *); ++int tokEqual(const Token *, const char *); ++void flushOutput(void); ++void clearState(void); ++void warnFor(const Token *token, const char *cmd, const char *txt); Added: head/devel/frink/files/patch-output.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/devel/frink/files/patch-output.c Wed Sep 30 18:15:38 2020 (r550728) @@ -0,0 +1,65 @@ +--- output.c.orig 2002-12-11 23:05:16 UTC ++++ output.c +@@ -43,10 +43,10 @@ static int olead = 0; /* number of spaces wanted at s + + static TokenType olast = HEAD; + +-static Token nlToken = {BLANK, CNSTWORD, 0, (char *) 0, 0, (Token *) 0, (Token *) 0}; +-static Token startToken = {START, CNSTWORD, 0, (char *) 0, 0, (Token *) 0, (Token *) 0}; +-static Token contToken = {CONT, CNSTWORD, 0, (char *) 0, 0, (Token *) 0, (Token *) 0}; +-static Token spToken = {SP, CNSTWORD, 0, " ", 1, (Token *) 0, (Token *) 0}; ++static Token nlToken = {.type = BLANK, .ckind = CNSTWORD}; ++static Token startToken = {.type = START, .ckind = CNSTWORD}; ++static Token contToken = {.type = CONT, .ckind = CNSTWORD}; ++static Token spToken = {.type = SP, .ckind = CNSTWORD, .text = " ", .length = 1}; + + void initOutput(void) + { +@@ -226,7 +226,7 @@ static void termline(void) + } + } + +-static void printkn(char *txt, int length, int keepnl) ++static void printkn(const char *txt, int length, int keepnl) + { + char *cp; + int l; +@@ -251,7 +251,7 @@ static void printkn(char *txt, int length, int keepnl) + } + } + +-static void printn(char *txt, int len) ++static void printn(const char *txt, int len) + { + if (!testonly) + { +@@ -259,12 +259,12 @@ static void printn(char *txt, int len) + } + } + +-static void print(char *txt) ++static void print(const char *txt) + { + printn(txt, strlen(txt)); + } + +-static void brace(char *t) ++static void brace(const char *t) + { + char *cp, *bp; + while ((cp = strpbrk(t, "{}")) != (char *) 0) +@@ -377,10 +377,10 @@ static void putString(Token *seq) + if (qts) { printn("\"", 1); } + } + +-static Token dollarToken = {DOLLAR, CNSTWORD, 0, (char *) 0, 0, (Token *) 0, (Token *) 0}; +-static Token endlineToken = {ENDLINE, CNSTWORD, 0, (char *) 0, 0, (Token *) 0, (Token *) 0}; +-static Token lbrackToken = {LBRACK, CNSTWORD, 0, (char *) 0, 0, (Token *) 0, (Token *) 0}; +-static Token rbrackToken = {RBRACK, CNSTWORD, 0, (char *) 0, 0, (Token *) 0, (Token *) 0}; ++static Token dollarToken = {.type = DOLLAR, .ckind = CNSTWORD}; ++static Token endlineToken = {.type = ENDLINE, .ckind = CNSTWORD}; ++static Token lbrackToken = {.type = LBRACK, .ckind = CNSTWORD}; ++static Token rbrackToken = {.type = RBRACK, .ckind = CNSTWORD}; + + void output(Token *token, int compress) + { Added: head/devel/frink/files/patch-tcl.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/devel/frink/files/patch-tcl.c Wed Sep 30 18:15:38 2020 (r550728) @@ -0,0 +1,680 @@ +--- tcl.c.orig 2004-01-22 13:25:48 UTC ++++ tcl.c +@@ -26,50 +26,42 @@ + static int nest[32]; /* = = class, 1 = namespace */ + static int inproc = 0; + +-static Token lbraceToken = {LBRACE, CNSTWORD, 0, (char *) 0, 0, (Token *) 0, (Token *) 0}; +-static Token rbraceToken = {RBRACE, CNSTWORD, 0, (char *) 0, 0, (Token *) 0, (Token *) 0}; +-static Token xcontToken = {XCONT, CNSTWORD, 0, (char *) 0, 0, (Token *) 0, (Token *) 0}; +-static Token ostartToken = {OSTART, CNSTWORD, 0, (char *) 0, 0, (Token *) 0, (Token *) 0}; +-static Token startToken = {START, CNSTWORD, 0, (char *) 0, 0, (Token *) 0, (Token *) 0}; +-static Token contToken = {CONT, CNSTWORD, 0, (char *) 0, 0, (Token *) 0, (Token *) 0}; +-static Token econtToken = {ECONT, CNSTWORD, 0, (char *) 0, 0, (Token *) 0, (Token *) 0}; +-static Token emToken = {EM, CNSTWORD, 0, (char *) 0, 0, (Token *) 0, (Token *) 0}; +-static Token nospToken = {NOSP, CNSTWORD, 0, (char *) 0, 0, (Token *) 0, (Token *) 0}; ++static Token lbraceToken = {.type = LBRACE, .ckind = CNSTWORD}; ++static Token rbraceToken = {.type = RBRACE, .ckind = CNSTWORD}; ++static Token xcontToken = {.type = XCONT, .ckind = CNSTWORD}; ++static Token ostartToken = {.type = OSTART, .ckind = CNSTWORD}; ++static Token startToken = {.type = START, .ckind = CNSTWORD}; ++static Token contToken = {.type = CONT, .ckind = CNSTWORD}; ++static Token econtToken = {.type = ECONT, .ckind = CNSTWORD}; ++static Token emToken = {.type = EM, .ckind = CNSTWORD}; ++static Token nospToken = {.type = NOSP, .ckind = CNSTWORD}; + static Token *olsToken = &emToken; +-static Token spToken = {SP, CNSTWORD, 0, (char *) 0, 0, (Token *) 0, (Token *) 0}; +-static Token lbrackToken = {LBRACK, CNSTWORD, 0, (char *) 0, 0, (Token *) 0, (Token *) 0}; +-static Token rbrackToken = {RBRACK, CNSTWORD, 0, (char *) 0, 0, (Token *) 0, (Token *) 0}; +-static Token msgcatToken = {CONST, CNSTWORD, 0, "::msgcat::mc", 12, (Token *) 0, (Token *) 0}; ++static Token spToken = {.type = SP, .ckind = CNSTWORD}; ++static Token lbrackToken = {.type = LBRACK, .ckind = CNSTWORD}; ++static Token rbrackToken = {.type = RBRACK, .ckind = CNSTWORD}; ++static Token msgcatToken = {.type = CONST, .ckind = CNSTWORD, .text = "::msgcat::mc", .length = 12}; + +-static Token dqStart = {DQSTART, CNSTWORD, 0, (char *) 0, 0, noToken, noToken}; +-static Token dqEnd = {DQEND, CNSTWORD, 0, (char *) 0, 0, noToken, noToken}; +-static Token thenToken = {CONST, CNSTWORD, 0, "then", 4, noToken, noToken}; +-static Token procToken = {CONST, CNSTWORD, 0, "proc", 4, noToken, noToken}; +-static Token elseToken = {CONST, CNSTWORD, 0, "else", 4, noToken, noToken}; +-static Token elseifToken = {CONST, CNSTWORD, 0, "elseif", 6, noToken, noToken}; +-static Token methodToken = {CONST, CNSTWORD, 0, "method", 6, noToken, noToken}; +-static Token semiToken = {SEMI, CNSTWORD, 0, ";", 1, noToken, noToken}; +-static Token argsToken = {SEMI, CNSTWORD, 0, "args", 4, noToken, noToken}; +-static Token argvToken = {SEMI, CNSTWORD, 0, "argv", 4, noToken, noToken}; +-static Token argv0Token = {SEMI, CNSTWORD, 0, "argv0", 5, noToken, noToken}; +-static Token platfToken = {SEMI, CNSTWORD, 0, "tcl_platform", 12, noToken, noToken}; ++static Token dqStart = {.type = DQSTART, .ckind = CNSTWORD}; ++static Token dqEnd = {.type = DQEND, .ckind = CNSTWORD}; ++static Token thenToken = {.type = CONST, .ckind = CNSTWORD, .text = "then", .length = 4}; ++static Token procToken = {.type = CONST, .ckind = CNSTWORD, .text = "proc", .length = 4}; ++static Token elseToken = {.type = CONST, .ckind = CNSTWORD, .text = "else", .length = 4}; ++static Token elseifToken = {.type = CONST, .ckind = CNSTWORD, .text = "elseif", .length = 6}; ++static Token methodToken = {.type = CONST, .ckind = CNSTWORD, .text = "method", .length = 6}; ++static Token semiToken = {.type = SEMI, .ckind = CNSTWORD, .text = ";", .length = 1}; ++static Token argsToken = {.type = SEMI, .ckind = CNSTWORD, .text = "args", .length = 4}; ++static Token argvToken = {.type = SEMI, .ckind = CNSTWORD, .text = "argv", .length = 4}; ++static Token argv0Token = {.type = SEMI, .ckind = CNSTWORD, .text = "argv0", .length = 5}; ++static Token platfToken = {.type = SEMI, .ckind = CNSTWORD, .text = "tcl_platform", .length = 12}; + + List *blocks = noList; + +-static CheckIt **noChecks = (CheckIt **) 0; +- +-extern void setIndent(void); +-extern void outdent(void); +-extern int isVarToken(Token *); +-extern int isSwitch(Token *); +-extern int isSingleCall(Token *, char *); +-extern int tokEqual(Token *, char *); +- + /* + * If there are no more tokens, print a useful message to the user and + * exit. + */ +-void failIfNullToken(Token *token, char *part, char *command, int ln) ++static void failIfNullToken(const Token *token, const char *part, ++ const char *command, int ln) + { + char msg[1024]; + +@@ -77,11 +69,11 @@ void failIfNullToken(Token *token, char *part, char *c + { + if (ln == 0) + { +- sprintf(msg, "Missing \"%s\" part in call of %s", part, command); ++ snprintf(msg, sizeof msg, "Missing \"%s\" part in call of %s", part, command); + } + else + { +- sprintf(msg, "Missing \"%s\" part in call of %s, starting line %d", ++ snprintf(msg, sizeof msg, "Missing \"%s\" part in call of %s, starting line %d", + part, command, ln); + } + fail(token, msg); +@@ -92,7 +84,8 @@ void failIfNullToken(Token *token, char *part, char *c + * If there are more tokens after this one, print a useful warning to + * the user. + */ +-void warnIfArgsAfter(Token *token, char *part, char *command) ++static void warnIfArgsAfter(const Token *token, const char *part, ++ const char *command) + { + char msg[1024]; + +@@ -106,25 +99,25 @@ void warnIfArgsAfter(Token *token, char *part, char *c + { + if (*part != '\0') + { +- sprintf(msg, "Extra arguments after \"%s\" part in call of %s", ++ snprintf(msg, sizeof msg, "Extra arguments after \"%s\" part in call of %s", + part, command); + } + else + { +- sprintf(msg, "Extra arguments in call of `%s'", command); ++ snprintf(msg, sizeof msg, "Extra arguments in call of `%s'", command); + } + warn(token, msg); + if (token->next != noToken && token->next->text != (char *) 0 && + token->next->text[0] != '\0') + { +- sprintf(msg, "Extra token is `%s'", token->next->text); ++ snprintf(msg, sizeof msg, "Extra token is `%s'", token->next->text); + warn(token->next, msg); + } + } + } + } + +-void warnExpr(Token *cmd, char *txt) ++static void warnExpr(const Token *cmd, const char *txt) + { + if (doTest(HEXPR) && cmd != noToken && cmd->type != LIST) + { +@@ -132,21 +125,14 @@ void warnExpr(Token *cmd, char *txt) + } + } + +-void warnFor(Token *token, char *cmd, char *txt) ++void warnFor(const Token *token, const char *cmd, const char *txt) + { + char msg[1024]; + +- sprintf(msg, txt, cmd); ++ snprintf(msg, sizeof msg, txt, cmd); + warn(token, msg); + } + +-static void warnIFor(Token *token, int val, char *txt) +-{ +- char msg[1024]; +- +- sprintf(msg, txt, val); +- warn(token, msg); +-} + /* + * reset various variables so that multiple file processing doesn't get + * screwed up +@@ -170,7 +156,7 @@ void clearState(void) + setVar(&platfToken, VGLOBAL, 1); + } + +-static int isNumber(char *cp) ++static int isNumber(const char *cp) + { + if (*cp == '-' || *cp == '+') + { +@@ -187,9 +173,9 @@ static int isNumber(char *cp) + return 1; + } + +-static int tokIsLevel(Token *tp) ++static int tokIsLevel(const Token *tp) + { +- char *cp; ++ const char *cp; + if (tp == noToken || !(tp->type == CONST || tp->type == LIST) || tp->text == (char *) 0) + { + return 0; +@@ -207,7 +193,7 @@ static int tokIsLevel(Token *tp) + return isNumber(cp); + } + +-static int oneLine(Token *seq, int semis) ++static int oneLine(const Token *seq, int semis) + { + while (seq != noToken) + { +@@ -221,7 +207,7 @@ static int oneLine(Token *seq, int semis) + return 1; + } + +-static int checkSpecial(char *val) ++static int checkSpecial(const char *val) + { + char ch; + +@@ -238,17 +224,17 @@ static int checkSpecial(char *val) + return 1; + } + +-static void checkUnquoted(Token *str) ++static void checkUnquoted(const Token *str) + { + char msg[128]; + if (noquotes && str->type == CONST && str->ckind == CNSTWORD && !isNumber(str->text)) + { +- sprintf(msg, "Unquoted constant - \"%s\"", str->text); ++ snprintf(msg, sizeof msg, "Unquoted constant - \"%s\"", str->text); + warn(str, msg); + } + } + +-static void checkType(Token *cmd, int flags) ++static void checkType(const Token *cmd, int flags) + { + if (cmd->type == CONST) + { +@@ -266,7 +252,7 @@ static void checkType(Token *cmd, int flags) + } + } + +-static int single(Token * tp) ++static int single(const Token * tp) + { + if (tp != noToken && tp->next == noToken) + { +@@ -285,13 +271,13 @@ static int single(Token * tp) + return 0; + } + +-static int sconstant(Token *tp) ++static int sconstant(const Token *tp) + { + return (tp != noToken && tp->next == noToken + && (tp->type == CONST || tp->type == LIST) && !checkSpecial(tp->text)); + } + +-static int constantString(Token * tp, int any) ++static int constantString(const Token * tp, int any) + { + Token *sq; + if (tp == noToken) return 0; +@@ -312,12 +298,12 @@ static int constantString(Token * tp, int any) + } + } + +-void loopstart(int inf, int cond) ++static void loopstart(int inf, int cond) + { + pushBlock(noToken, inf, -1, cond); + } + +-void loopend(void) ++static void loopend(void) + { + Blox *bp = lpeek(blocks); + int il = bp->infloop, su = (bp->breaks == 0); +@@ -329,7 +315,7 @@ void loopend(void) + } + } + +-static void msgsave(Token *tp, int any) ++static void msgsave(const Token *tp, int any) + { + char filename[128]; + +@@ -362,10 +348,11 @@ static void msgsave(Token *tp, int any) + } + } + +-void sptclop(Token *hd) ++static void doUser(Token *hd, Token *cmd, const ConfigData *cpt, int nostart); ++ ++static void sptclop(Token *hd) + { + List *cpt = config; +- extern void doUser(Token *hd, Token *cmd, ConfigData *cpt, int nostart); + ConfigData *cdp; + + while (cpt != noList) +@@ -528,7 +515,7 @@ typedef enum flags_e { + SPACEOUT = 020 + } PressFlags; + +-static void press(Token *v , PressFlags flags, CheckIt **checkp) ++static void press(Token *v , PressFlags flags) + { + Input *idx; + Token *token = noToken, *lst = noToken; +@@ -601,7 +588,7 @@ done : + switch (token->type) + { + case SEMI : +- if (flags && SEMIS) ++ if (flags & SEMIS) + { + output(&semiToken, 1); + } +@@ -640,7 +627,7 @@ done : + } + } + +-void etcetera(Token *cmd, int v) ++static void etcetera(Token *cmd, int v) + { + while (cmd != noToken) + { +@@ -649,7 +636,7 @@ void etcetera(Token *cmd, int v) + } + } + +-void catbin(Token *tp) ++static void catbin(Token *tp) + { + int sem, oln; + Token *sols; +@@ -692,7 +679,8 @@ static void handleVar(Token *hd, Token *cmd, int flags + enum VarType vt; + VarData *vp = (VarData *) 0; + char msg[1024]; +- Token *ap = noToken, *ac; ++ Token *ap = noToken; ++ const Token *ac; + int array = 0; + + if (isVarToken(cmd)) +@@ -828,7 +816,7 @@ void makeCall (Token *prc, Token *arg) + } + } + +-Token *doswitch(Token *cmd, Token *leadin) ++static Token *doswitch(Token *cmd, Token *leadin) + { + Token *tp, *bod; + int ln = leadin->lineNo, eopt = 0, dflt = 0, srtp = 1; +@@ -951,7 +939,7 @@ Token *doswitch(Token *cmd, Token *leadin) + return noToken; + } + +-Token *doif(Token *cmd, Token *leadin) ++static Token *doif(Token *cmd, Token *leadin) + { + Token *tp, *then; + int efl = ADDBRACES, ln = leadin->lineNo, cfl = ADDBRACES | PAREN; +@@ -963,7 +951,7 @@ Token *doif(Token *cmd, Token *leadin) + { + cfl |= SPACEOUT; + } +- press(cmd, cfl, noChecks); ++ press(cmd, cfl); + if (putThen) { output(&thenToken, 0); } + then = cmd->next; + if (tokEqual(then, "then")) { then = then->next; } +@@ -979,7 +967,7 @@ Token *doif(Token *cmd, Token *leadin) + tp = tp->next; + failIfNullToken(tp, "condition", "elseif", ln); + warnExpr(tp, "elseif condition not braced."); +- press(tp, efl | PAREN, noChecks); ++ press(tp, efl | PAREN); + tp = tp->next; + failIfNullToken(tp, "body", "elseif", ln); + body(tp, 0, 0); +@@ -1019,9 +1007,9 @@ Token *doif(Token *cmd, Token *leadin) + } + + +-int isNSName(Token *cmd) ++static int isNSName(const Token *cmd) + { +- char *cp; ++ const char *cp; + int cols = 0; + + if (!constant(cmd) || cmd->text == (char *) 0) { return 0; } +@@ -1053,7 +1041,7 @@ int isNSName(Token *cmd) + return 0; + } + +-static Token *doProc(Token *tag, Token *cmd, Token *leadin, int checkNS) ++static Token *doProc(Token *tag, Token *cmd, Token *leadin) + { + int ln = leadin->lineNo, inns; + Token *token, *tok2, *tok3; +@@ -1176,15 +1164,15 @@ static Token *doProc(Token *tag, Token *cmd, Token *le + + static Token *doproc(Token *cmd, Token *leadin) + { +- return doProc(&procToken, cmd, leadin, 1); ++ return doProc(&procToken, cmd, leadin); + } + + static Token *domethod(Token *cmd, Token *leadin) + { +- return doProc(&methodToken, cmd, leadin, 0); ++ return doProc(&methodToken, cmd, leadin); + } + +-static Token *dodestructor(Token *cmd, Token *leadin) ++static Token *dodestructor(Token *cmd, Token *leadin __attribute__((__unused__))) + { + if (!nest[0]) + { +@@ -1199,7 +1187,7 @@ static Token *dodestructor(Token *cmd, Token *leadin) + return noToken; + } + +-Token *doconstructor(Token *cmd, Token *leadin) ++static Token *doconstructor(Token *cmd, Token *leadin __attribute__((__unused__))) + { + if (!nest[0]) + { +@@ -1208,7 +1196,7 @@ Token *doconstructor(Token *cmd, Token *leadin) + else + { + failIfNullToken(cmd, "args", "constructor", 0); +- press(cmd, NOBRACE | ADDBRACES, noChecks); ++ press(cmd, NOBRACE | ADDBRACES); + cmd = cmd->next; + failIfNullToken(cmd, "body", "constructor", 0); + body(cmd, 0, 0); +@@ -1217,7 +1205,7 @@ Token *doconstructor(Token *cmd, Token *leadin) + return noToken; + } + +-Token *doreturn(Token *cmd, Token *leadin) ++static Token *doreturn(Token *cmd, Token *leadin) + { + Blox *pr = (Blox *) lpeek(blocks); + +@@ -1266,7 +1254,7 @@ Token *doreturn(Token *cmd, Token *leadin) + return noToken; + } + +-Token *doregexp(Token *cmd, Token *leadin) ++static Token *doregexp(Token *cmd, Token *leadin) + { + int eopt = 0; + int ln = cmd->lineNo, paramCount = 0; +@@ -1311,7 +1299,7 @@ Token *doregexp(Token *cmd, Token *leadin) + return noToken; + } + +-Token *doregsub(Token *cmd, Token *leadin) ++static Token *doregsub(Token *cmd, Token *leadin) + { + int eopt = 0; + int ln = cmd->lineNo, paramCount = 0; +@@ -1360,7 +1348,7 @@ Token *doregsub(Token *cmd, Token *leadin) + return cmd->next; + } + +-Token *dobind(Token *cmd, Token *leadin) ++static Token *dobind(Token *cmd, Token *leadin __attribute__((__unused__))) + { + Token *np; + if (!doBind || pragma & NOFORMAT) +@@ -1386,7 +1374,7 @@ Token *dobind(Token *cmd, Token *leadin) + return noToken; + } + +-Token *doitcl_class(Token *cmd, Token *leadin) ++static Token *doitcl_class(Token *cmd, Token *leadin __attribute__((__unused__))) + { + failIfNullToken(cmd, "className", "itcl_class", 0); + output(cmd, 1); +@@ -1399,7 +1387,7 @@ Token *doitcl_class(Token *cmd, Token *leadin) + return noToken; + } + +-Token *docvar(Token *cmd, Token *prt) ++static Token *docvar(Token *cmd, Token *prt) + { + if (!nest[0]) + { +@@ -1411,14 +1399,14 @@ Token *docvar(Token *cmd, Token *prt) + output(cmd, 1); + if ((cmd = cmd->next) != noToken) + { +- press(cmd, NOBRACE | ADDBRACES, noChecks); ++ press(cmd, NOBRACE | ADDBRACES); + warnIfArgsAfter(cmd, "init", prt->text); + } + } + return noToken; + } + +-Token *dopublic(Token *cmd, Token *leadin) ++static Token *dopublic(Token *cmd, Token *leadin __attribute__((__unused__))) + { + if (!nest[0]) + { +@@ -1430,7 +1418,7 @@ Token *dopublic(Token *cmd, Token *leadin) + output(cmd, 1); + if ((cmd = cmd->next) != noToken) + { +- press(cmd, NOBRACE | ADDBRACES, noChecks); ++ press(cmd, NOBRACE | ADDBRACES); + if ((cmd = cmd->next) != noToken) + { + body(cmd, 0, 0); +@@ -1441,11 +1429,11 @@ Token *dopublic(Token *cmd, Token *leadin) + return noToken; + } + +-Token *doprotected(Token *cmd, Token *leadin) { return docvar(cmd, leadin); } ++static Token *doprotected(Token *cmd, Token *leadin) { return docvar(cmd, leadin); } + +-Token *docommon(Token *cmd, Token *leadin) { return docvar(cmd, leadin); } ++static Token *docommon(Token *cmd, Token *leadin) { return docvar(cmd, leadin); } + +-static void checkVar(Token *cmd, char *nm) ++static void checkVar(Token *cmd, const char *nm) + { + List *bp = blocks; + Blox *xp; +@@ -1524,7 +1512,7 @@ static void addForVars(Token *cmd) + } + } + +-Token *doforeach(Token *cmd, Token *leadin) ++static Token *doforeach(Token *cmd, Token *leadin __attribute__((__unused__))) + { *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***