summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--alphabetparameters.cpp1
-rw-r--r--alphabetparameters.h6
-rw-r--r--bag.h2
-rw-r--r--board.h4
-rw-r--r--boardparameters.cpp1
-rw-r--r--boardparameters.h4
-rw-r--r--bogowinplayer.cpp1
-rw-r--r--datamanager.cpp1
-rw-r--r--datamanager.h10
-rw-r--r--endgame.cpp1
-rw-r--r--enumerator.h3
-rw-r--r--game.cpp1
-rw-r--r--game.h4
-rw-r--r--generator.h2
-rw-r--r--lexiconparameters.cpp1
-rw-r--r--lexiconparameters.h6
-rw-r--r--move.cpp1
-rw-r--r--move.h4
-rw-r--r--playerlist.h4
-rw-r--r--preendgame.cpp1
-rw-r--r--quacker/boardsetupdialog.cpp2
-rw-r--r--quacker/boardsetupdialog.h2
-rw-r--r--quacker/graphicalboard.cpp2
-rw-r--r--quacker/graphicalreporter.cpp2
-rw-r--r--quacker/lexicondialog.cpp2
-rw-r--r--quacker/lexicondialog.h1
-rw-r--r--quacker/lister.cpp3
-rw-r--r--quacker/newgame.cpp2
-rw-r--r--quacker/oppothread.cpp2
-rw-r--r--quacker/quacker.cpp4
-rw-r--r--quacker/settings.cpp2
-rw-r--r--quacker/settings.h2
-rw-r--r--quackleio/dawgfactory.cpp1
-rw-r--r--quackleio/dawgfactory.h1
-rw-r--r--quackleio/flexiblealphabet.cpp1
-rw-r--r--quackleio/gaddagfactory.cpp2
-rw-r--r--quackleio/gaddagfactory.h3
-rw-r--r--rack.h2
-rw-r--r--reporter.cpp1
-rw-r--r--sim.cpp1
-rw-r--r--sim.h2
-rw-r--r--strategyparameters.cpp1
-rw-r--r--strategyparameters.h2
-rw-r--r--uv.h42
44 files changed, 80 insertions, 63 deletions
diff --git a/alphabetparameters.cpp b/alphabetparameters.cpp
index 34c4d14..9d14ceb 100644
--- a/alphabetparameters.cpp
+++ b/alphabetparameters.cpp
@@ -23,6 +23,7 @@
#include "datamanager.h"
using namespace Quackle;
+using namespace std;
LetterString String::left(const LetterString &letterString, int number)
{
diff --git a/alphabetparameters.h b/alphabetparameters.h
index 26e332e..bfbf00a 100644
--- a/alphabetparameters.h
+++ b/alphabetparameters.h
@@ -25,7 +25,7 @@
#include "fixedstring.h"
#include "uv.h"
-using namespace std;
+using std::string;
#define QUACKLE_MAXIMUM_ALPHABET_SIZE 55
#define QUACKLE_MINIMUM_ALPHABET_SIZE 1
@@ -213,7 +213,7 @@ inline void LetterParameter::setVowel(bool isVowel)
m_isVowel = isVowel;
}
-typedef vector<LetterParameter> Alphabet;
+typedef std::vector<LetterParameter> Alphabet;
class AlphabetParameters
{
@@ -290,7 +290,7 @@ protected:
int m_length;
Alphabet m_alphabet;
- typedef map<UVString, int> LetterLookupMap;
+ typedef std::map<UVString, int> LetterLookupMap;
LetterLookupMap m_letterLookup;
string m_alphabetName;
diff --git a/bag.h b/bag.h
index fd44d6e..295fe54 100644
--- a/bag.h
+++ b/bag.h
@@ -22,8 +22,6 @@
#include "alphabetparameters.h"
#include "rack.h"
-using namespace std;
-
namespace Quackle
{
diff --git a/board.h b/board.h
index 3435b82..cf219aa 100644
--- a/board.h
+++ b/board.h
@@ -27,9 +27,7 @@
#include "move.h"
#include "rack.h"
-using namespace std;
-
-typedef bitset<QUACKLE_MAXIMUM_ALPHABET_SIZE> LetterBitset;
+typedef std::bitset<QUACKLE_MAXIMUM_ALPHABET_SIZE> LetterBitset;
#define QUACKLE_MAXIMUM_BOARD_SIZE LETTER_STRING_MAXIMUM_LENGTH
#define QUACKLE_MINIMUM_BOARD_SIZE 7
diff --git a/boardparameters.cpp b/boardparameters.cpp
index 5de6a8d..a77391a 100644
--- a/boardparameters.cpp
+++ b/boardparameters.cpp
@@ -19,6 +19,7 @@
#include "boardparameters.h"
using namespace Quackle;
+using namespace std;
BoardParameters::BoardParameters()
: m_width(15), m_height(15), m_startRow(7), m_startColumn(7)
diff --git a/boardparameters.h b/boardparameters.h
index 299c34c..b05d4b3 100644
--- a/boardparameters.h
+++ b/boardparameters.h
@@ -30,8 +30,8 @@ public:
BoardParameters();
// Does not serialize name...caller still has to get/set name manually
- void Serialize(ostream &stream);
- static BoardParameters *Deserialize(istream &stream);
+ void Serialize(std::ostream &stream);
+ static BoardParameters *Deserialize(std::istream &stream);
int width() const;
void setWidth(int width);
diff --git a/bogowinplayer.cpp b/bogowinplayer.cpp
index 083a94b..124a601 100644
--- a/bogowinplayer.cpp
+++ b/bogowinplayer.cpp
@@ -29,6 +29,7 @@
//#define DEBUG_COMPUTERPLAYER
using namespace Quackle;
+using namespace std;
SmartBogowin::SmartBogowin()
{
diff --git a/datamanager.cpp b/datamanager.cpp
index ecfeedc..392a5ed 100644
--- a/datamanager.cpp
+++ b/datamanager.cpp
@@ -34,6 +34,7 @@
#define QUACKLDEBUG
using namespace Quackle;
+using namespace std;
DataManager *DataManager::m_self = 0;
diff --git a/datamanager.h b/datamanager.h
index ca6ddd3..aa1bb3b 100644
--- a/datamanager.h
+++ b/datamanager.h
@@ -26,8 +26,6 @@
#include "playerlist.h"
-using namespace std;
-
#define QUACKLE_DATAMANAGER Quackle::DataManager::self()
#define QUACKLE_DATAMANAGER_EXISTS Quackle::DataManager::exists()
#define QUACKLE_EVALUATOR Quackle::DataManager::self()->evaluator()
@@ -125,11 +123,11 @@ public:
string userDataDirectory() { return m_userDataDirectory; }
void seedRandomNumbers(unsigned int seed);
- void seedRandomNumbers(seed_seq& seed);
+ void seedRandomNumbers(std::seed_seq& seed);
int randomInteger(int low, int high);
template <typename T> void shuffle(T& collection)
{
- lock_guard<mutex> lock(m_RngMutex);
+ std::lock_guard<std::mutex> lock(m_RngMutex);
std::shuffle(collection.begin(), collection.end(), m_mersenneTwisterRng);
}
@@ -154,8 +152,8 @@ private:
PlayerList m_computerPlayers;
- mt19937_64 m_mersenneTwisterRng;
- mutex m_RngMutex;
+ std::mt19937_64 m_mersenneTwisterRng;
+ std::mutex m_RngMutex;
};
inline DataManager *DataManager::self()
diff --git a/endgame.cpp b/endgame.cpp
index 5ebd7c6..99583f3 100644
--- a/endgame.cpp
+++ b/endgame.cpp
@@ -28,6 +28,7 @@
// #define DEBUG_ENDGAME
using namespace Quackle;
+using namespace std;
Endgame::Endgame()
: m_logfileIsOpen(false), m_hasHeader(false), m_dispatch(0)
diff --git a/enumerator.h b/enumerator.h
index 5d2c2d9..eddef1f 100644
--- a/enumerator.h
+++ b/enumerator.h
@@ -20,11 +20,10 @@
#define QUACKLE_ENUMERATOR_H
#include <vector>
+using std::vector;
#include "bag.h"
-using namespace std;
-
namespace Quackle
{
class Bag;
diff --git a/game.cpp b/game.cpp
index aa5a63f..0f2963a 100644
--- a/game.cpp
+++ b/game.cpp
@@ -31,6 +31,7 @@
#define DEBUG_BAG
using namespace Quackle;
+using namespace std;
Game::Game()
: m_defaultComputerPlayer(0)
diff --git a/game.h b/game.h
index 7cf5708..98031f1 100644
--- a/game.h
+++ b/game.h
@@ -610,7 +610,7 @@ inline void GamePosition::setExplanatoryNote(const UVString &explanatoryNote)
}
// simple modifiable list of positions
-typedef vector<GamePosition> PositionList;
+typedef std::vector<GamePosition> PositionList;
class Game;
@@ -836,7 +836,7 @@ public:
protected:
History m_positions;
- typedef map<int, ComputerPlayer *> ComputerPlayerMap;
+ typedef std::map<int, ComputerPlayer *> ComputerPlayerMap;
ComputerPlayer *m_defaultComputerPlayer;
ComputerPlayerMap m_computerPlayers;
diff --git a/generator.h b/generator.h
index 5a30f40..5fd0d54 100644
--- a/generator.h
+++ b/generator.h
@@ -25,7 +25,7 @@
#include "game.h"
#include "move.h"
-using namespace std;
+using std::vector;
namespace Quackle
{
diff --git a/lexiconparameters.cpp b/lexiconparameters.cpp
index 4f8d53d..bf6851e 100644
--- a/lexiconparameters.cpp
+++ b/lexiconparameters.cpp
@@ -26,6 +26,7 @@
#include "uv.h"
using namespace Quackle;
+using namespace std;
class Quackle::V0LexiconInterpreter : public LexiconInterpreter
{
diff --git a/lexiconparameters.h b/lexiconparameters.h
index 3d1ac19..96943cc 100644
--- a/lexiconparameters.h
+++ b/lexiconparameters.h
@@ -23,6 +23,8 @@
#include "gaddag.h"
+using std::vector;
+
namespace Quackle
{
@@ -31,8 +33,8 @@ class LexiconParameters;
class LexiconInterpreter
{
public:
- virtual void loadDawg(ifstream &file, LexiconParameters &lexparams) = 0;
- virtual void loadGaddag(ifstream &file, LexiconParameters &lexparams) = 0;
+ virtual void loadDawg(std::ifstream &file, LexiconParameters &lexparams) = 0;
+ virtual void loadGaddag(std::ifstream &file, LexiconParameters &lexparams) = 0;
virtual void dawgAt(const unsigned char *dawg, int index, unsigned int &p, Letter &letter, bool &t, bool &lastchild, bool &british, int &playability) const = 0;
virtual int versionNumber() const = 0;
virtual ~LexiconInterpreter() {};
diff --git a/move.cpp b/move.cpp
index 9a023f4..7793f27 100644
--- a/move.cpp
+++ b/move.cpp
@@ -23,6 +23,7 @@
#include "move.h"
using namespace Quackle;
+using namespace std;
bool operator==(const Move &move1, const Move &move2)
{
diff --git a/move.h b/move.h
index 7a66945..1734197 100644
--- a/move.h
+++ b/move.h
@@ -23,8 +23,6 @@
#include "alphabetparameters.h"
-using namespace std;
-
namespace Quackle
{
@@ -136,7 +134,7 @@ private:
// comparison based on action, then tiles, then horizontalness, then startrow, then endcol
bool operator<(const Quackle::Move &move1, const Quackle::Move &move2);
-class MoveList : public vector<Move>
+class MoveList : public std::vector<Move>
{
public:
enum SortType { Equity, Score, Alphabetical, Win};
diff --git a/playerlist.h b/playerlist.h
index 0f095e2..514de48 100644
--- a/playerlist.h
+++ b/playerlist.h
@@ -24,14 +24,12 @@
#include "alphabetparameters.h"
#include "player.h"
-using namespace std;
-
namespace Quackle
{
class Player;
-class PlayerList : public vector<Player>
+class PlayerList : public std::vector<Player>
{
public:
PlayerList();
diff --git a/preendgame.cpp b/preendgame.cpp
index 5a2ff71..0dc6b39 100644
--- a/preendgame.cpp
+++ b/preendgame.cpp
@@ -27,6 +27,7 @@
#include "resolvent.h"
using namespace Quackle;
+using namespace std;
Preendgame::Preendgame()
: m_initialCandidates(30), m_nestednessDenominatorBase(2)
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
diff --git a/quackleio/dawgfactory.cpp b/quackleio/dawgfactory.cpp
index 60c797d..a320f5c 100644
--- a/quackleio/dawgfactory.cpp
+++ b/quackleio/dawgfactory.cpp
@@ -26,6 +26,7 @@
#include "dawgfactory.h"
#include "util.h"
+using namespace std;
DawgFactory::DawgFactory(const QString &alphabetFile)
: m_encodableWords(0), m_unencodableWords(0), m_duplicateWords(0),
diff --git a/quackleio/dawgfactory.h b/quackleio/dawgfactory.h
index 04e7cb3..0751df3 100644
--- a/quackleio/dawgfactory.h
+++ b/quackleio/dawgfactory.h
@@ -24,6 +24,7 @@
#include <vector>
#include "flexiblealphabet.h"
+using std::vector;
class DawgFactory {
public:
diff --git a/quackleio/flexiblealphabet.cpp b/quackleio/flexiblealphabet.cpp
index 91d339e..6baf113 100644
--- a/quackleio/flexiblealphabet.cpp
+++ b/quackleio/flexiblealphabet.cpp
@@ -22,6 +22,7 @@
#include "util.h"
using namespace QuackleIO;
+using namespace std;
FlexibleAlphabetParameters::FlexibleAlphabetParameters()
{
diff --git a/quackleio/gaddagfactory.cpp b/quackleio/gaddagfactory.cpp
index 5d20d38..3fe129d 100644
--- a/quackleio/gaddagfactory.cpp
+++ b/quackleio/gaddagfactory.cpp
@@ -24,6 +24,8 @@
#include "gaddagfactory.h"
#include "util.h"
+using namespace std;
+
GaddagFactory::GaddagFactory(const UVString &alphabetFile)
: m_encodableWords(0), m_unencodableWords(0), m_alphas(NULL)
{
diff --git a/quackleio/gaddagfactory.h b/quackleio/gaddagfactory.h
index 364e492..ace0555 100644
--- a/quackleio/gaddagfactory.h
+++ b/quackleio/gaddagfactory.h
@@ -20,8 +20,11 @@
#define QUACKLE_GADDAGFACTORY_H
#include <cstdint>
+#include <vector>
#include "flexiblealphabet.h"
+using std::vector;
+
// This isn't a strict maximum...you can go higher...but too much higher, and you risk overflowing
// node pointers, which will get you garbage words. The OSPS dictionary is known to trigger
// such overflows.
diff --git a/rack.h b/rack.h
index 65c98f7..3d35df2 100644
--- a/rack.h
+++ b/rack.h
@@ -21,8 +21,6 @@
#include "alphabetparameters.h"
-using namespace std;
-
namespace Quackle
{
diff --git a/reporter.cpp b/reporter.cpp
index 92435d6..246da4b 100644
--- a/reporter.cpp
+++ b/reporter.cpp
@@ -28,6 +28,7 @@
#include "reporter.h"
using namespace Quackle;
+using namespace std;
void Reporter::reportPosition(const GamePosition &position, ComputerPlayer *computerPlayer, UVString *report)
{
diff --git a/sim.cpp b/sim.cpp
index 8fa9cab..eb8461b 100644
--- a/sim.cpp
+++ b/sim.cpp
@@ -31,6 +31,7 @@
//#define DEBUG_SIM
using namespace Quackle;
+using namespace std;
std::atomic_long SimmedMove::objectIdCounter{0};
diff --git a/sim.h b/sim.h
index 0a46c89..6532294 100644
--- a/sim.h
+++ b/sim.h
@@ -30,6 +30,8 @@
#include "alphabetparameters.h"
#include "game.h"
+using std::vector;
+
namespace Quackle
{
diff --git a/strategyparameters.cpp b/strategyparameters.cpp
index 88e66d1..336bf99 100644
--- a/strategyparameters.cpp
+++ b/strategyparameters.cpp
@@ -25,6 +25,7 @@
#include "strategyparameters.h"
using namespace Quackle;
+using namespace std;
StrategyParameters::StrategyParameters()
: m_hasSyn2(false)
diff --git a/strategyparameters.h b/strategyparameters.h
index 4398c51..12aa56f 100644
--- a/strategyparameters.h
+++ b/strategyparameters.h
@@ -60,7 +60,7 @@ protected:
static const int m_bogowinArrayWidth = 601;
static const int m_bogowinArrayHeight = 94;
double m_bogowin[m_bogowinArrayWidth][m_bogowinArrayHeight];
- typedef map<LetterString, double> SuperLeavesMap;
+ typedef std::map<LetterString, double> SuperLeavesMap;
SuperLeavesMap m_superleaves;
bool m_hasSyn2;
bool m_hasWorths;
diff --git a/uv.h b/uv.h
index b4a9a26..d792275 100644
--- a/uv.h
+++ b/uv.h
@@ -24,8 +24,6 @@
#include <sstream>
#include <string>
-using namespace std;
-
/** Beginning of define options */
// Whether to use wchar for Quackle's user-visible strings.
@@ -38,30 +36,30 @@ using namespace std;
#if QUACKLE_USE_WCHAR_FOR_USER_VISIBLE
-typedef wstring UVString;
+typedef std::wstring UVString;
typedef wchar_t UVChar;
-typedef wstringstream UVStringStream;
-typedef wistream UVIStream;
-typedef wostream UVOStream;
-typedef wostringstream UVOStringStream;
-typedef wistringstream UVIStringStream;
-typedef wifstream UVIFStream;
-typedef wofstream UVOFStream;
-#define UVcout wcout
-#define UVcerr wcerr
+typedef std::wstringstream UVStringStream;
+typedef std::wistream UVIStream;
+typedef std::wostream UVOStream;
+typedef std::wostringstream UVOStringStream;
+typedef std::wistringstream UVIStringStream;
+typedef std::wifstream UVIFStream;
+typedef std::wofstream UVOFStream;
+#define UVcout std::wcout
+#define UVcerr std::wcerr
#define MARK_UV(theString) L ## theString
#else
-typedef string UVString;
+typedef std::string UVString;
typedef char UVChar;
-typedef stringstream UVStringStream;
-typedef istream UVIStream;
-typedef ostream UVOStream;
-typedef istringstream UVIStringStream;
-typedef ostringstream UVOStringStream;
-typedef ifstream UVIFStream;
-typedef ofstream UVOFStream;
-#define UVcout cout
-#define UVcerr cerr
+typedef std::stringstream UVStringStream;
+typedef std::istream UVIStream;
+typedef std::ostream UVOStream;
+typedef std::istringstream UVIStringStream;
+typedef std::ostringstream UVOStringStream;
+typedef std::ifstream UVIFStream;
+typedef std::ofstream UVOFStream;
+#define UVcout std::cout
+#define UVcerr std::cerr
#define MARK_UV(theString) theString
#endif