From 4751b79f428e8c9ecab3f7208e80e1289e6b628d Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Fri, 25 May 2018 17:27:45 +0800 Subject: [PATCH] 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] --- src/app/stacktrace_win.h | 2 +- src/gui/torrentcontentmodel.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/stacktrace_win.h b/src/app/stacktrace_win.h index 0ed005b27..4ad573a83 100644 --- a/src/app/stacktrace_win.h +++ b/src/app/stacktrace_win.h @@ -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; diff --git a/src/gui/torrentcontentmodel.cpp b/src/gui/torrentcontentmodel.cpp index 9130c86b7..94b2fead6 100644 --- a/src/gui/torrentcontentmodel.cpp +++ b/src/gui/torrentcontentmodel.cpp @@ -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))