diff options
author | Joel Challis <git@zvecr.com> | 2020-03-01 18:46:40 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-02 05:46:40 +1100 |
commit | e7fb873ee281d93dbf96f369bd3a0a50e766eda3 (patch) | |
tree | 61c192c27793a1b02d09c8b8bcf59a7a4645b47f /tmk_core/common/chibios/printf.c | |
parent | 629950e51bb0f3f12d84520426f93449e0e4e9b7 (diff) | |
download | firmware-e7fb873ee281d93dbf96f369bd3a0a50e766eda3.tar.gz firmware-e7fb873ee281d93dbf96f369bd3a0a50e766eda3.tar.bz2 firmware-e7fb873ee281d93dbf96f369bd3a0a50e766eda3.zip |
Short term fix for conflicting types for 'tfp_printf' (#8157)
Diffstat (limited to 'tmk_core/common/chibios/printf.c')
-rw-r--r-- | tmk_core/common/chibios/printf.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/tmk_core/common/chibios/printf.c b/tmk_core/common/chibios/printf.c index 3a81acd31..17c1e6341 100644 --- a/tmk_core/common/chibios/printf.c +++ b/tmk_core/common/chibios/printf.c @@ -96,8 +96,8 @@ static int a2d(char ch) { return -1; } -static char a2i(char ch, char** src, int base, int* nump) { - char* p = *src; +static char a2i(char ch, const char** src, int base, int* nump) { + const char* p = *src; int num = 0; int digit; while ((digit = a2d(ch)) >= 0) { @@ -119,7 +119,7 @@ static void putchw(void* putp, putcf putf, int n, char z, char* bf) { while ((ch = *bf++)) putf(putp, ch); } -void tfp_format(void* putp, putcf putf, char* fmt, va_list va) { +void tfp_format(void* putp, putcf putf, const char* fmt, va_list va) { // This used to handle max of 12, but binary support jumps this to at least 32 char bf[36]; @@ -211,19 +211,23 @@ void init_printf(void* putp, void (*putf)(void*, char)) { stdout_putp = putp; } -void tfp_printf(char* fmt, ...) { +int tfp_printf(const char* fmt, ...) { va_list va; va_start(va, fmt); tfp_format(stdout_putp, stdout_putf, fmt, va); va_end(va); + + return 1; } static void putcp(void* p, char c) { *(*((char**)p))++ = c; } -void tfp_sprintf(char* s, char* fmt, ...) { +int tfp_sprintf(char* s, const char* fmt, ...) { va_list va; va_start(va, fmt); tfp_format(&s, putcp, fmt, va); putcp(&s, 0); va_end(va); + + return 1; } |