Mercurial > hg > early-roguelike
comparison srogue/misc.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 |
comparison
equal
deleted
inserted
replaced
| 216:b24545357d2e | 217:94a0d9dd5ce1 |
|---|---|
| 20 | 20 |
| 21 /* | 21 /* |
| 22 * waste_time: | 22 * waste_time: |
| 23 * Do nothing but let other things happen | 23 * Do nothing but let other things happen |
| 24 */ | 24 */ |
| 25 waste_time() | 25 void |
| 26 waste_time(void) | |
| 26 { | 27 { |
| 27 if (inwhgt) /* if from wghtchk, then done */ | 28 if (inwhgt) /* if from wghtchk, then done */ |
| 28 return; | 29 return; |
| 29 do_daemons(BEFORE); | 30 do_daemons(BEFORE); |
| 30 do_daemons(AFTER); | 31 do_daemons(AFTER); |
| 33 | 34 |
| 34 /* | 35 /* |
| 35 * getindex: | 36 * getindex: |
| 36 * Convert a type into an index for the things structures | 37 * Convert a type into an index for the things structures |
| 37 */ | 38 */ |
| 38 getindex(what) | 39 int |
| 39 char what; | 40 getindex(char what) |
| 40 { | 41 { |
| 41 int index = -1; | 42 int index = -1; |
| 42 | 43 |
| 43 switch (what) { | 44 switch (what) { |
| 44 case POTION: index = TYP_POTION; | 45 case POTION: index = TYP_POTION; |
| 56 /* | 57 /* |
| 57 * tr_name: | 58 * tr_name: |
| 58 * print the name of a trap | 59 * print the name of a trap |
| 59 */ | 60 */ |
| 60 char * | 61 char * |
| 61 tr_name(ch) | 62 tr_name(char ch) |
| 62 char ch; | |
| 63 { | 63 { |
| 64 reg char *s; | 64 reg char *s; |
| 65 | 65 |
| 66 switch (ch) { | 66 switch (ch) { |
| 67 case TRAPDOOR: | 67 case TRAPDOOR: |
| 90 | 90 |
| 91 /* | 91 /* |
| 92 * Look: | 92 * Look: |
| 93 * A quick glance all around the player | 93 * A quick glance all around the player |
| 94 */ | 94 */ |
| 95 look(wakeup) | 95 void |
| 96 bool wakeup; | 96 look(bool wakeup) |
| 97 { | 97 { |
| 98 reg char ch; | 98 reg char ch; |
| 99 reg int oldx, oldy, y, x; | 99 reg int oldx, oldy, y, x; |
| 100 reg struct room *rp; | 100 reg struct room *rp; |
| 101 int ey, ex, oex, oey; | 101 int ey, ex, oex, oey; |
| 228 /* | 228 /* |
| 229 * find_obj: | 229 * find_obj: |
| 230 * find the unclaimed object at y, x | 230 * find the unclaimed object at y, x |
| 231 */ | 231 */ |
| 232 struct linked_list * | 232 struct linked_list * |
| 233 find_obj(y, x) | 233 find_obj(int y, int x) |
| 234 int y, x; | |
| 235 { | 234 { |
| 236 reg struct linked_list *obj; | 235 reg struct linked_list *obj; |
| 237 reg struct object *op; | 236 reg struct object *op; |
| 238 | 237 |
| 239 for (obj = lvl_obj; obj != NULL; obj = next(obj)) { | 238 for (obj = lvl_obj; obj != NULL; obj = next(obj)) { |
| 246 | 245 |
| 247 /* | 246 /* |
| 248 * eat: | 247 * eat: |
| 249 * Let the hero eat some food. | 248 * Let the hero eat some food. |
| 250 */ | 249 */ |
| 251 eat() | 250 void |
| 251 eat(void) | |
| 252 { | 252 { |
| 253 reg struct linked_list *item; | 253 reg struct linked_list *item; |
| 254 reg struct object *obj; | 254 reg struct object *obj; |
| 255 reg int goodfood, cursed; | 255 reg int goodfood, cursed; |
| 256 | 256 |
| 295 | 295 |
| 296 /* | 296 /* |
| 297 * aggravate: | 297 * aggravate: |
| 298 * aggravate all the monsters on this level | 298 * aggravate all the monsters on this level |
| 299 */ | 299 */ |
| 300 aggravate() | 300 void |
| 301 aggravate(void) | |
| 301 { | 302 { |
| 302 reg struct linked_list *mi; | 303 reg struct linked_list *mi; |
| 303 | 304 |
| 304 for (mi = mlist; mi != NULL; mi = next(mi)) | 305 for (mi = mlist; mi != NULL; mi = next(mi)) |
| 305 runto(&(THINGPTR(mi))->t_pos, &hero); | 306 runto(&(THINGPTR(mi))->t_pos, &hero); |
| 308 /* | 309 /* |
| 309 * vowelstr: | 310 * vowelstr: |
| 310 * If string starts with a vowel, return "n" for an "an" | 311 * If string starts with a vowel, return "n" for an "an" |
| 311 */ | 312 */ |
| 312 char * | 313 char * |
| 313 vowelstr(str) | 314 vowelstr(char *str) |
| 314 char *str; | |
| 315 { | 315 { |
| 316 switch (tolower(*str)) { | 316 switch (tolower(*str)) { |
| 317 case 'a': | 317 case 'a': |
| 318 case 'e': | 318 case 'e': |
| 319 case 'i': | 319 case 'i': |
| 327 | 327 |
| 328 /* | 328 /* |
| 329 * is_current: | 329 * is_current: |
| 330 * See if the object is one of the currently used items | 330 * See if the object is one of the currently used items |
| 331 */ | 331 */ |
| 332 is_current(obj) | 332 bool |
| 333 struct object *obj; | 333 is_current(struct object *obj) |
| 334 { | 334 { |
| 335 if (obj == NULL) | 335 if (obj == NULL) |
| 336 return FALSE; | 336 return FALSE; |
| 337 if (obj == cur_armor || obj == cur_weapon || obj == cur_ring[LEFT] | 337 if (obj == cur_armor || obj == cur_weapon || obj == cur_ring[LEFT] |
| 338 || obj == cur_ring[RIGHT]) { | 338 || obj == cur_ring[RIGHT]) { |
| 344 | 344 |
| 345 /* | 345 /* |
| 346 * get_dir: | 346 * get_dir: |
| 347 * Set up the direction coordinates | 347 * Set up the direction coordinates |
| 348 */ | 348 */ |
| 349 get_dir() | 349 bool |
| 350 get_dir(void) | |
| 350 { | 351 { |
| 351 reg char *prompt; | 352 reg char *prompt; |
| 352 reg bool gotit; | 353 reg bool gotit; |
| 353 | 354 |
| 354 prompt = "Direction: "; | 355 prompt = "Direction: "; |
| 382 | 383 |
| 383 /* | 384 /* |
| 384 * initfood: | 385 * initfood: |
| 385 * Set up stuff for a food-type object | 386 * Set up stuff for a food-type object |
| 386 */ | 387 */ |
| 387 initfood(what) | 388 void |
| 388 struct object *what; | 389 initfood(struct object *what) |
| 389 { | 390 { |
| 390 what->o_type = FOOD; | 391 what->o_type = FOOD; |
| 391 what->o_group = NORMFOOD; | 392 what->o_group = NORMFOOD; |
| 392 if (rnd(100) < 15) | 393 if (rnd(100) < 15) |
| 393 what->o_group = FRUITFOOD; | 394 what->o_group = FRUITFOOD; |
