comparison srogue/encumb.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
comparison
equal deleted inserted replaced
216:b24545357d2e 217:94a0d9dd5ce1
8 * All rights reserved. 8 * All rights reserved.
9 * 9 *
10 * See the file LICENSE.TXT for full copyright and licensing information. 10 * See the file LICENSE.TXT for full copyright and licensing information.
11 */ 11 */
12 12
13 #include <string.h>
13 #include "rogue.h" 14 #include "rogue.h"
14 #include "rogue.ext" 15 #include "rogue.ext"
15 16
17 int packweight(void);
18 int pack_vol(void);
19
16 /* 20 /*
17 * updpack: 21 * updpack:
18 * Update his pack weight and adjust fooduse accordingly 22 * Update his pack weight and adjust fooduse accordingly
19 */ 23 */
20 updpack() 24 void
25 updpack(void)
21 { 26 {
22 reg int topcarry, curcarry; 27 reg int topcarry, curcarry;
23 28
24 him->s_carry = totalenc(); /* get total encumb */ 29 him->s_carry = totalenc(); /* get total encumb */
25 curcarry = packweight(); /* get pack weight */ 30 curcarry = packweight(); /* get pack weight */
42 47
43 /* 48 /*
44 * packweight: 49 * packweight:
45 * Get the total weight of the hero's pack 50 * Get the total weight of the hero's pack
46 */ 51 */
47 packweight() 52 int
53 packweight(void)
48 { 54 {
49 reg struct object *obj; 55 reg struct object *obj;
50 reg struct linked_list *pc; 56 reg struct linked_list *pc;
51 reg int weight, i; 57 reg int weight, i;
52 58
70 76
71 /* 77 /*
72 * itemweight: 78 * itemweight:
73 * Get the weight of an object 79 * Get the weight of an object
74 */ 80 */
75 itemweight(wh) 81 int
76 struct object *wh; 82 itemweight(struct object *wh)
77 { 83 {
78 reg int weight; 84 reg int weight;
79 85
80 weight = wh->o_weight; /* get base weight */ 86 weight = wh->o_weight; /* get base weight */
81 switch (wh->o_type) { 87 switch (wh->o_type) {
95 101
96 /* 102 /*
97 * pack_vol: 103 * pack_vol:
98 * Get the total volume of the hero's pack 104 * Get the total volume of the hero's pack
99 */ 105 */
100 pack_vol() 106 int
107 pack_vol(void)
101 { 108 {
102 reg struct object *obj; 109 reg struct object *obj;
103 reg struct linked_list *pc; 110 reg struct linked_list *pc;
104 reg int volume; 111 reg int volume;
105 112
113 120
114 /* 121 /*
115 * itemvol: 122 * itemvol:
116 * Get the volume of an object 123 * Get the volume of an object
117 */ 124 */
118 itemvol(wh) 125 int
119 struct object *wh; 126 itemvol(struct object *wh)
120 { 127 {
121 reg int volume, what, extra; 128 reg int volume, what, extra;
122 129
123 extra = 0; 130 extra = 0;
124 what = getindex(wh->o_type); 131 what = getindex(wh->o_type);
137 144
138 /* 145 /*
139 * playenc: 146 * playenc:
140 * Get hero's carrying ability above norm 147 * Get hero's carrying ability above norm
141 */ 148 */
142 playenc() 149 int
143 { 150 playenc(void)
144 reg estr = him->s_ef.a_str; 151 {
152 reg int estr = him->s_ef.a_str;
145 if (estr >= 24) 153 if (estr >= 24)
146 return 3000; 154 return 3000;
147 switch(him->s_ef.a_str) { 155 switch(him->s_ef.a_str) {
148 case 23: return 2000; 156 case 23: return 2000;
149 case 22: return 1500; 157 case 22: return 1500;
172 180
173 /* 181 /*
174 * totalenc: 182 * totalenc:
175 * Get total weight that the hero can carry 183 * Get total weight that the hero can carry
176 */ 184 */
177 totalenc() 185 int
186 totalenc(void)
178 { 187 {
179 reg int wtotal; 188 reg int wtotal;
180 189
181 wtotal = NORMENCB + playenc(); 190 wtotal = NORMENCB + playenc();
182 switch(hungry_state) { 191 switch(hungry_state) {
190 199
191 /* 200 /*
192 * whgtchk: 201 * whgtchk:
193 * See if the hero can carry his pack 202 * See if the hero can carry his pack
194 */ 203 */
195 wghtchk(fromfuse) 204 void
196 int fromfuse; 205 wghtchk(int fromfuse)
197 { 206 {
198 reg int dropchk, err = TRUE; 207 reg int dropchk, err = TRUE;
199 reg char ch; 208 reg char ch;
200 209
201 inwhgt = TRUE; 210 inwhgt = TRUE;
229 * Gets the fighting ability according to current weight 238 * Gets the fighting ability according to current weight
230 * This returns a +1 hit for light pack weight 239 * This returns a +1 hit for light pack weight
231 * 0 hit for medium pack weight 240 * 0 hit for medium pack weight
232 * -1 hit for heavy pack weight 241 * -1 hit for heavy pack weight
233 */ 242 */
234 hitweight() 243 int
244 hitweight(void)
235 { 245 {
236 return(2 - foodlev); 246 return(2 - foodlev);
237 } 247 }