Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/games Fix some uses of NULL as non-pointer and 0 for null po...
details: https://anonhg.NetBSD.org/src/rev/4774f9ed8354
branches: trunk
changeset: 476485:4774f9ed8354
user: jsm <jsm%NetBSD.org@localhost>
date: Fri Sep 17 17:07:11 1999 +0000
description:
Fix some uses of NULL as non-pointer and 0 for null pointer.
diffstat:
games/backgammon/backgammon/main.c | 6 +++---
games/boggle/boggle/bog.c | 6 +++---
games/quiz/quiz.c | 6 +++---
games/sail/game.c | 7 ++++---
4 files changed, 13 insertions(+), 12 deletions(-)
diffs (109 lines):
diff -r 1a554b145eb2 -r 4774f9ed8354 games/backgammon/backgammon/main.c
--- a/games/backgammon/backgammon/main.c Fri Sep 17 17:06:08 1999 +0000
+++ b/games/backgammon/backgammon/main.c Fri Sep 17 17:07:11 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.14 1999/09/09 17:30:17 jsm Exp $ */
+/* $NetBSD: main.c,v 1.15 1999/09/17 17:07:11 jsm Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -43,7 +43,7 @@
#if 0
static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: main.c,v 1.14 1999/09/09 17:30:17 jsm Exp $");
+__RCSID("$NetBSD: main.c,v 1.15 1999/09/17 17:07:11 jsm Exp $");
#endif
#endif /* not lint */
@@ -120,7 +120,7 @@
/* use whole screen for text */
if (tflag)
begscr = 0;
- t = time(0);
+ t = time(NULL);
srandom(t); /* 'random' seed */
#ifdef V7
diff -r 1a554b145eb2 -r 4774f9ed8354 games/boggle/boggle/bog.c
--- a/games/boggle/boggle/bog.c Fri Sep 17 17:06:08 1999 +0000
+++ b/games/boggle/boggle/bog.c Fri Sep 17 17:07:11 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: bog.c,v 1.12 1999/09/08 21:17:44 jsm Exp $ */
+/* $NetBSD: bog.c,v 1.13 1999/09/17 17:07:11 jsm Exp $ */
/*-
* Copyright (c) 1993
@@ -46,7 +46,7 @@
#if 0
static char sccsid[] = "@(#)bog.c 8.2 (Berkeley) 5/4/95";
#else
-__RCSID("$NetBSD: bog.c,v 1.12 1999/09/08 21:17:44 jsm Exp $");
+__RCSID("$NetBSD: bog.c,v 1.13 1999/09/17 17:07:11 jsm Exp $");
#endif
#endif /* not lint */
@@ -604,7 +604,7 @@
}
mword[nmwords++] = mwordsp;
p = w;
- while ((*mwordsp++ = *p++) != NULL)
+ while ((*mwordsp++ = *p++) != '\0')
;
}
}
diff -r 1a554b145eb2 -r 4774f9ed8354 games/quiz/quiz.c
--- a/games/quiz/quiz.c Fri Sep 17 17:06:08 1999 +0000
+++ b/games/quiz/quiz.c Fri Sep 17 17:07:11 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: quiz.c,v 1.15 1999/09/12 09:02:22 jsm Exp $ */
+/* $NetBSD: quiz.c,v 1.16 1999/09/17 17:07:11 jsm Exp $ */
/*-
* Copyright (c) 1991, 1993
@@ -47,7 +47,7 @@
#if 0
static char sccsid[] = "@(#)quiz.c 8.3 (Berkeley) 5/4/95";
#else
-__RCSID("$NetBSD: quiz.c,v 1.15 1999/09/12 09:02:22 jsm Exp $");
+__RCSID("$NetBSD: quiz.c,v 1.16 1999/09/17 17:07:11 jsm Exp $");
#endif
#endif /* not lint */
@@ -342,7 +342,7 @@
if ((m = malloc(strlen(s) + len + 1)) == NULL)
errx(1, "malloc");
- for (mp = m, sp = s; (*mp++ = *sp++) != NULL; )
+ for (mp = m, sp = s; (*mp++ = *sp++) != '\0'; )
;
--mp;
if (*(mp - 1) == '\\')
diff -r 1a554b145eb2 -r 4774f9ed8354 games/sail/game.c
--- a/games/sail/game.c Fri Sep 17 17:06:08 1999 +0000
+++ b/games/sail/game.c Fri Sep 17 17:07:11 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: game.c,v 1.5 1997/10/13 19:44:09 christos Exp $ */
+/* $NetBSD: game.c,v 1.6 1999/09/17 17:07:11 jsm Exp $ */
/*
* Copyright (c) 1983, 1993
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)game.c 8.2 (Berkeley) 4/28/95";
#else
-__RCSID("$NetBSD: game.c,v 1.5 1997/10/13 19:44:09 christos Exp $");
+__RCSID("$NetBSD: game.c,v 1.6 1999/09/17 17:07:11 jsm Exp $");
#endif
#endif /* not lint */
@@ -52,7 +52,8 @@
int turns;
turns = ship->specs->ta;
- if ((*af = (ship->file->drift > 1 && turns)) != NULL) {
+ *af = (ship->file->drift > 1 && turns);
+ if (*af != '\0') {
turns--;
if (ship->file->FS == 1)
turns = 0;
Home |
Main Index |
Thread Index |
Old Index