Mercurial > hg > early-roguelike
comparison arogue5/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 | 56e748983fa8 |
| children | 0250220d8cdd |
comparison
equal
deleted
inserted
replaced
| 227:696277507a2e | 228:b67b99f6c92b |
|---|---|
| 68 /* | 68 /* |
| 69 * find_slot: | 69 * find_slot: |
| 70 * Find a particular slot in the table | 70 * Find a particular slot in the table |
| 71 */ | 71 */ |
| 72 struct delayed_action * | 72 struct delayed_action * |
| 73 find_slot(int (*func)()) | 73 find_slot(void (*func)()) |
| 74 { | 74 { |
| 75 reg int i; | 75 reg int i; |
| 76 reg struct delayed_action *dev; | 76 reg struct delayed_action *dev; |
| 77 | 77 |
| 78 for (i = 0, dev = f_list; i < MAXFUSES; i++, dev++) | 78 for (i = 0, dev = f_list; i < MAXFUSES; i++, dev++) |
| 85 /* | 85 /* |
| 86 * start_daemon: | 86 * start_daemon: |
| 87 * Start a daemon, takes a function. | 87 * Start a daemon, takes a function. |
| 88 */ | 88 */ |
| 89 void | 89 void |
| 90 start_daemon(int (*func)(), void *arg, int type) | 90 start_daemon(void (*func)(), void *arg, int type) |
| 91 { | 91 { |
| 92 reg struct delayed_action *dev; | 92 reg struct delayed_action *dev; |
| 93 | 93 |
| 94 dev = d_slot(); | 94 dev = d_slot(); |
| 95 if (dev != NULL) { | 95 if (dev != NULL) { |
| 105 /* | 105 /* |
| 106 * kill_daemon: | 106 * kill_daemon: |
| 107 * Remove a daemon from the list | 107 * Remove a daemon from the list |
| 108 */ | 108 */ |
| 109 void | 109 void |
| 110 kill_daemon(int (*func)()) | 110 kill_daemon(void (*func)()) |
| 111 { | 111 { |
| 112 reg struct delayed_action *dev; | 112 reg struct delayed_action *dev; |
| 113 reg int i; | 113 reg int i; |
| 114 | 114 |
| 115 for (i = 0, dev = d_list; i < MAXDAEMONS; i++, dev++) { | 115 for (i = 0, dev = d_list; i < MAXDAEMONS; i++, dev++) { |
| 153 /* | 153 /* |
| 154 * fuse: | 154 * fuse: |
| 155 * Start a fuse to go off in a certain number of turns | 155 * Start a fuse to go off in a certain number of turns |
| 156 */ | 156 */ |
| 157 void | 157 void |
| 158 fuse(int (*func)(), void *arg, int time, int type) | 158 fuse(void (*func)(), void *arg, int time, int type) |
| 159 { | 159 { |
| 160 reg struct delayed_action *wire; | 160 reg struct delayed_action *wire; |
| 161 | 161 |
| 162 wire = f_slot(); | 162 wire = f_slot(); |
| 163 if (wire != NULL) { | 163 if (wire != NULL) { |
| 173 /* | 173 /* |
| 174 * lengthen: | 174 * lengthen: |
| 175 * Increase the time until a fuse goes off | 175 * Increase the time until a fuse goes off |
| 176 */ | 176 */ |
| 177 void | 177 void |
| 178 lengthen(int (*func)(), int xtime) | 178 lengthen(void (*func)(), int xtime) |
| 179 { | 179 { |
| 180 reg struct delayed_action *wire; | 180 reg struct delayed_action *wire; |
| 181 | 181 |
| 182 if ((wire = find_slot(func)) == NULL) | 182 if ((wire = find_slot(func)) == NULL) |
| 183 return; | 183 return; |
| 188 /* | 188 /* |
| 189 * extinguish: | 189 * extinguish: |
| 190 * Put out a fuse | 190 * Put out a fuse |
| 191 */ | 191 */ |
| 192 void | 192 void |
| 193 extinguish(int (*func)()) | 193 extinguish(void (*func)()) |
| 194 { | 194 { |
| 195 reg struct delayed_action *wire; | 195 reg struct delayed_action *wire; |
| 196 | 196 |
| 197 if ((wire = find_slot(func)) == NULL) | 197 if ((wire = find_slot(func)) == NULL) |
| 198 return; | 198 return; |
