comparison xrogue/daemon.c @ 228:b67b99f6c92b

Daemons and fuses now return void. Functions for starting and stopping daemons and fuses now expect the type 'void (*func)()'. Only a few functions in XRogue needed to be modified to fit. Determining the type of the argument is left for a later date. Building with GCC5 should now produce less than 200 lines of warnings per game.
author John "Elwin" Edwards
date Sat, 05 Mar 2016 20:49:37 -0500
parents f54901b9c39b
children 7c1cb43f346e
comparison
equal deleted inserted replaced
227:696277507a2e 228:b67b99f6c92b
72 * find_slot: 72 * find_slot:
73 * Find a particular slot in the table 73 * Find a particular slot in the table
74 */ 74 */
75 75
76 struct delayed_action * 76 struct delayed_action *
77 find_slot(int (*func)()) 77 find_slot(void (*func)())
78 { 78 {
79 reg int i; 79 reg int i;
80 reg struct delayed_action *dev; 80 reg struct delayed_action *dev;
81 81
82 for (i = 0, dev = f_list; i < MAXFUSES; i++, dev++) 82 for (i = 0, dev = f_list; i < MAXFUSES; i++, dev++)
89 * start_daemon: 89 * start_daemon:
90 * Start a daemon, takes a function. 90 * Start a daemon, takes a function.
91 */ 91 */
92 92
93 void 93 void
94 start_daemon(int (*dfunc)(), VOID *arg, int type) 94 start_daemon(void (*dfunc)(), VOID *arg, int type)
95 { 95 {
96 reg struct delayed_action *dev; 96 reg struct delayed_action *dev;
97 97
98 dev = d_slot(); 98 dev = d_slot();
99 if (dev != NULL) { 99 if (dev != NULL) {
109 * kill_daemon: 109 * kill_daemon:
110 * Remove a daemon from the list 110 * Remove a daemon from the list
111 */ 111 */
112 112
113 void 113 void
114 kill_daemon(int (*dfunc)()) 114 kill_daemon(void (*dfunc)())
115 { 115 {
116 reg struct delayed_action *dev; 116 reg struct delayed_action *dev;
117 reg int i; 117 reg int i;
118 118
119 for (i = 0, dev = d_list; i < MAXDAEMONS; i++, dev++) { 119 for (i = 0, dev = d_list; i < MAXDAEMONS; i++, dev++) {
162 * fuse: 162 * fuse:
163 * Start a fuse to go off in a certain number of turns 163 * Start a fuse to go off in a certain number of turns
164 */ 164 */
165 165
166 void 166 void
167 fuse(int (*dfunc)(), VOID *arg, int time, int type) 167 fuse(void (*dfunc)(), VOID *arg, int time, int type)
168 { 168 {
169 reg struct delayed_action *wire; 169 reg struct delayed_action *wire;
170 170
171 wire = f_slot(); 171 wire = f_slot();
172 if (wire != NULL) { 172 if (wire != NULL) {
182 * lengthen: 182 * lengthen:
183 * Increase the time until a fuse goes off 183 * Increase the time until a fuse goes off
184 */ 184 */
185 185
186 void 186 void
187 lengthen(int (*dfunc)(), int xtime) 187 lengthen(void (*dfunc)(), int xtime)
188 { 188 {
189 reg struct delayed_action *wire; 189 reg struct delayed_action *wire;
190 190
191 if ((wire = find_slot(dfunc)) == NULL) 191 if ((wire = find_slot(dfunc)) == NULL)
192 return; 192 return;
197 * extinguish: 197 * extinguish:
198 * Put out a fuse 198 * Put out a fuse
199 */ 199 */
200 200
201 void 201 void
202 extinguish(int (*dfunc)()) 202 extinguish(void (*dfunc)())
203 { 203 {
204 reg struct delayed_action *wire; 204 reg struct delayed_action *wire;
205 205
206 if ((wire = find_slot(dfunc)) == NULL) 206 if ((wire = find_slot(dfunc)) == NULL)
207 return; 207 return;