diff --git a/include/libtorrent/bencode.hpp b/include/libtorrent/bencode.hpp index 18701c843..3e6885673 100644 --- a/include/libtorrent/bencode.hpp +++ b/include/libtorrent/bencode.hpp @@ -90,7 +90,7 @@ namespace libtorrent = typename std::enable_if::value>::type> int write_integer(OutIt& out, In data) { - entry::integer_type const val(data); + entry::integer_type const val = entry::integer_type(data); TORRENT_ASSERT(data == In(val)); // the stack allocated buffer for keeping the // decimal representation of the number can diff --git a/include/libtorrent/create_torrent.hpp b/include/libtorrent/create_torrent.hpp index 721e8e771..734dc4d38 100644 --- a/include/libtorrent/create_torrent.hpp +++ b/include/libtorrent/create_torrent.hpp @@ -315,7 +315,7 @@ namespace libtorrent // if we're generating a merkle torrent, this is the // merkle tree we got. This should be saved in fast-resume // in order to start seeding the torrent - mutable std::vector m_merkle_tree; + mutable aux::vector m_merkle_tree; // dht nodes to add to the routing table/bootstrap from std::vector> m_nodes; diff --git a/include/libtorrent/file_storage.hpp b/include/libtorrent/file_storage.hpp index 78b151102..48e87d102 100644 --- a/include/libtorrent/file_storage.hpp +++ b/include/libtorrent/file_storage.hpp @@ -623,7 +623,7 @@ namespace libtorrent // name for multi-file torrents. The m_name field need to be // prepended to these paths, and the filename of a specific file // entry appended, to form full file paths - std::vector m_paths; + aux::vector m_paths; // name of torrent. For multi-file torrents // this is always the root directory diff --git a/include/libtorrent/natpmp.hpp b/include/libtorrent/natpmp.hpp index 473e7d7af..3b521a4ea 100644 --- a/include/libtorrent/natpmp.hpp +++ b/include/libtorrent/natpmp.hpp @@ -41,6 +41,7 @@ POSSIBILITY OF SUCH DAMAGE. #include "libtorrent/time.hpp" #include "libtorrent/debug.hpp" #include "libtorrent/aux_/portmap.hpp" +#include "libtorrent/aux_/vector.hpp" namespace libtorrent { @@ -115,7 +116,7 @@ private: aux::portmap_callback& m_callback; - std::vector m_mappings; + aux::vector m_mappings; // the endpoint to the nat router udp::endpoint m_nat_endpoint; diff --git a/include/libtorrent/upnp.hpp b/include/libtorrent/upnp.hpp index c62aceb6f..bc1e3fc42 100644 --- a/include/libtorrent/upnp.hpp +++ b/include/libtorrent/upnp.hpp @@ -42,6 +42,7 @@ POSSIBILITY OF SUCH DAMAGE. #include "libtorrent/resolver.hpp" #include "libtorrent/debug.hpp" #include "libtorrent/aux_/portmap.hpp" +#include "libtorrent/aux_/vector.hpp" #include #include @@ -348,7 +349,7 @@ private: std::set devices; }; - std::vector m_mappings; + aux::vector m_mappings; std::string m_user_agent; diff --git a/src/broadcast_socket.cpp b/src/broadcast_socket.cpp index c6145dc70..1fb5e4e8f 100644 --- a/src/broadcast_socket.cpp +++ b/src/broadcast_socket.cpp @@ -276,12 +276,12 @@ namespace libtorrent for (auto& s : m_unicast_sockets) { if (!s.socket) continue; - s.socket->send_to(boost::asio::buffer(buffer, size), m_multicast_endpoint, 0, e); + s.socket->send_to(boost::asio::buffer(buffer, std::size_t(size)), m_multicast_endpoint, 0, e); // if the user specified the broadcast flag, send one to the broadcast // address as well if ((flags & broadcast_socket::flag_broadcast) && s.can_broadcast()) - s.socket->send_to(boost::asio::buffer(buffer, size) + s.socket->send_to(boost::asio::buffer(buffer, std::size_t(size)) , udp::endpoint(s.broadcast_address(), m_multicast_endpoint.port()), 0, e); if (e) @@ -298,7 +298,7 @@ namespace libtorrent for (auto& s : m_sockets) { if (!s.socket) continue; - s.socket->send_to(boost::asio::buffer(buffer, size), m_multicast_endpoint, 0, e); + s.socket->send_to(boost::asio::buffer(buffer, std::size_t(size)), m_multicast_endpoint, 0, e); if (e) { s.socket->close(e); diff --git a/src/create_torrent.cpp b/src/create_torrent.cpp index c9dcfc0ad..a0c6c86d1 100644 --- a/src/create_torrent.cpp +++ b/src/create_torrent.cpp @@ -363,7 +363,7 @@ namespace libtorrent m_files.set_num_pieces(static_cast( (m_files.total_size() + m_files.piece_length() - 1) / m_files.piece_length())); - m_piece_hash.resize(m_files.num_pieces()); + m_piece_hash.resize(std::size_t(m_files.num_pieces())); } create_torrent::create_torrent(torrent_info const& ti) @@ -399,7 +399,7 @@ namespace libtorrent add_http_seed(s.url); } - m_piece_hash.resize(m_files.num_pieces()); + m_piece_hash.resize(std::size_t(m_files.num_pieces())); for (piece_index_t i(0); i != m_files.end_piece(); ++i) set_hash(i, ti.hash_for_piece(i)); @@ -614,7 +614,7 @@ namespace libtorrent int const num_leafs = merkle_num_leafs(m_files.num_pieces()); int const num_nodes = merkle_num_nodes(num_leafs); int const first_leaf = num_nodes - num_leafs; - m_merkle_tree.resize(num_nodes); + m_merkle_tree.resize(std::size_t(num_nodes)); int const num_pieces = int(m_piece_hash.size()); for (int i = 0; i < num_pieces; ++i) m_merkle_tree[first_leaf + i] = m_piece_hash[piece_index_t(i)]; @@ -695,7 +695,7 @@ namespace libtorrent { TORRENT_ASSERT(index >= file_index_t(0)); TORRENT_ASSERT(index < m_files.end_file()); - if (m_filehashes.empty()) m_filehashes.resize(m_files.num_files()); + if (m_filehashes.empty()) m_filehashes.resize(std::size_t(m_files.num_files())); m_filehashes[index] = h; } diff --git a/src/upnp.cpp b/src/upnp.cpp index b66eaf042..bab1ba4f4 100644 --- a/src/upnp.cpp +++ b/src/upnp.cpp @@ -1617,7 +1617,7 @@ void upnp::close() continue; } j->act = mapping_t::action::del; - m_mappings[j - d.mapping.begin()].protocol = portmap_protocol::none; + m_mappings[int(j - d.mapping.begin())].protocol = portmap_protocol::none; } if (num_mappings() > 0) update_map(d, 0); }