Repository navigation
fix a lot of low level cppcheck warnings #9623
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 15 commits
ba28f75
aeae987
22eca8d
ef8ee02
05f6724
6333971
8c08e25
6d85a68
fce912a
18bbb6f
ac83983
eb39348
3d71c30
fe040e8
7163195
f097763
04a182b
cde51a9
61f8faf
d9c06da
4dfad37
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -63,7 +63,6 @@ void TCA8418Keyboard::pressed(uint8_t key) | |
| if (state == Init || state == Busy) { | ||
| return; | ||
| } | ||
| uint8_t next_key = 0; | ||
| int row = (key - 1) / 10; | ||
| int col = (key - 1) % 10; | ||
|
|
||
|
|
@@ -72,7 +71,7 @@ void TCA8418Keyboard::pressed(uint8_t key) | |
| } | ||
|
|
||
| // Compute key index based on dynamic row/column | ||
| next_key = row * _TCA8418_COLS + col; | ||
| next_key = (int8_t)(row * _TCA8418_COLS + col); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shouldn't this be a uint8_t?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. that was also one of my question marks. i'll review once more
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah. next_key and last_key are class variables defined as int_8 - the original issue was variable shadowing inside the pressed() function by redefining as uint8 and then signed/unsigned comaprison to int8 last_key. Apparently last_key can be <0 (checked in release()) - are they prone to go over 128? If so we shouold increase to INt16 |
||
|
|
||
| // LOG_DEBUG("TCA8418: Key %u -> Next Key %u", key, next_key); | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.