OSDN Git Service

minigbm: cros_gralloc: Fix type mismatch on 64-bit builds
authorTomasz Figa <tfiga@chromium.org>
Wed, 26 Apr 2017 08:26:04 +0000 (17:26 +0900)
committerchrome-bot <chrome-bot@chromium.org>
Thu, 27 Apr 2017 18:15:44 +0000 (11:15 -0700)
For some reason GCC does not like using %llu print format for uint64_t, which
maps to unsigned long on Linux x86_64. However on Linux i386 unsigned
long is a 32-bit type and uint64_t maps effectively to unsigned long
long and we need to use %llu. To work this around, simply cast the value
to unsigned long long.

BUG=b:36540057
TEST=emerge-reef arc-cros-gralloc with multilib patches applied

Change-Id: Ic585d40d690346babc280a04111fc8aedf8a30cd
Reviewed-on: https://chromium-review.googlesource.com/487766
Commit-Ready: Tomasz Figa <tfiga@chromium.org>
Tested-by: Tomasz Figa <tfiga@chromium.org>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
cros_gralloc/cros_alloc_device.cc

index 10f30e7..990ccee 100644 (file)
@@ -28,7 +28,8 @@ static struct cros_gralloc_bo *cros_gralloc_bo_create(struct driver *drv, int wi
        if (!combo) {
                cros_gralloc_error("Unsupported combination -- HAL format: %u, HAL flags: %u, "
                                   "drv_format: %4.4s, drv_flags: %llu",
-                                  format, usage, reinterpret_cast<char *>(&drv_format), drv_usage);
+                                  format, usage, reinterpret_cast<char *>(&drv_format),
+                                  static_cast<unsigned long long>(drv_usage));
                return NULL;
        }