hooks: Make the _add functions emit a deprecation warning

Turn the `event_handler_hook_add` and `loop_hook_add` aliases into real
functions, that emit a deprecation warning during compilation. This makes it a
little bit easier to see what needs to be updated still.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
pull/91/head
Gergely Nagy 8 years ago
parent e349f882e7
commit 452f3bfc28

@ -24,6 +24,11 @@ event_handler_hook_use (custom_handler_t hook) {
event_handler_hook_append (hook);
}
void
event_handler_hook_add (custom_handler_t hook) {
event_handler_hook_use (hook);
}
void
loop_hook_replace (custom_loop_t oldHook, custom_loop_t newHook) {
for (byte i = 0; i < HOOK_MAX; i++) {
@ -47,3 +52,8 @@ loop_hook_use (custom_loop_t hook) {
}
loop_hook_append (hook);
}
void
loop_hook_add (custom_loop_t hook) {
loop_hook_use (hook);
}

@ -28,13 +28,13 @@ extern custom_handler_t eventHandlers[HOOK_MAX];
void event_handler_hook_use (custom_handler_t hook);
void event_handler_hook_append (custom_handler_t hook);
void event_handler_hook_add (custom_handler_t hook) __attribute__((deprecated));
void event_handler_hook_replace (custom_handler_t oldHook, custom_handler_t newHook);
#define event_handler_hook_add event_handler_hook_use
typedef void (*custom_loop_t)(bool postClear);
extern custom_loop_t loopHooks[HOOK_MAX];
void loop_hook_use (custom_loop_t hook);
void loop_hook_append (custom_loop_t hook);
void loop_hook_add (custom_loop_t hook) __attribute__((deprecated));
void loop_hook_replace (custom_loop_t oldHook, custom_loop_t newHook);
#define loop_hook_add loop_hook_use

Loading…
Cancel
Save