summaryrefslogtreecommitdiffstats
path: root/phantasia/misc.c
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 /phantasia/misc.c
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.
Diffstat (limited to 'phantasia/misc.c')
-rw-r--r--phantasia/misc.c18
1 files changed, 9 insertions, 9 deletions
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);
}