use cstdint intead of boost/cstdint.hpp (#833)

use cstdint intead of boost/cstdint.hpp
This commit is contained in:
Arvid Norberg 2016-06-18 14:01:38 -04:00 committed by GitHub
parent ead11737b4
commit ed077c8358
224 changed files with 1502 additions and 1502 deletions

View File

@ -152,7 +152,7 @@ void bind_converters()
to_python_converter<lt::udp::endpoint, endpoint_to_tuple<lt::udp::endpoint> >();
to_python_converter<std::vector<std::string>, vector_to_list<std::string> >();
to_python_converter<std::vector<int>, vector_to_list<int> >();
to_python_converter<std::vector<boost::uint8_t>, vector_to_list<boost::uint8_t> >();
to_python_converter<std::vector<std::uint8_t>, vector_to_list<std::uint8_t> >();
to_python_converter<std::vector<lt::tcp::endpoint>, vector_to_list<lt::tcp::endpoint> >();
to_python_converter<std::vector<lt::udp::endpoint>, vector_to_list<lt::udp::endpoint> >();
to_python_converter<std::vector<std::pair<std::string, int> >, vector_to_list<std::pair<std::string, int> > >();
@ -163,7 +163,7 @@ void bind_converters()
tuple_to_endpoint<lt::tcp::endpoint>();
tuple_to_endpoint<lt::udp::endpoint>();
list_to_vector<int>();
list_to_vector<boost::uint8_t>();
list_to_vector<std::uint8_t>();
list_to_vector<std::string>();
list_to_vector<lt::tcp::endpoint>();
list_to_vector<lt::udp::endpoint>();

View File

@ -110,7 +110,7 @@ namespace
}
void add_files_callback(file_storage& fs, std::string const& file
, boost::python::object cb, boost::uint32_t flags)
, boost::python::object cb, std::uint32_t flags)
{
add_files(fs, file, boost::bind(&call_python_object2, cb, _1), flags);
}
@ -119,11 +119,11 @@ namespace
void bind_create_torrent()
{
void (file_storage::*add_file0)(std::string const&, boost::int64_t
void (file_storage::*add_file0)(std::string const&, std::int64_t
, int, std::time_t, std::string const&) = &file_storage::add_file;
#if !defined TORRENT_NO_DEPRECATE
#if TORRENT_USE_WSTRING
void (file_storage::*add_file1)(std::wstring const&, boost::int64_t
void (file_storage::*add_file1)(std::wstring const&, std::int64_t
, int, std::time_t, std::string const&) = &file_storage::add_file;
#endif // TORRENT_USE_WSTRING
#endif // TORRENT_NO_DEPRECATE
@ -138,13 +138,13 @@ void bind_create_torrent()
#ifndef BOOST_NO_EXCEPTIONS
void (*set_piece_hashes0)(create_torrent&, std::string const&) = &set_piece_hashes;
#endif
void (*add_files0)(file_storage&, std::string const&, boost::uint32_t) = add_files;
void (*add_files0)(file_storage&, std::string const&, std::uint32_t) = add_files;
std::string const& (file_storage::*file_storage_symlink)(int) const = &file_storage::symlink;
sha1_hash (file_storage::*file_storage_hash)(int) const = &file_storage::hash;
std::string (file_storage::*file_storage_file_path)(int, std::string const&) const = &file_storage::file_path;
boost::int64_t (file_storage::*file_storage_file_size)(int) const = &file_storage::file_size;
boost::int64_t (file_storage::*file_storage_file_offset)(int) const = &file_storage::file_offset;
std::int64_t (file_storage::*file_storage_file_size)(int) const = &file_storage::file_size;
std::int64_t (file_storage::*file_storage_file_offset)(int) const = &file_storage::file_offset;
int (file_storage::*file_storage_file_flags)(int) const = &file_storage::file_flags;
#if !defined TORRENT_NO_DEPRECATE

View File

@ -10,17 +10,17 @@
using namespace boost::python;
using namespace libtorrent;
boost::int64_t get_last_active(peer_info const& pi)
std::int64_t get_last_active(peer_info const& pi)
{
return total_seconds(pi.last_active);
}
boost::int64_t get_last_request(peer_info const& pi)
std::int64_t get_last_request(peer_info const& pi)
{
return total_seconds(pi.last_request);
}
boost::int64_t get_download_queue_time(peer_info const& pi)
std::int64_t get_download_queue_time(peer_info const& pi)
{
return total_seconds(pi.download_queue_time);
}

View File

@ -252,7 +252,7 @@ namespace
p.dht_nodes.push_back(extract<std::pair<std::string, int> >(l[i]));
}
if (params.has_key("flags"))
p.flags = extract<boost::uint64_t>(params["flags"]);
p.flags = extract<std::uint64_t>(params["flags"]);
if (params.has_key("trackerid"))
p.trackerid = extract<std::string>(params["trackerid"]);
if (params.has_key("url"))
@ -267,7 +267,7 @@ namespace
list l = extract<list>(params["file_priorities"]);
int n = boost::python::len(l);
for(int i = 0; i < n; i++)
p.file_priorities.push_back(extract<boost::uint8_t>(l[i]));
p.file_priorities.push_back(extract<std::uint8_t>(l[i]));
p.file_priorities.clear();
}
}
@ -392,7 +392,7 @@ namespace
void load_country_db(lt::session& s, std::string file) {}
#endif
entry save_state(lt::session const& s, boost::uint32_t flags)
entry save_state(lt::session const& s, std::uint32_t flags)
{
allow_threading_guard guard;
entry e;
@ -417,7 +417,7 @@ namespace
return ret;
}
void load_state(lt::session& ses, entry const& st, boost::uint32_t flags)
void load_state(lt::session& ses, entry const& st, std::uint32_t flags)
{
allow_threading_guard guard;
@ -439,7 +439,7 @@ namespace
ses.dht_get_item(public_key, salt);
}
void put_string(entry& e, std::array<char, 64>& sig, boost::uint64_t& seq,
void put_string(entry& e, std::array<char, 64>& sig, std::uint64_t& seq,
std::string const& salt, std::string public_key, std::string private_key,
std::string data)
{
@ -693,7 +693,7 @@ void bind_session()
)
#ifndef TORRENT_NO_DEPRECATE
.def(
init<fingerprint, int, boost::uint32_t>((
init<fingerprint, int, std::uint32_t>((
arg("fingerprint")=fingerprint("LT",0,1,0,0)
, arg("flags")=lt::session::start_default_features | lt::session::add_default_plugins
, arg("alert_mask")=int(alert::error_notification)))

View File

@ -85,7 +85,7 @@ namespace
list file_progress(torrent_handle& handle, int flags)
{
std::vector<boost::int64_t> p;
std::vector<std::int64_t> p;
{
allow_threading_guard guard;
@ -99,7 +99,7 @@ list file_progress(torrent_handle& handle, int flags)
list result;
for (std::vector<boost::int64_t>::iterator i(p.begin()), e(p.end()); i != e; ++i)
for (std::vector<std::int64_t>::iterator i(p.begin()), e(p.end()); i != e; ++i)
result.append(*i);
return result;

View File

@ -100,7 +100,7 @@ namespace
return bytes(ti.metadata().get(), ti.metadata_size());
}
list map_block(torrent_info& ti, int piece, boost::int64_t offset, int size)
list map_block(torrent_info& ti, int piece, std::int64_t offset, int size)
{
std::vector<file_slice> p = ti.map_block(piece, offset, size);
list result;
@ -124,9 +124,9 @@ namespace
bool get_send_stats(announce_entry const& ae) { return ae.send_stats; }
#if !defined TORRENT_NO_DEPRECATE
boost::int64_t get_size(file_entry const& fe) { return fe.size; }
boost::int64_t get_offset(file_entry const& fe) { return fe.offset; }
boost::int64_t get_file_base(file_entry const& fe) { return fe.file_base; }
std::int64_t get_size(file_entry const& fe) { return fe.size; }
std::int64_t get_offset(file_entry const& fe) { return fe.offset; }
std::int64_t get_file_base(file_entry const& fe) { return fe.file_base; }
void set_file_base(file_entry& fe, int b) { fe.file_base = b; }
bool get_pad_file(file_entry const& fe) { return fe.pad_file; }
bool get_executable_attribute(file_entry const& fe) { return fe.executable_attribute; }

View File

@ -1,6 +1,6 @@
#include <boost/cstdint.hpp>
#include <cstdint>
typedef boost::uint64_t u64;
typedef boost::int64_t i64;
typedef boost::int32_t i32;
typedef std::uint64_t u64;
typedef std::int64_t i64;
typedef std::int32_t i32;

View File

@ -75,7 +75,7 @@ void sleep_ms(int milliseconds)
#if defined TORRENT_WINDOWS || defined TORRENT_CYGWIN
Sleep(milliseconds);
#elif defined TORRENT_BEOS
snooze_until(system_time() + boost::int64_t(milliseconds) * 1000, B_SYSTEM_TIMEBASE);
snooze_until(system_time() + std::int64_t(milliseconds) * 1000, B_SYSTEM_TIMEBASE);
#else
usleep(milliseconds * 1000);
#endif
@ -1003,7 +1003,7 @@ bool handle_alert(libtorrent::session& ses, libtorrent::alert* a
int peer_port = atoi(port);
error_code ec;
if (peer_port > 0)
h.connect_peer(tcp::endpoint(address::from_string(ip, ec), boost::uint16_t(peer_port)));
h.connect_peer(tcp::endpoint(address::from_string(ip, ec), std::uint16_t(peer_port)));
}
}
@ -2015,7 +2015,7 @@ int main(int argc, char* argv[])
if (print_file_progress && s.has_metadata)
{
std::vector<boost::int64_t> file_progress;
std::vector<std::int64_t> file_progress;
h.file_progress(file_progress);
std::vector<pool_file_status> file_status;
h.file_status(file_status);

View File

@ -61,9 +61,9 @@ using namespace libtorrent::detail; // for write_* and read_*
using namespace std::placeholders;
void generate_block(boost::uint32_t* buffer, int piece, int start, int length)
void generate_block(std::uint32_t* buffer, int piece, int start, int length)
{
boost::uint32_t fill = (piece << 8) | ((start / 0x4000) & 0xff);
std::uint32_t fill = (piece << 8) | ((start / 0x4000) & 0xff);
for (int i = 0; i < length / 4; ++i)
{
buffer[i] = fill;
@ -109,7 +109,7 @@ void sleep_ms(int milliseconds)
#if defined TORRENT_WINDOWS || defined TORRENT_CYGWIN
Sleep(milliseconds);
#elif defined TORRENT_BEOS
snooze_until(system_time() + boost::int64_t(milliseconds) * 1000, B_SYSTEM_TIMEBASE);
snooze_until(system_time() + std::int64_t(milliseconds) * 1000, B_SYSTEM_TIMEBASE);
#else
usleep(milliseconds * 1000);
#endif
@ -207,8 +207,8 @@ struct peer_conn
tcp::socket s;
char write_buf_proto[100];
boost::uint32_t write_buffer[17*1024/4];
boost::uint32_t buffer[17*1024/4];
std::uint32_t write_buffer[17*1024/4];
std::uint32_t buffer[17*1024/4];
int read_pos;
int corruption_counter;
@ -425,8 +425,8 @@ struct peer_conn
std::snprintf(tmp, sizeof(tmp), fmt, ec.message().c_str());
int time = int(total_milliseconds(end_time - start_time));
if (time == 0) time = 1;
float up = (boost::int64_t(blocks_sent) * 0x4000) / time / 1000.f;
float down = (boost::int64_t(blocks_received) * 0x4000) / time / 1000.f;
float up = (std::int64_t(blocks_sent) * 0x4000) / time / 1000.f;
float down = (std::int64_t(blocks_received) * 0x4000) / time / 1000.f;
error_code e;
char ep_str[200];
@ -665,8 +665,8 @@ struct peer_conn
bool verify_piece(int piece, int start, char const* ptr, int size)
{
boost::uint32_t* buf = (boost::uint32_t*)ptr;
boost::uint32_t fill = (piece << 8) | ((start / 0x4000) & 0xff);
std::uint32_t* buf = (std::uint32_t*)ptr;
std::uint32_t fill = (piece << 8) | ((start / 0x4000) & 0xff);
for (int i = 0; i < size / 4; ++i)
{
if (buf[i] != fill)
@ -760,7 +760,7 @@ void print_usage()
void hasher_thread(libtorrent::create_torrent* t, int start_piece, int end_piece, int piece_size, bool print)
{
if (print) std::fprintf(stderr, "\n");
boost::uint32_t piece[0x4000 / 4];
std::uint32_t piece[0x4000 / 4];
for (int i = start_piece; i < end_piece; ++i)
{
hasher ph;
@ -783,17 +783,17 @@ void generate_torrent(std::vector<char>& buf, int size, int num_files
// 1 MiB piece size
const int piece_size = 1024 * 1024;
const int num_pieces = size;
const boost::int64_t total_size = boost::int64_t(piece_size) * num_pieces;
const std::int64_t total_size = std::int64_t(piece_size) * num_pieces;
boost::int64_t s = total_size;
std::int64_t s = total_size;
int i = 0;
boost::int64_t file_size = total_size / num_files;
std::int64_t file_size = total_size / num_files;
while (s > 0)
{
char b[100];
std::snprintf(b, sizeof(b), "%s/stress_test%d", torrent_name, i);
++i;
fs.add_file(b, (std::min)(s, boost::int64_t(file_size)));
fs.add_file(b, (std::min)(s, std::int64_t(file_size)));
s -= file_size;
file_size += 200;
}
@ -837,7 +837,7 @@ void generate_data(char const* path, torrent_info const& ti)
st->initialize(error);
}
boost::uint32_t piece[0x4000 / 4];
std::uint32_t piece[0x4000 / 4];
for (int i = 0; i < ti.num_pieces(); ++i)
{
for (int j = 0; j < ti.piece_size(i); j += 0x4000)
@ -972,7 +972,7 @@ int main(int argc, char* argv[])
{
char file_name[100];
std::snprintf(file_name, sizeof(file_name), "%s-%d/file-%d", torrent_file, i, j);
fs.add_file(file_name, boost::int64_t(j + i + 1) * 251);
fs.add_file(file_name, std::int64_t(j + i + 1) * 251);
}
// 1 MiB piece size
const int piece_size = 1024 * 1024;
@ -1029,12 +1029,12 @@ int main(int argc, char* argv[])
std::fprintf(stderr, "ERROR RESOLVING %s: %s\n", destination_ip, ec.message().c_str());
return 1;
}
tcp::endpoint ep(addr, boost::uint16_t(destination_port));
tcp::endpoint ep(addr, std::uint16_t(destination_port));
#if !defined __APPLE__
// apparently darwin doesn't seems to let you bind to
// loopback on any other IP than 127.0.0.1
boost::uint32_t const ip = addr.to_ulong();
std::uint32_t const ip = addr.to_ulong();
if ((ip & 0xff000000) == 0x7f000000)
{
local_bind = true;
@ -1077,8 +1077,8 @@ int main(int argc, char* argv[])
float up = 0.f;
float down = 0.f;
boost::uint64_t total_sent = 0;
boost::uint64_t total_received = 0;
std::uint64_t total_sent = 0;
std::uint64_t total_received = 0;
for (std::vector<peer_conn*>::iterator i = conns.begin()
, end(conns.end()); i != end; ++i)
@ -1087,8 +1087,8 @@ int main(int argc, char* argv[])
int time = int(total_milliseconds(p->end_time - p->start_time));
if (time == 0) time = 1;
total_sent += p->blocks_sent;
up += (boost::int64_t(p->blocks_sent) * 0x4000) / time / 1000.f;
down += (boost::int64_t(p->blocks_received) * 0x4000) / time / 1000.f;
up += (std::int64_t(p->blocks_sent) * 0x4000) / time / 1000.f;
down += (std::int64_t(p->blocks_received) * 0x4000) / time / 1000.f;
delete p;
}

View File

@ -197,7 +197,7 @@ int main(int argc, char* argv[])
for (int i = 0; i < st.num_files(); ++i)
{
int const first = st.map_file(i, 0, 0).piece;
int const last = st.map_file(i, (std::max)(boost::int64_t(st.file_size(i))-1, boost::int64_t(0)), 0).piece;
int const last = st.map_file(i, (std::max)(std::int64_t(st.file_size(i))-1, std::int64_t(0)), 0).piece;
int const flags = st.file_flags(i);
std::stringstream file_hash;
if (!st.hash(i).is_all_zeros())
@ -210,7 +210,7 @@ int main(int argc, char* argv[])
, ((flags & file_storage::flag_hidden)?'h':'-')
, ((flags & file_storage::flag_symlink)?'l':'-')
, first, last
, boost::uint32_t(st.mtime(i))
, std::uint32_t(st.mtime(i))
, file_hash.str().c_str()
, st.file_path(i).c_str()
, (flags & file_storage::flag_symlink) ? "-> " : ""

View File

@ -108,9 +108,9 @@ void session_view::render()
, color(to_string(int(m_cnt[0][m_queued_reads_idx]), 3), col_red).c_str()
, color(to_string(int(m_cnt[0][m_queued_writes_idx]), 3), col_green).c_str()
, int((m_cnt[0][m_blocks_written_idx] - m_cnt[0][m_write_ops_idx]) * 100
/ (std::max)(boost::uint64_t(1), m_cnt[0][m_blocks_written_idx]))
/ (std::max)(std::uint64_t(1), m_cnt[0][m_blocks_written_idx]))
, int(m_cnt[0][m_cache_hit_idx] * 100
/ (std::max)(boost::uint64_t(1), m_cnt[0][m_num_blocks_read_idx]))
/ (std::max)(std::uint64_t(1), m_cnt[0][m_num_blocks_read_idx]))
, add_suffix(m_cnt[0][m_writes_cache_idx] * 16 * 1024).c_str()
, add_suffix(m_cnt[0][m_reads_cache_idx] * 16 * 1024).c_str()
, add_suffix(m_cnt[0][m_blocks_in_use_idx] * 16 * 1024).c_str()
@ -189,8 +189,8 @@ void session_view::render()
}
}
void session_view::update_counters(boost::uint64_t* stats_counters
, int num_cnt, boost::uint64_t t)
void session_view::update_counters(std::uint64_t* stats_counters
, int num_cnt, std::uint64_t t)
{
// only update the previous counters if there's been enough
// time since it was last updated

View File

@ -2,7 +2,7 @@
#define SESSION_VIEW_HPP_
#include "libtorrent/session_stats.hpp"
#include <boost/cstdint.hpp>
#include <cstdint>
namespace lt = libtorrent;
@ -21,8 +21,8 @@ struct session_view
void print_utp_stats(bool p) { m_print_utp_stats = p; }
bool print_utp_stats() const { return m_print_utp_stats; }
void update_counters(boost::uint64_t* stats_counters, int num_cnt
, boost::uint64_t t);
void update_counters(std::uint64_t* stats_counters, int num_cnt
, std::uint64_t t);
private:
@ -31,11 +31,11 @@ private:
// there are two sets of counters. the current one and the last one. This
// is used to calculate rates
std::vector<boost::uint64_t> m_cnt[2];
std::vector<std::uint64_t> m_cnt[2];
// the timestamps of the counters in m_cnt[0] and m_cnt[1]
// respectively. The timestamps are microseconds since session start
boost::uint64_t m_timestamp[2];
std::uint64_t m_timestamp[2];
bool m_print_utp_stats;

View File

@ -91,10 +91,10 @@
#include "libtorrent/config.hpp"
// these are standard C types, but they might
// not be available in c++
#include <boost/cstdint.hpp>
typedef boost::uint32_t UTF32;
typedef boost::uint16_t UTF16;
typedef boost::uint8_t UTF8;
#include <stdint.h>
typedef uint32_t UTF32;
typedef uint16_t UTF16;
typedef uint8_t UTF8;
extern "C" {
#else
#define TORRENT_EXTRA_EXPORT

View File

@ -105,7 +105,7 @@ namespace libtorrent
{}
// values for the ``flags`` field
enum flags_t : boost::uint64_t
enum flags_t : std::uint64_t
{
// If ``flag_seed_mode`` is set, libtorrent will assume that all files
// are present for this torrent and that they all match the hashes in
@ -335,7 +335,7 @@ namespace libtorrent
// can be set to control the initial file priorities when adding a
// torrent. The semantics are the same as for
// ``torrent_handle::prioritize_files()``.
std::vector<boost::uint8_t> file_priorities;
std::vector<std::uint8_t> file_priorities;
// torrent extension construction functions can be added to this vector
// to have them be added immediately when the torrent is constructed.
@ -367,7 +367,7 @@ namespace libtorrent
// constructor. In order to preserve default behavior when clearing or
// setting other flags, make sure to bitwise OR or in a flag or bitwise
// AND the inverse of a flag to clear it.
boost::uint64_t flags;
std::uint64_t flags;
// set this to the info hash of the torrent to add in case the info-hash
// is the only known property of the torrent. i.e. you don't have a
@ -390,8 +390,8 @@ namespace libtorrent
// the total number of bytes uploaded and downloaded by this torrent so
// far.
boost::int64_t total_uploaded;
boost::int64_t total_downloaded;
std::int64_t total_uploaded;
std::int64_t total_downloaded;
// the number of seconds this torrent has spent in started, finished and
// seeding state so far, respectively.
@ -466,7 +466,7 @@ namespace libtorrent
// element in the vector represent the piece with the same index. If you
// set both file- and piece priorities, file priorities will take
// precedence.
std::vector<boost::uint8_t> piece_priorities;
std::vector<std::uint8_t> piece_priorities;
// if this is a merkle tree torrent, and you're seeding, this field must
// be set. It is all the hashes in the binary tree, with the root as the

View File

@ -69,7 +69,7 @@ namespace libtorrent {
{
public:
alert_manager(int queue_limit
, boost::uint32_t alert_mask = alert::error_notification);
, std::uint32_t alert_mask = alert::error_notification);
~alert_manager();
template <class T, typename... Args>
@ -107,13 +107,13 @@ namespace libtorrent {
alert* wait_for_alert(time_duration max_wait);
void set_alert_mask(boost::uint32_t m)
void set_alert_mask(std::uint32_t m)
{
std::lock_guard<std::mutex> lock(m_mutex);
m_alert_mask = m;
}
boost::uint32_t alert_mask() const
std::uint32_t alert_mask() const
{
std::lock_guard<std::mutex> lock(m_mutex);
return m_alert_mask;
@ -138,7 +138,7 @@ namespace libtorrent {
mutable std::mutex m_mutex;
std::condition_variable m_condition;
boost::uint32_t m_alert_mask;
std::uint32_t m_alert_mask;
int m_queue_size_limit;
// this function (if set) is called whenever the number of alerts in

View File

@ -1893,7 +1893,7 @@ namespace libtorrent
// interpret these values throughout the process' runtime.
//
// For more information, see the session-statistics_ section.
boost::uint64_t values[counters::num_counters];
std::uint64_t values[counters::num_counters];
};
#ifndef TORRENT_NO_DEPRECATE
@ -1975,7 +1975,7 @@ namespace libtorrent
dht_mutable_item_alert(aux::stack_allocator& alloc
, std::array<char, 32> k
, std::array<char, 64> sig
, boost::uint64_t sequence
, std::uint64_t sequence
, std::string const& s
, entry const& i
, bool a);
@ -1996,7 +1996,7 @@ namespace libtorrent
std::array<char, 64> signature;
// the sequence number of this item
boost::uint64_t seq;
std::uint64_t seq;
// the salt, if any, used to lookup and store this item. If no
// salt was used, this is an empty string
@ -2018,7 +2018,7 @@ namespace libtorrent
dht_put_alert(aux::stack_allocator& alloc, std::array<char, 32> key
, std::array<char, 64> sig
, std::string s
, boost::uint64_t sequence_number
, std::uint64_t sequence_number
, int n);
TORRENT_DEFINE_ALERT(dht_put_alert, 76)
@ -2035,7 +2035,7 @@ namespace libtorrent
std::array<char, 32> public_key;
std::array<char, 64> signature;
std::string salt;
boost::uint64_t seq;
std::uint64_t seq;
// DHT put operation usually writes item to k nodes, maybe the node
// is stale so no response, or the node doesn't support 'put', or the
@ -2414,7 +2414,7 @@ namespace libtorrent
// internal
picker_log_alert(aux::stack_allocator& alloc, torrent_handle const& h
, tcp::endpoint const& ep, peer_id const& peer_id, boost::uint32_t flags
, tcp::endpoint const& ep, peer_id const& peer_id, std::uint32_t flags
, piece_block const* blocks, int num_blocks);
TORRENT_DEFINE_ALERT(picker_log_alert, 89)
@ -2450,7 +2450,7 @@ namespace libtorrent
// this is a bitmask of which features were enabled for this particular
// pick. The bits are defined in the picker_flags_t enum.
boost::uint32_t picker_flags;
std::uint32_t picker_flags;
std::vector<piece_block> blocks() const;

View File

@ -40,7 +40,7 @@ POSSIBILITY OF SUCH DAMAGE.
#include "libtorrent/aux_/disable_warnings_push.hpp"
#include <string>
#include <boost/cstdint.hpp>
#include <cstdint>
#include "libtorrent/aux_/disable_warnings_pop.hpp"
@ -112,15 +112,15 @@ namespace libtorrent
int scrape_downloaded;
// the tier this tracker belongs to
boost::uint8_t tier;
std::uint8_t tier;
// the max number of failures to announce to this tracker in
// a row, before this tracker is not used anymore. 0 means unlimited
boost::uint8_t fail_limit;
std::uint8_t fail_limit;
// the number of times in a row we have failed to announce to this
// tracker.
boost::uint8_t fails:7;
std::uint8_t fails:7;
// true while we're waiting for a response from the tracker.
bool updating:1;
@ -140,7 +140,7 @@ namespace libtorrent
};
// a bitmask specifying which sources we got this tracker from.
boost::uint8_t source:4;
std::uint8_t source:4;
// set to true the first time we receive a valid response
// from this tracker.

View File

@ -40,7 +40,7 @@ POSSIBILITY OF SUCH DAMAGE.
#include "libtorrent/aux_/disable_warnings_push.hpp"
#include <boost/cstdint.hpp>
#include <cstdint>
#ifdef TORRENT_WINDOWS
#include <winsock2.h>
@ -55,16 +55,16 @@ namespace aux {
// these need to be within the disabled warnings because on OSX
// the htonl and ntohl macros cause lots of old-style case warnings
inline boost::uint32_t host_to_network(boost::uint32_t x)
inline std::uint32_t host_to_network(std::uint32_t x)
{ return htonl(x); }
inline boost::uint32_t network_to_host(boost::uint32_t x)
inline std::uint32_t network_to_host(std::uint32_t x)
{ return ntohl(x); }
inline boost::uint16_t host_to_network(boost::uint16_t x)
inline std::uint16_t host_to_network(std::uint16_t x)
{ return htons(x); }
inline boost::uint16_t network_to_host(boost::uint16_t x)
inline std::uint16_t network_to_host(std::uint16_t x)
{ return ntohs(x); }
}

View File

@ -180,12 +180,12 @@ namespace boost {
namespace detail {
template <class Backend>
boost::uintmax_t extract_bits(const Backend& val, unsigned location, unsigned count, const mpl::false_& tag)
std::uintmax_t extract_bits(const Backend& val, unsigned location, unsigned count, const mpl::false_& tag)
{
unsigned limb = location / (sizeof(limb_type) * CHAR_BIT);
unsigned shift = location % (sizeof(limb_type) * CHAR_BIT);
boost::uintmax_t result = 0;
boost::uintmax_t mask = count == std::numeric_limits<boost::uintmax_t>::digits ? ~static_cast<boost::uintmax_t>(0) : (static_cast<boost::uintmax_t>(1u) << count) - 1;
std::uintmax_t result = 0;
std::uintmax_t mask = count == std::numeric_limits<std::uintmax_t>::digits ? ~static_cast<std::uintmax_t>(0) : (static_cast<std::uintmax_t>(1u) << count) - 1;
if(count > (sizeof(limb_type) * CHAR_BIT - shift))
{
result = extract_bits(val, location + sizeof(limb_type) * CHAR_BIT - shift, count - sizeof(limb_type) * CHAR_BIT + shift, tag);
@ -197,10 +197,10 @@ namespace boost {
}
template <class Backend>
inline boost::uintmax_t extract_bits(const Backend& val, unsigned location, unsigned count, const mpl::true_&)
inline std::uintmax_t extract_bits(const Backend& val, unsigned location, unsigned count, const mpl::true_&)
{
boost::uintmax_t result = *val.limbs();
boost::uintmax_t mask = count == std::numeric_limits<boost::uintmax_t>::digits ? ~static_cast<boost::uintmax_t>(0) : (static_cast<boost::uintmax_t>(1u) << count) - 1;
std::uintmax_t result = *val.limbs();
std::uintmax_t mask = count == std::numeric_limits<std::uintmax_t>::digits ? ~static_cast<std::uintmax_t>(0) : (static_cast<std::uintmax_t>(1u) << count) - 1;
return (result >> location) & mask;
}

View File

@ -34,7 +34,7 @@ POSSIBILITY OF SUCH DAMAGE.
#define TORRENT_FILE_PROGRESS_HPP_INCLUDE
#include <vector>
#include <boost/cstdint.hpp>
#include <cstdint>
#include "libtorrent/export.hpp"
@ -59,7 +59,7 @@ namespace aux
void init(piece_picker const& picker
, file_storage const& fs);
void export_progress(std::vector<boost::int64_t> &fp);
void export_progress(std::vector<std::int64_t> &fp);
void clear();
@ -73,7 +73,7 @@ namespace aux
// this lets us trigger on individual files completing
// the vector is allocated lazily, when file progress
// is first queried by the client
std::vector<boost::uint64_t> m_file_progress;
std::vector<std::uint64_t> m_file_progress;
#if TORRENT_USE_INVARIANT_CHECKS && defined TORRENT_DEBUG
friend class libtorrent::invariant_access;
@ -84,7 +84,7 @@ namespace aux
// to make sure we never say we've downloaded more bytes of a file than
// its file size
std::vector<boost::uint64_t> m_file_sizes;
std::vector<std::uint64_t> m_file_sizes;
#endif
};
} }

View File

@ -34,7 +34,7 @@ POSSIBILITY OF SUCH DAMAGE.
#define TORRENT_AUX_IO_HPP_INCLUDED
#include "libtorrent/aux_/disable_warnings_push.hpp"
#include <boost/cstdint.hpp>
#include <cstdint>
#include "libtorrent/aux_/disable_warnings_pop.hpp"
#include <string>
@ -56,7 +56,7 @@ namespace libtorrent { namespace aux
for (int i = 0; i < int(sizeof(T)); ++i)
{
ret <<= 8;
ret |= static_cast<boost::uint8_t>(view[i]);
ret |= static_cast<std::uint8_t>(view[i]);
}
view = view.cut_first(sizeof(T));
return ret;
@ -78,68 +78,68 @@ namespace libtorrent { namespace aux
// -- adaptors
template <typename Byte>
boost::int64_t read_int64(array_view<Byte>& view)
{ return read_impl(view, type<boost::int64_t>()); }
std::int64_t read_int64(array_view<Byte>& view)
{ return read_impl(view, type<std::int64_t>()); }
template <typename Byte>
boost::uint64_t read_uint64(array_view<Byte>& view)
{ return read_impl(view, type<boost::uint64_t>()); }
std::uint64_t read_uint64(array_view<Byte>& view)
{ return read_impl(view, type<std::uint64_t>()); }
template <typename Byte>
boost::uint32_t read_uint32(array_view<Byte>& view)
{ return read_impl(view, type<boost::uint32_t>()); }
std::uint32_t read_uint32(array_view<Byte>& view)
{ return read_impl(view, type<std::uint32_t>()); }
template <typename Byte>
boost::int32_t read_int32(array_view<Byte>& view)
{ return read_impl(view, type<boost::int32_t>()); }
std::int32_t read_int32(array_view<Byte>& view)
{ return read_impl(view, type<std::int32_t>()); }
template <typename Byte>
boost::int16_t read_int16(array_view<Byte>& view)
{ return read_impl(view, type<boost::int16_t>()); }
std::int16_t read_int16(array_view<Byte>& view)
{ return read_impl(view, type<std::int16_t>()); }
template <typename Byte>
boost::uint16_t read_uint16(array_view<Byte>& view)
{ return read_impl(view, type<boost::uint16_t>()); }
std::uint16_t read_uint16(array_view<Byte>& view)
{ return read_impl(view, type<std::uint16_t>()); }
template <typename Byte>
boost::int8_t read_int8(array_view<Byte>& view)
{ return read_impl(view, type<boost::int8_t>()); }
std::int8_t read_int8(array_view<Byte>& view)
{ return read_impl(view, type<std::int8_t>()); }
template <typename Byte>
boost::uint8_t read_uint8(array_view<Byte>& view)
{ return read_impl(view, type<boost::uint8_t>()); }
std::uint8_t read_uint8(array_view<Byte>& view)
{ return read_impl(view, type<std::uint8_t>()); }
template <typename Byte>
void write_uint64(boost::uint64_t val, array_view<Byte>& view)
void write_uint64(std::uint64_t val, array_view<Byte>& view)
{ write_impl(val, view); }
template <typename Byte>
void write_int64(boost::int64_t val, array_view<Byte>& view)
void write_int64(std::int64_t val, array_view<Byte>& view)
{ write_impl(val, view); }
template <typename Byte>
void write_uint32(boost::uint32_t val, array_view<Byte>& view)
void write_uint32(std::uint32_t val, array_view<Byte>& view)
{ write_impl(val, view); }
template <typename Byte>
void write_int32(boost::int32_t val, array_view<Byte>& view)
void write_int32(std::int32_t val, array_view<Byte>& view)
{ write_impl(val, view); }
template <typename Byte>
void write_uint16(boost::uint16_t val, array_view<Byte>& view)
void write_uint16(std::uint16_t val, array_view<Byte>& view)
{ write_impl(val, view); }
template <typename Byte>
void write_int16(boost::int16_t val, array_view<Byte>& view)
void write_int16(std::int16_t val, array_view<Byte>& view)
{ write_impl(val, view); }
template <typename Byte>
void write_uint8(boost::uint8_t val, array_view<Byte>& view)
void write_uint8(std::uint8_t val, array_view<Byte>& view)
{ write_impl(val, view); }
template <typename Byte>
void write_int8(boost::int8_t val, array_view<Byte>& view)
void write_int8(std::int8_t val, array_view<Byte>& view)
{ write_impl(val, view); }
template<typename Byte>

View File

@ -37,7 +37,7 @@ POSSIBILITY OF SUCH DAMAGE.
#include "libtorrent/config.hpp"
#include <string>
#include <boost/cstdint.hpp>
#include <cstdint>
namespace libtorrent {
struct settings_pack;
@ -118,10 +118,10 @@ namespace aux {
// tells libtorrent what kind of proxy server it is. See proxy_type
// enum for options
boost::uint8_t type;
std::uint8_t type;
// the port the proxy server is running on
boost::uint16_t port;
std::uint16_t port;
// defaults to true. It means that hostnames should be attempted to be
// resolved through the proxy instead of using the local DNS service.

View File

@ -335,7 +335,7 @@ namespace libtorrent
void dht_put_mutable_item(std::array<char, 32> key
, boost::function<void(entry&, std::array<char,64>&
, boost::uint64_t&, std::string const&)> cb
, std::uint64_t&, std::string const&)> cb
, std::string salt = std::string());
void dht_get_peers(sha1_hash const& info_hash);
@ -430,10 +430,10 @@ namespace libtorrent
void get_torrent_status(std::vector<torrent_status>* ret
, boost::function<bool(torrent_status const&)> const& pred
, boost::uint32_t flags) const;
, std::uint32_t flags) const;
void refresh_torrent_status(std::vector<torrent_status>* ret
, boost::uint32_t flags) const;
void post_torrent_updates(boost::uint32_t flags);
, std::uint32_t flags) const;
void post_torrent_updates(std::uint32_t flags);
void post_session_stats();
void post_dht_stats();
@ -496,8 +496,8 @@ namespace libtorrent
void set_peer_id(peer_id const& id);
void set_key(int key);
boost::uint16_t listen_port() const override;
boost::uint16_t ssl_listen_port() const override;
std::uint16_t listen_port() const override;
std::uint16_t ssl_listen_port() const override;
alert_manager& alerts() override { return m_alerts; }
disk_interface& disk_thread() override { return m_disk_thread; }
@ -509,8 +509,8 @@ namespace libtorrent
void announce_lsd(sha1_hash const& ih, int port, bool broadcast = false) override;
void save_state(entry* e, boost::uint32_t flags) const;
void load_state(bdecode_node const* e, boost::uint32_t flags);
void save_state(entry* e, std::uint32_t flags) const;
void load_state(bdecode_node const* e, std::uint32_t flags);
bool has_connection(peer_connection* p) const override;
void insert_peer(boost::shared_ptr<peer_connection> const& c) override;
@ -885,10 +885,10 @@ namespace libtorrent
// when as a socks proxy is used for peers, also
// listen for incoming connections on a socks connection
boost::shared_ptr<socket_type> m_socks_listen_socket;
boost::uint16_t m_socks_listen_port;
std::uint16_t m_socks_listen_port;
// round-robin index into m_outgoing_interfaces
mutable boost::uint8_t m_interface_index;
mutable std::uint8_t m_interface_index;
void open_new_incoming_socks_connection();
@ -961,16 +961,16 @@ namespace libtorrent
void recalculate_optimistic_unchoke_slots();
time_point m_created;
boost::uint16_t session_time() const override
std::uint16_t session_time() const override
{
// +1 is here to make it possible to distinguish uninitialized (to
// 0) timestamps and timestamps of things that happened during the
// first second after the session was constructed
boost::int64_t const ret = total_seconds(aux::time_now()
std::int64_t const ret = total_seconds(aux::time_now()
- m_created) + 1;
TORRENT_ASSERT(ret >= 0);
TORRENT_ASSERT(ret <= (std::numeric_limits<boost::uint16_t>::max)());
return static_cast<boost::uint16_t>(ret);
TORRENT_ASSERT(ret <= (std::numeric_limits<std::uint16_t>::max)());
return static_cast<std::uint16_t>(ret);
}
time_point m_last_tick;
@ -1144,7 +1144,7 @@ namespace libtorrent
// this keeps the timers more accurate over time
// as a kind of "leap second" to adjust for the
// accumulated error
boost::uint16_t m_tick_residual;
std::uint16_t m_tick_residual;
#ifndef TORRENT_DISABLE_LOGGING
virtual void session_log(char const* fmt, ...) const override TORRENT_FORMAT(2,3);

View File

@ -174,7 +174,7 @@ namespace libtorrent { namespace aux
virtual port_filter const& get_port_filter() const = 0;
virtual void ban_ip(address addr) = 0;
virtual boost::uint16_t session_time() const = 0;
virtual std::uint16_t session_time() const = 0;
virtual bool is_aborted() const = 0;
virtual int num_uploads() const = 0;
@ -210,8 +210,8 @@ namespace libtorrent { namespace aux
virtual void deferred_submit_jobs() = 0;
virtual boost::uint16_t listen_port() const = 0;
virtual boost::uint16_t ssl_listen_port() const = 0;
virtual std::uint16_t listen_port() const = 0;
virtual std::uint16_t ssl_listen_port() const = 0;
// load the specified torrent. also evict one torrent, except
// for the one specified, if we are at the limit of loaded torrents

View File

@ -36,7 +36,7 @@ POSSIBILITY OF SUCH DAMAGE.
#include "libtorrent/aux_/disable_warnings_push.hpp"
#include <boost/integer_traits.hpp>
#include <boost/cstdint.hpp>
#include <cstdint>
#include "libtorrent/aux_/disable_warnings_pop.hpp"
@ -92,11 +92,11 @@ private:
// this is the amount of bandwidth we have
// been assigned without using yet.
boost::int64_t m_quota_left;
std::int64_t m_quota_left;
// the limit is the number of bytes
// per second we are allowed to use.
boost::int64_t m_limit;
std::int64_t m_limit;
};
}

View File

@ -61,7 +61,7 @@ struct TORRENT_EXTRA_EXPORT bandwidth_manager
#endif
int queue_size() const;
boost::int64_t queued_bytes() const;
std::int64_t queued_bytes() const;
// non prioritized means that, if there's a line for bandwidth,
// others will cut in front of the non-prioritized peers.
@ -83,7 +83,7 @@ private:
typedef std::vector<bw_request> queue_t;
queue_t m_queue;
// the number of bytes all the requests in queue are for
boost::int64_t m_queued_bytes;
std::int64_t m_queued_bytes;
// this is the channel within the consumers
// that bandwidth is assigned to (upload or download)

View File

@ -331,7 +331,7 @@ namespace libtorrent
// ----------------------------------------------
// string
default:
if (is_digit(boost::uint8_t(*in)))
if (is_digit(std::uint8_t(*in)))
{
std::string len_s = read_until(in, end, ':', err);
if (err)

View File

@ -39,7 +39,7 @@ POSSIBILITY OF SUCH DAMAGE.
#include <cstring> // for memset and memcpy
#include <cstdlib> // for malloc, free and realloc
#include <boost/cstdint.hpp> // uint32_t
#include <cstdint> // uint32_t
#include <algorithm> // for min()
namespace libtorrent
@ -154,7 +154,7 @@ namespace libtorrent
void swap(bitfield& rhs)
{
boost::uint32_t* tmp = m_buf;
std::uint32_t* tmp = m_buf;
m_buf = rhs.m_buf;
rhs.m_buf = tmp;
}
@ -214,10 +214,10 @@ namespace libtorrent
bit <<= 1;
}
}
const_iterator(boost::uint32_t const* ptr, int offset)
const_iterator(std::uint32_t const* ptr, int offset)
: buf(ptr), bit(0x80000000 >> offset) {}
boost::uint32_t const* buf;
boost::uint32_t bit;
std::uint32_t const* buf;
std::uint32_t bit;
};
const_iterator begin() const { return const_iterator(m_buf, 0); }
@ -262,7 +262,7 @@ namespace libtorrent
// number of bits. For this purpose, the m_buf actually points
// the element 1, not 0. To access the size (in bits), access
// m_buf[-1]
boost::uint32_t* m_buf;
std::uint32_t* m_buf;
};
}

View File

@ -36,7 +36,7 @@ POSSIBILITY OF SUCH DAMAGE.
#include "libtorrent/aux_/disable_warnings_push.hpp"
#include <boost/unordered_set.hpp>
#include <boost/cstdint.hpp>
#include <cstdint>
#include <boost/shared_ptr.hpp>
#include <boost/shared_array.hpp>
#include <list>
@ -140,7 +140,7 @@ namespace libtorrent
// all references are gone and refcount reaches 0. The buf
// pointer in this struct doesn't count as a reference and
// is always the last to be cleared
boost::uint32_t refcount:30;
std::uint32_t refcount:30;
// if this is true, this block needs to be written to
// disk before it's freed. Typically all blocks in a piece
@ -148,13 +148,13 @@ namespace libtorrent
// (read-ahead cache). Once blocks are written to disk, the
// dirty flag is cleared and effectively turns the block
// into a read cache block
boost::uint32_t dirty:1;
std::uint32_t dirty:1;
// pending means that this buffer has not yet been filled in
// with valid data. There's an outstanding read job for this.
// If the dirty flag is set, it means there's an outstanding
// write job to write this block.
boost::uint32_t pending:1;
std::uint32_t pending:1;
#if TORRENT_USE_ASSERTS
// this many of the references are held by hashing operations
@ -223,38 +223,38 @@ namespace libtorrent
//TODO: make this 32 bits and to count seconds since the block cache was created
time_point expire;
boost::uint64_t piece:22;
std::uint64_t piece:22;
// the number of dirty blocks in this piece
boost::uint64_t num_dirty:14;
std::uint64_t num_dirty:14;
// the number of blocks in the cache for this piece
boost::uint64_t num_blocks:14;
std::uint64_t num_blocks:14;
// the total number of blocks in this piece (and the number
// of elements in the blocks array)
boost::uint64_t blocks_in_piece:14;
std::uint64_t blocks_in_piece:14;
// ---- 64 bit boundary ----
// while we have an outstanding async hash operation
// working on this piece, 'hashing' is set to 1
// When the operation returns, this is set to 0.
boost::uint32_t hashing:1;
std::uint32_t hashing:1;
// if we've completed at least one hash job on this
// piece, and returned it. This is set to one
boost::uint32_t hashing_done:1;
std::uint32_t hashing_done:1;
// if this is true, whenever refcount hits 0,
// this piece should be deleted
boost::uint32_t marked_for_deletion:1;
std::uint32_t marked_for_deletion:1;
// this is set to true once we flush blocks past
// the hash cursor. Once this happens, there's
// no point in keeping cache blocks around for
// it in avoid_readback mode
boost::uint32_t need_readback:1;
std::uint32_t need_readback:1;
// indicates which LRU list this piece is chained into
enum cache_state_t
@ -290,17 +290,17 @@ namespace libtorrent
num_lrus
};
boost::uint32_t cache_state:3;
std::uint32_t cache_state:3;
// this is the number of threads that are currently holding
// a reference to this piece. A piece may not be removed from
// the cache while this is > 0
boost::uint32_t piece_refcount:7;
std::uint32_t piece_refcount:7;
// if this is set to one, it means there is an outstanding
// flush_hashed job for this piece, and there's no need to
// issue another one.
boost::uint32_t outstanding_flush:1;
std::uint32_t outstanding_flush:1;
// as long as there is a read operation outstanding on this
// piece, this is set to 1. Otherwise 0.
@ -308,15 +308,15 @@ namespace libtorrent
// the same blocks at the same time. If a new read job is
// added when this is 1, that new job should be hung on the
// read job queue (read_jobs).
boost::uint32_t outstanding_read:1;
std::uint32_t outstanding_read:1;
// the number of blocks that have >= 1 refcount
boost::uint32_t pinned:16;
std::uint32_t pinned:16;
// ---- 32 bit boundary ---
// the sum of all refcounts in all blocks
boost::uint32_t refcount;
std::uint32_t refcount;
#if TORRENT_USE_ASSERTS
// the number of times this piece has finished hashing
@ -517,21 +517,21 @@ namespace libtorrent
int m_max_volatile_blocks;
// the number of blocks (buffers) allocated by volatile pieces.
boost::uint32_t m_volatile_size;
std::uint32_t m_volatile_size;
// the number of blocks in the cache
// that are in the read cache
boost::uint32_t m_read_cache_size;
std::uint32_t m_read_cache_size;
// the number of blocks in the cache
// that are in the write cache
boost::uint32_t m_write_cache_size;
std::uint32_t m_write_cache_size;
// the number of blocks that are currently sitting
// in peer's send buffers. If two peers are sending
// the same block, it counts as 2, even though there're
// no buffer duplication
boost::uint32_t m_send_buffer_blocks;
std::uint32_t m_send_buffer_blocks;
// the number of blocks with a refcount > 0, i.e.
// they may not be evicted

View File

@ -40,15 +40,15 @@ POSSIBILITY OF SUCH DAMAGE.
#include "libtorrent/aux_/disable_warnings_push.hpp"
#include <boost/cstdint.hpp>
#include <cstdint>
#include "libtorrent/aux_/disable_warnings_pop.hpp"
namespace libtorrent
{
TORRENT_EXTRA_EXPORT void set_bits(boost::uint8_t const* b, boost::uint8_t* bits, int len);
TORRENT_EXTRA_EXPORT bool has_bits(boost::uint8_t const* b, boost::uint8_t const* bits, int len);
TORRENT_EXTRA_EXPORT int count_zero_bits(boost::uint8_t const* bits, int len);
TORRENT_EXTRA_EXPORT void set_bits(std::uint8_t const* b, std::uint8_t* bits, int len);
TORRENT_EXTRA_EXPORT bool has_bits(std::uint8_t const* b, std::uint8_t const* bits, int len);
TORRENT_EXTRA_EXPORT int count_zero_bits(std::uint8_t const* bits, int len);
template <int N>
struct bloom_filter
@ -77,7 +77,7 @@ namespace libtorrent
bloom_filter() { clear(); }
private:
boost::uint8_t bits[N];
std::uint8_t bits[N];
};
}

View File

@ -47,7 +47,7 @@ POSSIBILITY OF SUCH DAMAGE.
#include <boost/noncopyable.hpp>
#include <array>
#include <boost/optional.hpp>
#include <boost/cstdint.hpp>
#include <cstdint>
#include "libtorrent/aux_/disable_warnings_pop.hpp"
@ -330,7 +330,7 @@ private:
#endif
// state of on_receive. one of the enums in state_t
boost::uint8_t m_state;
std::uint8_t m_state;
// this is set to true if the handshake from
// the peer indicated that it supports the
@ -425,17 +425,17 @@ private:
#ifndef TORRENT_DISABLE_EXTENSIONS
// the message ID for upload only message
// 0 if not supported
boost::uint8_t m_upload_only_id;
std::uint8_t m_upload_only_id;
// the message ID for holepunch messages
boost::uint8_t m_holepunch_id;
std::uint8_t m_holepunch_id;
// the message ID for don't-have message
boost::uint8_t m_dont_have_id;
std::uint8_t m_dont_have_id;
// the message ID for share mode message
// 0 if not supported
boost::uint8_t m_share_mode_id;
std::uint8_t m_share_mode_id;
char m_reserved_bits[8];
#endif

View File

@ -40,7 +40,7 @@ POSSIBILITY OF SUCH DAMAGE.
#include <algorithm> // for std::swap
#include "libtorrent/aux_/disable_warnings_push.hpp"
#include <boost/cstdint.hpp>
#include <cstdint>
#include "libtorrent/aux_/disable_warnings_pop.hpp"
namespace libtorrent {
@ -172,9 +172,9 @@ public:
void resize(std::size_t n)
{
TORRENT_ASSERT(n < std::numeric_limits<boost::uint32_t>::max());
TORRENT_ASSERT(n < std::numeric_limits<std::uint32_t>::max());
reserve(n);
m_size = boost::uint32_t(n);
m_size = std::uint32_t(n);
}
void insert(char* point, char const* first, char const* last)
@ -204,9 +204,9 @@ public:
}
std::memmove(b, e, m_begin + m_size - e);
TORRENT_ASSERT(e >= b);
TORRENT_ASSERT(uintptr_t(e - b) <= std::numeric_limits<boost::uint32_t>::max());
TORRENT_ASSERT(uintptr_t(e - b) <= std::numeric_limits<std::uint32_t>::max());
TORRENT_ASSERT(uintptr_t(e - b) <= m_size);
m_size -= boost::uint32_t(e - b);
m_size -= std::uint32_t(e - b);
}
void clear() { m_size = 0; }
@ -223,7 +223,7 @@ public:
if (tmp == NULL) throw std::bad_alloc();
#endif
m_begin = tmp;
m_capacity = boost::uint32_t(n);
m_capacity = std::uint32_t(n);
}
bool empty() const { return m_size == 0; }
@ -244,8 +244,8 @@ public:
}
private:
char* m_begin;
boost::uint32_t m_size;
boost::uint32_t m_capacity;
std::uint32_t m_size;
std::uint32_t m_capacity;
};

View File

@ -33,15 +33,15 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef TORRENT_CRC32C_HPP_INCLUDE
#define TORRENT_CRC32C_HPP_INCLUDE
#include <boost/cstdint.hpp>
#include <cstdint>
#include "libtorrent/export.hpp"
namespace libtorrent
{
// this is the crc32c (Castagnoli) polynomial
TORRENT_EXTRA_EXPORT boost::uint32_t crc32c_32(boost::uint32_t v);
TORRENT_EXTRA_EXPORT boost::uint32_t crc32c(boost::uint64_t const* v
TORRENT_EXTRA_EXPORT std::uint32_t crc32c_32(std::uint32_t v);
TORRENT_EXTRA_EXPORT std::uint32_t crc32c(std::uint64_t const* v
, int num_words);
}

View File

@ -395,9 +395,9 @@ namespace libtorrent
// The ``flags`` argument should be the same as the flags passed to the `create_torrent`_
// constructor.
TORRENT_EXPORT void add_files(file_storage& fs, std::string const& file
, boost::function<bool(std::string)> p, boost::uint32_t flags = 0);
, boost::function<bool(std::string)> p, std::uint32_t flags = 0);
TORRENT_EXPORT void add_files(file_storage& fs, std::string const& file
, boost::uint32_t flags = 0);
, std::uint32_t flags = 0);
// This function will assume that the files added to the torrent file exists at path
// ``p``, read those files and hash the content and set the hashes in the ``create_torrent``
@ -440,11 +440,11 @@ namespace libtorrent
TORRENT_DEPRECATED
TORRENT_EXPORT void add_files(file_storage& fs, std::wstring const& wfile
, boost::function<bool(std::string)> p, boost::uint32_t flags = 0);
, boost::function<bool(std::string)> p, std::uint32_t flags = 0);
TORRENT_DEPRECATED
TORRENT_EXPORT void add_files(file_storage& fs, std::wstring const& wfile
, boost::uint32_t flags = 0);
, std::uint32_t flags = 0);
TORRENT_DEPRECATED
TORRENT_EXPORT void set_piece_hashes(create_torrent& t, std::wstring const& p

View File

@ -80,7 +80,7 @@ namespace libtorrent
struct wakeup_t
{
time_point timestamp;
boost::uint64_t context_switches;
std::uint64_t context_switches;
char const* operation;
};
extern std::deque<wakeup_t> _wakeups;

View File

@ -88,12 +88,12 @@ namespace libtorrent
void release_memory();
boost::uint32_t in_use() const
std::uint32_t in_use() const
{
std::unique_lock<std::mutex> l(m_pool_mutex);
return m_in_use;
}
boost::uint32_t num_to_evict(int num_needed = 0);
std::uint32_t num_to_evict(int num_needed = 0);
bool exceeded_max_size() const { return m_exceeded_max_size; }
void set_settings(aux::session_settings const& sett, error_code& ec);

View File

@ -87,7 +87,7 @@ namespace libtorrent
virtual void async_delete_files(piece_manager* storage, int options
, boost::function<void(disk_io_job const*)> const& handler) = 0;
virtual void async_set_file_priority(piece_manager* storage
, std::vector<boost::uint8_t> const& prio
, std::vector<std::uint8_t> const& prio
, boost::function<void(disk_io_job const*)> const& handler) = 0;
virtual void async_load_torrent(add_torrent_params* params
, boost::function<void(disk_io_job const*)> const& handler) = 0;

View File

@ -155,7 +155,7 @@ namespace libtorrent
char* disk_block;
char* string;
add_torrent_params const* check_resume_data;
std::vector<boost::uint8_t>* priorities;
std::vector<std::uint8_t>* priorities;
torrent_info* torrent_file;
int delete_options;
} buffer;
@ -200,27 +200,27 @@ namespace libtorrent
// job is still holding a reference to. The end of
// the range of blocks a hash jobs holds references
// to is always the last block in the piece.
boost::uint32_t offset;
std::uint32_t offset;
// number of bytes 'buffer' points to. Used for read & write
boost::uint16_t buffer_size;
std::uint16_t buffer_size;
} io;
} d;
// arguments used for read and write
// the piece this job applies to
boost::uint32_t piece:24;
std::uint32_t piece:24;
// the type of job this is
boost::uint32_t action:8;
std::uint32_t action:8;
enum { operation_failed = -1 };
// return value of operation
boost::int32_t ret;
std::int32_t ret;
// flags controlling this job
boost::uint8_t flags;
std::uint8_t flags;
#if TORRENT_USE_ASSERTS
bool in_use:1;

View File

@ -182,7 +182,7 @@ namespace libtorrent
// the number of bytes queued for writing, including bytes
// submitted to the OS for writing, but not yet complete
mutable boost::int64_t queued_bytes;
mutable std::int64_t queued_bytes;
// the number of 16 KiB blocks currently in the disk cache (both read and write).
// This includes both read and write cache.
@ -334,7 +334,7 @@ namespace libtorrent
, boost::function<void(disk_io_job const*)> const& handler
= boost::function<void(disk_io_job const*)>()) override;
void async_set_file_priority(piece_manager* storage
, std::vector<boost::uint8_t> const& prio
, std::vector<std::uint8_t> const& prio
, boost::function<void(disk_io_job const*)> const& handler) override;
void async_load_torrent(add_torrent_params* params
, boost::function<void(disk_io_job const*)> const& handler) override;
@ -528,7 +528,7 @@ namespace libtorrent
// used for asserts and only applies for fence jobs
flush_expect_clear = 8
};
void flush_cache(piece_manager* storage, boost::uint32_t flags, jobqueue_t& completed_jobs, std::unique_lock<std::mutex>& l);
void flush_cache(piece_manager* storage, std::uint32_t flags, jobqueue_t& completed_jobs, std::unique_lock<std::mutex>& l);
void flush_expired_write_blocks(jobqueue_t& completed_jobs, std::unique_lock<std::mutex>& l);
void flush_piece(cached_piece_entry* pe, int flags, jobqueue_t& completed_jobs, std::unique_lock<std::mutex>& l);

View File

@ -66,7 +66,7 @@ POSSIBILITY OF SUCH DAMAGE.
#include <list>
#include <string>
#include <stdexcept>
#include <boost/cstdint.hpp>
#include <cstdint>
#include <boost/config.hpp>
#if TORRENT_USE_IOSTREAM
#include <iosfwd>
@ -99,7 +99,7 @@ namespace libtorrent
typedef std::map<std::string, entry> dictionary_type;
typedef std::string string_type;
typedef std::list<entry> list_type;
typedef boost::int64_t integer_type;
typedef std::int64_t integer_type;
typedef std::vector<char> preformatted_type;
// the types an entry can have
@ -280,14 +280,14 @@ namespace libtorrent
// that the ABI is the same for debug builds and release builds. It
// appears to be very hard to match debug builds with debug versions of
// libtorrent
boost::uint8_t m_type:7;
std::uint8_t m_type:7;
public:
// in debug mode this is set to false by bdecode to indicate that the
// program has not yet queried the type of this entry, and should not
// assume that it has a certain type. This is asserted in the accessor
// functions. This does not apply if exceptions are used.
mutable boost::uint8_t m_type_queried:1;
mutable std::uint8_t m_type_queried:1;
};
namespace detail

View File

@ -514,11 +514,11 @@ namespace libtorrent
error_code ec;
// the file the error occurred on
boost::int32_t file:24;
std::int32_t file:24;
// A code from file_operation_t enum, indicating what
// kind of operation failed.
boost::uint32_t operation:8;
std::uint32_t operation:8;
enum file_operation_t {
none,

View File

@ -222,7 +222,7 @@ namespace libtorrent
// callbacks may still be called even if the corresponding feature is not
// specified in the return value here. See feature_flags_t for possible
// flags to return.
virtual boost::uint32_t implemented_features() { return 0; }
virtual std::uint32_t implemented_features() { return 0; }
// this is called by the session every time a new torrent is added.
// The ``torrent*`` points to the internal torrent object created

View File

@ -92,10 +92,10 @@ namespace libtorrent
struct file_status
{
boost::int64_t file_size;
boost::uint64_t atime;
boost::uint64_t mtime;
boost::uint64_t ctime;
std::int64_t file_size;
std::uint64_t atime;
std::uint64_t mtime;
std::uint64_t ctime;
enum {
#if defined TORRENT_WINDOWS
fifo = 0x1000, // named pipe (fifo)
@ -130,7 +130,7 @@ namespace libtorrent
TORRENT_EXTRA_EXPORT void remove(std::string const& f, error_code& ec);
TORRENT_EXTRA_EXPORT bool exists(std::string const& f, error_code& ec);
TORRENT_EXTRA_EXPORT bool exists(std::string const& f);
TORRENT_EXTRA_EXPORT boost::int64_t file_size(std::string const& f);
TORRENT_EXTRA_EXPORT std::int64_t file_size(std::string const& f);
TORRENT_EXTRA_EXPORT bool is_directory(std::string const& f
, error_code& ec);
TORRENT_EXTRA_EXPORT void recursive_copy(std::string const& old_path
@ -182,7 +182,7 @@ namespace libtorrent
~directory();
void next(error_code& ec);
std::string file() const;
boost::uint64_t inode() const;
std::uint64_t inode() const;
bool done() const { return m_done; }
private:
#ifdef TORRENT_WINDOWS
@ -311,25 +311,25 @@ namespace libtorrent
bool open(std::string const& p, int m, error_code& ec);
bool is_open() const;
void close();
bool set_size(boost::int64_t size, error_code& ec);
bool set_size(std::int64_t size, error_code& ec);
int open_mode() const { return m_open_mode; }
boost::int64_t writev(boost::int64_t file_offset, iovec_t const* bufs, int num_bufs
std::int64_t writev(std::int64_t file_offset, iovec_t const* bufs, int num_bufs
, error_code& ec, int flags = 0);
boost::int64_t readv(boost::int64_t file_offset, iovec_t const* bufs, int num_bufs
std::int64_t readv(std::int64_t file_offset, iovec_t const* bufs, int num_bufs
, error_code& ec, int flags = 0);
boost::int64_t get_size(error_code& ec) const;
std::int64_t get_size(error_code& ec) const;
// return the offset of the first byte that
// belongs to a data-region
boost::int64_t sparse_end(boost::int64_t start) const;
std::int64_t sparse_end(std::int64_t start) const;
handle_type native_handle() const { return m_file_handle; }
#ifdef TORRENT_DISK_STATS
boost::uint32_t file_id() const { return m_file_id; }
std::uint32_t file_id() const { return m_file_id; }
#endif
#ifdef TORRENT_DEBUG_FILE_LEAKS
@ -340,7 +340,7 @@ namespace libtorrent
handle_type m_file_handle;
#ifdef TORRENT_DISK_STATS
boost::uint32_t m_file_id;
std::uint32_t m_file_id;
#endif
int m_open_mode;

View File

@ -40,7 +40,7 @@ POSSIBILITY OF SUCH DAMAGE.
#include <unordered_set>
#include <ctime>
#include <boost/cstdint.hpp>
#include <cstdint>
#include <boost/unordered_set.hpp>
#include "libtorrent/aux_/disable_warnings_pop.hpp"
@ -75,12 +75,12 @@ namespace libtorrent
std::string symlink_path;
// the offset of this file inside the torrent
boost::int64_t offset;
std::int64_t offset;
// the size of the file (in bytes) and ``offset`` is the byte offset
// of the file within the torrent. i.e. the sum of all the sizes of the files
// before it in the list.
boost::int64_t size;
std::int64_t size;
// the offset in the file where the storage should start. The normal
// case is to have this set to 0, so that the storage starts saving data at the start
@ -88,7 +88,7 @@ namespace libtorrent
// the ``file_base`` should be set to an offset so that the different regions do
// not overlap. This is used when mapping "unselected" files into a so-called part
// file.
boost::int64_t file_base;
std::int64_t file_base;
// the modification time of this file specified in posix time.
std::time_t mtime;
@ -157,29 +157,29 @@ namespace libtorrent
};
// the offset of this file inside the torrent
boost::uint64_t offset:48;
std::uint64_t offset:48;
// index into file_storage::m_symlinks or not_a_symlink
// if this is not a symlink
boost::uint64_t symlink_index:15;
std::uint64_t symlink_index:15;
// if this is true, don't include m_name as part of the
// path to this file
boost::uint64_t no_root_dir:1;
std::uint64_t no_root_dir:1;
// the size of this file
boost::uint64_t size:48;
std::uint64_t size:48;
// the number of characters in the name. If this is
// name_is_owned, name is null terminated and owned by this object
// (i.e. it should be freed in the destructor). If
// the len is not name_is_owned, the name pointer doesn not belong
// to this object, and it's not null terminated
boost::uint64_t name_len:12;
boost::uint64_t pad_file:1;
boost::uint64_t hidden_attribute:1;
boost::uint64_t executable_attribute:1;
boost::uint64_t symlink_attribute:1;
std::uint64_t name_len:12;
std::uint64_t pad_file:1;
std::uint64_t hidden_attribute:1;
std::uint64_t executable_attribute:1;
std::uint64_t symlink_attribute:1;
// make it available for logging
private:
@ -213,10 +213,10 @@ namespace libtorrent
int file_index;
// the offset from the start of the file, in bytes
boost::int64_t offset;
std::int64_t offset;
// the size of the window, in bytes
boost::int64_t size;
std::int64_t size;
};
// The ``file_storage`` class represents a file list and the piece
@ -302,10 +302,10 @@ namespace libtorrent
// This shared path element is also set to the name of the torrent. It
// can be changed by calling ``set_name``.
void add_file_borrow(char const* filename, int filename_len
, std::string const& path, boost::int64_t file_size
, boost::uint32_t file_flags = 0, char const* filehash = 0
, boost::int64_t mtime = 0, std::string const& symlink_path = "");
void add_file(std::string const& path, boost::int64_t file_size, int file_flags = 0
, std::string const& path, std::int64_t file_size
, std::uint32_t file_flags = 0, char const* filehash = 0
, std::int64_t mtime = 0, std::string const& symlink_path = "");
void add_file(std::string const& path, std::int64_t file_size, int file_flags = 0
, std::time_t mtime = 0, std::string const& symlink_path = "");
// renames the file at ``index`` to ``new_filename``. Keep in mind
@ -321,7 +321,7 @@ namespace libtorrent
// instead, use the wchar -> utf8 conversion functions
// and pass in utf8 strings
TORRENT_DEPRECATED
void add_file(std::wstring const& p, boost::int64_t size, int flags = 0
void add_file(std::wstring const& p, std::int64_t size, int flags = 0
, std::time_t mtime = 0, std::string const& s_p = "");
TORRENT_DEPRECATED
void rename_file(int index, std::wstring const& new_filename);
@ -342,7 +342,7 @@ namespace libtorrent
// ``piece`` * piece_size + ``offset`` + ``size``
//
// may not exceed the total size of the torrent.
std::vector<file_slice> map_block(int piece, boost::int64_t offset
std::vector<file_slice> map_block(int piece, std::int64_t offset
, int size) const;
// returns a peer_request representing the piece index, byte offset
@ -351,7 +351,7 @@ namespace libtorrent
// is meant to hold bittorrent block requests, which may not be larger
// than 16 kiB. Mapping a range larger than that may return an overflown
// integer.
peer_request map_file(int file, boost::int64_t offset, int size) const;
peer_request map_file(int file, std::int64_t offset, int size) const;
#ifndef TORRENT_NO_DEPRECATE
// all functions depending on internal_file_entry
@ -361,7 +361,7 @@ namespace libtorrent
typedef std::vector<internal_file_entry>::const_reverse_iterator reverse_iterator;
TORRENT_DEPRECATED
iterator file_at_offset(boost::int64_t offset) const;
iterator file_at_offset(std::int64_t offset) const;
TORRENT_DEPRECATED
iterator begin() const { return m_files.begin(); }
TORRENT_DEPRECATED
@ -389,7 +389,7 @@ namespace libtorrent
iterator end_deprecated() const { return m_files.end(); }
reverse_iterator rbegin_deprecated() const { return m_files.rbegin(); }
reverse_iterator rend_deprecated() const { return m_files.rend(); }
iterator file_at_offset_deprecated(boost::int64_t offset) const;
iterator file_at_offset_deprecated(std::int64_t offset) const;
file_entry at_deprecated(int index) const;
#endif // TORRENT_NO_DEPRECATE
@ -398,7 +398,7 @@ namespace libtorrent
{ return int(m_files.size()); }
// returns the total number of bytes all the files in this torrent spans
boost::int64_t total_size() const { return m_total_size; }
std::int64_t total_size() const { return m_total_size; }
// set and get the number of pieces in the torrent
void set_num_pieces(int n) { m_num_pieces = n; }
@ -486,12 +486,12 @@ namespace libtorrent
time_t mtime(int index) const;
std::string file_path(int index, std::string const& save_path = "") const;
std::string file_name(int index) const;
boost::int64_t file_size(int index) const;
std::int64_t file_size(int index) const;
bool pad_file_at(int index) const;
boost::int64_t file_offset(int index) const;
std::int64_t file_offset(int index) const;
// returns the crc32 hash of file_path(index)
boost::uint32_t file_path_hash(int index, std::string const& save_path) const;
std::uint32_t file_path_hash(int index, std::string const& save_path) const;
// this will add the CRC32 hash of all directory entries to the table. No
// filename will be included, just directories. Every depth of directories
@ -499,7 +499,7 @@ namespace libtorrent
// levels. i.e. if one path in the torrent is ``foo/bar/baz``, the CRC32
// hashes for ``foo``, ``foo/bar`` and ``foo/bar/baz`` will be added to
// the set.
void all_path_hashes(std::unordered_set<boost::uint32_t>& table) const;
void all_path_hashes(std::unordered_set<std::uint32_t>& table) const;
// flags indicating various attributes for files in
// a file_storage.
@ -537,7 +537,7 @@ namespace libtorrent
bool file_absolute_path(int index) const;
// returns the index of the file at the given offset in the torrent
int file_index_at_offset(boost::int64_t offset) const;
int file_index_at_offset(std::int64_t offset) const;
// low-level function. returns a pointer to the internal storage for
// the filename. This string may not be null terminated!
@ -547,11 +547,11 @@ namespace libtorrent
#ifndef TORRENT_NO_DEPRECATE
// deprecated in 1.1
boost::int64_t file_base_deprecated(int index) const;
std::int64_t file_base_deprecated(int index) const;
TORRENT_DEPRECATED
boost::int64_t file_base(int index) const;
std::int64_t file_base(int index) const;
TORRENT_DEPRECATED
void set_file_base(int index, boost::int64_t off);
void set_file_base(int index, std::int64_t off);
// these were deprecated in 1.0. Use the versions that take an index instead
TORRENT_DEPRECATED
@ -563,19 +563,19 @@ namespace libtorrent
TORRENT_DEPRECATED
int file_index(internal_file_entry const& fe) const;
TORRENT_DEPRECATED
boost::int64_t file_base(internal_file_entry const& fe) const;
std::int64_t file_base(internal_file_entry const& fe) const;
TORRENT_DEPRECATED
void set_file_base(internal_file_entry const& fe, boost::int64_t off);
void set_file_base(internal_file_entry const& fe, std::int64_t off);
TORRENT_DEPRECATED
std::string file_path(internal_file_entry const& fe, std::string const& save_path = "") const;
TORRENT_DEPRECATED
std::string file_name(internal_file_entry const& fe) const;
TORRENT_DEPRECATED
boost::int64_t file_size(internal_file_entry const& fe) const;
std::int64_t file_size(internal_file_entry const& fe) const;
TORRENT_DEPRECATED
bool pad_file_at(internal_file_entry const& fe) const;
TORRENT_DEPRECATED
boost::int64_t file_offset(internal_file_entry const& fe) const;
std::int64_t file_offset(internal_file_entry const& fe) const;
#endif
// if the backing buffer changed for this storage, this is the pointer
@ -586,7 +586,7 @@ namespace libtorrent
void add_pad_file(int size
, std::vector<internal_file_entry>::iterator& i
, boost::int64_t& offset
, std::int64_t& offset
, int& pad_file_counter);
// the number of bytes in a regular piece
@ -629,7 +629,7 @@ namespace libtorrent
// if any file has a non-zero file base (i.e. multiple
// files residing in the same physical file at different
// offsets)
std::vector<boost::int64_t> m_file_base;
std::vector<std::int64_t> m_file_base;
#endif
// all unique paths files have. The internal_file_entry::path_index
@ -644,7 +644,7 @@ namespace libtorrent
std::string m_name;
// the sum of all file sizes
boost::int64_t m_total_size;
std::int64_t m_total_size;
// the number of files. This is used when
// the torrent is unloaded

View File

@ -39,7 +39,7 @@ POSSIBILITY OF SUCH DAMAGE.
#include "libtorrent/aux_/disable_warnings_push.hpp"
#include <boost/cstdint.hpp>
#include <cstdint>
#include "libtorrent/aux_/disable_warnings_pop.hpp"

View File

@ -37,7 +37,7 @@ POSSIBILITY OF SUCH DAMAGE.
#include "libtorrent/aux_/disable_warnings_push.hpp"
#include <boost/cstdint.hpp>
#include <cstdint>
#include <boost/utility/enable_if.hpp>
#include <boost/type_traits/is_base_of.hpp>

View File

@ -222,7 +222,7 @@ private:
// used for DNS lookups
int m_resolve_flags;
boost::uint16_t m_port;
std::uint16_t m_port;
// bottled means that the handler is called once, when
// everything is received (and buffered in memory).

View File

@ -40,7 +40,7 @@ POSSIBILITY OF SUCH DAMAGE.
#include "libtorrent/aux_/disable_warnings_push.hpp"
#include <boost/cstdint.hpp>
#include <cstdint>
#include <boost/tuple/tuple.hpp>
#include "libtorrent/aux_/disable_warnings_pop.hpp"
@ -86,8 +86,8 @@ namespace libtorrent
boost::tuple<int, int> incoming(buffer::const_interval recv_buffer
, bool& error);
int body_start() const { return m_body_start_pos; }
boost::int64_t content_length() const { return m_content_length; }
std::pair<boost::int64_t, boost::int64_t> content_range() const
std::int64_t content_length() const { return m_content_length; }
std::pair<std::int64_t, std::int64_t> content_range() const
{ return std::make_pair(m_range_start, m_range_end); }
// returns true if this response is using chunked encoding.
@ -117,7 +117,7 @@ namespace libtorrent
// size may still have been modified, but their values are
// undefined
bool parse_chunk_header(buffer::const_interval buf
, boost::int64_t* chunk_size, int* header_size);
, std::int64_t* chunk_size, int* header_size);
// reset the whole state and start over
void reset();
@ -125,29 +125,29 @@ namespace libtorrent
bool connection_close() const { return m_connection_close; }
std::multimap<std::string, std::string> const& headers() const { return m_header; }
std::vector<std::pair<boost::int64_t, boost::int64_t> > const& chunks() const { return m_chunked_ranges; }
std::vector<std::pair<std::int64_t, std::int64_t> > const& chunks() const { return m_chunked_ranges; }
private:
boost::int64_t m_recv_pos;
std::int64_t m_recv_pos;
std::string m_method;
std::string m_path;
std::string m_protocol;
std::string m_server_message;
boost::int64_t m_content_length;
boost::int64_t m_range_start;
boost::int64_t m_range_end;
std::int64_t m_content_length;
std::int64_t m_range_start;
std::int64_t m_range_end;
std::multimap<std::string, std::string> m_header;
buffer::const_interval m_recv_buffer;
// contains offsets of the first and one-past-end of
// each chunked range in the response
std::vector<std::pair<boost::int64_t, boost::int64_t> > m_chunked_ranges;
std::vector<std::pair<std::int64_t, std::int64_t> > m_chunked_ranges;
// while reading a chunk, this is the offset where the
// current chunk will end (it refers to the first character
// in the chunk tail header or the next chunk header)
boost::int64_t m_cur_chunk_end;
std::int64_t m_cur_chunk_end;
int m_status_code;

View File

@ -47,7 +47,7 @@ POSSIBILITY OF SUCH DAMAGE.
#include <boost/noncopyable.hpp>
#include <array>
#include <boost/optional.hpp>
#include <boost/cstdint.hpp>
#include <cstdint>
#include "libtorrent/aux_/disable_warnings_pop.hpp"
@ -112,7 +112,7 @@ namespace libtorrent
// the number of bytes left to receive of the response we're
// currently parsing
boost::int64_t m_response_left;
std::int64_t m_response_left;
// this is the offset inside the current receive
// buffer where the next chunk header will be.
@ -120,7 +120,7 @@ namespace libtorrent
// parsed. It does not necessarily point to a valid
// offset in the receive buffer, if we haven't received
// it yet. This offset never includes the HTTP header
boost::int64_t m_chunk_pos;
std::int64_t m_chunk_pos;
// this is the number of bytes we've already received
// from the next chunk header we're waiting for

View File

@ -34,7 +34,7 @@ POSSIBILITY OF SUCH DAMAGE.
#define TORRENT_IO_HPP_INCLUDED
#include "libtorrent/aux_/disable_warnings_push.hpp"
#include <boost/cstdint.hpp>
#include <cstdint>
#include "libtorrent/aux_/disable_warnings_pop.hpp"
#include <string>
@ -57,22 +57,22 @@ namespace libtorrent
for (int i = 0; i < int(sizeof(T)); ++i)
{
ret <<= 8;
ret |= static_cast<boost::uint8_t>(*start);
ret |= static_cast<std::uint8_t>(*start);
++start;
}
return ret;
}
template <class InIt>
boost::uint8_t read_impl(InIt& start, type<boost::uint8_t>)
std::uint8_t read_impl(InIt& start, type<std::uint8_t>)
{
return static_cast<boost::uint8_t>(*start++);
return static_cast<std::uint8_t>(*start++);
}
template <class InIt>
boost::int8_t read_impl(InIt& start, type<boost::int8_t>)
std::int8_t read_impl(InIt& start, type<std::int8_t>)
{
return static_cast<boost::int8_t>(*start++);
return static_cast<std::int8_t>(*start++);
}
template <class T, class OutIt>
@ -88,68 +88,68 @@ namespace libtorrent
// -- adaptors
template <class InIt>
boost::int64_t read_int64(InIt& start)
{ return read_impl(start, type<boost::int64_t>()); }
std::int64_t read_int64(InIt& start)
{ return read_impl(start, type<std::int64_t>()); }
template <class InIt>
boost::uint64_t read_uint64(InIt& start)
{ return read_impl(start, type<boost::uint64_t>()); }
std::uint64_t read_uint64(InIt& start)
{ return read_impl(start, type<std::uint64_t>()); }
template <class InIt>
boost::uint32_t read_uint32(InIt& start)
{ return read_impl(start, type<boost::uint32_t>()); }
std::uint32_t read_uint32(InIt& start)
{ return read_impl(start, type<std::uint32_t>()); }
template <class InIt>
boost::int32_t read_int32(InIt& start)
{ return read_impl(start, type<boost::int32_t>()); }
std::int32_t read_int32(InIt& start)
{ return read_impl(start, type<std::int32_t>()); }
template <class InIt>
boost::int16_t read_int16(InIt& start)
{ return read_impl(start, type<boost::int16_t>()); }
std::int16_t read_int16(InIt& start)
{ return read_impl(start, type<std::int16_t>()); }
template <class InIt>
boost::uint16_t read_uint16(InIt& start)
{ return read_impl(start, type<boost::uint16_t>()); }
std::uint16_t read_uint16(InIt& start)
{ return read_impl(start, type<std::uint16_t>()); }
template <class InIt>
boost::int8_t read_int8(InIt& start)
{ return read_impl(start, type<boost::int8_t>()); }
std::int8_t read_int8(InIt& start)
{ return read_impl(start, type<std::int8_t>()); }
template <class InIt>
boost::uint8_t read_uint8(InIt& start)
{ return read_impl(start, type<boost::uint8_t>()); }
std::uint8_t read_uint8(InIt& start)
{ return read_impl(start, type<std::uint8_t>()); }
template <class OutIt>
void write_uint64(boost::uint64_t val, OutIt& start)
void write_uint64(std::uint64_t val, OutIt& start)
{ write_impl(val, start); }
template <class OutIt>
void write_int64(boost::int64_t val, OutIt& start)
void write_int64(std::int64_t val, OutIt& start)
{ write_impl(val, start); }
template <class OutIt>
void write_uint32(boost::uint32_t val, OutIt& start)
void write_uint32(std::uint32_t val, OutIt& start)
{ write_impl(val, start); }
template <class OutIt>
void write_int32(boost::int32_t val, OutIt& start)
void write_int32(std::int32_t val, OutIt& start)
{ write_impl(val, start); }
template <class OutIt>
void write_uint16(boost::uint16_t val, OutIt& start)
void write_uint16(std::uint16_t val, OutIt& start)
{ write_impl(val, start); }
template <class OutIt>
void write_int16(boost::int16_t val, OutIt& start)
void write_int16(std::int16_t val, OutIt& start)
{ write_impl(val, start); }
template <class OutIt>
void write_uint8(boost::uint8_t val, OutIt& start)
void write_uint8(std::uint8_t val, OutIt& start)
{ write_impl(val, start); }
template <class OutIt>
void write_int8(boost::int8_t val, OutIt& start)
void write_int8(std::int8_t val, OutIt& start)
{ write_impl(val, start); }
inline int write_string(std::string const& str, char*& start)

View File

@ -42,7 +42,7 @@ POSSIBILITY OF SUCH DAMAGE.
#include <boost/limits.hpp>
#include <boost/utility.hpp>
#include <boost/cstdint.hpp>
#include <cstdint>
#include <boost/tuple/tuple.hpp>
#include "libtorrent/aux_/disable_warnings_pop.hpp"
@ -65,7 +65,7 @@ struct ip_range
{
Addr first;
Addr last;
boost::uint32_t flags;
std::uint32_t flags;
};
namespace detail
@ -80,7 +80,7 @@ namespace detail
}
template<>
inline boost::uint16_t zero<boost::uint16_t>() { return 0; }
inline std::uint16_t zero<std::uint16_t>() { return 0; }
template<class Addr>
Addr plus_one(Addr const& a)
@ -98,7 +98,7 @@ namespace detail
return tmp;
}
inline boost::uint16_t plus_one(boost::uint16_t val) { return val + 1; }
inline std::uint16_t plus_one(std::uint16_t val) { return val + 1; }
template<class Addr>
Addr minus_one(Addr const& a)
@ -116,7 +116,7 @@ namespace detail
return tmp;
}
inline boost::uint16_t minus_one(boost::uint16_t val) { return val - 1; }
inline std::uint16_t minus_one(std::uint16_t val) { return val - 1; }
template<class Addr>
Addr max_addr()
@ -128,8 +128,8 @@ namespace detail
}
template<>
inline boost::uint16_t max_addr<boost::uint16_t>()
{ return (std::numeric_limits<boost::uint16_t>::max)(); }
inline std::uint16_t max_addr<std::uint16_t>()
{ return (std::numeric_limits<std::uint16_t>::max)(); }
// this is the generic implementation of
// a filter for a specific address type.
@ -158,8 +158,8 @@ namespace detail
TORRENT_ASSERT(j != m_access_list.begin());
TORRENT_ASSERT(j != i);
boost::uint32_t first_access = i->access;
boost::uint32_t last_access = boost::prior(j)->access;
std::uint32_t first_access = i->access;
std::uint32_t last_access = boost::prior(j)->access;
if (i->start != first && first_access != flags)
{
@ -179,7 +179,7 @@ namespace detail
// we can do this const-cast because we know that the new
// start address will keep the set correctly ordered
const_cast<Addr&>(i->start) = first;
const_cast<boost::uint32_t&>(i->access) = flags;
const_cast<std::uint32_t&>(i->access) = flags;
}
else if (first_access != flags)
{
@ -200,7 +200,7 @@ namespace detail
TORRENT_ASSERT(!m_access_list.empty());
}
boost::uint32_t access(Addr const& addr) const
std::uint32_t access(Addr const& addr) const
{
TORRENT_ASSERT(!m_access_list.empty());
typename range_t::const_iterator i = m_access_list.upper_bound(addr);
@ -247,7 +247,7 @@ namespace detail
Addr start;
// the end of the range is implicit
// and given by the next entry in the set
boost::uint32_t access;
std::uint32_t access;
};
typedef std::set<range> range_t;
@ -287,7 +287,7 @@ struct TORRENT_EXPORT ip_filter
//
// This means that in a case of overlapping ranges, the last one applied takes
// precedence.
void add_rule(address first, address last, boost::uint32_t flags);
void add_rule(address first, address last, std::uint32_t flags);
// Returns the access permissions for the given address (``addr``). The permission
// can currently be 0 or ``ip_filter::blocked``. The complexity of this operation
@ -340,16 +340,16 @@ public:
// set the flags for the specified port range (``first``, ``last``) to
// ``flags`` overwriting any existing rule for those ports. The range
// is inclusive, i.e. the port ``last`` also has the flag set on it.
void add_rule(boost::uint16_t first, boost::uint16_t last, boost::uint32_t flags);
void add_rule(std::uint16_t first, std::uint16_t last, std::uint32_t flags);
// test the specified port (``port``) for whether it is blocked
// or not. The returned value is the flags set for this port.
// see acces_flags.
int access(boost::uint16_t port) const;
int access(std::uint16_t port) const;
private:
detail::filter_impl<boost::uint16_t> m_filter;
detail::filter_impl<std::uint16_t> m_filter;
};

