diff --git a/include/libtorrent/alert.hpp b/include/libtorrent/alert.hpp index d6dfbd886..4dbb496ab 100644 --- a/include/libtorrent/alert.hpp +++ b/include/libtorrent/alert.hpp @@ -68,8 +68,7 @@ POSSIBILITY OF SUCH DAMAGE. namespace libtorrent { // hidden - struct alert_category_tag; - using alert_category_t = flags::bitfield_flag; + using alert_category_t = flags::bitfield_flag; // The ``alert`` class is the base class that specific messages are derived from. // alert types are not copyable, and cannot be constructed by the client. The diff --git a/include/libtorrent/alert_types.hpp b/include/libtorrent/alert_types.hpp index 89c80041f..bffd136f4 100644 --- a/include/libtorrent/alert_types.hpp +++ b/include/libtorrent/alert_types.hpp @@ -2552,8 +2552,7 @@ namespace libtorrent { }; // hidden - struct picker_flags_tag; - using picker_flags_t = flags::bitfield_flag; + using picker_flags_t = flags::bitfield_flag; // this is posted when one or more blocks are picked by the piece picker, // assuming the verbose piece picker logging is enabled (see diff --git a/include/libtorrent/aux_/escape_string.hpp b/include/libtorrent/aux_/escape_string.hpp index 74e255d91..5007df460 100644 --- a/include/libtorrent/aux_/escape_string.hpp +++ b/include/libtorrent/aux_/escape_string.hpp @@ -42,8 +42,7 @@ POSSIBILITY OF SUCH DAMAGE. namespace libtorrent { // hidden - struct encode_string_flags_tag; - using encode_string_flags_t = flags::bitfield_flag; + using encode_string_flags_t = flags::bitfield_flag; namespace string { diff --git a/include/libtorrent/aux_/session_interface.hpp b/include/libtorrent/aux_/session_interface.hpp index 7ea4a7903..f39275f48 100644 --- a/include/libtorrent/aux_/session_interface.hpp +++ b/include/libtorrent/aux_/session_interface.hpp @@ -89,8 +89,7 @@ namespace libtorrent { struct resolver_interface; // hidden - struct queue_position_tag; - using queue_position_t = aux::strong_typedef; + using queue_position_t = aux::strong_typedef; constexpr queue_position_t no_pos{-1}; constexpr queue_position_t last_pos{(std::numeric_limits::max)()}; @@ -110,8 +109,7 @@ namespace aux { struct session_settings; struct socket_type; - struct ip_source_tag; - using ip_source_t = flags::bitfield_flag; + using ip_source_t = flags::bitfield_flag; #if !defined TORRENT_DISABLE_LOGGING || TORRENT_USE_ASSERTS // This is the basic logging and debug interface offered by the session. diff --git a/include/libtorrent/create_torrent.hpp b/include/libtorrent/create_torrent.hpp index 0b1f779e5..ed53b3462 100644 --- a/include/libtorrent/create_torrent.hpp +++ b/include/libtorrent/create_torrent.hpp @@ -93,8 +93,7 @@ namespace libtorrent { class torrent_info; // hidden - struct create_flags_tag; - using create_flags_t = flags::bitfield_flag; + using create_flags_t = flags::bitfield_flag; // This class holds state for creating a torrent. After having added // all information to it, call create_torrent::generate() to generate diff --git a/include/libtorrent/disk_interface.hpp b/include/libtorrent/disk_interface.hpp index 559ce4a45..987f6d031 100644 --- a/include/libtorrent/disk_interface.hpp +++ b/include/libtorrent/disk_interface.hpp @@ -64,8 +64,7 @@ namespace libtorrent { struct storage_holder; - struct file_open_mode_tag; - using file_open_mode_t = flags::bitfield_flag; + using file_open_mode_t = flags::bitfield_flag; // this is a bittorrent constant constexpr int default_block_size = 0x4000; @@ -128,8 +127,7 @@ namespace libtorrent { using pool_file_status = open_file_state; #endif - struct disk_job_flags_tag; - using disk_job_flags_t = flags::bitfield_flag; + using disk_job_flags_t = flags::bitfield_flag; struct TORRENT_EXTRA_EXPORT disk_interface { diff --git a/include/libtorrent/download_priority.hpp b/include/libtorrent/download_priority.hpp index 4325e8d2d..fb2108ac4 100644 --- a/include/libtorrent/download_priority.hpp +++ b/include/libtorrent/download_priority.hpp @@ -37,8 +37,7 @@ POSSIBILITY OF SUCH DAMAGE. namespace libtorrent { -struct download_priority_tag; -using download_priority_t = aux::strong_typedef; +using download_priority_t = aux::strong_typedef; constexpr download_priority_t dont_download{0}; constexpr download_priority_t default_priority{4}; diff --git a/include/libtorrent/extensions.hpp b/include/libtorrent/extensions.hpp index c6df595cc..d39d110f7 100644 --- a/include/libtorrent/extensions.hpp +++ b/include/libtorrent/extensions.hpp @@ -186,11 +186,9 @@ namespace libtorrent { struct session_handle; struct peer_connection_handle; - struct feature_flags_tag; - // these are flags that can be returned by implemented_features() // indicating which callbacks this plugin is interested in - using feature_flags_t = flags::bitfield_flag; + using feature_flags_t = flags::bitfield_flag; // this is the base class for a session plugin. One primary feature // is that it is notified of all torrents that are added to the session, @@ -279,8 +277,7 @@ namespace libtorrent { virtual void load_state(bdecode_node const&) {} }; - struct add_peer_flags_tag; - using add_peer_flags_t = flags::bitfield_flag; + using add_peer_flags_t = flags::bitfield_flag; // Torrent plugins are associated with a single torrent and have a number // of functions called at certain events. Many of its functions have the diff --git a/include/libtorrent/file.hpp b/include/libtorrent/file.hpp index 31093e53d..d741399b2 100644 --- a/include/libtorrent/file.hpp +++ b/include/libtorrent/file.hpp @@ -128,8 +128,7 @@ namespace libtorrent { using file_handle = std::shared_ptr; // hidden - struct open_mode_tag; - using open_mode_t = flags::bitfield_flag; + using open_mode_t = flags::bitfield_flag; // the open mode for files. Used for the file constructor or // file::open(). diff --git a/include/libtorrent/file_storage.hpp b/include/libtorrent/file_storage.hpp index cc10f2373..34f20126a 100644 --- a/include/libtorrent/file_storage.hpp +++ b/include/libtorrent/file_storage.hpp @@ -193,8 +193,7 @@ namespace libtorrent { }; // hidden - struct file_flags_tag; - using file_flags_t = flags::bitfield_flag; + using file_flags_t = flags::bitfield_flag; // The ``file_storage`` class represents a file list and the piece // size. Everything necessary to interpret a regular bittorrent storage diff --git a/include/libtorrent/kademlia/observer.hpp b/include/libtorrent/kademlia/observer.hpp index 6dcdc5fe5..6d0d31f48 100644 --- a/include/libtorrent/kademlia/observer.hpp +++ b/include/libtorrent/kademlia/observer.hpp @@ -48,8 +48,7 @@ struct observer; struct msg; struct traversal_algorithm; -struct observer_flags_tag; -using observer_flags_t = libtorrent::flags::bitfield_flag; +using observer_flags_t = libtorrent::flags::bitfield_flag; struct TORRENT_EXTRA_EXPORT observer : std::enable_shared_from_this diff --git a/include/libtorrent/kademlia/traversal_algorithm.hpp b/include/libtorrent/kademlia/traversal_algorithm.hpp index d45193890..5ec98ef04 100644 --- a/include/libtorrent/kademlia/traversal_algorithm.hpp +++ b/include/libtorrent/kademlia/traversal_algorithm.hpp @@ -53,8 +53,7 @@ namespace dht { class node; struct node_endpoint; -struct traversal_flags_tag; -using traversal_flags_t = libtorrent::flags::bitfield_flag; +using traversal_flags_t = libtorrent::flags::bitfield_flag; // this class may not be instantiated as a stack object struct TORRENT_EXTRA_EXPORT traversal_algorithm diff --git a/include/libtorrent/link.hpp b/include/libtorrent/link.hpp index 7520c4046..4d91a9c13 100644 --- a/include/libtorrent/link.hpp +++ b/include/libtorrent/link.hpp @@ -38,8 +38,7 @@ POSSIBILITY OF SUCH DAMAGE. namespace libtorrent { - struct torrent_list_tag; - using torrent_list_index_t = aux::strong_typedef; + using torrent_list_index_t = aux::strong_typedef; struct link { diff --git a/include/libtorrent/part_file.hpp b/include/libtorrent/part_file.hpp index 3353f724d..ab6d6ac47 100644 --- a/include/libtorrent/part_file.hpp +++ b/include/libtorrent/part_file.hpp @@ -46,8 +46,7 @@ POSSIBILITY OF SUCH DAMAGE. namespace libtorrent { - struct slot_index_tag_t {}; - using slot_index_t = aux::strong_typedef; + using slot_index_t = aux::strong_typedef; struct TORRENT_EXTRA_EXPORT part_file { diff --git a/include/libtorrent/peer_class.hpp b/include/libtorrent/peer_class.hpp index 21aec777c..fe70baf1d 100644 --- a/include/libtorrent/peer_class.hpp +++ b/include/libtorrent/peer_class.hpp @@ -46,12 +46,7 @@ POSSIBILITY OF SUCH DAMAGE. namespace libtorrent { - namespace aux { - - struct peer_class_tag; - } - - using peer_class_t = aux::strong_typedef; + using peer_class_t = aux::strong_typedef; // holds settings for a peer class. Used in set_peer_class() and // get_peer_class() calls. diff --git a/include/libtorrent/peer_connection.hpp b/include/libtorrent/peer_connection.hpp index a4d482ff1..8b9bdb994 100644 --- a/include/libtorrent/peer_connection.hpp +++ b/include/libtorrent/peer_connection.hpp @@ -242,8 +242,7 @@ namespace aux { http_seed }; - struct request_flags_tag; - using request_flags_t = flags::bitfield_flag; + using request_flags_t = flags::bitfield_flag; class TORRENT_EXTRA_EXPORT peer_connection : public peer_connection_hot_members diff --git a/include/libtorrent/peer_info.hpp b/include/libtorrent/peer_info.hpp index 5535064d7..8dffe57fc 100644 --- a/include/libtorrent/peer_info.hpp +++ b/include/libtorrent/peer_info.hpp @@ -44,24 +44,19 @@ POSSIBILITY OF SUCH DAMAGE. namespace libtorrent { - // hidden - struct peer_flags_tag; - struct peer_source_flags_tag; - struct bandwidth_state_flags_tag; - // flags for the peer_info::flags field. Indicates various states // the peer may be in. These flags are not mutually exclusive, but // not every combination of them makes sense either. - using peer_flags_t = flags::bitfield_flag; + using peer_flags_t = flags::bitfield_flag; // the flags indicating which sources a peer can // have come from. A peer may have been seen from // multiple sources - using peer_source_flags_t = flags::bitfield_flag; + using peer_source_flags_t = flags::bitfield_flag; // flags indicating what is blocking network transfers in up- and down // direction - using bandwidth_state_flags_t = flags::bitfield_flag; + using bandwidth_state_flags_t = flags::bitfield_flag; // holds information and statistics about one peer // that libtorrent is connected to diff --git a/include/libtorrent/pex_flags.hpp b/include/libtorrent/pex_flags.hpp index 6f96c3f16..03bf4436a 100644 --- a/include/libtorrent/pex_flags.hpp +++ b/include/libtorrent/pex_flags.hpp @@ -37,8 +37,7 @@ POSSIBILITY OF SUCH DAMAGE. namespace libtorrent { - struct pex_flags_tag; - using pex_flags_t = flags::bitfield_flag; + using pex_flags_t = flags::bitfield_flag; // these flags match the flags passed in ut_pex // messages diff --git a/include/libtorrent/piece_picker.hpp b/include/libtorrent/piece_picker.hpp index ab21d7872..e58edd436 100644 --- a/include/libtorrent/piece_picker.hpp +++ b/include/libtorrent/piece_picker.hpp @@ -63,11 +63,8 @@ namespace libtorrent { struct counters; struct torrent_peer; - struct prio_index_tag_t {}; - using prio_index_t = aux::strong_typedef; - - struct picker_options_tag; - using picker_options_t = flags::bitfield_flag; + using prio_index_t = aux::strong_typedef; + using picker_options_t = flags::bitfield_flag; class TORRENT_EXTRA_EXPORT piece_picker { diff --git a/include/libtorrent/portmap.hpp b/include/libtorrent/portmap.hpp index 3462fa177..3a995cfb3 100644 --- a/include/libtorrent/portmap.hpp +++ b/include/libtorrent/portmap.hpp @@ -37,9 +37,6 @@ POSSIBILITY OF SUCH DAMAGE. #include "libtorrent/units.hpp" namespace libtorrent { -namespace aux { - struct port_mapping_tag; -} enum class portmap_transport : std::uint8_t { @@ -52,7 +49,7 @@ namespace aux { }; // this type represents an index referring to a port mapping - using port_mapping_t = aux::strong_typedef; + using port_mapping_t = aux::strong_typedef; } diff --git a/include/libtorrent/resolver_interface.hpp b/include/libtorrent/resolver_interface.hpp index e7936a0c0..509bcdd0b 100644 --- a/include/libtorrent/resolver_interface.hpp +++ b/include/libtorrent/resolver_interface.hpp @@ -44,8 +44,7 @@ POSSIBILITY OF SUCH DAMAGE. namespace libtorrent { // hidden -struct resolver_flag_tag; -using resolver_flags = flags::bitfield_flag; +using resolver_flags = flags::bitfield_flag; struct TORRENT_EXTRA_EXPORT resolver_interface { diff --git a/include/libtorrent/session_types.hpp b/include/libtorrent/session_types.hpp index 15b1b7227..1a5a3b09b 100644 --- a/include/libtorrent/session_types.hpp +++ b/include/libtorrent/session_types.hpp @@ -39,20 +39,16 @@ POSSIBILITY OF SUCH DAMAGE. namespace libtorrent { // hidden - struct save_state_flags_tag; - using save_state_flags_t = flags::bitfield_flag; + using save_state_flags_t = flags::bitfield_flag; // hidden - struct session_flags_tag; - using session_flags_t = flags::bitfield_flag; + using session_flags_t = flags::bitfield_flag; // hidden - struct remove_flags_tag; - using remove_flags_t = flags::bitfield_flag; + using remove_flags_t = flags::bitfield_flag; // hidden - struct reopen_network_flags_tag; - using reopen_network_flags_t = flags::bitfield_flag; + using reopen_network_flags_t = flags::bitfield_flag; } #endif diff --git a/include/libtorrent/storage_defs.hpp b/include/libtorrent/storage_defs.hpp index 9a79f3fd4..f06c1c595 100644 --- a/include/libtorrent/storage_defs.hpp +++ b/include/libtorrent/storage_defs.hpp @@ -48,8 +48,7 @@ namespace libtorrent { struct file_pool; class torrent_info; - struct storage_index_tag_t {}; - using storage_index_t = aux::strong_typedef; + using storage_index_t = aux::strong_typedef; // types of storage allocation used for add_torrent_params::storage_mode. enum storage_mode_t diff --git a/include/libtorrent/torrent_flags.hpp b/include/libtorrent/torrent_flags.hpp index 3d3a105f2..a2a4f2459 100644 --- a/include/libtorrent/torrent_flags.hpp +++ b/include/libtorrent/torrent_flags.hpp @@ -37,8 +37,7 @@ POSSIBILITY OF SUCH DAMAGE. namespace libtorrent { -struct torrent_flags_tag; -using torrent_flags_t = flags::bitfield_flag; +using torrent_flags_t = flags::bitfield_flag; namespace torrent_flags { diff --git a/include/libtorrent/torrent_handle.hpp b/include/libtorrent/torrent_handle.hpp index ec96fbfd9..3daead524 100644 --- a/include/libtorrent/torrent_handle.hpp +++ b/include/libtorrent/torrent_handle.hpp @@ -80,33 +80,16 @@ namespace aux { struct storage_interface; class torrent; - // hidden - struct status_flags_tag; - using status_flags_t = flags::bitfield_flag; - #ifndef BOOST_NO_EXCEPTIONS void TORRENT_NO_RETURN throw_invalid_handle(); #endif - // hidden - struct add_piece_flags_tag; - using add_piece_flags_t = flags::bitfield_flag; - - // hidden - struct pause_flags_tag; - using pause_flags_t = flags::bitfield_flag; - - // hidden - struct deadline_flags_tag; - using deadline_flags_t = flags::bitfield_flag; - - // hidden - struct resume_data_flags_tag; - using resume_data_flags_t = flags::bitfield_flag; - - // hidden - struct queue_position_tag; - using queue_position_t = aux::strong_typedef; + using status_flags_t = flags::bitfield_flag; + using add_piece_flags_t = flags::bitfield_flag; + using pause_flags_t = flags::bitfield_flag; + using deadline_flags_t = flags::bitfield_flag; + using resume_data_flags_t = flags::bitfield_flag; + using queue_position_t = aux::strong_typedef; // holds the state of a block in a piece. Who we requested // it from and how far along we are at downloading it. diff --git a/include/libtorrent/udp_socket.hpp b/include/libtorrent/udp_socket.hpp index 3a5e33874..b684ca435 100644 --- a/include/libtorrent/udp_socket.hpp +++ b/include/libtorrent/udp_socket.hpp @@ -48,8 +48,7 @@ namespace libtorrent { struct socks5; - struct udp_send_flags_tag; - using udp_send_flags_t = flags::bitfield_flag; + using udp_send_flags_t = flags::bitfield_flag; class TORRENT_EXTRA_EXPORT udp_socket : single_threaded { diff --git a/test/swarm_suite.hpp b/test/swarm_suite.hpp index 8aa520c3a..9668c9e28 100644 --- a/test/swarm_suite.hpp +++ b/test/swarm_suite.hpp @@ -33,16 +33,16 @@ POSSIBILITY OF SUCH DAMAGE. #include "test.hpp" #include "libtorrent/flags.hpp" -struct test_flags_tag; -using test_flags_t = libtorrent::flags::bitfield_flag; +using test_flags_t = libtorrent::flags::bitfield_flag; namespace test_flags { - constexpr test_flags_t super_seeding{1}; - constexpr test_flags_t strict_super_seeding{2}; - constexpr test_flags_t seed_mode{4}; - constexpr test_flags_t time_critical{8}; - constexpr test_flags_t suggest{16}; + using libtorrent::operator ""_bit; + constexpr test_flags_t super_seeding = 1_bit; + constexpr test_flags_t strict_super_seeding = 2_bit; + constexpr test_flags_t seed_mode = 3_bit; + constexpr test_flags_t time_critical = 4_bit; + constexpr test_flags_t suggest = 5_bit; } EXPORT void test_swarm(test_flags_t flags = test_flags_t{}); diff --git a/test/test_resume.cpp b/test/test_resume.cpp index 6769027f1..2cc0837aa 100644 --- a/test/test_resume.cpp +++ b/test/test_resume.cpp @@ -938,8 +938,7 @@ TORRENT_TEST(zero_file_prio) test_zero_file_prio(); } -struct test_mode_tag; -using test_mode_t = flags::bitfield_flag; +using test_mode_t = flags::bitfield_flag; namespace test_mode { constexpr test_mode_t file_prio = 0_bit; diff --git a/test/test_transfer.cpp b/test/test_transfer.cpp index ffb803235..f39a2624e 100644 --- a/test/test_transfer.cpp +++ b/test/test_transfer.cpp @@ -122,8 +122,7 @@ storage_interface* test_storage_constructor(storage_params const& params, file_p return new test_storage(params, pool); } -struct transfer_tag; -using transfer_flags_t = lt::flags::bitfield_flag; +using transfer_flags_t = lt::flags::bitfield_flag; constexpr transfer_flags_t disk_full = 1_bit; constexpr transfer_flags_t delete_files = 2_bit;