diff srogue/trader.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 0250220d8cdd
line wrap: on
line diff
--- a/srogue/trader.c	Thu Jan 28 18:55:47 2016 -0500
+++ b/srogue/trader.c	Sun Jan 31 13:45:07 2016 -0500
@@ -11,16 +11,25 @@
  */
 
 #include <stdlib.h>
+#include <string.h>
 #include "rogue.h"
 #include "rogue.ext"
 
 #define NOTPRICED -1
 
+bool open_market(void);
+void trans_line(void);
+void draw_maze(void);
+int findcells(int y, int x);
+void rmwall(int newy, int newx, int oldy, int oldx);
+void crankout(void);
+
 /*
  * do_post:
  *	Put a trading post room and stuff on the screen
  */
-do_post()
+void
+do_post(void)
 {
 	struct coord tp;
 	reg int i;
@@ -66,7 +75,8 @@
  * price_it:
  *	Price the object that the hero stands on
  */
-price_it()
+bool
+price_it(void)
 {
 	static char *bargain[] = {
 		"great bargain",
@@ -100,7 +110,8 @@
  * buy_it:
  *	Buy the item on which the hero stands
  */
-buy_it()
+void
+buy_it(void)
 {
 	reg int wh;
 
@@ -151,7 +162,8 @@
  * sell_it:
  *	Sell an item to the trading post
  */
-sell_it()
+void
+sell_it(void)
 {
 	reg struct linked_list *item;
 	reg struct object *obj;
@@ -199,7 +211,8 @@
  * open_market:
  *	Retruns TRUE when ok do to transacting
  */
-open_market()
+bool
+open_market(void)
 {
 	if (trader >= MAXPURCH) {
 		msg("The market is closed. The stairs are that-a-way.");
@@ -213,8 +226,8 @@
  * get_worth:
  *	Calculate an objects worth in gold
  */
-get_worth(obj)
-struct object *obj;
+int
+get_worth(struct object *obj)
 {
 	reg int worth, wh;
 
@@ -272,7 +285,8 @@
  * trans_line:
  *	Show how many transactions the hero has left
  */
-trans_line()
+void
+trans_line(void)
 {
 	sprintf(prbuf,"You have %d transactions remaining.",MAXPURCH-trader);
 	mvwaddstr(cw, LINES - 4, 0, prbuf);
@@ -282,7 +296,8 @@
  * domaze:
  *	Draw the maze on this level.
  */
-do_maze()
+void
+do_maze(void)
 {
 	struct coord tp;
 	reg int i, least;
@@ -328,14 +343,16 @@
 } mborder;
 
 char *frontier, *bits;
-char *moffset(), *foffset();
+char *moffset(int y, int x);
+char *foffset(int y, int x);
 int tlines, tcols;
 
 /*
  * draw_maze:
  *	Generate and draw the maze on the screen
  */
-draw_maze()
+void
+draw_maze(void)
 {
 	reg int i, j, more;
 	reg char *ptr;
@@ -372,8 +389,7 @@
  *	Calculate memory address for bits
  */
 char *
-moffset(y, x)
-int y, x;
+moffset(int y, int x)
 {
 	char *ptr;
 
@@ -386,8 +402,7 @@
  *	Calculate memory address for frontier
  */
 char *
-foffset(y, x)
-int y, x;
+foffset(int y, int x)
 {
 	char *ptr;
 
@@ -399,8 +414,8 @@
  * findcells:
  *	Figure out cells to open up 
  */
-findcells(y,x)
-int x, y;
+int
+findcells(int y, int x)
 {
 	reg int rtpos, i;
 
@@ -450,8 +465,8 @@
  * rmwall:
  *	Removes appropriate walls from the maze
  */
-rmwall(newy, newx, oldy, oldx)
-int newy, newx, oldy, oldx;
+void
+rmwall(int newy, int newx, int oldy, int oldx)
 {
 	reg int xdif,ydif;
 	
@@ -467,7 +482,8 @@
  * crankout:
  *	Does actual drawing of maze to window
  */
-crankout()
+void
+crankout(void)
 {
 	reg int x, y, i;