View File

@ -76,9 +76,9 @@ namespace libtorrent
// this is the actual external address
address addr;
// a bitmask of sources the reporters have come from
boost::uint16_t sources;
std::uint16_t sources;
// the total number of votes for this IP
boost::uint16_t num_votes;
std::uint16_t num_votes;
};
// this is a bloom filter of all the IPs that have

View File

@ -57,10 +57,10 @@ namespace dht
// This structure hold the relevant counters for the storage
struct TORRENT_EXPORT dht_storage_counters
{
boost::int32_t torrents;
boost::int32_t peers;
boost::int32_t immutable_data;
boost::int32_t mutable_data;
std::int32_t torrents;
std::int32_t peers;
std::int32_t immutable_data;
std::int32_t mutable_data;
// This member function set the counters to zero.
void reset();
@ -173,7 +173,7 @@ namespace dht
// inside the out parameter seq.
//
virtual bool get_mutable_item_seq(sha1_hash const& target
, boost::int64_t& seq) const = 0;
, std::int64_t& seq) const = 0;
// This function retrieves the mutable stored in the DHT.
//
@ -189,7 +189,7 @@ namespace dht
// inside the (entry) out parameter item.
//
virtual bool get_mutable_item(sha1_hash const& target
, boost::int64_t seq, bool force_fill
, std::int64_t seq, bool force_fill
, entry& item) const = 0;
// Store the item's data. This layer is only for storage.
@ -203,7 +203,7 @@ namespace dht
virtual void put_mutable_item(sha1_hash const& target
, char const* buf, int size
, char const* sig
, boost::int64_t seq
, std::int64_t seq
, char const* pk
, char const* salt, int salt_size
, address const& addr) = 0;

