Fix clang-10 compilation issue (#839)
clang-10 throws the following error:
In file included from external/org_brotli/c/enc/bit_cost.c:9:
external/org_brotli/c/enc/./bit_cost.h:48:16: error: implicit conversion
from 'size_t' (aka 'unsigned long') to 'double' may lose precision
[-Werror,-Wimplicit-int-float-conversion]
if (retval < sum) {
~ ^~~
1 error generated.
Make the conversion explicit.
diff --git a/c/enc/bit_cost.h b/c/enc/bit_cost.h
index 6586469..31838f1 100644
--- a/c/enc/bit_cost.h
+++ b/c/enc/bit_cost.h
@@ -45,7 +45,7 @@
const uint32_t* population, size_t size) {
size_t sum;
double retval = ShannonEntropy(population, size, &sum);
- if (retval < sum) {
+ if (retval < (double)sum) {
/* At least one bit per literal is needed. */
retval = (double)sum;
}