Fix MSVC warnings.

This commit is contained in:
Roman Telezhynskyi 2023-03-08 18:45:42 +02:00
parent 973f4d6b0d
commit 37541b600e
14 changed files with 25 additions and 17 deletions

View File

@ -808,8 +808,13 @@ Module {
"-wd5204", // class has virtual functions, but its trivial destructor is not virtual; instances of objects derived
// from this class may not be destructed correctly
"-wd5219", // implicit conversion from '<type>' to '<type>', possible loss of data
"-wd5243" // 'type-name': using incomplete class 'class-name' can cause potential one definition rule violation due
"-wd5243", // 'type-name': using incomplete class 'class-name' can cause potential one definition rule violation due
// to ABI limitation
"-wd4464", // relative include path contains '..'
"-wd4458", // declaration of 'X' hides class member
"-wd4456", // declaration of 'X' hides previous local declaration
"-wd4459", // declaration of 'X' hides global declaration
"-wd4457" // declaration of 'X' hides function parameter
)
}
return debugFlags;

View File

@ -1672,7 +1672,7 @@ void VPMainWindow::ReadSettings()
if (settings->status() == QSettings::NoError)
{
restoreGeometry(settings->GetGeometry());
restoreState(settings->GetToolbarsState(), AppVersion());
restoreState(settings->GetToolbarsState(), static_cast<int>(AppVersion()));
// Text under tool buton icon
ToolBarStyles();
@ -1697,7 +1697,7 @@ void VPMainWindow::WriteSettings()
{
VPSettings *settings = VPApplication::VApp()->PuzzleSettings();
settings->SetGeometry(saveGeometry());
settings->SetToolbarsState(saveState(AppVersion()));
settings->SetToolbarsState(saveState(static_cast<int>(AppVersion())));
settings->SetDockWidgetPropertiesActive(ui->dockWidgetProperties->isEnabled());
settings->SetDockWidgetPropertiesContentsActive(ui->dockWidgetPropertiesContents->isEnabled());

View File

@ -3611,7 +3611,7 @@ void TMainWindow::ReadSettings()
if (settings->status() == QSettings::NoError)
{
restoreGeometry(settings->GetGeometry());
restoreState(settings->GetToolbarsState(), AppVersion());
restoreState(settings->GetToolbarsState(), static_cast<int>(AppVersion()));
// Text under tool buton icon
ToolBarStyles();
@ -3630,7 +3630,7 @@ void TMainWindow::WriteSettings()
{
VTapeSettings *settings = MApplication::VApp()->TapeSettings();
settings->SetGeometry(saveGeometry());
settings->SetToolbarsState(saveState(AppVersion()));
settings->SetToolbarsState(saveState(static_cast<int>(AppVersion())));
settings->SetTapeSearchOptionMatchCase(m_search->IsMatchCase());
settings->SetTapeSearchOptionWholeWord(m_search->IsMatchWord());

View File

@ -5204,7 +5204,7 @@ void MainWindow::ReadSettings()
if (settings->status() == QSettings::NoError)
{
restoreGeometry(settings->GetGeometry());
restoreState(settings->GetToolbarsState(), AppVersion());
restoreState(settings->GetToolbarsState(), static_cast<int>(AppVersion()));
m_groupsActive = settings->IsDockWidgetGroupsActive();
m_toolOptionsActive = settings->IsDockWidgetToolOptionsActive();
@ -5248,7 +5248,7 @@ void MainWindow::WriteSettings()
VValentinaSettings *settings = VAbstractValApplication::VApp()->ValentinaSettings();
settings->SetGeometry(saveGeometry());
settings->SetToolbarsState(saveState(AppVersion()));
settings->SetToolbarsState(saveState(static_cast<int>(AppVersion())));
settings->SetDockWidgetGroupsActive(ui->dockWidgetGroups->isVisible());
settings->SetDockWidgetToolOptionsActive(ui->dockWidgetToolOptions->isVisible());

View File

@ -26,7 +26,6 @@
#include <QString>
#include <QtGlobal>
#include "../qmuparser/qmuparser_global.h"
#include "qmuparser.h"
#include "qmuparser_global.h"

View File

@ -32,13 +32,13 @@
#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0)
#include "../vmisc/defglobal.h"
namespace qmu
{
QT_WARNING_PUSH
QT_WARNING_DISABLE_GCC("-Weffc++")
QT_WARNING_DISABLE_GCC("-Wnon-virtual-dtor")
namespace qmu
{
class QmuParserCallbackData : public QSharedData
{
public:
@ -94,5 +94,7 @@ private:
Q_DISABLE_ASSIGN(QmuParserCallbackData)
};
QT_WARNING_POP
}
#endif // QMUPARSERCALLBACK_P_H

View File

@ -31,7 +31,6 @@
#include <QtGlobal>
#include <sstream>
#include "../qmuparser/qmuparser_global.h"
#include "qmuparser_global.h"
#include "qmuparserdef.h"
#include "qmutranslation.h"

View File

@ -34,7 +34,6 @@
# include <QRandomGenerator>
#endif
#include "../qmuparser/qmuparser_global.h"
#include "qmuparser.h"
#include "qmuparser_global.h"
#include "qmuparserdef.h"

View File

@ -26,7 +26,6 @@
#include <QString>
#include <QtGlobal>
#include "../qmuparser/qmuparser_global.h"
#include "qmuformulabase.h"
#include "qmuparser_global.h"

View File

@ -22,7 +22,7 @@
#ifndef QMUTRANSLATION_H
#define QMUTRANSLATION_H
#include "../qmuparser/qmuparser_global.h"
#include "qmuparser_global.h"
#include <QString>
namespace qmu

View File

@ -83,4 +83,6 @@ private:
Q_DISABLE_ASSIGN(VBestSquareData)
};
QT_WARNING_POP
#endif // VBESTSQUARE_P_H

View File

@ -26,6 +26,7 @@ namespace detail
QT_WARNING_PUSH
QT_WARNING_DISABLE_CLANG("-Wsign-conversion")
QT_WARNING_DISABLE_GCC("-Wconversion")
QT_WARNING_DISABLE_MSVC(4365)
// Returns the index of the most-signifcant set bit
inline auto find_highest_bit(unsigned long long value) noexcept -> long

View File

@ -262,8 +262,9 @@ void VAbstractApplication::WinAttachConsole()
auto stdout_type = GetFileType(GetStdHandle(STD_OUTPUT_HANDLE));
if (stdout_type == FILE_TYPE_UNKNOWN && AttachConsole(ATTACH_PARENT_PROCESS))
{
freopen("CONOUT$", "w", stdout);
freopen("CONOUT$", "w", stderr);
FILE *fp = nullptr;
freopen_s(&fp, "CONOUT$", "w", stdout);
freopen_s(&fp, "CONOUT$", "w", stderr);
}
}
#endif

View File

@ -591,6 +591,7 @@ QT_WARNING_DISABLE_GCC("-Wswitch-default")
{
case ContextMenuOption::LAST_ONE_DO_NOT_USE:
Q_UNREACHABLE();
break;
case ContextMenuOption::NoSelection:
return;
case ContextMenuOption::Option: