forked from premiere/premiere-libtorrent
fix examples build
This commit is contained in:
parent
1ed1963f29
commit
cc1a4dcdd7
|
@ -2012,7 +2012,7 @@ int main(int argc, char* argv[])
|
|||
|
||||
if (print_file_progress && s.has_metadata)
|
||||
{
|
||||
std::vector<size_type> file_progress;
|
||||
std::vector<boost::int64_t> file_progress;
|
||||
h.file_progress(file_progress);
|
||||
std::vector<pool_file_status> file_status;
|
||||
h.file_status(file_status);
|
||||
|
|
|
@ -729,17 +729,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 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;
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue