Source-Changes-HG archive

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

[src/trunk]: src/usr.bin fix unused variable warnings



details:   https://anonhg.NetBSD.org/src/rev/7f7521a146d8
branches:  trunk
changeset: 790643:7f7521a146d8
user:      christos <christos%NetBSD.org@localhost>
date:      Fri Oct 18 20:47:06 2013 +0000

description:
fix unused variable warnings

diffstat:

 usr.bin/audio/common/wav.c |   9 +++------
 usr.bin/cksum/cksum.c      |   9 ++++-----
 usr.bin/deroff/deroff.c    |   6 +++---
 usr.bin/fgen/fgen.l        |   7 +++----
 usr.bin/lock/lock.c        |  11 +++++++----
 usr.bin/login/login_pam.c  |   9 +++------
 usr.bin/mail/mime_attach.c |   7 ++-----
 usr.bin/make/parse.c       |   9 ++++-----
 usr.bin/msgs/msgs.c        |  13 +++++++------
 usr.bin/sdpquery/print.c   |   8 ++++----
 usr.bin/sort/init.c        |   7 +++----
 usr.bin/systat/bufcache.c  |   8 +++-----
 usr.bin/tail/forward.c     |  10 ++--------
 13 files changed, 48 insertions(+), 65 deletions(-)

diffs (truncated from 503 to 300 lines):

diff -r d066f2c1943e -r 7f7521a146d8 usr.bin/audio/common/wav.c
--- a/usr.bin/audio/common/wav.c        Fri Oct 18 20:46:09 2013 +0000
+++ b/usr.bin/audio/common/wav.c        Fri Oct 18 20:47:06 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: wav.c,v 1.11 2013/08/30 20:57:26 mrg Exp $     */
+/*     $NetBSD: wav.c,v 1.12 2013/10/18 20:47:06 christos Exp $        */
 
 /*
  * Copyright (c) 2002, 2009 Matthew R. Green
@@ -33,7 +33,7 @@
 #include <sys/cdefs.h>
 
 #ifndef lint
-__RCSID("$NetBSD: wav.c,v 1.11 2013/08/30 20:57:26 mrg Exp $");
+__RCSID("$NetBSD: wav.c,v 1.12 2013/10/18 20:47:06 christos Exp $");
 #endif
 
 
@@ -261,7 +261,7 @@
            *fact = "fact",
            *data = "data";
        u_int32_t filelen, fmtsz, sps, abps, factsz = 4, nsample, datalen;
-       u_int16_t fmttag, nchan, align, bps, extln = 0;
+       u_int16_t fmttag, nchan, align, extln = 0;
 
        if (wi->header_info)
                warnx("header information not supported for WAV");
@@ -269,13 +269,10 @@
 
        switch (wi->precision) {
        case 8:
-               bps = 8;
                break;
        case 16:
-               bps = 16;
                break;
        case 32:
-               bps = 32;
                break;
        default:
                {
diff -r d066f2c1943e -r 7f7521a146d8 usr.bin/cksum/cksum.c
--- a/usr.bin/cksum/cksum.c     Fri Oct 18 20:46:09 2013 +0000
+++ b/usr.bin/cksum/cksum.c     Fri Oct 18 20:47:06 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cksum.c,v 1.45 2011/08/29 14:12:29 joerg Exp $ */
+/*     $NetBSD: cksum.c,v 1.46 2013/10/18 20:47:06 christos Exp $      */
 
 /*-
  * Copyright (c) 1991, 1993
@@ -81,7 +81,7 @@
 #if 0
 static char sccsid[] = "@(#)cksum.c    8.2 (Berkeley) 4/28/95";
 #endif
-__RCSID("$NetBSD: cksum.c,v 1.45 2011/08/29 14:12:29 joerg Exp $");
+__RCSID("$NetBSD: cksum.c,v 1.46 2013/10/18 20:47:06 christos Exp $");
 #endif /* not lint */
 
 #include <sys/types.h>
