From d0a148f305a251b6508ba99708d1a6a2fd431089 Mon Sep 17 00:00:00 2001 From: Jaime Bernardo Date: Wed, 4 Sep 2024 16:12:24 +0100 Subject: [PATCH] Fix some more analyzer errors --- src/modules/ZoomIt/ZoomIt/DemoType.cpp | 2 +- src/modules/ZoomIt/ZoomIt/SelectRectangle.h | 2 +- src/modules/ZoomIt/ZoomIt/Zoomit.cpp | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/modules/ZoomIt/ZoomIt/DemoType.cpp b/src/modules/ZoomIt/ZoomIt/DemoType.cpp index be9d8098fb..b2cc14a653 100644 --- a/src/modules/ZoomIt/ZoomIt/DemoType.cpp +++ b/src/modules/ZoomIt/ZoomIt/DemoType.cpp @@ -934,7 +934,7 @@ LRESULT CALLBACK DemoTypeHookProc( int nCode, WPARAM wParam, LPARAM lParam ) } } } - + [[fallthrough]]; case WM_KEYDOWN: case WM_SYSKEYUP: case WM_SYSKEYDOWN: diff --git a/src/modules/ZoomIt/ZoomIt/SelectRectangle.h b/src/modules/ZoomIt/ZoomIt/SelectRectangle.h index 6244067ec6..aa31b6c530 100644 --- a/src/modules/ZoomIt/ZoomIt/SelectRectangle.h +++ b/src/modules/ZoomIt/ZoomIt/SelectRectangle.h @@ -32,7 +32,7 @@ private: bool m_cancel = false; const wchar_t* m_className = L"ZoomitSelectRectangle"; - UINT m_dpi; + UINT m_dpi{}; RECT m_oldClipRect{}; bool m_selected{ false }; bool m_setClip{ false }; diff --git a/src/modules/ZoomIt/ZoomIt/Zoomit.cpp b/src/modules/ZoomIt/ZoomIt/Zoomit.cpp index dcc1d6ea6d..143ab63a42 100644 --- a/src/modules/ZoomIt/ZoomIt/Zoomit.cpp +++ b/src/modules/ZoomIt/ZoomIt/Zoomit.cpp @@ -2243,7 +2243,7 @@ INT_PTR CALLBACK OptionsProc( HWND hDlg, UINT message, // Get the selected microphone int index = static_cast(SendMessage( GetDlgItem( g_OptionsTabs[RECORD_PAGE].hPage, IDC_MICROPHONE ), static_cast(CB_GETCURSEL), static_cast(0), static_cast(0) )); - _tcscpy( g_MicrophoneDeviceId, index == 0 ? L"" : microphones[index - 1].first.c_str() ); + _tcscpy( g_MicrophoneDeviceId, index == 0 ? L"" : microphones[static_cast(index) - 1].first.c_str() ); if( newToggleKey && !RegisterHotKey( GetParent( hDlg ), ZOOM_HOTKEY, newToggleMod, newToggleKey & 0xFF )) { @@ -2611,8 +2611,8 @@ void DrawArrow( HDC hdc, int x1, int y1, int x2, int y2, double length, double w bool UseGdiplus ) { // get normalized dx/dy - double dx = x2 - x1; - double dy = y2 - y1; + double dx = static_cast(x2) - x1; + double dy = static_cast(y2) - y1; double bodyLen = sqrt( dx*dx + dy*dy ); if ( bodyLen ) { dx /= bodyLen;