Skip to content

Commit

Permalink
Use std_vector and std_array type alias.
Browse files Browse the repository at this point in the history
  • Loading branch information
evoskuil committed Jul 6, 2024
1 parent c1911b6 commit ae083d2
Show file tree
Hide file tree
Showing 16 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion include/bitcoin/network/async/subscriber.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class subscriber final

// These are not thread safe.
bool stopped_{ false };
std::vector<handler> queue_{};
std_vector<handler> queue_{};
};

} // namespace network
Expand Down
2 changes: 1 addition & 1 deletion include/bitcoin/network/async/threadpool.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class BCT_API threadpool final
asio::io_context service_{};

// These are not thread safe.
std::vector<std::thread> threads_{};
std_vector<std::thread> threads_{};
work_guard work_;
};

Expand Down
2 changes: 1 addition & 1 deletion include/bitcoin/network/config/address.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ class BCT_API address
messages::address_item::cptr address_;
};

typedef std::vector<address> addresses;
typedef std_vector<address> addresses;

} // namespace config
} // namespace network
Expand Down
2 changes: 1 addition & 1 deletion include/bitcoin/network/config/authority.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ class BCT_API authority
uint8_t cidr_;
};

typedef std::vector<authority> authorities;
typedef std_vector<authority> authorities;

} // namespace config
} // namespace network
Expand Down
2 changes: 1 addition & 1 deletion include/bitcoin/network/config/endpoint.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ class BCT_API endpoint
uint16_t port_;
};

typedef std::vector<endpoint> endpoints;
typedef std_vector<endpoint> endpoints;

} // namespace config
} // namespace network
Expand Down
2 changes: 1 addition & 1 deletion include/bitcoin/network/messages/address_item.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ struct BCT_API address_item
bool operator==(const address_item& left, const address_item& right) NOEXCEPT;
bool operator!=(const address_item& left, const address_item& right) NOEXCEPT;

typedef std::vector<address_item> address_items;
typedef std_vector<address_item> address_items;
typedef std::shared_ptr<address_items> address_items_ptr;

// tools.ietf.org/html/rfc4291#section-2.5.3
Expand Down
4 changes: 2 additions & 2 deletions include/bitcoin/network/messages/alert_item.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ namespace messages {

struct BCT_API alert_item
{
typedef std::vector<uint32_t> cancels_t;
typedef std::vector<std::string> sub_versions_t;
typedef std_vector<uint32_t> cancels_t;
typedef std_vector<std::string> sub_versions_t;
static const system::ec_uncompressed satoshi_public_key;

static alert_item deserialize(uint32_t version,
Expand Down
2 changes: 1 addition & 1 deletion include/bitcoin/network/messages/compact_block_item.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ struct BCT_API compact_block_item
system::chain::transaction::cptr transaction_ptr;
};

typedef std::vector<compact_block_item> compact_block_items;
typedef std_vector<compact_block_item> compact_block_items;

} // namespace messages
} // namespace network
Expand Down
2 changes: 1 addition & 1 deletion include/bitcoin/network/messages/get_blocks.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ namespace messages {

struct BCT_API get_blocks
{
typedef std::vector<size_t> indexes;
typedef std_vector<size_t> indexes;
typedef std::shared_ptr<const get_blocks> cptr;

static const identifier id;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ struct BCT_API get_compact_transactions
size_t size(uint32_t version) const NOEXCEPT;

system::hash_digest block_hash;
std::vector<uint64_t> indexes;
std_vector<uint64_t> indexes;
};

} // namespace messages
Expand Down
2 changes: 1 addition & 1 deletion include/bitcoin/network/messages/get_headers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ namespace messages {
/// see also get_blocks.
struct BCT_API get_headers
{
typedef std::vector<size_t> indexes;
typedef std_vector<size_t> indexes;
typedef std::shared_ptr<const get_headers> cptr;

static const identifier id;
Expand Down
2 changes: 1 addition & 1 deletion include/bitcoin/network/messages/inventory_item.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ struct BCT_API inventory_item
bool operator==(const inventory_item& left, const inventory_item& right) NOEXCEPT;
bool operator!=(const inventory_item& left, const inventory_item& right) NOEXCEPT;

typedef std::vector<inventory_item> inventory_items;
typedef std_vector<inventory_item> inventory_items;

} // namespace messages
} // namespace network
Expand Down
2 changes: 1 addition & 1 deletion include/bitcoin/network/messages/merkle_block.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ struct BCT_API merkle_block
system::data_chunk flags;
};

typedef std::vector<merkle_block> merkle_blocks;
typedef std_vector<merkle_block> merkle_blocks;

} // namespace messages
} // namespace network
Expand Down
2 changes: 1 addition & 1 deletion include/bitcoin/network/net/connector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ class BCT_API connector
const socket::ptr& socket) NOEXCEPT;
};

typedef std::vector<connector::ptr> connectors;
typedef std_vector<connector::ptr> connectors;
typedef std::shared_ptr<connectors> connectors_ptr;

} // namespace network
Expand Down
2 changes: 1 addition & 1 deletion src/messages/get_compact_transactions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ get_compact_transactions get_compact_transactions::deserialize(uint32_t version,
const auto read_indexes = [](reader& source) NOEXCEPT
{
const auto size = source.read_size(chain::max_block_size);
std::vector<uint64_t> indexes;
std_vector<uint64_t> indexes;
indexes.reserve(size);

for (size_t index = 0; index < size; ++index)
Expand Down
4 changes: 2 additions & 2 deletions test/test.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ std::ostream& operator<<(std::ostream& stream,
// vector<Type> -> join(<<Type)
template <typename Type>
std::ostream& operator<<(std::ostream& stream,
const std::vector<Type>& values) noexcept
const std_vector<Type>& values) noexcept
{
// Ok when testing serialize because only used for error message out.
BC_PUSH_WARNING(NO_THROW_IN_NOEXCEPT)
Expand All @@ -70,7 +70,7 @@ std::ostream& operator<<(std::ostream& stream,
// array<Type, Size> -> join(<<Type)
template <typename Type, size_t Size>
std::ostream& operator<<(std::ostream& stream,
const std::array<Type, Size>& values) noexcept
const std_array<Type, Size>& values) noexcept
{
// Ok when testing serialize because only used for error message out.
BC_PUSH_WARNING(NO_THROW_IN_NOEXCEPT)
Expand Down

0 comments on commit ae083d2

Please sign in to comment.