zlgopen / awtk-linux-fb

awtk port for linux framebuffer
110 stars 49 forks source link

warning: overflow in conversion from #98

Open fatalfeel opened 2 years ago

fatalfeel commented 2 years ago

-I/root/fbgui/awtk/3rd/nanovg/gl -I/root/fbgui/awtk/3rd/nanovg/base -I/root/fbgui/awtk/res build/var/awtk/src/lcd/lcd_mem_rgba8888.c In file included from build/var/awtk/src/lcd/lcd_mem_rgb565.c:35: /root/fbgui/awtk/src/lcd/lcd_mem.inc: In function ‘lcd_mem_draw_vline’: /root/fbgui/awtk/src/lcd/lcd_mem.inc:224:16: warning: overflow in conversion from ‘long unsigned int’ to ‘int32_t’ {aka ‘int’} changes value from ‘18446744073709551614’ to ‘-2’ [-Woverflow] offset = -sizeof(pixel_t); ^ /root/fbgui/awtk/src/lcd/lcd_mem.inc: In function ‘lcd_mem_draw_glyph4’: /root/fbgui/awtk/src/lcd/lcd_mem.inc:339:18: warning: overflow in conversion from ‘long unsigned int’ to ‘wh_t’ {aka ‘int’} changes value from ‘18446744073709551614’ to ‘-2’ [-Woverflow] d_offset = -sizeof(pixel_t); ^ /root/fbgui/awtk/src/lcd/lcd_mem.inc:343:20: warning: overflow in conversion from ‘long unsigned int’ to ‘wh_t’ {aka ‘int’} changes value from ‘18446744073709551614’ to ‘-2’ [-Woverflow] dst_offset = -sizeof(pixel_t); ^ /root/fbgui/awtk/src/lcd/lcd_mem.inc: In function ‘lcd_mem_draw_glyph8’: /root/fbgui/awtk/src/lcd/lcd_mem.inc:411:18: warning: overflow in conversion from ‘long unsigned int’ to ‘wh_t’ {aka ‘int’} changes value from ‘18446744073709551614’ to ‘-2’ [-Woverflow] d_offset = -sizeof(pixel_t); ^ /root/fbgui/awtk/src/lcd/lcd_mem.inc:415:20: warning: overflow in conversion from ‘long unsigned int’ to ‘wh_t’ {aka ‘int’} changes value from ‘18446744073709551614’ to ‘-2’ [-Woverflow] dst_offset = -sizeof(pixel_t); ^ In file included from build/var/awtk/src/lcd/lcd_mem_rgb888.c:35: /root/fbgui/awtk/src/lcd/lcd_mem.inc: In function ‘lcd_mem_draw_vline’: /root/fbgui/awtk/src/lcd/lcd_mem.inc:224:16: warning: overflow in conversion from ‘long unsigned int’ to ‘int32_t’ {aka ‘int’} changes value from ‘18446744073709551613’ to ‘-3’ [-Woverflow] offset = -sizeof(pixel_t); ^ /root/fbgui/awtk/src/lcd/lcd_mem.inc: In function ‘lcd_mem_draw_glyph4’: /root/fbgui/awtk/src/lcd/lcd_mem.inc:339:18: warning: overflow in conversion from ‘long unsigned int’ to ‘wh_t’ {aka ‘int’} changes value from ‘18446744073709551613’ to ‘-3’ [-Woverflow] d_offset = -sizeof(pixel_t); ^ /root/fbgui/awtk/src/lcd/lcd_mem.inc:343:20: warning: overflow in conversion from ‘long unsigned int’ to ‘wh_t’ {aka ‘int’} changes value from ‘18446744073709551613’ to ‘-3’ [-Woverflow] dst_offset = -sizeof(pixel_t); ^ /root/fbgui/awtk/src/lcd/lcd_mem.inc: In function ‘lcd_mem_draw_glyph8’: /root/fbgui/awtk/src/lcd/lcd_mem.inc:411:18: warning: overflow in conversion from ‘long unsigned int’ to ‘wh_t’ {aka ‘int’} changes value from ‘18446744073709551613’ to ‘-3’ [-Woverflow] d_offset = -sizeof(pixel_t); ^ /root/fbgui/awtk/src/lcd/lcd_mem.inc:415:20: warning: overflow in conversion from ‘long unsigned int’ to ‘wh_t’ {aka ‘int’} changes value from ‘18446744073709551613’ to ‘-3’ [-Woverflow] dst_offset = -sizeof(pixel_t); ^ In file included from build/var/awtk/src/lcd/lcd_mem_rgba8888.c:35: /root/fbgui/awtk/src/lcd/lcd_mem.inc: In function ‘lcd_mem_draw_vline’: /root/fbgui/awtk/src/lcd/lcd_mem.inc:224:16: warning: overflow in conversion from ‘long unsigned int’ to ‘int32_t’ {aka ‘int’} changes value from ‘18446744073709551612’ to ‘-4’ [-Woverflow] offset = -sizeof(pixel_t); ^ /root/fbgui/awtk/src/lcd/lcd_mem.inc: In function ‘lcd_mem_draw_glyph4’: /root/fbgui/awtk/src/lcd/lcd_mem.inc:339:18: warning: overflow in conversion from ‘long unsigned int’ to ‘wh_t’ {aka ‘int’} changes value from ‘18446744073709551612’ to ‘-4’ [-Woverflow] d_offset = -sizeof(pixel_t); ^ /root/fbgui/awtk/src/lcd/lcd_mem.inc:343:20: warning: overflow in conversion from ‘long unsigned int’ to ‘wh_t’ {aka ‘int’} changes value from ‘18446744073709551612’ to ‘-4’ [-Woverflow] dst_offset = -sizeof(pixel_t); ^ /root/fbgui/awtk/src/lcd/lcd_mem.inc: In function ‘lcd_mem_draw_glyph8’: /root/fbgui/awtk/src/lcd/lcd_mem.inc:411:18: warning: overflow in conversion from ‘long unsigned int’ to ‘wh_t’ {aka ‘int’} changes value from ‘18446744073709551612’ to ‘-4’ [-Woverflow] d_offset = -sizeof(pixel_t); ^ /root/fbgui/awtk/src/lcd/lcd_mem.inc:415:20: warning: overflow in conversion from ‘long unsigned int’ to ‘wh_t’ {aka ‘int’} changes value from ‘18446744073709551612’ to ‘-4’ [-Woverflow] dst_offset = -sizeof(pixel_t);

fatalfeel commented 2 years ago

/root/fbgui/awtk-linux-fb/build/var/awtk/src/tkc/types_def.h typedef int32_t xy_t; typedef int32_t wh_t;

/root/fbgui/awtk/src/lcd/lcd_mem.inc //wh_t offset = sizeof(pixel_t); //to size_t d_offset = sizeof(pixel_t); //fixed ~~also need modify others size_t dst_offset = line_length; size_t offset = 0;