Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

games: Fix -Werror for gcc47.

* Remove unused variables and mark a few things __unused.

* Properly use socklen_t.

* Remove trek(6)'s undocumented -p option (which did nothing).
  • Loading branch information...
commit 435f923e109adcc7b1ee7693c6981255e6bc7030 1 parent a8f1df1
Sascha Wildner authored
View
6 games/adventure/io.c
@@ -564,7 +564,7 @@ void
pspeak(int m, int skip)
{
char *s, nonfirst;
- char *numst, ps_save;
+ char *numst;
struct text *msg;
char *tbuf;
@@ -580,8 +580,8 @@ pspeak(int m, int skip)
for (numst = s; (*s ^= *tape++) != TAB; s++) /* get number */
; /* nothing */
- ps_save = *s; /* Temporarily trash the string (cringe) */
- *s++ = 0; /* decrypting number within the string */
+ /* Temporarily trash the string (cringe) */
+ *s++ = 0; /* decrypting number within the string */
if (atoi(numst) != 100 * skip && skip >= 0) {
while ((*s++ ^ *tape++) != LF) /* flush the line */
View
4 games/backgammon/teachgammon/ttext2.c
@@ -28,7 +28,6 @@
*
* @(#)ttext2.c 8.1 (Berkeley) 5/31/93
* $FreeBSD: src/games/backgammon/teachgammon/ttext2.c,v 1.3.2.1 2001/10/15 13:46:32 dd Exp $
- * $DragonFly: src/games/backgammon/teachgammon/ttext2.c,v 1.3 2006/08/08 16:36:11 pavalos Exp $
*/
#include "back.h"
@@ -123,14 +122,12 @@ const char *const lastch[] = {
int
text(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') {
@@ -182,7 +179,6 @@ text(const char *const *txt)
fixtty(noech);
if (tflag)
curmove(curr, 0);
- begin = txt;
}
}
fixtty(raw);
View
2  games/battlestar/fly.c
@@ -240,7 +240,7 @@ blast(void)
}
static void
-moveenemy(int sig)
+moveenemy(__unused int sig)
{
double d;
int oldr, oldc;
View
4 games/hunt/hunt/list.c
@@ -5,7 +5,6 @@
* This software is provided ``as is'' without express or implied warranty.
*
* $OpenBSD: list.c,v 1.5 2007/09/04 22:39:31 hshoexer Exp $
- * $DragonFly: src/games/hunt/hunt/list.c,v 1.2 2008/09/04 16:12:51 swildner Exp $
*/
#include <stdio.h>
@@ -54,7 +53,8 @@ next_driver_fd(int fd)
{
fd_set r;
int maxfd = -1;
- int i, s, ret, len;
+ int i, s, ret;
+ socklen_t len;
struct driver *driver;
u_int16_t resp;
View
5 games/rain/rain.c
@@ -29,7 +29,6 @@
* @(#) Copyright (c) 1980, 1993 The Regents of the University of California. All rights reserved.
* @(#)rain.c 8.1 (Berkeley) 5/31/93
* $FreeBSD: src/games/rain/rain.c,v 1.8.2.1 2001/03/05 11:54:10 kris Exp $
- * $DragonFly: src/games/rain/rain.c,v 1.3 2003/11/12 14:53:54 eirikn Exp $
*/
/*
@@ -127,9 +126,7 @@ main(int argc, char **argv)
}
static void
-onsig(int sig)
+onsig(__unused int sig)
{
-
- sig = 0;
sig_caught = 1;
}
View
4 games/rogue/init.c
@@ -80,7 +80,6 @@ boolean
init(int argc, char *argv[])
{
const char *pn;
- int seed;
pn = md_gln();
if ((!pn) || (strlen(pn) >= MAX_OPT_LEN)) {
@@ -109,8 +108,7 @@ init(int argc, char *argv[])
if (score_only) {
put_scores(NULL, 0);
}
- seed = md_gseed();
- srrandom(seed);
+ srandomdev();
if (rest_file) {
restore(rest_file);
return(1);
View
28 games/rogue/machdep.c
@@ -31,7 +31,6 @@
*
* @(#)machdep.c 8.1 (Berkeley) 5/31/93
* $FreeBSD: src/games/rogue/machdep.c,v 1.6.2.1 2001/12/17 12:43:23 phantom Exp $
- * $DragonFly: src/games/rogue/machdep.c,v 1.4 2006/09/09 02:21:49 pavalos Exp $
*/
/*
@@ -448,33 +447,6 @@ md_malloc(int n)
return(t);
}
-/* md_gseed() (Get Seed)
- *
- * This function returns a seed for the random number generator (RNG). This
- * seed causes the RNG to begin generating numbers at some point in its
- * sequence. Without a random seed, the RNG will generate the same set
- * of numbers, and every game will start out exactly the same way. A good
- * number to use is the process id, given by getpid() on most UNIX systems.
- *
- * You need to find some single random integer, such as:
- * process id.
- * current time (minutes + seconds) returned from md_gct(), if implemented.
- *
- * It will not help to return "get_rand()" or "rand()" or the return value of
- * any pseudo-RNG. If you don't have a random number, you can just return 1,
- * but this means your games will ALWAYS start the same way, and will play
- * exactly the same way given the same input.
- */
-
-int
-md_gseed(void)
-{
- time_t seconds;
-
- time(&seconds);
- return((int)seconds);
-}
-
/* md_exit():
*
* This function causes the program to discontinue execution and exit.
View
3  games/rogue/rogue.h
@@ -31,7 +31,6 @@
*
* @(#)rogue.h 8.1 (Berkeley) 5/31/93
* $FreeBSD: src/games/rogue/rogue.h,v 1.3.2.1 2001/12/17 12:43:23 phantom Exp $
- * $DragonFly: src/games/rogue/rogue.h,v 1.4 2006/09/02 19:31:07 pavalos Exp $
*/
#include <curses.h>
@@ -443,7 +442,6 @@ struct rogue_time {
/* external routine declarations.
*/
#define rrandom random
-#define srrandom(x) srandomdev()
/* hit.c */
void mon_hit(object *);
@@ -505,7 +503,6 @@ const char *md_gln(void);
void md_sleep(int);
char *md_getenv(const char *);
char *md_malloc(int);
-int md_gseed(void);
void md_exit(int);
void md_lock(boolean);
void md_shell(const char *);
View
19 games/trek/main.c
@@ -29,14 +29,11 @@
* @(#) Copyright (c) 1980, 1993 The Regents of the University of California. All rights reserved.
* @(#)main.c 8.1 (Berkeley) 5/31/93
* $FreeBSD: src/games/trek/main.c,v 1.7.2.1 2001/03/05 12:11:14 kris Exp $
- * $DragonFly: src/games/trek/main.c,v 1.3 2006/09/07 21:19:44 pavalos Exp $
*/
#include "trek.h"
#include "getpar.h"
-#define PRIO 00 /* default priority */
-
unsigned int Mother = 51 + (51 << 8);
/*
@@ -143,9 +140,8 @@ main(int argc, char **argv)
{
#if 0
extern FILE *f_log;
-#endif
char opencode;
- int prio;
+#endif
int ac;
char **av;
@@ -156,13 +152,15 @@ main(int argc, char **argv)
ac = argc;
av++;
srandomdev();
+#if 0
opencode = 'w';
- prio = PRIO;
-
+#endif
while (ac > 1 && av[0][0] == '-') {
switch (av[0][1]) {
case 'a': /* append to log file */
+#if 0
opencode = 'a';
+#endif
break;
#ifdef xTRACE
@@ -172,13 +170,6 @@ main(int argc, char **argv)
Trace++;
break;
#endif
-
- case 'p': /* set priority */
- if (getuid() != Mother)
- goto badflag;
- prio = atoi(av[0] + 2);
- break;
-
default:
badflag:
printf("Invalid option: %s\n", av[0]);
Please sign in to comment.
Something went wrong with that request. Please try again.