From 943216dedaf6c5760886f93011163fda04ee6fa0 Mon Sep 17 00:00:00 2001 From: Lionel Debroux Date: Thu, 7 Feb 2019 19:43:40 +0100 Subject: [PATCH 1/2] Make several const char / const char * arrays static to save a bit of space. Signed-off-by: Lionel Debroux --- main.c | 4 ++-- supervisor/shared/usb/usb.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/main.c b/main.c index b17c11137b..522484856e 100755 --- a/main.c +++ b/main.c @@ -185,8 +185,8 @@ bool run_code_py(safe_mode_t safe_mode) { } else { new_status_color(MAIN_RUNNING); - const char *supported_filenames[] = STRING_LIST("code.txt", "code.py", "main.py", "main.txt"); - const char *double_extension_filenames[] = STRING_LIST("code.txt.py", "code.py.txt", "code.txt.txt","code.py.py", + static const char *supported_filenames[] = STRING_LIST("code.txt", "code.py", "main.py", "main.txt"); + static const char *double_extension_filenames[] = STRING_LIST("code.txt.py", "code.py.txt", "code.txt.txt","code.py.py", "main.txt.py", "main.py.txt", "main.txt.txt","main.py.py"); stack_resize(); diff --git a/supervisor/shared/usb/usb.c b/supervisor/shared/usb/usb.c index 136137f779..c77f1e417c 100644 --- a/supervisor/shared/usb/usb.c +++ b/supervisor/shared/usb/usb.c @@ -43,7 +43,7 @@ void load_serial_number(void) { uint8_t raw_id[COMMON_HAL_MCU_PROCESSOR_UID_LENGTH]; common_hal_mcu_processor_get_uid(raw_id); - const char nibble_to_hex[16] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', + static const char nibble_to_hex[16] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'}; for (int i = 0; i < COMMON_HAL_MCU_PROCESSOR_UID_LENGTH; i++) { for (int j = 0; j < 2; j++) { From 591eb23e0ff846cd8439c1638de454d1ebeeda05 Mon Sep 17 00:00:00 2001 From: Lionel Debroux Date: Thu, 7 Feb 2019 19:45:37 +0100 Subject: [PATCH 2/2] Fix a couple variable shadowing varnings. Signed-off-by: Lionel Debroux --- lib/libm_dbl/pow.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/libm_dbl/pow.c b/lib/libm_dbl/pow.c index 3ddc1b6ff8..4aef8a5b3e 100644 --- a/lib/libm_dbl/pow.c +++ b/lib/libm_dbl/pow.c @@ -125,13 +125,13 @@ double pow(double x, double y) else if (iy >= 0x3ff00000) { k = (iy>>20) - 0x3ff; /* exponent */ if (k > 20) { - uint32_t j = ly>>(52-k); - if ((j<<(52-k)) == ly) - yisint = 2 - (j&1); + uint32_t j2 = ly>>(52-k); + if ((j2<<(52-k)) == ly) + yisint = 2 - (j2&1); } else if (ly == 0) { - uint32_t j = iy>>(20-k); - if ((j<<(20-k)) == iy) - yisint = 2 - (j&1); + uint32_t j2 = iy>>(20-k); + if ((j2<<(20-k)) == (uint32_t)iy) + yisint = 2 - (j2&1); } } }