diff options
author | Gurchetan Singh <gurchetansingh@google.com> | 2022-07-25 17:15:36 -0700 |
---|---|---|
committer | Gurchetan Singh <gurchetansingh@google.com> | 2022-07-25 17:18:01 -0700 |
commit | a876a833a5db2625ac4c9e820da30fee86ea854e (patch) | |
tree | b77c3f8df8967c8003867936bb9a2f81b844288c | |
parent | 50941d0f0ed49593b69b58cc03ae83943ddc5aad (diff) | |
download | goldfish-opengl-a876a833a5db2625ac4c9e820da30fee86ea854e.tar.gz |
goldfish-opengl: HostConnection: fix compile bug
Sometimes I get:
../system/OpenglSystemCommon/HostConnection.cpp:267:73: error: cannot bind packed field ‘((cros_gralloc_handle*)handle)->cros_gralloc_handle::format’ to ‘unsigned int&’
267 | return std::optional<uint32_t>(((cros_gralloc_handle *)handle)->format);
BUG=202552093
TEST=
meson amd64-build/
ninja -C amd64-build/
Change-Id: I754dd3d61d147088fbacb01ed88efc86290e387c
-rw-r--r-- | system/OpenglSystemCommon/HostConnection.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/system/OpenglSystemCommon/HostConnection.cpp b/system/OpenglSystemCommon/HostConnection.cpp index df6e30b0..1888b81a 100644 --- a/system/OpenglSystemCommon/HostConnection.cpp +++ b/system/OpenglSystemCommon/HostConnection.cpp @@ -264,7 +264,8 @@ public: } virtual std::optional<uint32_t> getFormatDrmFourcc(native_handle_t const* handle) override { - return ((cros_gralloc_handle *)handle)->format; + uint32_t format = ((cros_gralloc_handle *)handle)->format; + return std::optional<uint32_t>(format); } virtual size_t getAllocatedSize(native_handle_t const* handle) { |