switch some using declarations to new-style typedefs. remove some redundant parenthesis

This commit is contained in:
arvidn 2017-09-17 23:50:33 +02:00 committed by Arvid Norberg
parent 65d16142aa
commit 6b55096ebd
7 changed files with 19 additions and 21 deletions

View File

@ -83,7 +83,7 @@ namespace libtorrent {
{
TORRENT_ASSERT(index >= 0);
TORRENT_ASSERT(index < size());
return (buf()[index / 32] & aux::host_to_network((0x80000000 >> (index & 31)))) != 0;
return (buf()[index / 32] & aux::host_to_network(0x80000000 >> (index & 31))) != 0;
}
// set bit at ``index`` to 0 (clear_bit) or 1 (set_bit).
@ -97,7 +97,7 @@ namespace libtorrent {
{
TORRENT_ASSERT(index >= 0);
TORRENT_ASSERT(index < size());
buf()[index / 32] |= aux::host_to_network((0x80000000 >> (index & 31)));
buf()[index / 32] |= aux::host_to_network(0x80000000 >> (index & 31));
}
// returns true if all bits in the bitfield are set

View File

@ -479,14 +479,14 @@ namespace libtorrent {
// returns the error_category for HTTP errors
TORRENT_EXPORT boost::system::error_category& http_category();
using boost::system::error_code;
using boost::system::error_condition;
using error_code = boost::system::error_code;
using error_condition = boost::system::error_condition;
// internal
using boost::system::generic_category;
using boost::system::system_category;
using boost::system::system_error;
using system_error = boost::system::system_error;
#ifndef BOOST_NO_EXCEPTIONS
#ifndef TORRENT_NO_DEPRECATE

View File

@ -180,8 +180,6 @@ namespace libtorrent {
constexpr open_mode_t attribute_mask = attribute_hidden | attribute_executable;
}
using namespace flags;
struct TORRENT_EXTRA_EXPORT file : boost::noncopyable
{
file();

View File

@ -44,9 +44,9 @@ POSSIBILITY OF SUCH DAMAGE.
namespace libtorrent {
#if defined TORRENT_BUILD_SIMULATOR
using sim::asio::io_service;
using io_service = sim::asio::io_service;
#else
using boost::asio::io_service;
using io_service = boost::asio::io_service;
#endif
}

View File

@ -68,17 +68,17 @@ POSSIBILITY OF SUCH DAMAGE.
namespace libtorrent {
#if defined TORRENT_BUILD_SIMULATOR
using sim::asio::ip::udp;
using sim::asio::ip::tcp;
using udp = sim::asio::ip::udp;
using tcp = sim::asio::ip::tcp;
using sim::asio::async_write;
using sim::asio::async_read;
using sim::asio::null_buffers;
using null_buffers = sim::asio::null_buffers;
#else
using boost::asio::ip::tcp;
using boost::asio::ip::udp;
using tcp = boost::asio::ip::tcp;
using udp = boost::asio::ip::udp;
using boost::asio::async_write;
using boost::asio::async_read;
using boost::asio::null_buffers;
using null_buffers = boost::asio::null_buffers;
#endif
#ifdef TORRENT_WINDOWS

View File

@ -58,11 +58,11 @@ namespace libtorrent {
using minutes32 = std::chrono::duration<std::int32_t, std::ratio<60>>;
using time_point32 = std::chrono::time_point<clock_type, seconds32>;
using std::chrono::seconds;
using std::chrono::milliseconds;
using std::chrono::microseconds;
using std::chrono::minutes;
using std::chrono::hours;
using seconds = std::chrono::seconds;
using milliseconds = std::chrono::milliseconds;
using microseconds = std::chrono::microseconds;
using minutes = std::chrono::minutes;
using hours = std::chrono::hours;
using std::chrono::duration_cast;
using std::chrono::time_point_cast;

View File

@ -51,7 +51,7 @@ POSSIBILITY OF SUCH DAMAGE.
using namespace lt;
using namespace lt::dht;
using namespace sim;
using namespace sim::chrono;
using sim::chrono::high_resolution_clock;
using namespace sim::asio;
using sim::simulation;
using sim::default_config;