about summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
Diffstat (limited to 'Src')
-rw-r--r--Src/Modules/db_gdbm.c10
-rw-r--r--Src/Zle/compcore.c6
-rw-r--r--Src/Zle/complist.c8
-rw-r--r--Src/Zle/zle_refresh.c2
-rw-r--r--Src/Zle/zle_tricky.c4
-rw-r--r--Src/glob.c3
-rw-r--r--Src/lex.c9
-rw-r--r--Src/math.c2
-rw-r--r--Src/params.c13
-rw-r--r--Src/parse.c4
-rw-r--r--Src/utils.c4
11 files changed, 28 insertions, 37 deletions
diff --git a/Src/Modules/db_gdbm.c b/Src/Modules/db_gdbm.c
index bdbbe19d8..9a2a7a5b9 100644
--- a/Src/Modules/db_gdbm.c
+++ b/Src/Modules/db_gdbm.c
@@ -39,7 +39,9 @@
 
 #include <gdbm.h>
 
+#if 0 /* what is this for? */
 static char *backtype = "db/gdbm";
+#endif
 
 static const struct gsu_scalar gdbm_gsu =
 { gdbmgetfn, gdbmsetfn, gdbmunsetfn };
@@ -138,7 +140,6 @@ static void
 gdbmsetfn(Param pm, char *val)
 {
     datum key, content;
-    int ret;
     GDBM_FILE dbf;
 
     key.dptr = pm->node.nam;
@@ -147,7 +148,7 @@ gdbmsetfn(Param pm, char *val)
     content.dsize = strlen(content.dptr) + 1;
 
     dbf = (GDBM_FILE)(pm->u.hash->tmpdata);
-    ret = gdbm_store(dbf, key, content, GDBM_REPLACE);
+    (void)gdbm_store(dbf, key, content, GDBM_REPLACE);
 }
 
 /**/
@@ -155,14 +156,13 @@ static void
 gdbmunsetfn(Param pm, int um)
 {
     datum key;
-    int ret;
     GDBM_FILE dbf;
 
     key.dptr = pm->node.nam;
     key.dsize = strlen(key.dptr) + 1;
 
     dbf = (GDBM_FILE)(pm->u.hash->tmpdata);
-    ret = gdbm_delete(dbf, key);
+    (void)gdbm_delete(dbf, key);
 }
 
 /**/
@@ -171,12 +171,10 @@ getgdbmnode(HashTable ht, const char *name)
 {
     int len;
     char *nameu;
-    datum key;
     Param pm = NULL;
 
     nameu = dupstring(name);
     unmetafy(nameu, &len);
-    key.dptr = nameu;
 
     pm = (Param) hcalloc(sizeof(struct param));
     pm->node.nam = nameu;
diff --git a/Src/Zle/compcore.c b/Src/Zle/compcore.c
index 0a1a97c3d..2e2749835 100644
--- a/Src/Zle/compcore.c
+++ b/Src/Zle/compcore.c
@@ -1477,7 +1477,7 @@ set_comp_sep(void)
      *      when stripping single quotes: 1 for RCQUOTES, 3 otherwise
      *      (because we leave a "'" in the final string).
      */
-    int dq = 0, odq, sq = 0, osq, qttype, sqq = 0, lsq = 0, qa = 0;
+    int dq = 0, odq, sq = 0, qttype, sqq = 0, lsq = 0, qa = 0;
     /* dolq: like sq and dq but for dollars quoting. */
     int dolq = 0;
     /* remember some global variable values (except lp is local) */
@@ -1582,7 +1582,6 @@ set_comp_sep(void)
 
     }
     odq = dq;
