comparison srogue/command.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 576cc8154521
children e52a8a7ad4c5
comparison
equal deleted inserted replaced
216:b24545357d2e 217:94a0d9dd5ce1
27 #include <process.h> 27 #include <process.h>
28 #else 28 #else
29 #include <unistd.h> 29 #include <unistd.h>
30 #endif 30 #endif
31 31
32 void search(void);
33 void help(void);
34 void d_level(void);
35 void u_level(void);
36 void shell(void);
37 void call(void);
38
32 /* 39 /*
33 * command: 40 * command:
34 * Process the user commands 41 * Process the user commands
35 */ 42 */
36 command() 43 void
44 command(void)
37 { 45 {
38 reg char ch; 46 reg char ch;
39 reg int ntimes = 1; /* Number of player moves */ 47 reg int ntimes = 1; /* Number of player moves */
40 static char countch, direction, newcount = FALSE; 48 static char countch, direction, newcount = FALSE;
41 49
414 /* 422 /*
415 * search: 423 * search:
416 * Player gropes about him to find hidden things. 424 * Player gropes about him to find hidden things.
417 */ 425 */
418 426
419 search() 427 void
428 search(void)
420 { 429 {
421 reg int x, y; 430 reg int x, y;
422 reg char ch; 431 reg char ch;
423 432
424 /* 433 /*
459 468
460 /* 469 /*
461 * help: 470 * help:
462 * Give single character help, or the whole mess if he wants it 471 * Give single character help, or the whole mess if he wants it
463 */ 472 */
464 help() 473 void
474 help(void)
465 { 475 {
466 extern struct h_list helpstr[]; 476 extern struct h_list helpstr[];
467 reg struct h_list *strp; 477 reg struct h_list *strp;
468 reg char helpch; 478 reg char helpch;
469 reg int cnt; 479 reg int cnt;
517 /* 527 /*
518 * identify: 528 * identify:
519 * Tell the player what a certain thing is. 529 * Tell the player what a certain thing is.
520 */ 530 */
521 char * 531 char *
522 identify(what) 532 identify(int what)
523 int what;
524 { 533 {
525 reg char ch, *str; 534 reg char ch, *str;
526 535
527 if (what == 0) { 536 if (what == 0) {
528 msg("What do you want identified? "); 537 msg("What do you want identified? ");
579 588
580 /* 589 /*
581 * d_level: 590 * d_level:
582 * He wants to go down a level 591 * He wants to go down a level
583 */ 592 */
584 d_level() 593 void
594 d_level(void)
585 { 595 {
586 if (winat(hero.y, hero.x) != STAIRS) 596 if (winat(hero.y, hero.x) != STAIRS)
587 msg("I see no way down."); 597 msg("I see no way down.");
588 else { 598 else {
589 if (pl_on(ISHELD)) { 599 if (pl_on(ISHELD)) {
597 607
598 /* 608 /*
599 * u_level: 609 * u_level:
600 * He wants to go up a level 610 * He wants to go up a level
601 */ 611 */
602 u_level() 612 void
613 u_level(void)
603 { 614 {
604 if (winat(hero.y, hero.x) == STAIRS) { 615 if (winat(hero.y, hero.x) == STAIRS) {
605 if (pl_on(ISHELD)) { 616 if (pl_on(ISHELD)) {
606 msg("You are being held."); 617 msg("You are being held.");
607 return; 618 return;
622 633
623 634
624 /* 635 /*
625 * Let him escape for a while 636 * Let him escape for a while
626 */ 637 */
627 shell() 638 void
639 shell(void)
628 { 640 {
629 reg int pid; 641 reg int pid;
630 reg char *sh; 642 reg char *sh;
631 int ret_status; 643 int ret_status;
632 644
657 669
658 /* 670 /*
659 * call: 671 * call:
660 * Allow a user to call a potion, scroll, or ring something 672 * Allow a user to call a potion, scroll, or ring something
661 */ 673 */
662 call() 674 void
675 call(void)
663 { 676 {
664 reg struct object *obj; 677 reg struct object *obj;
665 reg struct linked_list *item; 678 reg struct linked_list *item;
666 reg char **guess, *elsewise; 679 reg char **guess, *elsewise;
667 int wh; 680 int wh;