The value of uncompressed may not be precisely representable when
implicitly casted to an IEEE 754 single precision float.
Assuming the code doesn't need a precise compression ratio, accept the
potential imprecision via explicit cast.
system/core/libziparchive/unzip.cpp:114:68: error: implicit conversion
from 'int64_t' (aka 'long') to 'float' may lose precision
[-Werror,-Wimplicit-int-float-conversion]
return static_cast<float>(100LL * (uncompressed - compressed)) / uncompressed;
~ ^~~~~~~~~~~~
Change-Id: If46cfa4eb2bb16a7491e52bb5d1c212ed5d59079
Bug: 139945549
Test: lunch hikey960-userdebug && mm
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
|
||
|---|---|---|
| .. | ||
| include/ziparchive | ||
| testdata | ||
| .clang-format | ||
| Android.bp | ||
| entry_name_utils-inl.h | ||
| entry_name_utils_test.cc | ||
| libziparchive_fuzzer.cpp | ||
| OWNERS | ||
| unzip.cpp | ||
| zip_archive.cc | ||
| zip_archive_benchmark.cpp | ||
| zip_archive_common.h | ||
| zip_archive_private.h | ||
| zip_archive_stream_entry.cc | ||
| zip_archive_test.cc | ||
| zip_writer.cc | ||
| zip_writer_test.cc | ||