summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjsm <jsm@NetBSD.org>1999-09-08 21:57:16 +0000
committerjsm <jsm@NetBSD.org>1999-09-08 21:57:16 +0000
commit56b3b679266d099eba0ac4e8282b239c652357c3 (patch)
tree7e3a0748576fc3fd8c50331f1d419996a73538fd
parent82852318e37fa7eddacc3dd162a2d16d3a7487b9 (diff)
downloadbsdgames-darwin-56b3b679266d099eba0ac4e8282b239c652357c3.tar.gz
bsdgames-darwin-56b3b679266d099eba0ac4e8282b239c652357c3.tar.zst
bsdgames-darwin-56b3b679266d099eba0ac4e8282b239c652357c3.zip
Use the symbolic names `SEEK_SET' and `O_RDONLY' where appropriate in
the games.
-rw-r--r--fortune/fortune/fortune.c10
-rw-r--r--fortune/strfile/strfile.c12
-rw-r--r--fortune/unstr/unstr.c6
-rw-r--r--hangman/getword.c6
-rw-r--r--mille/save.c6
-rw-r--r--monop/cards.c6
-rw-r--r--monop/initdeck.c8
-rw-r--r--phantasia/fight.c6
-rw-r--r--phantasia/gamesupport.c10
-rw-r--r--phantasia/interplayer.c24
-rw-r--r--phantasia/main.c10
-rw-r--r--phantasia/misc.c18
-rw-r--r--robots/score.c6
-rw-r--r--sail/sync.c6
-rw-r--r--snake/snake/snake.c10
15 files changed, 72 insertions, 72 deletions
diff --git a/fortune/fortune/fortune.c b/fortune/fortune/fortune.c
index 09ba4c45..1839e15e 100644
--- a/fortune/fortune/fortune.c
+++ b/fortune/fortune/fortune.c
@@ -1,4 +1,4 @@
-/* $NetBSD: fortune.c,v 1.17 1999/09/08 21:45:27 jsm Exp $ */
+/* $NetBSD: fortune.c,v 1.18 1999/09/08 21:57:16 jsm Exp $ */
/*-
* Copyright (c) 1986, 1993
@@ -46,7 +46,7 @@ __COPYRIGHT("@(#) Copyright (c) 1986, 1993\n\
#if 0
static char sccsid[] = "@(#)fortune.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: fortune.c,v 1.17 1999/09/08 21:45:27 jsm Exp $");
+__RCSID("$NetBSD: fortune.c,v 1.18 1999/09/08 21:57:16 jsm Exp $");
#endif
#endif /* not lint */
@@ -260,7 +260,7 @@ display(fp)
char line[BUFSIZ];
open_fp(fp);
- (void) fseek(fp->inf, (long)Seekpts[0], 0);
+ (void) fseek(fp->inf, (long)Seekpts[0], SEEK_SET);
for (Fort_len = 0; fgets(line, sizeof line, fp->inf) != NULL &&
!STR_ENDSTRING(line, fp->tbl); Fort_len++) {
if (fp->tbl.str_flags & STR_ROTATED) {
@@ -289,7 +289,7 @@ fortlen()
nchar = (Seekpts[1] - Seekpts[0] <= SLEN);
else {
open_fp(Fortfile);
- (void) fseek(Fortfile->inf, (long)Seekpts[0], 0);
+ (void) fseek(Fortfile->inf, (long)Seekpts[0], SEEK_SET);
nchar = 0;
while (fgets(line, sizeof line, Fortfile->inf) != NULL &&
!STR_ENDSTRING(line, Fortfile->tbl))
@@ -990,7 +990,7 @@ get_fort()
get_pos(fp);
open_dat(fp);
(void) lseek(fp->datfd,
- (off_t) (sizeof fp->tbl + fp->pos * sizeof Seekpts[0]), 0);
+ (off_t) (sizeof fp->tbl + fp->pos * sizeof Seekpts[0]), SEEK_SET);
read(fp->datfd, Seekpts, sizeof Seekpts);
BE64TOH(Seekpts[0]);
BE64TOH(Seekpts[1]);
diff --git a/fortune/strfile/strfile.c b/fortune/strfile/strfile.c
index 69357391..9218a507 100644
--- a/fortune/strfile/strfile.c
+++ b/fortune/strfile/strfile.c
@@ -1,4 +1,4 @@
-/* $NetBSD: strfile.c,v 1.10 1999/09/08 21:17:49 jsm Exp $ */
+/* $NetBSD: strfile.c,v 1.11 1999/09/08 21:57:17 jsm Exp $ */
/*-
* Copyright (c) 1989, 1993
@@ -46,7 +46,7 @@ __COPYRIGHT("@(#) Copyright (c) 1989, 1993\n\
#if 0
static char sccsid[] = "@(#)strfile.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: strfile.c,v 1.10 1999/09/08 21:17:49 jsm Exp $");
+__RCSID("$NetBSD: strfile.c,v 1.11 1999/09/08 21:57:17 jsm Exp $");
#endif
#endif /* not lint */
@@ -175,7 +175,7 @@ main(ac, av)
if ((outf = fopen(Outfile, "w")) == NULL)
err(1, "open `%s'", Outfile);
if (!STORING_PTRS)
- (void) fseek(outf, sizeof Tbl, 0);
+ (void) fseek(outf, sizeof Tbl, SEEK_SET);
/*
* Write the strings onto the file
@@ -243,7 +243,7 @@ main(ac, av)
Tbl.str_shortlen == 1 ? "" : "s");
}
- (void) fseek(outf, (off_t) 0, 0);
+ (void) fseek(outf, (off_t) 0, SEEK_SET);
HTOBE32(Tbl.str_version);
Tbl.str_numstr = htobe32(Num_pts - 1);
HTOBE32(Tbl.str_longlen);
@@ -411,8 +411,8 @@ cmp_str(vp1, vp2)
if (c1 != c2)
return c1 - c2;
- (void) fseek(Sort_1, p1->pos, 0);
- (void) fseek(Sort_2, p2->pos, 0);
+ (void) fseek(Sort_1, p1->pos, SEEK_SET);
+ (void) fseek(Sort_2, p2->pos, SEEK_SET);
n1 = FALSE;
n2 = FALSE;
diff --git a/fortune/unstr/unstr.c b/fortune/unstr/unstr.c
index 8d52fc35..b851c40f 100644
--- a/fortune/unstr/unstr.c
+++ b/fortune/unstr/unstr.c
@@ -1,4 +1,4 @@
-/* $NetBSD: unstr.c,v 1.5 1999/08/21 07:02:46 simonb Exp $ */
+/* $NetBSD: unstr.c,v 1.6 1999/09/08 21:57:17 jsm Exp $ */
/*-
* Copyright (c) 1991, 1993
@@ -46,7 +46,7 @@ __COPYRIGHT("@(#) Copyright (c) 1991, 1993\n\
#if 0
static char sccsid[] = "@(#)unstr.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: unstr.c,v 1.5 1999/08/21 07:02:46 simonb Exp $");
+__RCSID("$NetBSD: unstr.c,v 1.6 1999/09/08 21:57:17 jsm Exp $");
#endif
#endif /* not lint */
@@ -140,7 +140,7 @@ order_unstr(tbl)
for (i = 0; i < tbl->str_numstr; i++) {
(void) fread((char *) &pos, 1, sizeof pos, Dataf);
- (void) fseek(Inf, be64toh(pos), 0);
+ (void) fseek(Inf, be64toh(pos), SEEK_SET);
if (i != 0)
(void) printf("%c\n", Delimch);
for (;;) {
diff --git a/hangman/getword.c b/hangman/getword.c
index 3539c140..28fa3b8d 100644
--- a/hangman/getword.c
+++ b/hangman/getword.c
@@ -1,4 +1,4 @@
-/* $NetBSD: getword.c,v 1.5 1997/10/11 01:16:30 lukem Exp $ */
+/* $NetBSD: getword.c,v 1.6 1999/09/08 21:57:17 jsm Exp $ */
/*
* Copyright (c) 1983, 1993
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)getword.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: getword.c,v 1.5 1997/10/11 01:16:30 lukem Exp $");
+__RCSID("$NetBSD: getword.c,v 1.6 1999/09/08 21:57:17 jsm Exp $");
#endif
#endif /* not lint */
@@ -58,7 +58,7 @@ getword()
inf = Dict;
for (;;) {
pos = (double) rand() / (RAND_MAX + 1.0) * (double) Dict_size;
- fseek(inf, pos, 0);
+ fseek(inf, pos, SEEK_SET);
if (fgets(Word, BUFSIZ, inf) == NULL)
continue;
if (fgets(Word, BUFSIZ, inf) == NULL)
diff --git a/mille/save.c b/mille/save.c
index 3d9d17c2..a66ea38c 100644
--- a/mille/save.c
+++ b/mille/save.c
@@ -1,4 +1,4 @@
-/* $NetBSD: save.c,v 1.8 1999/09/08 21:17:51 jsm Exp $ */
+/* $NetBSD: save.c,v 1.9 1999/09/08 21:57:18 jsm Exp $ */
/*
* Copyright (c) 1983, 1993
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)save.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: save.c,v 1.8 1999/09/08 21:17:51 jsm Exp $");
+__RCSID("$NetBSD: save.c,v 1.9 1999/09/08 21:57:18 jsm Exp $");
#endif
#endif /* not lint */
@@ -152,7 +152,7 @@ rest_f(file)
char buf[80];
STAT sbuf;
- if ((inf = open(file, 0)) < 0) {
+ if ((inf = open(file, O_RDONLY)) < 0) {
warn("%s", file);
exit(1);
}
diff --git a/monop/cards.c b/monop/cards.c
index 489f25ee..079cc236 100644
--- a/monop/cards.c
+++ b/monop/cards.c
@@ -1,4 +1,4 @@
-/* $NetBSD: cards.c,v 1.8 1999/09/08 21:17:51 jsm Exp $ */
+/* $NetBSD: cards.c,v 1.9 1999/09/08 21:57:18 jsm Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)cards.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: cards.c,v 1.8 1999/09/08 21:17:51 jsm Exp $");
+__RCSID("$NetBSD: cards.c,v 1.9 1999/09/08 21:57:18 jsm Exp $");
#endif
#endif /* not lint */
@@ -136,7 +136,7 @@ get_card(dp)
OWN *op;
do {
- fseek(deckf, dp->offsets[dp->last_card], 0);
+ fseek(deckf, dp->offsets[dp->last_card], SEEK_SET);
dp->last_card = ++(dp->last_card) % dp->num_cards;
type_maj = getc(deckf);
} while (dp->gojf_used && type_maj == GOJF);
diff --git a/monop/initdeck.c b/monop/initdeck.c
index 99b2fb2a..e2cda3b7 100644
--- a/monop/initdeck.c
+++ b/monop/initdeck.c
@@ -1,4 +1,4 @@
-/* $NetBSD: initdeck.c,v 1.8 1999/09/08 21:17:52 jsm Exp $ */
+/* $NetBSD: initdeck.c,v 1.9 1999/09/08 21:57:18 jsm Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -43,7 +43,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 1993\n\
#if 0
static char sccsid[] = "@(#)initdeck.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: initdeck.c,v 1.8 1999/09/08 21:17:52 jsm Exp $");
+__RCSID("$NetBSD: initdeck.c,v 1.9 1999/09/08 21:57:18 jsm Exp $");
#endif
#endif /* not lint */
@@ -101,7 +101,7 @@ main(ac, av)
*/
CC_D.offsets = (off_t *)calloc(CC_D.num_cards + 1, sizeof (off_t));
CH_D.offsets = (off_t *)calloc(CH_D.num_cards + 1, sizeof (off_t));
- fseek(inf, 0L, 0);
+ fseek(inf, 0L, SEEK_SET);
if ((outf = fopen(outfile, "w")) == NULL) {
perror(outfile);
exit(0);
@@ -122,7 +122,7 @@ main(ac, av)
putem();
fclose(inf);
- fseek(outf, 0, 0L);
+ fseek(outf, 0, SEEK_SET);
/* number of community chest cards first... */
nc = htobe32(CC_D.num_cards);
diff --git a/phantasia/fight.c b/phantasia/fight.c
index 3fb9c6bf..f23c37a5 100644
--- a/phantasia/fight.c
+++ b/phantasia/fight.c
@@ -1,4 +1,4 @@
-/* $NetBSD: fight.c,v 1.4 1998/08/30 09:19:39 veego Exp $ */
+/* $NetBSD: fight.c,v 1.5 1999/09/08 21:57:18 jsm Exp $ */
/*
* fight.c Phantasia monster fighting routines
@@ -844,7 +844,7 @@ callmonster(which)
which = MIN(which, 99); /* make sure within range */
/* fill structure */
- fseek(Monstfp, (long) which * (long) SZ_MONSTERSTRUCT, 0);
+ fseek(Monstfp, (long) which * (long) SZ_MONSTERSTRUCT, SEEK_SET);
fread((char *) &Curmonster, SZ_MONSTERSTRUCT, 1, Monstfp);
/* handle some special monsters */
@@ -879,7 +879,7 @@ callmonster(which)
/* pick another name */
{
which = (int) ROLL(0.0, 100.0);
- fseek(Monstfp, (long) which * (long) SZ_MONSTERSTRUCT, 0);
+ fseek(Monstfp, (long) which * (long) SZ_MONSTERSTRUCT, SEEK_SET);
fread(&Othermonster, SZ_MONSTERSTRUCT, 1, Monstfp);
strcpy(Curmonster.m_name, Othermonster.m_name);
}
diff --git a/phantasia/gamesupport.c b/phantasia/gamesupport.c
index dbb3f0fd..6c6d8044 100644
--- a/phantasia/gamesupport.c
+++ b/phantasia/gamesupport.c
@@ -1,4 +1,4 @@
-/* $NetBSD: gamesupport.c,v 1.5 1999/09/08 21:17:53 jsm Exp $ */
+/* $NetBSD: gamesupport.c,v 1.6 1999/09/08 21:57:19 jsm Exp $ */
/*
* gamesupport.c - auxiliary routines for support of Phantasia
@@ -443,7 +443,7 @@ monstlist()
int count = 0; /* count in file */
puts(" #) Name Str Brain Quick Energy Exper Treas Type Flock%\n");
- fseek(Monstfp, 0L, 0);
+ fseek(Monstfp, 0L, SEEK_SET);
while (fread((char *) &Curmonster, SZ_MONSTERSTRUCT, 1, Monstfp) == 1)
printf("%2d) %-20.20s%4.0f %4.0f %2.0f %5.0f %5.0f %2d %2d %3.0f\n", count++,
Curmonster.m_name, Curmonster.m_strength, Curmonster.m_brains,
@@ -468,7 +468,7 @@ scorelist()
void
activelist()
{
- fseek(Playersfp, 0L, 0);
+ fseek(Playersfp, 0L, SEEK_SET);
printf("Current characters on file are:\n\n");
while (fread((char *) &Other, SZ_PLAYERSTRUCT, 1, Playersfp) == 1)
@@ -492,7 +492,7 @@ purgeoldplayers()
today = localtime(&ltime)->tm_yday;
for (;;) {
- fseek(Playersfp, loc, 0);
+ fseek(Playersfp, loc, SEEK_SET);
if (fread((char *) &Other, SZ_PLAYERSTRUCT, 1, Playersfp) != 1)
break;
@@ -543,7 +543,7 @@ enterscore()
strcpy(sbuf.sb_type, descrtype(&Player, TRUE));
}
/* update entry */
- fseek(fp, loc, 0);
+ fseek(fp, loc, SEEK_SET);
fwrite((char *) &sbuf, SZ_SCORESTRUCT, 1, fp);
fclose(fp);
}
diff --git a/phantasia/interplayer.c b/phantasia/interplayer.c
index 2344e0e9..3f215463 100644
--- a/phantasia/interplayer.c
+++ b/phantasia/interplayer.c
@@ -1,4 +1,4 @@
-/* $NetBSD: interplayer.c,v 1.4 1999/09/08 21:17:53 jsm Exp $ */
+/* $NetBSD: interplayer.c,v 1.5 1999/09/08 21:57:19 jsm Exp $ */
/*
* interplayer.c - player to player routines for Phantasia
@@ -12,7 +12,7 @@ checkbattle()
long foeloc = 0L; /* location in file of person to fight */
Users = 0;
- fseek(Playersfp, 0L, 0);
+ fseek(Playersfp, 0L, SEEK_SET);
while (fread((char *) &Other, SZ_PLAYERSTRUCT, 1, Playersfp) == 1) {
if (Other.p_status != S_OFF
@@ -356,7 +356,7 @@ checktampered()
long loc = 0L; /* location in energy void file */
/* first check for energy voids */
- fseek(Energyvoidfp, 0L, 0);
+ fseek(Energyvoidfp, 0L, SEEK_SET);
while (fread((char *) &Enrgyvoid, SZ_VOIDSTRUCT, 1, Energyvoidfp) == 1)
if (Enrgyvoid.ev_active
&& Enrgyvoid.ev_x == Player.p_x
@@ -508,7 +508,7 @@ tampered(what, arg1, arg2)
addstr("You made to position of Valar!\n");
Player.p_specialtype = SC_VALAR;
Player.p_lives = 5;
- fseek(Playersfp, 0L, 0);
+ fseek(Playersfp, 0L, SEEK_SET);
loc = 0L;
while (fread((char *) &Other, SZ_PLAYERSTRUCT, 1, Playersfp) == 1)
/* search for existing valar */
@@ -545,7 +545,7 @@ userlist(ingameflag)
mvaddstr(8, 0, "You cannot see anyone.\n");
return;
}
- fseek(Playersfp, 0L, 0);
+ fseek(Playersfp, 0L, SEEK_SET);
mvaddstr(8, 0,
"Name X Y Lvl Type Login Status\n");
@@ -607,7 +607,7 @@ throneroom()
if (Player.p_specialtype < SC_KING)
/* not already king -- assumes crown */
{
- fseek(Playersfp, 0L, 0);
+ fseek(Playersfp, 0L, SEEK_SET);
while (fread((char *) &Other, SZ_PLAYERSTRUCT, 1, Playersfp) == 1)
if (Other.p_specialtype == SC_KING && Other.p_status != S_NOTUSED)
/* found old king */
@@ -643,7 +643,7 @@ throneroom()
fclose(fp);
/* clear all energy voids; retain location of holy grail */
- fseek(Energyvoidfp, 0L, 0);
+ fseek(Energyvoidfp, 0L, SEEK_SET);
fread((char *) &Enrgyvoid, SZ_VOIDSTRUCT, 1, Energyvoidfp);
fp = fopen(_PATH_VOID, "w");
fwrite((char *) &Enrgyvoid, SZ_VOIDSTRUCT, 1, fp);
@@ -718,7 +718,7 @@ dotampered()
/* collect taxes */
{
fread((char *) &temp1, sizeof(double), 1, fp);
- fseek(fp, 0L, 0);
+ fseek(fp, 0L, SEEK_SET);
/* clear out value */
temp2 = 0.0;
fwrite((char *) &temp2, sizeof(double), 1, fp);
@@ -765,7 +765,7 @@ dotampered()
if (Player.p_palantir)
/* need a palantir to seek */
{
- fseek(Energyvoidfp, 0L, 0);
+ fseek(Energyvoidfp, 0L, SEEK_SET);
fread((char *) &Enrgyvoid, SZ_VOIDSTRUCT, 1, Energyvoidfp);
temp1 = distance(Player.p_x, Enrgyvoid.ev_x, Player.p_y, Enrgyvoid.ev_y);
temp1 += ROLL(-temp1 / 10.0, temp1 / 5.0); /* add some error */
@@ -865,10 +865,10 @@ writevoid(vp, loc)
long loc;
{
- fseek(Energyvoidfp, loc, 0);
+ fseek(Energyvoidfp, loc, SEEK_SET);
fwrite((char *) vp, SZ_VOIDSTRUCT, 1, Energyvoidfp);
fflush(Energyvoidfp);
- fseek(Energyvoidfp, 0L, 0);
+ fseek(Energyvoidfp, 0L, SEEK_SET);
}
long
@@ -876,7 +876,7 @@ allocvoid()
{
long loc = 0L; /* location of new energy void */
- fseek(Energyvoidfp, 0L, 0);
+ fseek(Energyvoidfp, 0L, SEEK_SET);
while (fread((char *) &Enrgyvoid, SZ_VOIDSTRUCT, 1, Energyvoidfp) == 1)
if (Enrgyvoid.ev_active)
loc += SZ_VOIDSTRUCT;
diff --git a/phantasia/main.c b/phantasia/main.c
index efa49e05..324c634e 100644
--- a/phantasia/main.c
+++ b/phantasia/main.c
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.7 1999/09/08 21:17:54 jsm Exp $ */
+/* $NetBSD: main.c,v 1.8 1999/09/08 21:57:19 jsm Exp $ */
/*
* Phantasia 3.3.2 -- Interterminal fantasy game
@@ -626,7 +626,7 @@ titlelist()
fclose(fp);
}
/* search for king */
- fseek(Playersfp, 0L, 0);
+ fseek(Playersfp, 0L, SEEK_SET);
while (fread((char *) &Other, SZ_PLAYERSTRUCT, 1, Playersfp) == 1)
if (Other.p_specialtype == SC_KING &&
Other.p_status != S_NOTUSED)
@@ -642,7 +642,7 @@ titlelist()
mvaddstr(4, 24, "There is no ruler at this time.");
/* search for valar */
- fseek(Playersfp, 0L, 0);
+ fseek(Playersfp, 0L, SEEK_SET);
while (fread((char *) &Other, SZ_PLAYERSTRUCT, 1, Playersfp) == 1)
if (Other.p_specialtype == SC_VALAR && Other.p_status != S_NOTUSED)
/* found the valar */
@@ -652,7 +652,7 @@ titlelist()
break;
}
/* search for council of the wise */
- fseek(Playersfp, 0L, 0);
+ fseek(Playersfp, 0L, SEEK_SET);
Lines = 10;
while (fread((char *) &Other, SZ_PLAYERSTRUCT, 1, Playersfp) == 1)
if (Other.p_specialtype == SC_COUNCIL && Other.p_status != S_NOTUSED)
@@ -671,7 +671,7 @@ titlelist()
hiexp = 0.0;
nxtlvl = hilvl = 0;
- fseek(Playersfp, 0L, 0);
+ fseek(Playersfp, 0L, SEEK_SET);
while (fread((char *) &Other, SZ_PLAYERSTRUCT, 1, Playersfp) == 1)
if (Other.p_experience > hiexp && Other.p_specialtype <= SC_KING && Other.p_status != S_NOTUSED)
/* highest found so far */
diff --git a/phantasia/misc.c b/phantasia/misc.c
index 89cd940b..098b5888 100644
--- a/phantasia/misc.c
+++ b/phantasia/misc.c
@@ -1,4 +1,4 @@
-/* $NetBSD: misc.c,v 1.5 1999/09/08 21:17:54 jsm Exp $ */
+/* $NetBSD: misc.c,v 1.6 1999/09/08 21:57:19 jsm Exp $ */
/*
* misc.c Phantasia miscellaneous support routines
@@ -513,7 +513,7 @@ findname(name, playerp)
{
long loc = 0; /* location in the file */
- fseek(Playersfp, 0L, 0);
+ fseek(Playersfp, 0L, SEEK_SET);
while (fread((char *) playerp, SZ_PLAYERSTRUCT, 1, Playersfp) == 1) {
if (strcmp(playerp->p_name, name) == 0) {
if (playerp->p_status != S_NOTUSED || Wizard)
@@ -531,7 +531,7 @@ allocrecord()
{
long loc = 0L; /* location in file */
- fseek(Playersfp, 0L, 0);
+ fseek(Playersfp, 0L, SEEK_SET);
while (fread((char *) &Other, SZ_PLAYERSTRUCT, 1, Playersfp) == 1) {
if (Other.p_status == S_NOTUSED)
/* found an empty record */
@@ -638,10 +638,10 @@ death(how)
{
mvaddstr(4, 0,
"Your ring has taken control of you and turned you into a monster!\n");
- fseek(Monstfp, 13L * SZ_MONSTERSTRUCT, 0);
+ fseek(Monstfp, 13L * SZ_MONSTERSTRUCT, SEEK_SET);
fread((char *) &Curmonster, SZ_MONSTERSTRUCT, 1, Monstfp);
strcpy(Curmonster.m_name, Player.p_name);
- fseek(Monstfp, 13L * SZ_MONSTERSTRUCT, 0);
+ fseek(Monstfp, 13L * SZ_MONSTERSTRUCT, SEEK_SET);
fwrite((char *) &Curmonster, SZ_MONSTERSTRUCT, 1, Monstfp);
fflush(Monstfp);
}
@@ -684,7 +684,7 @@ writerecord(playerp, place)
struct player *playerp;
long place;
{
- fseek(Playersfp, place, 0);
+ fseek(Playersfp, place, SEEK_SET);
fwrite((char *) playerp, SZ_PLAYERSTRUCT, 1, Playersfp);
fflush(Playersfp);
}
@@ -768,7 +768,7 @@ readrecord(playerp, loc)
struct player *playerp;
long loc;
{
- fseek(Playersfp, loc, 0);
+ fseek(Playersfp, loc, SEEK_SET);
fread((char *) playerp, SZ_PLAYERSTRUCT, 1, Playersfp);
}
@@ -928,7 +928,7 @@ readmessage()
{
move(3, 0);
clrtoeol();
- fseek(Messagefp, 0L, 0);
+ fseek(Messagefp, 0L, SEEK_SET);
if (fgets(Databuf, SZ_DATABUF, Messagefp) != NULL)
addstr(Databuf);
}
@@ -1064,7 +1064,7 @@ collecttaxes(gold, gems)
dtemp = 0.0;
fread((char *) &dtemp, sizeof(double), 1, fp);
dtemp += floor(taxes);
- fseek(fp, 0L, 0);
+ fseek(fp, 0L, SEEK_SET);
fwrite((char *) &dtemp, sizeof(double), 1, fp);
fclose(fp);
}
diff --git a/robots/score.c b/robots/score.c
index c22a7463..ddc8ce56 100644
--- a/robots/score.c
+++ b/robots/score.c
@@ -1,4 +1,4 @@
-/* $NetBSD: score.c,v 1.8 1999/09/08 21:17:57 jsm Exp $ */
+/* $NetBSD: score.c,v 1.9 1999/09/08 21:57:20 jsm Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)score.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: score.c,v 1.8 1999/09/08 21:17:57 jsm Exp $");
+__RCSID("$NetBSD: score.c,v 1.9 1999/09/08 21:57:20 jsm Exp $");
#endif
#endif /* not lint */
@@ -94,7 +94,7 @@ write_score(inf)
{
SCORE *scp;
- lseek(inf, 0L, 0);
+ lseek(inf, 0L, SEEK_SET);
max_uid = htonl(max_uid);
write(inf, &max_uid, sizeof max_uid);
diff --git a/sail/sync.c b/sail/sync.c
index db9f4834..8bab1a99 100644
--- a/sail/sync.c
+++ b/sail/sync.c
@@ -1,4 +1,4 @@
-/* $NetBSD: sync.c,v 1.11 1999/02/10 00:45:46 hubertf Exp $ */
+/* $NetBSD: sync.c,v 1.12 1999/09/08 21:57:20 jsm Exp $ */
/*
* Copyright (c) 1983, 1993
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)sync.c 8.2 (Berkeley) 4/28/95";
#else
-__RCSID("$NetBSD: sync.c,v 1.11 1999/02/10 00:45:46 hubertf Exp $");
+__RCSID("$NetBSD: sync.c,v 1.12 1999/09/08 21:57:20 jsm Exp $");
#endif
#endif /* not lint */
@@ -262,7 +262,7 @@ Sync()
}
if (n <= 0)
return -1;
- (void) fseek(sync_fp, sync_seek, 0);
+ (void) fseek(sync_fp, sync_seek, SEEK_SET);
for (;;) {
switch (fscanf(sync_fp, "%d%d%d", &type, &shipnum, &isstr)) {
case 3:
diff --git a/snake/snake/snake.c b/snake/snake/snake.c
index cd1957e5..a356a02f 100644
--- a/snake/snake/snake.c
+++ b/snake/snake/snake.c
@@ -1,4 +1,4 @@
-/* $NetBSD: snake.c,v 1.11 1999/09/08 21:45:31 jsm Exp $ */
+/* $NetBSD: snake.c,v 1.12 1999/09/08 21:57:21 jsm Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -43,7 +43,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 1993\n\
#if 0
static char sccsid[] = "@(#)snake.c 8.2 (Berkeley) 1/7/94";
#else
-__RCSID("$NetBSD: snake.c,v 1.11 1999/09/08 21:45:31 jsm Exp $");
+__RCSID("$NetBSD: snake.c,v 1.12 1999/09/08 21:57:21 jsm Exp $");
#endif
#endif /* not lint */
@@ -506,14 +506,14 @@ post(iscore, flag)
/* Figure out what happened in the past */
read(rawscores, &allbscore, sizeof(short));
read(rawscores, &allbwho, sizeof(short));
- lseek(rawscores, uid * sizeof(short), 0);
+ lseek(rawscores, uid * sizeof(short), SEEK_SET);
read(rawscores, &oldbest, sizeof(short));
if (!flag)
return (score > oldbest ? 1 : 0);
/* Update this jokers best */
if (score > oldbest) {
- lseek(rawscores, uid * sizeof(short), 0);
+ lseek(rawscores, uid * sizeof(short), SEEK_SET);
write(rawscores, &score, sizeof(short));
pr("You bettered your previous best of $%d\n", oldbest);
} else
@@ -522,7 +522,7 @@ post(iscore, flag)
/* See if we have a new champ */
p = getpwuid(allbwho);
if (p == NULL || score > allbscore) {
- lseek(rawscores, 0, 0);
+ lseek(rawscores, 0, SEEK_SET);
write(rawscores, &score, sizeof(short));
write(rawscores, &uid, sizeof(short));
if (allbwho)