raise warning level. fix a few of them. filter out warnings from boost

This commit is contained in:
Arvid Norberg 2015-04-18 02:33:39 +00:00
parent 1b20755c03
commit 408232cfc8
99 changed files with 724 additions and 592 deletions

52
Jamfile
View File

@ -225,6 +225,33 @@ rule linking ( properties * )
return $(result) ; return $(result) ;
} }
rule warnings ( properties * )
{
local result ;
if <toolset>clang in $(properties)
|| <toolset>darwin in $(properties)
{
result += <cflags>-Weverything ;
result += <cflags>-Wno-documentation ;
result += <cflags>-Wno-c++98-compat-pedantic ;
result += <cflags>-Wno-padded ;
result += <cflags>-Wno-global-constructors ;
result += <cflags>-Wno-c++98-compat ;
result += <cflags>-Wno-exit-time-destructors ;
result += <cflags>-Wno-documentation-unknown-command ;
result += <cflags>-Wno-disabled-macro-expansion ;
}
if <toolset>msvc in $(properties)
{
# disable warning C4503: decorated name length exceeded, name was truncated
result += <cflags>/wd4503 ;
result += <cflags>/W4 ;
}
return $(result) ;
}
# rule for adding the right source files # rule for adding the right source files
# depending on target-os and features # depending on target-os and features
rule building ( properties * ) rule building ( properties * )
@ -679,26 +706,10 @@ local usage-requirements =
# these compiler settings just makes the compiler standard conforming # these compiler settings just makes the compiler standard conforming
<toolset>msvc:<cflags>/Zc:wchar_t <toolset>msvc:<cflags>/Zc:wchar_t
<toolset>msvc:<cflags>/Zc:forScope <toolset>msvc:<cflags>/Zc:forScope
# disable bogus deprecation warnings on msvc8
<toolset>msvc:<define>_SCL_SECURE_NO_DEPRECATE
<toolset>msvc:<define>_CRT_SECURE_NO_DEPRECATE
# msvc optimizations # msvc optimizations
<toolset>msvc,<variant>release:<linkflags>/OPT:ICF=5 <toolset>msvc,<variant>release:<linkflags>/OPT:ICF=5
<toolset>msvc,<variant>release:<linkflags>/OPT:REF <toolset>msvc,<variant>release:<linkflags>/OPT:REF
# disable warning C4503: decorated name length exceeded, name was truncated
<toolset>msvc:<cxxflags>/wd4503
# disable warning C4275: non-dll interface class 'x' used as base for dll-interface struct 'y'
<toolset>msvc:<cxxflags>/wd4275
# disable warning C4251: 'x' needs to have dll-interface to be used by clients of class 'y'
<toolset>msvc:<cxxflags>/wd4251
# disable some warnings for gcc
<toolset>gcc:<cflags>-fno-strict-aliasing
<toolset>gcc:<cflags>-Wno-missing-braces
<toolset>gcc:<cflags>-Wno-unused-local-typedefs
# suppress warnings caused by boost using c++11 features even when not
# in c++11 mode
<toolset>darwin:<cxxflags>-Wno-c++11-extensions
# assert on integer overflow
<boost>system:<cxxflags>$(CXXFLAGS) <boost>system:<cxxflags>$(CXXFLAGS)
<boost>system:<linkflags>$(LDFLAGS) <boost>system:<linkflags>$(LDFLAGS)
# this works around a bug in asio in boost-1.39 # this works around a bug in asio in boost-1.39
@ -736,19 +747,22 @@ lib torrent
<dht>logging:<source>ed25519/src/$(ED25519_SOURCES).cpp <dht>logging:<source>ed25519/src/$(ED25519_SOURCES).cpp
<conditional>@building <conditional>@building
<conditional>@warnings
<boost>system:<cxxflags>$(CXXFLAGS) <boost>system:<cxxflags>$(CXXFLAGS)
# disable bogus deprecation warnings on msvc8
<toolset>msvc:<define>_SCL_SECURE_NO_DEPRECATE
<toolset>msvc:<define>_CRT_SECURE_NO_DEPRECATE
$(usage-requirements) $(usage-requirements)
: # default build : # default build
<link>static <link>static
<threading>multi <threading>multi
<warnings>all
: # usage requirements : # usage requirements
$(usage-requirements) $(usage-requirements)
<link>shared:<define>TORRENT_LINKING_SHARED <link>shared:<define>TORRENT_LINKING_SHARED
; ;
headers = [ path.glob-tree include/libtorrent : *.hpp ] ; headers = [ path.glob-tree include/libtorrent : *.hpp ] ;

View File

