Skip to content

Commit 7c650ad

Browse files
committed
fix pedantic warnings
The code now compiles under Apple clang version 17.0.0 with all warnings and pedantic warnings enabled. Fixed a number of problems related arguments of pointers to functions.
1 parent 7985601 commit 7c650ad

File tree

6 files changed

+13
-14
lines changed

6 files changed

+13
-14
lines changed

daemons.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ stomach(int d_arg __attribute__ ((__unused__)))
191191
* Take the hero down off her acid trip.
192192
*/
193193
void
194-
come_down(void)
194+
come_down(int d_arg __attribute__ ((__unused__)))
195195
{
196196
THING *tp;
197197
int seemonst;
@@ -287,7 +287,7 @@ visuals(int d_arg __attribute__ ((__unused__)))
287287
* Land from a levitation potion
288288
*/
289289
void
290-
land(void)
290+
land(int d_arg __attribute__ ((__unused__)))
291291
{
292292
player.t_flags &= ~ISLEVIT;
293293
msg(choose_str("bummer! You've hit the ground",

mdport.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1100,7 +1100,7 @@ int undo[5];
11001100
int uindex = -1;
11011101

11021102
int
1103-
reread()
1103+
reread(void)
11041104
{
11051105
int redo;
11061106

potions.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
typedef struct PACT
1818
{
1919
const int pa_flags;
20-
void (*pa_daemon)();
20+
void (*pa_daemon)(int);
2121
const int pa_time;
2222
const char *pa_high, *pa_straight;
2323
} PACT;
@@ -97,7 +97,7 @@ quaff(void)
9797
{
9898
chg_str(-(rnd(3) + 1));
9999
msg("you feel very sick now");
100-
come_down();
100+
come_down(0);
101101
}
102102
when P_HEALING:
103103
pot_info[P_HEALING].oi_know = TRUE;
@@ -183,7 +183,7 @@ quaff(void)
183183
pstats.s_hpt = ++max_hp;
184184
}
185185
sight(0);
186-
come_down();
186+
come_down(0);
187187
msg("you begin to feel much better");
188188
when P_HASTE:
189189
pot_info[P_HASTE].oi_know = TRUE;

rogue.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,7 @@ void chg_str(int amt);
572572
void check_level(void);
573573
const char *choose_str(const char *ts, const char *ns);
574574
void conn(int r1, int r2);
575-
void come_down(void);
575+
void come_down(int);
576576
void command(void);
577577
void create_obj(void);
578578
void current(const THING *cur, const char *how, const char *where);
@@ -605,8 +605,8 @@ void draw_room(const struct room *rp);
605605
void drop(void);
606606
int dropcheck(const THING *obj);
607607
void eat(void);
608-
int encclearerr();
609-
int encerror();
608+
int encclearerr(void);
609+
int encerror(void);
610610
void encseterr(int err);
611611
size_t encread(char *start, size_t size, FILE *inf);
612612
size_t encwrite(const char *start, size_t size, FILE *outf);
@@ -666,7 +666,7 @@ int is_symlink(const char *sp);
666666
void kill_daemon(void (*func)(int));
667667
void killed(THING *tp, int pr);
668668
const char *killname(int monst, int doart);
669-
void land(void);
669+
void land(int);
670670
void leave(int);
671671
THING *leave_pack(THING *obj, int newobj, int all);
672672
int levit_check(void);

save.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ restore(const char *file)
264264
static int encerrno = 0;
265265

266266
int
267-
encerror()
267+
encerror(void)
268268
{
269269
return encerrno;
270270
}
@@ -276,7 +276,7 @@ encseterr(int err)
276276
}
277277

278278
int
279-
encclearerr()
279+
encclearerr(void)
280280
{
281281
int n = encerrno;
282282

scedit.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,7 @@ static int seed;
4747
static FILE *finf;
4848
static char *scorefile;
4949

50-
struct passwd *getpwnam();
51-
int do_comm();
50+
int do_comm(void);
5251
int pr_score(SCORE *, int);
5352

5453

0 commit comments

Comments
 (0)