comparison rogue4/command.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 f871cb0539d3
children e52a8a7ad4c5
comparison
equal deleted inserted replaced
214:e5a15b09ce1d 215:1b73a8641b37
17 #include <string.h> 17 #include <string.h>
18 #include "rogue.h" 18 #include "rogue.h"
19 19
20 char countch, direction, newcount = FALSE; 20 char countch, direction, newcount = FALSE;
21 21
22 void call(void);
23 void d_level(void);
24 void help(void);
25 void identify(void);
26 void illcom(char ch);
27 void search(void);
28 void u_level(void);
29
30 #ifdef WIZARD
31 extern void add_pass(void);
32 extern void create_obj(void);
33 extern bool passwd(void);
34 extern void show_map(void);
35 #endif
36
22 /* 37 /*
23 * command: 38 * command:
24 * Process the user commands 39 * Process the user commands
25 */ 40 */
26 command() 41 void
42 command(void)
27 { 43 {
28 register char ch; 44 register char ch;
29 register int ntimes = 1; /* Number of player moves */ 45 register int ntimes = 1; /* Number of player moves */
30 char *unctrol();
31 46
32 if (on(player, ISHASTE)) 47 if (on(player, ISHASTE))
33 ntimes++; 48 ntimes++;
34 /* 49 /*
35 * Let the daemons start up 50 * Let the daemons start up
342 357
343 /* 358 /*
344 * illcom: 359 * illcom:
345 * What to do with an illegal command 360 * What to do with an illegal command
346 */ 361 */
347 illcom(ch) 362 void
348 char ch; 363 illcom(char ch)
349 { 364 {
350 save_msg = FALSE; 365 save_msg = FALSE;
351 count = 0; 366 count = 0;
352 msg("illegal command '%s'", unctrol(ch)); 367 msg("illegal command '%s'", unctrol(ch));
353 save_msg = TRUE; 368 save_msg = TRUE;
355 370
356 /* 371 /*
357 * search: 372 * search:
358 * Player gropes about him to find hidden things. 373 * Player gropes about him to find hidden things.
359 */ 374 */
360 search() 375 void
376 search(void)
361 { 377 {
362 register int y, x; 378 register int y, x;
363 register char *fp; 379 register char *fp;
364 register int ey, ex; 380 register int ey, ex;
365 381
398 414
399 /* 415 /*
400 * help: 416 * help:
401 * Give single character help, or the whole mess if he wants it 417 * Give single character help, or the whole mess if he wants it
402 */ 418 */
403 help() 419 void
420 help(void)
404 { 421 {
405 register const struct h_list *strp = helpstr; 422 register const struct h_list *strp = helpstr;
406 register char helpch; 423 register char helpch;
407 register int cnt; 424 register int cnt;
408 425
455 472
456 /* 473 /*
457 * identify: 474 * identify:
458 * Tell the player what a certain thing is. 475 * Tell the player what a certain thing is.
459 */ 476 */
460 identify() 477 void
478 identify(void)
461 { 479 {
462 register char ch; 480 register char ch;
463 register const char *str; 481 register const char *str;
464 482
465 msg("what do you want identified? "); 483 msg("what do you want identified? ");
500 518
501 /* 519 /*
502 * d_level: 520 * d_level:
503 * He wants to go down a level 521 * He wants to go down a level
504 */ 522 */
505 d_level() 523 void
524 d_level(void)
506 { 525 {
507 if (chat(hero.y, hero.x) != STAIRS) 526 if (chat(hero.y, hero.x) != STAIRS)
508 msg("I see no way down"); 527 msg("I see no way down");
509 else 528 else
510 { 529 {
515 534
516 /* 535 /*
517 * u_level: 536 * u_level:
518 * He wants to go up a level 537 * He wants to go up a level
519 */ 538 */
520 u_level() 539 void
540 u_level(void)
521 { 541 {
522 if (chat(hero.y, hero.x) == STAIRS) 542 if (chat(hero.y, hero.x) == STAIRS)
523 if (amulet) 543 if (amulet)
524 { 544 {
525 level--; 545 level--;
536 556
537 /* 557 /*
538 * call: 558 * call:
539 * Allow a user to call a potion, scroll, or ring something 559 * Allow a user to call a potion, scroll, or ring something
540 */ 560 */
541 call() 561 void
562 call(void)
542 { 563 {
543 register THING *obj; 564 register THING *obj;
544 register char **guess; 565 register char **guess;
545 const char *elsewise; 566 const char *elsewise;
546 register bool *know; 567 register bool *know;