@ -50,7 +50,7 @@ std::string to_string(int v, int width)
std::string add_suffix(float val, char const* suffix) std::string add_suffix(float val, char const* suffix)
{ {
if (val == 0) if (val < 0.001f)
{ {
std::string ret; std::string ret;
ret.resize(4 + 2, ' '); ret.resize(4 + 2, ' ');
@ -85,7 +85,7 @@ std::string const& progress_bar(int progress, int width, color_code c
{ {
static std::string bar; static std::string bar;
bar.clear(); bar.clear();
bar.reserve(width + 10); bar.reserve(size_t(width + 10));
int progress_chars = (progress * width + 500) / 1000; int progress_chars = (progress * width + 500) / 1000;
@ -105,7 +105,7 @@ std::string const& progress_bar(int progress, int width, color_code c
if (c == col_black || c == col_blue) if (c == col_black || c == col_blue)
tc = col_white; tc = col_white;
caption.resize(width, ' '); caption.resize(size_t(width), ' ');
char str[256]; char str[256];
if (flags & progress_invert) if (flags & progress_invert)
@ -180,7 +180,7 @@ void terminal_size(int* terminal_width, int* terminal_height)
#else #else
int tty = open("/dev/tty", O_RDONLY); int tty = open("/dev/tty", O_RDONLY);
winsize size; winsize size;
int ret = ioctl(tty, TIOCGWINSZ, (char*)&size); int ret = ioctl(tty, TIOCGWINSZ, reinterpret_cast<char*>(&size));
close(tty); close(tty);
if (ret == 0) if (ret == 0)
{ {

View File

@ -13,7 +13,7 @@ enum color_code
col_blue = 4, col_blue = 4,
col_magenta = 5, col_magenta = 5,
col_cyan = 6, col_cyan = 6,
col_white = 7, col_white = 7
}; };
char const* esc(char const* code); char const* esc(char const* code);

View File

@ -36,6 +36,8 @@ POSSIBILITY OF SUCH DAMAGE.
#include <boost/version.hpp> #include <boost/version.hpp>
#include "libtorrent/config.hpp" #include "libtorrent/config.hpp"
#include "aux_/disable_warnings_push.hpp"
#ifdef __OBJC__ #ifdef __OBJC__
#define Protocol Protocol_ #define Protocol Protocol_
#endif #endif
@ -51,6 +53,8 @@ POSSIBILITY OF SUCH DAMAGE.
#include <boost/asio/ip/address.hpp> #include <boost/asio/ip/address.hpp>
#endif #endif
#include "aux_/disable_warnings_pop.hpp"
#ifdef __OBJC__ #ifdef __OBJC__
#undef Protocol #undef Protocol
#endif #endif

View File

@ -38,9 +38,7 @@ POSSIBILITY OF SUCH DAMAGE.
#include <string> #include <string>
#include <vector> #include <vector>
#ifdef _MSC_VER #include "aux_/disable_warnings_push.hpp"
#pragma warning(push, 1)
#endif
#include <boost/preprocessor/repetition/enum_params_with_a_default.hpp> #include <boost/preprocessor/repetition/enum_params_with_a_default.hpp>
#include <boost/preprocessor/repetition/enum.hpp> #include <boost/preprocessor/repetition/enum.hpp>
@ -48,6 +46,8 @@ POSSIBILITY OF SUCH DAMAGE.
#include <boost/preprocessor/repetition/enum_shifted_params.hpp> #include <boost/preprocessor/repetition/enum_shifted_params.hpp>
#include <boost/preprocessor/repetition/enum_shifted_binary_params.hpp> #include <boost/preprocessor/repetition/enum_shifted_binary_params.hpp>
#include "aux_/disable_warnings_pop.hpp"
// OVERVIEW // OVERVIEW
// //
// The pop_alerts() function on session is the main interface for retrieving // The pop_alerts() function on session is the main interface for retrieving
@ -74,10 +74,6 @@ POSSIBILITY OF SUCH DAMAGE.
// call to pop_alerts(). Internal members of alerts also become invalid once // call to pop_alerts(). Internal members of alerts also become invalid once
// pop_alerts() is called again. // pop_alerts() is called again.
#ifdef _MSC_VER
#pragma warning(pop)
#endif
#include "libtorrent/time.hpp" #include "libtorrent/time.hpp"
#include "libtorrent/config.hpp" #include "libtorrent/config.hpp"
@ -273,7 +269,7 @@ namespace libtorrent {
#ifndef BOOST_NO_EXCEPTIONS #ifndef BOOST_NO_EXCEPTIONS
#ifndef TORRENT_NO_DEPRECATE #ifndef TORRENT_NO_DEPRECATE
struct TORRENT_EXPORT unhandled_alert : std::exception struct TORRENT_DEPRECATED TORRENT_EXPORT unhandled_alert : std::exception
{ {
unhandled_alert() {} unhandled_alert() {}
}; };
@ -286,6 +282,7 @@ namespace libtorrent {
template<class Handler template<class Handler
, BOOST_PP_ENUM_PARAMS(TORRENT_MAX_ALERT_TYPES, class T)> , BOOST_PP_ENUM_PARAMS(TORRENT_MAX_ALERT_TYPES, class T)>
TORRENT_DEPRECATED
void handle_alert_dispatch( void handle_alert_dispatch(
const std::auto_ptr<alert>& alert_, const Handler& handler const std::auto_ptr<alert>& alert_, const Handler& handler
, const std::type_info& typeid_ , const std::type_info& typeid_
@ -296,10 +293,11 @@ namespace libtorrent {
else else
handle_alert_dispatch(alert_, handler, typeid_ handle_alert_dispatch(alert_, handler, typeid_
, BOOST_PP_ENUM_SHIFTED_PARAMS( , BOOST_PP_ENUM_SHIFTED_PARAMS(
TORRENT_MAX_ALERT_TYPES, p), (void_*)0); TORRENT_MAX_ALERT_TYPES, p), reinterpret_cast<void_*>(0));
} }
template<class Handler> template<class Handler>
TORRENT_DEPRECATED
void handle_alert_dispatch( void handle_alert_dispatch(
const std::auto_ptr<alert>& const std::auto_ptr<alert>&
, const Handler& , const Handler&
@ -313,13 +311,13 @@ namespace libtorrent {
template<BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT( template<BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(
TORRENT_MAX_ALERT_TYPES, class T, detail::void_)> TORRENT_MAX_ALERT_TYPES, class T, detail::void_)>
struct TORRENT_EXPORT handle_alert struct TORRENT_DEPRECATED TORRENT_EXPORT handle_alert
{ {
template<class Handler> template<class Handler>
handle_alert(const std::auto_ptr<alert>& alert_ handle_alert(const std::auto_ptr<alert>& alert_
, const Handler& handler) , const Handler& handler)
{ {
#define ALERT_POINTER_TYPE(z, n, text) (BOOST_PP_CAT(T, n)*)0 #define ALERT_POINTER_TYPE(z, n, text) reinterpret_cast<BOOST_PP_CAT(T, n)*>(0)
detail::handle_alert_dispatch(alert_, handler, typeid(*alert_) detail::handle_alert_dispatch(alert_, handler, typeid(*alert_)
, BOOST_PP_ENUM(TORRENT_MAX_ALERT_TYPES, ALERT_POINTER_TYPE, _)); , BOOST_PP_ENUM(TORRENT_MAX_ALERT_TYPES, ALERT_POINTER_TYPE, _));

View File

@ -39,6 +39,8 @@ POSSIBILITY OF SUCH DAMAGE.
#include "libtorrent/heterogeneous_queue.hpp" #include "libtorrent/heterogeneous_queue.hpp"
#include "libtorrent/stack_allocator.hpp" #include "libtorrent/stack_allocator.hpp"
#include "aux_/disable_warnings_push.hpp"
#ifndef TORRENT_NO_DEPRECATE #ifndef TORRENT_NO_DEPRECATE
#include <boost/function/function1.hpp> #include <boost/function/function1.hpp>
#endif #endif
@ -47,6 +49,8 @@ POSSIBILITY OF SUCH DAMAGE.
#include <list> #include <list>
#include <utility> // for std::forward #include <utility> // for std::forward
#include "aux_/disable_warnings_pop.hpp"
// used for emplace_alert() variadic template emulation for c++98 // used for emplace_alert() variadic template emulation for c++98
#define TORRENT_ALERT_MANAGER_MAX_ARITY 7 #define TORRENT_ALERT_MANAGER_MAX_ARITY 7

View File

@ -166,7 +166,7 @@ namespace libtorrent
// internal // internal
torrent_added_alert(aux::stack_allocator& alloc, torrent_handle const& h); torrent_added_alert(aux::stack_allocator& alloc, torrent_handle const& h);
TORRENT_DEFINE_ALERT(torrent_added_alert, 3); TORRENT_DEFINE_ALERT(torrent_added_alert, 3)
static const int static_category = alert::status_notification; static const int static_category = alert::status_notification;
virtual std::string message() const; virtual std::string message() const;
}; };
@ -189,7 +189,7 @@ namespace libtorrent
torrent_removed_alert(aux::stack_allocator& alloc torrent_removed_alert(aux::stack_allocator& alloc
, torrent_handle const& h, sha1_hash const& ih); , torrent_handle const& h, sha1_hash const& ih);
TORRENT_DEFINE_ALERT_PRIO(torrent_removed_alert, 4); TORRENT_DEFINE_ALERT_PRIO(torrent_removed_alert, 4)
static const int static_category = alert::status_notification; static const int static_category = alert::status_notification;
virtual std::string message() const; virtual std::string message() const;
#ifndef TORRENT_NO_DEPRECATE #ifndef TORRENT_NO_DEPRECATE
@ -213,7 +213,7 @@ namespace libtorrent
, int p, boost::shared_array<char> d, int s); , int p, boost::shared_array<char> d, int s);
read_piece_alert(aux::stack_allocator& alloc, torrent_handle h, int p, error_code e); read_piece_alert(aux::stack_allocator& alloc, torrent_handle h, int p, error_code e);
TORRENT_DEFINE_ALERT_PRIO(read_piece_alert, 5); TORRENT_DEFINE_ALERT_PRIO(read_piece_alert, 5)
static const int static_category = alert::storage_notification; static const int static_category = alert::storage_notification;
virtual std::string message() const; virtual std::string message() const;
@ -235,7 +235,7 @@ namespace libtorrent
file_completed_alert(aux::stack_allocator& alloc, torrent_handle const& h file_completed_alert(aux::stack_allocator& alloc, torrent_handle const& h
, int idx); , int idx);
TORRENT_DEFINE_ALERT(file_completed_alert, 6); TORRENT_DEFINE_ALERT(file_completed_alert, 6)
static const int static_category = alert::progress_notification; static const int static_category = alert::progress_notification;
virtual std::string message() const; virtual std::string message() const;
@ -253,7 +253,7 @@ namespace libtorrent
, std::string const& n , std::string const& n
, int idx); , int idx);
TORRENT_DEFINE_ALERT_PRIO(file_renamed_alert, 7); TORRENT_DEFINE_ALERT_PRIO(file_renamed_alert, 7)
static const int static_category = alert::storage_notification; static const int static_category = alert::storage_notification;
virtual std::string message() const; virtual std::string message() const;
@ -280,7 +280,7 @@ namespace libtorrent
, torrent_handle const& h, int idx , torrent_handle const& h, int idx
, error_code ec); , error_code ec);
TORRENT_DEFINE_ALERT_PRIO(file_rename_failed_alert, 8); TORRENT_DEFINE_ALERT_PRIO(file_rename_failed_alert, 8)
static const int static_category = alert::storage_notification; static const int static_category = alert::storage_notification;
@ -384,7 +384,7 @@ namespace libtorrent
performance_alert(aux::stack_allocator& alloc, torrent_handle const& h performance_alert(aux::stack_allocator& alloc, torrent_handle const& h
, performance_warning_t w); , performance_warning_t w);
TORRENT_DEFINE_ALERT(performance_alert, 9); TORRENT_DEFINE_ALERT(performance_alert, 9)
static const int static_category = alert::performance_warning; static const int static_category = alert::performance_warning;
@ -401,7 +401,7 @@ namespace libtorrent
, torrent_status::state_t st , torrent_status::state_t st
, torrent_status::state_t prev_st); , torrent_status::state_t prev_st);
TORRENT_DEFINE_ALERT(state_changed_alert, 10); TORRENT_DEFINE_ALERT(state_changed_alert, 10)
static const int static_category = alert::status_notification; static const int static_category = alert::status_notification;
@ -433,7 +433,7 @@ namespace libtorrent
, error_code const& e , error_code const& e
, std::string const& m); , std::string const& m);
TORRENT_DEFINE_ALERT(tracker_error_alert, 11); TORRENT_DEFINE_ALERT(tracker_error_alert, 11)
static const int static_category = alert::tracker_notification | alert::error_notification; static const int static_category = alert::tracker_notification | alert::error_notification;
virtual std::string message() const; virtual std::string message() const;
@ -463,7 +463,7 @@ namespace libtorrent
, std::string const& u , std::string const& u
, std::string const& m); , std::string const& m);
TORRENT_DEFINE_ALERT(tracker_warning_alert, 12); TORRENT_DEFINE_ALERT(tracker_warning_alert, 12)
static const int static_category = alert::tracker_notification | alert::error_notification; static const int static_category = alert::tracker_notification | alert::error_notification;
virtual std::string message() const; virtual std::string message() const;
@ -490,7 +490,7 @@ namespace libtorrent
, int comp , int comp
, std::string const& u); , std::string const& u);
TORRENT_DEFINE_ALERT(scrape_reply_alert, 13); TORRENT_DEFINE_ALERT(scrape_reply_alert, 13)
virtual std::string message() const; virtual std::string message() const;
@ -515,7 +515,7 @@ namespace libtorrent
, std::string const& u , std::string const& u
, std::string const& m); , std::string const& m);
TORRENT_DEFINE_ALERT(scrape_failed_alert, 14); TORRENT_DEFINE_ALERT(scrape_failed_alert, 14)
static const int static_category = alert::tracker_notification | alert::error_notification; static const int static_category = alert::tracker_notification | alert::error_notification;
virtual std::string message() const; virtual std::string message() const;
@ -549,7 +549,7 @@ namespace libtorrent
, int np , int np
, std::string const& u); , std::string const& u);
TORRENT_DEFINE_ALERT(tracker_reply_alert, 15); TORRENT_DEFINE_ALERT(tracker_reply_alert, 15)
virtual std::string message() const; virtual std::string message() const;
@ -570,7 +570,7 @@ namespace libtorrent
, torrent_handle const& h , torrent_handle const& h
, int np); , int np);
TORRENT_DEFINE_ALERT(dht_reply_alert, 16); TORRENT_DEFINE_ALERT(dht_reply_alert, 16)
virtual std::string message() const; virtual std::string message() const;
@ -587,7 +587,7 @@ namespace libtorrent
, torrent_handle const& h , torrent_handle const& h
, std::string const& u, int e); , std::string const& u, int e);
TORRENT_DEFINE_ALERT(tracker_announce_alert, 17); TORRENT_DEFINE_ALERT(tracker_announce_alert, 17)
virtual std::string message() const; virtual std::string message() const;
@ -608,7 +608,7 @@ namespace libtorrent
hash_failed_alert(aux::stack_allocator& alloc, torrent_handle const& h hash_failed_alert(aux::stack_allocator& alloc, torrent_handle const& h
, int index); , int index);
TORRENT_DEFINE_ALERT(hash_failed_alert, 18); TORRENT_DEFINE_ALERT(hash_failed_alert, 18)
static const int static_category = alert::status_notification; static const int static_category = alert::status_notification;
virtual std::string message() const; virtual std::string message() const;
@ -624,7 +624,7 @@ namespace libtorrent
peer_ban_alert(aux::stack_allocator& alloc, torrent_handle h peer_ban_alert(aux::stack_allocator& alloc, torrent_handle h
, tcp::endpoint const& ep, peer_id const& peer_id); , tcp::endpoint const& ep, peer_id const& peer_id);
TORRENT_DEFINE_ALERT(peer_ban_alert, 19); TORRENT_DEFINE_ALERT(peer_ban_alert, 19)
virtual std::string message() const; virtual std::string message() const;
}; };
@ -637,7 +637,7 @@ namespace libtorrent
peer_unsnubbed_alert(aux::stack_allocator& alloc, torrent_handle h peer_unsnubbed_alert(aux::stack_allocator& alloc, torrent_handle h
, tcp::endpoint const& ep, peer_id const& peer_id); , tcp::endpoint const& ep, peer_id const& peer_id);
TORRENT_DEFINE_ALERT(peer_unsnubbed_alert, 20); TORRENT_DEFINE_ALERT(peer_unsnubbed_alert, 20)
virtual std::string message() const; virtual std::string message() const;
}; };
@ -650,7 +650,7 @@ namespace libtorrent
peer_snubbed_alert(aux::stack_allocator& alloc, torrent_handle h peer_snubbed_alert(aux::stack_allocator& alloc, torrent_handle h
, tcp::endpoint const& ep, peer_id const& peer_id); , tcp::endpoint const& ep, peer_id const& peer_id);
TORRENT_DEFINE_ALERT(peer_snubbed_alert, 21); TORRENT_DEFINE_ALERT(peer_snubbed_alert, 21)
virtual std::string message() const; virtual std::string message() const;
}; };
@ -664,7 +664,7 @@ namespace libtorrent
, tcp::endpoint const& ep, peer_id const& peer_id, int op , tcp::endpoint const& ep, peer_id const& peer_id, int op
, error_code const& e); , error_code const& e);
TORRENT_DEFINE_ALERT(peer_error_alert, 22); TORRENT_DEFINE_ALERT(peer_error_alert, 22)
static const int static_category = alert::peer_notification; static const int static_category = alert::peer_notification;
virtual std::string message() const; virtual std::string message() const;
@ -688,7 +688,7 @@ namespace libtorrent
peer_connect_alert(aux::stack_allocator& alloc, torrent_handle h peer_connect_alert(aux::stack_allocator& alloc, torrent_handle h
, tcp::endpoint const& ep, peer_id const& peer_id, int type); , tcp::endpoint const& ep, peer_id const& peer_id, int type);
TORRENT_DEFINE_ALERT(peer_connect_alert, 23); TORRENT_DEFINE_ALERT(peer_connect_alert, 23)
static const int static_category = alert::debug_notification; static const int static_category = alert::debug_notification;
virtual std::string message() const; virtual std::string message() const;
@ -706,7 +706,7 @@ namespace libtorrent
, peer_id const& peer_id, operation_t op, int type, error_code const& e , peer_id const& peer_id, operation_t op, int type, error_code const& e
, close_reason_t r); , close_reason_t r);
TORRENT_DEFINE_ALERT(peer_disconnected_alert, 24); TORRENT_DEFINE_ALERT(peer_disconnected_alert, 24)
static const int static_category = alert::debug_notification; static const int static_category = alert::debug_notification;
virtual std::string message() const; virtual std::string message() const;
@ -740,7 +740,7 @@ namespace libtorrent
, peer_id const& peer_id, peer_request const& r , peer_id const& peer_id, peer_request const& r
, bool we_have, bool peer_interested, bool withheld); , bool we_have, bool peer_interested, bool withheld);
TORRENT_DEFINE_ALERT(invalid_request_alert, 25); TORRENT_DEFINE_ALERT(invalid_request_alert, 25)
virtual std::string message() const; virtual std::string message() const;
@ -768,7 +768,7 @@ namespace libtorrent
torrent_finished_alert(aux::stack_allocator& alloc, torrent_finished_alert(aux::stack_allocator& alloc,
torrent_handle h); torrent_handle h);
TORRENT_DEFINE_ALERT(torrent_finished_alert, 26); TORRENT_DEFINE_ALERT(torrent_finished_alert, 26)
static const int static_category = alert::status_notification; static const int static_category = alert::status_notification;
virtual std::string message() const; virtual std::string message() const;
@ -783,7 +783,7 @@ namespace libtorrent
piece_finished_alert(aux::stack_allocator& alloc, piece_finished_alert(aux::stack_allocator& alloc,
torrent_handle const& h, int piece_num); torrent_handle const& h, int piece_num);
TORRENT_DEFINE_ALERT(piece_finished_alert, 27); TORRENT_DEFINE_ALERT(piece_finished_alert, 27)
static const int static_category = alert::progress_notification; static const int static_category = alert::progress_notification;
virtual std::string message() const; virtual std::string message() const;
@ -800,7 +800,7 @@ namespace libtorrent
, tcp::endpoint const& ep, peer_id const& peer_id, int block_num , tcp::endpoint const& ep, peer_id const& peer_id, int block_num
, int piece_num); , int piece_num);
TORRENT_DEFINE_ALERT(request_dropped_alert, 28); TORRENT_DEFINE_ALERT(request_dropped_alert, 28)
static const int static_category = alert::progress_notification static const int static_category = alert::progress_notification
| alert::peer_notification; | alert::peer_notification;
@ -818,7 +818,7 @@ namespace libtorrent
, tcp::endpoint const& ep, peer_id const& peer_id, int block_num , tcp::endpoint const& ep, peer_id const& peer_id, int block_num
, int piece_num); , int piece_num);
TORRENT_DEFINE_ALERT(block_timeout_alert, 29); TORRENT_DEFINE_ALERT(block_timeout_alert, 29)
static const int static_category = alert::progress_notification static const int static_category = alert::progress_notification
| alert::peer_notification; | alert::peer_notification;
@ -836,7 +836,7 @@ namespace libtorrent
, tcp::endpoint const& ep, peer_id const& peer_id, int block_num , tcp::endpoint const& ep, peer_id const& peer_id, int block_num
, int piece_num); , int piece_num);
TORRENT_DEFINE_ALERT(block_finished_alert, 30); TORRENT_DEFINE_ALERT(block_finished_alert, 30)
static const int static_category = alert::progress_notification; static const int static_category = alert::progress_notification;
virtual std::string message() const; virtual std::string message() const;
@ -853,7 +853,7 @@ namespace libtorrent
, tcp::endpoint const& ep , tcp::endpoint const& ep
, peer_id const& peer_id, int block_num, int piece_num); , peer_id const& peer_id, int block_num, int piece_num);
TORRENT_DEFINE_ALERT(block_downloading_alert, 31); TORRENT_DEFINE_ALERT(block_downloading_alert, 31)
static const int static_category = alert::progress_notification; static const int static_category = alert::progress_notification;
virtual std::string message() const; virtual std::string message() const;
@ -874,7 +874,7 @@ namespace libtorrent
, tcp::endpoint const& ep , tcp::endpoint const& ep
, peer_id const& peer_id, int block_num, int piece_num); , peer_id const& peer_id, int block_num, int piece_num);
TORRENT_DEFINE_ALERT(unwanted_block_alert, 32); TORRENT_DEFINE_ALERT(unwanted_block_alert, 32)
virtual std::string message() const; virtual std::string message() const;
@ -892,7 +892,7 @@ namespace libtorrent
storage_moved_alert(aux::stack_allocator& alloc storage_moved_alert(aux::stack_allocator& alloc
, torrent_handle const& h, std::string const& p); , torrent_handle const& h, std::string const& p);
TORRENT_DEFINE_ALERT(storage_moved_alert, 33); TORRENT_DEFINE_ALERT(storage_moved_alert, 33)
static const int static_category = alert::storage_notification; static const int static_category = alert::storage_notification;
virtual std::string message() const; virtual std::string message() const;
@ -919,7 +919,7 @@ namespace libtorrent
, std::string const& file , std::string const& file
, char const* op); , char const* op);
TORRENT_DEFINE_ALERT(storage_moved_failed_alert, 34); TORRENT_DEFINE_ALERT(storage_moved_failed_alert, 34)
static const int static_category = alert::storage_notification; static const int static_category = alert::storage_notification;
virtual std::string message() const; virtual std::string message() const;
@ -956,7 +956,7 @@ namespace libtorrent
torrent_deleted_alert(aux::stack_allocator& alloc torrent_deleted_alert(aux::stack_allocator& alloc
, torrent_handle const& h, sha1_hash const& ih); , torrent_handle const& h, sha1_hash const& ih);
TORRENT_DEFINE_ALERT_PRIO(torrent_deleted_alert, 35); TORRENT_DEFINE_ALERT_PRIO(torrent_deleted_alert, 35)
static const int static_category = alert::storage_notification; static const int static_category = alert::storage_notification;
virtual std::string message() const; virtual std::string message() const;
@ -976,7 +976,7 @@ namespace libtorrent
torrent_delete_failed_alert(aux::stack_allocator& alloc torrent_delete_failed_alert(aux::stack_allocator& alloc
, torrent_handle const& h, error_code const& e, sha1_hash const& ih); , torrent_handle const& h, error_code const& e, sha1_hash const& ih);
TORRENT_DEFINE_ALERT_PRIO(torrent_delete_failed_alert, 36); TORRENT_DEFINE_ALERT_PRIO(torrent_delete_failed_alert, 36)
static const int static_category = alert::storage_notification static const int static_category = alert::storage_notification
| alert::error_notification; | alert::error_notification;
@ -1006,7 +1006,7 @@ namespace libtorrent
, boost::shared_ptr<entry> const& rd , boost::shared_ptr<entry> const& rd
, torrent_handle const& h); , torrent_handle const& h);
TORRENT_DEFINE_ALERT_PRIO(save_resume_data_alert, 37); TORRENT_DEFINE_ALERT_PRIO(save_resume_data_alert, 37)
static const int static_category = alert::storage_notification; static const int static_category = alert::storage_notification;
virtual std::string message() const; virtual std::string message() const;
@ -1027,7 +1027,7 @@ namespace libtorrent
save_resume_data_failed_alert(aux::stack_allocator& alloc save_resume_data_failed_alert(aux::stack_allocator& alloc
, torrent_handle const& h, error_code const& e); , torrent_handle const& h, error_code const& e);
TORRENT_DEFINE_ALERT_PRIO(save_resume_data_failed_alert, 38); TORRENT_DEFINE_ALERT_PRIO(save_resume_data_failed_alert, 38)
static const int static_category = alert::storage_notification static const int static_category = alert::storage_notification
| alert::error_notification; | alert::error_notification;
@ -1053,7 +1053,7 @@ namespace libtorrent
// internal // internal
torrent_paused_alert(aux::stack_allocator& alloc, torrent_handle const& h); torrent_paused_alert(aux::stack_allocator& alloc, torrent_handle const& h);
TORRENT_DEFINE_ALERT(torrent_paused_alert, 39); TORRENT_DEFINE_ALERT(torrent_paused_alert, 39)
static const int static_category = alert::status_notification; static const int static_category = alert::status_notification;
virtual std::string message() const; virtual std::string message() const;
@ -1066,7 +1066,7 @@ namespace libtorrent
// internal // internal
torrent_resumed_alert(aux::stack_allocator& alloc, torrent_handle const& h); torrent_resumed_alert(aux::stack_allocator& alloc, torrent_handle const& h);
TORRENT_DEFINE_ALERT(torrent_resumed_alert, 40); TORRENT_DEFINE_ALERT(torrent_resumed_alert, 40)
static const int static_category = alert::status_notification; static const int static_category = alert::status_notification;
virtual std::string message() const; virtual std::string message() const;
@ -1079,7 +1079,7 @@ namespace libtorrent
// internal // internal
torrent_checked_alert(aux::stack_allocator& alloc, torrent_handle const& h); torrent_checked_alert(aux::stack_allocator& alloc, torrent_handle const& h);
TORRENT_DEFINE_ALERT(torrent_checked_alert, 41); TORRENT_DEFINE_ALERT(torrent_checked_alert, 41)
static const int static_category = alert::status_notification; static const int static_category = alert::status_notification;
virtual std::string message() const; virtual std::string message() const;
@ -1094,7 +1094,7 @@ namespace libtorrent
url_seed_alert(aux::stack_allocator& alloc, torrent_handle const& h url_seed_alert(aux::stack_allocator& alloc, torrent_handle const& h
, std::string const& u, std::string const& m); , std::string const& u, std::string const& m);
TORRENT_DEFINE_ALERT(url_seed_alert, 42); TORRENT_DEFINE_ALERT(url_seed_alert, 42)
static const int static_category = alert::peer_notification | alert::error_notification; static const int static_category = alert::peer_notification | alert::error_notification;
std::string message() const; std::string message() const;
@ -1134,7 +1134,7 @@ namespace libtorrent
, char const* op , char const* op
, torrent_handle const& h); , torrent_handle const& h);
TORRENT_DEFINE_ALERT(file_error_alert, 43); TORRENT_DEFINE_ALERT(file_error_alert, 43)
static const int static_category = alert::status_notification static const int static_category = alert::status_notification
| alert::error_notification | alert::error_notification
@ -1170,7 +1170,7 @@ namespace libtorrent
metadata_failed_alert(aux::stack_allocator& alloc metadata_failed_alert(aux::stack_allocator& alloc
, torrent_handle const& h, error_code const& ec); , torrent_handle const& h, error_code const& ec);
TORRENT_DEFINE_ALERT(metadata_failed_alert, 44); TORRENT_DEFINE_ALERT(metadata_failed_alert, 44)
static const int static_category = alert::error_notification; static const int static_category = alert::error_notification;
virtual std::string message() const; virtual std::string message() const;
@ -1210,7 +1210,7 @@ namespace libtorrent
metadata_received_alert(aux::stack_allocator& alloc metadata_received_alert(aux::stack_allocator& alloc
, torrent_handle const& h); , torrent_handle const& h);
TORRENT_DEFINE_ALERT(metadata_received_alert, 45); TORRENT_DEFINE_ALERT(metadata_received_alert, 45)
static const int static_category = alert::status_notification; static const int static_category = alert::status_notification;
virtual std::string message() const; virtual std::string message() const;
@ -1227,7 +1227,7 @@ namespace libtorrent
, udp::endpoint const& ep , udp::endpoint const& ep
, error_code const& ec); , error_code const& ec);
TORRENT_DEFINE_ALERT(udp_error_alert, 46); TORRENT_DEFINE_ALERT(udp_error_alert, 46)
static const int static_category = alert::error_notification; static const int static_category = alert::error_notification;
virtual std::string message() const; virtual std::string message() const;
@ -1248,7 +1248,7 @@ namespace libtorrent
// internal // internal
external_ip_alert(aux::stack_allocator& alloc, address const& ip); external_ip_alert(aux::stack_allocator& alloc, address const& ip);
TORRENT_DEFINE_ALERT(external_ip_alert, 47); TORRENT_DEFINE_ALERT(external_ip_alert, 47)
static const int static_category = alert::status_notification; static const int static_category = alert::status_notification;
virtual std::string message() const; virtual std::string message() const;
@ -1278,7 +1278,7 @@ namespace libtorrent
, error_code const& ec , error_code const& ec
, socket_type_t t); , socket_type_t t);
TORRENT_DEFINE_ALERT_PRIO(listen_failed_alert, 48); TORRENT_DEFINE_ALERT_PRIO(listen_failed_alert, 48)
static const int static_category = alert::status_notification | alert::error_notification; static const int static_category = alert::status_notification | alert::error_notification;
virtual std::string message() const; virtual std::string message() const;
@ -1321,7 +1321,7 @@ namespace libtorrent
listen_succeeded_alert(aux::stack_allocator& alloc, tcp::endpoint const& ep listen_succeeded_alert(aux::stack_allocator& alloc, tcp::endpoint const& ep
, socket_type_t t); , socket_type_t t);
TORRENT_DEFINE_ALERT_PRIO(listen_succeeded_alert, 49); TORRENT_DEFINE_ALERT_PRIO(listen_succeeded_alert, 49)
static const int static_category = alert::status_notification; static const int static_category = alert::status_notification;
virtual std::string message() const; virtual std::string message() const;
@ -1349,7 +1349,7 @@ namespace libtorrent
portmap_error_alert(aux::stack_allocator& alloc, int i, int t portmap_error_alert(aux::stack_allocator& alloc, int i, int t
, error_code const& e); , error_code const& e);
TORRENT_DEFINE_ALERT(portmap_error_alert, 50); TORRENT_DEFINE_ALERT(portmap_error_alert, 50)
static const int static_category = alert::port_mapping_notification static const int static_category = alert::port_mapping_notification
| alert::error_notification; | alert::error_notification;
@ -1378,7 +1378,7 @@ namespace libtorrent
// internal // internal
portmap_alert(aux::stack_allocator& alloc, int i, int port, int t); portmap_alert(aux::stack_allocator& alloc, int i, int port, int t);
TORRENT_DEFINE_ALERT(portmap_alert, 51); TORRENT_DEFINE_ALERT(portmap_alert, 51)
static const int static_category = alert::port_mapping_notification; static const int static_category = alert::port_mapping_notification;
virtual std::string message() const; virtual std::string message() const;
@ -1403,7 +1403,7 @@ namespace libtorrent
// internal // internal
portmap_log_alert(aux::stack_allocator& alloc, int t, const char* m); portmap_log_alert(aux::stack_allocator& alloc, int t, const char* m);
TORRENT_DEFINE_ALERT(portmap_log_alert, 52); TORRENT_DEFINE_ALERT(portmap_log_alert, 52)
static const int static_category = alert::port_mapping_notification; static const int static_category = alert::port_mapping_notification;
virtual std::string message() const; virtual std::string message() const;
@ -1437,7 +1437,7 @@ namespace libtorrent
, std::string const& file , std::string const& file
, char const* op); , char const* op);
TORRENT_DEFINE_ALERT(fastresume_rejected_alert, 53); TORRENT_DEFINE_ALERT(fastresume_rejected_alert, 53)
static const int static_category = alert::status_notification static const int static_category = alert::status_notification
| alert::error_notification; | alert::error_notification;
@ -1478,7 +1478,7 @@ namespace libtorrent
peer_blocked_alert(aux::stack_allocator& alloc, torrent_handle const& h peer_blocked_alert(aux::stack_allocator& alloc, torrent_handle const& h
, address const& i, int r); , address const& i, int r);
TORRENT_DEFINE_ALERT(peer_blocked_alert, 54); TORRENT_DEFINE_ALERT(peer_blocked_alert, 54)
static const int static_category = alert::ip_block_notification; static const int static_category = alert::ip_block_notification;
virtual std::string message() const; virtual std::string message() const;
@ -1508,7 +1508,7 @@ namespace libtorrent
dht_announce_alert(aux::stack_allocator& alloc, address const& i, int p dht_announce_alert(aux::stack_allocator& alloc, address const& i, int p
, sha1_hash const& ih); , sha1_hash const& ih);
TORRENT_DEFINE_ALERT(dht_announce_alert, 55); TORRENT_DEFINE_ALERT(dht_announce_alert, 55)
static const int static_category = alert::dht_notification; static const int static_category = alert::dht_notification;
virtual std::string message() const; virtual std::string message() const;
@ -1525,7 +1525,7 @@ namespace libtorrent
// internal // internal
dht_get_peers_alert(aux::stack_allocator& alloc, sha1_hash const& ih); dht_get_peers_alert(aux::stack_allocator& alloc, sha1_hash const& ih);
TORRENT_DEFINE_ALERT(dht_get_peers_alert, 56); TORRENT_DEFINE_ALERT(dht_get_peers_alert, 56)
static const int static_category = alert::dht_notification; static const int static_category = alert::dht_notification;
virtual std::string message() const; virtual std::string message() const;
@ -1542,7 +1542,7 @@ namespace libtorrent
stats_alert(aux::stack_allocator& alloc, torrent_handle const& h, int interval stats_alert(aux::stack_allocator& alloc, torrent_handle const& h, int interval
, stat const& s); , stat const& s);
TORRENT_DEFINE_ALERT(stats_alert, 57); TORRENT_DEFINE_ALERT(stats_alert, 57)
static const int static_category = alert::stats_notification; static const int static_category = alert::stats_notification;
virtual std::string message() const; virtual std::string message() const;
@ -1593,7 +1593,7 @@ namespace libtorrent
// internal // internal
cache_flushed_alert(aux::stack_allocator& alloc, torrent_handle const& h); cache_flushed_alert(aux::stack_allocator& alloc, torrent_handle const& h);
TORRENT_DEFINE_ALERT(cache_flushed_alert, 58); TORRENT_DEFINE_ALERT(cache_flushed_alert, 58)
static const int static_category = alert::storage_notification; static const int static_category = alert::storage_notification;
}; };
@ -1608,7 +1608,7 @@ namespace libtorrent
anonymous_mode_alert(aux::stack_allocator& alloc, torrent_handle const& h anonymous_mode_alert(aux::stack_allocator& alloc, torrent_handle const& h
, int k, std::string const& s); , int k, std::string const& s);
TORRENT_DEFINE_ALERT(anonymous_mode_alert, 59); TORRENT_DEFINE_ALERT(anonymous_mode_alert, 59)
static const int static_category = alert::error_notification; static const int static_category = alert::error_notification;
virtual std::string message() const; virtual std::string message() const;
@ -1634,7 +1634,7 @@ namespace libtorrent
lsd_peer_alert(aux::stack_allocator& alloc, torrent_handle const& h lsd_peer_alert(aux::stack_allocator& alloc, torrent_handle const& h
, tcp::endpoint const& i); , tcp::endpoint const& i);
TORRENT_DEFINE_ALERT(lsd_peer_alert, 60); TORRENT_DEFINE_ALERT(lsd_peer_alert, 60)
static const int static_category = alert::peer_notification; static const int static_category = alert::peer_notification;
virtual std::string message() const; virtual std::string message() const;
@ -1650,7 +1650,7 @@ namespace libtorrent
, std::string const& u , std::string const& u
, const std::string& id); , const std::string& id);
TORRENT_DEFINE_ALERT(trackerid_alert, 61); TORRENT_DEFINE_ALERT(trackerid_alert, 61)
static const int static_category = alert::status_notification; static const int static_category = alert::status_notification;
virtual std::string message() const; virtual std::string message() const;
@ -1673,7 +1673,7 @@ namespace libtorrent
// internal // internal
dht_bootstrap_alert(aux::stack_allocator& alloc); dht_bootstrap_alert(aux::stack_allocator& alloc);
TORRENT_DEFINE_ALERT(dht_bootstrap_alert, 62); TORRENT_DEFINE_ALERT(dht_bootstrap_alert, 62)
static const int static_category = alert::dht_notification; static const int static_category = alert::dht_notification;
virtual std::string message() const; virtual std::string message() const;
@ -1691,7 +1691,7 @@ namespace libtorrent
rss_alert(aux::stack_allocator& alloc, feed_handle h rss_alert(aux::stack_allocator& alloc, feed_handle h
, std::string const& u, int s, error_code const& ec); , std::string const& u, int s, error_code const& ec);
TORRENT_DEFINE_ALERT(rss_alert, 63); TORRENT_DEFINE_ALERT(rss_alert, 63)
static const int static_category = alert::rss_notification; static const int static_category = alert::rss_notification;
virtual std::string message() const; virtual std::string message() const;
@ -1734,7 +1734,7 @@ namespace libtorrent
torrent_error_alert(aux::stack_allocator& alloc, torrent_handle const& h torrent_error_alert(aux::stack_allocator& alloc, torrent_handle const& h
, error_code const& e, std::string const& f); , error_code const& e, std::string const& f);
TORRENT_DEFINE_ALERT(torrent_error_alert, 64); TORRENT_DEFINE_ALERT(torrent_error_alert, 64)
static const int static_category = alert::error_notification | alert::status_notification; static const int static_category = alert::error_notification | alert::status_notification;
virtual std::string message() const; virtual std::string message() const;
@ -1764,7 +1764,7 @@ namespace libtorrent
torrent_need_cert_alert(aux::stack_allocator& alloc torrent_need_cert_alert(aux::stack_allocator& alloc
, torrent_handle const& h); , torrent_handle const& h);
TORRENT_DEFINE_ALERT_PRIO(torrent_need_cert_alert, 65); TORRENT_DEFINE_ALERT_PRIO(torrent_need_cert_alert, 65)
static const int static_category = alert::status_notification; static const int static_category = alert::status_notification;
virtual std::string message() const; virtual std::string message() const;
@ -1787,7 +1787,7 @@ namespace libtorrent
incoming_connection_alert(aux::stack_allocator& alloc, int t incoming_connection_alert(aux::stack_allocator& alloc, int t
, tcp::endpoint const& i); , tcp::endpoint const& i);
TORRENT_DEFINE_ALERT(incoming_connection_alert, 66); TORRENT_DEFINE_ALERT(incoming_connection_alert, 66)
static const int static_category = alert::peer_notification; static const int static_category = alert::peer_notification;
virtual std::string message() const; virtual std::string message() const;
@ -1849,7 +1849,7 @@ namespace libtorrent
: status(st) : status(st)
{} {}
TORRENT_DEFINE_ALERT_PRIO(state_update_alert, 68); TORRENT_DEFINE_ALERT_PRIO(state_update_alert, 68)
static const int static_category = alert::status_notification; static const int static_category = alert::status_notification;
virtual std::string message() const; virtual std::string message() const;
@ -1869,7 +1869,7 @@ namespace libtorrent
{ {
mmap_cache_alert(aux::stack_allocator& alloc mmap_cache_alert(aux::stack_allocator& alloc
, error_code const& ec): error(ec) {} , error_code const& ec): error(ec) {}
TORRENT_DEFINE_ALERT(mmap_cache_alert, 69); TORRENT_DEFINE_ALERT(mmap_cache_alert, 69)
static const int static_category = alert::error_notification; static const int static_category = alert::error_notification;
virtual std::string message() const; virtual std::string message() const;
@ -1884,7 +1884,7 @@ namespace libtorrent
struct TORRENT_EXPORT session_stats_alert : alert struct TORRENT_EXPORT session_stats_alert : alert
{ {
session_stats_alert(aux::stack_allocator& alloc, counters const& cnt); session_stats_alert(aux::stack_allocator& alloc, counters const& cnt);
TORRENT_DEFINE_ALERT_PRIO(session_stats_alert, 70); TORRENT_DEFINE_ALERT_PRIO(session_stats_alert, 70)
static const int static_category = alert::stats_notification; static const int static_category = alert::stats_notification;
virtual std::string message() const; virtual std::string message() const;
@ -1917,7 +1917,7 @@ namespace libtorrent
torrent_update_alert(aux::stack_allocator& alloc, torrent_handle h torrent_update_alert(aux::stack_allocator& alloc, torrent_handle h
, sha1_hash const& old_hash, sha1_hash const& new_hash); , sha1_hash const& old_hash, sha1_hash const& new_hash);
TORRENT_DEFINE_ALERT_PRIO(torrent_update_alert, 71); TORRENT_DEFINE_ALERT_PRIO(torrent_update_alert, 71)
static const int static_category = alert::status_notification; static const int static_category = alert::status_notification;
virtual std::string message() const; virtual std::string message() const;
@ -1942,7 +1942,7 @@ namespace libtorrent
rss_item_alert(aux::stack_allocator& alloc, feed_handle h rss_item_alert(aux::stack_allocator& alloc, feed_handle h
, feed_item const& item); , feed_item const& item);
TORRENT_DEFINE_ALERT(rss_item_alert, 72); TORRENT_DEFINE_ALERT(rss_item_alert, 72)
static const int static_category = alert::rss_notification; static const int static_category = alert::rss_notification;
virtual std::string message() const; virtual std::string message() const;
@ -1959,7 +1959,7 @@ namespace libtorrent
// internal // internal
dht_error_alert(aux::stack_allocator& alloc, int op, error_code const& ec); dht_error_alert(aux::stack_allocator& alloc, int op, error_code const& ec);
TORRENT_DEFINE_ALERT(dht_error_alert, 73); TORRENT_DEFINE_ALERT(dht_error_alert, 73)
static const int static_category = alert::error_notification static const int static_category = alert::error_notification
| alert::dht_notification; | alert::dht_notification;
@ -1985,7 +1985,7 @@ namespace libtorrent
dht_immutable_item_alert(aux::stack_allocator& alloc, sha1_hash const& t dht_immutable_item_alert(aux::stack_allocator& alloc, sha1_hash const& t
, entry const& i); , entry const& i);
TORRENT_DEFINE_ALERT_PRIO(dht_immutable_item_alert, 74); TORRENT_DEFINE_ALERT_PRIO(dht_immutable_item_alert, 74)
static const int static_category = alert::error_notification static const int static_category = alert::error_notification
| alert::dht_notification; | alert::dht_notification;
@ -2014,7 +2014,7 @@ namespace libtorrent
, std::string const& s , std::string const& s
, entry const& i); , entry const& i);
TORRENT_DEFINE_ALERT_PRIO(dht_mutable_item_alert, 75); TORRENT_DEFINE_ALERT_PRIO(dht_mutable_item_alert, 75)
static const int static_category = alert::error_notification static const int static_category = alert::error_notification
| alert::dht_notification; | alert::dht_notification;
@ -2055,7 +2055,7 @@ namespace libtorrent
, std::string s , std::string s
, boost::uint64_t sequence_number); , boost::uint64_t sequence_number);
TORRENT_DEFINE_ALERT(dht_put_alert, 76); TORRENT_DEFINE_ALERT(dht_put_alert, 76)
static const int static_category = alert::dht_notification; static const int static_category = alert::dht_notification;
virtual std::string message() const; virtual std::string message() const;
@ -2077,7 +2077,7 @@ namespace libtorrent
{ {
i2p_alert(aux::stack_allocator& alloc, error_code const& ec); i2p_alert(aux::stack_allocator& alloc, error_code const& ec);
TORRENT_DEFINE_ALERT(i2p_alert, 77); TORRENT_DEFINE_ALERT(i2p_alert, 77)
static const int static_category = alert::error_notification; static const int static_category = alert::error_notification;
virtual std::string message() const; virtual std::string message() const;
@ -2099,7 +2099,7 @@ namespace libtorrent
, ip(ep) , ip(ep)
{} {}
TORRENT_DEFINE_ALERT(dht_outgoing_get_peers_alert, 78); TORRENT_DEFINE_ALERT(dht_outgoing_get_peers_alert, 78)
static const int static_category = alert::dht_notification; static const int static_category = alert::dht_notification;
virtual std::string message() const; virtual std::string message() const;
@ -2124,7 +2124,7 @@ namespace libtorrent
// internal // internal
log_alert(aux::stack_allocator& alloc, char const* log); log_alert(aux::stack_allocator& alloc, char const* log);
TORRENT_DEFINE_ALERT(log_alert, 79); TORRENT_DEFINE_ALERT(log_alert, 79)
static const int static_category = alert::session_log_notification; static const int static_category = alert::session_log_notification;
virtual std::string message() const; virtual std::string message() const;
@ -2147,7 +2147,7 @@ namespace libtorrent
torrent_log_alert(aux::stack_allocator& alloc, torrent_handle h torrent_log_alert(aux::stack_allocator& alloc, torrent_handle h
, char const* log); , char const* log);
TORRENT_DEFINE_ALERT(torrent_log_alert, 80); TORRENT_DEFINE_ALERT(torrent_log_alert, 80)
static const int static_category = alert::torrent_log_notification; static const int static_category = alert::torrent_log_notification;
virtual std::string message() const; virtual std::string message() const;
@ -2170,7 +2170,7 @@ namespace libtorrent
, tcp::endpoint const& i , tcp::endpoint const& i
, peer_id const& pi, char const* log); , peer_id const& pi, char const* log);
TORRENT_DEFINE_ALERT(peer_log_alert, 81); TORRENT_DEFINE_ALERT(peer_log_alert, 81)
static const int static_category = alert::peer_log_notification; static const int static_category = alert::peer_log_notification;
virtual std::string message() const; virtual std::string message() const;
@ -2192,7 +2192,7 @@ namespace libtorrent
, error(ec) , error(ec)
{} {}
TORRENT_DEFINE_ALERT(lsd_error_alert, 82); TORRENT_DEFINE_ALERT(lsd_error_alert, 82)
static const int static_category = alert::error_notification; static const int static_category = alert::error_notification;
virtual std::string message() const; virtual std::string message() const;
@ -2270,7 +2270,7 @@ namespace libtorrent
, routing_table(table) , routing_table(table)
{} {}
TORRENT_DEFINE_ALERT(dht_stats_alert, 83); TORRENT_DEFINE_ALERT(dht_stats_alert, 83)
static const int static_category = alert::stats_notification; static const int static_category = alert::stats_notification;
virtual std::string message() const; virtual std::string message() const;