-    osq = sq;
     inpush(dupstrspace(tmp), 0, NULL);
     zlemetaline = tmp;
     /*
@@ -3306,7 +3305,7 @@ dupmatch(Cmatch m, int nbeg, int nend)
 mod_export int
 permmatches(int last)
 {
-    Cmgroup g = amatches, n, opm;
+    Cmgroup g = amatches, n;
     Cmatch *p, *q;
     Cexpl *ep, *eq, e, o;
     LinkList mlist;
@@ -3320,7 +3319,6 @@ permmatches(int last)
     }
     newmatches = fi = 0;
 
-    opm = pmatches;
     pmatches = lmatches = NULL;
     nmatches = smatches = diffmatches = 0;
 
diff --git a/Src/Zle/complist.c b/Src/Zle/complist.c
index fdca7a99f..c9c0c2dd4 100644
--- a/Src/Zle/complist.c
+++ b/Src/Zle/complist.c
@@ -1369,8 +1369,6 @@ compprintlist(int showall)
 	}
 #endif
 	if ((e = g->expls)) {
-	    int l;
-
 	    if (!lastused && lasttype == 1) {
 		e = lastexpl;
 		ml = lastml;
@@ -1393,9 +1391,9 @@ compprintlist(int showall)
 		    }
 		    if (mlbeg < 0 && mfirstl < 0)
 			mfirstl = ml;
-		    l = compprintfmt((*e)->str,
-                                     ((*e)->always ? -1 : (*e)->count),
-                                     dolist(ml), 1, ml, &stop);
+		    (void)compprintfmt((*e)->str,
+				       ((*e)->always ? -1 : (*e)->count),
+				       dolist(ml), 1, ml, &stop);
 		    if (mselect >= 0) {
 			int mm = (mcols * ml), i;
 
diff --git a/Src/Zle/zle_refresh.c b/Src/Zle/zle_refresh.c
index 797f86251..52797831c 100644
--- a/Src/Zle/zle_refresh.c
+++ b/Src/Zle/zle_refresh.c
@@ -2418,8 +2418,6 @@ singlerefresh(ZLE_STRING_T tmpline, int tmpll, int tmpcs)
 	all_atr_off = TXT_ATTR_OFF_FROM_ON(all_atr_on);
 
 	if (tmpline[t0] == ZWC('\t')) {
-	    REFRESH_ELEMENT sp = zr_sp;
-	    sp.atr = base_atr_on;
 	    for (*vp++ = zr_sp; (vp - vbuf) & 7; )
 		*vp++ = zr_sp;
 	    vp[-1].atr |= base_atr_off;
diff --git a/Src/Zle/zle_tricky.c b/Src/Zle/zle_tricky.c
index 8f7c2aac1..80a495317 100644
--- a/Src/Zle/zle_tricky.c
+++ b/Src/Zle/zle_tricky.c
@@ -529,7 +529,7 @@ parambeg(char *s)
 	 * or $'...').
 	 */
 	char *b = p + 1, *e = b;
-	int n = 0, br = 1, nest = 0;
+	int n = 0, br = 1;
 
 	if (*b == Inbrace) {
 	    char *tb = b;
@@ -543,8 +543,6 @@ parambeg(char *s)
 	    n = skipparens(Inpar, Outpar, &b);
 
 	    for (tb = p - 1; tb > s && *tb != Outbrace && *tb != Inbrace; tb--);
-	    if (tb > s && *tb == Inbrace && (tb[-1] == String || *tb == Qstring))
-		nest = 1;
 	}
 
 	/* Ignore the stuff before the parameter name. */
