Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src fix unused variable warnings
details: https://anonhg.NetBSD.org/src/rev/f8884034a036
branches: trunk
changeset: 790704:f8884034a036
user: christos <christos%NetBSD.org@localhost>
date: Sat Oct 19 17:19:30 2013 +0000
description:
fix unused variable warnings
diffstat:
games/backgammon/teachgammon/ttext2.c | 7 ++-----
games/boggle/boggle/prtable.c | 5 +++--
games/gomoku/pickmove.c | 7 +++----
games/hunt/huntd/driver.c | 10 +++-------
games/sail/sync.c | 7 +++----
games/tetris/scores.c | 7 ++-----
libexec/ld.elf_so/rtld.c | 7 +++++--
libexec/lfs_cleanerd/lfs_cleanerd.c | 10 +++++-----
8 files changed, 26 insertions(+), 34 deletions(-)
diffs (292 lines):
diff -r 24f1074d4ff8 -r f8884034a036 games/backgammon/teachgammon/ttext2.c
--- a/games/backgammon/teachgammon/ttext2.c Sat Oct 19 17:16:37 2013 +0000
+++ b/games/backgammon/teachgammon/ttext2.c Sat Oct 19 17:19:30 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ttext2.c,v 1.9 2010/03/22 05:10:19 mrg Exp $ */
+/* $NetBSD: ttext2.c,v 1.10 2013/10/19 17:23:08 christos Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)ttext2.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: ttext2.c,v 1.9 2010/03/22 05:10:19 mrg Exp $");
+__RCSID("$NetBSD: ttext2.c,v 1.10 2013/10/19 17:23:08 christos Exp $");
#endif
#endif /* not lint */
@@ -129,14 +129,12 @@
int
wrtext(const char *const *txt)
{
- const char *const *begin;
const char *a;
char b;
const char *c;
int i;
fixtty(&noech);
- begin = txt;
while (*txt) {
a = *(txt++);
if (*a != '\0') {
@@ -187,7 +185,6 @@
fixtty(&noech);
if (tflag)
curmove(curr, 0);
- begin = txt;
}
}
fixtty(&raw);
diff -r 24f1074d4ff8 -r f8884034a036 games/boggle/boggle/prtable.c
--- a/games/boggle/boggle/prtable.c Sat Oct 19 17:16:37 2013 +0000
+++ b/games/boggle/boggle/prtable.c Sat Oct 19 17:19:30 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: prtable.c,v 1.9 2005/07/01 16:38:24 jmc Exp $ */
+/* $NetBSD: prtable.c,v 1.10 2013/10/19 17:23:08 christos Exp $ */
/*-
* Copyright (c) 1993
@@ -36,7 +36,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: prtable.c,v 1.9 2005/07/01 16:38:24 jmc Exp $");
+__RCSID("$NetBSD: prtable.c,v 1.10 2013/10/19 17:23:08 christos Exp $");
#endif /* not lint */
#include <curses.h>
@@ -106,6 +106,7 @@
}
}
getyx(stdscr, row, col);
+ __USE(col);
move(row + 1, 0);
}
refresh();
diff -r 24f1074d4ff8 -r f8884034a036 games/gomoku/pickmove.c
--- a/games/gomoku/pickmove.c Sat Oct 19 17:16:37 2013 +0000
+++ b/games/gomoku/pickmove.c Sat Oct 19 17:19:30 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pickmove.c,v 1.21 2012/10/13 20:57:35 dholland Exp $ */
+/* $NetBSD: pickmove.c,v 1.22 2013/10/19 17:23:08 christos Exp $ */
/*
* Copyright (c) 1994
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)pickmove.c 8.2 (Berkeley) 5/3/95";
#else
-__RCSID("$NetBSD: pickmove.c,v 1.21 2012/10/13 20:57:35 dholland Exp $");
+__RCSID("$NetBSD: pickmove.c,v 1.22 2013/10/19 17:23:08 christos Exp $");
#endif
#endif /* not lint */
@@ -1083,7 +1083,7 @@
int s, struct overlap_info *vertices)
{
struct combostr *tcbp, *lcbp;
- int i, n, mask, flags, verts, loop, myindex, fcnt;
+ int i, n, mask, flags, verts, myindex, fcnt;
union comboval cb;
u_char *str;
short *ip;
@@ -1094,7 +1094,6 @@
cb.s = s;
fcnt = cb.c.a - 2;
verts = 0;
- loop = 0;
myindex = cbp->c_nframes;
n = (fcbp - frames) * FAREA;
str = &overlap[n];
diff -r 24f1074d4ff8 -r f8884034a036 games/hunt/huntd/driver.c
--- a/games/hunt/huntd/driver.c Sat Oct 19 17:16:37 2013 +0000
+++ b/games/hunt/huntd/driver.c Sat Oct 19 17:19:30 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: driver.c,v 1.21 2011/08/31 16:24:56 plunky Exp $ */
+/* $NetBSD: driver.c,v 1.22 2013/10/19 17:23:08 christos Exp $ */
/*
* Copyright (c) 1983-2003, Regents of the University of California.
* All rights reserved.
@@ -32,7 +32,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: driver.c,v 1.21 2011/08/31 16:24:56 plunky Exp $");
+__RCSID("$NetBSD: driver.c,v 1.22 2013/10/19 17:23:08 christos Exp $");
#endif /* not lint */
#include <sys/ioctl.h>
@@ -88,7 +88,7 @@
PLAYER *pp;
#ifdef INTERNET
u_short msg;
- short port_num, reply;
+ short reply;
socklen_t namelen;
SOCKET test;
#endif
@@ -143,7 +143,6 @@
#ifdef INTERNET
if (fdset[2].revents & POLLIN) {
namelen = DAEMON_SIZE;
- port_num = htons(sock_port);
(void) recvfrom(Test_socket, &msg, sizeof msg,
0, (struct sockaddr *) &test, &namelen);
switch (ntohs(msg)) {
@@ -599,7 +598,6 @@
BULLET *bp;
PLAYER *np;
int x, y;
- int savefd;
if (was_player) {
if (pp->p_undershot)
@@ -622,8 +620,6 @@
outstr(pp, pp->p_death, len);
cgoto(pp, HEIGHT, 0);
- savefd = pp->p_fd;
-
#ifdef MONITOR
if (was_player) {
#endif
diff -r 24f1074d4ff8 -r f8884034a036 games/sail/sync.c
--- a/games/sail/sync.c Sat Oct 19 17:16:37 2013 +0000
+++ b/games/sail/sync.c Sat Oct 19 17:19:30 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sync.c,v 1.33 2009/03/14 23:47:18 dholland Exp $ */
+/* $NetBSD: sync.c,v 1.34 2013/10/19 17:23:08 christos Exp $ */
/*
* Copyright (c) 1983, 1993
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)sync.c 8.2 (Berkeley) 4/28/95";
#else
-__RCSID("$NetBSD: sync.c,v 1.33 2009/03/14 23:47:18 dholland Exp $");
+__RCSID("$NetBSD: sync.c,v 1.34 2013/10/19 17:23:08 christos Exp $");
#endif
#endif /* not lint */
@@ -247,13 +247,12 @@
sync_open(void)
{
const char *sync_file;
- const char *sync_lock;
struct stat tmp;
if (sync_fp != NULL)
fclose(sync_fp);
sync_file = get_sync_file(game);
- sync_lock = get_lock_file(game);
+ (void)get_lock_file(game);
setegid(egid);
if (stat(sync_file, &tmp) < 0) {
mode_t omask = umask(002);
diff -r 24f1074d4ff8 -r f8884034a036 games/tetris/scores.c
--- a/games/tetris/scores.c Sat Oct 19 17:16:37 2013 +0000
+++ b/games/tetris/scores.c Sat Oct 19 17:19:30 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: scores.c,v 1.20 2011/01/05 15:48:00 wiz Exp $ */
+/* $NetBSD: scores.c,v 1.21 2013/10/19 17:23:08 christos Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -381,9 +381,8 @@
struct highscore_header header;
int sd, mint, lck;
mode_t mask;
- const char *mstr, *human;
+ const char *human;
int doflip;
- int serrno;
ssize_t result;
#ifdef ALLOW_SCORE_UPDATES
@@ -395,14 +394,12 @@
#endif
{
mint = O_RDONLY;
- mstr = "r";
human = "reading";
lck = LOCK_SH;
}
setegid(egid);
mask = umask(S_IWOTH);
sd = open(_PATH_SCOREFILE, mint, 0666);
- serrno = errno;
(void)umask(mask);
setegid(gid);
if (sd < 0) {
diff -r 24f1074d4ff8 -r f8884034a036 libexec/ld.elf_so/rtld.c
--- a/libexec/ld.elf_so/rtld.c Sat Oct 19 17:16:37 2013 +0000
+++ b/libexec/ld.elf_so/rtld.c Sat Oct 19 17:19:30 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rtld.c,v 1.169 2013/05/09 15:47:34 skrll Exp $ */
+/* $NetBSD: rtld.c,v 1.170 2013/10/19 17:19:30 christos Exp $ */
/*
* Copyright 1996 John D. Polstra.
@@ -40,7 +40,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: rtld.c,v 1.169 2013/05/09 15:47:34 skrll Exp $");
+__RCSID("$NetBSD: rtld.c,v 1.170 2013/10/19 17:19:30 christos Exp $");
#endif /* not lint */
#include <sys/param.h>
@@ -1290,6 +1290,7 @@
info->dli_saddr = symbol_addr;
best_def = def;
+
/* Exact match? */
if (info->dli_saddr == addr)
break;
@@ -1299,6 +1300,8 @@
if (best_def != NULL && ELF_ST_TYPE(best_def->st_info) == STT_FUNC)
info->dli_saddr = (void *)_rtld_function_descriptor_alloc(obj,
best_def, 0);
+#else
+ __USE(best_def);
#endif /* __HAVE_FUNCTION_DESCRIPTORS */
lookup_mutex_exit();
diff -r 24f1074d4ff8 -r f8884034a036 libexec/lfs_cleanerd/lfs_cleanerd.c
--- a/libexec/lfs_cleanerd/lfs_cleanerd.c Sat Oct 19 17:16:37 2013 +0000
+++ b/libexec/lfs_cleanerd/lfs_cleanerd.c Sat Oct 19 17:19:30 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lfs_cleanerd.c,v 1.36 2013/06/18 18:18:57 christos Exp $ */
+/* $NetBSD: lfs_cleanerd.c,v 1.37 2013/10/19 17:19:30 christos Exp $ */
/*-
* Copyright (c) 2005 The NetBSD Foundation, Inc.
@@ -1353,7 +1353,9 @@
{
int i, opt, error, r, loopcount, nodetach;
struct timeval tv;
+#ifdef LFS_CLEANER_AS_LIB
sem_t *semaddr = NULL;
+#endif
CLEANERINFO ci;
#ifndef USE_CLIENT_SERVER
char *cp, *pidname;
@@ -1414,13 +1416,11 @@
case 's': /* Small writes */
do_small = 1;
break;
+#ifdef LFS_CLEANER_AS_LIB
case 'S': /* semaphore */
-#ifndef LFS_CLEANER_AS_LIB
- usage();
- /*NOTREACHED*/
-#endif
semaddr = (void*)(uintptr_t)strtoull(optarg,NULL,0);
break;
+#endif
case 't': /* timeout */
segwait_timeout = atoi(optarg);
break;
Home |
Main Index |
Thread Index |
Old Index