diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2014-06-16 16:30:38 +0200 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2014-06-16 17:42:54 +0200 |
commit | 09eb201b1b3ed808e5167245149f5635d4eaf6f9 (patch) | |
tree | 0fc95f43c7355321cbd2b79603edfdcea42e962d | |
parent | 807691ca96a1a4b0655f6ea80b721b940dd29a39 (diff) |
Remove `using namespace std` from header file
It's considered bad form to import things into the global namespace in a
header. Put it in the cpp files where it is needed instead.
-rw-r--r-- | src/bitcoin-cli.cpp | 1 | ||||
-rw-r--r-- | src/chainparams.cpp | 1 | ||||
-rw-r--r-- | src/chainparams.h | 22 | ||||
-rw-r--r-- | src/miner.cpp | 2 | ||||
-rw-r--r-- | src/qt/paymentrequestplus.cpp | 1 | ||||
-rw-r--r-- | src/qt/paymentrequestplus.h | 2 | ||||
-rw-r--r-- | src/qt/paymentserver.cpp | 1 | ||||
-rw-r--r-- | src/qt/transactiondesc.cpp | 2 | ||||
-rw-r--r-- | src/qt/walletmodel.cpp | 2 |
9 files changed, 21 insertions, 13 deletions
diff --git a/src/bitcoin-cli.cpp b/src/bitcoin-cli.cpp index c7327fd7c9..40b45415c4 100644 --- a/src/bitcoin-cli.cpp +++ b/src/bitcoin-cli.cpp @@ -12,6 +12,7 @@ #include <boost/filesystem/operations.hpp> +using namespace std; using namespace boost; using namespace boost::asio; using namespace json_spirit; diff --git a/src/chainparams.cpp b/src/chainparams.cpp index 47136eeeea..6b2cfa1d1f 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -10,6 +10,7 @@ #include <boost/assign/list_of.hpp> +using namespace std; using namespace boost::assign; // diff --git a/src/chainparams.h b/src/chainparams.h index 6e09a2cba3..28a51cbb0c 100644 --- a/src/chainparams.h +++ b/src/chainparams.h @@ -12,13 +12,11 @@ #include <vector> -using namespace std; - typedef unsigned char MessageStartChars[MESSAGE_START_SIZE]; struct CDNSSeedData { - string name, host; - CDNSSeedData(const string &strName, const string &strHost) : name(strName), host(strHost) {} + std::string name, host; + CDNSSeedData(const std::string &strName, const std::string &strHost) : name(strName), host(strHost) {} }; /** @@ -51,7 +49,7 @@ public: const uint256& HashGenesisBlock() const { return hashGenesisBlock; } const MessageStartChars& MessageStart() const { return pchMessageStart; } - const vector<unsigned char>& AlertKey() const { return vAlertPubKey; } + const std::vector<unsigned char>& AlertKey() const { return vAlertPubKey; } int GetDefaultPort() const { return nDefaultPort; } const uint256& ProofOfWorkLimit() const { return bnProofOfWorkLimit; } int SubsidyHalvingInterval() const { return nSubsidyHalvingInterval; } @@ -74,16 +72,16 @@ public: bool RequireStandard() const { return fRequireStandard; } /* Make standard checks */ bool RPCisTestNet() const { return fRPCisTestNet; } - const string& DataDir() const { return strDataDir; } + const std::string& DataDir() const { return strDataDir; } /* Make miner stop after a block is found. In RPC, don't return * until nGenProcLimit blocks are generated */ bool MineBlocksOnDemand() const { return fMineBlocksOnDemand; } Network NetworkID() const { return networkID; } /* Return the BIP70 network string (main, test or regtest) */ std::string NetworkIDString() const { return strNetworkID; } - const vector<CDNSSeedData>& DNSSeeds() const { return vSeeds; } + const std::vector<CDNSSeedData>& DNSSeeds() const { return vSeeds; } const std::vector<unsigned char>& Base58Prefix(Base58Type type) const { return base58Prefixes[type]; } - const vector<CAddress>& FixedSeeds() const { return vFixedSeeds; } + const std::vector<CAddress>& FixedSeeds() const { return vFixedSeeds; } int RPCPort() const { return nRPCPort; } protected: CChainParams() {} @@ -91,7 +89,7 @@ protected: uint256 hashGenesisBlock; MessageStartChars pchMessageStart; // Raw pub key bytes for the broadcast alert signing key. - vector<unsigned char> vAlertPubKey; + std::vector<unsigned char> vAlertPubKey; int nDefaultPort; int nRPCPort; uint256 bnProofOfWorkLimit; @@ -99,14 +97,14 @@ protected: int nEnforceBlockUpgradeMajority; int nRejectBlockOutdatedMajority; int nToCheckBlockUpgradeMajority; - string strDataDir; + std::string strDataDir; int nMinerThreads; - vector<CDNSSeedData> vSeeds; + std::vector<CDNSSeedData> vSeeds; std::vector<unsigned char> base58Prefixes[MAX_BASE58_TYPES]; Network networkID; std::string strNetworkID; CBlock genesis; - vector<CAddress> vFixedSeeds; + std::vector<CAddress> vFixedSeeds; bool fRequireRPCPassword; bool fMiningRequiresPeers; bool fDefaultCheckMemPool; diff --git a/src/miner.cpp b/src/miner.cpp index a0a728fb81..87779efbbd 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -11,6 +11,8 @@ #ifdef ENABLE_WALLET #include "wallet.h" #endif + +using namespace std; ////////////////////////////////////////////////////////////////////////////// // // BitcoinMiner diff --git a/src/qt/paymentrequestplus.cpp b/src/qt/paymentrequestplus.cpp index e369734a98..464f995eb6 100644 --- a/src/qt/paymentrequestplus.cpp +++ b/src/qt/paymentrequestplus.cpp @@ -17,6 +17,7 @@ #include <QDebug> #include <QSslCertificate> +using namespace std; class SSLVerifyError : public std::runtime_error { diff --git a/src/qt/paymentrequestplus.h b/src/qt/paymentrequestplus.h index 8c126b1fad..3c4861a4d4 100644 --- a/src/qt/paymentrequestplus.h +++ b/src/qt/paymentrequestplus.h @@ -24,7 +24,7 @@ public: PaymentRequestPlus() { } bool parse(const QByteArray& data); - bool SerializeToString(string* output) const; + bool SerializeToString(std::string* output) const; bool IsInitialized() const; QString getPKIType() const; diff --git a/src/qt/paymentserver.cpp b/src/qt/paymentserver.cpp index eb6ab879aa..49923a1afc 100644 --- a/src/qt/paymentserver.cpp +++ b/src/qt/paymentserver.cpp @@ -44,6 +44,7 @@ #include <QUrlQuery> #endif +using namespace std; using namespace boost; const int BITCOIN_IPC_CONNECT_TIMEOUT = 1000; // milliseconds diff --git a/src/qt/transactiondesc.cpp b/src/qt/transactiondesc.cpp index 0cfcb048c8..61da3373fd 100644 --- a/src/qt/transactiondesc.cpp +++ b/src/qt/transactiondesc.cpp @@ -18,6 +18,8 @@ #include <stdint.h> #include <string> +using namespace std; + QString TransactionDesc::FormatTxStatus(const CWalletTx& wtx) { AssertLockHeld(cs_main); diff --git a/src/qt/walletmodel.cpp b/src/qt/walletmodel.cpp index 87ff3db584..2f633a26c8 100644 --- a/src/qt/walletmodel.cpp +++ b/src/qt/walletmodel.cpp @@ -24,6 +24,8 @@ #include <QSet> #include <QTimer> +using namespace std; + WalletModel::WalletModel(CWallet *wallet, OptionsModel *optionsModel, QObject *parent) : QObject(parent), wallet(wallet), optionsModel(optionsModel), addressTableModel(0), transactionTableModel(0), |