fix warnings

This commit is contained in:
arvidn
2015-08-06 02:30:06 -04:00
parent 788e41c3bb
commit a91e7ce25d
11 changed files with 65 additions and 53 deletions

View File

@@ -249,7 +249,7 @@ public:
void get_item(char const* pk, std::string const& salt, boost::function<bool(item&)> f); void get_item(char const* pk, std::string const& salt, boost::function<bool(item&)> f);
bool verify_token(std::string const& token, char const* info_hash bool verify_token(std::string const& token, char const* info_hash
, udp::endpoint const& addr); , udp::endpoint const& addr) const;
std::string generate_token(udp::endpoint const& addr, char const* info_hash); std::string generate_token(udp::endpoint const& addr, char const* info_hash);

View File

@@ -692,7 +692,7 @@ namespace libtorrent
, std::vector<std::string> const* links , std::vector<std::string> const* links
, storage_error& error); , storage_error& error);
// helper functions for check_fastresume // helper functions for check_fastresume
int check_no_fastresume(storage_error& error); int check_no_fastresume(storage_error& error);
int check_init_storage(storage_error& error); int check_init_storage(storage_error& error);

View File

@@ -295,7 +295,7 @@ namespace libtorrent
bdecode_node::type_t bdecode_node::type() const bdecode_node::type_t bdecode_node::type() const
{ {
if (m_token_idx == -1) return none_t; if (m_token_idx == -1) return none_t;
return (bdecode_node::type_t)m_root_tokens[m_token_idx].type; return static_cast<bdecode_node::type_t>(m_root_tokens[m_token_idx].type);
} }
bdecode_node::operator bool() const bdecode_node::operator bool() const
@@ -958,7 +958,7 @@ done:
line_len += 4; line_len += 4;
break; break;
} }
if (line_len > limit) return -1; if (line_len > limit) return -1;
return line_len; return line_len;
} }
@@ -974,7 +974,7 @@ done:
else else
{ {
char tmp[5]; char tmp[5];
snprintf(tmp, sizeof(tmp), "\\x%02x", (unsigned char)str[i]); snprintf(tmp, sizeof(tmp), "\\x%02x", boost::uint8_t(str[i]));
ret += tmp; ret += tmp;
} }
} }

View File

