*** empty log message ***

This commit is contained in:
Arvid Norberg 2004-11-21 10:49:02 +00:00
parent 79a9a59fbf
commit 705e40fda6
4 changed files with 17 additions and 19 deletions

View File

@ -90,6 +90,7 @@ namespace libtorrent
if (v >= 0 && v < 10) return '0' + v; if (v >= 0 && v < 10) return '0' + v;
else if (v >= 10) return 'A' + (v - 10); else if (v >= 10) return 'A' + (v - 10);
assert(false); assert(false);
return '0';
} }
}; };

View File

@ -133,7 +133,7 @@ namespace libtorrent
} }
} }
#ifndef NDEBUG #ifndef NDEBUG
integrity_check(); // integrity_check();
#endif #endif
} }
@ -368,7 +368,7 @@ namespace libtorrent
move(true, m_piece_map[index].peer_count, m_piece_map[index].index); move(true, m_piece_map[index].peer_count, m_piece_map[index].index);
#ifndef NDEBUG #ifndef NDEBUG
integrity_check(); // integrity_check();
#endif #endif
} }
@ -389,7 +389,7 @@ namespace libtorrent
move(m_piece_map[i].downloading, peer_count, index); move(m_piece_map[i].downloading, peer_count, index);
#ifndef NDEBUG #ifndef NDEBUG
integrity_check(); // integrity_check();
#endif #endif
return; return;
} }
@ -423,7 +423,7 @@ namespace libtorrent
assert(info_index != 0xffffff); assert(info_index != 0xffffff);
remove(m_piece_map[index].downloading, peer_count, info_index); remove(m_piece_map[index].downloading, peer_count, info_index);
#ifndef NDEBUG #ifndef NDEBUG
integrity_check(); // integrity_check();
#endif #endif
} }
@ -435,7 +435,7 @@ namespace libtorrent
assert(pieces.size() == m_piece_map.size()); assert(pieces.size() == m_piece_map.size());
#ifndef NDEBUG #ifndef NDEBUG
integrity_check(); // integrity_check();
#endif #endif
// free refers to pieces that are free to download, noone else // free refers to pieces that are free to download, noone else
@ -582,7 +582,7 @@ namespace libtorrent
void piece_picker::mark_as_downloading(piece_block block, const address& peer) void piece_picker::mark_as_downloading(piece_block block, const address& peer)
{ {
#ifndef NDEBUG #ifndef NDEBUG
integrity_check(); // integrity_check();
#endif #endif
assert(block.piece_index >= 0); assert(block.piece_index >= 0);
assert(block.block_index >= 0); assert(block.block_index >= 0);
@ -611,14 +611,14 @@ namespace libtorrent
i->requested_blocks[block.block_index] = 1; i->requested_blocks[block.block_index] = 1;
} }
#ifndef NDEBUG #ifndef NDEBUG
integrity_check(); // integrity_check();
#endif #endif
} }
void piece_picker::mark_as_finished(piece_block block, const address& peer) void piece_picker::mark_as_finished(piece_block block, const address& peer)
{ {
#ifndef NDEBUG #ifndef NDEBUG
integrity_check(); // integrity_check();
#endif #endif
assert(block.piece_index >= 0); assert(block.piece_index >= 0);
assert(block.block_index >= 0); assert(block.block_index >= 0);
@ -648,7 +648,7 @@ namespace libtorrent
i->finished_blocks[block.block_index] = 1; i->finished_blocks[block.block_index] = 1;
} }
#ifndef NDEBUG #ifndef NDEBUG
integrity_check(); // integrity_check();
#endif #endif
} }
/* /*
@ -717,7 +717,7 @@ namespace libtorrent
void piece_picker::abort_download(piece_block block) void piece_picker::abort_download(piece_block block)
{ {
#ifndef NDEBUG #ifndef NDEBUG
integrity_check(); // integrity_check();
#endif #endif
assert(block.piece_index >= 0); assert(block.piece_index >= 0);
@ -752,7 +752,7 @@ namespace libtorrent
move(true, m_piece_map[block.piece_index].peer_count, m_piece_map[block.piece_index].index); move(true, m_piece_map[block.piece_index].peer_count, m_piece_map[block.piece_index].index);
} }
#ifndef NDEBUG #ifndef NDEBUG
integrity_check(); // integrity_check();
#endif #endif
} }

View File

@ -905,7 +905,6 @@ namespace libtorrent
return ret; return ret;
} }
// TODO: add a check to see if filenames are accepted on the // TODO: add a check to see if filenames are accepted on the
// current platform. // current platform.
// if the torrent already exists, this will throw duplicate_torrent // if the torrent already exists, this will throw duplicate_torrent
@ -947,7 +946,7 @@ namespace libtorrent
d.save_path = save_path; d.save_path = save_path;
d.info_hash = ti.info_hash(); d.info_hash = ti.info_hash();
d.resume_data = resume_data; d.resume_data = resume_data;
// add the torrent to the queue to be checked // add the torrent to the queue to be checked
m_checker_impl.m_torrents.push_back(d); m_checker_impl.m_torrents.push_back(d);
// and notify the thread that it got another // and notify the thread that it got another
@ -1301,11 +1300,11 @@ namespace libtorrent
, boost::bind((mem_fun_type)&entry::integer, _1)); , boost::bind((mem_fun_type)&entry::integer, _1));
#endif #endif
if (tmp_pieces.size() == info.num_pieces() if ((int)tmp_pieces.size() == info.num_pieces()
&& std::find_if(tmp_pieces.begin(), tmp_pieces.end() && std::find_if(tmp_pieces.begin(), tmp_pieces.end()
, boost::bind(std::less<int>(), _1, 0)) == tmp_pieces.end()) , boost::bind(std::less<int>(), _1, 0)) == tmp_pieces.end())
{ {
if (info.num_files() != file_sizes.size()) if (info.num_files() != (int)file_sizes.size())
return; return;
std::vector<size_type>::iterator fs = file_sizes.begin(); std::vector<size_type>::iterator fs = file_sizes.begin();

View File

@ -158,11 +158,9 @@ namespace libtorrent
int old_num_pieces = static_cast<int>(m_piece_hash.size()); int old_num_pieces = static_cast<int>(m_piece_hash.size());
m_piece_hash.resize(num_pieces); m_piece_hash.resize(num_pieces);
for (std::vector<sha1_hash>::iterator i = m_piece_hash.begin() + old_num_pieces; for (int i = old_num_pieces; i < num_pieces; ++i)
i != m_piece_hash.end();
++i)
{ {
i->clear(); m_piece_hash[i].clear();
} }
} }