Browse Source

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.
0.10
Wladimir J. van der Laan 11 years ago
parent
commit
09eb201b1b
  1. 1
      src/bitcoin-cli.cpp
  2. 1
      src/chainparams.cpp
  3. 22
      src/chainparams.h
  4. 2
      src/miner.cpp
  5. 1
      src/qt/paymentrequestplus.cpp
  6. 2
      src/qt/paymentrequestplus.h
  7. 1
      src/qt/paymentserver.cpp
  8. 2
      src/qt/transactiondesc.cpp
  9. 2
      src/qt/walletmodel.cpp

1
src/bitcoin-cli.cpp

@ -12,6 +12,7 @@
#include <boost/filesystem/operations.hpp> #include <boost/filesystem/operations.hpp>
using namespace std;
using namespace boost; using namespace boost;
using namespace boost::asio; using namespace boost::asio;
using namespace json_spirit; using namespace json_spirit;

1
src/chainparams.cpp

@ -10,6 +10,7 @@
#include <boost/assign/list_of.hpp> #include <boost/assign/list_of.hpp>
using namespace std;
using namespace boost::assign; using namespace boost::assign;
// //

22
src/chainparams.h

@ -12,13 +12,11 @@
#include <vector> #include <vector>
using namespace std;
typedef unsigned char MessageStartChars[MESSAGE_START_SIZE]; typedef unsigned char MessageStartChars[MESSAGE_START_SIZE];
struct CDNSSeedData { struct CDNSSeedData {
string name, host; std::string name, host;
CDNSSeedData(const string &strName, const string &strHost) : name(strName), host(strHost) {} 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 uint256& HashGenesisBlock() const { return hashGenesisBlock; }
const MessageStartChars& MessageStart() const { return pchMessageStart; } 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; } int GetDefaultPort() const { return nDefaultPort; }
const uint256& ProofOfWorkLimit() const { return bnProofOfWorkLimit; } const uint256& ProofOfWorkLimit() const { return bnProofOfWorkLimit; }
int SubsidyHalvingInterval() const { return nSubsidyHalvingInterval; } int SubsidyHalvingInterval() const { return nSubsidyHalvingInterval; }
@ -74,16 +72,16 @@ public:
bool RequireStandard() const { return fRequireStandard; } bool RequireStandard() const { return fRequireStandard; }
/* Make standard checks */ /* Make standard checks */
bool RPCisTestNet() const { return fRPCisTestNet; } 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 /* Make miner stop after a block is found. In RPC, don't return
* until nGenProcLimit blocks are generated */ * until nGenProcLimit blocks are generated */
bool MineBlocksOnDemand() const { return fMineBlocksOnDemand; } bool MineBlocksOnDemand() const { return fMineBlocksOnDemand; }
Network NetworkID() const { return networkID; } Network NetworkID() const { return networkID; }
/* Return the BIP70 network string (main, test or regtest) */ /* Return the BIP70 network string (main, test or regtest) */
std::string NetworkIDString() const { return strNetworkID; } 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 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; } int RPCPort() const { return nRPCPort; }
protected: protected:
CChainParams() {} CChainParams() {}
@ -91,7 +89,7 @@ protected:
uint256 hashGenesisBlock; uint256 hashGenesisBlock;
MessageStartChars pchMessageStart; MessageStartChars pchMessageStart;
// Raw pub key bytes for the broadcast alert signing key. // Raw pub key bytes for the broadcast alert signing key.
vector<unsigned char> vAlertPubKey; std::vector<unsigned char> vAlertPubKey;
int nDefaultPort; int nDefaultPort;
int nRPCPort; int nRPCPort;
uint256 bnProofOfWorkLimit; uint256 bnProofOfWorkLimit;
@ -99,14 +97,14 @@ protected:
int nEnforceBlockUpgradeMajority; int nEnforceBlockUpgradeMajority;
int nRejectBlockOutdatedMajority; int nRejectBlockOutdatedMajority;
int nToCheckBlockUpgradeMajority; int nToCheckBlockUpgradeMajority;
string strDataDir; std::string strDataDir;
int nMinerThreads; int nMinerThreads;
vector<CDNSSeedData> vSeeds; std::vector<CDNSSeedData> vSeeds;
std::vector<unsigned char> base58Prefixes[MAX_BASE58_TYPES]; std::vector<unsigned char> base58Prefixes[MAX_BASE58_TYPES];
Network networkID; Network networkID;
std::string strNetworkID; std::string strNetworkID;
CBlock genesis; CBlock genesis;
vector<CAddress> vFixedSeeds; std::vector<CAddress> vFixedSeeds;
bool fRequireRPCPassword; bool fRequireRPCPassword;
bool fMiningRequiresPeers; bool fMiningRequiresPeers;
bool fDefaultCheckMemPool; bool fDefaultCheckMemPool;

2
src/miner.cpp

@ -11,6 +11,8 @@
#ifdef ENABLE_WALLET #ifdef ENABLE_WALLET
#include "wallet.h" #include "wallet.h"
#endif #endif
using namespace std;
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
// //
// BitcoinMiner // BitcoinMiner

1
src/qt/paymentrequestplus.cpp

@ -17,6 +17,7 @@
#include <QDebug> #include <QDebug>
#include <QSslCertificate> #include <QSslCertificate>
using namespace std;
class SSLVerifyError : public std::runtime_error class SSLVerifyError : public std::runtime_error
{ {

2
src/qt/paymentrequestplus.h

@ -24,7 +24,7 @@ public:
PaymentRequestPlus() { } PaymentRequestPlus() { }
bool parse(const QByteArray& data); bool parse(const QByteArray& data);
bool SerializeToString(string* output) const; bool SerializeToString(std::string* output) const;
bool IsInitialized() const; bool IsInitialized() const;
QString getPKIType() const; QString getPKIType() const;

1
src/qt/paymentserver.cpp

@ -44,6 +44,7 @@
#include <QUrlQuery> #include <QUrlQuery>
#endif #endif
using namespace std;
using namespace boost; using namespace boost;
const int BITCOIN_IPC_CONNECT_TIMEOUT = 1000; // milliseconds const int BITCOIN_IPC_CONNECT_TIMEOUT = 1000; // milliseconds

2
src/qt/transactiondesc.cpp

@ -18,6 +18,8 @@
#include <stdint.h> #include <stdint.h>
#include <string> #include <string>
using namespace std;
QString TransactionDesc::FormatTxStatus(const CWalletTx& wtx) QString TransactionDesc::FormatTxStatus(const CWalletTx& wtx)
{ {
AssertLockHeld(cs_main); AssertLockHeld(cs_main);

2
src/qt/walletmodel.cpp

@ -24,6 +24,8 @@
#include <QSet> #include <QSet>
#include <QTimer> #include <QTimer>
using namespace std;
WalletModel::WalletModel(CWallet *wallet, OptionsModel *optionsModel, QObject *parent) : WalletModel::WalletModel(CWallet *wallet, OptionsModel *optionsModel, QObject *parent) :
QObject(parent), wallet(wallet), optionsModel(optionsModel), addressTableModel(0), QObject(parent), wallet(wallet), optionsModel(optionsModel), addressTableModel(0),
transactionTableModel(0), transactionTableModel(0),

Loading…
Cancel
Save