View File

@ -43,7 +43,7 @@ namespace libtorrent
struct TORRENT_EXTRA_EXPORT page_aligned_allocator struct TORRENT_EXTRA_EXPORT page_aligned_allocator
{ {
typedef std::size_t size_type; typedef int size_type;
typedef std::ptrdiff_t difference_type; typedef std::ptrdiff_t difference_type;
static char* malloc(const size_type bytes); static char* malloc(const size_type bytes);

View File

@ -34,7 +34,7 @@ POSSIBILITY OF SUCH DAMAGE.
#include "libtorrent/config.hpp" #include "libtorrent/config.hpp"
#if (defined TORRENT_DEBUG && !TORRENT_NO_ASSERTS) \ #if (defined TORRENT_DEBUG && TORRENT_USE_ASSERTS) \
|| defined TORRENT_ASIO_DEBUGGING \ || defined TORRENT_ASIO_DEBUGGING \
|| defined TORRENT_PROFILE_CALLS \ || defined TORRENT_PROFILE_CALLS \
|| TORRENT_RELEASE_ASSERTS \ || TORRENT_RELEASE_ASSERTS \
@ -47,11 +47,11 @@ TORRENT_EXPORT void print_backtrace(char* out, int len, int max_depth = 0);
#if TORRENT_USE_ASSERTS #if TORRENT_USE_ASSERTS
#if TORRENT_PRODUCTION_ASSERTS #ifdef TORRENT_PRODUCTION_ASSERTS
extern char const* libtorrent_assert_log; extern char const* libtorrent_assert_log;
#endif #endif
#if !TORRENT_USE_SYSTEM_ASSERT #ifndef TORRENT_USE_SYSTEM_ASSERTS
#if TORRENT_USE_IOSTREAM #if TORRENT_USE_IOSTREAM
#include <sstream> #include <sstream>
@ -59,8 +59,8 @@ extern char const* libtorrent_assert_log;
TORRENT_EXPORT void assert_print(char const* fmt, ...); TORRENT_EXPORT void assert_print(char const* fmt, ...);
TORRENT_EXPORT void assert_fail(const char* expr, int line, char const* file TORRENT_NO_RETURN TORRENT_EXPORT void assert_fail(const char* expr, int line
, char const* function, char const* val, int kind = 0); , char const* file, char const* function, char const* val, int kind = 0);
#define TORRENT_ASSERT_PRECOND(x) \ #define TORRENT_ASSERT_PRECOND(x) \
do { if (x) {} else assert_fail(#x, __LINE__, __FILE__, TORRENT_FUNCTION, 0, 1); } while (false) do { if (x) {} else assert_fail(#x, __LINE__, __FILE__, TORRENT_FUNCTION, 0, 1); } while (false)

View File

@ -0,0 +1,40 @@
/*
Copyright (c) 2015, Arvid Norberg
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the distribution.
* Neither the name of the author nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif
#ifdef _MSC_VER
#pragma warning(pop)
#endif

View File

@ -0,0 +1,69 @@
/*
Copyright (c) 2015, Arvid Norberg
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the distribution.
* Neither the name of the author nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wall"
#pragma GCC diagnostic ignored "-Wsign-conversion"
#pragma GCC diagnostic ignored "-Wconversion"
#pragma GCC diagnostic ignored "-Wswitch-enum"
#pragma GCC diagnostic ignored "-Wcovered-switch-default"
#pragma GCC diagnostic ignored "-Wold-style-cast"
#pragma GCC diagnostic ignored "-Wundef"
#pragma GCC diagnostic ignored "-Wweak-vtables"
#pragma GCC diagnostic ignored "-Wmissing-noreturn"
#pragma GCC diagnostic ignored "-Wdeprecated"
#pragma GCC diagnostic ignored "-Wshadow"
#endif
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Weverything"
#pragma clang diagnostic ignored "-Wsign-conversion"
#pragma clang diagnostic ignored "-Wconversion"
#pragma clang diagnostic ignored "-Wswitch-enum"
#pragma clang diagnostic ignored "-Wcovered-switch-default"
#pragma clang diagnostic ignored "-Wold-style-cast"
#pragma clang diagnostic ignored "-Wundef"
#pragma clang diagnostic ignored "-Wweak-vtables"
#pragma clang diagnostic ignored "-Wmissing-noreturn"
#pragma clang diagnostic ignored "-Wdeprecated"
#pragma clang diagnostic ignored "-Wcast-align"
#pragma clang diagnostic ignored "-Wweak-vtable"
#pragma clang diagnostic ignored "-Wundef"
#pragma clang diagnostic ignored "-Wshadow"
#endif
#ifdef _MSC_VER
#pragma warning(push, 1)
#endif

View File

@ -33,12 +33,6 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef TORRENT_SESSION_IMPL_HPP_INCLUDED #ifndef TORRENT_SESSION_IMPL_HPP_INCLUDED
#define TORRENT_SESSION_IMPL_HPP_INCLUDED #define TORRENT_SESSION_IMPL_HPP_INCLUDED
#include <algorithm>
#include <vector>
#include <set>
#include <list>
#include <stdarg.h> // for va_start, va_end
#include "libtorrent/config.hpp" #include "libtorrent/config.hpp"
#include "libtorrent/aux_/session_settings.hpp" #include "libtorrent/aux_/session_settings.hpp"
#include "libtorrent/aux_/session_interface.hpp" #include "libtorrent/aux_/session_interface.hpp"
@ -48,18 +42,24 @@ POSSIBILITY OF SUCH DAMAGE.
#include "libtorrent/torrent_peer_allocator.hpp" #include "libtorrent/torrent_peer_allocator.hpp"
#include "libtorrent/performance_counters.hpp" // for counters #include "libtorrent/performance_counters.hpp" // for counters
#ifdef _MSC_VER #include "aux_/disable_warnings_push.hpp"
#pragma warning(push, 1)
#endif #include <algorithm>
#include <vector>
#include <set>
#include <list>
#include <stdarg.h> // for va_start, va_end
#if TORRENT_HAS_BOOST_UNORDERED #if TORRENT_HAS_BOOST_UNORDERED
#include <boost/unordered_map.hpp> #include <boost/unordered_map.hpp>
#endif #endif
#ifdef _MSC_VER #ifdef TORRENT_USE_OPENSSL
#pragma warning(pop) #include <boost/asio/ssl/context.hpp>
#endif #endif
#include "aux_/disable_warnings_pop.hpp"
#include "libtorrent/session.hpp" // for user_load_function_t #include "libtorrent/session.hpp" // for user_load_function_t
#include "libtorrent/ip_voter.hpp" #include "libtorrent/ip_voter.hpp"
#include "libtorrent/torrent_handle.hpp" #include "libtorrent/torrent_handle.hpp"
@ -100,10 +100,6 @@ POSSIBILITY OF SUCH DAMAGE.
#include "libtorrent/peer_connection.hpp" #include "libtorrent/peer_connection.hpp"
#endif #endif
#ifdef TORRENT_USE_OPENSSL
#include <boost/asio/ssl/context.hpp>
#endif
namespace libtorrent namespace libtorrent
{ {

View File

@ -35,17 +35,12 @@ POSSIBILITY OF SUCH DAMAGE.
#include "libtorrent/config.hpp" #include "libtorrent/config.hpp"
#include "libtorrent/peer_id.hpp" #include "libtorrent/peer_id.hpp"
#include "aux_/disable_warnings_push.hpp"
#include <boost/weak_ptr.hpp> #include <boost/weak_ptr.hpp>
#include <boost/function.hpp> #include <boost/function.hpp>
#include "libtorrent/address.hpp"
#include "libtorrent/io_service.hpp"
#include "libtorrent/disk_buffer_holder.hpp"
#ifndef TORRENT_DISABLE_DHT
#include "libtorrent/socket.hpp"
#endif
#ifndef TORRENT_DISABLE_LOGGING #ifndef TORRENT_DISABLE_LOGGING
#include <boost/shared_ptr.hpp> #include <boost/shared_ptr.hpp>
#endif #endif
@ -54,6 +49,16 @@ POSSIBILITY OF SUCH DAMAGE.
#include <boost/asio/ssl/context.hpp> #include <boost/asio/ssl/context.hpp>
#endif #endif
#include "aux_/disable_warnings_pop.hpp"
#include "libtorrent/address.hpp"
#include "libtorrent/io_service.hpp"
#include "libtorrent/disk_buffer_holder.hpp"
#ifndef TORRENT_DISABLE_DHT
#include "libtorrent/socket.hpp"
#endif
#include "libtorrent/socket.hpp" // for tcp::endpoint #include "libtorrent/socket.hpp" // for tcp::endpoint
namespace libtorrent namespace libtorrent

View File

@ -33,8 +33,12 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef TORRENT_BANDWIDTH_MANAGER_HPP_INCLUDED #ifndef TORRENT_BANDWIDTH_MANAGER_HPP_INCLUDED
#define TORRENT_BANDWIDTH_MANAGER_HPP_INCLUDED #define TORRENT_BANDWIDTH_MANAGER_HPP_INCLUDED
#include "aux_/disable_warnings_push.hpp"
#include <boost/shared_ptr.hpp> #include <boost/shared_ptr.hpp>
#include "aux_/disable_warnings_pop.hpp"
#ifdef TORRENT_VERBOSE_BANDWIDTH_LIMIT #ifdef TORRENT_VERBOSE_BANDWIDTH_LIMIT
#include <fstream> #include <fstream>
#endif #endif

View File

@ -33,7 +33,12 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef TORRENT_BANDWIDTH_QUEUE_ENTRY_HPP_INCLUDED #ifndef TORRENT_BANDWIDTH_QUEUE_ENTRY_HPP_INCLUDED
#define TORRENT_BANDWIDTH_QUEUE_ENTRY_HPP_INCLUDED #define TORRENT_BANDWIDTH_QUEUE_ENTRY_HPP_INCLUDED
#include "aux_/disable_warnings_push.hpp"
#include <boost/shared_ptr.hpp> #include <boost/shared_ptr.hpp>
#include "aux_/disable_warnings_pop.hpp"
#include "libtorrent/bandwidth_limit.hpp" #include "libtorrent/bandwidth_limit.hpp"
#include "libtorrent/bandwidth_socket.hpp" #include "libtorrent/bandwidth_socket.hpp"

View File

@ -30,10 +30,15 @@ POSSIBILITY OF SUCH DAMAGE.
*/ */
#include "aux_/disable_warnings_push.hpp"
#include <boost/cstdint.hpp> #include <boost/cstdint.hpp>
#include <boost/system/error_code.hpp> #include <boost/system/error_code.hpp>
#include <vector> #include <vector>
#include <string> #include <string>
#include "aux_/disable_warnings_pop.hpp"
#include "libtorrent/assert.hpp" #include "libtorrent/assert.hpp"
#ifndef TORRENT_BDECODE_HPP #ifndef TORRENT_BDECODE_HPP

View File

@ -76,15 +76,11 @@ POSSIBILITY OF SUCH DAMAGE.
#include <exception> #include <exception>
#include <iterator> // for distance #include <iterator> // for distance
#ifdef _MSC_VER #include "aux_/disable_warnings_push.hpp"
#pragma warning(push, 1)
#endif
#include <boost/static_assert.hpp> #include <boost/static_assert.hpp>
#ifdef _MSC_VER #include "aux_/disable_warnings_pop.hpp"
#pragma warning(pop)
#endif
#include "libtorrent/entry.hpp" #include "libtorrent/entry.hpp"
#include "libtorrent/config.hpp" #include "libtorrent/config.hpp"

View File

@ -85,7 +85,7 @@ namespace libtorrent
resize(bits); resize(bits);
if (bits > 0) if (bits > 0)
{ {
std::memcpy(m_buf, b, ((bits + 7) / 8)); std::memcpy(m_buf, b, size_t((bits + 7) / 8));
clear_trailing_bits(); clear_trailing_bits();
} }
} }
@ -143,7 +143,7 @@ namespace libtorrent
// returns the size of the bitfield in bits. // returns the size of the bitfield in bits.
int size() const int size() const
{ {
return m_buf == NULL ? 0 : m_buf[-1]; return m_buf == NULL ? 0 : int(m_buf[-1]);
} }
int num_words() const int num_words() const
@ -156,7 +156,7 @@ namespace libtorrent
// returns a pointer to the internal buffer of the bitfield. // returns a pointer to the internal buffer of the bitfield.
// TODO: rename to data() ? // TODO: rename to data() ?
char const* bytes() const { return (char const*)m_buf; } char const* bytes() const { return reinterpret_cast<char const*>(m_buf); }
// copy operator // copy operator
bitfield& operator=(bitfield const& rhs) bitfield& operator=(bitfield const& rhs)
@ -287,13 +287,15 @@ namespace libtorrent
{ {
if (old_size_words && b) m_buf[old_size_words - 1] |= htonl((0xffffffff >> b)); if (old_size_words && b) m_buf[old_size_words - 1] |= htonl((0xffffffff >> b));
if (old_size_words < new_size_words) if (old_size_words < new_size_words)
std::memset(m_buf + old_size_words, 0xff, (new_size_words - old_size_words) * 4); std::memset(m_buf + old_size_words, 0xff
, size_t((new_size_words - old_size_words) * 4));
clear_trailing_bits(); clear_trailing_bits();
} }
else else
{ {
if (old_size_words < new_size_words) if (old_size_words < new_size_words)
std::memset(m_buf + old_size_words, 0x00, (new_size_words - old_size_words) * 4); std::memset(m_buf + old_size_words, 0x00
, size_t((new_size_words - old_size_words) * 4));
} }
TORRENT_ASSERT(size() == bits); TORRENT_ASSERT(size() == bits);
} }
@ -329,12 +331,12 @@ namespace libtorrent
// set all bits in the bitfield to 1 (set_all) or 0 (clear_all). // set all bits in the bitfield to 1 (set_all) or 0 (clear_all).
void set_all() void set_all()
{ {
std::memset(m_buf, 0xff, num_words() * 4); std::memset(m_buf, 0xff, size_t(num_words() * 4));
clear_trailing_bits(); clear_trailing_bits();
} }
void clear_all() void clear_all()
{ {
std::memset(m_buf, 0x00, num_words() * 4); std::memset(m_buf, 0x00, size_t(num_words() * 4));
} }
// make the bitfield empty, of zero size. // make the bitfield empty, of zero size.

View File

@ -33,6 +33,8 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef TORRENT_BLOCK_CACHE #ifndef TORRENT_BLOCK_CACHE
#define TORRENT_BLOCK_CACHE #define TORRENT_BLOCK_CACHE
#include "aux_/disable_warnings_push.hpp"
#include <boost/unordered_set.hpp> #include <boost/unordered_set.hpp>
#include <boost/cstdint.hpp> #include <boost/cstdint.hpp>
#include <boost/shared_ptr.hpp> #include <boost/shared_ptr.hpp>
@ -40,6 +42,8 @@ POSSIBILITY OF SUCH DAMAGE.
#include <list> #include <list>
#include <vector> #include <vector>
#include "aux_/disable_warnings_pop.hpp"
#include "libtorrent/time.hpp" #include "libtorrent/time.hpp"
#include "libtorrent/error_code.hpp" #include "libtorrent/error_code.hpp"
#include "libtorrent/io_service_fwd.hpp" #include "libtorrent/io_service_fwd.hpp"

View File

@ -33,12 +33,16 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef TORRENT_BLOOM_FILTER_HPP_INCLUDED #ifndef TORRENT_BLOOM_FILTER_HPP_INCLUDED
#define TORRENT_BLOOM_FILTER_HPP_INCLUDED #define TORRENT_BLOOM_FILTER_HPP_INCLUDED
#include <boost/cstdint.hpp>
#include "libtorrent/peer_id.hpp" // for sha1_hash #include "libtorrent/peer_id.hpp" // for sha1_hash
#include "libtorrent/config.hpp" // for sha1_hash #include "libtorrent/config.hpp" // for sha1_hash
#include "aux_/disable_warnings_push.hpp"
#include <boost/cstdint.hpp>
#include <math.h> // for log() #include <math.h> // for log()
#include "aux_/disable_warnings_pop.hpp"
namespace libtorrent namespace libtorrent
{ {
TORRENT_EXTRA_EXPORT void set_bits(boost::uint8_t const* b, boost::uint8_t* bits, int len); TORRENT_EXTRA_EXPORT void set_bits(boost::uint8_t const* b, boost::uint8_t* bits, int len);

View File

@ -41,9 +41,7 @@ POSSIBILITY OF SUCH DAMAGE.
#include "libtorrent/debug.hpp" #include "libtorrent/debug.hpp"
#ifdef _MSC_VER #include "aux_/disable_warnings_push.hpp"
#pragma warning(push, 1)
#endif
#include <boost/smart_ptr.hpp> #include <boost/smart_ptr.hpp>
#include <boost/noncopyable.hpp> #include <boost/noncopyable.hpp>
@ -51,9 +49,7 @@ POSSIBILITY OF SUCH DAMAGE.
#include <boost/optional.hpp> #include <boost/optional.hpp>
#include <boost/cstdint.hpp> #include <boost/cstdint.hpp>
#ifdef _MSC_VER #include "aux_/disable_warnings_pop.hpp"
#pragma warning(pop)
#endif
#include "libtorrent/buffer.hpp" #include "libtorrent/buffer.hpp"
#include "libtorrent/peer_connection.hpp" #include "libtorrent/peer_connection.hpp"

View File

@ -389,6 +389,12 @@ int snprintf(char* buf, int len, char const* fmt, ...)
#include <limits.h> #include <limits.h>
#endif #endif
#if defined __cplusplus && __cplusplus >= 199711L
#define TORRENT_NO_RETURN [[noreturn]]
#else
#define TORRENT_NO_RETURN
#endif
#ifndef TORRENT_ICONV_ARG #ifndef TORRENT_ICONV_ARG
#define TORRENT_ICONV_ARG (char**) #define TORRENT_ICONV_ARG (char**)
#endif #endif
@ -442,6 +448,14 @@ int snprintf(char* buf, int len, char const* fmt, ...)
#define TORRENT_HAS_SEM_RELTIMEDWAIT 0 #define TORRENT_HAS_SEM_RELTIMEDWAIT 0
#endif #endif
#ifndef TORRENT_USE_MEMALIGN
#define TORRENT_USE_MEMALIGN 0
#endif
#ifndef TORRENT_USE_POSIX_MEMALIGN
#define TORRENT_USE_POSIX_MEMALIGN 0
#endif
#ifndef TORRENT_USE_LOCALE #ifndef TORRENT_USE_LOCALE
#define TORRENT_USE_LOCALE 0 #define TORRENT_USE_LOCALE 0
#endif #endif
@ -525,7 +539,7 @@ int snprintf(char* buf, int len, char const* fmt, ...)
#endif #endif
#ifndef TORRENT_THREADSAFE_STATIC #ifndef TORRENT_THREADSAFE_STATIC
#if __cplusplus < 199711L || _MSC_VER <= 1800 #if __cplusplus < 199711L || (defined _MSC_VER && _MSC_VER <= 1800)
#define TORRENT_THREADSAFE_STATIC 0 #define TORRENT_THREADSAFE_STATIC 0
#else #else
#define TORRENT_THREADSAFE_STATIC 1 #define TORRENT_THREADSAFE_STATIC 1
@ -592,6 +606,7 @@ int snprintf(char* buf, int len, char const* fmt, ...)
#define TORRENT_FUNCTION __FUNCTION__ #define TORRENT_FUNCTION __FUNCTION__
#endif #endif
// debug builds have asserts enabled by default, release // debug builds have asserts enabled by default, release
// builds have asserts if they are explicitly enabled by // builds have asserts if they are explicitly enabled by
// the release_asserts macro. // the release_asserts macro.
@ -603,7 +618,7 @@ int snprintf(char* buf, int len, char const* fmt, ...)
#endif #endif
#endif // TORRENT_USE_ASSERTS #endif // TORRENT_USE_ASSERTS
#if defined TORRENT_DEBUG && TORRENT_USE_ASSERTS \ #if defined TORRENT_DEBUG && defined TORRENT_USE_ASSERTS \
&& !defined TORRENT_DISABLE_INVARIANT_CHECKS && !defined TORRENT_DISABLE_INVARIANT_CHECKS
#define TORRENT_USE_INVARIANT_CHECKS 1 #define TORRENT_USE_INVARIANT_CHECKS 1
#else #else

View File

@ -43,20 +43,16 @@ POSSIBILITY OF SUCH DAMAGE.
#include "libtorrent/allocator.hpp" #include "libtorrent/allocator.hpp"
#include "libtorrent/file.hpp" // for combine_path etc. #include "libtorrent/file.hpp" // for combine_path etc.
#include "aux_/disable_warnings_push.hpp"
#include <vector> #include <vector>
#include <string> #include <string>
#include <utility> #include <utility>
#ifdef _MSC_VER
#pragma warning(push, 1)
#endif
#include <boost/scoped_ptr.hpp> #include <boost/scoped_ptr.hpp>
#include <boost/config.hpp> #include <boost/config.hpp>
#ifdef _MSC_VER #include "aux_/disable_warnings_pop.hpp"
#pragma warning(pop)
#endif
// OVERVIEW // OVERVIEW
// //

View File

@ -33,25 +33,30 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef TORRENT_DISK_BUFFER_POOL_HPP #ifndef TORRENT_DISK_BUFFER_POOL_HPP
#define TORRENT_DISK_BUFFER_POOL_HPP #define TORRENT_DISK_BUFFER_POOL_HPP
#include <boost/utility.hpp>
#include "libtorrent/config.hpp" #include "libtorrent/config.hpp"
#include "libtorrent/thread.hpp"
#include "libtorrent/io_service_fwd.hpp" #include "aux_/disable_warnings_push.hpp"
#include "libtorrent/file.hpp" // for iovec_t
#include <vector> #include <vector>
#include <boost/shared_ptr.hpp> #include <boost/shared_ptr.hpp>
#include <boost/function.hpp> #include <boost/function.hpp>
#include <boost/utility.hpp>
#if defined TORRENT_DEBUG || TORRENT_RELEASE_ASSERTS
#include <set>
#endif
#ifndef TORRENT_DISABLE_POOL_ALLOCATOR #ifndef TORRENT_DISABLE_POOL_ALLOCATOR
#include "libtorrent/allocator.hpp" // for page_aligned_allocator #include "libtorrent/allocator.hpp" // for page_aligned_allocator
#include <boost/pool/pool.hpp> #include <boost/pool/pool.hpp>
#endif #endif
#if defined TORRENT_DEBUG || TORRENT_RELEASE_ASSERTS
#include <set>
#endif
#include "aux_/disable_warnings_pop.hpp"
#include "libtorrent/thread.hpp"
#include "libtorrent/io_service_fwd.hpp"
#include "libtorrent/file.hpp" // for iovec_t
namespace libtorrent namespace libtorrent
{ {
namespace aux { struct session_settings; } namespace aux { struct session_settings; }

View File

@ -33,15 +33,20 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef TORRENT_DISK_IO_JOB_HPP #ifndef TORRENT_DISK_IO_JOB_HPP
#define TORRENT_DISK_IO_JOB_HPP #define TORRENT_DISK_IO_JOB_HPP
#include <string>
#include "libtorrent/time.hpp" #include "libtorrent/time.hpp"
#include "libtorrent/error_code.hpp" #include "libtorrent/error_code.hpp"
#include "libtorrent/tailqueue.hpp" #include "libtorrent/tailqueue.hpp"
#include "libtorrent/peer_id.hpp" #include "libtorrent/peer_id.hpp"
#include "aux_/disable_warnings_push.hpp"
#include <string>
#include <boost/function/function1.hpp> #include <boost/function/function1.hpp>
#include <boost/shared_ptr.hpp> #include <boost/shared_ptr.hpp>
#include <boost/shared_ptr.hpp> #include <boost/shared_ptr.hpp>
#include "aux_/disable_warnings_pop.hpp"
namespace libtorrent namespace libtorrent
{ {
class entry; class entry;

View File

@ -35,8 +35,13 @@ POSSIBILITY OF SUCH DAMAGE.
#include "libtorrent/config.hpp" #include "libtorrent/config.hpp"
#include "libtorrent/thread.hpp" #include "libtorrent/thread.hpp"
#include "aux_/disable_warnings_push.hpp"
#include <boost/pool/object_pool.hpp> #include <boost/pool/object_pool.hpp>
#include "aux_/disable_warnings_pop.hpp"
namespace libtorrent namespace libtorrent
{ {
struct disk_io_job; struct disk_io_job;

View File

@ -303,7 +303,7 @@ namespace libtorrent
#ifndef BOOST_NO_EXCEPTIONS #ifndef BOOST_NO_EXCEPTIONS
// internal // internal
inline void throw_type_error() TORRENT_NO_RETURN inline void throw_type_error()
{ {
throw libtorrent_exception(error_code(errors::invalid_entry_type throw libtorrent_exception(error_code(errors::invalid_entry_type
, get_libtorrent_category())); , get_libtorrent_category()));

View File

@ -34,16 +34,22 @@ POSSIBILITY OF SUCH DAMAGE.
#define TORRENT_ENUM_NET_HPP_INCLUDED #define TORRENT_ENUM_NET_HPP_INCLUDED
#include "libtorrent/config.hpp" #include "libtorrent/config.hpp"
#include "aux_/disable_warnings_push.hpp"
#include <vector> #include <vector>
#include <boost/asio/ip/tcp.hpp> #include <boost/asio/ip/tcp.hpp>
#include "libtorrent/io_service_fwd.hpp"
#include "libtorrent/address.hpp"
#include "libtorrent/error_code.hpp"
#if TORRENT_USE_IFCONF || TORRENT_USE_NETLINK || TORRENT_USE_SYSCTL #if TORRENT_USE_IFCONF || TORRENT_USE_NETLINK || TORRENT_USE_SYSCTL
#include <sys/socket.h> // for SO_BINDTODEVICE #include <sys/socket.h> // for SO_BINDTODEVICE
#endif #endif
#include "aux_/disable_warnings_pop.hpp"
#include "libtorrent/io_service_fwd.hpp"
#include "libtorrent/address.hpp"
#include "libtorrent/error_code.hpp"
namespace libtorrent namespace libtorrent
{ {
struct socket_type; struct socket_type;

View File

@ -35,6 +35,10 @@ POSSIBILITY OF SUCH DAMAGE.
#include <boost/version.hpp> #include <boost/version.hpp>
#include "libtorrent/config.hpp" #include "libtorrent/config.hpp"
#include "libtorrent/string_util.hpp" // for allocate_string_copy
#include <stdlib.h> // free
#include "libtorrent/aux_/disable_warnings_push.hpp"
#if defined TORRENT_WINDOWS || defined TORRENT_CYGWIN #if defined TORRENT_WINDOWS || defined TORRENT_CYGWIN
// asio assumes that the windows error codes are defined already // asio assumes that the windows error codes are defined already
@ -47,8 +51,7 @@ POSSIBILITY OF SUCH DAMAGE.
#include <boost/system/error_code.hpp> #include <boost/system/error_code.hpp>
#endif #endif
#include "libtorrent/string_util.hpp" // for allocate_string_copy #include "libtorrent/aux_/disable_warnings_pop.hpp"
#include <stdlib.h> // free
#ifndef BOOST_SYSTEM_NOEXCEPT #ifndef BOOST_SYSTEM_NOEXCEPT
#define BOOST_SYSTEM_NOEXCEPT throw() #define BOOST_SYSTEM_NOEXCEPT throw()
@ -59,8 +62,10 @@ namespace libtorrent
namespace errors namespace errors
{ {
// libtorrent uses boost.system's ``error_code`` class to represent errors. libtorrent has // libtorrent uses boost.system's ``error_code`` class to represent
// its own error category get_libtorrent_category() whith the error codes defined by error_code_enum. // errors. libtorrent has its own error category
// get_libtorrent_category() whith the error codes defined by
// error_code_enum.
enum error_code_enum enum error_code_enum
{ {
// Not an error // Not an error
@ -535,8 +540,8 @@ namespace libtorrent
struct TORRENT_EXPORT libtorrent_exception: std::exception struct TORRENT_EXPORT libtorrent_exception: std::exception
{ {
libtorrent_exception(error_code const& s): m_error(s), m_msg(0) {} libtorrent_exception(error_code const& s): m_error(s), m_msg(0) {}
virtual const char* what() const throw(); virtual const char* what() const BOOST_SYSTEM_NOEXCEPT;
virtual ~libtorrent_exception() throw(); virtual ~libtorrent_exception() BOOST_SYSTEM_NOEXCEPT;
error_code error() const { return m_error; } error_code error() const { return m_error; }
private: private:
error_code m_error; error_code m_error;
@ -619,6 +624,9 @@ namespace boost { namespace system {
#endif // BOOST_VERSION #endif // BOOST_VERSION
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif
#endif #endif

View File

@ -69,7 +69,7 @@ POSSIBILITY OF SUCH DAMAGE.
// when this is specified, export a bunch of extra // when this is specified, export a bunch of extra
// symbols, mostly for the unit tests to reach // symbols, mostly for the unit tests to reach
#if TORRENT_EXPORT_EXTRA #if defined TORRENT_EXPORT_EXTRA
# if defined TORRENT_BUILDING_SHARED # if defined TORRENT_BUILDING_SHARED
# define TORRENT_EXTRA_EXPORT BOOST_SYMBOL_EXPORT # define TORRENT_EXTRA_EXPORT BOOST_SYMBOL_EXPORT
# elif defined TORRENT_LINKING_SHARED # elif defined TORRENT_LINKING_SHARED

View File

@ -165,15 +165,11 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef TORRENT_DISABLE_EXTENSIONS #ifndef TORRENT_DISABLE_EXTENSIONS
#ifdef _MSC_VER #include "aux_/disable_warnings_push.hpp"
#pragma warning(push, 1)
#endif
#include <boost/weak_ptr.hpp> #include <boost/weak_ptr.hpp>
#ifdef _MSC_VER #include "aux_/disable_warnings_pop.hpp"
#pragma warning(pop)
#endif
#include <vector> #include <vector>
#include "libtorrent/config.hpp" #include "libtorrent/config.hpp"

View File

@ -35,16 +35,12 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef TORRENT_DISABLE_EXTENSIONS #ifndef TORRENT_DISABLE_EXTENSIONS
#ifdef _MSC_VER #include "aux_/disable_warnings_push.hpp"
#pragma warning(push, 1)
#endif
#include <boost/shared_ptr.hpp> #include <boost/shared_ptr.hpp>
#include "libtorrent/config.hpp" #include "libtorrent/config.hpp"
#ifdef _MSC_VER #include "aux_/disable_warnings_pop.hpp"
#pragma warning(pop)
#endif
namespace libtorrent namespace libtorrent
{ {

View File

@ -35,16 +35,13 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef TORRENT_DISABLE_EXTENSIONS #ifndef TORRENT_DISABLE_EXTENSIONS
#ifdef _MSC_VER
#pragma warning(push, 1)
#endif
#include <boost/shared_ptr.hpp>
#include "libtorrent/config.hpp" #include "libtorrent/config.hpp"
#ifdef _MSC_VER #include "aux_/disable_warnings_push.hpp"
#pragma warning(pop)
#endif #include <boost/shared_ptr.hpp>
#include "aux_/disable_warnings_pop.hpp"
#ifndef TORRENT_NO_DEPRECATE #ifndef TORRENT_NO_DEPRECATE

View File

@ -35,16 +35,12 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef TORRENT_DISABLE_EXTENSIONS #ifndef TORRENT_DISABLE_EXTENSIONS
#ifdef _MSC_VER #include "aux_/disable_warnings_push.hpp"
#pragma warning(push, 1)
#endif
#include <boost/shared_ptr.hpp> #include <boost/shared_ptr.hpp>
#include "libtorrent/config.hpp" #include "libtorrent/config.hpp"
#ifdef _MSC_VER #include "aux_/disable_warnings_pop.hpp"
#pragma warning(pop)
#endif
namespace libtorrent namespace libtorrent
{ {

View File

@ -35,16 +35,12 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef TORRENT_DISABLE_EXTENSIONS #ifndef TORRENT_DISABLE_EXTENSIONS
#ifdef _MSC_VER #include "aux_/disable_warnings_push.hpp"
#pragma warning(push, 1)
#endif
#include <boost/shared_ptr.hpp> #include <boost/shared_ptr.hpp>
#include "libtorrent/config.hpp" #include "libtorrent/config.hpp"
#ifdef _MSC_VER #include "aux_/disable_warnings_pop.hpp"
#pragma warning(pop)
#endif
namespace libtorrent namespace libtorrent
{ {

View File

@ -35,16 +35,12 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef TORRENT_DISABLE_EXTENSIONS #ifndef TORRENT_DISABLE_EXTENSIONS
#ifdef _MSC_VER #include "aux_/disable_warnings_push.hpp"
#pragma warning(push, 1)
#endif
#include <boost/shared_ptr.hpp> #include <boost/shared_ptr.hpp>
#include "libtorrent/config.hpp" #include "libtorrent/config.hpp"
#ifdef _MSC_VER #include "aux_/disable_warnings_pop.hpp"
#pragma warning(pop)
#endif
namespace libtorrent namespace libtorrent
{ {

View File

@ -36,21 +36,13 @@ POSSIBILITY OF SUCH DAMAGE.
#include <memory> #include <memory>
#include <string> #include <string>
#ifdef _MSC_VER #include "libtorrent/config.hpp"
#pragma warning(push, 1)
#endif #include "aux_/disable_warnings_push.hpp"
#include <boost/noncopyable.hpp> #include <boost/noncopyable.hpp>
#include <boost/smart_ptr.hpp> #include <boost/smart_ptr.hpp>
#include <boost/function.hpp>
#ifdef _MSC_VER
#pragma warning(pop)
#endif
#include "libtorrent/config.hpp"
#include "libtorrent/error_code.hpp"
#include "libtorrent/assert.hpp"
#include "libtorrent/time.hpp"
#ifdef TORRENT_WINDOWS #ifdef TORRENT_WINDOWS
// windows part // windows part
@ -82,7 +74,11 @@ POSSIBILITY OF SUCH DAMAGE.
#endif #endif
#include <boost/function.hpp> #include "aux_/disable_warnings_pop.hpp"
#include "libtorrent/error_code.hpp"
#include "libtorrent/assert.hpp"
#include "libtorrent/time.hpp"
namespace libtorrent namespace libtorrent
{ {
@ -206,7 +202,7 @@ namespace libtorrent
struct file; struct file;
#if TORRENT_DEBUG_FILE_LEAKS #ifdef TORRENT_DEBUG_FILE_LEAKS
struct file_handle struct file_handle
{ {
file_handle(); file_handle();
@ -338,7 +334,7 @@ namespace libtorrent
boost::uint32_t file_id() const { return m_file_id; } boost::uint32_t file_id() const { return m_file_id; }
#endif #endif
#if TORRENT_DEBUG_FILE_LEAKS #ifdef TORRENT_DEBUG_FILE_LEAKS
void print_info(FILE* out) const; void print_info(FILE* out) const;
#endif #endif
@ -365,7 +361,7 @@ namespace libtorrent
static bool has_manage_volume_privs; static bool has_manage_volume_privs;
#endif #endif
#if TORRENT_DEBUG_FILE_LEAKS #ifdef TORRENT_DEBUG_FILE_LEAKS
std::string m_file_path; std::string m_file_path;
#endif #endif
}; };

View File

@ -33,12 +33,17 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef TORRENT_FILE_STORAGE_HPP_INCLUDED #ifndef TORRENT_FILE_STORAGE_HPP_INCLUDED
#define TORRENT_FILE_STORAGE_HPP_INCLUDED #define TORRENT_FILE_STORAGE_HPP_INCLUDED
#include "aux_/disable_warnings_push.hpp"
#include <string> #include <string>
#include <vector> #include <vector>
#include <ctime> #include <ctime>
#include <boost/cstdint.hpp> #include <boost/cstdint.hpp>
#include <boost/unordered_set.hpp> #include <boost/unordered_set.hpp>
#include "aux_/disable_warnings_pop.hpp"
#include "libtorrent/assert.hpp" #include "libtorrent/assert.hpp"
#include "libtorrent/peer_request.hpp" #include "libtorrent/peer_request.hpp"
#include "libtorrent/peer_id.hpp" #include "libtorrent/peer_id.hpp"

View File

@ -115,8 +115,8 @@ namespace libtorrent
char version_to_char(int v) const char version_to_char(int v) const
{ {
if (v >= 0 && v < 10) return '0' + v; if (v >= 0 && v < 10) return char('0' + v);
else if (v >= 10) return 'A' + (v - 10); else if (v >= 10) return char('A' + (v - 10));
TORRENT_ASSERT(false); TORRENT_ASSERT(false);
return '0'; return '0';
} }

View File

@ -69,7 +69,7 @@ namespace libtorrent {
uintptr_t* ptr = m_storage + m_size; uintptr_t* ptr = m_storage + m_size;
// length prefix // length prefix
header_t* hdr = (header_t*)ptr; header_t* hdr = reinterpret_cast<header_t*>(ptr);
hdr->len = object_size; hdr->len = object_size;
hdr->move = &move<U>; hdr->move = &move<U>;
ptr += header_size; ptr += header_size;
@ -91,10 +91,10 @@ namespace libtorrent {
uintptr_t const* const end = m_storage + m_size; uintptr_t const* const end = m_storage + m_size;
while (ptr < end) while (ptr < end)
{ {
header_t* hdr = (header_t*)ptr; header_t* hdr = reinterpret_cast<header_t*>(ptr);
ptr += header_size; ptr += header_size;
TORRENT_ASSERT(ptr + hdr->len <= end); TORRENT_ASSERT(ptr + hdr->len <= end);
out.push_back((T*)ptr); out.push_back(reinterpret_cast<T*>(ptr));
ptr += hdr->len; ptr += hdr->len;
} }
} }
@ -116,10 +116,10 @@ namespace libtorrent {
uintptr_t const* const end = m_storage + m_size; uintptr_t const* const end = m_storage + m_size;
while (ptr < end) while (ptr < end)
{ {
header_t* hdr = (header_t*)ptr; header_t* hdr = reinterpret_cast<header_t*>(ptr);
ptr += header_size; ptr += header_size;
TORRENT_ASSERT(ptr + hdr->len <= end); TORRENT_ASSERT(ptr + hdr->len <= end);
T* a = (T*)ptr; T* a = reinterpret_cast<T*>(ptr);
a->~T(); a->~T();
ptr += hdr->len; ptr += hdr->len;
} }
@ -133,10 +133,10 @@ namespace libtorrent {
TORRENT_ASSERT(m_size > 1); TORRENT_ASSERT(m_size > 1);
uintptr_t* ptr = m_storage; uintptr_t* ptr = m_storage;
header_t* hdr = (header_t*)ptr; header_t* hdr = reinterpret_cast<header_t*>(ptr);
ptr += header_size; ptr += header_size;
TORRENT_ASSERT(hdr->len <= m_size); TORRENT_ASSERT(hdr->len <= m_size);
return (T*)ptr; return reinterpret_cast<T*>(ptr);
} }
~heterogeneous_queue() ~heterogeneous_queue()
@ -176,8 +176,8 @@ namespace libtorrent {
uintptr_t const* const end = m_storage + m_size; uintptr_t const* const end = m_storage + m_size;
while (src < end) while (src < end)
{ {
header_t* src_hdr = (header_t*)src; header_t* src_hdr = reinterpret_cast<header_t*>(src);
header_t* dst_hdr = (header_t*)dst; header_t* dst_hdr = reinterpret_cast<header_t*>(dst);
*dst_hdr = *src_hdr; *dst_hdr = *src_hdr;
src += header_size; src += header_size;
dst += header_size; dst += header_size;
@ -196,7 +196,7 @@ namespace libtorrent {
template <class U> template <class U>
static void move(uintptr_t* dst, uintptr_t* src) static void move(uintptr_t* dst, uintptr_t* src)
{ {
U* rhs = (U*)src; U* rhs = reinterpret_cast<U*>(src);
#if __cplusplus >= 201103L #if __cplusplus >= 201103L
new (dst) U(std::move(*rhs)); new (dst) U(std::move(*rhs));
#else #else

View File

@ -33,6 +33,8 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef TORRENT_HTTP_CONNECTION #ifndef TORRENT_HTTP_CONNECTION
#define TORRENT_HTTP_CONNECTION #define TORRENT_HTTP_CONNECTION
#include "aux_/disable_warnings_push.hpp"
#include <boost/function/function1.hpp> #include <boost/function/function1.hpp>
#include <boost/function/function2.hpp> #include <boost/function/function2.hpp>
#include <boost/function/function5.hpp> #include <boost/function/function5.hpp>
@ -43,6 +45,12 @@ POSSIBILITY OF SUCH DAMAGE.
#include <vector> #include <vector>
#include <string> #include <string>
#ifdef TORRENT_USE_OPENSSL
#include <boost/asio/ssl/context.hpp>
#endif
#include "aux_/disable_warnings_pop.hpp"
#include "libtorrent/socket.hpp" #include "libtorrent/socket.hpp"
#include "libtorrent/error_code.hpp" #include "libtorrent/error_code.hpp"
#include "libtorrent/http_parser.hpp" #include "libtorrent/http_parser.hpp"
@ -53,10 +61,6 @@ POSSIBILITY OF SUCH DAMAGE.
#include "libtorrent/i2p_stream.hpp" #include "libtorrent/i2p_stream.hpp"
#ifdef TORRENT_USE_OPENSSL
#include <boost/asio/ssl/context.hpp>
#endif
namespace libtorrent namespace libtorrent
{ {

View File

@ -38,16 +38,12 @@ POSSIBILITY OF SUCH DAMAGE.
#include <utility> #include <utility>
#include <vector> #include <vector>
#ifdef _MSC_VER #include "aux_/disable_warnings_push.hpp"
#pragma warning(push, 1)
#endif
#include <boost/cstdint.hpp> #include <boost/cstdint.hpp>
#include <boost/tuple/tuple.hpp> #include <boost/tuple/tuple.hpp>
#ifdef _MSC_VER #include "aux_/disable_warnings_pop.hpp"
#pragma warning(pop)
#endif
#include "libtorrent/config.hpp" #include "libtorrent/config.hpp"
#include "libtorrent/buffer.hpp" #include "libtorrent/buffer.hpp"

View File

@ -40,9 +40,7 @@ POSSIBILITY OF SUCH DAMAGE.
#include "libtorrent/debug.hpp" #include "libtorrent/debug.hpp"
#ifdef _MSC_VER #include "aux_/disable_warnings_push.hpp"
#pragma warning(push, 1)
#endif
#include <boost/smart_ptr.hpp> #include <boost/smart_ptr.hpp>
#include <boost/weak_ptr.hpp> #include <boost/weak_ptr.hpp>
@ -51,9 +49,7 @@ POSSIBILITY OF SUCH DAMAGE.
#include <boost/optional.hpp> #include <boost/optional.hpp>
#include <boost/cstdint.hpp> #include <boost/cstdint.hpp>
#ifdef _MSC_VER #include "aux_/disable_warnings_pop.hpp"
#pragma warning(pop)
#endif
#include "libtorrent/config.hpp" #include "libtorrent/config.hpp"
#include "libtorrent/web_connection_base.hpp" #include "libtorrent/web_connection_base.hpp"

View File

@ -33,12 +33,17 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef TORRENT_HTTP_STREAM_HPP_INCLUDED #ifndef TORRENT_HTTP_STREAM_HPP_INCLUDED
#define TORRENT_HTTP_STREAM_HPP_INCLUDED #define TORRENT_HTTP_STREAM_HPP_INCLUDED
#include "aux_/disable_warnings_push.hpp"
#include <boost/function/function1.hpp> #include <boost/function/function1.hpp>
#include "libtorrent/proxy_base.hpp"
#include "libtorrent/string_util.hpp"
#include <boost/bind.hpp> #include <boost/bind.hpp>
#include <boost/shared_ptr.hpp> #include <boost/shared_ptr.hpp>
#include "aux_/disable_warnings_pop.hpp"
#include "libtorrent/proxy_base.hpp"
#include "libtorrent/string_util.hpp"
namespace libtorrent { namespace libtorrent {
class http_stream : public proxy_base class http_stream : public proxy_base

View File

@ -36,15 +36,11 @@ POSSIBILITY OF SUCH DAMAGE.
#include <string> #include <string>
#include <vector> #include <vector>
#ifdef _MSC_VER #include "aux_/disable_warnings_push.hpp"
#pragma warning(push, 1)
#endif
#include <boost/shared_ptr.hpp> #include <boost/shared_ptr.hpp>
#ifdef _MSC_VER #include "aux_/disable_warnings_pop.hpp"
#pragma warning(pop)
#endif
#include "libtorrent/config.hpp" #include "libtorrent/config.hpp"
#include "libtorrent/lazy_entry.hpp" #include "libtorrent/lazy_entry.hpp"

View File

@ -37,6 +37,8 @@ POSSIBILITY OF SUCH DAMAGE.
#if TORRENT_USE_I2P #if TORRENT_USE_I2P
#include "aux_/disable_warnings_push.hpp"
#include <list> #include <list>
#include <string> #include <string>
#include <vector> #include <vector>
@ -44,6 +46,9 @@ POSSIBILITY OF SUCH DAMAGE.
#include <boost/function/function2.hpp> #include <boost/function/function2.hpp>
#include <boost/bind.hpp> #include <boost/bind.hpp>
#include <boost/shared_ptr.hpp> #include <boost/shared_ptr.hpp>
#include "aux_/disable_warnings_pop.hpp"
#include "libtorrent/proxy_base.hpp" #include "libtorrent/proxy_base.hpp"
#include "libtorrent/session_settings.hpp" #include "libtorrent/session_settings.hpp"
#include "libtorrent/string_util.hpp" #include "libtorrent/string_util.hpp"

View File

@ -33,15 +33,11 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef TORRENT_IDENTIFY_CLIENT_HPP_INCLUDED #ifndef TORRENT_IDENTIFY_CLIENT_HPP_INCLUDED
#define TORRENT_IDENTIFY_CLIENT_HPP_INCLUDED #define TORRENT_IDENTIFY_CLIENT_HPP_INCLUDED
#ifdef _MSC_VER #include "aux_/disable_warnings_push.hpp"
#pragma warning(push, 1)
#endif
#include <boost/optional.hpp> #include <boost/optional.hpp>
#ifdef _MSC_VER #include "aux_/disable_warnings_pop.hpp"
#pragma warning(pop)
#endif
#include "libtorrent/peer_id.hpp" #include "libtorrent/peer_id.hpp"
#include "libtorrent/fingerprint.hpp" #include "libtorrent/fingerprint.hpp"

View File

@ -51,7 +51,7 @@ namespace libtorrent
inline T read_impl(InIt& start, type<T>) inline T read_impl(InIt& start, type<T>)
{ {
T ret = 0; T ret = 0;
for (int i = 0; i < (int)sizeof(T); ++i) for (int i = 0; i < int(sizeof(T)); ++i)
{ {
ret <<= 8; ret <<= 8;
ret |= static_cast<boost::uint8_t>(*start); ret |= static_cast<boost::uint8_t>(*start);
@ -75,7 +75,7 @@ namespace libtorrent
template <class T, class OutIt> template <class T, class OutIt>
inline void write_impl(T val, OutIt& start) inline void write_impl(T val, OutIt& start)
{ {
for (int i = (int)sizeof(T)-1; i >= 0; --i) for (int i = int(sizeof(T))-1; i >= 0; --i)
{ {
*start = static_cast<unsigned char>((val >> (i * 8)) & 0xff); *start = static_cast<unsigned char>((val >> (i * 8)) & 0xff);
++start; ++start;
@ -151,7 +151,7 @@ namespace libtorrent
inline int write_string(std::string const& str, char*& start) inline int write_string(std::string const& str, char*& start)
{ {
std::memcpy((void*)start, str.c_str(), str.size()); std::memcpy(reinterpret_cast<void*>(start), str.c_str(), str.size());
start += str.size(); start += str.size();
return str.size(); return str.size();
} }

View File

@ -37,9 +37,7 @@ POSSIBILITY OF SUCH DAMAGE.
#define Protocol Protocol_ #define Protocol Protocol_
#endif #endif
#ifdef _MSC_VER #include "aux_/disable_warnings_push.hpp"
#pragma warning(push, 1)
#endif
#include <boost/version.hpp> #include <boost/version.hpp>
@ -54,9 +52,7 @@ POSSIBILITY OF SUCH DAMAGE.
#include <boost/asio/io_service.hpp> #include <boost/asio/io_service.hpp>
#endif #endif
#ifdef _MSC_VER #include "aux_/disable_warnings_pop.hpp"
#pragma warning(pop)
#endif
#ifdef __OBJC__ #ifdef __OBJC__
#undef Protocol #undef Protocol

View File

@ -37,15 +37,11 @@ POSSIBILITY OF SUCH DAMAGE.
#define Protocol Protocol_ #define Protocol Protocol_
#endif #endif
#ifdef _MSC_VER #include "aux_/disable_warnings_push.hpp"
#pragma warning(push, 1)
#endif
#include <boost/version.hpp> #include <boost/version.hpp>
#ifdef _MSC_VER #include "aux_/disable_warnings_pop.hpp"
#pragma warning(pop)
#endif
#ifdef __OBJC__ #ifdef __OBJC__
#undef Protocol #undef Protocol

View File

@ -36,19 +36,14 @@ POSSIBILITY OF SUCH DAMAGE.
#include <set> #include <set>
#include <vector> #include <vector>
#ifdef _MSC_VER #include "aux_/disable_warnings_push.hpp"
#pragma warning(push, 1)
#endif
#include <boost/limits.hpp> #include <boost/limits.hpp>
#include <boost/utility.hpp> #include <boost/utility.hpp>
#include <boost/cstdint.hpp> #include <boost/cstdint.hpp>
#include <boost/tuple/tuple.hpp> #include <boost/tuple/tuple.hpp>
#ifdef _MSC_VER #include "aux_/disable_warnings_pop.hpp"
#pragma warning(pop)
#endif
#include "libtorrent/config.hpp" #include "libtorrent/config.hpp"
#include "libtorrent/address.hpp" #include "libtorrent/address.hpp"

View File

@ -33,23 +33,26 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef ROUTING_TABLE_HPP #ifndef ROUTING_TABLE_HPP
#define ROUTING_TABLE_HPP #define ROUTING_TABLE_HPP
#include <vector> #include "aux_/disable_warnings_push.hpp"
#include <boost/cstdint.hpp>
#include <vector>
#include <set>
#include <boost/cstdint.hpp>
#include <boost/utility.hpp> #include <boost/utility.hpp>
#include <boost/tuple/tuple.hpp> #include <boost/tuple/tuple.hpp>
#include <boost/array.hpp> #include <boost/array.hpp>
#include <boost/noncopyable.hpp> #include <boost/noncopyable.hpp>
#include <set> #include <boost/unordered_set.hpp>
#include "aux_/disable_warnings_pop.hpp"
#include <libtorrent/kademlia/logging.hpp> #include <libtorrent/kademlia/logging.hpp>
#include <libtorrent/kademlia/node_id.hpp> #include <libtorrent/kademlia/node_id.hpp>
#include <libtorrent/kademlia/node_entry.hpp> #include <libtorrent/kademlia/node_entry.hpp>
#include <libtorrent/session_settings.hpp> #include <libtorrent/session_settings.hpp>
#include <libtorrent/assert.hpp> #include <libtorrent/assert.hpp>
#include <libtorrent/time.hpp> #include <libtorrent/time.hpp>
#include <boost/unordered_set.hpp>
namespace libtorrent namespace libtorrent
{ {

View File

@ -33,6 +33,8 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef RPC_MANAGER_HPP #ifndef RPC_MANAGER_HPP
#define RPC_MANAGER_HPP #define RPC_MANAGER_HPP
#include "aux_/disable_warnings_push.hpp"
#include <vector> #include <vector>
#include <deque> #include <deque>
#include <map> #include <map>
@ -46,6 +48,8 @@ POSSIBILITY OF SUCH DAMAGE.
#include <multimap> #include <multimap>
#endif #endif
#include "aux_/disable_warnings_pop.hpp"
#include <libtorrent/socket.hpp> #include <libtorrent/socket.hpp>
#include <libtorrent/entry.hpp> #include <libtorrent/entry.hpp>
#include <libtorrent/kademlia/node_id.hpp> #include <libtorrent/kademlia/node_id.hpp>

View File

@ -33,15 +33,11 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef TORRENT_PARSE_URL_HPP_INCLUDED #ifndef TORRENT_PARSE_URL_HPP_INCLUDED
#define TORRENT_PARSE_URL_HPP_INCLUDED #define TORRENT_PARSE_URL_HPP_INCLUDED
#ifdef _MSC_VER #include "aux_/disable_warnings_push.hpp"
#pragma warning(push, 1)
#endif
#include <boost/tuple/tuple.hpp> #include <boost/tuple/tuple.hpp>
#ifdef _MSC_VER #include "aux_/disable_warnings_pop.hpp"
#pragma warning(pop)
#endif
#include <string> #include <string>
#include "libtorrent/config.hpp" #include "libtorrent/config.hpp"

View File

@ -30,10 +30,15 @@ POSSIBILITY OF SUCH DAMAGE.
*/ */
#include "aux_/disable_warnings_push.hpp"
#include <string> #include <string>
#include <vector> #include <vector>
#include <boost/unordered_map.hpp> #include <boost/unordered_map.hpp>
#include <boost/cstdint.hpp> #include <boost/cstdint.hpp>
#include "aux_/disable_warnings_pop.hpp"
#include "libtorrent/config.hpp" #include "libtorrent/config.hpp"
#include "libtorrent/file.hpp" #include "libtorrent/file.hpp"
#include "libtorrent/error_code.hpp" #include "libtorrent/error_code.hpp"

View File

@ -36,11 +36,15 @@ POSSIBILITY OF SUCH DAMAGE.
#include "libtorrent/bandwidth_limit.hpp" #include "libtorrent/bandwidth_limit.hpp"
#include "libtorrent/assert.hpp" #include "libtorrent/assert.hpp"
#include "aux_/disable_warnings_push.hpp"
#include <vector> #include <vector>
#include <string> #include <string>
#include <boost/smart_ptr.hpp> #include <boost/smart_ptr.hpp>
#include <boost/cstdint.hpp> #include <boost/cstdint.hpp>
#include "aux_/disable_warnings_pop.hpp"
namespace libtorrent namespace libtorrent
{ {
typedef boost::uint8_t peer_class_t; typedef boost::uint8_t peer_class_t;

View File

@ -42,9 +42,7 @@ POSSIBILITY OF SUCH DAMAGE.
#include "libtorrent/debug.hpp" #include "libtorrent/debug.hpp"
#endif #endif
#ifdef _MSC_VER #include "aux_/disable_warnings_push.hpp"
#pragma warning(push, 1)
#endif
#include <boost/smart_ptr.hpp> #include <boost/smart_ptr.hpp>
#include <boost/weak_ptr.hpp> #include <boost/weak_ptr.hpp>
@ -55,9 +53,7 @@ POSSIBILITY OF SUCH DAMAGE.
#include <boost/pool/pool.hpp> #include <boost/pool/pool.hpp>
#include <boost/aligned_storage.hpp> #include <boost/aligned_storage.hpp>
#ifdef _MSC_VER #include "aux_/disable_warnings_pop.hpp"
#pragma warning(pop)
#endif
#include "libtorrent/buffer.hpp" #include "libtorrent/buffer.hpp"
#include "libtorrent/peer_id.hpp" #include "libtorrent/peer_id.hpp"

View File

@ -33,8 +33,13 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef TORRENT_PERFORMANCE_COUNTERS_HPP_INCLUDED #ifndef TORRENT_PERFORMANCE_COUNTERS_HPP_INCLUDED
#define TORRENT_PERFORMANCE_COUNTERS_HPP_INCLUDED #define TORRENT_PERFORMANCE_COUNTERS_HPP_INCLUDED
#include "aux_/disable_warnings_push.hpp"
#include <boost/cstdint.hpp> #include <boost/cstdint.hpp>
#include <boost/atomic.hpp> #include <boost/atomic.hpp>
#include "aux_/disable_warnings_pop.hpp"
#include "libtorrent/config.hpp" #include "libtorrent/config.hpp"
namespace libtorrent namespace libtorrent

View File

@ -32,34 +32,25 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef TORRENT_PIECE_PICKER_HPP_INCLUDED #ifndef TORRENT_PIECE_PICKER_HPP_INCLUDED
#define TORRENT_PIECE_PICKER_HPP_INCLUDED #define TORRENT_PIECE_PICKER_HPP_INCLUDED
#include <algorithm>
#include <vector>
#include <bitset>
#include <utility>
#ifdef _MSC_VER
#pragma warning(push, 1)
#endif
#include <boost/static_assert.hpp>
#include <boost/cstdint.hpp>
#include <boost/tuple/tuple.hpp>
#ifdef _MSC_VER
#pragma warning(pop)
#endif
#include "libtorrent/peer_id.hpp"
#include "libtorrent/config.hpp"
#include "libtorrent/assert.hpp"
#include "libtorrent/time.hpp"
// this is really only useful for debugging unit tests // this is really only useful for debugging unit tests
//#define TORRENT_PICKER_LOG //#define TORRENT_PICKER_LOG
// heavy weight reference counting invariant checks // heavy weight reference counting invariant checks
//#define TORRENT_DEBUG_REFCOUNTS //#define TORRENT_DEBUG_REFCOUNTS
#include "libtorrent/config.hpp"
#include "aux_/disable_warnings_push.hpp"
#include <algorithm>
#include <vector>
#include <bitset>
#include <utility>
#include <boost/static_assert.hpp>
#include <boost/cstdint.hpp>
#include <boost/tuple/tuple.hpp>
#ifdef TORRENT_DEBUG_REFCOUNTS #ifdef TORRENT_DEBUG_REFCOUNTS
#include <set> #include <set>
#endif #endif
@ -68,6 +59,12 @@ POSSIBILITY OF SUCH DAMAGE.
#include <set> #include <set>
#endif #endif
#include "aux_/disable_warnings_pop.hpp"
#include "libtorrent/peer_id.hpp"
#include "libtorrent/assert.hpp"
#include "libtorrent/time.hpp"
namespace libtorrent namespace libtorrent
{ {
@ -499,10 +496,10 @@ namespace libtorrent
{ {
piece_pos() {} piece_pos() {}
piece_pos(int peer_count_, int index_) piece_pos(int peer_count_, int index_)
: peer_count(peer_count_) : peer_count(unsigned(peer_count_))
, download_state(piece_pos::piece_open) , download_state(piece_pos::piece_open)
, piece_priority(4) , piece_priority(4)
, index(index_) , index(unsigned(index_))
{ {
TORRENT_ASSERT(peer_count_ >= 0); TORRENT_ASSERT(peer_count_ >= 0);
TORRENT_ASSERT(index_ >= 0); TORRENT_ASSERT(index_ >= 0);
@ -582,7 +579,7 @@ namespace libtorrent
// the number of peers that has this piece // the number of peers that has this piece
// (availability) // (availability)
#if TORRENT_OPTIMIZE_MEMORY_USAGE #ifdef TORRENT_OPTIMIZE_MEMORY_USAGE
boost::uint32_t peer_count : 9; boost::uint32_t peer_count : 9;
#else #else
boost::uint32_t peer_count : 16; boost::uint32_t peer_count : 16;
@ -614,7 +611,7 @@ namespace libtorrent
boost::uint32_t piece_priority : 3; boost::uint32_t piece_priority : 3;
// index in to the piece_info vector // index in to the piece_info vector
#if TORRENT_OPTIMIZE_MEMORY_USAGE #ifdef TORRENT_OPTIMIZE_MEMORY_USAGE
boost::uint32_t index : 17; boost::uint32_t index : 17;
#else #else
boost::uint32_t index; boost::uint32_t index;
@ -630,7 +627,7 @@ namespace libtorrent
// index is set to this to indicate that we have the // index is set to this to indicate that we have the
// piece. There is no entry for the piece in the // piece. There is no entry for the piece in the
// buckets if this is the case. // buckets if this is the case.
#if TORRENT_OPTIMIZE_MEMORY_USAGE #ifdef TORRENT_OPTIMIZE_MEMORY_USAGE
we_have_index = 0x3ffff, we_have_index = 0x3ffff,
#else #else
we_have_index = 0xffffffff, we_have_index = 0xffffffff,
@ -638,7 +635,7 @@ namespace libtorrent
// the priority value that means the piece is filtered // the priority value that means the piece is filtered
filter_priority = 0, filter_priority = 0,
// the max number the peer count can hold // the max number the peer count can hold
#if TORRENT_OPTIMIZE_MEMORY_USAGE #ifdef TORRENT_OPTIMIZE_MEMORY_USAGE
max_peer_count = 0x1ff max_peer_count = 0x1ff
#else #else
max_peer_count = 0xffff max_peer_count = 0xffff
@ -710,7 +707,7 @@ namespace libtorrent
}; };
#ifndef TORRENT_DEBUG_REFCOUNTS #ifndef TORRENT_DEBUG_REFCOUNTS
#if TORRENT_OPTIMIZE_MEMORY_USAGE #ifdef TORRENT_OPTIMIZE_MEMORY_USAGE
BOOST_STATIC_ASSERT(sizeof(piece_pos) == sizeof(char) * 4); BOOST_STATIC_ASSERT(sizeof(piece_pos) == sizeof(char) * 4);
#else #else
BOOST_STATIC_ASSERT(sizeof(piece_pos) == sizeof(char) * 8); BOOST_STATIC_ASSERT(sizeof(piece_pos) == sizeof(char) * 8);
@ -843,7 +840,7 @@ namespace libtorrent
mutable bool m_dirty; mutable bool m_dirty;
public: public:
#if TORRENT_OPTIMIZE_MEMORY_USAGE #ifdef TORRENT_OPTIMIZE_MEMORY_USAGE
enum { max_pieces = piece_pos::we_have_index - 1 }; enum { max_pieces = piece_pos::we_have_index - 1 };
#else #else
// still limited by piece_block // still limited by piece_block

View File

@ -33,10 +33,15 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef TORRENT_RESOLVE_LINKS_HPP #ifndef TORRENT_RESOLVE_LINKS_HPP
#define TORRENT_RESOLVE_LINKS_HPP #define TORRENT_RESOLVE_LINKS_HPP
#include "aux_/disable_warnings_push.hpp"
#include <boost/shared_ptr.hpp> #include <boost/shared_ptr.hpp>
#include <boost/unordered_map.hpp> #include <boost/unordered_map.hpp>
#include <vector> #include <vector>
#include <utility> #include <utility>
#include "aux_/disable_warnings_pop.hpp"
#include "libtorrent/export.hpp" #include "libtorrent/export.hpp"
namespace libtorrent namespace libtorrent

View File

@ -33,10 +33,15 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef TORRENT_RESOLVER_HPP_INCLUDE #ifndef TORRENT_RESOLVER_HPP_INCLUDE
#define TORRENT_RESOLVER_HPP_INCLUDE #define TORRENT_RESOLVER_HPP_INCLUDE
#include "aux_/disable_warnings_push.hpp"
#include <boost/asio/ip/tcp.hpp> #include <boost/asio/ip/tcp.hpp>
#include <boost/function.hpp> #include <boost/function.hpp>
#include <boost/unordered_map.hpp> #include <boost/unordered_map.hpp>
#include <vector> #include <vector>
#include "aux_/disable_warnings_pop.hpp"
#include "libtorrent/error_code.hpp" #include "libtorrent/error_code.hpp"
#include "libtorrent/io_service.hpp" #include "libtorrent/io_service.hpp"
#include "libtorrent/resolver_interface.hpp" #include "libtorrent/resolver_interface.hpp"

View File

@ -36,16 +36,15 @@ POSSIBILITY OF SUCH DAMAGE.
#include <algorithm> #include <algorithm>
#include <vector> #include <vector>
#ifdef _MSC_VER #include "aux_/disable_warnings_push.hpp"
#pragma warning(push, 1)
#endif
#include <boost/limits.hpp> #include <boost/limits.hpp>
#ifdef _MSC_VER #ifdef _MSC_VER
#pragma warning(pop) # include <eh.h>
#endif #endif
#include "aux_/disable_warnings_pop.hpp"
#include "libtorrent/config.hpp" #include "libtorrent/config.hpp"
#include "libtorrent/torrent_handle.hpp" #include "libtorrent/torrent_handle.hpp"
#include "libtorrent/entry.hpp" #include "libtorrent/entry.hpp"
@ -62,10 +61,6 @@ POSSIBILITY OF SUCH DAMAGE.
#include "libtorrent/storage.hpp" #include "libtorrent/storage.hpp"
#include "libtorrent/session_settings.hpp" #include "libtorrent/session_settings.hpp"
#ifdef _MSC_VER
# include <eh.h>
#endif
#ifndef TORRENT_NO_DEPRECATE #ifndef TORRENT_NO_DEPRECATE
#include "libtorrent/rss.hpp" #include "libtorrent/rss.hpp"
#endif #endif

View File

@ -305,7 +305,7 @@ namespace libtorrent
// return a copy of the 20 bytes representing the sha1-hash as a std::string. // return a copy of the 20 bytes representing the sha1-hash as a std::string.
// It's still a binary string with 20 binary characters. // It's still a binary string with 20 binary characters.
std::string to_string() const std::string to_string() const
{ return std::string((char const*)&m_number[0], size); } { return std::string(reinterpret_cast<char const*>(&m_number[0]), size); }
private: private:
@ -327,7 +327,7 @@ namespace libtorrent
inline std::ostream& operator<<(std::ostream& os, sha1_hash const& peer) inline std::ostream& operator<<(std::ostream& os, sha1_hash const& peer)
{ {
char out[41]; char out[41];
to_hex((char const*)&peer[0], sha1_hash::size, out); to_hex(reinterpret_cast<char const*>(&peer[0]), sha1_hash::size, out);
return os << out; return os << out;
} }
@ -336,7 +336,7 @@ namespace libtorrent
{ {
char hex[40]; char hex[40];
is.read(hex, 40); is.read(hex, 40);
if (!from_hex(hex, 40, (char*)&peer[0])) if (!from_hex(hex, 40, reinterpret_cast<char*>(&peer[0])))
is.setstate(std::ios_base::failbit); is.setstate(std::ios_base::failbit);
return is; return is;
} }

View File

@ -33,9 +33,7 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef TORRENT_SOCKET_HPP_INCLUDED #ifndef TORRENT_SOCKET_HPP_INCLUDED
#define TORRENT_SOCKET_HPP_INCLUDED #define TORRENT_SOCKET_HPP_INCLUDED
#ifdef _MSC_VER #include "aux_/disable_warnings_push.hpp"
#pragma warning(push, 1)
#endif
// if building as Objective C++, asio's template // if building as Objective C++, asio's template
// parameters Protocol has to be renamed to avoid // parameters Protocol has to be renamed to avoid
@ -68,9 +66,7 @@ POSSIBILITY OF SUCH DAMAGE.
#undef Protocol #undef Protocol
#endif #endif
#ifdef _MSC_VER #include "aux_/disable_warnings_pop.hpp"
#pragma warning(pop)
#endif
namespace libtorrent namespace libtorrent
{ {

View File

@ -33,9 +33,13 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef TORRENT_SOCKS5_STREAM_HPP_INCLUDED #ifndef TORRENT_SOCKS5_STREAM_HPP_INCLUDED
#define TORRENT_SOCKS5_STREAM_HPP_INCLUDED #define TORRENT_SOCKS5_STREAM_HPP_INCLUDED
#include "aux_/disable_warnings_push.hpp"
#include <boost/bind.hpp> #include <boost/bind.hpp>
#include <boost/shared_ptr.hpp> #include <boost/shared_ptr.hpp>
#include "aux_/disable_warnings_pop.hpp"
#include "libtorrent/proxy_base.hpp" #include "libtorrent/proxy_base.hpp"
#include "libtorrent/assert.hpp" #include "libtorrent/assert.hpp"
#if defined TORRENT_ASIO_DEBUGGING #if defined TORRENT_ASIO_DEBUGGING

View File

@ -33,13 +33,10 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef TORRENT_STORAGE_HPP_INCLUDE #ifndef TORRENT_STORAGE_HPP_INCLUDE
#define TORRENT_STORAGE_HPP_INCLUDE #define TORRENT_STORAGE_HPP_INCLUDE
#include "aux_/disable_warnings_push.hpp"
#include <vector> #include <vector>
#include <sys/types.h> #include <sys/types.h>
#ifdef _MSC_VER
#pragma warning(push, 1)
#endif
#include <boost/function/function2.hpp> #include <boost/function/function2.hpp>
#include <boost/function/function0.hpp> #include <boost/function/function0.hpp>
#include <boost/limits.hpp> #include <boost/limits.hpp>
@ -49,10 +46,7 @@ POSSIBILITY OF SUCH DAMAGE.
#include <boost/unordered_set.hpp> #include <boost/unordered_set.hpp>
#include <boost/atomic.hpp> #include <boost/atomic.hpp>
#ifdef _MSC_VER #include "aux_/disable_warnings_pop.hpp"
#pragma warning(pop)
#endif
#include "libtorrent/piece_picker.hpp" #include "libtorrent/piece_picker.hpp"
#include "libtorrent/peer_request.hpp" #include "libtorrent/peer_request.hpp"

View File

@ -37,7 +37,7 @@ POSSIBILITY OF SUCH DAMAGE.
#include "libtorrent/assert.hpp" #include "libtorrent/assert.hpp"
#include "libtorrent/time.hpp" #include "libtorrent/time.hpp"
#include <memory> #include "aux_/disable_warnings_push.hpp"
#if defined TORRENT_WINDOWS || defined TORRENT_CYGWIN #if defined TORRENT_WINDOWS || defined TORRENT_CYGWIN
// asio assumes that the windows error codes are defined already // asio assumes that the windows error codes are defined already
@ -55,6 +55,8 @@ POSSIBILITY OF SUCH DAMAGE.
#include <boost/asio/detail/event.hpp> #include <boost/asio/detail/event.hpp>
#include <boost/cstdint.hpp> #include <boost/cstdint.hpp>
#include "aux_/disable_warnings_pop.hpp"
namespace libtorrent namespace libtorrent
{ {
typedef boost::asio::detail::thread thread; typedef boost::asio::detail::thread thread;

View File

@ -39,9 +39,7 @@ POSSIBILITY OF SUCH DAMAGE.
#include <list> #include <list>
#include <deque> #include <deque>
#ifdef _MSC_VER #include "aux_/disable_warnings_push.hpp"
#pragma warning(push, 1)
#endif
#include <boost/limits.hpp> #include <boost/limits.hpp>
#include <boost/tuple/tuple.hpp> #include <boost/tuple/tuple.hpp>
@ -50,9 +48,7 @@ POSSIBILITY OF SUCH DAMAGE.
#include <boost/shared_ptr.hpp> #include <boost/shared_ptr.hpp>
#include <boost/version.hpp> #include <boost/version.hpp>
#ifdef _MSC_VER #include "aux_/disable_warnings_pop.hpp"
#pragma warning(pop)
#endif
#include "libtorrent/torrent_handle.hpp" #include "libtorrent/torrent_handle.hpp"
#include "libtorrent/entry.hpp" #include "libtorrent/entry.hpp"

View File

@ -33,22 +33,18 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef TORRENT_TORRENT_HANDLE_HPP_INCLUDED #ifndef TORRENT_TORRENT_HANDLE_HPP_INCLUDED
#define TORRENT_TORRENT_HANDLE_HPP_INCLUDED #define TORRENT_TORRENT_HANDLE_HPP_INCLUDED
#include "aux_/disable_warnings_push.hpp"
#include <vector> #include <vector>
#include <set> #include <set>
#ifdef _MSC_VER
#pragma warning(push, 1)
#endif
#include <boost/assert.hpp> #include <boost/assert.hpp>
#include <boost/date_time/posix_time/posix_time_duration.hpp> #include <boost/date_time/posix_time/posix_time_duration.hpp>
#include <boost/shared_ptr.hpp> #include <boost/shared_ptr.hpp>
#include <boost/weak_ptr.hpp> #include <boost/weak_ptr.hpp>
#include <boost/cstdint.hpp> #include <boost/cstdint.hpp>
#ifdef _MSC_VER #include "aux_/disable_warnings_pop.hpp"
#pragma warning(pop)
#endif
#include "libtorrent/peer_id.hpp" #include "libtorrent/peer_id.hpp"
#include "libtorrent/piece_picker.hpp" #include "libtorrent/piece_picker.hpp"
@ -1223,7 +1219,7 @@ namespace libtorrent
boost::uint32_t id() const boost::uint32_t id() const
{ {
uintptr_t ret = (uintptr_t)m_torrent.lock().get(); uintptr_t ret = reinterpret_cast<uintptr_t>(m_torrent.lock().get());
// a torrent object is about 1024 bytes, so // a torrent object is about 1024 bytes, so
// it's safe to shift 11 bits // it's safe to shift 11 bits
return boost::uint32_t(ret >> 11); return boost::uint32_t(ret >> 11);
@ -1335,6 +1331,7 @@ namespace libtorrent
// ``torrent_handle::query_torrent_file``. // ``torrent_handle::query_torrent_file``.
boost::weak_ptr<const torrent_info> torrent_file; boost::weak_ptr<const torrent_info> torrent_file;
// TODO: 3 don't use boost.date-time types here. use chrono types
// the time until the torrent will announce itself to the tracker. // the time until the torrent will announce itself to the tracker.
boost::posix_time::time_duration next_announce; boost::posix_time::time_duration next_announce;

View File

@ -36,16 +36,12 @@ POSSIBILITY OF SUCH DAMAGE.
#include <string> #include <string>
#include <vector> #include <vector>
#ifdef _MSC_VER #include "aux_/disable_warnings_push.hpp"
#pragma warning(push, 1)
#endif
#include <boost/optional.hpp> #include <boost/optional.hpp>
#include <boost/shared_array.hpp> #include <boost/shared_array.hpp>
#ifdef _MSC_VER #include "aux_/disable_warnings_pop.hpp"
#pragma warning(pop)
#endif
#include "libtorrent/config.hpp" #include "libtorrent/config.hpp"
#include "libtorrent/entry.hpp" #include "libtorrent/entry.hpp"

View File

@ -39,9 +39,7 @@ POSSIBILITY OF SUCH DAMAGE.
#include <utility> #include <utility>
#include <ctime> #include <ctime>
#ifdef _MSC_VER #include "aux_/disable_warnings_push.hpp"
#pragma warning(push, 1)
#endif
#include <boost/shared_ptr.hpp> #include <boost/shared_ptr.hpp>
#include <boost/enable_shared_from_this.hpp> #include <boost/enable_shared_from_this.hpp>
@ -50,10 +48,12 @@ POSSIBILITY OF SUCH DAMAGE.
#include <boost/tuple/tuple.hpp> #include <boost/tuple/tuple.hpp>
#include <boost/unordered_map.hpp> #include <boost/unordered_map.hpp>
#ifdef _MSC_VER #ifdef TORRENT_USE_OPENSSL
#pragma warning(pop) #include <boost/asio/ssl/context.hpp>
#endif #endif
#include "aux_/disable_warnings_pop.hpp"
#include "libtorrent/config.hpp" #include "libtorrent/config.hpp"
#include "libtorrent/socket.hpp" #include "libtorrent/socket.hpp"
#include "libtorrent/address.hpp" #include "libtorrent/address.hpp"
@ -62,9 +62,6 @@ POSSIBILITY OF SUCH DAMAGE.
#include "libtorrent/deadline_timer.hpp" #include "libtorrent/deadline_timer.hpp"
#include "libtorrent/union_endpoint.hpp" #include "libtorrent/union_endpoint.hpp"
#include "libtorrent/udp_socket.hpp" // for udp_socket_observer #include "libtorrent/udp_socket.hpp" // for udp_socket_observer
#ifdef TORRENT_USE_OPENSSL
#include <boost/asio/ssl/context.hpp>
#endif
namespace libtorrent namespace libtorrent
{ {

View File

@ -33,21 +33,17 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef TORRENT_UDP_TRACKER_CONNECTION_HPP_INCLUDED #ifndef TORRENT_UDP_TRACKER_CONNECTION_HPP_INCLUDED
#define TORRENT_UDP_TRACKER_CONNECTION_HPP_INCLUDED #define TORRENT_UDP_TRACKER_CONNECTION_HPP_INCLUDED
#include "aux_/disable_warnings_push.hpp"
#include <vector> #include <vector>
#include <string> #include <string>
#include <utility> #include <utility>
#include <ctime> #include <ctime>
#ifdef _MSC_VER
#pragma warning(push, 1)
#endif
#include <boost/shared_ptr.hpp> #include <boost/shared_ptr.hpp>
#include <boost/cstdint.hpp> #include <boost/cstdint.hpp>
#ifdef _MSC_VER #include "aux_/disable_warnings_pop.hpp"
#pragma warning(pop)
#endif
#include "libtorrent/udp_socket.hpp" #include "libtorrent/udp_socket.hpp"
#include "libtorrent/entry.hpp" #include "libtorrent/entry.hpp"

View File

@ -33,18 +33,16 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef WEB_CONNECTION_BASE_HPP_INCLUDED #ifndef WEB_CONNECTION_BASE_HPP_INCLUDED
#define WEB_CONNECTION_BASE_HPP_INCLUDED #define WEB_CONNECTION_BASE_HPP_INCLUDED
#include "libtorrent/debug.hpp"
#include "aux_/disable_warnings_push.hpp"
#include <ctime> #include <ctime>
#include <algorithm> #include <algorithm>
#include <vector> #include <vector>
#include <deque> #include <deque>
#include <string> #include <string>
#include "libtorrent/debug.hpp"
#ifdef _MSC_VER
#pragma warning(push, 1)
#endif
#include <boost/smart_ptr.hpp> #include <boost/smart_ptr.hpp>
#include <boost/weak_ptr.hpp> #include <boost/weak_ptr.hpp>
#include <boost/noncopyable.hpp> #include <boost/noncopyable.hpp>
@ -52,9 +50,7 @@ POSSIBILITY OF SUCH DAMAGE.
#include <boost/optional.hpp> #include <boost/optional.hpp>
#include <boost/cstdint.hpp> #include <boost/cstdint.hpp>
#ifdef _MSC_VER #include "aux_/disable_warnings_pop.hpp"
#pragma warning(pop)
#endif
#include "libtorrent/buffer.hpp" #include "libtorrent/buffer.hpp"
#include "libtorrent/peer_connection.hpp" #include "libtorrent/peer_connection.hpp"

View File

@ -33,16 +33,14 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef TORRENT_WEB_PEER_CONNECTION_HPP_INCLUDED #ifndef TORRENT_WEB_PEER_CONNECTION_HPP_INCLUDED
#define TORRENT_WEB_PEER_CONNECTION_HPP_INCLUDED #define TORRENT_WEB_PEER_CONNECTION_HPP_INCLUDED
#include "aux_/disable_warnings_push.hpp"
#include <ctime> #include <ctime>
#include <algorithm> #include <algorithm>
#include <vector> #include <vector>
#include <deque> #include <deque>
#include <string> #include <string>
#ifdef _MSC_VER
#pragma warning(push, 1)
#endif
#include <boost/smart_ptr.hpp> #include <boost/smart_ptr.hpp>
#include <boost/weak_ptr.hpp> #include <boost/weak_ptr.hpp>
#include <boost/noncopyable.hpp> #include <boost/noncopyable.hpp>
@ -50,9 +48,7 @@ POSSIBILITY OF SUCH DAMAGE.
#include <boost/optional.hpp> #include <boost/optional.hpp>
#include <boost/cstdint.hpp> #include <boost/cstdint.hpp>
#ifdef _MSC_VER #include "aux_/disable_warnings_pop.hpp"
#pragma warning(pop)
#endif
#include "libtorrent/config.hpp" #include "libtorrent/config.hpp"
#include "libtorrent/web_connection_base.hpp" #include "libtorrent/web_connection_base.hpp"

View File

@ -33,14 +33,18 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef TORRENT_XML_PARSE_HPP #ifndef TORRENT_XML_PARSE_HPP
#define TORRENT_XML_PARSE_HPP #define TORRENT_XML_PARSE_HPP
#include "aux_/disable_warnings_push.hpp"
#include <cctype> #include <cctype>
#include <cstring> #include <cstring>
#include <boost/function.hpp>
#include "aux_/disable_warnings_pop.hpp"
#include "libtorrent/config.hpp" #include "libtorrent/config.hpp"
#include "libtorrent/assert.hpp" #include "libtorrent/assert.hpp"
#include <boost/function.hpp>
namespace libtorrent namespace libtorrent
{ {
enum enum

View File

@ -87,7 +87,7 @@ namespace libtorrent
#elif defined TORRENT_BEOS #elif defined TORRENT_BEOS
s = B_PAGE_SIZE; s = B_PAGE_SIZE;
#else #else
s = sysconf(_SC_PAGESIZE); s = int(sysconf(_SC_PAGESIZE));
#endif #endif
// assume the page size is 4 kiB if we // assume the page size is 4 kiB if we
// fail to query it // fail to query it
@ -112,18 +112,19 @@ namespace libtorrent
char* ret; char* ret;
#if TORRENT_USE_POSIX_MEMALIGN #if TORRENT_USE_POSIX_MEMALIGN
if (posix_memalign((void**)&ret, page_size(), bytes) != 0) ret = NULL; if (posix_memalign(reinterpret_cast<void**>(&ret), page_size(), bytes)
!= 0) ret = NULL;
#elif TORRENT_USE_MEMALIGN #elif TORRENT_USE_MEMALIGN
ret = (char*)memalign(page_size(), bytes); ret = static_cast<char*>(memalign(page_size(), bytes));
#elif defined TORRENT_WINDOWS #elif defined TORRENT_WINDOWS
ret = (char*)_aligned_malloc(bytes, page_size()); ret = static_cast<char*>(_aligned_malloc(bytes, page_size()));
#elif defined TORRENT_BEOS #elif defined TORRENT_BEOS
area_id id = create_area("", &ret, B_ANY_ADDRESS area_id id = create_area("", &ret, B_ANY_ADDRESS
, (bytes + page_size() - 1) & (page_size()-1), B_NO_LOCK, B_READ_AREA | B_WRITE_AREA); , (bytes + page_size() - 1) & (page_size()-1), B_NO_LOCK, B_READ_AREA | B_WRITE_AREA);
if (id < B_OK) return NULL; if (id < B_OK) return NULL;
ret = (char*)ret; ret = static_cast<char*>(ret);
#else #else
ret = (char*)valloc(bytes); ret = static_cast<char*>(valloc(size_t(bytes)));
#endif #endif
if (ret == NULL) return NULL; if (ret == NULL) return NULL;

View File

@ -18,9 +18,13 @@
#define BOOST_ASIO_DECL BOOST_SYMBOL_EXPORT #define BOOST_ASIO_DECL BOOST_SYMBOL_EXPORT
#endif #endif
#include "aux_/disable_warnings_push.hpp"
#if BOOST_VERSION >= 104500 #if BOOST_VERSION >= 104500
#include <boost/asio/impl/src.hpp> #include <boost/asio/impl/src.hpp>
#elif BOOST_VERSION >= 104400 #elif BOOST_VERSION >= 104400
#include <boost/asio/impl/src.cpp> #include <boost/asio/impl/src.cpp>
#endif #endif
#include "aux_/disable_warnings_pop.hpp"

View File

@ -31,12 +31,13 @@ POSSIBILITY OF SUCH DAMAGE.
*/ */
#include "libtorrent/config.hpp" #include "libtorrent/config.hpp"
#include "libtorrent/assert.hpp"
#if TORRENT_PRODUCTION_ASSERTS #ifdef TORRENT_PRODUCTION_ASSERTS
#include <boost/atomic.hpp> #include <boost/atomic.hpp>
#endif #endif
#if (defined TORRENT_DEBUG && !TORRENT_NO_ASSERTS) \ #if (defined TORRENT_DEBUG && TORRENT_USE_ASSERTS) \
|| defined TORRENT_ASIO_DEBUGGING \ || defined TORRENT_ASIO_DEBUGGING \
|| defined TORRENT_PROFILE_CALLS \ || defined TORRENT_PROFILE_CALLS \
|| TORRENT_RELEASE_ASSERTS \ || TORRENT_RELEASE_ASSERTS \
@ -214,7 +215,7 @@ TORRENT_EXPORT void print_backtrace(char* out, int len, int max_depth)
#if TORRENT_USE_ASSERTS || defined TORRENT_ASIO_DEBUGGING #if TORRENT_USE_ASSERTS || defined TORRENT_ASIO_DEBUGGING
#if TORRENT_PRODUCTION_ASSERTS #ifdef TORRENT_PRODUCTION_ASSERTS
char const* libtorrent_assert_log = "asserts.log"; char const* libtorrent_assert_log = "asserts.log";
// the number of asserts we've printed to the log // the number of asserts we've printed to the log
boost::atomic<int> assert_counter(0); boost::atomic<int> assert_counter(0);
@ -222,7 +223,7 @@ boost::atomic<int> assert_counter(0);
TORRENT_EXPORT void assert_print(char const* fmt, ...) TORRENT_EXPORT void assert_print(char const* fmt, ...)
{ {
#if TORRENT_PRODUCTION_ASSERTS #ifdef TORRENT_PRODUCTION_ASSERTS
if (assert_counter > 500) return; if (assert_counter > 500) return;
FILE* out = fopen(libtorrent_assert_log, "a+"); FILE* out = fopen(libtorrent_assert_log, "a+");
@ -235,15 +236,15 @@ TORRENT_EXPORT void assert_print(char const* fmt, ...)
vfprintf(out, fmt, va); vfprintf(out, fmt, va);
va_end(va); va_end(va);
#if TORRENT_PRODUCTION_ASSERTS #ifdef TORRENT_PRODUCTION_ASSERTS
if (out != stderr) fclose(out); if (out != stderr) fclose(out);
#endif #endif
} }
TORRENT_EXPORT void assert_fail(char const* expr, int line, char const* file TORRENT_NO_RETURN TORRENT_EXPORT void assert_fail(char const* expr, int line
, char const* function, char const* value, int kind) , char const* file, char const* function, char const* value, int kind)
{ {
#if TORRENT_PRODUCTION_ASSERTS #ifdef TORRENT_PRODUCTION_ASSERTS
// no need to flood the assert log with infinite number of asserts // no need to flood the assert log with infinite number of asserts
if (assert_counter.fetch_add(1) + 1 > 500) return; if (assert_counter.fetch_add(1) + 1 > 500) return;
#endif #endif
@ -266,7 +267,7 @@ TORRENT_EXPORT void assert_fail(char const* expr, int line, char const* file
} }
assert_print("%s\n" assert_print("%s\n"
#if TORRENT_PRODUCTION_ASSERTS #ifdef TORRENT_PRODUCTION_ASSERTS
"#: %d\n" "#: %d\n"
#endif #endif
"file: '%s'\n" "file: '%s'\n"
@ -277,7 +278,7 @@ TORRENT_EXPORT void assert_fail(char const* expr, int line, char const* file
"stack:\n" "stack:\n"
"%s\n" "%s\n"
, message , message
#if TORRENT_PRODUCTION_ASSERTS #ifdef TORRENT_PRODUCTION_ASSERTS
, assert_counter.load() , assert_counter.load()
#endif #endif
, file, line, function, expr , file, line, function, expr

View File

@ -33,9 +33,15 @@ POSSIBILITY OF SUCH DAMAGE.
#include "libtorrent/close_reason.hpp" #include "libtorrent/close_reason.hpp"
#include "libtorrent/error_code.hpp" #include "libtorrent/error_code.hpp"
#include "libtorrent/assert.hpp" #include "libtorrent/assert.hpp"
#include "libtorrent/error_code.hpp"
#include "aux_/disable_warnings_push.hpp"
#include <boost/system/error_code.hpp>
#include <boost/asio/error.hpp> #include <boost/asio/error.hpp>
#include "aux_/disable_warnings_pop.hpp"
namespace libtorrent namespace libtorrent
{ {

View File

@ -33,8 +33,12 @@ POSSIBILITY OF SUCH DAMAGE.
#include "libtorrent/crc32c.hpp" #include "libtorrent/crc32c.hpp"
#include "libtorrent/cpuid.hpp" #include "libtorrent/cpuid.hpp"
#include "aux_/disable_warnings_push.hpp"
#include <boost/crc.hpp> #include <boost/crc.hpp>
#include "aux_/disable_warnings_pop.hpp"
namespace libtorrent namespace libtorrent
{ {
bool supports_sse42() bool supports_sse42()

View File

@ -30,6 +30,8 @@ POSSIBILITY OF SUCH DAMAGE.
*/ */
#include "aux_/disable_warnings_push.hpp"
#include <string> #include <string>
#include <cctype> #include <cctype>
#include <algorithm> #include <algorithm>
@ -40,11 +42,6 @@ POSSIBILITY OF SUCH DAMAGE.
#include <boost/array.hpp> #include <boost/array.hpp>
#include <boost/tuple/tuple.hpp> #include <boost/tuple/tuple.hpp>
#include "libtorrent/config.hpp"
#include "libtorrent/assert.hpp"
#include "libtorrent/parse_url.hpp"
#include "libtorrent/random.hpp"
#ifdef TORRENT_WINDOWS #ifdef TORRENT_WINDOWS
#ifndef WIN32_LEAN_AND_MEAN #ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN
@ -52,17 +49,24 @@ POSSIBILITY OF SUCH DAMAGE.
#include <windows.h> #include <windows.h>
#endif #endif
#if TORRENT_USE_ICONV
#include <iconv.h>
#include <locale.h>
#endif
#include "aux_/disable_warnings_pop.hpp"
#include "libtorrent/config.hpp"
#include "libtorrent/assert.hpp"
#include "libtorrent/parse_url.hpp"
#include "libtorrent/random.hpp"
#include "libtorrent/utf8.hpp" #include "libtorrent/utf8.hpp"
#include "libtorrent/thread.hpp" #include "libtorrent/thread.hpp"
#include "libtorrent/aux_/escape_string.hpp" #include "libtorrent/aux_/escape_string.hpp"
#include "libtorrent/string_util.hpp" // for to_string #include "libtorrent/string_util.hpp" // for to_string
#if TORRENT_USE_ICONV
#include <iconv.h>
#include <locale.h>
#endif
namespace libtorrent namespace libtorrent
{ {

View File

@ -47,7 +47,7 @@ POSSIBILITY OF SUCH DAMAGE.
#include <cstring> #include <cstring>
#include <vector> #include <vector>
#if TORRENT_DEBUG_FILE_LEAKS #ifdef TORRENT_DEBUG_FILE_LEAKS
#include <set> #include <set>
#include "libtorrent/thread.hpp" #include "libtorrent/thread.hpp"
#endif #endif
@ -1285,7 +1285,7 @@ namespace libtorrent
{ {
close(); close();
#if TORRENT_DEBUG_FILE_LEAKS #ifdef TORRENT_DEBUG_FILE_LEAKS
m_file_path = path; m_file_path = path;
#endif #endif
@ -1471,7 +1471,7 @@ namespace libtorrent
return true; return true;
} }
#if TORRENT_DEBUG_FILE_LEAKS #ifdef TORRENT_DEBUG_FILE_LEAKS
void file::print_info(FILE* out) const void file::print_info(FILE* out) const
{ {
if (!is_open()) return; if (!is_open()) return;
@ -2201,7 +2201,7 @@ typedef struct _FILE_ALLOCATED_RANGE_BUFFER {
#endif #endif
} }
#if TORRENT_DEBUG_FILE_LEAKS #ifdef TORRENT_DEBUG_FILE_LEAKS
std::set<file_handle*> global_file_handles; std::set<file_handle*> global_file_handles;
mutex file_handle_mutex; mutex file_handle_mutex;

View File

@ -34,15 +34,11 @@ POSSIBILITY OF SUCH DAMAGE.
#include <algorithm> #include <algorithm>
#include <stdio.h> #include <stdio.h>
#ifdef _MSC_VER #include "aux_/disable_warnings_push.hpp"
#pragma warning(push, 1)
#endif
#include <boost/optional.hpp> #include <boost/optional.hpp>
#ifdef _MSC_VER #include "aux_/disable_warnings_pop.hpp"
#pragma warning(pop)
#endif
#include "libtorrent/identify_client.hpp" #include "libtorrent/identify_client.hpp"
#include "libtorrent/fingerprint.hpp" #include "libtorrent/fingerprint.hpp"

View File

@ -30,10 +30,14 @@ POSSIBILITY OF SUCH DAMAGE.
*/ */
#include "aux_/disable_warnings_push.hpp"
#include <utility> #include <utility>
#include <boost/bind.hpp> #include <boost/bind.hpp>
#include <boost/function/function1.hpp> #include <boost/function/function1.hpp>
#include "aux_/disable_warnings_pop.hpp"
#include "libtorrent/io.hpp" #include "libtorrent/io.hpp"
#include "libtorrent/bencode.hpp" #include "libtorrent/bencode.hpp"
#include "libtorrent/hasher.hpp" #include "libtorrent/hasher.hpp"

View File

@ -32,22 +32,18 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef TORRENT_DISABLE_EXTENSIONS #ifndef TORRENT_DISABLE_EXTENSIONS
#ifdef _MSC_VER #include "aux_/disable_warnings_push.hpp"
#pragma warning(push, 1)
#endif
#include <boost/shared_ptr.hpp> #include <boost/shared_ptr.hpp>
#include <boost/bind.hpp> #include <boost/bind.hpp>
#ifdef _MSC_VER
#pragma warning(pop)
#endif
#include <vector> #include <vector>
#include <utility> #include <utility>
#include <numeric> #include <numeric>
#include <cstdio> #include <cstdio>
#include "aux_/disable_warnings_pop.hpp"
#include "libtorrent/peer_connection.hpp" #include "libtorrent/peer_connection.hpp"
#include "libtorrent/bt_peer_connection.hpp" #include "libtorrent/bt_peer_connection.hpp"
#include "libtorrent/hasher.hpp" #include "libtorrent/hasher.hpp"

View File

@ -33,22 +33,18 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef TORRENT_NO_DEPRECATE #ifndef TORRENT_NO_DEPRECATE
#ifndef TORRENT_DISABLE_EXTENSIONS #ifndef TORRENT_DISABLE_EXTENSIONS
#ifdef _MSC_VER #include "aux_/disable_warnings_push.hpp"
#pragma warning(push, 1)
#endif
#include <boost/shared_ptr.hpp> #include <boost/shared_ptr.hpp>
#include <boost/bind.hpp> #include <boost/bind.hpp>
#ifdef _MSC_VER
#pragma warning(pop)
#endif
#include <vector> #include <vector>
#include <utility> #include <utility>
#include <numeric> #include <numeric>
#include <algorithm> // count #include <algorithm> // count
#include "aux_/disable_warnings_pop.hpp"
#include "libtorrent/peer_connection.hpp" #include "libtorrent/peer_connection.hpp"
#include "libtorrent/bt_peer_connection.hpp" #include "libtorrent/bt_peer_connection.hpp"
#include "libtorrent/hasher.hpp" #include "libtorrent/hasher.hpp"

View File

@ -30,11 +30,23 @@ POSSIBILITY OF SUCH DAMAGE.
*/ */
#include "aux_/disable_warnings_push.hpp"
#include <vector> #include <vector>
#include <boost/limits.hpp> #include <boost/limits.hpp>
#include <boost/bind.hpp> #include <boost/bind.hpp>
#include <boost/cstdint.hpp> #include <boost/cstdint.hpp>
#ifdef TORRENT_DEBUG
#include <set>
#endif
#ifdef TORRENT_USE_OPENSSL
#include <openssl/rand.h>
#endif
#include "aux_/disable_warnings_pop.hpp"
#ifndef TORRENT_DISABLE_LOGGING #ifndef TORRENT_DISABLE_LOGGING
#include <stdarg.h> // for va_start, va_end #include <stdarg.h> // for va_start, va_end
#include <stdio.h> // for vsnprintf #include <stdio.h> // for vsnprintf
@ -72,14 +84,6 @@ POSSIBILITY OF SUCH DAMAGE.
#include "libtorrent/close_reason.hpp" #include "libtorrent/close_reason.hpp"
#include "libtorrent/aux_/time.hpp" #include "libtorrent/aux_/time.hpp"
#ifdef TORRENT_DEBUG
#include <set>
#endif
#ifdef TORRENT_USE_OPENSSL
#include <openssl/rand.h>
#endif
//#define TORRENT_CORRUPT_DATA //#define TORRENT_CORRUPT_DATA
using boost::shared_ptr; using boost::shared_ptr;

View File

@ -30,16 +30,12 @@ POSSIBILITY OF SUCH DAMAGE.
*/ */
#ifdef _MSC_VER #include "aux_/disable_warnings_push.hpp"
#pragma warning(push, 1)
#endif
#include <boost/bind.hpp> #include <boost/bind.hpp>
#include <boost/utility.hpp> #include <boost/utility.hpp>
#ifdef _MSC_VER #include "aux_/disable_warnings_pop.hpp"
#pragma warning(pop)
#endif
#include "libtorrent/peer_connection.hpp" #include "libtorrent/peer_connection.hpp"
#include "libtorrent/web_peer_connection.hpp" #include "libtorrent/web_peer_connection.hpp"

View File

@ -30,6 +30,8 @@ POSSIBILITY OF SUCH DAMAGE.
*/ */
#include "aux_/disable_warnings_push.hpp"
#include <vector> #include <vector>
#include <cmath> #include <cmath>
#include <algorithm> #include <algorithm>
@ -39,6 +41,8 @@ POSSIBILITY OF SUCH DAMAGE.
#include <boost/bind.hpp> #include <boost/bind.hpp>
#include <boost/tuple/tuple.hpp> #include <boost/tuple/tuple.hpp>
#include "aux_/disable_warnings_pop.hpp"
#include "libtorrent/piece_picker.hpp" #include "libtorrent/piece_picker.hpp"
#include "libtorrent/bitfield.hpp" #include "libtorrent/bitfield.hpp"
#include "libtorrent/random.hpp" #include "libtorrent/random.hpp"

View File

@ -33,10 +33,15 @@ POSSIBILITY OF SUCH DAMAGE.
#include "libtorrent/config.hpp" #include "libtorrent/config.hpp"
#include "libtorrent/random.hpp" #include "libtorrent/random.hpp"
#include "libtorrent/assert.hpp" #include "libtorrent/assert.hpp"
#include "aux_/disable_warnings_push.hpp"
#include <boost/random/random_device.hpp> #include <boost/random/random_device.hpp>
#include <boost/random/mersenne_twister.hpp> #include <boost/random/mersenne_twister.hpp>
#include <boost/random/uniform_int_distribution.hpp> #include <boost/random/uniform_int_distribution.hpp>
#include "aux_/disable_warnings_pop.hpp"
#if !TORRENT_THREADSAFE_STATIC #if !TORRENT_THREADSAFE_STATIC
#include "libtorrent/thread.hpp" #include "libtorrent/thread.hpp"
#endif #endif

View File

@ -30,6 +30,8 @@ POSSIBILITY OF SUCH DAMAGE.
*/ */
#include "aux_/disable_warnings_push.hpp"
#include <ctime> #include <ctime>
#include <algorithm> #include <algorithm>
#include <cctype> #include <cctype>
@ -43,22 +45,20 @@ POSSIBILITY OF SUCH DAMAGE.
#endif #endif
#endif // TORRENT_DEBUG && !TORRENT_DISABLE_INVARIANT_CHECKS #endif // TORRENT_DEBUG && !TORRENT_DISABLE_INVARIANT_CHECKS
#ifdef _MSC_VER
#pragma warning(push, 1)
#endif
#include <boost/limits.hpp> #include <boost/limits.hpp>
#include <boost/bind.hpp> #include <boost/bind.hpp>
#include <boost/function_equal.hpp> #include <boost/function_equal.hpp>
#include <boost/make_shared.hpp> #include <boost/make_shared.hpp>
#ifndef TORRENT_WINDOWS
#include <sys/resource.h>
#endif
#ifdef TORRENT_USE_VALGRIND #ifdef TORRENT_USE_VALGRIND
#include <valgrind/memcheck.h> #include <valgrind/memcheck.h>
#endif #endif
#ifdef _MSC_VER #include "aux_/disable_warnings_pop.hpp"
#pragma warning(pop)
#endif
#include "libtorrent/peer_id.hpp" #include "libtorrent/peer_id.hpp"
#include "libtorrent/torrent_info.hpp" #include "libtorrent/torrent_info.hpp"
@ -95,10 +95,6 @@ POSSIBILITY OF SUCH DAMAGE.
#include "libtorrent/torrent_peer.hpp" #include "libtorrent/torrent_peer.hpp"
#include "libtorrent/choker.hpp" #include "libtorrent/choker.hpp"
#ifndef TORRENT_WINDOWS
#include <sys/resource.h>
#endif
#ifndef TORRENT_DISABLE_LOGGING #ifndef TORRENT_DISABLE_LOGGING
#include "libtorrent/socket_io.hpp" #include "libtorrent/socket_io.hpp"

View File

@ -32,23 +32,19 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef TORRENT_DISABLE_EXTENSIONS #ifndef TORRENT_DISABLE_EXTENSIONS
#ifdef _MSC_VER #include "aux_/disable_warnings_push.hpp"
#pragma warning(push, 1)
#endif
#include <boost/shared_ptr.hpp> #include <boost/shared_ptr.hpp>
#include <boost/enable_shared_from_this.hpp> #include <boost/enable_shared_from_this.hpp>
#ifdef _MSC_VER
#pragma warning(pop)
#endif
#include <vector> #include <vector>
#include <map> #include <map>
#include <utility> #include <utility>
#include <numeric> #include <numeric>
#include <cstdio> #include <cstdio>
#include "aux_/disable_warnings_pop.hpp"
#include "libtorrent/hasher.hpp" #include "libtorrent/hasher.hpp"
#include "libtorrent/torrent.hpp" #include "libtorrent/torrent.hpp"
#include "libtorrent/extensions.hpp" #include "libtorrent/extensions.hpp"

View File

@ -30,15 +30,13 @@ POSSIBILITY OF SUCH DAMAGE.
*/ */
#include "aux_/disable_warnings_push.hpp"
#include <ctime> #include <ctime>
#include <algorithm> #include <algorithm>
#include <set> #include <set>
#include <functional> #include <functional>
#ifdef _MSC_VER
#pragma warning(push, 1)
#endif
#include <boost/ref.hpp> #include <boost/ref.hpp>
#include <boost/bind.hpp> #include <boost/bind.hpp>
#include <boost/version.hpp> #include <boost/version.hpp>
@ -47,28 +45,6 @@ POSSIBILITY OF SUCH DAMAGE.
#include <boost/system/system_error.hpp> #include <boost/system/system_error.hpp>
#endif #endif
#ifdef _MSC_VER
#pragma warning(pop)
#endif
#include "libtorrent/config.hpp"
#include "libtorrent/storage.hpp"
#include "libtorrent/torrent.hpp"
#include "libtorrent/hasher.hpp"
#include "libtorrent/session.hpp"
#include "libtorrent/peer_id.hpp"
#include "libtorrent/file.hpp"
#include "libtorrent/invariant_check.hpp"
#include "libtorrent/file_pool.hpp"
#include "libtorrent/aux_/session_impl.hpp"
#include "libtorrent/disk_buffer_holder.hpp"
#include "libtorrent/alloca.hpp"
#include "libtorrent/stat_cache.hpp"
#include <cstdio>
//#define TORRENT_PARTIAL_HASH_LOG
#if defined(__APPLE__) #if defined(__APPLE__)
// for getattrlist() // for getattrlist()
#include <sys/attr.h> #include <sys/attr.h>
@ -88,6 +64,26 @@ POSSIBILITY OF SUCH DAMAGE.
#include <sys/mount.h> #include <sys/mount.h>
#endif #endif
#include "aux_/disable_warnings_pop.hpp"
#include "libtorrent/config.hpp"
#include "libtorrent/storage.hpp"
#include "libtorrent/torrent.hpp"
#include "libtorrent/hasher.hpp"
#include "libtorrent/session.hpp"
#include "libtorrent/peer_id.hpp"
#include "libtorrent/file.hpp"
#include "libtorrent/invariant_check.hpp"
#include "libtorrent/file_pool.hpp"
#include "libtorrent/aux_/session_impl.hpp"
#include "libtorrent/disk_buffer_holder.hpp"
#include "libtorrent/alloca.hpp"
#include "libtorrent/stat_cache.hpp"
#include <cstdio>
//#define TORRENT_PARTIAL_HASH_LOG
// for convert_to_wstring and convert_to_native // for convert_to_wstring and convert_to_native
#include "libtorrent/aux_/escape_string.hpp" #include "libtorrent/aux_/escape_string.hpp"

View File

@ -30,6 +30,10 @@ POSSIBILITY OF SUCH DAMAGE.
*/ */
#include "libtorrent/config.hpp"
#include "aux_/disable_warnings_push.hpp"
#include <ctime> #include <ctime>
#include <algorithm> #include <algorithm>
#include <set> #include <set>
@ -37,18 +41,20 @@ POSSIBILITY OF SUCH DAMAGE.
#include <numeric> #include <numeric>
#include <limits> // for numeric_limits #include <limits> // for numeric_limits
#ifdef _MSC_VER
#pragma warning(push, 1)
#endif
#include <boost/bind.hpp> #include <boost/bind.hpp>
#include <boost/make_shared.hpp> #include <boost/make_shared.hpp>
#ifdef _MSC_VER #ifdef TORRENT_USE_OPENSSL
#pragma warning(pop) #include "libtorrent/ssl_stream.hpp"
#endif #include <boost/asio/ssl/context.hpp>
#include <openssl/rand.h>
#if BOOST_VERSION >= 104700
#include <boost/asio/ssl/verify_context.hpp>
#endif // BOOST_VERSION
#endif // TORRENT_USE_OPENSSL
#include "aux_/disable_warnings_pop.hpp"
#include "libtorrent/config.hpp"
#include "libtorrent/torrent_handle.hpp" #include "libtorrent/torrent_handle.hpp"
#include "libtorrent/session.hpp" #include "libtorrent/session.hpp"
#include "libtorrent/torrent_info.hpp" #include "libtorrent/torrent_info.hpp"
@ -88,15 +94,6 @@ POSSIBILITY OF SUCH DAMAGE.
#include "libtorrent/alloca.hpp" #include "libtorrent/alloca.hpp"
#include "libtorrent/resolve_links.hpp" #include "libtorrent/resolve_links.hpp"
#ifdef TORRENT_USE_OPENSSL
#include "libtorrent/ssl_stream.hpp"
#include <boost/asio/ssl/context.hpp>
#include <openssl/rand.h>
#if BOOST_VERSION >= 104700
#include <boost/asio/ssl/verify_context.hpp>
#endif // BOOST_VERSION
#endif // TORRENT_USE_OPENSSL
#ifndef TORRENT_DISABLE_LOGGING #ifndef TORRENT_DISABLE_LOGGING
#include "libtorrent/aux_/session_impl.hpp" // for tracker_logger #include "libtorrent/aux_/session_impl.hpp" // for tracker_logger
#endif #endif

View File

@ -30,6 +30,8 @@ POSSIBILITY OF SUCH DAMAGE.
*/ */
#include "aux_/disable_warnings_push.hpp"
#include <ctime> #include <ctime>
#include <iterator> #include <iterator>
#include <algorithm> #include <algorithm>
@ -37,16 +39,10 @@ POSSIBILITY OF SUCH DAMAGE.
#include <cctype> #include <cctype>
#include <algorithm> #include <algorithm>
#ifdef _MSC_VER
#pragma warning(push, 1)
#endif
#include <boost/optional.hpp> #include <boost/optional.hpp>
#include <boost/bind.hpp> #include <boost/bind.hpp>
#ifdef _MSC_VER #include "aux_/disable_warnings_pop.hpp"
#pragma warning(pop)
#endif
#include "libtorrent/peer_id.hpp" #include "libtorrent/peer_id.hpp"
#include "libtorrent/bt_peer_connection.hpp" #include "libtorrent/bt_peer_connection.hpp"

View File

@ -30,12 +30,16 @@ POSSIBILITY OF SUCH DAMAGE.
*/ */
#include "aux_/disable_warnings_push.hpp"
#include <vector> #include <vector>
#include <cctype> #include <cctype>
#include <boost/bind.hpp> #include <boost/bind.hpp>
#include <boost/make_shared.hpp> #include <boost/make_shared.hpp>
#include "aux_/disable_warnings_pop.hpp"
#include "libtorrent/tracker_manager.hpp" #include "libtorrent/tracker_manager.hpp"
#include "libtorrent/http_tracker_connection.hpp" #include "libtorrent/http_tracker_connection.hpp"
#include "libtorrent/udp_tracker_connection.hpp" #include "libtorrent/udp_tracker_connection.hpp"

View File

@ -30,19 +30,15 @@ POSSIBILITY OF SUCH DAMAGE.
*/ */
#include "aux_/disable_warnings_push.hpp"
#include <vector> #include <vector>
#include <cctype> #include <cctype>
#ifdef _MSC_VER
#pragma warning(push, 1)
#endif
#include <boost/bind.hpp> #include <boost/bind.hpp>
#include <boost/tuple/tuple.hpp> #include <boost/tuple/tuple.hpp>
#ifdef _MSC_VER #include "aux_/disable_warnings_pop.hpp"
#pragma warning(pop)
#endif
#include "libtorrent/tracker_manager.hpp" #include "libtorrent/tracker_manager.hpp"
#include "libtorrent/parse_url.hpp" #include "libtorrent/parse_url.hpp"

View File

@ -32,22 +32,18 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef TORRENT_DISABLE_EXTENSIONS #ifndef TORRENT_DISABLE_EXTENSIONS
#ifdef _MSC_VER #include "aux_/disable_warnings_push.hpp"
#pragma warning(push, 1)
#endif
#include <boost/shared_ptr.hpp> #include <boost/shared_ptr.hpp>
#include <boost/bind.hpp> #include <boost/bind.hpp>
#ifdef _MSC_VER
#pragma warning(pop)
#endif
#include <vector> #include <vector>
#include <utility> #include <utility>
#include <numeric> #include <numeric>
#include <cstdio> #include <cstdio>
#include "aux_/disable_warnings_pop.hpp"
#include "libtorrent/peer_connection.hpp" #include "libtorrent/peer_connection.hpp"
#include "libtorrent/bt_peer_connection.hpp" #include "libtorrent/bt_peer_connection.hpp"
#include "libtorrent/hasher.hpp" #include "libtorrent/hasher.hpp"

View File

@ -32,15 +32,11 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef TORRENT_DISABLE_EXTENSIONS #ifndef TORRENT_DISABLE_EXTENSIONS
#ifdef _MSC_VER #include "aux_/disable_warnings_push.hpp"
#pragma warning(push, 1)
#endif
#include <boost/shared_ptr.hpp> #include <boost/shared_ptr.hpp>
#ifdef _MSC_VER #include "aux_/disable_warnings_pop.hpp"
#pragma warning(pop)
#endif
#include "libtorrent/peer_connection.hpp" #include "libtorrent/peer_connection.hpp"
#include "libtorrent/bt_peer_connection.hpp" #include "libtorrent/bt_peer_connection.hpp"