From owner-dev-commits-ports-main@freebsd.org Wed Sep 15 07:48:38 2021 Return-Path: Delivered-To: dev-commits-ports-main@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 0927367A2F1; Wed, 15 Sep 2021 07:48:38 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H8XQY6hGYz4hhg; Wed, 15 Sep 2021 07:48:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C1C8A22C2; Wed, 15 Sep 2021 07:48:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18F7mbxu018777; Wed, 15 Sep 2021 07:48:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18F7mbxt018776; Wed, 15 Sep 2021 07:48:37 GMT (envelope-from git) Date: Wed, 15 Sep 2021 07:48:37 GMT Message-Id: <202109150748.18F7mbxt018776@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Dimitry Andric Subject: git: 9118b8848d5a - main - devel/frink: fix unused but set variables MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9118b8848d5ad2b51d8af3ed72b45b618f5caf36 Auto-Submitted: auto-generated X-BeenThere: dev-commits-ports-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the main branch of the FreeBSD ports repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2021 07:48:38 -0000 The branch main has been updated by dim (src committer): URL: https://cgit.FreeBSD.org/ports/commit/?id=9118b8848d5ad2b51d8af3ed72b45b618f5caf36 commit 9118b8848d5ad2b51d8af3ed72b45b618f5caf36 Author: Dimitry Andric AuthorDate: 2021-09-15 07:42:49 +0000 Commit: Dimitry Andric CommitDate: 2021-09-15 07:47:47 +0000 devel/frink: fix unused but set variables Clang 13 now has a -Wunused-but-set-variable warning, which is emitted a few times in devel/frink. Remove the variables that were unused. PR: 258470 Approved by: portmaster@bsdforge.com (maintainer) MFH: 2021Q3 --- devel/frink/Makefile | 2 +- devel/frink/files/patch-tcl.c | 72 +++++++++++++++++++++++++++++++---------- devel/frink/files/patch-token.c | 37 +++++++++++++++------ 3 files changed, 84 insertions(+), 27 deletions(-) diff --git a/devel/frink/Makefile b/devel/frink/Makefile index 8b8cca039c50..a065ec0a4900 100644 --- a/devel/frink/Makefile +++ b/devel/frink/Makefile @@ -2,7 +2,7 @@ PORTNAME= frink PORTVERSION= 2.2.2p4 -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= devel MASTER_SITES= https://BSDforge.COM/projects/source/devel/frink/ diff --git a/devel/frink/files/patch-tcl.c b/devel/frink/files/patch-tcl.c index 669c4fcbb2c2..d968fbd54514 100644 --- a/devel/frink/files/patch-tcl.c +++ b/devel/frink/files/patch-tcl.c @@ -514,7 +514,45 @@ { List *bp = blocks; Blox *xp; -@@ -1524,7 +1512,7 @@ static void addForVars(Token *cmd) +@@ -1476,7 +1464,6 @@ static void checkVar(Token *cmd, char *nm) + static void addForVars(Token *cmd) + { + Token *vr, *vp, *ap; +- VarData *rp; + + switch (cmd->type) + { +@@ -1484,12 +1471,12 @@ static void addForVars(Token *cmd) + checkVar(cmd, cmd->text); + if ((ap = isArray(cmd)) != noToken) + { +- rp = setVar(ap, VFOR, 1); ++ setVar(ap, VFOR, 1); + freeToken(ap); + } + else + { +- rp = setVar(cmd, VFOR, 0); ++ setVar(cmd, VFOR, 0); + } + break; + +@@ -1506,12 +1493,12 @@ static void addForVars(Token *cmd) + checkVar(vp, vp->text); + if ((ap = isArray(vp)) != noToken) + { +- rp = setVar(ap, VFOR, 1); ++ setVar(ap, VFOR, 1); + freeToken(ap); + } + else + { +- rp = setVar(vp, VFOR, 0); ++ setVar(vp, VFOR, 0); + } + } + vp = vp->next; +@@ -1524,7 +1511,7 @@ static void addForVars(Token *cmd) } } @@ -523,7 +561,7 @@ { failIfNullToken(cmd, "varName", "foreach", 0); loopstart(0, 0); -@@ -1534,7 +1522,7 @@ Token *doforeach(Token *cmd, Token *leadin) +@@ -1534,7 +1521,7 @@ Token *doforeach(Token *cmd, Token *leadin) addForVars(cmd); cmd = cmd->next; failIfNullToken(cmd, "list", "foreach", 0); @@ -532,7 +570,7 @@ cmd = cmd->next; } while (cmd != noToken && cmd->next != noToken && cmd->next->type != SCOMMENT); -@@ -1546,7 +1534,7 @@ Token *doforeach(Token *cmd, Token *leadin) +@@ -1546,7 +1533,7 @@ Token *doforeach(Token *cmd, Token *leadin) return noToken; } @@ -541,7 +579,7 @@ { Token *tp; if (!tclX) -@@ -1556,15 +1544,15 @@ Token *doloop(Token *cmd, Token *leadin) +@@ -1556,15 +1543,15 @@ Token *doloop(Token *cmd, Token *leadin) else { failIfNullToken(cmd, "var", "loop", 0); @@ -560,7 +598,7 @@ tp = tp->next; failIfNullToken(tp, "body", "loop", 0); -@@ -1572,7 +1560,7 @@ Token *doloop(Token *cmd, Token *leadin) +@@ -1572,7 +1559,7 @@ Token *doloop(Token *cmd, Token *leadin) if (tp->next != noToken) { warnExpr(cmd, "Unbracketed loop \"incr\""); @@ -569,7 +607,7 @@ tp = tp->next; } loopstart(0, 0); -@@ -1584,7 +1572,7 @@ Token *doloop(Token *cmd, Token *leadin) +@@ -1584,7 +1571,7 @@ Token *doloop(Token *cmd, Token *leadin) return noToken; } @@ -578,7 +616,7 @@ { if (!doExpr) { -@@ -1599,7 +1587,7 @@ Token *doexpr(Token *cmd, Token *leadin) +@@ -1599,7 +1586,7 @@ Token *doexpr(Token *cmd, Token *leadin) else if (cmd->next == noToken) { warnExpr(cmd, "expr body not braced."); @@ -587,7 +625,7 @@ } else { -@@ -1610,7 +1598,7 @@ Token *doexpr(Token *cmd, Token *leadin) +@@ -1610,7 +1597,7 @@ Token *doexpr(Token *cmd, Token *leadin) return noToken; } @@ -596,7 +634,7 @@ { int pCount = 1; -@@ -1641,7 +1629,7 @@ Token *dounset(Token *cmd, Token *leadin) +@@ -1641,7 +1628,7 @@ Token *dounset(Token *cmd, Token *leadin) return noToken; } @@ -605,7 +643,7 @@ { int paramCount = 0; int ln = leadin->lineNo; -@@ -1672,7 +1660,7 @@ Token *doupvar(Token *cmd, Token *leadin) +@@ -1672,7 +1659,7 @@ Token *doupvar(Token *cmd, Token *leadin) return noToken; } @@ -614,7 +652,7 @@ { int paramCount = 1; -@@ -1776,7 +1764,7 @@ static int valuecheck(ParamData *pdp, Token *cmd) +@@ -1776,7 +1763,7 @@ static int valuecheck(ParamData *pdp, Token *cmd) return 0; } @@ -623,7 +661,7 @@ { List *sp, *llp, *lp; ParamData *pt, *pdp; -@@ -1793,7 +1781,7 @@ void doBasic(ConfigData *cpt, Token *hd, Token *cmd) +@@ -1793,7 +1780,7 @@ void doBasic(ConfigData *cpt, Token *hd, Token *cmd) pt = (ParamData *) lpeek(lp); if (pt != (ParamData *) 0 && pt->values != noList) { @@ -632,7 +670,7 @@ } else { -@@ -1850,7 +1838,7 @@ void doBasic(ConfigData *cpt, Token *hd, Token *cmd) +@@ -1850,7 +1837,7 @@ void doBasic(ConfigData *cpt, Token *hd, Token *cmd) } else { @@ -641,7 +679,7 @@ } break; -@@ -1862,7 +1850,7 @@ void doBasic(ConfigData *cpt, Token *hd, Token *cmd) +@@ -1862,7 +1849,7 @@ void doBasic(ConfigData *cpt, Token *hd, Token *cmd) else { warnExpr(cmd, "Unbracketed expression"); @@ -650,7 +688,7 @@ } break; -@@ -1883,7 +1871,7 @@ void doBasic(ConfigData *cpt, Token *hd, Token *cmd) +@@ -1883,7 +1870,7 @@ void doBasic(ConfigData *cpt, Token *hd, Token *cmd) { ptpar |= SPACEOUT; } @@ -659,7 +697,7 @@ loopstart(infloop, 1); } break; -@@ -2085,7 +2073,7 @@ void doBasic(ConfigData *cpt, Token *hd, Token *cmd) +@@ -2085,7 +2072,7 @@ void doBasic(ConfigData *cpt, Token *hd, Token *cmd) pt = (ParamData *) lpeek(lp); if ((sp = pt->values) != noList) { @@ -668,7 +706,7 @@ } else { -@@ -2140,7 +2128,8 @@ void doBasic(ConfigData *cpt, Token *hd, Token *cmd) +@@ -2140,7 +2127,8 @@ void doBasic(ConfigData *cpt, Token *hd, Token *cmd) } } diff --git a/devel/frink/files/patch-token.c b/devel/frink/files/patch-token.c index e62544dc6b49..396c124a4f62 100644 --- a/devel/frink/files/patch-token.c +++ b/devel/frink/files/patch-token.c @@ -233,13 +233,32 @@ + { NULL, 0, 1}, }; struct pragma_s *prp; - int label, mode = 1; +- int label, mode = 1; - char *cp; ++ int mode = 1; + const char *cp; Token *token, *chars = newToken(CONST); Input *pfile; -@@ -1347,9 +1329,6 @@ int handle(Token *line) +@@ -1277,16 +1259,8 @@ static void handlePragma(Token *tp) + chars->length = strlen(cp); + pfile=tokenise(chars, 0); + token = getToken(pfile); +- if (tokNEqual(token, "PRAGMA", 6)) ++ if (!tokNEqual(token, "PRAGMA", 6) && !tokNEqual(token, "FRINK", 5)) + { +- label = 1; +- } +- else if (tokNEqual(token, "FRINK", 5)) +- { +- label = 2; +- } +- else +- { + warn(tp, "Pragma syntax weirdness"); + } + freeToken(token); +@@ -1347,9 +1321,6 @@ int handle(Token *line) { Token *hd; @@ -249,7 +268,7 @@ if (line == noToken) { if (!minimise) -@@ -1575,7 +1554,7 @@ void lprocess(Token *lst, int nls) +@@ -1575,7 +1546,7 @@ void lprocess(Token *lst, int nls) if (line != noToken) { handle(line); } } @@ -258,7 +277,7 @@ { Token *line = noToken, *hd = noToken; TokenType last = NL; -@@ -1652,16 +1631,16 @@ Token *tokacc(Token *tp, int flag, int nl) +@@ -1652,16 +1623,16 @@ Token *tokacc(Token *tp, int flag, int nl) return lp; } @@ -278,7 +297,7 @@ TBuff *tb; if (token != noToken && token->type == CONC) -@@ -1694,7 +1673,7 @@ int isVarToken(Token *token) +@@ -1694,7 +1665,7 @@ int isVarToken(Token *token) return chkVarToken(token); } @@ -287,7 +306,7 @@ { if (token != noToken) { -@@ -1715,7 +1694,7 @@ int isSingleCall(Token *token, char *proc) +@@ -1715,7 +1686,7 @@ int isSingleCall(Token *token, char *proc) return 0; } @@ -296,7 +315,7 @@ { if (token != noToken) { -@@ -1739,14 +1718,15 @@ int isSwitch(Token *token) +@@ -1739,14 +1710,15 @@ int isSwitch(Token *token) return 0; } @@ -315,7 +334,7 @@ { switch (tp->type) { -@@ -1776,9 +1756,7 @@ Token *isArray(Token *tp) +@@ -1776,9 +1748,7 @@ Token *isArray(Token *tp) ch = *cp; if (ch == '(') { @@ -326,7 +345,7 @@ break; } if (ch == '\0') { break; } -@@ -1790,7 +1768,7 @@ Token *isArray(Token *tp) +@@ -1790,7 +1760,7 @@ Token *isArray(Token *tp) return res; }