Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/tests fix unused variable warnings
details: https://anonhg.NetBSD.org/src/rev/76019bc68e9c
branches: trunk
changeset: 790707:76019bc68e9c
user: christos <christos%NetBSD.org@localhost>
date: Sat Oct 19 17:45:00 2013 +0000
description:
fix unused variable warnings
diffstat:
tests/fs/nfs/nfsservice/mountd.c | 6 ++----
tests/fs/nfs/nfsservice/nfsd.c | 13 ++++++-------
tests/fs/nfs/nfsservice/rpcbind/pmap_svc.c | 5 ++---
tests/fs/nfs/nfsservice/rpcbind/rpcbind.c | 8 ++++----
tests/fs/puffs/h_dtfs/dtfs_subr.c | 5 ++---
tests/fs/puffs/h_dtfs/dtfs_vnops.c | 4 +---
tests/fs/puffs/t_basic.c | 4 +---
tests/fs/vfs/t_vnops.c | 5 ++---
tests/include/sys/t_socket.c | 6 +++---
tests/kernel/t_lockf.c | 6 +++---
tests/lib/libc/gen/t_dir.c | 7 +++----
tests/lib/libc/stdio/t_fmemopen.c | 13 +++----------
tests/lib/libpthread/t_cond.c | 10 ++--------
tests/lib/libpthread/t_sigmask.c | 10 ++++------
tests/net/net/t_pktinfo.c | 5 +++--
15 files changed, 41 insertions(+), 66 deletions(-)
diffs (truncated from 532 to 300 lines):
diff -r 091c5851b4e6 -r 76019bc68e9c tests/fs/nfs/nfsservice/mountd.c
--- a/tests/fs/nfs/nfsservice/mountd.c Sat Oct 19 17:44:37 2013 +0000
+++ b/tests/fs/nfs/nfsservice/mountd.c Sat Oct 19 17:45:00 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: mountd.c,v 1.7 2012/01/22 18:36:17 christos Exp $ */
+/* $NetBSD: mountd.c,v 1.8 2013/10/19 17:45:00 christos Exp $ */
/*
* Copyright (c) 1989, 1993
@@ -42,7 +42,7 @@
#if 0
static char sccsid[] = "@(#)mountd.c 8.15 (Berkeley) 5/1/95";
#else
-__RCSID("$NetBSD: mountd.c,v 1.7 2012/01/22 18:36:17 christos Exp $");
+__RCSID("$NetBSD: mountd.c,v 1.8 2013/10/19 17:45:00 christos Exp $");
#endif
#endif /* not lint */
@@ -497,7 +497,6 @@
struct fhreturn fhr;
struct stat stb;
struct statvfs fsb;
- struct addrinfo *ai;
char host[NI_MAXHOST], numerichost[NI_MAXHOST];
int lookup_failed = 1;
struct sockaddr *saddr;
@@ -532,7 +531,6 @@
if (getnameinfo(saddr, saddr->sa_len, numerichost,
sizeof numerichost, NULL, 0, ninumeric) != 0)
strlcpy(numerichost, "?", sizeof(numerichost));
- ai = NULL;
ret = 0;
switch (rqstp->rq_proc) {
case NULLPROC:
diff -r 091c5851b4e6 -r 76019bc68e9c tests/fs/nfs/nfsservice/nfsd.c
--- a/tests/fs/nfs/nfsservice/nfsd.c Sat Oct 19 17:44:37 2013 +0000
+++ b/tests/fs/nfs/nfsservice/nfsd.c Sat Oct 19 17:45:00 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: nfsd.c,v 1.3 2010/07/28 15:12:17 pooka Exp $ */
+/* $NetBSD: nfsd.c,v 1.4 2013/10/19 17:45:00 christos Exp $ */
/*
* Copyright (c) 1989, 1993, 1994
@@ -42,7 +42,7 @@
#if 0
static char sccsid[] = "@(#)nfsd.c 8.9 (Berkeley) 3/29/95";
#else
-__RCSID("$NetBSD: nfsd.c,v 1.3 2010/07/28 15:12:17 pooka Exp $");
+__RCSID("$NetBSD: nfsd.c,v 1.4 2013/10/19 17:45:00 christos Exp $");
#endif
#endif /* not lint */
@@ -149,18 +149,17 @@
struct sockaddr_in inetpeer;
struct pollfd set[4];
socklen_t len;
- int ch, cltpflag, connect_type_cnt, i, maxsock, msgsock;
+ int ch, connect_type_cnt, i, msgsock;
int nfsdcnt, on = 1, reregister, sock, tcpflag, tcpsock;
int tcp6sock, ip6flag;
- int tp4cnt, tp4flag, tpipcnt, tpipflag, udpflag, ecode, s;
+ int tp4cnt, tp4flag, tpipcnt, udpflag, ecode, s;
int error = 0;
#define DEFNFSDCNT 4
nfsdcnt = DEFNFSDCNT;
- cltpflag = reregister = tcpflag = tp4cnt = tp4flag = tpipcnt = 0;
- tpipflag = udpflag = ip6flag = 0;
+ reregister = tcpflag = tp4cnt = tp4flag = tpipcnt = 0;
+ udpflag = ip6flag = 0;
nconf_udp = nconf_tcp = nconf_udp6 = nconf_tcp6 = NULL;
- maxsock = 0;
tcpsock = tcp6sock = -1;
#define GETOPT "6n:rtu"
#define USAGE "[-rtu] [-n num_servers]"
diff -r 091c5851b4e6 -r 76019bc68e9c tests/fs/nfs/nfsservice/rpcbind/pmap_svc.c
--- a/tests/fs/nfs/nfsservice/rpcbind/pmap_svc.c Sat Oct 19 17:44:37 2013 +0000
+++ b/tests/fs/nfs/nfsservice/rpcbind/pmap_svc.c Sat Oct 19 17:45:00 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap_svc.c,v 1.1 2010/07/26 15:53:00 pooka Exp $ */
+/* $NetBSD: pmap_svc.c,v 1.2 2013/10/19 17:45:00 christos Exp $ */
/*
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
@@ -170,7 +170,6 @@
struct pmap reg;
RPCB rpcbreg;
long ans;
- struct sockaddr_in *who;
struct sockcred *sc;
char uidbuf[32];
@@ -191,7 +190,7 @@
return FALSE;
}
- who = svc_getcaller(xprt);
+ (void)svc_getcaller(xprt);
sc = __svc_getcallercreds(xprt);
/*
diff -r 091c5851b4e6 -r 76019bc68e9c tests/fs/nfs/nfsservice/rpcbind/rpcbind.c
--- a/tests/fs/nfs/nfsservice/rpcbind/rpcbind.c Sat Oct 19 17:44:37 2013 +0000
+++ b/tests/fs/nfs/nfsservice/rpcbind/rpcbind.c Sat Oct 19 17:45:00 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rpcbind.c,v 1.3 2011/09/16 16:13:18 plunky Exp $ */
+/* $NetBSD: rpcbind.c,v 1.4 2013/10/19 17:45:00 christos Exp $ */
/*
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
@@ -233,9 +233,7 @@
struct addrinfo hints, *res = NULL;
struct __rpc_sockinfo si;
SVCXPRT *my_xprt;
- int status; /* bound checking ? */
- int aicode;
- int addrlen;
+ int aicode, status, addrlen;
struct sockaddr *sa;
struct sockaddr_un sun;
const int one = 1;
@@ -480,6 +478,8 @@
nconf->nc_netid);
}
}
+#else
+ __USE(status);
#endif
/*
* rmtcall only supported on CLTS transports for now.
diff -r 091c5851b4e6 -r 76019bc68e9c tests/fs/puffs/h_dtfs/dtfs_subr.c
--- a/tests/fs/puffs/h_dtfs/dtfs_subr.c Sat Oct 19 17:44:37 2013 +0000
+++ b/tests/fs/puffs/h_dtfs/dtfs_subr.c Sat Oct 19 17:45:00 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dtfs_subr.c,v 1.3 2011/03/01 15:19:49 pooka Exp $ */
+/* $NetBSD: dtfs_subr.c,v 1.4 2013/10/19 17:45:00 christos Exp $ */
/*
* Copyright (c) 2006 Antti Kantee. All Rights Reserved.
@@ -81,7 +81,7 @@
dtfs_genfile(struct puffs_node *dir, const struct puffs_cn *pcn,
enum vtype type)
{
- struct dtfs_file *df_dir, *dff;
+ struct dtfs_file *dff;
struct dtfs_dirent *dfd;
struct dtfs_mount *dtm;
struct puffs_node *newpn;
@@ -107,7 +107,6 @@
errx(1, "getnewpnode");
dtfs_baseattrs(&newpn->pn_va, type, dtm->dtm_nextfileid++);
- df_dir = dir->pn_data;
dfd = emalloc(sizeof(struct dtfs_dirent));
dfd->dfd_node = newpn;
dfd->dfd_name = estrndup(pcn->pcn_name, pcn->pcn_namelen);
diff -r 091c5851b4e6 -r 76019bc68e9c tests/fs/puffs/h_dtfs/dtfs_vnops.c
--- a/tests/fs/puffs/h_dtfs/dtfs_vnops.c Sat Oct 19 17:44:37 2013 +0000
+++ b/tests/fs/puffs/h_dtfs/dtfs_vnops.c Sat Oct 19 17:45:00 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dtfs_vnops.c,v 1.9 2012/01/31 18:56:07 njoly Exp $ */
+/* $NetBSD: dtfs_vnops.c,v 1.10 2013/10/19 17:45:00 christos Exp $ */
/*
* Copyright (c) 2006 Antti Kantee. All Rights Reserved.
@@ -430,7 +430,6 @@
{
struct puffs_node *pn_parent = opc;
struct puffs_node *pn_new;
- struct dtfs_file *df;
if (!(va->va_type == VBLK || va->va_type == VCHR
|| va->va_type == VFIFO))
@@ -439,7 +438,6 @@
pn_new = dtfs_genfile(pn_parent, pcn, va->va_type);
puffs_setvattr(&pn_new->pn_va, va);
- df = DTFS_PTOF(pn_new);
puffs_newinfo_setcookie(pni, pn_new);
return 0;
diff -r 091c5851b4e6 -r 76019bc68e9c tests/fs/puffs/t_basic.c
--- a/tests/fs/puffs/t_basic.c Sat Oct 19 17:44:37 2013 +0000
+++ b/tests/fs/puffs/t_basic.c Sat Oct 19 17:45:00 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: t_basic.c,v 1.11 2011/04/04 15:42:42 plunky Exp $ */
+/* $NetBSD: t_basic.c,v 1.12 2013/10/19 17:45:00 christos Exp $ */
#include <sys/types.h>
#include <sys/mount.h>
@@ -115,13 +115,11 @@
ATF_TC_BODY(root_lnk, tc)
{
MAKEOPTS("-r", "lnk " LINKSTR);
- struct puffstestargs *pargs;
void *args;
char buf[PATH_MAX];
ssize_t len;
FSTEST_CONSTRUCTOR_FSPRIV(tc, puffs, args, theopts);
- pargs = args;
if ((len = rump_sys_readlink(FSTEST_MNTNAME, buf, sizeof(buf)-1)) == -1)
atf_tc_fail_errno("readlink");
diff -r 091c5851b4e6 -r 76019bc68e9c tests/fs/vfs/t_vnops.c
--- a/tests/fs/vfs/t_vnops.c Sat Oct 19 17:44:37 2013 +0000
+++ b/tests/fs/vfs/t_vnops.c Sat Oct 19 17:45:00 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: t_vnops.c,v 1.37 2013/07/28 09:03:43 njoly Exp $ */
+/* $NetBSD: t_vnops.c,v 1.38 2013/10/19 17:45:00 christos Exp $ */
/*-
* Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -333,7 +333,7 @@
{
bool haslinks;
struct stat sb;
- ino_t f1ino, f2ino;
+ ino_t f1ino;
if (FSTYPE_RUMPFS(tc))
atf_tc_skip("rename not supported by file system");
@@ -366,7 +366,6 @@
if (rump_sys_stat("file2", &sb) == -1)
atf_tc_fail_errno("stat");
- f2ino = sb.st_ino;
if (rump_sys_rename("file1", "file3") == -1)
atf_tc_fail_errno("rename 1");
diff -r 091c5851b4e6 -r 76019bc68e9c tests/include/sys/t_socket.c
--- a/tests/include/sys/t_socket.c Sat Oct 19 17:44:37 2013 +0000
+++ b/tests/include/sys/t_socket.c Sat Oct 19 17:45:00 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: t_socket.c,v 1.2 2013/09/05 12:22:10 pooka Exp $ */
+/* $NetBSD: t_socket.c,v 1.3 2013/10/19 17:45:00 christos Exp $ */
#include <sys/types.h>
#include <sys/mount.h>
@@ -83,7 +83,7 @@
struct cmsghdr *cmp;
struct msghdr msg;
struct sockaddr_un sun;
- struct lwp *l1, *l2;
+ struct lwp *l1;
struct iovec iov;
socklen_t sl;
int s1, s2, sgot;
@@ -109,7 +109,7 @@
/* create second process for test */
RZ(rump_pub_lwproc_rfork(RUMP_RFCFDG));
- l2 = rump_pub_lwproc_curlwp();
+ (void)rump_pub_lwproc_curlwp();
/* connect to unix domain socket */
memset(&sun, 0, sizeof(sun));
diff -r 091c5851b4e6 -r 76019bc68e9c tests/kernel/t_lockf.c
--- a/tests/kernel/t_lockf.c Sat Oct 19 17:44:37 2013 +0000
+++ b/tests/kernel/t_lockf.c Sat Oct 19 17:45:00 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: t_lockf.c,v 1.8 2013/02/20 02:22:48 pgoyette Exp $ */
+/* $NetBSD: t_lockf.c,v 1.9 2013/10/19 17:45:00 christos Exp $ */
/*-
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -70,7 +70,7 @@
static void
trylocks(int id)
{
- int i, ret, fd;
+ int i, fd;
srand48(getpid());
@@ -99,7 +99,7 @@
}
fl.l_whence = SEEK_SET;
- ret = fcntl(fd, F_SETLKW, &fl);
+ (void)fcntl(fd, F_SETLKW, &fl);
if (usleep(sleeptime) < 0)
err(1, "usleep");
diff -r 091c5851b4e6 -r 76019bc68e9c tests/lib/libc/gen/t_dir.c
--- a/tests/lib/libc/gen/t_dir.c Sat Oct 19 17:44:37 2013 +0000
+++ b/tests/lib/libc/gen/t_dir.c Sat Oct 19 17:45:00 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: t_dir.c,v 1.5 2012/03/18 07:14:08 jruoho Exp $ */
+/* $NetBSD: t_dir.c,v 1.6 2013/10/19 17:45:00 christos Exp $ */
/*-
* Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -122,7 +122,6 @@
ATF_TC_BODY(telldir_leak, tc)
{
DIR *dp;
- long loc;
char *memused;
int i;
Home |
Main Index |
Thread Index |
Old Index