summaryrefslogtreecommitdiffstats
path: root/usr.bin/m4/expr.c
diff options
context:
space:
mode:
authored <ed@FreeBSD.org>2011-10-16 08:09:17 +0000
committered <ed@FreeBSD.org>2011-10-16 08:09:17 +0000
commit225015e0ef641913f865dee3a9c5e6bc9524d970 (patch)
tree9600e57a5c4edc9635bc5ae1d54b98667ee0a864 /usr.bin/m4/expr.c
parent7ccc19c3b89a2b9b1fdf8db9bf23a9bcc50026e4 (diff)
downloadFreeBSD-src-225015e0ef641913f865dee3a9c5e6bc9524d970.zip
FreeBSD-src-225015e0ef641913f865dee3a9c5e6bc9524d970.tar.gz
Fix build of m4 with WARNS=6.
Change the parser; rename `exp' to `exponent' not to collide with exp(3).
Diffstat (limited to 'usr.bin/m4/expr.c')
-rw-r--r--usr.bin/m4/expr.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/usr.bin/m4/expr.c b/usr.bin/m4/expr.c
index be0f9f9..8f4dd9c 100644
--- a/usr.bin/m4/expr.c
+++ b/usr.bin/m4/expr.c
@@ -71,8 +71,8 @@ __FBSDID("$FreeBSD$");
* nerel : shift { ("<" | ">" | "<=" | ">=") shift }
* shift : primary { ("<<" | ">>") primary }
* primary : term { ("+" | "-") term }
- * term : exp { ("*" | "/" | "%") exp }
- * exp : unary { "**" unary }
+ * term : exponent { ("*" | "/" | "%") exponent }
+ * exponent: unary { "**" unary }
* unary : factor
* | ("+" | "-" | "~" | "!") unary
* factor : constant
@@ -115,12 +115,11 @@ static int nerel(int mayeval);
static int shift(int mayeval);
static int primary(int mayeval);
static int term(int mayeval);
-static int exp(int mayeval);
+static int exponent(int mayeval);
static int unary(int mayeval);
static int factor(int mayeval);
static int constant(int mayeval);
static int num(int mayeval);
-static int geteqrel(int mayeval);
static int skipws(void);
static void experr(const char *);
@@ -388,16 +387,16 @@ primary(int mayeval)
}
/*
- * term : exp { ("*" | "/" | "%") exp }
+ * term : exponent { ("*" | "/" | "%") exponent }
*/
static int
term(int mayeval)
{
int c, vl, vr;
- vl = exp(mayeval);
+ vl = exponent(mayeval);
while ((c = skipws()) == '*' || c == '/' || c == '%') {
- vr = exp(mayeval);
+ vr = exponent(mayeval);
switch (c) {
case '*':
@@ -426,10 +425,10 @@ term(int mayeval)
}
/*
- * exp : unary { "**" exp }
+ * exponent : unary { "**" exponent }
*/
static int
-exp(int mayeval)
+exponent(int mayeval)
{
int c, vl, vr, n;
@@ -562,7 +561,7 @@ constant(int mayeval)
* num : digit | num digit
*/
static int
-num(int mayeval)
+num(int mayeval __unused)
{
int rval, c, base;
int ndig;
OpenPOWER on IntegriCloud