usr.bin/mg: fix -Wunused-but-set-variable warnings

* strtonum() is only called to verify that a string is numerical, the
  return value is unused.
* inlist is no longer used after the code was refactored.

OK?
 
M  usr.bin/mg/interpreter.c

diff 6e5c342a53c05496c18849837c67b7dc05ce3792 
5ce17aab12dafb0a17452c4e0e86b29d89d83d13
blob - 320b4089849fb28a0b1ee4ff0db2542da902d56e
blob + f3a4310dfe01138c77e624877eefa92d29feb039
--- usr.bin/mg/interpreter.c
+++ usr.bin/mg/interpreter.c
@@ -492,9 +492,8 @@ multiarg(char *cmdp, char *argbuf, int numparams)
 
                                if (!doregex(regs, argp)) {
                                const char *errstr;
-                               int iters;
 
-                               iters = strtonum(argp, 0, INT_MAX, &errstr);
+                               strtonum(argp, 0, INT_MAX, &errstr);
                                if (errstr != NULL)
                                        return (dobeep_msgs("Var not found:",
                                            argp));
@@ -628,7 +627,7 @@ expandvals(char *cmdp, char *valp, char *bp)
        char    *argp, *endp, *p, *v, *s = " ";
        char    *regs;
        int      spc, cnt;
-       int      inlist, sizof, fin, inquote;
+       int      sizof, fin, inquote;
 
        /* now find the first argument */
        p = skipwhite(valp);
@@ -637,7 +636,7 @@ expandvals(char *cmdp, char *valp, char *bp)
                return (dobeep_msg("strlcpy error"));
        argp = argbuf;
        spc = 1; /* initially fake a space so we find first argument */
-       inlist = fin = inquote = cnt = spc = 0;
+       fin = inquote = cnt = spc = 0;
 
        for (p = argbuf; *p != '\0'; p++) {
                if (*(p + 1) == '\0')
@@ -693,9 +692,8 @@ expandvals(char *cmdp, char *valp, char *bp)
                                continue;
                        } else {
                                const char *errstr;
-                               int iters;
 
-                               iters = strtonum(argp, 0, INT_MAX, &errstr);
+                               strtonum(argp, 0, INT_MAX, &errstr);
                                if (errstr != NULL)
                                        return (dobeep_msgs("Var not found:",
                                            argp));

-- 
Christian "naddy" Weisgerber                          [email protected]

Reply via email to