From d8e9a0f7a319e27c8dbb4e5a1131bc02b365da76 Mon Sep 17 00:00:00 2001 From: fauxpark Date: Fri, 1 Feb 2019 11:40:12 +1100 Subject: Change return type of layer_switch_get_layer() to uint8_t (#5011) * Change return type of layer_switch_get_layer() to uint8_t * Keep loop index signed so we don't wrap around --- tmk_core/common/action_layer.c | 4 ++-- tmk_core/common/action_layer.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'tmk_core') diff --git a/tmk_core/common/action_layer.c b/tmk_core/common/action_layer.c index 6ff8c5549..47cad996a 100644 --- a/tmk_core/common/action_layer.c +++ b/tmk_core/common/action_layer.c @@ -296,7 +296,7 @@ action_t store_or_get_action(bool pressed, keypos_t key) { * * Gets the layer based on key info */ -int8_t layer_switch_get_layer(keypos_t key) { +uint8_t layer_switch_get_layer(keypos_t key) { #ifndef NO_ACTION_LAYER action_t action; action.code = ACTION_TRANSPARENT; @@ -304,7 +304,7 @@ int8_t layer_switch_get_layer(keypos_t key) { uint32_t layers = layer_state | default_layer_state; /* check top layer first */ for (int8_t i = 31; i >= 0; i--) { - if (layers & (1UL<