OSDN Git Service

Fix -Wdouble-promotion warnings
authorGeorge Burgess IV <gbiv@google.com>
Wed, 25 Jan 2017 21:33:38 +0000 (13:33 -0800)
committerGeorge Burgess IV <gbiv@google.com>
Thu, 26 Jan 2017 18:36:49 +0000 (18:36 +0000)
commitd348e8afe79206b0c11343139d0cacdb7b78dfe9
treedbe4c3368e1c806d97c662e92534aafef23ca5e8
parent24257dda488651ad2c05875761b9e9ad110975c5
Fix -Wdouble-promotion warnings

With the new clang FORTIFY, this code emits the following error:

error: implicit conversion increases floating-point precision: 'float'
to 'double' [-Werror,-Wdouble-promotion]

This is because strncpy is now a function, not a macro defined in a
system header. So, the warning is considered to appear in user code
(instead of system code), and is therefore no longer suppressed.

Bug: 32073964
Test: Now builds with clang FORTIFY
Change-Id: Id5fcfe91755535f90b542e11bc42b66976fe24fc
Merged-In: I5e8292d7800434268793bc4db4a96f20b7022e17
libs/ui/GraphicBufferAllocator.cpp