Mercurial > hg > early-roguelike
comparison arogue5/encumb.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 | 0ed67132cf10 |
children |
comparison
equal
deleted
inserted
replaced
217:94a0d9dd5ce1 | 218:56e748983fa8 |
---|---|
13 */ | 13 */ |
14 | 14 |
15 #include "curses.h" | 15 #include "curses.h" |
16 #include "rogue.h" | 16 #include "rogue.h" |
17 | 17 |
18 int packweight(void); | |
19 | |
18 /* | 20 /* |
19 * updpack: | 21 * updpack: |
20 * Update his pack weight and adjust fooduse accordingly | 22 * Update his pack weight and adjust fooduse accordingly |
21 */ | 23 */ |
22 updpack(getmax) | 24 void |
23 int getmax; | 25 updpack(bool getmax) |
24 { | 26 { |
25 | 27 |
26 reg int topcarry, curcarry; | 28 reg int topcarry, curcarry; |
27 | 29 |
28 if (getmax) | 30 if (getmax) |
43 | 45 |
44 /* | 46 /* |
45 * packweight: | 47 * packweight: |
46 * Get the total weight of the hero's pack | 48 * Get the total weight of the hero's pack |
47 */ | 49 */ |
48 packweight() | 50 int |
51 packweight(void) | |
49 { | 52 { |
50 reg struct object *obj; | 53 reg struct object *obj; |
51 reg struct linked_list *pc; | 54 reg struct linked_list *pc; |
52 reg int weight; | 55 reg int weight; |
53 | 56 |
66 | 69 |
67 /* | 70 /* |
68 * itemweight: | 71 * itemweight: |
69 * Get the weight of an object | 72 * Get the weight of an object |
70 */ | 73 */ |
71 itemweight(wh) | 74 int |
72 reg struct object *wh; | 75 itemweight(struct object *wh) |
73 { | 76 { |
74 reg int weight; | 77 reg int weight; |
75 reg int ac; | 78 reg int ac; |
76 | 79 |
77 weight = wh->o_weight; /* get base weight */ | 80 weight = wh->o_weight; /* get base weight */ |
97 | 100 |
98 /* | 101 /* |
99 * playenc: | 102 * playenc: |
100 * Get hero's carrying ability above norm | 103 * Get hero's carrying ability above norm |
101 */ | 104 */ |
102 playenc() | 105 int |
106 playenc(void) | |
103 { | 107 { |
104 return ((str_compute()-8)*50); | 108 return ((str_compute()-8)*50); |
105 } | 109 } |
106 | 110 |
107 | 111 |
108 /* | 112 /* |
109 * totalenc: | 113 * totalenc: |
110 * Get total weight that the hero can carry | 114 * Get total weight that the hero can carry |
111 */ | 115 */ |
112 totalenc() | 116 int |
117 totalenc(void) | |
113 { | 118 { |
114 reg int wtotal; | 119 reg int wtotal; |
115 | 120 |
116 wtotal = NORMENCB + playenc(); | 121 wtotal = NORMENCB + playenc(); |
117 switch(hungry_state) { | 122 switch(hungry_state) { |
128 /* | 133 /* |
129 * whgtchk: | 134 * whgtchk: |
130 * See if the hero can carry his pack | 135 * See if the hero can carry his pack |
131 */ | 136 */ |
132 | 137 |
133 wghtchk() | 138 void |
139 wghtchk(void) | |
134 { | 140 { |
135 reg int dropchk, err = TRUE; | 141 reg int dropchk, err = TRUE; |
136 reg char ch; | 142 reg char ch; |
137 int wghtchk(); | |
138 | 143 |
139 inwhgt = TRUE; | 144 inwhgt = TRUE; |
140 if (pstats.s_pack > pstats.s_carry) { | 145 if (pstats.s_pack > pstats.s_carry) { |
141 ch = CCHAR( mvwinch(stdscr, hero.y, hero.x) ); | 146 ch = CCHAR( mvwinch(stdscr, hero.y, hero.x) ); |
142 if((ch != FLOOR && ch != PASSAGE)) { | 147 if((ch != FLOOR && ch != PASSAGE)) { |
143 extinguish(wghtchk); | 148 extinguish(wghtchk); |
144 fuse(wghtchk,TRUE,1,AFTER); | 149 fuse(wghtchk,NULL,1,AFTER); |
145 inwhgt = FALSE; | 150 inwhgt = FALSE; |
146 return; | 151 return; |
147 } | 152 } |
148 extinguish(wghtchk); | 153 extinguish(wghtchk); |
149 msg("Your pack is too heavy for you"); | 154 msg("Your pack is too heavy for you"); |
167 * This returns a +1 hit for light pack weight | 172 * This returns a +1 hit for light pack weight |
168 * 0 hit for medium pack weight | 173 * 0 hit for medium pack weight |
169 * -1 hit for heavy pack weight | 174 * -1 hit for heavy pack weight |
170 */ | 175 */ |
171 | 176 |
172 hitweight() | 177 int |
178 hitweight(void) | |
173 { | 179 { |
174 return(2 - foodlev); | 180 return(2 - foodlev); |
175 } | 181 } |