View File

@ -47,7 +47,7 @@ public:
void got_data(bdecode_node const& v,
char const* pk,
boost::uint64_t seq,
std::uint64_t seq,
char const* sig);
// for immutable itms

View File

@ -54,7 +54,7 @@ sha1_hash TORRENT_EXTRA_EXPORT item_target_id(std::pair<char const*, int> salt
bool TORRENT_EXTRA_EXPORT verify_mutable_item(
std::pair<char const*, int> v
, std::pair<char const*, int> salt
, boost::uint64_t seq
, std::uint64_t seq
, char const* pk
, char const* sig);
@ -70,7 +70,7 @@ bool TORRENT_EXTRA_EXPORT verify_mutable_item(
void TORRENT_EXPORT sign_mutable_item(
std::pair<char const*, int> v
, std::pair<char const*, int> salt
, boost::uint64_t seq
, std::uint64_t seq
, char const* pk
, char const* sk
, char* sig);
@ -90,7 +90,7 @@ public:
item(entry const& v) { assign(v); }
item(entry const& v
, std::pair<char const*, int> salt
, boost::uint64_t seq, char const* pk, char const* sk);
, std::uint64_t seq, char const* pk, char const* sk);
item(bdecode_node const& v) { assign(v); }
void assign(entry const& v)
@ -99,15 +99,15 @@ public:
, 0), 0, NULL, NULL);
}
void assign(entry const& v, std::pair<char const*, int> salt
, boost::uint64_t seq, char const* pk, char const* sk);
, std::uint64_t seq, char const* pk, char const* sk);
void assign(bdecode_node const& v)
{
assign(v, std::pair<char const*, int>(static_cast<char const*>(NULL)
, 0), 0, NULL, NULL);
}
bool assign(bdecode_node const& v, std::pair<char const*, int> salt
, boost::uint64_t seq, char const* pk, char const* sig);
void assign(entry const& v, std::string salt, boost::uint64_t seq
, std::uint64_t seq, char const* pk, char const* sig);
void assign(entry const& v, std::string salt, std::uint64_t seq
, char const* pk, char const* sig);
void clear() { m_value = entry(); }
@ -120,7 +120,7 @@ public:
{ return m_pk; }
std::array<char, item_sig_len> const& sig() const
{ return m_sig; }
boost::uint64_t seq() const { return m_seq; }
std::uint64_t seq() const { return m_seq; }
std::string const& salt() const { return m_salt; }
private:
@ -128,7 +128,7 @@ private:
std::string m_salt;
std::array<char, item_pk_len> m_pk;
std::array<char, item_sig_len> m_sig;
boost::uint64_t m_seq;
std::uint64_t m_seq;
bool m_mutable;
};

