mirror of
https://github.com/reactos/reactos.git
synced 2025-05-28 13:38:19 +00:00
[SYSDM][USERINIT] Fix uninitialized variables warnings detected by Clang. (#3619)
CORE-17545
Addendum to commit d635ce0c
.
- Move the HDC variables initialization via function calls, out of
the variables declaration block.
- Fix warnings (and identical for base/system/userinit/livecd.c):
dll/cpl/sysdm/general.c:72:9: warning: variable 'hLogo' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
if (hDC == NULL || hDCLogo == NULL || hDCMask == NULL)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
dll/cpl/sysdm/general.c:130:9: note: uninitialized use occurs here
if (hLogo != NULL) DeleteObject(hLogo);
^~~~~
and similar for hMask too:
dll/cpl/sysdm/general.c:129:9: note: uninitialized use occurs here
if (hMask != NULL) DeleteObject(hMask);
^~~~~
This commit is contained in:
parent
89860ab543
commit
cba0d64645
2 changed files with 14 additions and 8 deletions
|
@ -27,13 +27,16 @@ InitLogo(PIMGINFO pImgInfo, HWND hwndDlg)
|
|||
BITMAP logoBitmap;
|
||||
BITMAP maskBitmap;
|
||||
BITMAPINFO bmpi;
|
||||
HDC hDC = GetDC(hwndDlg);
|
||||
HDC hDCLogo = CreateCompatibleDC(NULL);
|
||||
HDC hDCMask = CreateCompatibleDC(NULL);
|
||||
HBITMAP hMask, hLogo, hAlphaLogo = NULL;
|
||||
HDC hDC, hDCLogo, hDCMask;
|
||||
HBITMAP hMask = NULL, hLogo = NULL;
|
||||
HBITMAP hAlphaLogo = NULL;
|
||||
COLORREF *pBits;
|
||||
INT line, column;
|
||||
|
||||
hDC = GetDC(hwndDlg);
|
||||
hDCLogo = CreateCompatibleDC(NULL);
|
||||
hDCMask = CreateCompatibleDC(NULL);
|
||||
|
||||
if (hDC == NULL || hDCLogo == NULL || hDCMask == NULL)
|
||||
goto Cleanup;
|
||||
|
||||
|
|
|
@ -62,13 +62,16 @@ static VOID InitLogo(HWND hwndDlg)
|
|||
BITMAP logoBitmap;
|
||||
BITMAP maskBitmap;
|
||||
BITMAPINFO bmpi;
|
||||
HDC hDC = GetDC(hwndDlg);
|
||||
HDC hDCLogo = CreateCompatibleDC(NULL);
|
||||
HDC hDCMask = CreateCompatibleDC(NULL);
|
||||
HBITMAP hMask, hLogo, hAlphaLogo = NULL;
|
||||
HDC hDC, hDCLogo, hDCMask;
|
||||
HBITMAP hMask = NULL, hLogo = NULL;
|
||||
HBITMAP hAlphaLogo = NULL;
|
||||
COLORREF *pBits;
|
||||
INT line, column;
|
||||
|
||||
hDC = GetDC(hwndDlg);
|
||||
hDCLogo = CreateCompatibleDC(NULL);
|
||||
hDCMask = CreateCompatibleDC(NULL);
|
||||
|
||||
if (hDC == NULL || hDCLogo == NULL || hDCMask == NULL)
|
||||
goto Cleanup;
|
||||
|
||||
|
|
Loading…
Reference in a new issue