Commit bcfef55
encoder tests: align mock 'index' field with the API's uint8_t
Apple clang 21 fails the encoder test builds with errors like:
quantum/encoder/tests/encoder_tests.cpp:37:40: error:
non-constant-expression cannot be narrowed from type 'uint8_t'
(aka 'unsigned char') to 'int8_t' (aka 'signed char') in
initializer list [-Wc++11-narrowing]
37 | updates[updates_array_idx % 32] = {index, clockwise};
| ^~~~~
`encoder_update_kb()` takes `uint8_t index`, but the test-only
`struct update` declared the captured field as `int8_t`. The
aggregate-init `{index, clockwise}` then narrows uint8_t -> int8_t,
which clang's stricter -Wc++11-narrowing rejects (gcc was lenient
about it, which is why Linux CI didn't catch this).
The signed type was a mismatch, not a deliberate choice — encoder
indices are non-negative — so widen the field to `uint8_t` to match
the real API instead of papering over the narrowing with a cast.
Applied identically to all six encoder test variants.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent b9c6ec0 commit bcfef55
6 files changed
Lines changed: 12 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
30 | | - | |
| 29 | + | |
| 30 | + | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
30 | | - | |
| 29 | + | |
| 30 | + | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
30 | | - | |
| 29 | + | |
| 30 | + | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
30 | | - | |
| 29 | + | |
| 30 | + | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
30 | | - | |
| 29 | + | |
| 30 | + | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
30 | | - | |
| 29 | + | |
| 30 | + | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| |||
0 commit comments