From beb352549c19ecad09626b4ce8a1064e0a7cf1b0 Mon Sep 17 00:00:00 2001 From: CJentzsch Date: Mon, 22 Jun 2015 16:53:19 +0200 Subject: [PATCH] even more --- ethminer/MinerAux.h | 20 ++++++++++---------- libethcore/BlockInfo.cpp | 4 ++-- libethcore/ICAP.cpp | 16 ++++++++-------- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/ethminer/MinerAux.h b/ethminer/MinerAux.h index a609754dd..a4a671ddb 100644 --- a/ethminer/MinerAux.h +++ b/ethminer/MinerAux.h @@ -107,7 +107,7 @@ public: catch (...) { cerr << "Bad " << arg << " option: " << argv[i] << endl; - throw BadArgument(); + BOOST_THROW_EXCEPTION(BadArgument()); } else if (arg == "--opencl-platform" && i + 1 < argc) try { @@ -116,7 +116,7 @@ public: catch (...) { cerr << "Bad " << arg << " option: " << argv[i] << endl; - throw BadArgument(); + BOOST_THROW_EXCEPTION(BadArgument()); } else if (arg == "--opencl-device" && i + 1 < argc) try { @@ -126,7 +126,7 @@ public: catch (...) { cerr << "Bad " << arg << " option: " << argv[i] << endl; - throw BadArgument(); + BOOST_THROW_EXCEPTION(BadArgument()); } else if (arg == "--list-devices") m_shouldListDevices = true; @@ -144,7 +144,7 @@ public: else { cerr << "Bad " << arg << " option: " << m << endl; - throw BadArgument(); + BOOST_THROW_EXCEPTION(BadArgument()); } } else if (arg == "--benchmark-warmup" && i + 1 < argc) @@ -154,7 +154,7 @@ public: catch (...) { cerr << "Bad " << arg << " option: " << argv[i] << endl; - throw BadArgument(); + BOOST_THROW_EXCEPTION(BadArgument()); } else if (arg == "--benchmark-trial" && i + 1 < argc) try { @@ -163,7 +163,7 @@ public: catch (...) { cerr << "Bad " << arg << " option: " << argv[i] << endl; - throw BadArgument(); + BOOST_THROW_EXCEPTION( BadArgument()); } else if (arg == "--benchmark-trials" && i + 1 < argc) try { @@ -172,7 +172,7 @@ public: catch (...) { cerr << "Bad " << arg << " option: " << argv[i] << endl; - throw BadArgument(); + BOOST_THROW_EXCEPTION( BadArgument()); } else if (arg == "-C" || arg == "--cpu") m_minerType = MinerType::CPU; @@ -195,7 +195,7 @@ public: catch (...) { cerr << "Bad " << arg << " option: " << m << endl; - throw BadArgument(); + BOOST_THROW_EXCEPTION( BadArgument()); } } else if ((arg == "-w" || arg == "--check-pow") && i + 4 < argc) @@ -232,7 +232,7 @@ public: catch (...) { cerr << "Bad " << arg << " option: " << m << endl; - throw BadArgument(); + BOOST_THROW_EXCEPTION( BadArgument()); } } else if (arg == "-M" || arg == "--benchmark") @@ -245,7 +245,7 @@ public: catch (...) { cerr << "Bad " << arg << " option: " << argv[i] << endl; - throw BadArgument(); + BOOST_THROW_EXCEPTION( BadArgument()); } } else diff --git a/libethcore/BlockInfo.cpp b/libethcore/BlockInfo.cpp index 69da52b09..fec5b4678 100644 --- a/libethcore/BlockInfo.cpp +++ b/libethcore/BlockInfo.cpp @@ -122,7 +122,7 @@ void BlockInfo::populateFromHeader(RLP const& _header, Strictness _s, h256 const try { if (_header.itemCount() != 15) - throw InvalidBlockHeaderItemCount(); + BOOST_THROW_EXCEPTION(InvalidBlockHeaderItemCount()); parentHash = _header[field = 0].toHash(RLP::VeryStrict); sha3Uncles = _header[field = 1].toHash(RLP::VeryStrict); coinbaseAddress = _header[field = 2].toHash
(RLP::VeryStrict); @@ -146,7 +146,7 @@ void BlockInfo::populateFromHeader(RLP const& _header, Strictness _s, h256 const } if (number > ~(unsigned)0) - throw InvalidNumber(); + BOOST_THROW_EXCEPTION(InvalidNumber()); // check it hashes according to proof of work or that it's the genesis block. if (_s == CheckEverything && parentHash && !ProofOfWork::verify(*this)) diff --git a/libethcore/ICAP.cpp b/libethcore/ICAP.cpp index 158c297f8..12e8aed56 100644 --- a/libethcore/ICAP.cpp +++ b/libethcore/ICAP.cpp @@ -71,7 +71,7 @@ ICAP ICAP::decoded(std::string const& _encoded) std::string data; std::tie(country, data) = fromIBAN(_encoded); if (country != "XE") - throw InvalidICAP(); + BOOST_THROW_EXCEPTION(InvalidICAP()); if (data.size() == 30) { ret.m_type = Direct; @@ -88,10 +88,10 @@ ICAP ICAP::decoded(std::string const& _encoded) ret.m_client = data.substr(7); } else - throw InvalidICAP(); + BOOST_THROW_EXCEPTION(InvalidICAP()); } else - throw InvalidICAP(); + BOOST_THROW_EXCEPTION(InvalidICAP()); return ret; } @@ -101,7 +101,7 @@ std::string ICAP::encoded() const if (m_type == Direct) { if (!!m_direct[0]) - throw InvalidICAP(); + BOOST_THROW_EXCEPTION(InvalidICAP()); std::string d = toBase36(m_direct); while (d.size() < 30) d = "0" + d; @@ -118,11 +118,11 @@ std::string ICAP::encoded() const m_institution.size() != 4 || m_client.size() != 9 ) - throw InvalidICAP(); + BOOST_THROW_EXCEPTION(InvalidICAP()); return iban("XE", m_asset + m_institution + m_client); } else - throw InvalidICAP(); + BOOST_THROW_EXCEPTION(InvalidICAP()); } pair ICAP::lookup(std::function const& _call, Address const& _reg) const @@ -149,9 +149,9 @@ pair ICAP::lookup(std::function const& _c else if (m_institution[0] != 'X') return make_pair(resolve(m_institution + "/" + m_client), bytes()); else - throw InterfaceNotSupported("ICAP::lookup(), bad institution"); + BOOST_THROW_EXCEPTION(InterfaceNotSupported("ICAP::lookup(), bad institution")); } - throw InterfaceNotSupported("ICAP::lookup(), bad asset"); + BOOST_THROW_EXCEPTION(InterfaceNotSupported("ICAP::lookup(), bad asset")); } }