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
This commit is contained in:
Dimitry Andric 2021-09-15 09:42:49 +02:00
parent 11b23e6472
commit 9118b8848d
3 changed files with 84 additions and 27 deletions

View file

@ -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/

View file

@ -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)
}
}

View file

@ -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;
}