From 77ccd417a335427569b7266bc0c737a045b932ef Mon Sep 17 00:00:00 2001 From: harre Date: Tue, 6 Aug 2019 23:49:51 +0200 Subject: [PATCH] Fix deprecated-copy errors and made deprecated-declarations just a warning --- oscar/Graphs/MinutesAtPressure.h | 13 +-- oscar/SleepLib/common.h | 6 +- oscar/SleepLib/loader_plugins/resmed_loader.h | 81 +------------------ oscar/SleepLib/machine_common.h | 13 +-- oscar/SleepLib/schema.h | 7 +- oscar/oscar.pro | 5 ++ 6 files changed, 11 insertions(+), 114 deletions(-) diff --git a/oscar/Graphs/MinutesAtPressure.h b/oscar/Graphs/MinutesAtPressure.h index 8dceb6c3..d7420ddf 100644 --- a/oscar/Graphs/MinutesAtPressure.h +++ b/oscar/Graphs/MinutesAtPressure.h @@ -22,18 +22,7 @@ struct PressureInfo peaktime = peakevents = 0; min_pressure = max_pressure = 0; } - PressureInfo(PressureInfo ©) { - code = copy.code; - minx = copy.minx; - maxx = copy.maxx; - peaktime = copy.peaktime; - peakevents = copy.peakevents; - min_pressure = copy.min_pressure; - max_pressure = copy.max_pressure; - times = copy.times; - events = copy.events; - chans = copy.chans; - } + PressureInfo(PressureInfo ©) = default; PressureInfo(ChannelID code, qint64 minx, qint64 maxx) : code(code), minx(minx), maxx(maxx) { diff --git a/oscar/SleepLib/common.h b/oscar/SleepLib/common.h index 523d4757..21a31c86 100644 --- a/oscar/SleepLib/common.h +++ b/oscar/SleepLib/common.h @@ -69,11 +69,7 @@ struct ValueCount { ValueCount( EventDataType val, qint64 cnt, double pp) :value(val), count(cnt), p(pp) {} - ValueCount(const ValueCount ©) { - value = copy.value; - count = copy.count; - p = copy.p; - } + ValueCount(const ValueCount ©) = default; EventDataType value; qint64 count; double p; diff --git a/oscar/SleepLib/loader_plugins/resmed_loader.h b/oscar/SleepLib/loader_plugins/resmed_loader.h index bd7101a4..75d84821 100644 --- a/oscar/SleepLib/loader_plugins/resmed_loader.h +++ b/oscar/SleepLib/loader_plugins/resmed_loader.h @@ -125,82 +125,8 @@ struct STRRecord date=QDate(); } - STRRecord(const STRRecord & copy) { - maskon = copy.maskon; - maskoff = copy.maskoff; - maskdur = copy.maskdur; - maskevents = copy.maskevents; - mode = copy.mode; - rms9_mode = copy.rms9_mode; - set_pressure = copy.set_pressure; - epap = copy.epap; - max_pressure = copy.max_pressure; - min_pressure = copy.min_pressure; - max_ps = copy.max_ps; - min_ps = copy.min_ps; - ps = copy.ps; - max_epap = copy.max_epap; - min_epap = copy.min_epap; - ipap = copy.ipap; - max_ipap = copy.max_ipap; - min_ipap = copy.min_ipap; - epr = copy.epr; - epr_level = copy.epr_level; - sessionid = copy.sessionid; - ahi = copy.ahi; - ai = copy.ai; - oai = copy.oai; - hi = copy.hi; - uai = copy.uai; - cai = copy.cai; - csr = copy.csr; + STRRecord(const STRRecord & copy) = default; - date = copy.date; - leak50 = copy.leak50; - leak95 = copy.leak95; - leakmax = copy.leakmax; - rr50 = copy.rr50; - rr95 = copy.rr95; - rrmax = copy.rrmax; - mv50 = copy.mv50; - mv95 = copy.mv95; - mvmax = copy.mvmax; - ie50 = copy.ie50; - ie95 = copy.ie95; - iemax = copy.iemax; - tv50 = copy.tv50; - tv95 = copy.tv95; - tvmax = copy.tvmax; - mp50 = copy.mp50; - mp95 = copy.mp95; - mpmax = copy.mpmax; - - - tgtepap50 = copy.tgtepap50; - tgtepap95 = copy.tgtepap95; - tgtepapmax = copy.tgtepapmax; - tgtipap50 = copy.tgtipap50; - tgtipap95 = copy.tgtipap95; - tgtipapmax = copy.tgtipapmax; - - s_EPREnable = copy.s_EPREnable; - s_EPR_ClinEnable = copy.s_EPREnable; - s_RampEnable = copy.s_RampEnable; - s_RampTime = copy.s_RampTime; - - s_SmartStart = copy.s_SmartStart; - s_PtAccess = copy.s_PtAccess; - s_ABFilter = copy.s_ABFilter; - s_Mask = copy.s_Mask; - - s_Tube = copy.s_Tube; - s_ClimateControl = copy.s_ClimateControl; - s_HumEnable = copy.s_HumEnable; - s_HumLevel = copy.s_HumLevel; - s_TempEnable = copy.s_TempEnable; - s_Temp = copy.s_Temp; - ramp_pressure = copy.ramp_pressure; - } QVector maskon; QVector maskoff; @@ -347,10 +273,7 @@ struct STRFile { filename(QString()), edf(nullptr) {} STRFile(QString name, ResMedEDFParser *str) : filename(name), edf(str) {} - STRFile(const STRFile & copy) { - filename = copy.filename; - edf = copy.edf; - } + STRFile(const STRFile & copy) = default; ~STRFile() { } diff --git a/oscar/SleepLib/machine_common.h b/oscar/SleepLib/machine_common.h index cac60064..e815bddf 100644 --- a/oscar/SleepLib/machine_common.h +++ b/oscar/SleepLib/machine_common.h @@ -92,18 +92,7 @@ enum PRTimeModes { //:short struct MachineInfo { MachineInfo() { type = MT_UNKNOWN; version = 0; cap=0; } - MachineInfo(const MachineInfo & copy) { - type = copy.type; - loadername = copy.loadername; - brand = copy.brand; - model = copy.model; - modelnumber = copy.modelnumber; - serial = copy.serial; - series = copy.series; - version = copy.version; - lastimported = copy.lastimported; - cap = copy.cap; - } + MachineInfo(const MachineInfo & copy) = default; MachineInfo(MachineType type, quint32 cap, QString loadername, QString brand, QString model, QString modelnumber, QString serial, QString series, QDateTime lastimported, int version) : type(type), cap(cap), loadername(loadername), brand(brand), model(model), modelnumber(modelnumber), serial(serial), series(series), lastimported(lastimported), version(version) {} diff --git a/oscar/SleepLib/schema.h b/oscar/SleepLib/schema.h index d30597e5..a91eade2 100644 --- a/oscar/SleepLib/schema.h +++ b/oscar/SleepLib/schema.h @@ -36,12 +36,7 @@ public: color = Qt::black; type = Calc_Zero; } - ChannelCalc(const ChannelCalc & copy) { - code = copy.code; - color = copy.color; - enabled = copy.enabled; - type = copy.type; - } + ChannelCalc(const ChannelCalc & copy) = default; ChannelCalc(ChannelID code, ChannelCalcType type, QColor color, bool enabled): code(code), type(type), color(color), enabled(enabled) {} diff --git a/oscar/oscar.pro b/oscar/oscar.pro index fc103de8..5ba9b31e 100644 --- a/oscar/oscar.pro +++ b/oscar/oscar.pro @@ -455,6 +455,11 @@ DISTFILES += help/default.css \ QMAKE_CFLAGS += -Werror QMAKE_CXXFLAGS += -Werror +# Make deprecation warnings just warnings +QMAKE_CFLAGS += -Wno-error=deprecated-declarations +QMAKE_CXXFLAGS += -Wno-error=deprecated-declarations + + # Create a debug GUI build by adding "CONFIG+=memdebug" to your qmake command memdebug { !win32 { # add memory checking on Linux and macOS debug builds