Browse Source

change typedef to using according to preferred coding style

cl-refactor
Lu Guanqun 10 years ago
parent
commit
77a15f749f
  1. 2
      evmjit/libevmjit/ExecutionEngine.cpp
  2. 12
      libdevcore/Exceptions.h
  3. 8
      libdevcore/RLP.h
  4. 6
      libdevcore/vector_ref.h
  5. 2
      libdevcrypto/ECDHE.h
  6. 8
      libethcore/Exceptions.h
  7. 6
      libethereum/BlockDetails.h
  8. 4
      libevmcore/Assembly.h
  9. 4
      liblll/Parser.cpp
  10. 6
      libp2p/Common.h
  11. 2
      libsolidity/Exceptions.h
  12. 2
      mix/CodeHighlighter.h
  13. 8
      mix/Exceptions.h

2
evmjit/libevmjit/ExecutionEngine.cpp

@ -29,7 +29,7 @@ namespace jit
namespace
{
typedef ReturnCode(*EntryFuncPtr)(Runtime*);
using EntryFuncPtr = ReturnCode(*)(Runtime*);
ReturnCode runEntryFunc(EntryFuncPtr _mainFunc, Runtime* _runtime)
{

12
libdevcore/Exceptions.h

@ -44,10 +44,10 @@ struct FileError: virtual Exception {};
struct InterfaceNotSupported: virtual Exception { public: InterfaceNotSupported(std::string _f): m_f("Interface " + _f + " not supported.") {} virtual const char* what() const noexcept { return m_f.c_str(); } private: std::string m_f; };
// error information to be added to exceptions
typedef boost::error_info<struct tag_invalidSymbol, char> errinfo_invalidSymbol;
typedef boost::error_info<struct tag_address, std::string> errinfo_wrongAddress;
typedef boost::error_info<struct tag_comment, std::string> errinfo_comment;
typedef boost::error_info<struct tag_required, bigint> errinfo_required;
typedef boost::error_info<struct tag_got, bigint> errinfo_got;
typedef boost::tuple<errinfo_required, errinfo_got> RequirementError;
using errinfo_invalidSymbol = boost::error_info<struct tag_invalidSymbol, char>;
using errinfo_wrongAddress = boost::error_info<struct tag_address, std::string>;
using errinfo_comment = boost::error_info<struct tag_comment, std::string>;
using errinfo_required = boost::error_info<struct tag_required, bigint>;
using errinfo_got = boost::error_info<struct tag_got, bigint>;
using RequirementError = boost::tuple<errinfo_required, errinfo_got>;
}

8
libdevcore/RLP.h

@ -37,7 +37,7 @@ namespace dev
{
class RLP;
typedef std::vector<RLP> RLPs;
using RLPs = std::vector<RLP>;
template <class _T> struct intTraits { static const unsigned maxSize = sizeof(_T); };
template <> struct intTraits<u160> { static const unsigned maxSize = 20; };
@ -125,7 +125,7 @@ public:
/// @note if used to access items in ascending order, this is efficient.
RLP operator[](unsigned _i) const;
typedef RLP element_type;
using element_type = RLP;
/// @brief Iterator class for iterating through items of RLP list.
class iterator
@ -133,8 +133,8 @@ public:
friend class RLP;
public:
typedef RLP value_type;
typedef RLP element_type;
using value_type = RLP;
using element_type = RLP;
iterator& operator++();
iterator operator++(int) { auto ret = *this; operator++(); return ret; }

6
libdevcore/vector_ref.h

@ -12,9 +12,9 @@ template <class _T>
class vector_ref
{
public:
typedef _T value_type;
typedef _T element_type;
typedef typename std::conditional<std::is_const<_T>::value, typename std::remove_const<_T>::type, _T>::type mutable_value_type;
using value_type = _T;
using element_type = _T;
using mutable_value_type = typename std::conditional<std::is_const<_T>::value, typename std::remove_const<_T>::type, _T>::type;
vector_ref(): m_data(nullptr), m_count(0) {}
vector_ref(_T* _data, size_t _count): m_data(_data), m_count(_count) {}

2
libdevcrypto/ECDHE.h

@ -31,7 +31,7 @@ namespace crypto
{
/// Public key of remote and corresponding shared secret.
typedef std::pair<Public,h256> AliasSession;
using AliasSession = std::pair<Public,h256>;
/**
* @brief An addressable EC key pair.

8
libethcore/Exceptions.h

@ -29,10 +29,10 @@ namespace eth
{
// information to add to exceptions
typedef boost::error_info<struct tag_field, std::string> errinfo_name;
typedef boost::error_info<struct tag_field, int> errinfo_field;
typedef boost::error_info<struct tag_data, std::string> errinfo_data;
typedef boost::tuple<errinfo_field, errinfo_data> BadFieldError;
using errinfo_name = boost::error_info<struct tag_field, std::string>;
using errinfo_field = boost::error_info<struct tag_field, int>;
using errinfo_data = boost::error_info<struct tag_data, std::string>;
using BadFieldError = boost::tuple<errinfo_field, errinfo_data>;
struct DatabaseAlreadyOpen: virtual dev::Exception {};
struct NotEnoughCash: virtual dev::Exception {};

6
libethereum/BlockDetails.h

@ -70,9 +70,9 @@ struct BlockReceipts
TransactionReceipts receipts;
};
typedef std::map<h256, BlockDetails> BlockDetailsHash;
typedef std::map<h256, BlockLogBlooms> BlockLogBloomsHash;
typedef std::map<h256, BlockReceipts> BlockReceiptsHash;
using BlockDetailsHash = std::map<h256, BlockDetails>;
using BlockLogBloomsHash = std::map<h256, BlockLogBlooms>;
using BlockReceiptsHash = std::map<h256, BlockReceipts>;
static const BlockDetails NullBlockDetails;
static const BlockLogBlooms NullBlockLogBlooms;

4
libevmcore/Assembly.h

@ -63,8 +63,8 @@ private:
u256 m_data;
};
typedef std::vector<AssemblyItem> AssemblyItems;
typedef vector_ref<AssemblyItem const> AssemblyItemsConstRef;
using AssemblyItems = std::vector<AssemblyItem>;
using AssemblyItemsConstRef = vector_ref<AssemblyItem const>;
std::ostream& operator<<(std::ostream& _out, AssemblyItemsConstRef _i);
inline std::ostream& operator<<(std::ostream& _out, AssemblyItems const& _i) { return operator<<(_out, AssemblyItemsConstRef(&_i)); }

4
liblll/Parser.cpp

@ -89,8 +89,8 @@ void dev::eth::parseTreeLLL(string const& _s, sp::utree& o_out)
using qi::standard::space;
using qi::standard::space_type;
using dev::eth::parseTreeLLL_::tagNode;
typedef sp::basic_string<std::string, sp::utree_type::symbol_type> symbol_type;
typedef string::const_iterator it;
using symbol_type = sp::basic_string<std::string, sp::utree_type::symbol_type>;
using it = string::const_iterator;
static const u256 ether = u256(1000000000) * 1000000000;
static const u256 finney = u256(1000000000) * 1000000;

6
libp2p/Common.h

@ -112,9 +112,9 @@ inline bool isPermanentProblem(DisconnectReason _r)
/// @returns the string form of the given disconnection reason.
std::string reasonOf(DisconnectReason _r);
typedef std::pair<std::string, u256> CapDesc;
typedef std::set<CapDesc> CapDescSet;
typedef std::vector<CapDesc> CapDescs;
using CapDesc = std::pair<std::string, u256>;
using CapDescSet = std::set<CapDesc>;
using CapDescs = std::vector<CapDesc>;
struct PeerInfo
{

2
libsolidity/Exceptions.h

@ -38,7 +38,7 @@ struct CompilerError: virtual Exception {};
struct InternalCompilerError: virtual Exception {};
struct DocstringParsingError: virtual Exception {};
typedef boost::error_info<struct tag_sourceLocation, Location> errinfo_sourceLocation;
using errinfo_sourceLocation = boost::error_info<struct tag_sourceLocation, Location>;
}
}

2
mix/CodeHighlighter.h

@ -81,7 +81,7 @@ public:
int start;
int length;
};
typedef std::vector<FormatRange> Formats; // Sorted by start position
using Formats = std::vector<FormatRange>; // Sorted by start position
public:
/// Collect highligting information by lexing the source

8
mix/Exceptions.h

@ -40,10 +40,10 @@ struct FunctionNotFoundException: virtual Exception {};
struct ExecutionStateException: virtual Exception {};
struct ParameterChangedException: virtual Exception {};
typedef boost::error_info<struct tagQmlError, QQmlError> QmlErrorInfo;
typedef boost::error_info<struct tagFileError, std::string> FileError;
typedef boost::error_info<struct tagBlockIndex, unsigned> BlockIndex;
typedef boost::error_info<struct tagFunctionName, std::string> FunctionName;
using QmlErrorInfo = boost::error_info<struct tagQmlError, QQmlError>;
using FileError = boost::error_info<struct tagFileError, std::string>;
using BlockIndex = boost::error_info<struct tagBlockIndex, unsigned>;
using FunctionName = boost::error_info<struct tagFunctionName, std::string>;
}
}

Loading…
Cancel
Save