diff options
| author | fauxpark <fauxpark@gmail.com> | 2019-02-01 11:40:12 +1100 |
|---|---|---|
| committer | Drashna Jaelre <drashna@live.com> | 2019-01-31 16:40:12 -0800 |
| commit | d8e9a0f7a319e27c8dbb4e5a1131bc02b365da76 (patch) | |
| tree | e09444b0853f5dacf20a6124701a28ba13ee7fff /tmk_core/common/action_layer.c | |
| parent | 8c5c1fd7fe8866f61081ec4cf953f48352d7c088 (diff) | |
| download | qmk_firmware-d8e9a0f7a319e27c8dbb4e5a1131bc02b365da76.tar.gz qmk_firmware-d8e9a0f7a319e27c8dbb4e5a1131bc02b365da76.zip | |
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
Diffstat (limited to 'tmk_core/common/action_layer.c')
| -rw-r--r-- | tmk_core/common/action_layer.c | 4 |
1 files changed, 2 insertions, 2 deletions
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) { | |||
| 296 | * | 296 | * |
| 297 | * Gets the layer based on key info | 297 | * Gets the layer based on key info |
| 298 | */ | 298 | */ |
| 299 | int8_t layer_switch_get_layer(keypos_t key) { | 299 | uint8_t layer_switch_get_layer(keypos_t key) { |
| 300 | #ifndef NO_ACTION_LAYER | 300 | #ifndef NO_ACTION_LAYER |
| 301 | action_t action; | 301 | action_t action; |
| 302 | action.code = ACTION_TRANSPARENT; | 302 | action.code = ACTION_TRANSPARENT; |
| @@ -304,7 +304,7 @@ int8_t layer_switch_get_layer(keypos_t key) { | |||
| 304 | uint32_t layers = layer_state | default_layer_state; | 304 | uint32_t layers = layer_state | default_layer_state; |
| 305 | /* check top layer first */ | 305 | /* check top layer first */ |
| 306 | for (int8_t i = 31; i >= 0; i--) { | 306 | for (int8_t i = 31; i >= 0; i--) { |
| 307 | if (layers & (1UL<<i)) { | 307 | if (layers & (1UL << i)) { |
| 308 | action = action_for_key(i, key); | 308 | action = action_for_key(i, key); |
| 309 | if (action.code != ACTION_TRANSPARENT) { | 309 | if (action.code != ACTION_TRANSPARENT) { |
| 310 | return i; | 310 | return i; |