View File

@ -54,7 +54,7 @@ POSSIBILITY OF SUCH DAMAGE.
#include <libtorrent/assert.hpp>
#include <libtorrent/bloom_filter.hpp>
#include <boost/cstdint.hpp>
#include <cstdint>
#include <boost/ref.hpp>
#include "libtorrent/socket.hpp"
@ -127,7 +127,7 @@ public:
node_id const& nid() const { return m_id; }
boost::tuple<int, int, int> size() const { return m_table.size(); }
boost::int64_t num_global_nodes() const
std::int64_t num_global_nodes() const
{ return m_table.num_global_nodes(); }
#ifndef TORRENT_NO_DEPRECATE

View File

@ -72,11 +72,11 @@ struct TORRENT_EXTRA_EXPORT node_entry
union_endpoint endpoint;
// the average RTT of this node
boost::uint16_t rtt;
std::uint16_t rtt;
// the number of times this node has failed to
// respond in a row
boost::uint8_t timeout_count;
std::uint8_t timeout_count;
};
} } // namespace libtorrent::dht

View File

@ -36,7 +36,7 @@ POSSIBILITY OF SUCH DAMAGE.
#include <vector>
#include "libtorrent/aux_/disable_warnings_push.hpp"
#include <boost/cstdint.hpp>
#include <cstdint>
#include "libtorrent/aux_/disable_warnings_pop.hpp"
#include "libtorrent/config.hpp"
@ -71,7 +71,7 @@ node_id TORRENT_EXTRA_EXPORT generate_random_id();
void TORRENT_EXTRA_EXPORT make_id_secret(node_id& in);
node_id TORRENT_EXTRA_EXPORT generate_secret_id();
bool TORRENT_EXTRA_EXPORT verify_secret_id(node_id const& nid);
node_id TORRENT_EXTRA_EXPORT generate_id_impl(address const& ip_, boost::uint32_t r);
node_id TORRENT_EXTRA_EXPORT generate_id_impl(address const& ip_, std::uint32_t r);
bool TORRENT_EXTRA_EXPORT verify_id(node_id const& nid, address const& source_ip);
bool TORRENT_EXTRA_EXPORT matching_prefix(node_entry const& n, int mask, int prefix, int bucket_index);

View File

@ -41,7 +41,7 @@ POSSIBILITY OF SUCH DAMAGE.
#include <boost/pool/pool.hpp>
#include <boost/detail/atomic_count.hpp>
#include <boost/intrusive_ptr.hpp>
#include <boost/cstdint.hpp>
#include <cstdint>
#include "libtorrent/aux_/disable_warnings_pop.hpp"
@ -117,10 +117,10 @@ struct TORRENT_EXTRA_EXPORT observer : boost::noncopyable
void set_id(node_id const& id);
node_id const& id() const { return m_id; }
void set_transaction_id(boost::uint16_t tid)
void set_transaction_id(std::uint16_t tid)
{ m_transaction_id = tid; }
boost::uint16_t transaction_id() const
std::uint16_t transaction_id() const
{ return m_transaction_id; }
enum {
@ -155,12 +155,12 @@ private:
} m_addr;
// reference counter for intrusive_ptr
mutable boost::uint16_t m_refs;
mutable std::uint16_t m_refs;
boost::uint16_t m_port;
std::uint16_t m_port;
// the transaction ID for this call
boost::uint16_t m_transaction_id;
std::uint16_t m_transaction_id;
public:
unsigned char flags;

View File

@ -38,7 +38,7 @@ POSSIBILITY OF SUCH DAMAGE.
#include <vector>
#include <set>
#include <boost/cstdint.hpp>
#include <cstdint>
#include <boost/utility.hpp>
#include <boost/tuple/tuple.hpp>
#include <array>
@ -221,7 +221,7 @@ public:
// been pinged and confirmed up
boost::tuple<int, int, int> size() const;
boost::int64_t num_global_nodes() const;
std::int64_t num_global_nodes() const;
// the number of bits down we have full buckets
// i.e. essentially the number of full buckets

View File

@ -37,7 +37,7 @@ POSSIBILITY OF SUCH DAMAGE.
#include <unordered_map>
#include <boost/cstdint.hpp>
#include <cstdint>
#include <boost/pool/pool.hpp>
#include <boost/function/function3.hpp>
@ -105,7 +105,7 @@ public:
private:
boost::uint32_t calc_connection_id(udp::endpoint addr);
std::uint32_t calc_connection_id(udp::endpoint addr);
mutable boost::pool<> m_pool_allocator;
@ -118,8 +118,8 @@ private:
routing_table& m_table;
time_point m_timer;
node_id m_our_id;
boost::uint32_t m_allocated_observers:31;
boost::uint32_t m_destructing:1;
std::uint32_t m_allocated_observers:31;
std::uint32_t m_destructing:1;
};
} } // namespace libtorrent::dht

View File

@ -116,16 +116,16 @@ protected:
node& m_node;
std::vector<observer_ptr> m_results;
node_id const m_target;
boost::uint16_t m_ref_count;
boost::uint16_t m_invoke_count;
boost::uint16_t m_branch_factor;
boost::uint16_t m_responses;
boost::uint16_t m_timeouts;
std::uint16_t m_ref_count;
std::uint16_t m_invoke_count;
std::uint16_t m_branch_factor;
std::uint16_t m_responses;
std::uint16_t m_timeouts;
// the IP addresses of the nodes in m_results
std::set<boost::uint32_t> m_peer4_prefixes;
std::set<std::uint32_t> m_peer4_prefixes;
#if TORRENT_USE_IPV6
std::set<boost::uint64_t> m_peer6_prefixes;
std::set<std::uint64_t> m_peer6_prefixes;
#endif
};

View File

@ -167,7 +167,7 @@ namespace libtorrent
}
// requires the type to be an integer. return the integer value
boost::int64_t int_value() const;
std::int64_t int_value() const;
// internal
void construct_string(char const* start, int length);
@ -244,8 +244,8 @@ namespace libtorrent
// if this is a dictionary, look for a key ``name`` whose value
// is an int. If such key exist, return a pointer to its value,
// otherwise NULL.
boost::int64_t dict_find_int_value(char const* name
, boost::int64_t default_val = 0) const;
std::int64_t dict_find_int_value(char const* name
, std::int64_t default_val = 0) const;
lazy_entry const* dict_find_int(char const* name) const;
// these functions require that ``this`` is a dictionary.
@ -306,7 +306,7 @@ namespace libtorrent
// (this->type() == list_t). returns the integer value at
// index ``i``. If the element at ``i`` is not an integer
// ``default_val`` is returned, which defaults to 0.
boost::int64_t list_int_value_at(int i, boost::int64_t default_val = 0) const;
std::int64_t list_int_value_at(int i, std::int64_t default_val = 0) const;
// if this is a list, return the number of items in it.
int list_size() const
@ -347,7 +347,7 @@ namespace libtorrent
void swap(lazy_entry& e)
{
using std::swap;
boost::uint32_t tmp = e.m_type;
std::uint32_t tmp = e.m_type;
e.m_type = m_type;
m_type = tmp;
tmp = e.m_size;
@ -378,12 +378,12 @@ namespace libtorrent
// the number of bytes this entry extends in the
// bencoded buffer
boost::uint32_t m_len;
std::uint32_t m_len;
// if list or dictionary, the number of items
boost::uint32_t m_size:29;
std::uint32_t m_size:29;
// element type (dict, list, int, string)
boost::uint32_t m_type:3;
std::uint32_t m_type:3;
// non-copyable
lazy_entry(lazy_entry const&);
@ -404,7 +404,7 @@ namespace libtorrent
// defined in bdecode.cpp
TORRENT_EXTRA_EXPORT char const* parse_int(char const* start
, char const* end, char delimiter, boost::int64_t& val
, char const* end, char delimiter, std::int64_t& val
, bdecode_errors::error_code_enum& ec);
}

View File

