Initialize variables properly

The warnings are emitted when compiling on msys2, mingw

The warning was:
gui/torrentcontentmodel.cpp:135:33: warning: missing initializer for
member '_SHFILEINFOW::iIcon' [-Wmissing-field-initializers]

..\..\qBittorrent\src\app\stacktrace_win.h:141:30: warning: missing
initializer for member '_IMAGEHLP_LINE64::Key'
[-Wmissing-field-initializers]
This commit is contained in:
Chocobo1 2018-05-25 17:27:45 +08:00 committed by sledgehammer999
parent 0a8925dc75
commit 0c918bcc3a
No known key found for this signature in database
GPG key ID: 6E4A2D025B7CC9A2
2 changed files with 2 additions and 2 deletions

View file

@ -138,7 +138,7 @@ bool straceWin::makeRelativePath(const QString& dir, QString& file)
QString straceWin::getSourcePathAndLineNumber(HANDLE hProcess, DWORD64 addr)
{
IMAGEHLP_LINE64 line = {0};
IMAGEHLP_LINE64 line {};
line.SizeOfStruct = sizeof(IMAGEHLP_LINE64);
DWORD dwDisplacement = 0;

View file

@ -132,7 +132,7 @@ namespace
QPixmap pixmapForExtension(const QString &ext) const override
{
const QString extWithDot = QLatin1Char('.') + ext;
SHFILEINFO sfi = { 0 };
SHFILEINFO sfi {};
HRESULT hr = ::SHGetFileInfoW(extWithDot.toStdWString().c_str(),
FILE_ATTRIBUTE_NORMAL, &sfi, sizeof(sfi), SHGFI_ICON | SHGFI_USEFILEATTRIBUTES);
if (FAILED(hr))