comparison arogue7/rings.c @ 219:f9ef86cf22b2

Advanced Rogue 7: convert to ANSI-style function declarations. Almost 1500 lines of compiler warnings remain, and the GCC developers are already working on a new version with even more warnings turned on by default.
author John "Elwin" Edwards
date Fri, 19 Feb 2016 21:02:28 -0500
parents cadff8f047a1
children e1cd27c5464f
comparison
equal deleted inserted replaced
218:56e748983fa8 219:f9ef86cf22b2
10 * 10 *
11 * See the file LICENSE.TXT for full copyright and licensing information. 11 * See the file LICENSE.TXT for full copyright and licensing information.
12 */ 12 */
13 13
14 #include <stdlib.h> 14 #include <stdlib.h>
15 #include <string.h>
15 #include "curses.h" 16 #include "curses.h"
16 #include "rogue.h" 17 #include "rogue.h"
17 18
18 /* 19 /*
19 * routines dealing specifically with rings 20 * routines dealing specifically with rings
21 22
22 23
23 /* 24 /*
24 * how much food does this ring use up? 25 * how much food does this ring use up?
25 */ 26 */
26 ring_eat(hand) 27 int
27 register int hand; 28 ring_eat(int hand)
28 { 29 {
29 if (cur_ring[hand] == NULL) 30 if (cur_ring[hand] == NULL)
30 return 0; 31 return 0;
31 switch (cur_ring[hand]->o_which) { 32 switch (cur_ring[hand]->o_which) {
32 case R_VAMPREGEN: 33 case R_VAMPREGEN:
46 return (-(cur_ring[hand]->o_ac)); 47 return (-(cur_ring[hand]->o_ac));
47 } 48 }
48 return 0; 49 return 0;
49 } 50 }
50 51
51 ring_on(item) 52 void
52 register struct linked_list *item; 53 ring_on(struct linked_list *item)
53 { 54 {
54 register struct object *obj; 55 register struct object *obj;
55 register int save_max; 56 register int save_max;
56 57
57 obj = OBJPTR(item); 58 obj = OBJPTR(item);
109 110
110 /* 111 /*
111 * print ring bonuses 112 * print ring bonuses
112 */ 113 */
113 char * 114 char *
114 ring_num(obj) 115 ring_num(struct object *obj)
115 register struct object *obj;
116 { 116 {
117 static char buf[5]; 117 static char buf[5];
118 118
119 if (!(obj->o_flags & ISKNOW)) 119 if (!(obj->o_flags & ISKNOW))
120 return ""; 120 return "";
144 } 144 }
145 145
146 /* 146 /*
147 * Return the effect of the specified ring 147 * Return the effect of the specified ring
148 */ 148 */
149 ring_value(type) 149 int
150 ring_value(int type)
150 { 151 {
151 int result = 0; 152 int result = 0;
152 153
153 if (ISRING(LEFT_1, type)) result += cur_ring[LEFT_1]->o_ac; 154 if (ISRING(LEFT_1, type)) result += cur_ring[LEFT_1]->o_ac;
154 if (ISRING(LEFT_2, type)) result += cur_ring[LEFT_2]->o_ac; 155 if (ISRING(LEFT_2, type)) result += cur_ring[LEFT_2]->o_ac;