@ -34,7 +34,7 @@ POSSIBILITY OF SUCH DAMAGE.
#define TORRENT_PACKET_BUFFER_HPP_INCLUDED
#include "libtorrent/config.hpp"
#include <boost/cstdint.hpp>
#include <cstdint>
#include <cstddef>
namespace libtorrent
@ -69,7 +69,7 @@ namespace libtorrent
class TORRENT_EXTRA_EXPORT packet_buffer_impl
{
public:
typedef boost::uint32_t index_type;
typedef std::uint32_t index_type;
packet_buffer_impl();
~packet_buffer_impl();

View File

@ -36,7 +36,7 @@ POSSIBILITY OF SUCH DAMAGE.
#include <vector>
#include <mutex>
#include <boost/unordered_map.hpp>
#include <boost/cstdint.hpp>
#include <cstdint>
#include "libtorrent/aux_/disable_warnings_pop.hpp"
@ -62,8 +62,8 @@ namespace libtorrent
void move_partfile(std::string const& path, error_code& ec);
void import_file(file& f, boost::int64_t offset, boost::int64_t size, error_code& ec);
void export_file(file& f, boost::int64_t offset, boost::int64_t size, error_code& ec);
void import_file(file& f, std::int64_t offset, std::int64_t size, error_code& ec);
void export_file(file& f, std::int64_t offset, std::int64_t size, error_code& ec);
// flush the metadata
void flush_metadata(error_code& ec);

View File

@ -78,7 +78,7 @@ namespace libtorrent
// read remote_pubkey, generate and store shared secret in
// m_dh_shared_secret.
void compute_secret(boost::uint8_t const* remote_pubkey);
void compute_secret(std::uint8_t const* remote_pubkey);
void compute_secret(key_t const& remote_pubkey);
key_t const& get_secret() const { return m_dh_shared_secret; }

View File

@ -45,7 +45,7 @@ namespace libtorrent
{
std::string hostname;
peer_id pid;
boost::uint16_t port;
std::uint16_t port;
bool operator==(const peer_entry& p) const
{ return pid == p.pid; }
@ -57,14 +57,14 @@ namespace libtorrent
struct ipv4_peer_entry
{
address_v4::bytes_type ip;
boost::uint16_t port;
std::uint16_t port;
};
#if TORRENT_USE_IPV6
struct ipv6_peer_entry
{
address_v6::bytes_type ip;
boost::uint16_t port;
std::uint16_t port;
};
#endif

View File

@ -41,13 +41,13 @@ POSSIBILITY OF SUCH DAMAGE.
#include <vector>
#include <string>
#include <boost/smart_ptr.hpp>
#include <boost/cstdint.hpp>
#include <cstdint>
#include "libtorrent/aux_/disable_warnings_pop.hpp"
namespace libtorrent
{
typedef boost::uint16_t peer_class_t;
typedef std::uint16_t peer_class_t;
struct peer_class_info
{

View File

@ -56,7 +56,7 @@ namespace libtorrent {
private:
// the number of elements used in the m_class array
boost::uint8_t m_size;
std::uint8_t m_size;
// if this object belongs to any peer-class, this vector contains all
// class IDs. Each ID refers to a an entry in m_ses.m_peer_classes which

View File

@ -34,7 +34,7 @@ POSSIBILITY OF SUCH DAMAGE.
#define TORRENT_PEER_CLASS_TYPE_FILTER_HPP_INCLUDED
#include <cstring> // for memset
#include <boost/cstdint.hpp>
#include <cstdint>
namespace libtorrent
{
@ -115,7 +115,7 @@ namespace libtorrent
// takes a bitmask of peer classes and returns a new bitmask of
// peer classes after the rules have been applied, based on the socket type argument
// (``st``).
boost::uint32_t apply(int st, boost::uint32_t peer_class_mask)
std::uint32_t apply(int st, std::uint32_t peer_class_mask)
{
TORRENT_ASSERT(st < num_socket_types && st >= 0);
if (st < 0 || st >= num_socket_types) return peer_class_mask;
@ -130,9 +130,9 @@ namespace libtorrent
private:
// maps socket type to a bitmask that's used to filter out
// (mask) bits from the m_peer_class_filter.
boost::uint32_t m_peer_class_type_mask[5];
std::uint32_t m_peer_class_type_mask[5];
// peer class bitfield added based on socket type
boost::uint32_t m_peer_class_type[5];
std::uint32_t m_peer_class_type[5];
};
}

View File

@ -75,7 +75,7 @@ POSSIBILITY OF SUCH DAMAGE.
#include <boost/noncopyable.hpp>
#include <array>
#include <boost/optional.hpp>
#include <boost/cstdint.hpp>
#include <cstdint>
#include "libtorrent/aux_/disable_warnings_pop.hpp"
@ -113,7 +113,7 @@ namespace libtorrent
// request_time field is set to the current time.
// if the request has not been written to the send buffer, this field
// remains not_in_buffer.
boost::uint32_t send_buffer_offset:29;
std::uint32_t send_buffer_offset:29;
// if any of these are set to true, this block
// is not allocated
@ -121,14 +121,14 @@ namespace libtorrent
// other peers to pick. This may be caused by
// it either timing out or being received
// unexpectedly from the peer
boost::uint32_t not_wanted:1;
boost::uint32_t timed_out:1;
std::uint32_t not_wanted:1;
std::uint32_t timed_out:1;
// the busy flag is set if the block was
// requested from another peer when this
// request was queued. We only allow a single
// busy request at a time in each peer's queue
boost::uint32_t busy:1;
std::uint32_t busy:1;
bool operator==(pending_block const& b)
{
@ -377,7 +377,7 @@ namespace libtorrent
bool ignore_stats() const { return m_ignore_stats; }
void ignore_stats(bool b) { m_ignore_stats = b; }
boost::uint32_t peer_rank() const;
std::uint32_t peer_rank() const;
void fast_reconnect(bool r);
bool fast_reconnect() const { return m_fast_reconnect; }
@ -455,7 +455,7 @@ namespace libtorrent
{ return m_torrent; }
stat const& statistics() const { return m_statistics; }
void add_stat(boost::int64_t downloaded, boost::int64_t uploaded);
void add_stat(std::int64_t downloaded, std::int64_t uploaded);
void sent_bytes(int bytes_payload, int bytes_protocol);
void received_bytes(int bytes_payload, int bytes_protocol);
void trancieve_ip_packet(int bytes, bool ipv6);
@ -683,13 +683,13 @@ namespace libtorrent
time_t last_seen_complete() const { return m_last_seen_complete; }
void set_last_seen_complete(int ago) { m_last_seen_complete = time(0) - ago; }
boost::int64_t uploaded_in_last_round() const
std::int64_t uploaded_in_last_round() const
{ return m_statistics.total_payload_upload() - m_uploaded_at_last_round; }
boost::int64_t downloaded_in_last_round() const
std::int64_t downloaded_in_last_round() const
{ return m_statistics.total_payload_download() - m_downloaded_at_last_round; }
boost::int64_t uploaded_since_unchoked() const
std::int64_t uploaded_since_unchoked() const
{ return m_statistics.total_payload_upload() - m_uploaded_at_last_unchoke; }
// the time we last unchoked this peer
@ -950,8 +950,8 @@ namespace libtorrent
// measure the number of bytes transferred during
// an unchoke cycle, to unchoke peers the more bytes
// they sent us
boost::int64_t m_downloaded_at_last_round;
boost::int64_t m_uploaded_at_last_round;
std::int64_t m_downloaded_at_last_round;
std::int64_t m_uploaded_at_last_round;
// this is the number of bytes we had uploaded the
// last time this peer was unchoked. This does not
@ -959,13 +959,13 @@ namespace libtorrent
// track upload across rounds, for the full duration of
// the peer being unchoked. Specifically, it's used
// for the round-robin unchoke algorithm.
boost::int64_t m_uploaded_at_last_unchoke;
std::int64_t m_uploaded_at_last_unchoke;
// the number of payload bytes downloaded last second tick
boost::int32_t m_downloaded_last_second;
std::int32_t m_downloaded_last_second;
// the number of payload bytes uploaded last second tick
boost::int32_t m_uploaded_last_second;
std::int32_t m_uploaded_last_second;
// the number of bytes that the other
// end has to send us in order to respond
@ -989,7 +989,7 @@ namespace libtorrent
// a sent-piece counter for the allowed fast set
// to avoid exploitation. Each slot is a counter
// for one of the pieces from the allowed-fast set
std::vector<boost::uint16_t> m_accept_fast_piece_cnt;
std::vector<std::uint16_t> m_accept_fast_piece_cnt;
// the pieces the peer will send us if
// requested (regardless of choke state)
@ -1100,7 +1100,7 @@ namespace libtorrent
// the number of request we should queue up
// at the remote end.
// TODO: 2 rename this target queue size
boost::uint16_t m_desired_queue_size;
std::uint16_t m_desired_queue_size;
// if set to non-zero, this peer will always prefer
// to request entire n pieces, rather than blocks.
@ -1108,19 +1108,19 @@ namespace libtorrent
// if it is 0, the download rate limit setting
// will be used to determine if whole pieces
// are preferred.
boost::uint8_t m_prefer_contiguous_blocks;
std::uint8_t m_prefer_contiguous_blocks;
// this is the number of times this peer has had
// a request rejected because of a disk I/O failure.
// once this reaches a certain threshold, the
// peer is disconnected in order to avoid infinite
// loops of consistent failures
boost::uint8_t m_disk_read_failures;
std::uint8_t m_disk_read_failures;
// this is used in seed mode whenever we trigger a hash check
// for a piece, before we read it. It's used to throttle
// the hash checks to just a few per peer at a time.
boost::uint8_t m_outstanding_piece_verification:3;
std::uint8_t m_outstanding_piece_verification:3;
// is true if it was we that connected to the peer
// and false if we got an incoming connection

View File

@ -56,7 +56,7 @@ namespace libtorrent
virtual torrent_peer* peer_info_struct() const = 0;
virtual void set_peer_info(torrent_peer* pi) = 0;
virtual bool is_outgoing() const = 0;
virtual void add_stat(boost::int64_t downloaded, boost::int64_t uploaded) = 0;
virtual void add_stat(std::int64_t downloaded, std::int64_t uploaded) = 0;
virtual bool fast_reconnect() const = 0;
virtual bool is_choked() const = 0;
virtual bool failed() const = 0;

View File

@ -61,8 +61,8 @@ namespace libtorrent
// the total number of bytes downloaded from and uploaded to this peer.
// These numbers do not include the protocol chatter, but only the
// payload data.
boost::int64_t total_download;
boost::int64_t total_upload;
std::int64_t total_download;
std::int64_t total_upload;
// the time since we last sent a request to this peer and since any
// transfer occurred with this peer
@ -183,7 +183,7 @@ namespace libtorrent
// tells you in which state the peer is in. It is set to
// any combination of the peer_flags_t enum.
boost::uint32_t flags;
std::uint32_t flags;
// the flags indicating which sources a peer can
// have come from. A peer may have been seen from
@ -213,7 +213,7 @@ namespace libtorrent
// a combination of flags describing from which sources this peer
// was received. See peer_source_flags.
boost::uint32_t source;
std::uint32_t source;
// the current upload and download speed we have to and from this peer
// (including any protocol messages). updated about once per second
@ -410,7 +410,7 @@ namespace libtorrent
// but this member says how much *extra* free upload this peer has got.
// If it is a negative number it means that this was a peer from which we
// have got this amount of free download.
boost::int64_t load_balancing;
std::int64_t load_balancing;
#endif
};
@ -429,9 +429,9 @@ namespace libtorrent
// internal
int flags;
// internal
boost::uint8_t failcount;
std::uint8_t failcount;
// internal
boost::uint8_t source;
std::uint8_t source;
};
}

View File

@ -245,7 +245,7 @@ namespace libtorrent
torrent_peer* m_locked_peer;
// the number of seeds in the torrent_peer list
boost::uint32_t m_num_seeds:31;
std::uint32_t m_num_seeds:31;
// this was the state of the torrent the
// last time we recalculated the number of
@ -255,7 +255,7 @@ namespace libtorrent
// this state. Every time m_torrent->is_finished()
// is different from this state, we need to
// recalculate the connect candidates.
boost::uint32_t m_finished:1;
std::uint32_t m_finished:1;
// since the torrent_peer list can grow too large
// to scan all of it, start at this index

View File

@ -37,7 +37,7 @@ POSSIBILITY OF SUCH DAMAGE.
#include "libtorrent/aux_/disable_warnings_push.hpp"
#include <boost/cstdint.hpp>
#include <cstdint>
#include <atomic>
#include <mutex>
#include <array>
@ -441,11 +441,11 @@ namespace libtorrent
counters& operator=(counters const&);
// returns the new value
boost::int64_t inc_stats_counter(int c, boost::int64_t value = 1);
boost::int64_t operator[](int i) const;
std::int64_t inc_stats_counter(int c, std::int64_t value = 1);
std::int64_t operator[](int i) const;
void set_value(int c, boost::int64_t value);
void blend_stats_counter(int c, boost::int64_t value, int ratio);
void set_value(int c, std::int64_t value);
void blend_stats_counter(int c, std::int64_t value, int ratio);
private:
@ -454,12 +454,12 @@ namespace libtorrent
// of the counters per thread and collect them at convenient
// synchronization points
#ifdef ATOMIC_LLONG_LOCK_FREE
std::array<std::atomic<boost::int64_t>, num_counters> m_stats_counter;
std::array<std::atomic<std::int64_t>, num_counters> m_stats_counter;
#else
// if the atomic type is't lock-free, use a single lock instead, for
// the whole array
mutable std::mutex m_mutex;
std::array<boost::int64_t, num_counters> m_stats_counter;
std::array<std::int64_t, num_counters> m_stats_counter;
#endif
};
}

View File

@ -44,7 +44,7 @@ POSSIBILITY OF SUCH DAMAGE.
#include "libtorrent/aux_/disable_warnings_push.hpp"
#include <boost/cstdint.hpp>
#include <cstdint>
#include <boost/tuple/tuple.hpp>
#include "libtorrent/aux_/disable_warnings_pop.hpp"
@ -157,8 +157,8 @@ namespace libtorrent
struct downloading_piece
{
downloading_piece() : index((std::numeric_limits<boost::uint32_t>::max)())
, info_idx((std::numeric_limits<boost::uint16_t>::max)())
downloading_piece() : index((std::numeric_limits<std::uint32_t>::max)())
, info_idx((std::numeric_limits<std::uint16_t>::max)())
, finished(0)
, passed_hash_check(0)
, writing(0)
@ -169,16 +169,16 @@ namespace libtorrent
bool operator<(downloading_piece const& rhs) const { return index < rhs.index; }
// the index of the piece
boost::uint32_t index;
std::uint32_t index;
// info about each block in this piece. this is an index into the
// m_block_info array, when multiplied by m_blocks_per_piece.
// The m_blocks_per_piece following entries contain information about
// all blocks in this piece.
boost::uint16_t info_idx;
std::uint16_t info_idx;
// the number of blocks in the finished state
boost::uint16_t finished:15;
std::uint16_t finished:15;
// set to true when the hash check job
// returns with a valid hash for this piece.
@ -186,10 +186,10 @@ namespace libtorrent
// since it might not have been written to
// disk. This is not set of locked is
// set.
boost::uint16_t passed_hash_check:1;
std::uint16_t passed_hash_check:1;
// the number of blocks in the writing state
boost::uint16_t writing:15;
std::uint16_t writing:15;
// when this is set, blocks from this piece may
// not be picked. This is used when the hash check
@ -198,14 +198,14 @@ namespace libtorrent
// remaining state. Once this synchronization is
// done, restore_piece() is called to clear the
// locked flag.
boost::uint16_t locked:1;
std::uint16_t locked:1;
// the number of blocks in the requested state
boost::uint16_t requested:15;
std::uint16_t requested:15;
// set to true while there is an outstanding
// hash check for this piece
boost::uint16_t outstanding_hash_check:1;
std::uint16_t outstanding_hash_check:1;
};
piece_picker();
@ -294,7 +294,7 @@ namespace libtorrent
// this feature is used by web_peer_connection to request larger blocks
// at a time to mitigate limited pipelining and lack of keep-alive
// (i.e. higher overhead per request).
boost::uint32_t pick_pieces(bitfield const& pieces
std::uint32_t pick_pieces(bitfield const& pieces
, std::vector<piece_block>& interesting_blocks, int num_blocks
, int prefer_contiguous_blocks, torrent_peer* peer
, int options, std::vector<int> const& suggested_pieces
@ -455,10 +455,10 @@ namespace libtorrent
// functor that compares indices on downloading_pieces
struct has_index
{
has_index(int i): index(boost::uint32_t(i)) { TORRENT_ASSERT(i >= 0); }
has_index(int i): index(std::uint32_t(i)) { TORRENT_ASSERT(i >= 0); }
bool operator()(const downloading_piece& p) const
{ return p.index == index; }
boost::uint32_t index;
std::uint32_t index;
};
int blocks_in_last_piece() const
@ -578,9 +578,9 @@ namespace libtorrent
// the number of peers that has this piece
// (availability)
#ifdef TORRENT_OPTIMIZE_MEMORY_USAGE
boost::uint32_t peer_count : 9;
std::uint32_t peer_count : 9;
#else
boost::uint32_t peer_count : 16;
std::uint32_t peer_count : 16;
#endif
// one of the enums from state_t. This indicates whether this piece
@ -593,7 +593,7 @@ namespace libtorrent
// as piece_downloading, it just saves space to also indicate that it
// has a bit lower priority. The reverse bit is only relevant if the
// state is piece_downloading.
boost::uint32_t download_state : 3;
std::uint32_t download_state : 3;
// TODO: 2 having 8 priority levels is probably excessive. It should
// probably be changed to 3 levels + dont-download
@ -606,13 +606,13 @@ namespace libtorrent
// 5 is mid priority
// 6 is high priority
// 7 is high priority
boost::uint32_t piece_priority : 3;
std::uint32_t piece_priority : 3;
// index in to the piece_info vector
#ifdef TORRENT_OPTIMIZE_MEMORY_USAGE
boost::uint32_t index : 17;
std::uint32_t index : 17;
#else
boost::uint32_t index;
std::uint32_t index;
#endif
#ifdef TORRENT_DEBUG_REFCOUNTS
@ -620,7 +620,7 @@ namespace libtorrent
std::set<const torrent_peer*> have_peers;
#endif
enum : boost::uint32_t
enum : std::uint32_t
{
// index is set to this to indicate that we have the
// piece. There is no entry for the piece in the
@ -796,10 +796,10 @@ namespace libtorrent
// in here, when multiplied by m_blocks_per_piece is the index to the
// first block in the range that's free to use by a new downloading_piece.
// this is a free-list.
std::vector<boost::uint16_t> m_free_block_infos;
std::vector<std::uint16_t> m_free_block_infos;
boost::uint16_t m_blocks_per_piece;
boost::uint16_t m_blocks_in_last_piece;
std::uint16_t m_blocks_per_piece;
std::uint16_t m_blocks_in_last_piece;
// the number of filtered pieces that we don't already
// have. total_number_of_pieces - number_of_pieces_we_have

View File

@ -1,13 +1,13 @@
#ifndef TORRENT_PLATFORM_UTIL_HPP
#define TORRENT_PLATFORM_UTIL_HPP
#include <boost/cstdint.hpp>
#include <cstdint>
namespace libtorrent
{
int max_open_files();
boost::uint64_t total_physical_ram();
std::uint64_t total_physical_ram();
}
#endif // TORRENT_PLATFORM_UTIL_HPP

View File

@ -25,9 +25,9 @@
/*
* See puff.c for purpose and usage.
*/
#include <boost/cstdint.hpp>
#include <cstdint>
int puff(unsigned char *dest, /* pointer to destination pointer */
boost::uint32_t *destlen, /* amount of output space */
std::uint32_t *destlen, /* amount of output space */
const unsigned char *source, /* pointer to source data pointer */
boost::uint32_t *sourcelen); /* amount of input available */
std::uint32_t *sourcelen); /* amount of input available */

View File

@ -31,10 +31,10 @@ POSSIBILITY OF SUCH DAMAGE.
*/
#include "libtorrent/config.hpp"
#include <boost/cstdint.hpp>
#include <cstdint>
namespace libtorrent
{
boost::uint32_t TORRENT_EXTRA_EXPORT random();
boost::uint32_t TORRENT_EXTRA_EXPORT randint(int i);
std::uint32_t TORRENT_EXTRA_EXPORT random();
std::uint32_t TORRENT_EXTRA_EXPORT randint(int i);
}

View File

@ -79,7 +79,7 @@ namespace libtorrent
std::vector<link_t> m_links;
// maps file size to file index, in m_torrent_file
boost::unordered_multimap<boost::int64_t, int> m_file_sizes;
boost::unordered_multimap<std::int64_t, int> m_file_sizes;
};
#endif // TORRENT_DISABLE_MUTABLE_TORRENTS

View File

@ -198,7 +198,7 @@ namespace libtorrent
TORRENT_DEPRECATED
session(fingerprint const& print
, int flags = start_default_features | add_default_plugins
, boost::uint32_t alert_mask = alert::error_notification)
, std::uint32_t alert_mask = alert::error_notification)
: session_handle(NULL)
{
TORRENT_CFG();

View File

@ -113,8 +113,8 @@ namespace libtorrent
// The ``flags`` argument is used to filter which parts of the session
// state to save or load. By default, all state is saved/restored (except
// for the individual torrents). see save_state_flags_t
void save_state(entry& e, boost::uint32_t flags = 0xffffffff) const;
void load_state(bdecode_node const& e, boost::uint32_t flags = 0xffffffff);
void save_state(entry& e, std::uint32_t flags = 0xffffffff) const;
void load_state(bdecode_node const& e, std::uint32_t flags = 0xffffffff);
// .. note::
// these calls are potentially expensive and won't scale well with
@ -143,9 +143,9 @@ namespace libtorrent
// a valid torrent are ignored.
void get_torrent_status(std::vector<torrent_status>* ret
, boost::function<bool(torrent_status const&)> const& pred
, boost::uint32_t flags = 0) const;
, std::uint32_t flags = 0) const;
void refresh_torrent_status(std::vector<torrent_status>* ret
, boost::uint32_t flags = 0) const;
, std::uint32_t flags = 0) const;
// This functions instructs the session to post the state_update_alert,
// containing the status of all torrents whose state changed since the
@ -155,7 +155,7 @@ namespace libtorrent
// included. This flag is on by default. See add_torrent_params.
// the ``flags`` argument is the same as for torrent_handle::status().
// see torrent_handle::status_flags_t.
void post_torrent_updates(boost::uint32_t flags = 0xffffffff);
void post_torrent_updates(std::uint32_t flags = 0xffffffff);
// This function will post a session_stats_alert object, containing a
// snapshot of the performance counters from the internals of libtorrent.
@ -389,7 +389,7 @@ namespace libtorrent
// To generate the signature, you may want to use the
// ``sign_mutable_item`` function.
//
// boost::uint64_t& seq
// std::uint64_t& seq
// current sequence number. May be zero if there is no current value.
// The function is expected to set this to the new sequence number of
// the value that is to be stored. Sequence numbers must be monotonically
@ -411,7 +411,7 @@ namespace libtorrent
// calling the callback in between is convenient.
void dht_put_item(std::array<char, 32> key
, boost::function<void(entry&, std::array<char,64>&
, boost::uint64_t&, std::string const&)> cb
, std::uint64_t&, std::string const&)> cb
, std::string salt = std::string());
void dht_get_peers(sha1_hash const& info_hash);
@ -518,13 +518,13 @@ namespace libtorrent
// use load_state and save_state instead
TORRENT_DEPRECATED
void load_state(entry const& ses_state
, boost::uint32_t flags = 0xffffffff);
, std::uint32_t flags = 0xffffffff);
TORRENT_DEPRECATED
entry state() const;
// deprecated in 1.1
TORRENT_DEPRECATED
void load_state(lazy_entry const& ses_state
, boost::uint32_t flags = 0xffffffff);
, std::uint32_t flags = 0xffffffff);
#endif // TORRENT_NO_DEPRECATE
// Sets a filter that will be used to reject and accept incoming as well
@ -960,9 +960,9 @@ namespace libtorrent
//
// See category_t enum for options.
TORRENT_DEPRECATED
void set_alert_mask(boost::uint32_t m);
void set_alert_mask(std::uint32_t m);
TORRENT_DEPRECATED
boost::uint32_t get_alert_mask() const;
std::uint32_t get_alert_mask() const;
// Starts and stops Local Service Discovery. This service will broadcast
// the infohashes of all the non-private torrents on the local network to

