diff srogue/weapons.c @ 217:94a0d9dd5ce1

Super-Rogue: convert to ANSI-style function declarations. This fixes most of the build warnings.
author John "Elwin" Edwards
date Sun, 31 Jan 2016 13:45:07 -0500
parents 2128c7dc8a40
children e52a8a7ad4c5
line wrap: on
line diff
--- a/srogue/weapons.c	Thu Jan 28 18:55:47 2016 -0500
+++ b/srogue/weapons.c	Sun Jan 31 13:45:07 2016 -0500
@@ -14,6 +14,7 @@
  * See the file LICENSE.TXT for full copyright and licensing information.
  */
 
+#include <string.h>
 #include <ctype.h>
 #include "rogue.h"
 #include "rogue.ext"
@@ -22,8 +23,8 @@
  * missile:
  *	Fire a missile in a given direction
  */
-missile(ydelta, xdelta)
-int ydelta, xdelta;
+void
+missile(int ydelta, int xdelta)
 {
 	reg struct object *obj, *nowwield;
 	reg struct linked_list *item, *nitem;
@@ -83,9 +84,8 @@
  * do the actual motion on the screen done by an object traveling
  * across the room
  */
-do_motion(obj, ydelta, xdelta)
-struct object *obj;
-int ydelta, xdelta;
+void
+do_motion(struct object *obj, int ydelta, int xdelta)
 {
 	reg int ch, y, x;
 
@@ -120,9 +120,8 @@
  *	Drop an item someplace around here.
  */
 
-fall(item, pr)
-struct linked_list *item;
-bool pr;
+void
+fall(struct linked_list *item, bool pr)
 {
 	reg struct object *obj;
 	reg struct room *rp;
@@ -155,9 +154,8 @@
  *	Set up the initial goodies for a weapon
  */
 
-init_weapon(weap, type)
-struct object *weap;
-int type;
+void
+init_weapon(struct object *weap, int type)
 {
 	reg struct init_weps *iwp;
 
@@ -182,9 +180,8 @@
  * hit_monster:
  *	Does the missile hit the monster
  */
-hit_monster(mp, obj)
-struct coord *mp;
-struct object *obj;
+bool
+hit_monster(struct coord *mp, struct object *obj)
 {
 	return fight(mp, obj, TRUE);
 }
@@ -194,8 +191,7 @@
  *	Figure out the plus number for armor/weapons
  */
 char *
-num(n1, n2)
-int n1, n2;
+num(int n1, int n2)
 {
 	static char numbuf[LINLEN];
 
@@ -212,7 +208,8 @@
  * wield:
  *	Pull out a certain weapon
  */
-wield()
+void
+wield(void)
 {
 	reg struct linked_list *item;
 	reg struct object *obj, *oweapon;
@@ -238,9 +235,8 @@
  * fallpos:
  *	Pick a random position around the give (y, x) coordinates
  */
-fallpos(pos, newpos, passages)
-struct coord *pos, *newpos;
-bool passages;
+bool
+fallpos(struct coord *pos, struct coord *newpos, bool passages)
 {
 	reg int y, x, ch;