lc-soft / LCUI

C library for building user interfaces
https://lcui-dev.github.io
MIT License
4.15k stars 357 forks source link

Compiler warnings and errors #80

Closed mrwert closed 7 years ago

mrwert commented 7 years ago

Hello!

src/platform/windows/windows_display.c [398]: wsprintf( str, L"LCUI_CreateWinAppDriver(): error code: %d\n", GetLastError() ); Warning C4133: 'function' : incompatible types - from 'wchar_t *' to 'LPCSTR'.

src/platform/windows/windows_events.c [172]: wsprintf( str, L"LCUI_CreateWinAppDriver(): error code: %d\n", GetLastError() ); Warning C4133: 'function' : incompatible types - from 'wchar_t [256]' to 'LPSTR'. and Warning C4133: 'function' : incompatible types - from 'unsigned short [43]' to 'LPCSTR'.

src/platform/windows/windows_events.c [173]: MessageBox( NULL, str, szAppName, MB_ICONERROR ); Warning C4133: 'function' : incompatible types - from 'wchar_t [256]' to 'LPCSTR'.

src/platform/windows/windows_events.c [177]: app->PostTask = WIN_PostTask; Error C2039: ‘PostTask’ is not a member of ‘LCUIAppDriverRec’.

src/platform/windows/windows_events.c [178]: app->WaitEvent = WIN_WaitEvent; Error C2039: ‘WaitEvent’ is not a member of ‘LCUIAppDriverRec’.

LCUI version: [2.661 commits / 13.04.2017] OS and version: [Windows 7] Build tools: [vcvars32.bat -> cl.exe (VisualStudio 2015)]

Thanks!

mrwert commented 7 years ago

src/display.c: In function ‘OnSurfaceEvent’: src/display.c:556:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] e_type = ((int)&arg); ^~

LCUI version: [2.661 commits / 13.04.2017] OS and version: [Linux Ubuntu 4.10.0-19-generic] Build tools: [gcc version 6.3.0 20170406 (Ubuntu 6.3.0-12ubuntu2)]

mrwert commented 7 years ago

src/image/jpeg.c: In function ‘LCUI_ReadJPEGHeader’: src/image/jpeg.c:171:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] mark = ((short int)jpeg_reader->buffer); ^~~~

LCUI version: [2.661 commits / 13.04.2017] OS and version: [Linux Ubuntu 4.10.0-19-generic] Build tools: [gcc version 6.3.0 20170406 (Ubuntu 6.3.0-12ubuntu2)]

lc-soft commented 7 years ago
Warning C4133: 'function' : incompatible types - from 'wchar_t [256]' to 'LPSTR'.

The correct content should be: from 'wchar_t [256]' to 'LPWSTR'. But it seems _UNICODE macro does not work. I will try to solve this problem tomorrow.

lc-soft commented 7 years ago

Ok, now you can try rebuild in windows agian.

mrwert commented 7 years ago

Ok.

src/platform/windows/windows_events.c [164]: wndclass.lpszClassName = szAppName; Warning C4133: '=' : incompatible types - from 'wchar_t *' to 'LPCSTR'.

src/font/charset.c

Warning C4715: 'LCUI_DecodeString' : not all control paths return a value.

Thanks!

mrwert commented 7 years ago

hm... [display] init ... [display] init failed [timer] timer thread is working and the end...

lc-soft commented 7 years ago

@mrwert You can switch to v140_xp toolset.

image

Universal Windows Platform (UWP) version of the driver support code is not included in the LCUI source code.

mrwert commented 7 years ago

src/platform/windows/windows_events.c [170]: if( !RegisterClass( &wndclass ) ) { Warning C4133: 'function' : incompatible types - from 'WNDCLASSW ' to 'const WNDCLASSA '.

LCUI version: [2.671 commits / 17.04.2017] OS and version: [Windows 10] Build tools: [vcvars32.bat -> cl.exe (VisualStudio 2017)]

lc-soft commented 7 years ago

@mrwert It seems that the _UNICODE macro does not work in your compiler,