@@ -678,7 +678,8 @@ cached_piece_entry* block_cache::add_dirty_block(disk_io_job* j)
// we're not allowed to add dirty blocks // we're not allowed to add dirty blocks
// for a deleted storage! // for a deleted storage!
TORRENT_ASSERT(std::find(m_deleted_storages.begin(), m_deleted_storages.end() TORRENT_ASSERT(std::find(m_deleted_storages.begin(), m_deleted_storages.end()
, std::make_pair(j->storage->files()->name(), (void const*)j->storage->files())) , std::make_pair(j->storage->files()->name()
, static_cast<void const*>(j->storage->files())))
== m_deleted_storages.end()); == m_deleted_storages.end());
#endif #endif
@@ -1127,9 +1128,9 @@ void block_cache::clear(tailqueue& jobs)
cached_piece_entry& pe = const_cast<cached_piece_entry&>(*p); cached_piece_entry& pe = const_cast<cached_piece_entry&>(*p);
#if TORRENT_USE_ASSERTS #if TORRENT_USE_ASSERTS
for (tailqueue_iterator i = pe.jobs.iterate(); i.get(); i.next()) for (tailqueue_iterator i = pe.jobs.iterate(); i.get(); i.next())
TORRENT_PIECE_ASSERT(((disk_io_job*)i.get())->piece == pe.piece, &pe); TORRENT_PIECE_ASSERT((static_cast<disk_io_job const*>(i.get()))->piece == pe.piece, &pe);
for (tailqueue_iterator i = pe.read_jobs.iterate(); i.get(); i.next()) for (tailqueue_iterator i = pe.read_jobs.iterate(); i.get(); i.next())
TORRENT_PIECE_ASSERT(((disk_io_job*)i.get())->piece == pe.piece, &pe); TORRENT_PIECE_ASSERT((static_cast<disk_io_job const*>(i.get()))->piece == pe.piece, &pe);
#endif #endif
// this also removes the jobs from the piece // this also removes the jobs from the piece
jobs.append(pe.jobs); jobs.append(pe.jobs);
@@ -1173,7 +1174,7 @@ void block_cache::move_to_ghost(cached_piece_entry* pe)
linked_list* ghost_list = &m_lru[pe->cache_state + 1]; linked_list* ghost_list = &m_lru[pe->cache_state + 1];
while (ghost_list->size() >= m_ghost_size) while (ghost_list->size() >= m_ghost_size)
{ {
cached_piece_entry* p = (cached_piece_entry*)ghost_list->front(); cached_piece_entry* p = static_cast<cached_piece_entry*>(ghost_list->front());
TORRENT_PIECE_ASSERT(p != pe, p); TORRENT_PIECE_ASSERT(p != pe, p);
TORRENT_PIECE_ASSERT(p->num_blocks == 0, p); TORRENT_PIECE_ASSERT(p->num_blocks == 0, p);
TORRENT_PIECE_ASSERT(p->refcount == 0, p); TORRENT_PIECE_ASSERT(p->refcount == 0, p);
@@ -1215,7 +1216,7 @@ void block_cache::insert_blocks(cached_piece_entry* pe, int block, file::iovec_t
// we're not allowed to add dirty blocks // we're not allowed to add dirty blocks
// for a deleted storage! // for a deleted storage!
TORRENT_ASSERT(std::find(m_deleted_storages.begin(), m_deleted_storages.end() TORRENT_ASSERT(std::find(m_deleted_storages.begin(), m_deleted_storages.end()
, std::make_pair(j->storage->files()->name(), (void const*)j->storage->files())) , std::make_pair(j->storage->files()->name(), static_cast<void const*>(j->storage->files())))
== m_deleted_storages.end()); == m_deleted_storages.end());
#endif #endif
@@ -1621,7 +1622,7 @@ void block_cache::check_invariant() const
, end(storages.end()); i != end; ++i) , end(storages.end()); i != end; ++i)
{ {
for (boost::unordered_set<cached_piece_entry*>::iterator j = (*i)->cached_pieces().begin() for (boost::unordered_set<cached_piece_entry*>::iterator j = (*i)->cached_pieces().begin()
, end((*i)->cached_pieces().end()); j != end; ++j) , end2((*i)->cached_pieces().end()); j != end2; ++j)
{ {
cached_piece_entry* pe = *j; cached_piece_entry* pe = *j;
TORRENT_PIECE_ASSERT(pe->storage.get() == *i, pe); TORRENT_PIECE_ASSERT(pe->storage.get() == *i, pe);
@@ -1640,7 +1641,7 @@ void block_cache::check_invariant() const
int num_pending = 0; int num_pending = 0;
int num_refcount = 0; int num_refcount = 0;
bool in_storage = p.storage->has_piece((cached_piece_entry*)&p); bool in_storage = p.storage->has_piece(&p);
switch (p.cache_state) switch (p.cache_state)
{ {
case cached_piece_entry::write_lru: case cached_piece_entry::write_lru:

View File

@@ -394,7 +394,7 @@ namespace libtorrent
} }
else else
{ {
TORRENT_ASSERT(false && "unknown seed choking algorithm"); TORRENT_ASSERT(false);
int pieces = sett.get_int(settings_pack::seeding_piece_quota); int pieces = sett.get_int(settings_pack::seeding_piece_quota);
std::partial_sort(peers.begin(), peers.begin() std::partial_sort(peers.begin(), peers.begin()

View File

@@ -120,7 +120,7 @@ node::node(udp_socket_interface* sock
} }
bool node::verify_token(std::string const& token, char const* info_hash bool node::verify_token(std::string const& token, char const* info_hash
, udp::endpoint const& addr) , udp::endpoint const& addr) const
{ {
if (token.length() != 4) if (token.length() != 4)
{ {
@@ -139,19 +139,19 @@ bool node::verify_token(std::string const& token, char const* info_hash
std::string address = addr.address().to_string(ec); std::string address = addr.address().to_string(ec);
if (ec) return false; if (ec) return false;
h1.update(&address[0], address.length()); h1.update(&address[0], address.length());
h1.update((char*)&m_secret[0], sizeof(m_secret[0])); h1.update(reinterpret_cast<char const*>(&m_secret[0]), sizeof(m_secret[0]));
h1.update((char*)info_hash, sha1_hash::size); h1.update(reinterpret_cast<char const*>(info_hash), sha1_hash::size);
sha1_hash h = h1.final(); sha1_hash h = h1.final();
if (std::equal(token.begin(), token.end(), (char*)&h[0])) if (std::equal(token.begin(), token.end(), reinterpret_cast<char*>(&h[0])))
return true; return true;
hasher h2; hasher h2;
h2.update(&address[0], address.length()); h2.update(&address[0], address.length());
h2.update((char*)&m_secret[1], sizeof(m_secret[1])); h2.update(reinterpret_cast<char const*>(&m_secret[1]), sizeof(m_secret[1]));
h2.update((char*)info_hash, sha1_hash::size); h2.update(info_hash, sha1_hash::size);
h = h2.final(); h = h2.final();
if (std::equal(token.begin(), token.end(), (char*)&h[0])) if (std::equal(token.begin(), token.end(), reinterpret_cast<char*>(&h[0])))
return true; return true;
return false; return false;
} }
@@ -165,12 +165,12 @@ std::string node::generate_token(udp::endpoint const& addr, char const* info_has
std::string address = addr.address().to_string(ec); std::string address = addr.address().to_string(ec);
TORRENT_ASSERT(!ec); TORRENT_ASSERT(!ec);
h.update(&address[0], address.length()); h.update(&address[0], address.length());
h.update((char*)&m_secret[0], sizeof(m_secret[0])); h.update(reinterpret_cast<char*>(&m_secret[0]), sizeof(m_secret[0]));
h.update(info_hash, sha1_hash::size); h.update(info_hash, sha1_hash::size);
sha1_hash hash = h.final(); sha1_hash hash = h.final();
std::copy(hash.begin(), hash.begin() + 4, (char*)&token[0]); std::copy(hash.begin(), hash.begin() + 4, reinterpret_cast<char*>(&token[0]));
TORRENT_ASSERT(std::equal(token.begin(), token.end(), (char*)&hash[0])); TORRENT_ASSERT(std::equal(token.begin(), token.end(), reinterpret_cast<char*>(&hash[0])));
return token; return token;
} }
@@ -674,7 +674,7 @@ void node::lookup_peers(sha1_hash const& info_hash, entry& reply
} }
else else
{ {
int num = (std::min)((int)v.peers.size(), m_settings.max_peers_reply); int num = (std::min)(int(v.peers.size()), m_settings.max_peers_reply);
std::set<peer_entry>::const_iterator iter = v.peers.begin(); std::set<peer_entry>::const_iterator iter = v.peers.begin();
entry::list_type& pe = reply["values"].list(); entry::list_type& pe = reply["values"].list();
std::string endpoint; std::string endpoint;
@@ -1131,7 +1131,8 @@ void node::incoming_request(msg const& m, entry& e)
// verify the write-token. tokens are only valid to write to // verify the write-token. tokens are only valid to write to
// specific target hashes. it must match the one we got a "get" for // specific target hashes. it must match the one we got a "get" for
if (!verify_token(msg_keys[0].string_value(), (char const*)&target[0], m.addr)) if (!verify_token(msg_keys[0].string_value()
, reinterpret_cast<char const*>(&target[0]), m.addr))
{ {
m_counters.inc_stats_counter(counters::dht_invalid_put); m_counters.inc_stats_counter(counters::dht_invalid_put);
incoming_error(e, "invalid token"); incoming_error(e, "invalid token");
@@ -1161,10 +1162,10 @@ void node::incoming_request(msg const& m, entry& e)
m_counters.inc_stats_counter(counters::dht_immutable_data, -1); m_counters.inc_stats_counter(counters::dht_immutable_data, -1);
} }
dht_immutable_item to_add; dht_immutable_item to_add;
to_add.value = (char*)malloc(buf.second); to_add.value = static_cast<char*>(malloc(buf.second));
to_add.size = buf.second; to_add.size = buf.second;
memcpy(to_add.value, buf.first, buf.second); memcpy(to_add.value, buf.first, buf.second);
boost::tie(i, boost::tuples::ignore) = m_immutable_table.insert( boost::tie(i, boost::tuples::ignore) = m_immutable_table.insert(
std::make_pair(target, to_add)); std::make_pair(target, to_add));
m_counters.inc_stats_counter(counters::dht_immutable_data); m_counters.inc_stats_counter(counters::dht_immutable_data);
@@ -1211,14 +1212,14 @@ void node::incoming_request(msg const& m, entry& e)
m_counters.inc_stats_counter(counters::dht_mutable_data, -1); m_counters.inc_stats_counter(counters::dht_mutable_data, -1);
} }
dht_mutable_item to_add; dht_mutable_item to_add;
to_add.value = (char*)malloc(buf.second); to_add.value = static_cast<char*>(malloc(buf.second));
to_add.size = buf.second; to_add.size = buf.second;
to_add.seq = msg_keys[2].int_value(); to_add.seq = msg_keys[2].int_value();
to_add.salt = NULL; to_add.salt = NULL;
to_add.salt_size = 0; to_add.salt_size = 0;
if (salt.second > 0) if (salt.second > 0)
{ {
to_add.salt = (char*)malloc(salt.second); to_add.salt = static_cast<char*>(malloc(salt.second));
to_add.salt_size = salt.second; to_add.salt_size = salt.second;
memcpy(to_add.salt, salt.first, salt.second); memcpy(to_add.salt, salt.first, salt.second);
} }
@@ -1262,7 +1263,7 @@ void node::incoming_request(msg const& m, entry& e)
if (item->size != buf.second) if (item->size != buf.second)
{ {
free(item->value); free(item->value);
item->value = (char*)malloc(buf.second); item->value = static_cast<char*>(malloc(buf.second));
item->size = buf.second; item->size = buf.second;
} }
item->seq = msg_keys[2].int_value(); item->seq = msg_keys[2].int_value();

View File

@@ -99,7 +99,7 @@ int distance_exp(node_id const& n1, node_id const& n2)
node_id generate_id_impl(address const& ip_, boost::uint32_t r) node_id generate_id_impl(address const& ip_, boost::uint32_t r)
{ {
boost::uint8_t* ip = 0; boost::uint8_t* ip = 0;
static const boost::uint8_t v4mask[] = { 0x03, 0x0f, 0x3f, 0xff }; static const boost::uint8_t v4mask[] = { 0x03, 0x0f, 0x3f, 0xff };
#if TORRENT_USE_IPV6 #if TORRENT_USE_IPV6
static const boost::uint8_t v6mask[] = { 0x01, 0x03, 0x07, 0x0f, 0x1f, 0x3f, 0x7f, 0xff }; static const boost::uint8_t v6mask[] = { 0x01, 0x03, 0x07, 0x0f, 0x1f, 0x3f, 0x7f, 0xff };
@@ -164,8 +164,8 @@ void make_id_secret(node_id& in)
// generate the last 4 bytes as a "signature" of the previous 4 bytes. This // generate the last 4 bytes as a "signature" of the previous 4 bytes. This
// lets us verify whether a hash came from this function or not in the future. // lets us verify whether a hash came from this function or not in the future.
hasher h((char*)&secret, 4); hasher h(reinterpret_cast<char*>(&secret), 4);
h.update((char*)&rand, 4); h.update(reinterpret_cast<char*>(&rand), 4);
sha1_hash secret_hash = h.final(); sha1_hash secret_hash = h.final();
memcpy(&in[20-4], &secret_hash[0], 4); memcpy(&in[20-4], &secret_hash[0], 4);
memcpy(&in[20-8], &rand, 4); memcpy(&in[20-8], &rand, 4);
@@ -189,8 +189,8 @@ bool verify_secret_id(node_id const& nid)
{ {
if (secret == 0) return false; if (secret == 0) return false;
hasher h((char*)&secret, 4); hasher h(reinterpret_cast<char*>(&secret), 4);
h.update((char const*)&nid[20-8], 4); h.update(reinterpret_cast<char const*>(&nid[20-8]), 4);
sha1_hash secret_hash = h.final(); sha1_hash secret_hash = h.final();
return memcmp(&nid[20-4], &secret_hash[0], 4) == 0; return memcmp(&nid[20-4], &secret_hash[0], 4) == 0;
} }

View File

@@ -263,8 +263,8 @@ bool rpc_manager::incoming(msg const& m, node_id* id
std::string transaction_id = m.message.dict_find_string_value("t"); std::string transaction_id = m.message.dict_find_string_value("t");
if (transaction_id.empty()) return false; if (transaction_id.empty()) return false;
std::string::const_iterator i = transaction_id.begin(); std::string::const_iterator ptr = transaction_id.begin();
int tid = transaction_id.size() != 2 ? -1 : io::read_uint16(i); int tid = transaction_id.size() != 2 ? -1 : io::read_uint16(ptr);
observer_ptr o; observer_ptr o;
std::pair<transactions_t::iterator, transactions_t::iterator> range = m_transactions.equal_range(tid); std::pair<transactions_t::iterator, transactions_t::iterator> range = m_transactions.equal_range(tid);
@@ -296,8 +296,8 @@ bool rpc_manager::incoming(msg const& m, node_id* id
time_point now = clock_type::now(); time_point now = clock_type::now();
#ifndef TORRENT_DISABLE_LOGGING #ifndef TORRENT_DISABLE_LOGGING
m_log->log(dht_logger::rpc_manager, "round trip time(ms): %" PRId64 " from %s" m_log->log(dht_logger::rpc_manager, "round trip time(ms): %" PRId64 " from %s"
, total_milliseconds(now - o->sent()), print_endpoint(m.addr).c_str()); , total_milliseconds(now - o->sent()), print_endpoint(m.addr).c_str());
#endif #endif
bdecode_node ret_ent = m.message.dict_find_dict("r"); bdecode_node ret_ent = m.message.dict_find_dict("r");

View File

@@ -147,7 +147,7 @@ void traversal_algorithm::add_entry(node_id const& id, udp::endpoint addr, unsig
, m_target) , m_target)
)); ));
std::vector<observer_ptr>::iterator i = std::lower_bound( std::vector<observer_ptr>::iterator iter = std::lower_bound(
m_results.begin() m_results.begin()
, m_results.end() , m_results.end()
, o , o
@@ -159,7 +159,7 @@ void traversal_algorithm::add_entry(node_id const& id, udp::endpoint addr, unsig
) )
); );
if (i == m_results.end() || (*i)->id() != id) if (iter == m_results.end() || (*iter)->id() != id)
{ {
if (m_node.settings().restrict_search_ips if (m_node.settings().restrict_search_ips
&& !(flags & observer::flag_initial)) && !(flags & observer::flag_initial))
@@ -189,7 +189,8 @@ void traversal_algorithm::add_entry(node_id const& id, udp::endpoint addr, unsig
m_peer4_prefixes.insert(prefix4); m_peer4_prefixes.insert(prefix4);
} }
TORRENT_ASSERT((o->flags & observer::flag_no_id) || std::find_if(m_results.begin(), m_results.end() TORRENT_ASSERT((o->flags & observer::flag_no_id)
|| std::find_if(m_results.begin(), m_results.end()
, boost::bind(&observer::id, _1) == id) == m_results.end()); , boost::bind(&observer::id, _1) == id) == m_results.end());
#ifndef TORRENT_DISABLE_LOGGING #ifndef TORRENT_DISABLE_LOGGING
@@ -203,7 +204,7 @@ void traversal_algorithm::add_entry(node_id const& id, udp::endpoint addr, unsig
, distance_exp(m_target, id), m_invoke_count, name()); , distance_exp(m_target, id), m_invoke_count, name());
} }
#endif #endif
i = m_results.insert(i, o); iter = m_results.insert(iter, o);
TORRENT_ASSERT(libtorrent::dht::is_sorted(m_results.begin(), m_results.end() TORRENT_ASSERT(libtorrent::dht::is_sorted(m_results.begin(), m_results.end()
, boost::bind( , boost::bind(

View File

@@ -86,7 +86,9 @@ namespace libtorrent
if (mp_read_unsigned_bin(&prime, dh_prime, sizeof(dh_prime))) if (mp_read_unsigned_bin(&prime, dh_prime, sizeof(dh_prime)))
return; return;
if (mp_read_unsigned_bin(&secret, (unsigned char*)m_dh_local_secret, sizeof(m_dh_local_secret))) if (mp_read_unsigned_bin(&secret
, reinterpret_cast<unsigned char*>(m_dh_local_secret)
, sizeof(m_dh_local_secret)))
return; return;
// generator is 2 // generator is 2
@@ -98,7 +100,9 @@ namespace libtorrent
// key is now our local key // key is now our local key
int size = mp_unsigned_bin_size(&key); int size = mp_unsigned_bin_size(&key);
memset(m_dh_local_key, 0, sizeof(m_dh_local_key) - size); memset(m_dh_local_key, 0, sizeof(m_dh_local_key) - size);
mp_to_unsigned_bin(&key, (unsigned char*)m_dh_local_key + sizeof(m_dh_local_key) - size); mp_to_unsigned_bin(&key
, reinterpret_cast<unsigned char*>(m_dh_local_key)
+ sizeof(m_dh_local_key) - size);
} }
char const* dh_key_exchange::get_local_key() const char const* dh_key_exchange::get_local_key() const
@@ -116,9 +120,12 @@ namespace libtorrent
if (mp_read_unsigned_bin(&prime, dh_prime, sizeof(dh_prime))) if (mp_read_unsigned_bin(&prime, dh_prime, sizeof(dh_prime)))
return -1; return -1;
if (mp_read_unsigned_bin(&secret, (unsigned char*)m_dh_local_secret, sizeof(m_dh_local_secret))) if (mp_read_unsigned_bin(&secret
, reinterpret_cast<unsigned char*>(m_dh_local_secret)
, sizeof(m_dh_local_secret)))
return -1; return -1;
if (mp_read_unsigned_bin(&remote_key, (unsigned char*)remote_pubkey, 96)) if (mp_read_unsigned_bin(&remote_key
, reinterpret_cast<const unsigned char*>(remote_pubkey), 96))
return -1; return -1;
if (mp_exptmod(&remote_key, &secret, &prime, &remote_key)) if (mp_exptmod(&remote_key, &secret, &prime, &remote_key))
@@ -127,7 +134,9 @@ namespace libtorrent
// remote_key is now the shared secret // remote_key is now the shared secret
int size = mp_unsigned_bin_size(&remote_key); int size = mp_unsigned_bin_size(&remote_key);
memset(m_dh_shared_secret, 0, sizeof(m_dh_shared_secret) - size); memset(m_dh_shared_secret, 0, sizeof(m_dh_shared_secret) - size);
mp_to_unsigned_bin(&remote_key, (unsigned char*)m_dh_shared_secret + sizeof(m_dh_shared_secret) - size); mp_to_unsigned_bin(&remote_key
, reinterpret_cast<unsigned char*>(m_dh_shared_secret)
+ sizeof(m_dh_shared_secret) - size);
// calculate the xor mask for the obfuscated hash // calculate the xor mask for the obfuscated hash
hasher h; hasher h;
@@ -306,14 +315,14 @@ namespace libtorrent
for (std::vector<boost::asio::mutable_buffer>::iterator i = buf.begin(); for (std::vector<boost::asio::mutable_buffer>::iterator i = buf.begin();
i != buf.end(); ++i) i != buf.end(); ++i)
{ {
char* pos = boost::asio::buffer_cast<char*>(*i); unsigned char* pos = boost::asio::buffer_cast<unsigned char*>(*i);
int len = boost::asio::buffer_size(*i); int len = boost::asio::buffer_size(*i);
TORRENT_ASSERT(len >= 0); TORRENT_ASSERT(len >= 0);
TORRENT_ASSERT(pos); TORRENT_ASSERT(pos);
bytes_processed += len; bytes_processed += len;
rc4_encrypt((unsigned char*)pos, len, &m_rc4_outgoing); rc4_encrypt(pos, len, &m_rc4_outgoing);
} }
buf.clear(); buf.clear();
return bytes_processed; return bytes_processed;
@@ -334,14 +343,14 @@ namespace libtorrent
for (std::vector<boost::asio::mutable_buffer>::iterator i = buf.begin(); for (std::vector<boost::asio::mutable_buffer>::iterator i = buf.begin();
i != buf.end(); ++i) i != buf.end(); ++i)
{ {
char* pos = boost::asio::buffer_cast<char*>(*i); unsigned char* pos = boost::asio::buffer_cast<unsigned char*>(*i);
int len = boost::asio::buffer_size(*i); int len = boost::asio::buffer_size(*i);
TORRENT_ASSERT(len >= 0); TORRENT_ASSERT(len >= 0);
TORRENT_ASSERT(pos); TORRENT_ASSERT(pos);
bytes_processed += len; bytes_processed += len;
rc4_encrypt(reinterpret_cast<unsigned char*>(pos), len, &m_rc4_incoming); rc4_encrypt(pos, len, &m_rc4_incoming);
} }
buf.clear(); buf.clear();
produce = bytes_processed; produce = bytes_processed;

View File

@@ -62,7 +62,7 @@ namespace libtorrent
// sizing the disk cache size when it's set to // sizing the disk cache size when it's set to
// automatic. // automatic.
boost::uint64_t ret = 0; boost::uint64_t ret = 0;
#ifdef TORRENT_BSD #ifdef TORRENT_BSD
#ifdef HW_MEMSIZE #ifdef HW_MEMSIZE
int mib[2] = { CTL_HW, HW_MEMSIZE }; int mib[2] = { CTL_HW, HW_MEMSIZE };