Use explicitly sized types from stdint

Replace bare int types with stdint types. This was done with:

    grep -rwl 'int' src/ | xargs sed -i 's/\<int\>/int16_t/g'
    grep -rwl 'unsigned long' src/ | xargs sed -i 's/\<unsigned long\>/uint32_t/g'
    grep -rwl 'unsigned char' src/ | xargs sed -i 's/\<unsigned char\>/uint8_t/g'

Then reverted for *main(), putchar(), and getchar().

The Arduino declarations for parallel_main() were also corrected to
match their definitions.

SDCC does *not* generate the same code in all instances, due to `int`
being treated different than `short int`.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
This commit is contained in:
Tim Crawford
2021-07-28 07:36:42 -06:00
committed by Jeremy Soller
parent 38b2a628f9
commit 99af8a35f5
41 changed files with 169 additions and 167 deletions

View File

@ -17,9 +17,9 @@ void keymap_init(void) {
}
void keymap_load_default(void) {
for (int layer = 0; layer < KM_LAY; layer++) {
for (int output = 0; output < KM_OUT; output++) {
for (int input = 0; input < KM_IN; input++) {
for (int16_t layer = 0; layer < KM_LAY; layer++) {
for (int16_t output = 0; output < KM_OUT; output++) {
for (int16_t input = 0; input < KM_IN; input++) {
DYNAMIC_KEYMAP[layer][output][input] = KEYMAP[layer][output][input];
}
}
@ -57,7 +57,7 @@ bool keymap_save_config(void) {
return flash_read_u16(CONFIG_ADDR) == CONFIG_SIGNATURE;
}
bool keymap_get(int layer, int output, int input, uint16_t * value) {
bool keymap_get(int16_t layer, int16_t output, int16_t input, uint16_t * value) {
if (layer < KM_LAY && output < KM_OUT && input < KM_IN) {
*value = DYNAMIC_KEYMAP[layer][output][input];
return true;
@ -66,7 +66,7 @@ bool keymap_get(int layer, int output, int input, uint16_t * value) {
}
}
bool keymap_set(int layer, int output, int input, uint16_t value) {
bool keymap_set(int16_t layer, int16_t output, int16_t input, uint16_t value) {
if (layer < KM_LAY && output < KM_OUT && input < KM_IN) {
DYNAMIC_KEYMAP[layer][output][input] = value;
return true;