diff options
author | David Robillard <d@drobilla.net> | 2019-01-07 18:55:35 +0100 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2019-01-07 18:55:35 +0100 |
commit | 9d31b07bbc144da93eb65250ee7cf47611d1ce16 (patch) | |
tree | 83c59c63f86281803ff9e11a033b251e950fbe58 /src/string.c | |
parent | 9b80535334de1a3ca0bf40d2f1109202385148aa (diff) | |
download | serd-9d31b07bbc144da93eb65250ee7cf47611d1ce16.tar.gz serd-9d31b07bbc144da93eb65250ee7cf47611d1ce16.tar.bz2 serd-9d31b07bbc144da93eb65250ee7cf47611d1ce16.zip |
WIP: Fix warningsserd1-warnings
Diffstat (limited to 'src/string.c')
-rw-r--r-- | src/string.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/string.c b/src/string.c index c2466c48..304dec6d 100644 --- a/src/string.c +++ b/src/string.c @@ -93,14 +93,14 @@ serd_strtod(const char* str, size_t* end) const double sign = read_sign(&s); // Parse integer part - for (; is_digit(*s); ++s) { + for (; is_digit((uint8_t)*s); ++s) { result = (result * 10.0) + (*s - '0'); } // Parse fractional part if (*s == '.') { double denom = 10.0; - for (++s; is_digit(*s); ++s) { + for (++s; is_digit((uint8_t)*s); ++s) { result += (*s - '0') / denom; denom *= 10.0; } @@ -111,14 +111,14 @@ serd_strtod(const char* str, size_t* end) ++s; double expt = 0.0; double expt_sign = read_sign(&s); - for (; is_digit(*s); ++s) { + for (; is_digit((uint8_t)*s); ++s) { expt = (expt * 10.0) + (*s - '0'); } result *= pow(10, expt * expt_sign); } if (end) { - *end = s - str; + *end = (size_t)(s - str); } return result * sign; |