Mercurial > hg > early-roguelike
comparison rogue4/init.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 |
comparison
equal
deleted
inserted
replaced
214:e5a15b09ce1d | 215:1b73a8641b37 |
---|---|
14 #include <ctype.h> | 14 #include <ctype.h> |
15 #include <stdlib.h> | 15 #include <stdlib.h> |
16 #include <string.h> | 16 #include <string.h> |
17 #include "rogue.h" | 17 #include "rogue.h" |
18 | 18 |
19 #ifdef WIZARD | |
20 void badcheck(char *name, struct magic_item *magic, int bound); | |
21 #endif | |
22 | |
19 /* | 23 /* |
20 * init_player: | 24 * init_player: |
21 * Roll up the rogue | 25 * Roll up the rogue |
22 */ | 26 */ |
23 init_player() | 27 void |
28 init_player(void) | |
24 { | 29 { |
25 register THING *obj; | 30 register THING *obj; |
26 | 31 |
27 pstats = max_stats; | 32 pstats = max_stats; |
28 food_left = HUNGERTIME; | 33 food_left = HUNGERTIME; |
234 | 239 |
235 /* | 240 /* |
236 * init_things | 241 * init_things |
237 * Initialize the probabilities for types of things | 242 * Initialize the probabilities for types of things |
238 */ | 243 */ |
239 init_things() | 244 void |
245 init_things(void) | |
240 { | 246 { |
241 register struct magic_item *mp; | 247 register struct magic_item *mp; |
242 | 248 |
243 for (mp = &things[1]; mp <= &things[NUMTHINGS-1]; mp++) | 249 for (mp = &things[1]; mp <= &things[NUMTHINGS-1]; mp++) |
244 mp->mi_prob += (mp-1)->mi_prob; | 250 mp->mi_prob += (mp-1)->mi_prob; |
249 | 255 |
250 /* | 256 /* |
251 * init_colors: | 257 * init_colors: |
252 * Initialize the potion color scheme for this time | 258 * Initialize the potion color scheme for this time |
253 */ | 259 */ |
254 init_colors() | 260 void |
261 init_colors(void) | |
255 { | 262 { |
256 register int i, j; | 263 register int i, j; |
257 bool used[NCOLORS]; | 264 bool used[NCOLORS]; |
258 | 265 |
259 for (i = 0; i < NCOLORS; i++) | 266 for (i = 0; i < NCOLORS; i++) |
279 * init_names: | 286 * init_names: |
280 * Generate the names of the various scrolls | 287 * Generate the names of the various scrolls |
281 */ | 288 */ |
282 #define MAXNAME 40 /* Max number of characters in a name */ | 289 #define MAXNAME 40 /* Max number of characters in a name */ |
283 | 290 |
284 init_names() | 291 void |
292 init_names(void) | |
285 { | 293 { |
286 register int nsyl; | 294 register int nsyl; |
287 register char *cp; | 295 register char *cp; |
288 const char *sp; | 296 const char *sp; |
289 register int i, nwords; | 297 register int i, nwords; |
320 | 328 |
321 /* | 329 /* |
322 * init_stones: | 330 * init_stones: |
323 * Initialize the ring stone setting scheme for this time | 331 * Initialize the ring stone setting scheme for this time |
324 */ | 332 */ |
325 init_stones() | 333 void |
334 init_stones(void) | |
326 { | 335 { |
327 register int i, j; | 336 register int i, j; |
328 bool used[NSTONES]; | 337 bool used[NSTONES]; |
329 | 338 |
330 for (i = 0; i < NSTONES; i++) | 339 for (i = 0; i < NSTONES; i++) |
349 | 358 |
350 /* | 359 /* |
351 * init_materials: | 360 * init_materials: |
352 * Initialize the construction materials for wands and staffs | 361 * Initialize the construction materials for wands and staffs |
353 */ | 362 */ |
354 init_materials() | 363 void |
364 init_materials(void) | |
355 { | 365 { |
356 register int i, j; | 366 register int i, j; |
357 register const char *str; | 367 register const char *str; |
358 bool metused[NMETAL], woodused[NWOOD]; | 368 bool metused[NMETAL], woodused[NWOOD]; |
359 | 369 |
400 #ifdef WIZARD | 410 #ifdef WIZARD |
401 /* | 411 /* |
402 * badcheck: | 412 * badcheck: |
403 * Check to see if a series of probabilities sums to 100 | 413 * Check to see if a series of probabilities sums to 100 |
404 */ | 414 */ |
405 badcheck(name, magic, bound) | 415 void |
406 char *name; | 416 badcheck(char *name, struct magic_item *magic, int bound) |
407 register struct magic_item *magic; | |
408 register int bound; | |
409 { | 417 { |
410 register struct magic_item *end; | 418 register struct magic_item *end; |
411 | 419 |
412 if (magic[bound - 1].mi_prob == 100) | 420 if (magic[bound - 1].mi_prob == 100) |
413 return; | 421 return; |