comparison arogue5/wizard.c @ 218:56e748983fa8

Advanced Rogue 5: convert to ANSI function declarations. This still leaves over a thousand lines of warning messages, mostly related to the return types of daemons and fuses.
author John "Elwin" Edwards
date Sun, 07 Feb 2016 14:39:21 -0500
parents c49f7927b0fa
children e52a8a7ad4c5
comparison
equal deleted inserted replaced
217:94a0d9dd5ce1 218:56e748983fa8
13 * See the file LICENSE.TXT for full copyright and licensing information. 13 * See the file LICENSE.TXT for full copyright and licensing information.
14 */ 14 */
15 15
16 #include "curses.h" 16 #include "curses.h"
17 #include <ctype.h> 17 #include <ctype.h>
18 #include <string.h>
18 #include <stdlib.h> 19 #include <stdlib.h>
19 #include "rogue.h" 20 #include "rogue.h"
20 21
21 22
22 /* 23 /*
23 * create_obj: 24 * create_obj:
24 * Create any object for wizard, scroll, magician, or cleric 25 * Create any object for wizard, scroll, magician, or cleric
25 */ 26 */
26 create_obj(prompt, which_item, which_type) 27 void
27 bool prompt; 28 create_obj(bool prompt, int which_item, int which_type)
28 int which_item, which_type;
29 { 29 {
30 reg struct linked_list *item; 30 reg struct linked_list *item;
31 reg struct object *obj; 31 reg struct object *obj;
32 reg int wh; 32 reg int wh;
33 reg char ch, newitem, newtype = 0, whc, msz, *pt; 33 reg char ch, newitem, newtype = 0, whc, msz, *pt;
309 309
310 /* 310 /*
311 * getbless: 311 * getbless:
312 * Get a blessing for a wizards object 312 * Get a blessing for a wizards object
313 */ 313 */
314 getbless() 314 int
315 getbless(void)
315 { 316 {
316 reg char bless; 317 reg char bless;
317 318
318 msg("Blessing? (+,-,n)"); 319 msg("Blessing? (+,-,n)");
319 bless = readchar(); 320 bless = readchar();
326 } 327 }
327 328
328 /* 329 /*
329 * get a non-monster death type 330 * get a non-monster death type
330 */ 331 */
331 getdeath() 332 int
333 getdeath(void)
332 { 334 {
333 register int i; 335 register int i;
334 int which_death; 336 int which_death;
335 char label[80]; 337 char label[80];
336 338
356 } 358 }
357 359
358 /* 360 /*
359 * make a monster for the wizard 361 * make a monster for the wizard
360 */ 362 */
361 makemonster(create) 363 short
362 bool create; 364 makemonster(bool create)
363 { 365 {
364 register int i; 366 register int i;
365 register short which_monst; 367 register short which_monst;
366 register int num_monst = NUMMONST, pres_monst=1, num_lines=2*(LINES-3); 368 register int num_monst = NUMMONST, pres_monst=1, num_lines=2*(LINES-3);
367 char monst_name[40]; 369 char monst_name[40];
368 370
369 /* Print out the monsters */ 371 /* Print out the monsters */
370 while (num_monst > 0) { 372 while (num_monst > 0) {
371 register left_limit; 373 register int left_limit;
372 374
373 if (num_monst < num_lines) left_limit = (num_monst+1)/2; 375 if (num_monst < num_lines) left_limit = (num_monst+1)/2;
374 else left_limit = num_lines/2; 376 else left_limit = num_lines/2;
375 377
376 wclear(hw); 378 wclear(hw);
428 /* 430 /*
429 * passwd: 431 * passwd:
430 * see if user knows password 432 * see if user knows password
431 */ 433 */
432 434
433 passwd() 435 bool
436 passwd(void)
434 { 437 {
435 register char *sp, c; 438 register char *sp, c;
436 char buf[LINELEN]; 439 char buf[LINELEN];
437 440
438 msg("Wizard's Password:"); 441 msg("Wizard's Password:");
455 /* 458 /*
456 * teleport: 459 * teleport:
457 * Bamf the hero someplace else 460 * Bamf the hero someplace else
458 */ 461 */
459 462
460 teleport() 463 int
464 teleport(void)
461 { 465 {
462 register struct room *new_rp, *old_rp = roomin(&hero); 466 register struct room *new_rp, *old_rp = roomin(&hero);
463 register int rm; 467 register int rm;
464 coord c; 468 coord c;
465 469
523 /* 527 /*
524 * whatis: 528 * whatis:
525 * What a certin object is 529 * What a certin object is
526 */ 530 */
527 531
528 whatis(what) 532 void
529 struct linked_list *what; 533 whatis(struct linked_list *what)
530 { 534 {
531 register struct object *obj; 535 register struct object *obj;
532 register struct linked_list *item; 536 register struct linked_list *item;
533 537
534 if (what == NULL) { /* do we need to ask which one? */ 538 if (what == NULL) { /* do we need to ask which one? */