OSDN Git Service

libsync.h: fix missing braces in (struct sync_merge_data) data oreo-x86 android-x86-8.1-r6 android-x86-9.0-r1 android-x86-9.0-r2
authorMauro Rossi <issor.oruam@gmail.com>
Sun, 7 Jul 2019 20:25:52 +0000 (22:25 +0200)
committerMauro Rossi <issor.oruam@gmail.com>
Thu, 17 Oct 2019 18:11:23 +0000 (20:11 +0200)
Fixes the following build error in IA-HardwareComposer when using clang:

In file included from external/IA-Hardware-Composer/common/core/hwclayer.cpp:18:
external/libdrm/libsync.h:88:33:
error: suggest braces around initialization of subobject [-Werror,-Wmissing-braces]
        struct sync_merge_data data = {0};
                                       ^
                                       {}

Using -Wno-missing-braces in external/IA-Hardware-Composer/common/core/Android.mk
LOCAL_CPPFLAGS did not solve the issue, this change in external/libdrm/libsync.h
was necessary

Signed-off-by: Mauro Rossi <issor.oruam@gmail.com>
libsync.h

index f1a2f96..d30cdbf 100644 (file)
--- a/libsync.h
+++ b/libsync.h
@@ -85,7 +85,7 @@ static inline int sync_wait(int fd, int timeout)
 
 static inline int sync_merge(const char *name, int fd1, int fd2)
 {
-       struct sync_merge_data data = {0};
+       struct sync_merge_data data = { {0} };
        int ret;
 
        data.fd2 = fd2;