Skip to content

Commit

Permalink
samples: modules: lvgl: transparency: Fix supported pixel format check
Browse files Browse the repository at this point in the history
Found while building with clang and -Wtautological-compare:

samples/modules/lvgl/screen_transparency/src/main.c:47:45: error:
bitwise or with non-zero value always evaluates to true
[-Werror,-Wtautological-bitwise-compare]

if (!(display_caps.supported_pixel_formats | PIXEL_FORMAT_ARGB_8888)) {
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Tom Hughes <[email protected]>
  • Loading branch information
thughes authored and kartben committed Jan 16, 2025
1 parent 8cf0148 commit 37deb31
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion samples/modules/lvgl/screen_transparency/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ int main(void)
}

display_get_capabilities(display_dev, &display_caps);
if (!(display_caps.supported_pixel_formats | PIXEL_FORMAT_ARGB_8888)) {
if (!(display_caps.supported_pixel_formats & PIXEL_FORMAT_ARGB_8888)) {
LOG_ERR("Display does not support ARGB8888 mode");
return -ENOTSUP;
}
Expand Down

0 comments on commit 37deb31

Please sign in to comment.