Fix clang -Wsign-conversion warning in grisu_count_digits. (#1573)

grisu_count_digits is only used by grisu_gen_digits, which assigns the unsigned result to a (signed) int.

Although grisu_count_digits always returns a positive integer this keeps its return type in sync with the type its result is assigned to.
This commit is contained in:
refnum 2020-03-04 14:48:41 +00:00 committed by GitHub
parent 1e8493196e
commit 68742e1d87
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -756,7 +756,7 @@ enum result {
} }
// A version of count_digits optimized for grisu_gen_digits. // A version of count_digits optimized for grisu_gen_digits.
inline unsigned grisu_count_digits(uint32_t n) { inline int grisu_count_digits(uint32_t n) {
if (n < 10) return 1; if (n < 10) return 1;
if (n < 100) return 2; if (n < 100) return 2;
if (n < 1000) return 3; if (n < 1000) return 3;