Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 4e7507ff authored by Nick Desaulniers's avatar Nick Desaulniers
Browse files

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: default avatarNick Desaulniers <ndesaulniers@google.com>
parent e91c76b2
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment