http://bugs.winehq.org/show_bug.cgi?id=37131
Janne janne.kekkonen@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |janne.kekkonen@gmail.com
--- Comment #2 from Janne janne.kekkonen@gmail.com --- tested with Wine 10.0 source.
command used in analyze. clang -I /usr/x86_64-w64-mingw32/include -I ~/wine10.0/include/ -fdeclspec --analyze -Xanalyzer -analyzer-checker=unix -ferror-limit=4000 palette.c
There was no error about division by zero. Based on code i is initialized to 1 in stead of 0.
static void X11DRV_PALETTE_FillDefaultColors(...) {
int i = 1, idx = 0; int red, no_r, inc_r; ... if (palette_size <= NB_RESERVED_COLORS) return; while (i*i*i <= (palette_size - NB_RESERVED_COLORS)) i++; no_r = no_g = no_b = --i; if ((no_r * (no_g+1) * no_b) <= (palette_size - NB_RESERVED_COLORS)) no_g++; if ((no_r * no_g * (no_b+1)) <= (palette_size - NB_RESERVED_COLORS)) no_b++; inc_r = (255 - NB_COLORCUBE_START_INDEX)/no_r; inc_g = (255 - NB_COLORCUBE_START_INDEX)/no_g; inc_b = (255 - NB_COLORCUBE_START_INDEX)/no_b;
Instead i got these errors related to palette.c.
palette.c:883:57: error: use of undeclared identifier 'NTGDI_OBJ_PAL' HPALETTE hPal = NtGdiGetDCObject( physDev->dev.hdc, NTGDI_OBJ_PAL ); ^ palette.c:914:57: error: use of undeclared identifier 'NTGDI_OBJ_PAL' HPALETTE hPal = NtGdiGetDCObject( physDev->dev.hdc, NTGDI_OBJ_PAL ); ^ palette.c:1360:53: error: use of undeclared identifier 'NTGDI_OBJ_PAL' HPALETTE hpal = NtGdiGetDCObject( dev->hdc, NTGDI_OBJ_PAL ); ^ palette.c:1394:52: error: use of undeclared identifier 'NtGdiIsMemDC' if (palette_size && NtGdiGetDCDword( dev->hdc, NtGdiIsMemDC, &is_memdc ) && is_memdc)