diff options
author | John Fultz <jfultz@wolfram.com> | 2023-07-17 15:49:09 -0500 |
---|---|---|
committer | John Fultz <jfultz@wolfram.com> | 2023-07-17 16:20:01 -0500 |
commit | 3b9e9b6df1d124b29bfd3715b6cb12cdee18b2ea (patch) | |
tree | 9ee43ed8bc403f7f9b444ecb505dbcd5afb11d75 /quacker | |
parent | 741ba7f9223071da84146069851b48d2344ac03e (diff) |
Fix up std:: namespace hygiene.
* Remove all uses of `using namespace std` from header files (although a
few specific cases of things like `using std::vector` remain)
* Move all existing uses of `using namespace std` in cpp files to after the
header includes
* Make coordinating changes so it builds again.
Qt6 builds on Windows were breaking because of namespace collision between
std::byte and some version of `byte` in one of Qt's namespaces. That breakage
is now fixed.
It would be good to systematically clean up all `using` declarations in header
files to ensure nothing is leaking out, but that's for another time.
Diffstat (limited to 'quacker')
-rw-r--r-- | quacker/boardsetupdialog.cpp | 2 | ||||
-rw-r--r-- | quacker/boardsetupdialog.h | 2 | ||||
-rw-r--r-- | quacker/graphicalboard.cpp | 2 | ||||
-rw-r--r-- | quacker/graphicalreporter.cpp | 2 | ||||
-rw-r--r-- | quacker/lexicondialog.cpp | 2 | ||||
-rw-r--r-- | quacker/lexicondialog.h | 1 | ||||
-rw-r--r-- | quacker/lister.cpp | 3 | ||||
-rw-r--r-- | quacker/newgame.cpp | 2 | ||||
-rw-r--r-- | quacker/oppothread.cpp | 2 | ||||
-rw-r--r-- | quacker/quacker.cpp | 4 | ||||
-rw-r--r-- | quacker/settings.cpp | 2 | ||||
-rw-r--r-- | quacker/settings.h | 2 |
12 files changed, 17 insertions, 9 deletions
diff --git a/quacker/boardsetupdialog.cpp b/quacker/boardsetupdialog.cpp index 33c9f21..e1d8892 100644 --- a/quacker/boardsetupdialog.cpp +++ b/quacker/boardsetupdialog.cpp @@ -32,6 +32,8 @@ #include "widgetfactory.h" #include "settings.h" +using namespace std; + BoardSetupDialog::BoardSetupDialog(QWidget *parent) : QDialog(parent) { resize(700,550); diff --git a/quacker/boardsetupdialog.h b/quacker/boardsetupdialog.h index 0929b66..8a1a34c 100644 --- a/quacker/boardsetupdialog.h +++ b/quacker/boardsetupdialog.h @@ -25,8 +25,6 @@ #include <QWidget> #include <QDialog> -using namespace std; - class QCheckBox; class QComboBox; class QLineEdit; diff --git a/quacker/graphicalboard.cpp b/quacker/graphicalboard.cpp index 0fc3785..6b1d14b 100644 --- a/quacker/graphicalboard.cpp +++ b/quacker/graphicalboard.cpp @@ -33,6 +33,8 @@ #include "quackersettings.h" #include "settings.h" +using namespace std; + const double GraphicalBoardFrame::s_markOtherLengthMultiplier = 0.6; const double TileWidget::s_defaultLetterScale = 0.7; diff --git a/quacker/graphicalreporter.cpp b/quacker/graphicalreporter.cpp index 4c9fa43..a23cc97 100644 --- a/quacker/graphicalreporter.cpp +++ b/quacker/graphicalreporter.cpp @@ -39,6 +39,8 @@ const char *kHtmlHeader = "\n\n" ; +using namespace std; + GraphicalReporter::GraphicalReporter(const QString &outputDirectory, bool generateImages) : m_output(outputDirectory), m_generateImages(generateImages) { diff --git a/quacker/lexicondialog.cpp b/quacker/lexicondialog.cpp index 88e86b1..04092f1 100644 --- a/quacker/lexicondialog.cpp +++ b/quacker/lexicondialog.cpp @@ -278,7 +278,7 @@ void LexiconDialog::accept() void LexiconDialog::updateLexiconInformation(bool firstTime) { - QByteArray hash = m_wordFactory ? QByteArray(m_wordFactory->hashBytes(), 16).toHex() : ""; + QByteArray hash = m_wordFactory ? QByteArray(m_wordFactory->hashBytes(), 16).toHex() : QByteArray(""); QString text; QString lengthText; diff --git a/quacker/lexicondialog.h b/quacker/lexicondialog.h index 4e18398..2834a90 100644 --- a/quacker/lexicondialog.h +++ b/quacker/lexicondialog.h @@ -26,7 +26,6 @@ #include <QWidget> #include <QDialog> -using namespace std; using namespace Quackle; class QComboBox; diff --git a/quacker/lister.cpp b/quacker/lister.cpp index 644dd90..4cfc03e 100644 --- a/quacker/lister.cpp +++ b/quacker/lister.cpp @@ -17,7 +17,6 @@ */ #include <iostream> -using namespace std; #include <QtWidgets> @@ -27,6 +26,8 @@ using namespace std; #include "lister.h" #include "customqsettings.h" +using namespace std; + ListerDialog::ListerDialog(QWidget *parent, const QString &settingsGroup, const QString &appName, int flags) : QDialog(parent), m_settingsGroup(settingsGroup), m_appName(appName), m_flags(flags) { diff --git a/quacker/newgame.cpp b/quacker/newgame.cpp index 001d37d..4d5c5a2 100644 --- a/quacker/newgame.cpp +++ b/quacker/newgame.cpp @@ -27,6 +27,8 @@ #include "newgame.h" #include "customqsettings.h" +using namespace std; + NewGameDialog::NewGameDialog(QWidget *parent) : QDialog(parent) { diff --git a/quacker/oppothread.cpp b/quacker/oppothread.cpp index ffeb1ec..c3df7a5 100644 --- a/quacker/oppothread.cpp +++ b/quacker/oppothread.cpp @@ -23,6 +23,8 @@ #include "oppothread.h" +using namespace std; + QuackerDispatch::QuackerDispatch(QObject *parent) : QObject(parent), m_shouldAbort(false) { diff --git a/quacker/quacker.cpp b/quacker/quacker.cpp index a244586..7ab54c0 100644 --- a/quacker/quacker.cpp +++ b/quacker/quacker.cpp @@ -19,8 +19,6 @@ #include <algorithm> #include <iostream> -using namespace std; - #include <QtWidgets> #include <game.h> @@ -55,6 +53,8 @@ using namespace std; #include "widgetfactory.h" #include "view.h" +using namespace std; + const int kExtraPlaysToKibitz = 15; TopLevel::TopLevel(QWidget *parent) diff --git a/quacker/settings.cpp b/quacker/settings.cpp index 41ff9a3..6ce139a 100644 --- a/quacker/settings.cpp +++ b/quacker/settings.cpp @@ -44,6 +44,8 @@ #include "graphicalboard.h" #include "lexicondialog.h" +using namespace std; + Settings *Settings::m_self = 0; Settings *Settings::self() { diff --git a/quacker/settings.h b/quacker/settings.h index e0736c0..d732692 100644 --- a/quacker/settings.h +++ b/quacker/settings.h @@ -31,8 +31,6 @@ class QCheckBox; class QPushButton; class QLabel; -using namespace std; - class Settings : public QWidget { Q_OBJECT |