# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1571961471 0 # Node ID 0e354f2edb1633e3266187f4fefba6e5acb3433e # Parent 289a8ca4855b5e515a1b38c0ae44904099068d0a Win: Fixed a number of Visual C warnings show in the IDE. diff -r 289a8ca4855b -r 0e354f2edb16 win/dw.c --- a/win/dw.c Wed Oct 16 21:47:10 2019 +0000 +++ b/win/dw.c Thu Oct 24 23:57:51 2019 +0000 @@ -1338,7 +1338,7 @@ */ void _initial_focus(HWND handle) { - Box *thisbox; + Box *thisbox = NULL; TCHAR tmpbuf[100] = {0}; if(!handle) @@ -2774,7 +2774,8 @@ if(!cinfo || !cinfo->pOldProc) ret = DefWindowProc(hWnd, msg, mp1, mp2); - ret = CallWindowProc(cinfo->pOldProc, hWnd, msg, mp1, mp2); + else + ret = CallWindowProc(cinfo->pOldProc, hWnd, msg, mp1, mp2); /* Tell the edit control that a buttonpress has * occured and to update it's window title. @@ -3125,7 +3126,7 @@ if(!(msg == WM_CTLCOLORSTATIC && SendMessage((HWND)mp2, STM_GETIMAGE, IMAGE_BITMAP, 0))) { SetBkColor((HDC)mp1, _dw_transparencykey); - if(thiscinfo->hbrush) + if(thiscinfo && thiscinfo->hbrush) DeleteObject(thiscinfo->hbrush); thiscinfo->hbrush = CreateSolidBrush(_dw_transparencykey); SelectObject((HDC)mp1, thiscinfo->hbrush); @@ -5140,7 +5141,7 @@ /* Free temporary bitmaps */ if(ii.hbmColor) DeleteObject(ii.hbmColor); - if(ii.hbmMask); + if(ii.hbmMask) DeleteObject(ii.hbmMask); } @@ -5182,9 +5183,8 @@ oldfont = cinfo->hfont; cinfo->hfont = hfont; } - else + else if(cinfo = calloc(1, sizeof(ColorInfo))) { - cinfo = calloc(1, sizeof(ColorInfo)); cinfo->fore = cinfo->back = -1; strncpy(cinfo->fontname, fontname, 127); @@ -5354,10 +5354,8 @@ cinfo->fore = fore; cinfo->back = back; } - else - { - cinfo = calloc(1, sizeof(ColorInfo)); - + else if(cinfo = calloc(1, sizeof(ColorInfo))) + { cinfo->fore = fore; cinfo->back = back;