View File

@ -38,7 +38,7 @@ POSSIBILITY OF SUCH DAMAGE.
#include "libtorrent/settings_pack.hpp"
#include "libtorrent/aux_/proxy_settings.hpp"
#include <boost/cstdint.hpp>
#include <cstdint>
#include <string>
#include <vector>
#include <utility>
@ -1544,14 +1544,14 @@ namespace libtorrent
// control the settings for incoming
// and outgoing connections respectively.
// see enc_policy enum for the available options.
boost::uint8_t out_enc_policy;
boost::uint8_t in_enc_policy;
std::uint8_t out_enc_policy;
std::uint8_t in_enc_policy;
// determines the encryption level of the
// connections. This setting will adjust which encryption scheme is
// offered to the other peer, as well as which encryption scheme is
// selected by the client. See enc_level enum for options.
boost::uint8_t allowed_enc_level;
std::uint8_t allowed_enc_level;
// if the allowed encryption level is both, setting this to
// true will prefer rc4 if both methods are offered, plaintext

View File

@ -60,18 +60,18 @@ namespace libtorrent
// These are monotonically increasing
// and cumulative counters for their respective event.
boost::uint64_t packet_loss;
boost::uint64_t timeout;
boost::uint64_t packets_in;
boost::uint64_t packets_out;
boost::uint64_t fast_retransmit;
boost::uint64_t packet_resend;
boost::uint64_t samples_above_target;
boost::uint64_t samples_below_target;
boost::uint64_t payload_pkts_in;
boost::uint64_t payload_pkts_out;
boost::uint64_t invalid_pkts_in;
boost::uint64_t redundant_pkts_in;
std::uint64_t packet_loss;
std::uint64_t timeout;
std::uint64_t packets_in;
std::uint64_t packets_out;
std::uint64_t fast_retransmit;
std::uint64_t packet_resend;
std::uint64_t samples_above_target;
std::uint64_t samples_below_target;
std::uint64_t payload_pkts_in;
std::uint64_t payload_pkts_out;
std::uint64_t invalid_pkts_in;
std::uint64_t redundant_pkts_in;
};
// contains session wide state and counters
@ -92,8 +92,8 @@ namespace libtorrent
// the total number of bytes downloaded and
// uploaded to and from all torrents. This also includes all the protocol overhead.
boost::int64_t total_download;
boost::int64_t total_upload;
std::int64_t total_download;
std::int64_t total_upload;
// the rate of the payload
// down- and upload only.
@ -103,38 +103,38 @@ namespace libtorrent
// the total transfers of payload
// only. The payload does not include the bittorrent protocol overhead, but only parts of the
// actual files to be downloaded.
boost::int64_t total_payload_download;
boost::int64_t total_payload_upload;
std::int64_t total_payload_download;
std::int64_t total_payload_upload;
// the estimated TCP/IP overhead in each direction.
int ip_overhead_upload_rate;
int ip_overhead_download_rate;
boost::int64_t total_ip_overhead_download;
boost::int64_t total_ip_overhead_upload;
std::int64_t total_ip_overhead_download;
std::int64_t total_ip_overhead_upload;
// the upload and download rate used by DHT traffic. Also the total number
// of bytes sent and received to and from the DHT.
int dht_upload_rate;
int dht_download_rate;
boost::int64_t total_dht_download;
boost::int64_t total_dht_upload;
std::int64_t total_dht_download;
std::int64_t total_dht_upload;
// the upload and download rate used by tracker traffic. Also the total number
// of bytes sent and received to and from trackers.
int tracker_upload_rate;
int tracker_download_rate;
boost::int64_t total_tracker_download;
boost::int64_t total_tracker_upload;
std::int64_t total_tracker_download;
std::int64_t total_tracker_upload;
// the number of bytes that has been received more than once.
// This can happen if a request from a peer times out and is requested from a different
// peer, and then received again from the first one. To make this lower, increase the
// ``request_timeout`` and the ``piece_timeout`` in the session settings.
boost::int64_t total_redundant_bytes;
std::int64_t total_redundant_bytes;
// the number of bytes that was downloaded which later failed
// the hash-check.
boost::int64_t total_failed_bytes;
std::int64_t total_failed_bytes;
// the total number of peer connections this session has. This includes
// incoming connections that still hasn't sent their handshake or outgoing connections
@ -189,7 +189,7 @@ namespace libtorrent
// an estimation of the total number of nodes in the DHT
// network.
boost::int64_t dht_global_nodes;
std::int64_t dht_global_nodes;
// a vector of the currently running DHT lookups.
std::vector<dht_lookup> active_requests;

View File

@ -1665,9 +1665,9 @@ namespace libtorrent
};
private:
std::vector<std::pair<boost::uint16_t, std::string> > m_strings;
std::vector<std::pair<boost::uint16_t, int> > m_ints;
std::vector<std::pair<boost::uint16_t, bool> > m_bools;
std::vector<std::pair<std::uint16_t, std::string> > m_strings;
std::vector<std::pair<std::uint16_t, int> > m_ints;
std::vector<std::pair<std::uint16_t, bool> > m_bools;
};
}

View File

@ -14,24 +14,24 @@ changelog at the end of sha1.cpp
#define TORRENT_SHA1_HPP_INCLUDED
#include "libtorrent/config.hpp"
#include <boost/cstdint.hpp>
#include <cstdint>
namespace libtorrent
{
struct TORRENT_EXTRA_EXPORT sha_ctx
{
boost::uint32_t state[5];
boost::uint32_t count[2];
boost::uint8_t buffer[64];
std::uint32_t state[5];
std::uint32_t count[2];
std::uint8_t buffer[64];
};
// we don't want these to clash with openssl's libcrypto
TORRENT_EXTRA_EXPORT void SHA1_init(sha_ctx* context);
TORRENT_EXTRA_EXPORT void SHA1_update(sha_ctx* context
, boost::uint8_t const* data
, boost::uint32_t len);
TORRENT_EXTRA_EXPORT void SHA1_final(boost::uint8_t* digest, sha_ctx* context);
, std::uint8_t const* data
, std::uint32_t len);
TORRENT_EXTRA_EXPORT void SHA1_final(std::uint8_t* digest, sha_ctx* context);
}
#endif

View File

@ -69,7 +69,7 @@ namespace libtorrent
public:
// internal
// the number of bytes of the number
static const int size = number_size * sizeof(boost::uint32_t);
static const int size = number_size * sizeof(std::uint32_t);
// constructs an all-zero sha1-hash
sha1_hash() { clear(); }
@ -149,8 +149,8 @@ namespace libtorrent
{
for (int i = 0; i < number_size; ++i)
{
boost::uint32_t const lhs = aux::network_to_host(m_number[i]);
boost::uint32_t const rhs = aux::network_to_host(n.m_number[i]);
std::uint32_t const lhs = aux::network_to_host(m_number[i]);
std::uint32_t const rhs = aux::network_to_host(n.m_number[i]);
if (lhs < rhs) return true;
if (lhs > rhs) return false;
}
@ -209,30 +209,30 @@ namespace libtorrent
}
// accessors for specific bytes
boost::uint8_t& operator[](int i)
std::uint8_t& operator[](int i)
{
TORRENT_ASSERT(i >= 0 && i < size);
return reinterpret_cast<boost::uint8_t*>(m_number)[i];
return reinterpret_cast<std::uint8_t*>(m_number)[i];
}
boost::uint8_t const& operator[](int i) const
std::uint8_t const& operator[](int i) const
{
TORRENT_ASSERT(i >= 0 && i < size);
return reinterpret_cast<boost::uint8_t const*>(m_number)[i];
return reinterpret_cast<std::uint8_t const*>(m_number)[i];
}
using const_iterator = boost::uint8_t const*;
using iterator = boost::uint8_t*;
using const_iterator = std::uint8_t const*;
using iterator = std::uint8_t*;
// start and end iterators for the hash. The value type
// of these iterators is ``boost::uint8_t``.
// of these iterators is ``std::uint8_t``.
const_iterator begin() const
{ return reinterpret_cast<boost::uint8_t const*>(m_number); }
{ return reinterpret_cast<std::uint8_t const*>(m_number); }
const_iterator end() const
{ return reinterpret_cast<boost::uint8_t const*>(m_number) + size; }
{ return reinterpret_cast<std::uint8_t const*>(m_number) + size; }
iterator begin()
{ return reinterpret_cast<boost::uint8_t*>(m_number); }
{ return reinterpret_cast<std::uint8_t*>(m_number); }
iterator end()
{ return reinterpret_cast<boost::uint8_t*>(m_number) + size; }
{ return reinterpret_cast<std::uint8_t*>(m_number) + size; }
// return a copy of the 20 bytes representing the sha1-hash as a std::string.
// It's still a binary string with 20 binary characters.
@ -244,7 +244,7 @@ namespace libtorrent
private:
boost::uint32_t m_number[number_size];
std::uint32_t m_number[number_size];
};

View File

@ -33,7 +33,7 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef TORRENT_SLIDING_AVERAGE_HPP_INCLUDED
#define TORRENT_SLIDING_AVERAGE_HPP_INCLUDED
#include <boost/cstdint.hpp>
#include <cstdint>
#include <cstdlib> // for std::abs
namespace libtorrent
@ -109,7 +109,7 @@ struct average_accumulator
}
int m_num_samples;
boost::uint64_t m_sample_sum;
std::uint64_t m_sample_sum;
};
}

View File

@ -212,8 +212,8 @@ namespace libtorrent
void close(error_code& ec);
// this is only relevant for uTP connections
void set_close_reason(boost::uint16_t code);
boost::uint16_t get_close_reason();
void set_close_reason(std::uint16_t code);
std::uint16_t get_close_reason();
endpoint_type local_endpoint(error_code& ec) const;
endpoint_type remote_endpoint(error_code& ec) const;

View File

