libziparchive: fix -Wimplicit-int-float-conversion
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>
Loading
Please register or sign in to comment