changeset 239:837044d2c362

Merge the GCC5 and build fix branches. This fixes all warnings produced by GCC 5, except the ones related to system functions. Those could be fixed by including the proper headers, but it would be better to replace the system-dependent code with functions from mdport.c.
author John "Elwin" Edwards
date Fri, 11 Mar 2016 19:47:52 -0500
parents bac2c81fec78 (current diff) e1cd27c5464f (diff)
children 163bd1fd4766
files
diffstat 52 files changed, 416 insertions(+), 392 deletions(-) [+]
line wrap: on
line diff
--- a/arogue5/daemon.c	Tue Mar 08 19:45:41 2016 -0500
+++ b/arogue5/daemon.c	Fri Mar 11 19:47:52 2016 -0500
@@ -70,7 +70,7 @@
  *	Find a particular slot in the table
  */
 struct delayed_action *
-find_slot(int (*func)())
+find_slot(void (*func)())
 {
 	reg int i;
 	reg struct delayed_action *dev;
@@ -87,7 +87,7 @@
  *	Start a daemon, takes a function.
  */
 void
-start_daemon(int (*func)(), void *arg, int type)
+start_daemon(void (*func)(), void *arg, int type)
 {
 	reg struct delayed_action *dev;
 
@@ -107,7 +107,7 @@
  *	Remove a daemon from the list
  */
 void
-kill_daemon(int (*func)())
+kill_daemon(void (*func)())
 {
 	reg struct delayed_action *dev;
 	reg int i;
@@ -155,7 +155,7 @@
  *	Start a fuse to go off in a certain number of turns
  */
 void
-fuse(int (*func)(), void *arg, int time, int type)
+fuse(void (*func)(), void *arg, int time, int type)
 {
 	reg struct delayed_action *wire;
 
@@ -175,7 +175,7 @@
  *	Increase the time until a fuse goes off
  */
 void
-lengthen(int (*func)(), int xtime)
+lengthen(void (*func)(), int xtime)
 {
 	reg struct delayed_action *wire;
 
@@ -190,7 +190,7 @@
  *	Put out a fuse
  */
 void
-extinguish(int (*func)())
+extinguish(void (*func)())
 {
 	reg struct delayed_action *wire;
 
--- a/arogue5/fight.c	Tue Mar 08 19:45:41 2016 -0500
+++ b/arogue5/fight.c	Fri Mar 11 19:47:52 2016 -0500
@@ -20,17 +20,18 @@
 
 bool roll_em(struct thing *att_er, struct thing *def_er, struct object *weap, 
              bool hurl, struct object *cur_weapon, bool back_stab);
-void hit(struct object *weapon, struct thing *tp, char *er, char *ee, 
-         bool back_stab);
-void miss(struct object *weapon, struct thing *tp, char *er, char *ee);
+void hit(struct object *weapon, struct thing *tp, const char *er,
+         const char *ee, bool back_stab);
+void miss(struct object *weapon, struct thing *tp, const char *er, 
+          const char *ee);
 int dext_plus(int dexterity);
 int str_plus(short str);
 int add_dam(short str);
 int hung_dam(void);
-void thunk(struct object *weap, struct thing *tp, char *mname);
-void m_thunk(struct object *weap, struct thing *tp, char *mname);
-void bounce(struct object *weap, struct thing *tp, char *mname);
-void m_bounce(struct object *weap, struct thing *tp, char *mname);
+void thunk(struct object *weap, struct thing *tp, const char *mname);
+void m_thunk(struct object *weap, struct thing *tp, const char *mname);
+void bounce(struct object *weap, struct thing *tp, const char *mname);
+void m_bounce(struct object *weap, struct thing *tp, const char *mname);
 struct object *wield_weap(struct object *thrown, struct thing *mp);
 void explode(struct thing *tp);
 
@@ -1037,7 +1038,7 @@
  */
 
 char *
-prname(char *who, bool upper)
+prname(const char *who, bool upper)
 {
     static char tbuf[LINELEN];
 
@@ -1062,7 +1063,8 @@
  */
 
 void
-hit(struct object *weapon, struct thing *tp, char *er, char *ee, bool back_stab)
+hit(struct object *weapon, struct thing *tp, const char *er, const char *ee, 
+    bool back_stab)
 {
     register char *s = NULL;
     char 
@@ -1119,7 +1121,7 @@
  */
 
 void
-miss(struct object *weapon, struct thing *tp, char *er, char *ee)
+miss(struct object *weapon, struct thing *tp, const char *er, const char *ee)
 {
     register char *s = NULL;
     char
@@ -1226,7 +1228,7 @@
  */
 
 void
-thunk(struct object *weap, struct thing *tp, char *mname)
+thunk(struct object *weap, struct thing *tp, const char *mname)
 {
     /* tp: Defender */
     char *def_name;	/* Name of defender */
@@ -1254,7 +1256,7 @@
  */
 
 void
-m_thunk(struct object *weap, struct thing *tp, char *mname)
+m_thunk(struct object *weap, struct thing *tp, const char *mname)
 {
     char *att_name;	/* Name of attacker */
 
@@ -1281,7 +1283,7 @@
  */
 
 void
-bounce(struct object *weap, struct thing *tp, char *mname)
+bounce(struct object *weap, struct thing *tp, const char *mname)
 {
     /* tp: Defender */
     char *def_name;	/* Name of defender */
@@ -1309,7 +1311,7 @@
  */