@ -37,7 +37,7 @@ POSSIBILITY OF SUCH DAMAGE.
#include <vector>
#include <cstring>
#include <limits>
#include <boost/cstdint.hpp>
#include <cstdint>
#include "libtorrent/invariant_check.hpp"
#include "libtorrent/config.hpp"
@ -57,9 +57,9 @@ namespace libtorrent
void operator+=(stat_channel const& s)
{
TORRENT_ASSERT(m_counter < (std::numeric_limits<boost::uint32_t>::max)() - s.m_counter);
TORRENT_ASSERT(m_counter < (std::numeric_limits<std::uint32_t>::max)() - s.m_counter);
m_counter += s.m_counter;
TORRENT_ASSERT(m_total_counter < (std::numeric_limits<boost::uint64_t>::max)() - s.m_counter);
TORRENT_ASSERT(m_total_counter < (std::numeric_limits<std::uint64_t>::max)() - s.m_counter);
m_total_counter += s.m_counter;
}
@ -67,9 +67,9 @@ namespace libtorrent
{
TORRENT_ASSERT(count >= 0);
TORRENT_ASSERT(m_counter < (std::numeric_limits<boost::uint32_t>::max)() - count);
TORRENT_ASSERT(m_counter < (std::numeric_limits<std::uint32_t>::max)() - count);
m_counter += count;
TORRENT_ASSERT(m_total_counter < (std::numeric_limits<boost::uint64_t>::max)() - count);
TORRENT_ASSERT(m_total_counter < (std::numeric_limits<std::uint64_t>::max)() - count);
m_total_counter += count;
}
@ -78,11 +78,11 @@ namespace libtorrent
int rate() const { return m_5_sec_average; }
int low_pass_rate() const { return m_5_sec_average; }
boost::int64_t total() const { return m_total_counter; }
std::int64_t total() const { return m_total_counter; }
void offset(boost::int64_t c)
void offset(std::int64_t c)
{
TORRENT_ASSERT(m_total_counter < (std::numeric_limits<boost::uint64_t>::max)() - c);
TORRENT_ASSERT(m_total_counter < (std::numeric_limits<std::uint64_t>::max)() - c);
m_total_counter += c;
}
@ -98,13 +98,13 @@ namespace libtorrent
private:
// total counters
boost::uint64_t m_total_counter;
std::uint64_t m_total_counter;
// the accumulator for this second.
boost::uint32_t m_counter;
std::uint32_t m_counter;
// sliding average
boost::uint32_t m_5_sec_average;
std::uint32_t m_5_sec_average;
};
class TORRENT_EXTRA_EXPORT stat
@ -201,14 +201,14 @@ namespace libtorrent
+ m_stat[download_ip_protocol].rate();
}
boost::int64_t total_upload() const
std::int64_t total_upload() const
{
return m_stat[upload_payload].total()
+ m_stat[upload_protocol].total()
+ m_stat[upload_ip_protocol].total();
}
boost::int64_t total_download() const
std::int64_t total_download() const
{
return m_stat[download_payload].total()
+ m_stat[download_protocol].total()
@ -220,17 +220,17 @@ namespace libtorrent
int download_payload_rate() const
{ return m_stat[download_payload].rate(); }
boost::int64_t total_payload_upload() const
std::int64_t total_payload_upload() const
{ return m_stat[upload_payload].total(); }
boost::int64_t total_payload_download() const
std::int64_t total_payload_download() const
{ return m_stat[download_payload].total(); }
boost::int64_t total_protocol_upload() const
std::int64_t total_protocol_upload() const
{ return m_stat[upload_protocol].total(); }
boost::int64_t total_protocol_download() const
std::int64_t total_protocol_download() const
{ return m_stat[download_protocol].total(); }
boost::int64_t total_transfer(int channel) const
std::int64_t total_transfer(int channel) const
{ return m_stat[channel].total(); }
int transfer_rate(int channel) const
{ return m_stat[channel].rate(); }
@ -238,7 +238,7 @@ namespace libtorrent
// this is used to offset the statistics when a
// peer_connection is opened and have some previous
// transfers from earlier connections.
void add_stat(boost::int64_t downloaded, boost::int64_t uploaded)
void add_stat(std::int64_t downloaded, std::int64_t uploaded)
{
m_stat[download_payload].offset(downloaded);
m_stat[upload_payload].offset(uploaded);

View File

@ -37,7 +37,7 @@ POSSIBILITY OF SUCH DAMAGE.
#include <vector>
#include <string>
#include <boost/cstdint.hpp>
#include <cstdint>
#include "libtorrent/aux_/disable_warnings_pop.hpp"
@ -56,7 +56,7 @@ namespace libtorrent
// returns the size of the file unless an error occurs, in which case ec
// is set to indicate the error
boost::int64_t get_filesize(int i, file_storage const& fs
std::int64_t get_filesize(int i, file_storage const& fs
, std::string const& save_path, error_code& ec);
void set_dirty(int i);
@ -71,7 +71,7 @@ namespace libtorrent
};
// internal
void set_cache(int i, boost::int64_t size);
void set_cache(int i, std::int64_t size);
void set_error(int i, error_code const& ec);
private:
@ -82,14 +82,14 @@ namespace libtorrent
struct stat_cache_t
{
stat_cache_t(boost::int64_t s): file_size(s) {}
stat_cache_t(std::int64_t s): file_size(s) {}
// the size of the file. Negative values have special meaning. -1 means
// not-in-cache (i.e. there's no data for this file in the cache).
// lower values (larger negative values) indicate that an error
// occurred while stat()ing the file. The positive value is an index
// into m_errors, that recorded the actual error.
boost::int64_t file_size;
std::int64_t file_size;
};
// one entry per file

View File

@ -113,7 +113,7 @@ POSSIBILITY OF SUCH DAMAGE.
// virtual bool verify_resume_data(add_torrent_params const& rd
// , std::vector<std::string> const* links
// , storage_error& error) { return false; }
// virtual boost::int64_t physical_offset(int piece, int offset)
// virtual std::int64_t physical_offset(int piece, int offset)
// { return piece * m_files.piece_length() + offset; };
// virtual sha1_hash hash_for_slot(int piece, partial_hash& ph, int piece_size)
// {
@ -262,7 +262,7 @@ namespace libtorrent
// change the priorities of files. This is a fenced job and is
// guaranteed to be the only running function on this storage
// when called
virtual void set_file_priority(std::vector<boost::uint8_t> const& prio
virtual void set_file_priority(std::vector<std::uint8_t> const& prio
, storage_error& ec) = 0;
// This function should move all the files belonging to the storage to
@ -402,7 +402,7 @@ namespace libtorrent
void finalize_file(int file, storage_error& ec) override;
#endif
virtual bool has_any_file(storage_error& ec) override;
virtual void set_file_priority(std::vector<boost::uint8_t> const& prio
virtual void set_file_priority(std::vector<std::uint8_t> const& prio
, storage_error& ec) override;
virtual void rename_file(int index, std::string const& new_filename
, storage_error& ec) override;
@ -449,7 +449,7 @@ namespace libtorrent
file_handle open_file(int file, int mode, storage_error& ec) const;
file_handle open_file_impl(int file, int mode, error_code& ec) const;
std::vector<boost::uint8_t> m_file_priority;
std::vector<std::uint8_t> m_file_priority;
std::string m_save_path;
std::string m_part_file_name;
// the file pool is typically stored in
@ -624,7 +624,7 @@ namespace libtorrent
// what to do when it's actually touching the file
struct fileop
{
virtual int file_op(int const file_index, boost::int64_t const file_offset, int const size
virtual int file_op(int const file_index, std::int64_t const file_offset, int const size
, file::iovec_t const* bufs, storage_error& ec) = 0;
};

View File

@ -68,7 +68,7 @@ namespace libtorrent
std::string path;
file_pool* pool;
storage_mode_t mode;
std::vector<boost::uint8_t> const* priorities; // optional
std::vector<std::uint8_t> const* priorities; // optional
torrent_info const* info; // optional
};

View File

@ -39,7 +39,7 @@ POSSIBILITY OF SUCH DAMAGE.
#include <vector>
#include <string>
#include <boost/cstdint.hpp>
#include <cstdint>
#include <boost/limits.hpp>
#include <array> // for std::array
@ -50,8 +50,8 @@ namespace libtorrent
TORRENT_EXTRA_EXPORT bool is_alpha(char c);
TORRENT_EXTRA_EXPORT
std::array<char, 4+std::numeric_limits<boost::int64_t>::digits10>
to_string(boost::int64_t n);
std::array<char, 4+std::numeric_limits<std::int64_t>::digits10>
to_string(std::int64_t n);
// internal
inline bool is_digit(char c)

View File

@ -37,7 +37,7 @@ POSSIBILITY OF SUCH DAMAGE.
#include "libtorrent/aux_/disable_warnings_push.hpp"
#include <boost/cstdint.hpp>
#include <cstdint>
#include <chrono>
@ -72,15 +72,15 @@ namespace libtorrent {
inline time_point max_time() { return (time_point::max)(); }
template<class T>
boost::int64_t total_seconds(T td)
std::int64_t total_seconds(T td)
{ return duration_cast<seconds>(td).count(); }
template<class T>
boost::int64_t total_milliseconds(T td)
std::int64_t total_milliseconds(T td)
{ return duration_cast<milliseconds>(td).count(); }
template<class T>
boost::int64_t total_microseconds(T td)
std::int64_t total_microseconds(T td)
{ return duration_cast<microseconds>(td).count(); }
}

View File

@ -34,7 +34,7 @@ POSSIBILITY OF SUCH DAMAGE.
#define TIMESTAMP_HISTORY_HPP
#include "libtorrent/aux_/disable_warnings_push.hpp"
#include <boost/cstdint.hpp>
#include <cstdint>
#include "libtorrent/aux_/disable_warnings_pop.hpp"
#include "libtorrent/config.hpp"
@ -53,22 +53,22 @@ struct TORRENT_EXTRA_EXPORT timestamp_history
// add a sample to the timestamp history. If step is true, it's been
// a minute since the last step
boost::uint32_t add_sample(boost::uint32_t sample, bool step);
boost::uint32_t base() const { TORRENT_ASSERT(initialized()); return m_base; }
std::uint32_t add_sample(std::uint32_t sample, bool step);
std::uint32_t base() const { TORRENT_ASSERT(initialized()); return m_base; }
void adjust_base(int change);
private:
// this is a circular buffer
boost::uint32_t m_history[history_size];
std::uint32_t m_history[history_size];
// this is the lowest sample seen in the
// last 'history_size' minutes
boost::uint32_t m_base;
std::uint32_t m_base;
// and this is the index we're currently at
// in the circular buffer
boost::uint16_t m_index;
std::uint16_t m_index;
enum { not_initialized = 0xffff };
@ -78,7 +78,7 @@ private:
// if this is set to 'not_initialized' we
// have bit seen any samples at all yet
// and m_base is not initialized yet
boost::uint16_t m_num_samples;
std::uint16_t m_num_samples;
};
}

View File

@ -203,7 +203,7 @@ namespace libtorrent
// the scrape data from the tracker response, this
// is optional and may be 0xffffff
boost::uint32_t m_complete:24;
std::uint32_t m_complete:24;
// set to true when this torrent may not download anything
bool m_upload_mode:1;
@ -251,16 +251,16 @@ namespace libtorrent
bool m_state_subscription:1;
// the maximum number of connections for this torrent
boost::uint32_t m_max_connections:24;
std::uint32_t m_max_connections:24;
// the size of a request block
// each piece is divided into these
// blocks when requested. The block size is
// 1 << m_block_size_shift
boost::uint32_t m_block_size_shift:5;
std::uint32_t m_block_size_shift:5;
// the state of this torrent (queued, checking, downloading, etc.)
boost::uint32_t m_state:3;
std::uint32_t m_state:3;
std::unique_ptr<peer_list> m_peer_list;
};
@ -430,10 +430,10 @@ namespace libtorrent
std::string name() const;
stat statistics() const { return m_stat; }
boost::int64_t bytes_left() const;
std::int64_t bytes_left() const;
int block_bytes_wanted(piece_block const& p) const;
void bytes_done(torrent_status& st, bool accurate) const;
boost::int64_t quantized_bytes_done() const;
std::int64_t quantized_bytes_done() const;
void sent_bytes(int bytes_payload, int bytes_protocol);
void received_bytes(int bytes_payload, int bytes_protocol);
@ -537,13 +537,13 @@ namespace libtorrent
void clear_time_critical();
void update_piece_priorities();
void status(torrent_status* st, boost::uint32_t flags);
void status(torrent_status* st, std::uint32_t flags);
// this torrent changed state, if the user is subscribing to
// it, add it to the m_state_updates list in session_impl
void state_updated();
void file_progress(std::vector<boost::int64_t>& fp, int flags = 0);
void file_progress(std::vector<std::int64_t>& fp, int flags = 0);
#ifndef TORRENT_NO_DEPRECATE
void use_interface(std::string net_interface);
@ -693,7 +693,7 @@ namespace libtorrent
// generate the tracker key for this torrent.
// The key is passed to http trackers as ``&key=``.
boost::uint32_t tracker_key() const;
std::uint32_t tracker_key() const;
// if we need a connect boost, connect some peers
// immediately
@ -706,11 +706,11 @@ namespace libtorrent
// forcefully sets next_announce to the current time
void force_tracker_request(time_point, int tracker_idx);
void scrape_tracker(int idx, bool user_triggered);
void announce_with_tracker(boost::uint8_t e
void announce_with_tracker(std::uint8_t e
= tracker_request::none);
int seconds_since_last_scrape() const
{
return m_last_scrape == (std::numeric_limits<boost::int16_t>::min)()
return m_last_scrape == (std::numeric_limits<std::int16_t>::min)()
? -1 : int(m_ses.session_time() - m_last_scrape);
}
@ -1160,8 +1160,8 @@ namespace libtorrent
// all time totals of uploaded and downloaded payload
// stored in resume data
boost::int64_t m_total_uploaded;
boost::int64_t m_total_downloaded;
std::int64_t m_total_uploaded;
std::int64_t m_total_downloaded;
// if this pointer is 0, the torrent is in
// a state where the metadata hasn't been
@ -1221,7 +1221,7 @@ namespace libtorrent
// ever changed, this remains empty. Any unallocated slot
// implicitly means the file has priority 1.
// TODO: this wastes 5 bits per file
std::vector<boost::uint8_t> m_file_priority;
std::vector<std::uint8_t> m_file_priority;
// this object is used to track download progress of individual files
aux::file_progress m_file_progress;
@ -1332,11 +1332,11 @@ namespace libtorrent
private:
// m_num_verified = m_verified.count()
boost::uint32_t m_num_verified;
std::uint32_t m_num_verified;
// this timestamp is kept in session-time, to
// make it fit in 16 bits
boost::uint16_t m_last_saved_resume;
std::uint16_t m_last_saved_resume;
// if this torrent is running, this was the time
// when it was started. This is used to have a
@ -1346,15 +1346,15 @@ namespace libtorrent
// in session-time. see session_impl for details.
// the reference point is stepped forward every 4
// hours to keep the timestamps fit in 16 bits
boost::uint16_t m_started;
std::uint16_t m_started;
// if we're a seed, this is the session time
// timestamp of when we became one
boost::uint16_t m_became_seed;
std::uint16_t m_became_seed;
// if we're finished, this is the session time
// timestamp of when we finished
boost::uint16_t m_became_finished;
std::uint16_t m_became_finished;
// when checking, this is the first piece we have not
// issued a hash job for
@ -1374,15 +1374,15 @@ namespace libtorrent
int m_error_file;
// the average time it takes to download one time critical piece
boost::uint32_t m_average_piece_time;
std::uint32_t m_average_piece_time;
// the average piece download time deviation
boost::uint32_t m_piece_time_deviation;
std::uint32_t m_piece_time_deviation;
// the number of bytes that has been
// downloaded that failed the hash-test
boost::uint32_t m_total_failed_bytes;
boost::uint32_t m_total_redundant_bytes;
std::uint32_t m_total_failed_bytes;
std::uint32_t m_total_redundant_bytes;
// the sequence number for this torrent, this is a
// monotonically increasing number for each added torrent
@ -1390,14 +1390,14 @@ namespace libtorrent
// for torrents who have a bandwidth limit, this is != 0
// and refers to a peer_class in the session.
boost::uint16_t m_peer_class;
std::uint16_t m_peer_class;
// of all peers in m_connections, this is the number
// of peers that are outgoing and still waiting to
// complete the connection. This is used to possibly
// kick out these connections when we get incoming
// connections (if we've reached the connection limit)
boost::uint16_t m_num_connecting;
std::uint16_t m_num_connecting;
// ==============================
// The following members are specifically
@ -1408,7 +1408,7 @@ namespace libtorrent
// the session time timestamp of when we entered upload mode
// if we're currently in upload-mode
boost::uint16_t m_upload_mode_time;
std::uint16_t m_upload_mode_time;
// true when this torrent should anncounce to
// trackers
@ -1449,7 +1449,7 @@ namespace libtorrent
unsigned int m_active_time:24;
// the index to the last tracker that worked
boost::int8_t m_last_working_tracker;
std::int8_t m_last_working_tracker;
// ----
@ -1504,7 +1504,7 @@ namespace libtorrent
// these are the flags sent in on a call to save_resume_data
// we need to save them to check them in write_resume_data
boost::uint8_t m_save_resume_flags;
std::uint8_t m_save_resume_flags;
// ----
@ -1522,7 +1522,7 @@ namespace libtorrent
// rotating sequence number for LSD announces sent out.
// used to only use IP broadcast for every 8th lsd announce
boost::uint8_t m_lsd_seq:3;
std::uint8_t m_lsd_seq:3;
// this is set to true if the torrent was started without
// metadata. It is used to save metadata in the resume file
@ -1543,18 +1543,18 @@ namespace libtorrent
// ----
// the number of bytes of padding files
boost::uint32_t m_padding:24;
std::uint32_t m_padding:24;
// this is the priority of the torrent. The higher
// the value is, the more bandwidth is assigned to
// the torrent's peers
boost::uint32_t m_priority:8;
std::uint32_t m_priority:8;
// ----
// the scrape data from the tracker response, this
// is optional and may be 0xffffff
boost::uint32_t m_incomplete:24;
std::uint32_t m_incomplete:24;
// true when the torrent should announce to
@ -1597,16 +1597,16 @@ namespace libtorrent
// the timestamp of the last piece passed for this torrent specified in
// session_time. This is signed because it must be able to represent time
// before the session started
boost::int16_t m_last_download;
std::int16_t m_last_download;
// the number of peer connections to seeds. This should be the same as
// counting the peer connections that say true for is_seed()
boost::uint16_t m_num_seeds;
std::uint16_t m_num_seeds;
// the timestamp of the last byte uploaded from this torrent specified in
// session_time. This is signed because it must be able to represent time
// before the session started.
boost::int16_t m_last_upload;
std::int16_t m_last_upload;
// this is a second count-down to when we should tick the
// storage for this torrent. Ticking the storage is used
@ -1614,7 +1614,7 @@ namespace libtorrent
// other deferred flushing. Any disk operation starts this
// counter (unless it's already counting down). 0 means no
// ticking is needed.
boost::uint8_t m_storage_tick;
std::uint8_t m_storage_tick;
// ----
@ -1627,7 +1627,7 @@ namespace libtorrent
enum { no_gauge_state = 0xf };
// the current stats gauge this torrent counts against
boost::uint32_t m_current_gauge_state:4;
std::uint32_t m_current_gauge_state:4;
// set to true while moving the storage
bool m_moving_storage:1;
@ -1646,7 +1646,7 @@ namespace libtorrent
// the timestamp of the last scrape request to one of the trackers in
// this torrent specified in session_time. This is signed because it must
// be able to represent time before the session started
boost::int16_t m_last_scrape;
std::int16_t m_last_scrape;
// ----

View File

@ -108,7 +108,7 @@ namespace libtorrent
#endif
} addr;
boost::uint16_t port;
std::uint16_t port;
public:
// The peer is the ip address of the peer this block was downloaded from.
@ -346,7 +346,7 @@ namespace libtorrent
//
// By default everything is included. The flags you can use to decide
// what to *include* are defined in the status_flags_t enum.
torrent_status status(boost::uint32_t flags = 0xffffffff) const;
torrent_status status(std::uint32_t flags = 0xffffffff) const;
// ``get_download_queue()`` takes a non-const reference to a vector which
// it will fill with information about pieces that are partially
@ -444,7 +444,7 @@ namespace libtorrent
// fully downloaded and passed the hash check count. When specifying
// piece granularity, the operation is a lot cheaper, since libtorrent
// already keeps track of this internally and no calculation is required.
void file_progress(std::vector<boost::int64_t>& progress, int flags = 0) const;
void file_progress(std::vector<std::int64_t>& progress, int flags = 0) const;
// This function fills in the passed in vector with status about files
// that are open for this torrent. Any file that is not open in this
@ -1266,12 +1266,12 @@ namespace libtorrent
bool operator<(const torrent_handle& h) const
{ return m_torrent.lock() < h.m_torrent.lock(); }
boost::uint32_t id() const
std::uint32_t id() const
{
uintptr_t ret = reinterpret_cast<uintptr_t>(m_torrent.lock().get());
// a torrent object is about 1024 bytes, so
// it's safe to shift 11 bits
return boost::uint32_t(ret >> 11);
return std::uint32_t(ret >> 11);
}
// This function is intended only for use by plugins and the alert

View File

@ -110,7 +110,7 @@ namespace libtorrent
headers_t extra_headers;
// The type of web seed (see type_t)
boost::uint8_t type;
std::uint8_t type;
};
// TODO: there may be some opportunities to optimize the size if torrent_info.
@ -314,7 +314,7 @@ namespace libtorrent
// argument and gives you the exact size of that piece. It will always be
// the same as ``piece_length()`` except in the case of the last piece,
// which may be smaller.
boost::int64_t total_size() const { return m_files.total_size(); }
std::int64_t total_size() const { return m_files.total_size(); }
int piece_length() const { return m_files.piece_length(); }
int num_pieces() const { return m_files.num_pieces(); }
@ -345,7 +345,7 @@ namespace libtorrent
reverse_file_iterator rend_files() const { return m_files.rend_deprecated(); }
TORRENT_DEPRECATED
file_iterator file_at_offset(boost::int64_t offset) const
file_iterator file_at_offset(std::int64_t offset) const
{ return m_files.file_at_offset_deprecated(offset); }
TORRENT_DEPRECATED
@ -359,7 +359,7 @@ namespace libtorrent
// This function will map a piece index, a byte offset within that piece
// and a size (in bytes) into the corresponding files with offsets where
// that data for that piece is supposed to be stored. See file_slice.
std::vector<file_slice> map_block(int piece, boost::int64_t offset, int size) const
std::vector<file_slice> map_block(int piece, std::int64_t offset, int size) const
{
TORRENT_ASSERT(is_loaded());
return m_files.map_block(piece, offset, size);
@ -373,7 +373,7 @@ namespace libtorrent
// ``file_offset`` + ``size`` is not allowed to be greater than the file
// size. ``file_index`` must refer to a valid file, i.e. it cannot be >=
// ``num_files()``.
peer_request map_file(int file, boost::int64_t offset, int size) const
peer_request map_file(int file, std::int64_t offset, int size) const
{
TORRENT_ASSERT(is_loaded());
return m_files.map_file(file, offset, size);
@ -609,11 +609,11 @@ namespace libtorrent
sha1_hash m_info_hash;
// the number of bytes in m_info_section
boost::uint32_t m_info_section_size;
std::uint32_t m_info_section_size;
// the index to the first leaf. This is where the hash for the
// first piece is stored
boost::uint32_t m_merkle_first_leaf:24;
std::uint32_t m_merkle_first_leaf:24;
// this is used when creating a torrent. If there's
// only one file there are cases where it's impossible

View File

@ -45,17 +45,17 @@ namespace libtorrent
// calculate the priority of a peer based on its address. One of the
// endpoint should be our own. The priority is symmetric, so it doesn't
// matter which is which
TORRENT_EXTRA_EXPORT boost::uint32_t peer_priority(
TORRENT_EXTRA_EXPORT std::uint32_t peer_priority(
tcp::endpoint e1, tcp::endpoint e2);
struct TORRENT_EXTRA_EXPORT torrent_peer
{
torrent_peer(boost::uint16_t port, bool connectable, int src);
torrent_peer(std::uint16_t port, bool connectable, int src);
boost::uint64_t total_download() const;
boost::uint64_t total_upload() const;
std::uint64_t total_download() const;
std::uint64_t total_upload() const;
boost::uint32_t rank(external_ip const& external, int external_port) const;
std::uint32_t rank(external_ip const& external, int external_port) const;
libtorrent::address address() const;
char const* dest() const;
@ -79,8 +79,8 @@ namespace libtorrent
// with byte-precision, they specify the number
// of kiB. i.e. shift left 10 bits to compare to
// byte counters.
boost::uint32_t prev_amount_upload;
boost::uint32_t prev_amount_download;
std::uint32_t prev_amount_upload;
std::uint32_t prev_amount_download;
// if the torrent_peer is connected now, this
// will refer to a valid peer_connection
@ -89,7 +89,7 @@ namespace libtorrent
// as computed by hashing our IP with the remote
// IP of this peer
// calculated lazily
mutable boost::uint32_t peer_rank;
mutable std::uint32_t peer_rank;
// the time when this torrent_peer was optimistically unchoked
// the last time. in seconds since session was created
@ -97,19 +97,19 @@ namespace libtorrent
// when the session time reaches 18 hours, it jumps back by
// 9 hours, and all peers' times are updated to be
// relative to that new time offset
boost::uint16_t last_optimistically_unchoked;
std::uint16_t last_optimistically_unchoked;
// the time when the torrent_peer connected to us
// or disconnected if it isn't connected right now
// in number of seconds since session was created
boost::uint16_t last_connected;
std::uint16_t last_connected;
// the port this torrent_peer is or was connected on
boost::uint16_t port;
std::uint16_t port;
// the number of times this torrent_peer has been
// part of a piece that failed the hash check
boost::uint8_t hashfails;
std::uint8_t hashfails;
// the number of failed connection attempts
// this torrent_peer has

Some files were not shown because too many files have changed in this diff Show More