From 87b727d8c52e9aea44afee2e665c85df6fd8a002 Mon Sep 17 00:00:00 2001 From: Okke Formsma Date: Sat, 6 Feb 2021 20:57:06 +0100 Subject: [PATCH] refactor(hold-tap): improve switch statements --- app/src/behaviors/behavior_hold_tap.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/src/behaviors/behavior_hold_tap.c b/app/src/behaviors/behavior_hold_tap.c index cfee1af5..5319c083 100644 --- a/app/src/behaviors/behavior_hold_tap.c +++ b/app/src/behaviors/behavior_hold_tap.c @@ -279,8 +279,9 @@ static inline const char *flavor_str(enum flavor flavor) { return "balanced"; case FLAVOR_TAP_PREFERRED: return "tap-preferred"; + default: + return "UNKNOWN FLAVOR"; } - return "UNKNOWN FLAVOR"; } static inline const char *status_str(enum status status) { @@ -293,8 +294,9 @@ static inline const char *status_str(enum status status) { return "hold-interrupt"; case STATUS_TAP: return "tap"; + default: + return "UNKNOWN STATUS"; } - return "UNKNOWN STATUS"; } static inline const char *decision_moment_str(enum decision_moment decision_moment) { @@ -309,8 +311,9 @@ static inline const char *decision_moment_str(enum decision_moment decision_mome return "quick-tap"; case HT_TIMER_EVENT: return "timer"; + default: + return "UNKNOWN STATUS"; } - return "UNKNOWN STATUS"; } static int press_binding(struct active_hold_tap *hold_tap) {