diff --git a/Src/glob.c b/Src/glob.c
index bfc7f0416..cf4a5a537 100644
--- a/Src/glob.c
+++ b/Src/glob.c
@@ -1801,7 +1801,7 @@ zglob(LinkList list, LinkNode np, int nountok)
 		    Eprog prog;
 
 		    if ((prog = parse_string(sortp->exec, 0))) {
-			int ef = errflag, lv = lastval, ret;
+			int ef = errflag, lv = lastval;
 
 			/* Parsed OK, execute for each name */
 			for (tmpptr = matchbuf; tmpptr < matchptr; tmpptr++) {
@@ -1814,7 +1814,6 @@ zglob(LinkList list, LinkNode np, int nountok)
 				tmpptr->sortstrs[iexec] = tmpptr->name;
 			}
 
-			ret = lastval;
 			errflag = ef;
 			lastval = lv;
 		    } else {
diff --git a/Src/lex.c b/Src/lex.c
index fdd05efff..51aaa76ef 100644
--- a/Src/lex.c
+++ b/Src/lex.c
@@ -1698,7 +1698,7 @@ parse_subscript(char *s, int sub, int endchar)
 mod_export int
 parse_subst_string(char *s)
 {
-    int c, l = strlen(s), err, olen, lexstop_ret;
+    int c, l = strlen(s), err;
     char *ptr;
 
     if (!*s || !strcmp(s, nulstring))
@@ -1711,13 +1711,11 @@ parse_subst_string(char *s)
     bptr = tokstr = s;
     bsiz = l + 1;
     c = hgetc();
-    lexstop_ret = lexstop;
     c = gettokstr(c, 1);
     err = errflag;
     strinend();
     inpop();
     DPUTS(cmdsp, "BUG: parse_subst_string: cmdstack not empty.");
-    olen = len;
     lexrestore();
     errflag = err;
     if (c == LEXERR) {
@@ -1726,8 +1724,9 @@ parse_subst_string(char *s)
     }
 #ifdef DEBUG
     /*
-     * Historical note: we used to check here for olen == l, but
-     * that's not necessarily the case if we stripped an RCQUOTE.
+     * Historical note: we used to check here for olen (the value of len
+     * before lexrestore()) == l, but that's not necessarily the case if
+     * we stripped an RCQUOTE.
      */
     if (c != STRING || (errflag && !noerrs)) {
 	fprintf(stderr, "Oops. Bug in parse_subst_string: %s\n",
diff --git a/Src/math.c b/Src/math.c
index beef74525..cca521098 100644
--- a/Src/math.c
+++ b/Src/math.c
@@ -969,7 +969,6 @@ void
 op(int what)
 {
     mnumber a, b, c, *spval;
-    char *lv;
     int tp = type[what];
 
     if (errflag)
@@ -1155,7 +1154,6 @@ op(int what)
 	}
 	if (tp & (OP_E2|OP_E2IO)) {
 	    struct mathvalue *mvp = stack + sp + 1;
-	    lv = stack[sp+1].lval;
 	    c = setmathvar(mvp, c);
 	    push(c, mvp->lval, 0);
 	} else
diff --git a/Src/params.c b/Src/params.c
index a59c51767..8a56766f8 100644
--- a/Src/params.c
+++ b/Src/params.c
@@ -655,7 +655,10 @@ createparamtable(void)
     char **new_environ;
     int  envsize;
 #endif
-    char **envp, **envp2, **sigptr, **t;
+#ifndef USE_SET_UNSET_ENV
+    char **envp;
+#endif
+    char **envp2, **sigptr, **t;
     char buf[50], *str, *iname, *ivalue, *hostnam;
     int  oae = opts[ALLEXPORT];
 #ifdef HAVE_UNAME
@@ -721,7 +724,11 @@ createparamtable(void)
     /* Now incorporate environment variables we are inheriting *
      * into the parameter hash table. Copy them into dynamic   *
      * memory so that we can free them if needed               */
-    for (envp = envp2 = environ; *envp2; envp2++) {
+    for (
+#ifndef USE_SET_UNSET_ENV
+	envp = 
+#endif
+	    envp2 = environ; *envp2; envp2++) {
 	if (split_env_string(*envp2, &iname, &ivalue)) {
 	    if (!idigit(*iname) && isident(iname) && !strchr(iname, '[')) {
 		if ((!(pm = (Param) paramtab->getnode(paramtab, iname)) ||
@@ -993,9 +1000,7 @@ mod_export int
 isident(char *s)
 {
     char *ss;
-    int ne;
 
-    ne = noeval;		/* save the current value of noeval     */
     if (!*s)			/* empty string is definitely not valid */
 	return 0;
 
diff --git a/Src/parse.c b/Src/parse.c
index e59a882ca..4720dc3cf 100644
--- a/Src/parse.c
+++ b/Src/parse.c
@@ -1709,11 +1709,11 @@ par_simple(int *complex, int nr)
 		}
 		zshlex();
 	    } else {
-		int ll, sl, pl, c = 0;
+		int ll, sl, c = 0;
 
 		ll = ecadd(0);
 		sl = ecadd(0);
-		pl = ecadd(WCB_PIPE(WC_PIPE_END, 0));
+		(void)ecadd(WCB_PIPE(WC_PIPE_END, 0));
 
 		if (!par_cmd(&c)) {
 		    cmdpop();
diff --git a/Src/utils.c b/Src/utils.c
index 066710e1e..d50311637 100644
--- a/Src/utils.c
+++ b/Src/utils.c
@@ -4689,7 +4689,7 @@ addunprintable(char *v, const char *u, const char *uend)
 mod_export char *
 quotestring(const char *s, char **e, int instring)
 {
-    const char *u, *tt;
+    const char *u;
     char *v;
     int alloclen;
     char *buf;
@@ -4740,7 +4740,7 @@ quotestring(const char *s, char **e, int instring)
 	break;
     }
 
-    tt = quotestart = v = buf = zshcalloc(alloclen);
+    quotestart = v = buf = zshcalloc(alloclen);
 
     DPUTS(instring < QT_BACKSLASH || instring == QT_BACKTICK ||
 	  instring > QT_SINGLE_OPTIONAL,