Skip to content

drm_hwcomposer: fix shift compiling error with AOSP

Yongqin Liu requested to merge yongqin.liu/drm-hwcomposer:main into main

which reported like this:

    08:58:21 external/drm_hwcomposer/hwc2_device/HwcDisplay.cpp:76:26: error: constexpr variable 'kOne' must be initialized by a constant expression
    08:58:21       constexpr uint64_t kOne = 1L << 32; /* 1.0 in s31.32 format */
    08:58:21                          ^      ~~~~~~~~
    08:58:21 external/drm_hwcomposer/hwc2_device/HwcDisplay.cpp:76:36: note: shift count 32 >= width of type 'long' (32 bits)
    08:58:21       constexpr uint64_t kOne = 1L << 32; /* 1.0 in s31.32 format */
    08:58:21                                    ^
    08:58:21 external/drm_hwcomposer/hwc2_device/HwcDisplay.cpp:76:36: error: shift count >= width of type [-Werror,-Wshift-count-overflow]
    08:58:21       constexpr uint64_t kOne = 1L << 32; /* 1.0 in s31.32 format */
    08:58:21                                    ^  ~~
    08:58:21 external/drm_hwcomposer/hwc2_device/HwcDisplay.cpp:697:71: error: shift count >= width of type [-Werror,-Wshift-count-overflow]
    08:58:21           auto value = uint64_t(matrix[i * kInCtmRows + j] * float(1L << 32));
    08:58:21                                                                       ^  ~~
    08:58:21 3 errors generated.

Test: build passes and could boot to home screen

Issue: #75 (closed)

Change-Id: Ia9dfcd842a186dfbe279da1793363c6a25df0e2f

Signed-off-by: Yongqin Liu yongqin.liu@linaro.org

Edited by Yongqin Liu

Merge request reports