Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/bin Fixed unused warnings.



details:   https://anonhg.NetBSD.org/src/rev/7465cdcec7a0
branches:  trunk
changeset: 790624:7465cdcec7a0
user:      christos <christos%NetBSD.org@localhost>
date:      Fri Oct 18 19:53:34 2013 +0000

description:
Fixed unused warnings.

diffstat:

 bin/ksh/c_sh.c   |  6 ++++--
 bin/ksh/eval.c   |  6 ++----
 bin/ksh/expand.h |  5 +++--
 bin/pax/tables.c |  6 ++++--
 4 files changed, 13 insertions(+), 10 deletions(-)

diffs (110 lines):

diff -r cd08f891138f -r 7465cdcec7a0 bin/ksh/c_sh.c
--- a/bin/ksh/c_sh.c    Fri Oct 18 19:48:36 2013 +0000
+++ b/bin/ksh/c_sh.c    Fri Oct 18 19:53:34 2013 +0000
@@ -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 @@
                                        shprintf(" %s", p->name);
                        shprintf(newline);
                }
+#else
+               __USE(anydfl);
 #endif
                return 0;
        }
diff -r cd08f891138f -r 7465cdcec7a0 bin/ksh/eval.c
--- a/bin/ksh/eval.c    Fri Oct 18 19:48:36 2013 +0000
+++ b/bin/ksh/eval.c    Fri Oct 18 19:53:34 2013 +0000
@@ -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 @@
                /* 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 */
diff -r cd08f891138f -r 7465cdcec7a0 bin/ksh/expand.h
--- a/bin/ksh/expand.h  Fri Oct 18 19:48:36 2013 +0000
+++ b/bin/ksh/expand.h  Fri Oct 18 19:53:34 2013 +0000
@@ -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 @@
                        (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 */
diff -r cd08f891138f -r 7465cdcec7a0 bin/pax/tables.c
--- a/bin/pax/tables.c  Fri Oct 18 19:48:36 2013 +0000
+++ b/bin/pax/tables.c  Fri Oct 18 19:53:34 2013 +0000
@@ -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 @@
                        return;
                }
                name = rp;
+#ifdef DIRS_USE_FILE
                nlen = strlen(name);
+#endif
        }
 
 #ifdef DIRS_USE_FILE



Home | Main Index | Thread Index | Old Index