comparison rogue4/rings.c @ 215:1b73a8641b37

rogue4: fix most GCC5 warnings. Converting all function definitions to ANSI style accounts for most of the change. This has exposed other problems, such as daemons not actually being their stated type, that will require more careful solutions.
author John "Elwin" Edwards
date Wed, 27 Jan 2016 19:41:05 -0500
parents 9535a08ddc39
children
comparison
equal deleted inserted replaced
214:e5a15b09ce1d 215:1b73a8641b37
12 12
13 #include <curses.h> 13 #include <curses.h>
14 #include <string.h> 14 #include <string.h>
15 #include "rogue.h" 15 #include "rogue.h"
16 16
17 int gethand(void);
18
17 /* 19 /*
18 * ring_on: 20 * ring_on:
19 * Put a ring on a hand 21 * Put a ring on a hand
20 */ 22 */
21 ring_on() 23 void
24 ring_on(void)
22 { 25 {
23 register THING *obj; 26 register THING *obj;
24 register int ring; 27 register int ring;
25 28
26 obj = get_item("put on", RING); 29 obj = get_item("put on", RING);
86 89
87 /* 90 /*
88 * ring_off: 91 * ring_off:
89 * Take off a ring 92 * Take off a ring
90 */ 93 */
91 ring_off() 94 void
95 ring_off(void)
92 { 96 {
93 register int ring; 97 register int ring;
94 register THING *obj; 98 register THING *obj;
95 register char packchar; 99 register char packchar;
96 100
123 127
124 /* 128 /*
125 * gethand: 129 * gethand:
126 * Which hand is the hero interested in? 130 * Which hand is the hero interested in?
127 */ 131 */
128 gethand() 132 int
133 gethand(void)
129 { 134 {
130 register int c; 135 register int c;
131 136
132 for (;;) 137 for (;;)
133 { 138 {
151 156
152 /* 157 /*
153 * ring_eat: 158 * ring_eat:
154 * How much food does this ring use up? 159 * How much food does this ring use up?
155 */ 160 */
156 ring_eat(hand) 161 int
157 register int hand; 162 ring_eat(int hand)
158 { 163 {
159 if (cur_ring[hand] == NULL) 164 if (cur_ring[hand] == NULL)
160 return 0; 165 return 0;
161 switch (cur_ring[hand]->o_which) 166 switch (cur_ring[hand]->o_which)
162 { 167 {
184 /* 189 /*
185 * ring_num: 190 * ring_num:
186 * Print ring bonuses 191 * Print ring bonuses
187 */ 192 */
188 char * 193 char *
189 ring_num(obj) 194 ring_num(THING *obj)
190 register THING *obj;
191 { 195 {
192 static char buf[5]; 196 static char buf[5];
193 197
194 if (!(obj->o_flags & ISKNOW)) 198 if (!(obj->o_flags & ISKNOW))
195 return ""; 199 return "";