comparison rogue4/things.c @ 235:2dcf10d45d5b

Rogue V4: add two more function declarations. Though it was called with different numbers of arguments, add_line() does not need to be a variadic function. Making the second argument mandatory is a better solution.
author John "Elwin" Edwards
date Mon, 07 Mar 2016 19:26:08 -0500
parents 1b73a8641b37
children ded75a57405c
comparison
equal deleted inserted replaced
234:c10fe421b8fb 235:2dcf10d45d5b
436 } 436 }
437 } while (!disc_list); 437 } while (!disc_list);
438 if (ch == '*') 438 if (ch == '*')
439 { 439 {
440 print_disc(POTION); 440 print_disc(POTION);
441 add_line(""); 441 add_line("", NULL);
442 print_disc(SCROLL); 442 print_disc(SCROLL);
443 add_line(""); 443 add_line("", NULL);
444 print_disc(RING); 444 print_disc(RING);
445 add_line(""); 445 add_line("", NULL);
446 print_disc(STICK); 446 print_disc(STICK);
447 end_line(); 447 end_line();
448 } 448 }
449 else 449 else
450 { 450 {
503 obj.o_which = order[i]; 503 obj.o_which = order[i];
504 add_line("%s", inv_name(&obj, FALSE)); 504 add_line("%s", inv_name(&obj, FALSE));
505 num_found++; 505 num_found++;
506 } 506 }
507 if (num_found == 0) 507 if (num_found == 0)
508 add_line(nothing(type)); 508 add_line(nothing(type), NULL);
509 } 509 }
510 510
511 /* 511 /*
512 * set_order: 512 * set_order:
513 * Set up order for list 513 * Set up order for list
531 531
532 /* 532 /*
533 * add_line: 533 * add_line:
534 * Add a line to the list of discoveries 534 * Add a line to the list of discoveries
535 */ 535 */
536 /* VARARGS1 */ 536 void
537 add_line(fmt, arg) 537 add_line(char *fmt, char *arg)
538 char *fmt, *arg;
539 { 538 {
540 if (line_cnt == 0) 539 if (line_cnt == 0)
541 { 540 {
542 wclear(hw); 541 wclear(hw);
543 if (slow_invent) 542 if (slow_invent)
544 mpos = 0; 543 mpos = 0;
545 } 544 }
546 if (slow_invent) 545 if (slow_invent)
547 { 546 {
548 if (*fmt != '\0') 547 if (fmt != NULL && *fmt != '\0')
549 msg(fmt, arg); 548 msg(fmt, arg);
550 line_cnt++; 549 line_cnt++;
551 } 550 }
552 else 551 else
553 { 552 {
573 572
574 /* 573 /*
575 * end_line: 574 * end_line:
576 * End the list of lines 575 * End the list of lines
577 */ 576 */
578 end_line() 577 void
578 end_line(void)
579 { 579 {
580 if (!slow_invent) 580 if (!slow_invent)
581 if (line_cnt == 1 && !newpage) 581 if (line_cnt == 1 && !newpage)
582 { 582 {
583 mpos = 0; 583 mpos = 0;
584 msg(lastfmt, lastarg); 584 msg(lastfmt, lastarg);
585 } 585 }
586 else 586 else
587 add_line(NULL); 587 add_line(NULL, NULL);
588 line_cnt = 0; 588 line_cnt = 0;
589 newpage = FALSE; 589 newpage = FALSE;
590 } 590 }
591 591
592 /* 592 /*