comparison rogue4/weapons.c @ 215:1b73a8641b37

rogue4: fix most GCC5 warnings. Converting all function definitions to ANSI style accounts for most of the change. This has exposed other problems, such as daemons not actually being their stated type, that will require more careful solutions.
author John "Elwin" Edwards
date Wed, 27 Jan 2016 19:41:05 -0500
parents 9535a08ddc39
children 0250220d8cdd
comparison
equal deleted inserted replaced
214:e5a15b09ce1d 215:1b73a8641b37
37 37
38 /* 38 /*
39 * missile: 39 * missile:
40 * Fire a missile in a given direction 40 * Fire a missile in a given direction
41 */ 41 */
42 missile(ydelta, xdelta) 42 void
43 int ydelta, xdelta; 43 missile(int ydelta, int xdelta)
44 { 44 {
45 register THING *obj, *nitem; 45 register THING *obj, *nitem;
46 46
47 /* 47 /*
48 * Get which thing we are hurling 48 * Get which thing we are hurling
84 /* 84 /*
85 * do_motion: 85 * do_motion:
86 * Do the actual motion on the screen done by an object traveling 86 * Do the actual motion on the screen done by an object traveling
87 * across the room 87 * across the room
88 */ 88 */
89 do_motion(obj, ydelta, xdelta) 89 void
90 register THING *obj; 90 do_motion(THING *obj, int ydelta, int xdelta)
91 register int ydelta, xdelta;
92 { 91 {
93 /* 92 /*
94 * Come fly with us ... 93 * Come fly with us ...
95 */ 94 */
96 obj->o_pos = hero; 95 obj->o_pos = hero;
127 126
128 /* 127 /*
129 * fall: 128 * fall:
130 * Drop an item someplace around here. 129 * Drop an item someplace around here.
131 */ 130 */
132 fall(obj, pr) 131 void
133 register THING *obj; 132 fall(THING *obj, bool pr)
134 register bool pr;
135 { 133 {
136 static coord fpos; 134 static coord fpos;
137 register int index; 135 register int index;
138 136
139 if (fallpos(&obj->o_pos, &fpos, TRUE)) 137 if (fallpos(&obj->o_pos, &fpos, TRUE))
161 159
162 /* 160 /*
163 * init_weapon: 161 * init_weapon:
164 * Set up the initial goodies for a weapon 162 * Set up the initial goodies for a weapon
165 */ 163 */
166 init_weapon(weap, type) 164 void
167 register THING *weap; 165 init_weapon(THING *weap, char type)
168 char type;
169 { 166 {
170 register struct init_weps *iwp; 167 register struct init_weps *iwp;
171 168
172 iwp = &init_dam[type]; 169 iwp = &init_dam[type];
173 strncpy(weap->o_damage, iwp->iw_dam, 8); 170 strncpy(weap->o_damage, iwp->iw_dam, 8);
185 182
186 /* 183 /*
187 * hit_monster: 184 * hit_monster:
188 * Does the missile hit the monster? 185 * Does the missile hit the monster?
189 */ 186 */
190 hit_monster(y, x, obj) 187 bool
191 register int y, x; 188 hit_monster(int y, int x, THING *obj)
192 THING *obj;
193 { 189 {
194 static coord mp; 190 static coord mp;
195 191
196 mp.y = y; 192 mp.y = y;
197 mp.x = x; 193 mp.x = x;
201 /* 197 /*
202 * num: 198 * num:
203 * Figure out the plus number for armor/weapons 199 * Figure out the plus number for armor/weapons
204 */ 200 */
205 char * 201 char *
206 num(n1, n2, type) 202 num(int n1, int n2, char type)
207 register int n1, n2;
208 register char type;
209 { 203 {
210 static char numbuf[10]; 204 static char numbuf[10];
211 205
212 sprintf(numbuf, "%s%d", n1 < 0 ? "" : "+", n1); 206 sprintf(numbuf, "%s%d", n1 < 0 ? "" : "+", n1);
213 if (type == WEAPON) 207 if (type == WEAPON)
217 211
218 /* 212 /*
219 * wield: 213 * wield:
220 * Pull out a certain weapon 214 * Pull out a certain weapon
221 */ 215 */
222 wield() 216 void
217 wield(void)
223 { 218 {
224 register THING *obj, *oweapon; 219 register THING *obj, *oweapon;
225 register char *sp; 220 register char *sp;
226 221
227 oweapon = cur_weapon; 222 oweapon = cur_weapon;
255 250
256 /* 251 /*
257 * fallpos: 252 * fallpos:
258 * Pick a random position around the give (y, x) coordinates 253 * Pick a random position around the give (y, x) coordinates
259 */ 254 */
260 fallpos(pos, newpos, pass) 255 bool
261 register coord *pos, *newpos; 256 fallpos(coord *pos, coord *newpos, bool pass)
262 register bool pass;
263 { 257 {
264 register int y, x, cnt, ch; 258 register int y, x, cnt, ch;
265 259
266 cnt = 0; 260 cnt = 0;
267 for (y = pos->y - 1; y <= pos->y + 1; y++) 261 for (y = pos->y - 1; y <= pos->y + 1; y++)