From 87546d2ce6457f0b6cc5bace532122bd6fb5875c Mon Sep 17 00:00:00 2001 From: ts-korhonen Date: Mon, 7 Mar 2022 21:47:48 +0200 Subject: [PATCH] qt: fix multiple compiler warnings --- src/qt/qt_newfloppydialog.cpp | 5 +++++ src/qt/qt_platform.cpp | 10 ++++++---- src/qt/qt_settings_bus_tracking.cpp | 2 +- src/qt/qt_settingsinput.cpp | 1 - src/qt/qt_settingsnetwork.cpp | 1 - src/qt/qt_settingsstoragecontrollers.cpp | 1 - 6 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/qt/qt_newfloppydialog.cpp b/src/qt/qt_newfloppydialog.cpp index 6eb43c960..58239fe16 100644 --- a/src/qt/qt_newfloppydialog.cpp +++ b/src/qt/qt_newfloppydialog.cpp @@ -339,6 +339,11 @@ bool NewFloppyDialog::create86f(const QString& filename, const disk_size_t& disk return true; } +/* Ignore false positive warning caused by a bug on gcc */ +#ifdef __GNUC__ +#pragma GCC diagnostic ignored "-Wstringop-overflow" +#endif + bool NewFloppyDialog::createSectorImage(const QString &filename, const disk_size_t& disk_size, FileType type) { uint32_t total_size = 0; diff --git a/src/qt/qt_platform.cpp b/src/qt/qt_platform.cpp index 0c399cd48..855e8a04c 100644 --- a/src/qt/qt_platform.cpp +++ b/src/qt/qt_platform.cpp @@ -74,11 +74,13 @@ private: extern "C" { #ifdef Q_OS_WINDOWS -#define NOMINMAX -#include -#include <86box/win.h> +# ifndef NOMINMAX +# define NOMINMAX +# endif +# include +# include <86box/win.h> #else -#include +# include #endif #include <86box/86box.h> #include <86box/device.h> diff --git a/src/qt/qt_settings_bus_tracking.cpp b/src/qt/qt_settings_bus_tracking.cpp index 41c7990da..b9b70bae1 100644 --- a/src/qt/qt_settings_bus_tracking.cpp +++ b/src/qt/qt_settings_bus_tracking.cpp @@ -218,7 +218,7 @@ SettingsBusTracking::scsi_bus_full() void SettingsBusTracking::device_track(int set, uint8_t dev_type, int bus, int channel) { - int i, element; + int element; uint64_t mask; uint8_t count = 0; diff --git a/src/qt/qt_settingsinput.cpp b/src/qt/qt_settingsinput.cpp index 7408db5d4..d5a62534f 100644 --- a/src/qt/qt_settingsinput.cpp +++ b/src/qt/qt_settingsinput.cpp @@ -54,7 +54,6 @@ void SettingsInput::onCurrentMachineChanged(int machineId) { // win_settings_video_proc, WM_INITDIALOG this->machineId = machineId; - const auto* machine = &machines[machineId]; auto* mouseModel = ui->comboBoxMouse->model(); auto removeRows = mouseModel->rowCount(); diff --git a/src/qt/qt_settingsnetwork.cpp b/src/qt/qt_settingsnetwork.cpp index 437ed3647..ec5ebbe53 100644 --- a/src/qt/qt_settingsnetwork.cpp +++ b/src/qt/qt_settingsnetwork.cpp @@ -80,7 +80,6 @@ void SettingsNetwork::save() { void SettingsNetwork::onCurrentMachineChanged(int machineId) { this->machineId = machineId; - auto* machine = &machines[machineId]; auto* model = ui->comboBoxAdapter->model(); auto removeRows = model->rowCount(); diff --git a/src/qt/qt_settingsstoragecontrollers.cpp b/src/qt/qt_settingsstoragecontrollers.cpp index 2427b5774..114654340 100644 --- a/src/qt/qt_settingsstoragecontrollers.cpp +++ b/src/qt/qt_settingsstoragecontrollers.cpp @@ -64,7 +64,6 @@ void SettingsStorageControllers::save() { void SettingsStorageControllers::onCurrentMachineChanged(int machineId) { this->machineId = machineId; - auto* machine = &machines[machineId]; /*HD controller config*/ auto* model = ui->comboBoxHD->model();