Avoid uninitialized variable warnings in debug MSVC build

The compiler is smart enough to determine that the variables are always
initialized when they're actually used when using optimizations, but
gives a bunch of C4701 warnings for them if we don't initialize them in
the non-optimized debug builds.
This commit is contained in:
Vadim Zeitlin
2020-07-16 01:49:23 +02:00
parent d57c688d89
commit 99f210a0e7

View File

@@ -1234,7 +1234,10 @@ void wxGCDCImpl::DoGetTextExtent( const wxString &str, wxCoord *width, wxCoord *
m_graphicContext->SetFont( *theFont, m_textForegroundColour );
}
wxDouble h , d , e , w;
wxDouble w wxDUMMY_INITIALIZE(0),
h wxDUMMY_INITIALIZE(0),
d wxDUMMY_INITIALIZE(0),
e wxDUMMY_INITIALIZE(0);
// Don't pass non-NULL pointers for the parts we don't need, this could
// result in doing extra unnecessary work inside GetTextExtent().