From dd6efcbac6e15307400decfe6c7d2efeff1333cc Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 17 Oct 2024 00:26:44 +0200 Subject: [PATCH] Avoid spurious "maybe uninitialized" MSVC warnings Always initialize the variables that were previously only initialized in the case when they were really used -- this doesn't cost much and avoids MSVC warnings about these variables being possibly uninitialized. --- src/qt/bitmap.cpp | 2 +- src/qt/font.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/qt/bitmap.cpp b/src/qt/bitmap.cpp index b5edf069d7..a5bc256ac4 100644 --- a/src/qt/bitmap.cpp +++ b/src/qt/bitmap.cpp @@ -86,7 +86,7 @@ static QImage ConvertImage( const wxImage &image, wxMask** mask = nullptr ) QRgb colour; QImage qtMask; - QRgb maskedColour; + QRgb maskedColour wxDUMMY_INITIALIZE(0); if ( hasMask ) { unsigned char r, g, b; diff --git a/src/qt/font.cpp b/src/qt/font.cpp index c36859132f..768a1955d1 100644 --- a/src/qt/font.cpp +++ b/src/qt/font.cpp @@ -522,7 +522,7 @@ void wxNativeFontInfo::SetPixelSize(const wxSize& size) void wxNativeFontInfo::SetStyle(wxFontStyle style) { - QFont::Style qtStyle; + QFont::Style qtStyle wxDUMMY_INITIALIZE(QFont::StyleNormal); switch ( style ) {