Menu

#18 lv_color.c:263: possible bad shift ?

JESS_plugin
closed-fixed
nobody
None
5
2022-12-13
2014-10-13
dcb
No

lv_color.c:263:16: warning: signed shift result (0x100000000) requires 34 bits to represent, but 'int' only has 32 bits [-Wshift-overflow]

colors = (256 << 24) |
    (color->r << 16) |
    (color->g << 8) |
    (color->b);

maybe

colors = (256UL << 24) |
    (color->r << 16) |
    (color->g << 8) |
    (color->b);

would be better.

Discussion

  • Sebastian Pipping

    • status: open --> closed-fixed
     
  • Sebastian Pipping

    Closing as fixed in 0.4.1…

     

Log in to post a comment.