-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbcb5b78c74f06cc878cb347b9f99b08cddfafef4.patch
86 lines (73 loc) · 2.91 KB
/
bcb5b78c74f06cc878cb347b9f99b08cddfafef4.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
From bcb5b78c74f06cc878cb347b9f99b08cddfafef4 Mon Sep 17 00:00:00 2001
From: jontio <[email protected]>
Date: Sat, 26 Oct 2019 08:59:37 +1300
Subject: [PATCH] compiles with QMAKE_CXXFLAGS += '-Werror=format-security'.
changed location of math constants define.
---
JAERO/DSP.h | 1 -
JAERO/JAERO.pro | 4 ++++
JAERO/downloadmanager.cpp | 10 +++++-----
3 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/JAERO/DSP.h b/JAERO/DSP.h
index ddef3ff..d960c31 100644
--- a/JAERO/DSP.h
+++ b/JAERO/DSP.h
@@ -3,7 +3,6 @@
#ifndef DSPH
#define DSPH
//---------------------------------------------------------------------------
-#define _USE_MATH_DEFINES
#include <math.h>
#include <vector>
#include <complex>
diff --git a/JAERO/JAERO.pro b/JAERO/JAERO.pro
index a9116e4..540620b 100644
--- a/JAERO/JAERO.pro
+++ b/JAERO/JAERO.pro
@@ -53,6 +53,8 @@ contains(QT_ARCH, i386) {
DEFINES += kiss_fft_scalar=double
}
+DEFINES += _USE_MATH_DEFINES
+
SOURCES += main.cpp\
mainwindow.cpp \
coarsefreqestimate.cpp \
@@ -243,3 +245,5 @@ INSTALLS += target
# disable stupid deprecated-copy warnings
# cluttering up issues
QMAKE_CXXFLAGS += '-Wno-deprecated-copy'
+
+#QMAKE_CXXFLAGS += '-Werror=format-security'
diff --git a/JAERO/downloadmanager.cpp b/JAERO/downloadmanager.cpp
index 6cefa1d..0a7fe56 100644
--- a/JAERO/downloadmanager.cpp
+++ b/JAERO/downloadmanager.cpp
@@ -93,7 +93,7 @@ void DownloadManager::startNextDownload()
if (downloadQueue.isEmpty())
{
pd.hide();
- qDebug(qPrintable(((QString)"").sprintf("%d/%d files downloaded successfully\n", downloadedCount, totalCount)));
+ qDebug()<<QString::asprintf("%d/%d files downloaded successfully\n", downloadedCount, totalCount);
if(downloadedCount||(totalCount>1))
{
@@ -128,13 +128,13 @@ void DownloadManager::startNextDownload()
msgBox.setIcon(QMessageBox::Critical);
msgBox.exec();
- qCritical(qPrintable(((QString)"").sprintf(
+ qCritical()<<QString::asprintf(
"Problem opening save file '%s' for download '%s': %s\n",
qPrintable(tmptofilalfilenamemap.value(filename)), url.toEncoded().constData(),
qPrintable(output.errorString())
- )));
+ );
startNextDownload();
return; // skip this download
@@ -184,11 +184,11 @@ void DownloadManager::downloadFinished()
// download failed
- qCritical(qPrintable(((QString)"").sprintf(
+ qCritical()<<QString::asprintf(
"Download Failed: %s", qPrintable(currentDownload->errorString())
- )));
+ );
QMessageBox msgBox;
msgBox.setText("Download failed.");