@@ -149,7 +149,7 @@
 int
 main(int argc, char **argv)
 {
-       int ch, fd, rval, dosum, pflag, nohashstdin;
+       int ch, fd, rval, pflag, nohashstdin;
        u_int32_t val;
        off_t len;
        char *fn;
@@ -161,7 +161,7 @@
 
        cfncn = NULL;
        pfncn = NULL;
-       dosum = pflag = nohashstdin = 0;
+       pflag = nohashstdin = 0;
        normal = 0;
        check_warn = 0;
        do_check = 0;
@@ -178,7 +178,6 @@
                hash = NULL;
 
                if (!strcmp(progname, "sum")) {
-                       dosum = 1;
                        cfncn = csum1;
                        pfncn = psum1;
                } else {
diff -r d066f2c1943e -r 7f7521a146d8 usr.bin/deroff/deroff.c
--- a/usr.bin/deroff/deroff.c   Fri Oct 18 20:46:09 2013 +0000
+++ b/usr.bin/deroff/deroff.c   Fri Oct 18 20:47:06 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: deroff.c,v 1.10 2013/09/13 20:51:20 joerg Exp $        */
+/*     $NetBSD: deroff.c,v 1.11 2013/10/18 20:47:06 christos Exp $     */
 
 /* taken from: OpenBSD: deroff.c,v 1.6 2004/06/02 14:58:46 tom Exp */
 
@@ -65,7 +65,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: deroff.c,v 1.10 2013/09/13 20:51:20 joerg Exp $");
+__RCSID("$NetBSD: deroff.c,v 1.11 2013/10/18 20:47:06 christos Exp $");
 
 #include <err.h>
 #include <limits.h>
@@ -166,7 +166,7 @@
 static int     argconcat = 0;  /* concat arguments together (-me only) */
 
 #define        tomac(c1, c2)           ((((c1) & 0xFF) << 8) | ((c2) & 0xFF))
-#define        frommac(src, c1, c2)    (((c1)=((src)>>8)&0xFF),((c2) =(src)&0xFF))
+#define        frommac(src, c1, c2)    (((c1)=((src)>>8)&0xFF),((c2) =(src)&0xFF), __USE(c1), __USE(c2))
 
 struct mactab {
        int     condition;
diff -r d066f2c1943e -r 7f7521a146d8 usr.bin/fgen/fgen.l
--- a/usr.bin/fgen/fgen.l       Fri Oct 18 20:46:09 2013 +0000
+++ b/usr.bin/fgen/fgen.l       Fri Oct 18 20:47:06 2013 +0000
@@ -1,5 +1,5 @@
 %{
-/*     $NetBSD: fgen.l,v 1.35 2011/09/01 13:44:25 joerg Exp $  */
+/*     $NetBSD: fgen.l,v 1.36 2013/10/18 20:47:06 christos Exp $       */
 /* FLEX input for FORTH input file scanner */
 /*  
  * Copyright (c) 1998 Eduardo Horvath.
@@ -42,7 +42,7 @@
 #endif
 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: fgen.l,v 1.35 2011/09/01 13:44:25 joerg Exp $");
+__RCSID("$NetBSD: fgen.l,v 1.36 2013/10/18 20:47:06 christos Exp $");
 #endif
 
 %}
@@ -996,7 +996,7 @@
 int
 main(int argc, char *argv[])
 {
-       int bflag, ch;
+       int ch;
        FILE *inf;
        struct fcode_header *fheader;
        YY_BUFFER_STATE inbuf;
@@ -1006,7 +1006,6 @@
        outf = 1; /* stdout */
        myname = argv[0];
 
-       bflag = 0;
        while ((ch = getopt(argc, argv, "d:o:")) != -1)
                switch(ch) {
                case 'd':
diff -r d066f2c1943e -r 7f7521a146d8 usr.bin/lock/lock.c
--- a/usr.bin/lock/lock.c       Fri Oct 18 20:46:09 2013 +0000
+++ b/usr.bin/lock/lock.c       Fri Oct 18 20:47:06 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: lock.c,v 1.32 2012/03/20 20:34:58 matt Exp $   */
+/*     $NetBSD: lock.c,v 1.33 2013/10/18 20:47:06 christos Exp $       */
 
 /*
  * Copyright (c) 1980, 1987, 1993
@@ -42,7 +42,7 @@
 #if 0
 static char sccsid[] = "@(#)lock.c     8.1 (Berkeley) 6/6/93";
 #endif
-__RCSID("$NetBSD: lock.c,v 1.32 2012/03/20 20:34:58 matt Exp $");
+__RCSID("$NetBSD: lock.c,v 1.33 2013/10/18 20:47:06 christos Exp $");
 #endif /* not lint */
 
 /*
@@ -105,7 +105,7 @@
        time_t curtime;
        int ch, usemine;
        long sectimeout;
-       char *ap, *mypw, *ttynam;
+       char *ap, *ttynam;
        const char *tzn;
        uid_t uid = getuid();
        char hostname[MAXHOSTNAMELEN + 1], s[BUFSIZ], s1[BUFSIZ];
@@ -113,6 +113,8 @@
        pam_handle_t *pamh = NULL;
        static const struct pam_conv pamc = { &openpam_ttyconv, NULL };
        int pam_err;
+#else
+       char *mypw = NULL;
 #endif
 
        if ((pw = getpwuid(getuid())) == NULL)
@@ -120,7 +122,6 @@
 
        notimeout = 0;
        sectimeout = TIMEOUT;
-       mypw = NULL;
        usemine = 0;
 
        while ((ch = getopt(argc, argv, "npt:")) != -1)
@@ -210,7 +211,9 @@
                        exit(1);
                }
                s[0] = '\0';
+#ifndef USE_PAM
                mypw = s1;
+#endif
        }
 #ifdef USE_PAM
        if (usemine) {
diff -r d066f2c1943e -r 7f7521a146d8 usr.bin/login/login_pam.c
--- a/usr.bin/login/login_pam.c Fri Oct 18 20:46:09 2013 +0000
+++ b/usr.bin/login/login_pam.c Fri Oct 18 20:47:06 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: login_pam.c,v 1.22 2012/04/23 09:27:36 martin Exp $       */
+/*     $NetBSD: login_pam.c,v 1.23 2013/10/18 20:47:06 christos Exp $       */
 
 /*-
  * Copyright (c) 1980, 1987, 1988, 1991, 1993, 1994
@@ -39,7 +39,7 @@
 #if 0
 static char sccsid[] = "@(#)login.c    8.4 (Berkeley) 4/2/94";
 #endif
-__RCSID("$NetBSD: login_pam.c,v 1.22 2012/04/23 09:27:36 martin Exp $");
+__RCSID("$NetBSD: login_pam.c,v 1.23 2013/10/18 20:47:06 christos Exp $");
 #endif /* not lint */
 
 /*
@@ -107,10 +107,9 @@
        uid_t uid, saved_uid;
        gid_t saved_gid, saved_gids[NGROUPS_MAX];
        int nsaved_gids;
-       char *domain, *p, *ttyn, *pwprompt;
+       char *domain, *p, *ttyn;
        char tbuf[MAXPATHLEN + 2], tname[sizeof(_PATH_TTY) + 10];
        char localhost[MAXHOSTNAMELEN + 1];
-       int need_chpass, require_chpass;
        int login_retries = DEFAULT_RETRIES, 
            login_backoff = DEFAULT_BACKOFF;
        char *shell = NULL;
@@ -126,9 +125,7 @@
        char **pamenv;
 
        tbuf[0] = '\0';
-       pwprompt = NULL;
        nested = NULL;
-       need_chpass = require_chpass = 0;
 
        oabrt = signal(SIGABRT, SIG_IGN);
        oalrm = signal(SIGALRM, timedout);
diff -r d066f2c1943e -r 7f7521a146d8 usr.bin/mail/mime_attach.c
--- a/usr.bin/mail/mime_attach.c        Fri Oct 18 20:46:09 2013 +0000
+++ b/usr.bin/mail/mime_attach.c        Fri Oct 18 20:47:06 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mime_attach.c,v 1.16 2013/01/04 01:54:55 christos Exp $        */
+/*     $NetBSD: mime_attach.c,v 1.17 2013/10/18 20:47:06 christos Exp $        */
 
 /*-
  * Copyright (c) 2006 The NetBSD Foundation, Inc.
@@ -33,7 +33,7 @@
 
 #include <sys/cdefs.h>
 #ifndef __lint__
-__RCSID("$NetBSD: mime_attach.c,v 1.16 2013/01/04 01:54:55 christos Exp $");
+__RCSID("$NetBSD: mime_attach.c,v 1.17 2013/10/18 20:47:06 christos Exp $");
 #endif /* not __lint__ */
 
 #include <assert.h>
@@ -230,14 +230,11 @@
 #define MAILMSG_8BIT   0x4
 #define MAILMSG_LONGL  0x8
        int c, lastc, state;
-       int ctrlchar, endwhite;
        size_t curlen, maxlen;
 
        state = MAILMSG_CLEAN;
        curlen = 0;
        maxlen = line_limit();
-       ctrlchar = 0;
-       endwhite = 0;
        lastc = EOF;
        while ((c = fgetc(fh)) != EOF) {
                curlen++;
diff -r d066f2c1943e -r 7f7521a146d8 usr.bin/make/parse.c
--- a/usr.bin/make/parse.c      Fri Oct 18 20:46:09 2013 +0000
+++ b/usr.bin/make/parse.c      Fri Oct 18 20:47:06 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: parse.c,v 1.191 2013/08/28 21:56:49 sjg Exp $  */
+/*     $NetBSD: parse.c,v 1.192 2013/10/18 20:47:06 christos Exp $     */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: parse.c,v 1.191 2013/08/28 21:56:49 sjg Exp $";
+static char rcsid[] = "$NetBSD: parse.c,v 1.192 2013/10/18 20:47:06 christos Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)parse.c    8.3 (Berkeley) 3/19/94";
 #else
-__RCSID("$NetBSD: parse.c,v 1.191 2013/08/28 21:56:49 sjg Exp $");
+__RCSID("$NetBSD: parse.c,v 1.192 2013/10/18 20:47:06 christos Exp $");
 #endif
 #endif /* not lint */



Home | Main Index | Thread Index | Old Index