From 4b0e30d2592ef5561d98263696cb5550daa121e9 Mon Sep 17 00:00:00 2001 From: chriseth Date: Fri, 25 Aug 2017 12:07:02 +0200 Subject: Cleanup of Common.h --- libdevcore/Common.h | 58 ++++++++--------------------------------------------- 1 file changed, 8 insertions(+), 50 deletions(-) (limited to 'libdevcore/Common.h') diff --git a/libdevcore/Common.h b/libdevcore/Common.h index 9d6dd408..2543855d 100644 --- a/libdevcore/Common.h +++ b/libdevcore/Common.h @@ -37,13 +37,7 @@ #pragma warning(disable:3682) //call through incomplete class #endif -#include -#include -#include -#include -#include -#include -#include +#include #if defined(__GNUC__) #pragma warning(push) @@ -67,14 +61,13 @@ #pragma GCC diagnostic pop #endif // defined(__GNUC__) -#include "vector_ref.h" +#include +#include +#include +#include using byte = uint8_t; -// Quote a given token stream to turn it into a string. -#define DEV_QUOTED_HELPER(s) #s -#define DEV_QUOTED(s) DEV_QUOTED_HELPER(s) - namespace dev { @@ -85,32 +78,15 @@ using bytesConstRef = vector_ref; // Numeric types. using bigint = boost::multiprecision::number>; -using u64 = boost::multiprecision::number>; -using u128 = boost::multiprecision::number>; -using u256 = boost::multiprecision::number>; -using s256 = boost::multiprecision::number>; -using u160 = boost::multiprecision::number>; -using s160 = boost::multiprecision::number>; -using u512 = boost::multiprecision::number>; -using s512 = boost::multiprecision::number>; -using u256s = std::vector; -using u160s = std::vector; -using u256Set = std::set; -using u160Set = std::set; +using u256 = boost::multiprecision::number>; +using s256 = boost::multiprecision::number>; +using u160 = boost::multiprecision::number>; // Map types. using StringMap = std::map; -// Hash types. -using StringHashMap = std::unordered_map; - // String types. using strings = std::vector; -// Fixed-length string types. -using string32 = std::array; - -// Null/Invalid values for convenience. -static const bytes NullBytes; /// Interprets @a _u as a two's complement signed number and returns the resulting s256. inline s256 u2s(u256 _u) @@ -143,16 +119,6 @@ inline std::ostream& operator<<(std::ostream& os, bytes const& _bytes) return os; } -template inline u256 exp10() -{ - return exp10() * u256(10); -} - -template <> inline u256 exp10<0>() -{ - return u256(1); -} - /// RAII utility class whose destructor calls a given function. class ScopeGuard { @@ -164,12 +130,4 @@ private: std::function m_f; }; -enum class WithExisting: int -{ - Trust = 0, - Verify, - Rescue, - Kill -}; - } -- cgit v1.2.3