fixed some shadowed variable warnings
This commit is contained in:
parent
74ccff22be
commit
113fa0ba3d
|
@ -236,15 +236,15 @@ namespace libtorrent
|
|||
bool header_finished = m_parser.header_finished();
|
||||
if (!header_finished)
|
||||
{
|
||||
bool error = false;
|
||||
bool parse_error = false;
|
||||
int protocol = 0;
|
||||
int payload = 0;
|
||||
boost::tie(payload, protocol) = m_parser.incoming(recv_buffer, error);
|
||||
boost::tie(payload, protocol) = m_parser.incoming(recv_buffer, parse_error);
|
||||
m_statistics.received_bytes(0, protocol);
|
||||
bytes_transferred -= protocol;
|
||||
if (payload > front_request.length) payload = front_request.length;
|
||||
|
||||
if (error)
|
||||
if (parse_error)
|
||||
{
|
||||
m_statistics.received_bytes(0, bytes_transferred);
|
||||
disconnect(errors::http_parse_error, 2);
|
||||
|
|
|
@ -1904,7 +1904,6 @@ namespace aux {
|
|||
|
||||
// set our main IPv4 and IPv6 interfaces
|
||||
// used to send to the tracker
|
||||
error_code ec;
|
||||
std::vector<ip_interface> ifs = enum_net_interfaces(m_io_service, ec);
|
||||
for (std::vector<ip_interface>::const_iterator i = ifs.begin()
|
||||
, end(ifs.end()); i != end; ++i)
|
||||
|
|
|
@ -1601,13 +1601,13 @@ namespace libtorrent
|
|||
|
||||
const int num_bitmask_bytes = (std::max)(num_blocks_per_piece / 8, 1);
|
||||
if ((int)bitmask.size() != num_bitmask_bytes) continue;
|
||||
for (int j = 0; j < num_bitmask_bytes; ++j)
|
||||
for (int k = 0; k < num_bitmask_bytes; ++k)
|
||||
{
|
||||
unsigned char bits = bitmask[j];
|
||||
int num_bits = (std::min)(num_blocks_per_piece - j*8, 8);
|
||||
unsigned char bits = bitmask[k];
|
||||
int num_bits = (std::min)(num_blocks_per_piece - k*8, 8);
|
||||
for (int k = 0; k < num_bits; ++k)
|
||||
{
|
||||
const int bit = j * 8 + k;
|
||||
const int bit = k * 8 + k;
|
||||
if (bits & (1 << k))
|
||||
{
|
||||
m_picker->mark_as_finished(piece_block(piece, bit), 0);
|
||||
|
@ -4300,11 +4300,11 @@ namespace libtorrent
|
|||
// look up the country code in the map
|
||||
const int size = sizeof(country_map)/sizeof(country_map[0]);
|
||||
country_entry tmp = {country, ""};
|
||||
country_entry const* i =
|
||||
country_entry const* j =
|
||||
std::lower_bound(country_map, country_map + size, tmp
|
||||
, boost::bind(&country_entry::code, _1) < boost::bind(&country_entry::code, _2));
|
||||
if (i == country_map + size
|
||||
|| i->code != country)
|
||||
if (j == country_map + size
|
||||
|| j->code != country)
|
||||
{
|
||||
// unknown country!
|
||||
p->set_country("!!");
|
||||
|
@ -4314,7 +4314,7 @@ namespace libtorrent
|
|||
return;
|
||||
}
|
||||
|
||||
p->set_country(i->name);
|
||||
p->set_country(j->name);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -1447,8 +1447,8 @@ void upnp::on_expire(error_code const& ec)
|
|||
#if defined TORRENT_ASIO_DEBUGGING
|
||||
add_outstanding_async("upnp::on_expire");
|
||||
#endif
|
||||
error_code ec;
|
||||
m_refresh_timer.expires_at(next_expire, ec);
|
||||
error_code e;
|
||||
m_refresh_timer.expires_at(next_expire, e);
|
||||
m_refresh_timer.async_wait(boost::bind(&upnp::on_expire, self(), _1));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue