diff --git a/channels/audin/client/winmm/audin_winmm.c b/channels/audin/client/winmm/audin_winmm.c index 82b19e51e..aefef8433 100644 --- a/channels/audin/client/winmm/audin_winmm.c +++ b/channels/audin/client/winmm/audin_winmm.c @@ -177,7 +177,6 @@ static DWORD WINAPI audin_winmm_thread_func(LPVOID arg) if (!winmm->hWaveIn) { - MMRESULT rc; rc = waveInOpen(&winmm->hWaveIn, WAVE_MAPPER, winmm->pwfx_cur, (DWORD_PTR)waveInProc, (DWORD_PTR)winmm, CALLBACK_FUNCTION | WAVE_MAPPED_DEFAULT_COMMUNICATION_DEVICE); diff --git a/client/Windows/wf_event.c b/client/Windows/wf_event.c index cb3891f62..46cd40bc8 100644 --- a/client/Windows/wf_event.c +++ b/client/Windows/wf_event.c @@ -370,18 +370,15 @@ static void wf_send_resize(wfContext* wfc) LRESULT CALLBACK wf_event_proc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam) { - HDC hdc; - LONG_PTR ptr; - wfContext* wfc; - int x, y, w, h; - PAINTSTRUCT ps; - BOOL processed; - RECT windowRect; - MINMAXINFO* minmax; - SCROLLINFO si; + HDC hdc = { 0 }; + PAINTSTRUCT ps = { 0 }; + BOOL processed = FALSE; + RECT windowRect = { 0 }; + MINMAXINFO* minmax = NULL; + SCROLLINFO si = { 0 }; processed = TRUE; - ptr = GetWindowLongPtr(hWnd, GWLP_USERDATA); - wfc = (wfContext*)ptr; + LONG_PTR ptr = GetWindowLongPtr(hWnd, GWLP_USERDATA); + wfContext* wfc = (wfContext*)ptr; if (wfc != NULL) { @@ -408,9 +405,8 @@ LRESULT CALLBACK wf_event_proc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam break; case WM_GETMINMAXINFO: - if (freerdp_settings_get_bool(wfc->common.context.settings, FreeRDP_SmartSizing) || - (freerdp_settings_get_bool(wfc->common.context.settings, - FreeRDP_DynamicResolutionUpdate))) + if (freerdp_settings_get_bool(settings, FreeRDP_SmartSizing) || + (freerdp_settings_get_bool(settings, FreeRDP_DynamicResolutionUpdate))) { processed = FALSE; } @@ -494,16 +490,18 @@ LRESULT CALLBACK wf_event_proc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam return (LRESULT)1; case WM_PAINT: + { hdc = BeginPaint(hWnd, &ps); - x = ps.rcPaint.left; - y = ps.rcPaint.top; - w = ps.rcPaint.right - ps.rcPaint.left + 1; - h = ps.rcPaint.bottom - ps.rcPaint.top + 1; + const int x = ps.rcPaint.left; + const int y = ps.rcPaint.top; + const int w = ps.rcPaint.right - ps.rcPaint.left + 1; + const int h = ps.rcPaint.bottom - ps.rcPaint.top + 1; wf_scale_blt(wfc, hdc, x, y, w, h, wfc->primary->hdc, x - wfc->offset_x + wfc->xCurrentScroll, y - wfc->offset_y + wfc->yCurrentScroll, SRCCOPY); EndPaint(hWnd, &ps); - break; + } + break; #if (_WIN32_WINNT >= 0x0500) case WM_XBUTTONDOWN: @@ -725,7 +723,6 @@ LRESULT CALLBACK wf_event_proc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam { if (wParam == SYSCOMMAND_ID_SMARTSIZING) { - rdpSettings* settings = wfc->common.context.settings; HMENU hMenu = GetSystemMenu(wfc->hwnd, FALSE); const BOOL rc = freerdp_settings_get_bool(settings, FreeRDP_SmartSizing); freerdp_settings_set_bool(settings, FreeRDP_SmartSizing, !rc); @@ -837,11 +834,10 @@ LRESULT CALLBACK wf_event_proc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam BOOL wf_scale_blt(wfContext* wfc, HDC hdc, int x, int y, int w, int h, HDC hdcSrc, int x1, int y1, DWORD rop) { - rdpSettings* settings; UINT32 ww, wh, dw, dh; WINPR_ASSERT(wfc); - settings = wfc->common.context.settings; + rdpSettings* settings = wfc->common.context.settings; WINPR_ASSERT(settings); if (!wfc->client_width) diff --git a/libfreerdp/core/tcp.c b/libfreerdp/core/tcp.c index 513d787ef..da6731c63 100644 --- a/libfreerdp/core/tcp.c +++ b/libfreerdp/core/tcp.c @@ -246,8 +246,8 @@ static long transport_bio_simple_ctrl(BIO* bio, int cmd, long arg1, void* arg2) } while ((status < 0) && (errno == EINTR)); #else - fd_set rset; - struct timeval tv; + fd_set rset = { 0 }; + struct timeval tv = { 0 }; FD_ZERO(&rset); FD_SET(sockfd, &rset); @@ -285,8 +285,8 @@ static long transport_bio_simple_ctrl(BIO* bio, int cmd, long arg1, void* arg2) } while ((status < 0) && (errno == EINTR)); #else - fd_set rset; - struct timeval tv; + fd_set rset = { 0 }; + struct timeval tv = { 0 }; FD_ZERO(&rset); FD_SET(sockfd, &rset); @@ -1447,8 +1447,8 @@ static BOOL freerdp_tcp_layer_wait(void* userContext, BOOL waitWrite, DWORD time } while ((status < 0) && (errno == EINTR)); #else - fd_set rset; - struct timeval tv; + fd_set rset = { 0 }; + struct timeval tv = { 0 }; FD_ZERO(&rset); FD_SET(sockfd, &rset);