comparison arogue5/trader.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 ad2570b5b21f
comparison
equal deleted inserted replaced
217:94a0d9dd5ce1 218:56e748983fa8
12 * See the file LICENSE.TXT for full copyright and licensing information. 12 * See the file LICENSE.TXT for full copyright and licensing information.
13 */ 13 */
14 14
15 #include "curses.h" 15 #include "curses.h"
16 #include "rogue.h" 16 #include "rogue.h"
17 #include <ctype.h>
17 #include <string.h> 18 #include <string.h>
18 19
19 20 bool open_market(void);
20 21 void trans_line(void);
22 char *typ_name(struct object *obj);
21 23
22 24
23 /* 25 /*
24 * buy_it: 26 * buy_it:
25 * Buy the item on which the hero stands 27 * Buy the item on which the hero stands
26 */ 28 */
27 buy_it() 29 void
30 buy_it(void)
28 { 31 {
29 reg int wh; 32 reg int wh;
30 struct linked_list *item; 33 struct linked_list *item;
31 34
32 if (purse <= 0) { 35 if (purse <= 0) {
75 78
76 /* 79 /*
77 * do_post: 80 * do_post:
78 * Put a trading post room and stuff on the screen 81 * Put a trading post room and stuff on the screen
79 */ 82 */
80 do_post() 83 void
84 do_post(void)
81 { 85 {
82 coord tp; 86 coord tp;
83 reg int i; 87 reg int i;
84 reg struct room *rp; 88 reg struct room *rp;
85 reg struct object *op; 89 reg struct object *op;
122 126
123 /* 127 /*
124 * get_worth: 128 * get_worth:
125 * Calculate an objects worth in gold 129 * Calculate an objects worth in gold
126 */ 130 */
127 get_worth(obj) 131 int
128 reg struct object *obj; 132 get_worth(struct object *obj)
129 { 133 {
130 reg int worth, wh; 134 reg int worth, wh;
131 135
132 worth = 0; 136 worth = 0;
133 wh = obj->o_which; 137 wh = obj->o_which;
193 197
194 /* 198 /*
195 * open_market: 199 * open_market:
196 * Retruns TRUE when ok do to transacting 200 * Retruns TRUE when ok do to transacting
197 */ 201 */
198 open_market() 202 bool
203 open_market(void)
199 { 204 {
200 if (trader >= MAXPURCH && !wizard) { 205 if (trader >= MAXPURCH && !wizard) {
201 msg("The market is closed. The stairs are that-a-way."); 206 msg("The market is closed. The stairs are that-a-way.");
202 return FALSE; 207 return FALSE;
203 } 208 }
208 213
209 /* 214 /*
210 * price_it: 215 * price_it:
211 * Price the object that the hero stands on 216 * Price the object that the hero stands on
212 */ 217 */
213 price_it() 218 bool
219 price_it(void)
214 { 220 {
215 reg struct linked_list *item; 221 reg struct linked_list *item;
216 reg struct object *obj; 222 reg struct object *obj;
217 reg int worth; 223 reg int worth;
218 reg char *str; 224 reg char *str;
242 248
243 /* 249 /*
244 * sell_it: 250 * sell_it:
245 * Sell an item to the trading post 251 * Sell an item to the trading post
246 */ 252 */
247 sell_it() 253 void
254 sell_it(void)
248 { 255 {
249 reg struct linked_list *item; 256 reg struct linked_list *item;
250 reg struct object *obj; 257 reg struct object *obj;
251 reg int wo, ch; 258 reg int wo, ch;
252 259
289 296
290 /* 297 /*
291 * trans_line: 298 * trans_line:
292 * Show how many transactions the hero has left 299 * Show how many transactions the hero has left
293 */ 300 */
294 trans_line() 301 void
302 trans_line(void)
295 { 303 {
296 if (!wizard) 304 if (!wizard)
297 sprintf(prbuf,"You have %d transactions remaining.", 305 sprintf(prbuf,"You have %d transactions remaining.",
298 MAXPURCH - trader); 306 MAXPURCH - trader);
299 else 307 else
307 /* 315 /*
308 * typ_name: 316 * typ_name:
309 * Return the name for this type of object 317 * Return the name for this type of object
310 */ 318 */
311 char * 319 char *
312 typ_name(obj) 320 typ_name(struct object *obj)
313 reg struct object *obj;
314 { 321 {
315 static char buff[20]; 322 static char buff[20];
316 reg int wh; 323 reg int wh;
317 324
318 switch (obj->o_type) { 325 switch (obj->o_type) {