1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-10-27 04:40:59 +01:00

29491: remove some variables set but not used

This commit is contained in:
Peter Stephenson 2011-06-19 16:26:10 +00:00
parent c31caeb086
commit 962624e8c3
12 changed files with 34 additions and 38 deletions

View file

@ -1,5 +1,10 @@
2011-06-19 Peter Stephenson <p.w.stephenson@ntlworld.com>
* 29491: Src/glob.c, Src/lex.c, Src/math.c, Src/params.c,
Src/parse.c, Src/utils.c, Src/Modules/db_gdbm.c,
Src/Zle/compcore.c, Src/Zle/complist.c, Src/Zle/zle_refresh.c,
Src/Zle/zle_tricky.c: remove some variables set but not used.
* 29490: Src/Builtins/rlimits.awk, Src/Builtins/rlimits.c,
Src/Builtins/rlimits.mdd: add RLIMIT_RTTIME.
@ -15011,5 +15016,5 @@
*****************************************************
* This is used by the shell to define $ZSH_PATCHLEVEL
* $Revision: 1.5373 $
* $Revision: 1.5374 $
*****************************************************

View file

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

View file

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

View file

@ -1369,8 +1369,6 @@ compprintlist(int showall)
}
#endif
if ((e = g->expls)) {
int l;
if (!lastused && lasttype == 1) {
e = lastexpl;
ml = lastml;
@ -1393,7 +1391,7 @@ compprintlist(int showall)
}
if (mlbeg < 0 && mfirstl < 0)
mfirstl = ml;
l = compprintfmt((*e)->str,
(void)compprintfmt((*e)->str,
((*e)->always ? -1 : (*e)->count),
dolist(ml), 1, ml, &stop);
if (mselect >= 0) {

View file

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

View file

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

View file

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

View file

@ -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",

View file

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

View file

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

View file

@ -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();

View file

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