Module Name: src
Committed By: christos
Date: Fri Oct 18 19:53:34 UTC 2013
Modified Files:
src/bin/ksh: c_sh.c eval.c expand.h
src/bin/pax: tables.c
Log Message:
Fixed unused warnings.
To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/bin/ksh/c_sh.c src/bin/ksh/eval.c
cvs rdiff -u -r1.4 -r1.5 src/bin/ksh/expand.h
cvs rdiff -u -r1.30 -r1.31 src/bin/pax/tables.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/bin/ksh/c_sh.c
diff -u src/bin/ksh/c_sh.c:1.14 src/bin/ksh/c_sh.c:1.15
--- src/bin/ksh/c_sh.c:1.14 Wed Aug 31 12:24:54 2011
+++ src/bin/ksh/c_sh.c Fri Oct 18 15:53:34 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: c_sh.c,v 1.14 2011/08/31 16:24:54 plunky Exp $ */
+/* $NetBSD: c_sh.c,v 1.15 2013/10/18 19:53:34 christos Exp $ */
/*
* built-in Bourne commands
@@ -6,7 +6,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: c_sh.c,v 1.14 2011/08/31 16:24:54 plunky Exp $");
+__RCSID("$NetBSD: c_sh.c,v 1.15 2013/10/18 19:53:34 christos Exp $");
#endif
@@ -506,6 +506,8 @@ c_trap(wp)
shprintf(" %s", p->name);
shprintf(newline);
}
+#else
+ __USE(anydfl);
#endif
return 0;
}
Index: src/bin/ksh/eval.c
diff -u src/bin/ksh/eval.c:1.14 src/bin/ksh/eval.c:1.15
--- src/bin/ksh/eval.c:1.14 Sun Aug 21 17:24:34 2011
+++ src/bin/ksh/eval.c Fri Oct 18 15:53:34 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: eval.c,v 1.14 2011/08/21 21:24:34 dholland Exp $ */
+/* $NetBSD: eval.c,v 1.15 2013/10/18 19:53:34 christos Exp $ */
/*
* Expansion - quoting, separation, substitution, globbing
@@ -6,7 +6,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: eval.c,v 1.14 2011/08/21 21:24:34 dholland Exp $");
+__RCSID("$NetBSD: eval.c,v 1.15 2013/10/18 19:53:34 christos Exp $");
#endif
#include <stdint.h>
@@ -729,13 +729,11 @@ varsub(xp, sp, word, stypep, slenp)
/* Check for size of array */
if ((p=strchr(sp,'[')) && (p[1]=='*'||p[1]=='@') && p[2]==']') {
int n = 0;
- int max = 0;
vp = global(arrayname(sp));
if (vp->flag & (ISSET|ARRAY))
zero_ok = 1;
for (; vp; vp = vp->u.array)
if (vp->flag & ISSET) {
- max = vp->index + 1;
n++;
}
c = n; /* ksh88/ksh93 go for number, not max index */
Index: src/bin/ksh/expand.h
diff -u src/bin/ksh/expand.h:1.4 src/bin/ksh/expand.h:1.5
--- src/bin/ksh/expand.h:1.4 Thu Jul 26 11:05:07 2001
+++ src/bin/ksh/expand.h Fri Oct 18 15:53:34 2013
@@ -1,9 +1,9 @@
-/* $NetBSD: expand.h,v 1.4 2001/07/26 15:05:07 wiz Exp $ */
+/* $NetBSD: expand.h,v 1.5 2013/10/18 19:53:34 christos Exp $ */
/*
* Expanding strings
*/
-/* $Id: expand.h,v 1.4 2001/07/26 15:05:07 wiz Exp $ */
+/* $Id: expand.h,v 1.5 2013/10/18 19:53:34 christos Exp $ */
#define X_EXTRA 8 /* this many extra bytes in X string */
@@ -40,6 +40,7 @@ typedef char * XStringP;
(xs).beg = alloc((xs).len + X_EXTRA, (xs).areap); \
(xs).end = (xs).beg + (xs).len; \
xp = (xs).beg; \
+ __USE(xp); \
} while (0)
/* stuff char into string */
Index: src/bin/pax/tables.c
diff -u src/bin/pax/tables.c:1.30 src/bin/pax/tables.c:1.31
--- src/bin/pax/tables.c:1.30 Wed Jan 9 23:24:51 2008
+++ src/bin/pax/tables.c Fri Oct 18 15:53:34 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: tables.c,v 1.30 2008/01/10 04:24:51 tls Exp $ */
+/* $NetBSD: tables.c,v 1.31 2013/10/18 19:53:34 christos Exp $ */
/*-
* Copyright (c) 1992 Keith Muller.
@@ -42,7 +42,7 @@
#if 0
static char sccsid[] = "@(#)tables.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: tables.c,v 1.30 2008/01/10 04:24:51 tls Exp $");
+__RCSID("$NetBSD: tables.c,v 1.31 2013/10/18 19:53:34 christos Exp $");
#endif
#endif /* not lint */
@@ -1155,7 +1155,9 @@ add_dir(char *name, int nlen, struct sta
return;
}
name = rp;
+#ifdef DIRS_USE_FILE
nlen = strlen(name);
+#endif
}
#ifdef DIRS_USE_FILE