From cc1a4dcdd7dd0e4239590a07600bbc656a819d72 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Wed, 3 Dec 2014 09:05:09 +0000 Subject: [PATCH] fix examples build --- examples/client_test.cpp | 2 +- examples/connection_tester.cpp | 10 +++++----- examples/dump_torrent.cpp | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/examples/client_test.cpp b/examples/client_test.cpp index f9a057ed3..5ef65538b 100644 --- a/examples/client_test.cpp +++ b/examples/client_test.cpp @@ -2012,7 +2012,7 @@ int main(int argc, char* argv[]) if (print_file_progress && s.has_metadata) { - std::vector file_progress; + std::vector file_progress; h.file_progress(file_progress); std::vector file_status; h.file_status(file_status); diff --git a/examples/connection_tester.cpp b/examples/connection_tester.cpp index 884a77b30..7f639f2ce 100644 --- a/examples/connection_tester.cpp +++ b/examples/connection_tester.cpp @@ -729,17 +729,17 @@ void generate_torrent(std::vector& buf, int size, int num_files // 1 MiB piece size const int piece_size = 1024 * 1024; const int num_pieces = size; - const size_type total_size = size_type(piece_size) * num_pieces; + const boost::int64_t total_size = boost::int64_t(piece_size) * num_pieces; - size_type s = total_size; + boost::int64_t s = total_size; int i = 0; - size_type file_size = total_size / num_files; + boost::int64_t file_size = total_size / num_files; while (s > 0) { char b[100]; snprintf(b, sizeof(b), "%s/stress_test%d", torrent_name, i); ++i; - fs.add_file(b, (std::min)(s, size_type(file_size))); + fs.add_file(b, (std::min)(s, boost::int64_t(file_size))); s -= file_size; file_size += 200; } @@ -915,7 +915,7 @@ int main(int argc, char* argv[]) { char file_name[100]; snprintf(file_name, sizeof(file_name), "%s-%d/file-%d", torrent_file, i, j); - fs.add_file(file_name, size_type(j + i + 1) * 251); + fs.add_file(file_name, boost::int64_t(j + i + 1) * 251); } // 1 MiB piece size const int piece_size = 1024 * 1024; diff --git a/examples/dump_torrent.cpp b/examples/dump_torrent.cpp index e217587c6..b9b883324 100644 --- a/examples/dump_torrent.cpp +++ b/examples/dump_torrent.cpp @@ -131,7 +131,7 @@ int line_longer_than(libtorrent::lazy_entry const& e, int limit) break; case lazy_entry::int_t: { - size_type val = e.int_value(); + boost::int64_t val = e.int_value(); while (val > 0) { ++line_len; @@ -244,7 +244,7 @@ int main(int argc, char* argv[]) for (int i = 0; i < st.num_files(); ++i) { int first = st.map_file(i, 0, 0).piece; - int last = st.map_file(i, (std::max)(size_type(st.file_size(i))-1, size_type(0)), 0).piece; + int last = st.map_file(i, (std::max)(boost::int64_t(st.file_size(i))-1, boost::int64_t(0)), 0).piece; int flags = st.file_flags(i); printf(" %8" PRIx64 " %11" PRId64 " %c%c%c%c [ %5d, %5d ] %7u %s %s %s%s\n" , st.file_offset(i)