fix build warnings/errors, typos and minor cleanup (#1277)
fix build warnings/errors, typos and minor cleanup. no need to provide boost::throw_exception, better left it to the user
This commit is contained in:
parent
09cbd0a51d
commit
aef614a74c
17
Jamfile
17
Jamfile
|
@ -27,15 +27,11 @@ if $(BOOST_ROOT)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
local boost-lib-search-path =
|
local boost-lib-search-path =
|
||||||
<search>/opt/local/lib
|
|
||||||
<search>/usr/lib
|
<search>/usr/lib
|
||||||
<search>/usr/local/lib
|
<search>/usr/local/lib
|
||||||
<search>/sw/lib
|
|
||||||
<search>/usr/g++/lib
|
|
||||||
;
|
;
|
||||||
|
|
||||||
local boost-include-path =
|
local boost-include-path =
|
||||||
<include>/opt/local/include
|
|
||||||
<include>/usr/local/include
|
<include>/usr/local/include
|
||||||
<include>/usr/sfw/include
|
<include>/usr/sfw/include
|
||||||
;
|
;
|
||||||
|
@ -125,11 +121,6 @@ rule linking ( properties * )
|
||||||
# gcrypt libraries, if enabled
|
# gcrypt libraries, if enabled
|
||||||
if <crypto>libgcrypt in $(properties)
|
if <crypto>libgcrypt in $(properties)
|
||||||
{
|
{
|
||||||
# on mac os x, adding the /opt/local/include path
|
|
||||||
# would include openssl headers incompatible with
|
|
||||||
# the system library. Only add this include path
|
|
||||||
# if we're not using openssl (which we're most
|
|
||||||
# likely not if we're using libgcrypt)
|
|
||||||
result += <library>gcrypt ;
|
result += <library>gcrypt ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -556,10 +547,10 @@ lib gcc : : <name>gcc <link>static ;
|
||||||
lib libiconv : : <name>iconv <link>shared <search>/usr/local/lib ;
|
lib libiconv : : <name>iconv <link>shared <search>/usr/local/lib ;
|
||||||
|
|
||||||
# openssl on linux/bsd/macos etc.
|
# openssl on linux/bsd/macos etc.
|
||||||
lib gcrypt : : <name>gcrypt <link>shared <search>/opt/local/lib <search>/usr/local/lib : : <include>/opt/local/include <include>/usr/local/include ;
|
lib gcrypt : : <name>gcrypt <link>shared <search>/usr/local/lib : : <include>/usr/local/include ;
|
||||||
lib z : : <link>shared <name>z <search>/usr/lib ;
|
lib z : : <link>shared <name>z <search>/usr/lib ;
|
||||||
lib crypto : : <name>crypto <link>shared <use>z <search>/opt/local/lib : : <include>/opt/local/include ;
|
lib crypto : : <name>crypto <link>shared <use>z ;
|
||||||
lib ssl : : <name>ssl <link>shared <use>crypto <search>/opt/local/lib : : <include>/opt/local/include ;
|
lib ssl : : <name>ssl <link>shared <use>crypto ;
|
||||||
lib dl : : <link>shared <name>dl ;
|
lib dl : : <link>shared <name>dl ;
|
||||||
|
|
||||||
# time functions used on linux require librt
|
# time functions used on linux require librt
|
||||||
|
@ -601,7 +592,6 @@ SOURCES =
|
||||||
entry
|
entry
|
||||||
error_code
|
error_code
|
||||||
file_storage
|
file_storage
|
||||||
lazy_bdecode
|
|
||||||
escape_string
|
escape_string
|
||||||
string_util
|
string_util
|
||||||
file
|
file
|
||||||
|
@ -770,6 +760,7 @@ lib torrent
|
||||||
<dht>on:<source>src/kademlia/$(KADEMLIA_SOURCES).cpp
|
<dht>on:<source>src/kademlia/$(KADEMLIA_SOURCES).cpp
|
||||||
<dht>on:<source>ed25519/src/$(ED25519_SOURCES).cpp
|
<dht>on:<source>ed25519/src/$(ED25519_SOURCES).cpp
|
||||||
<dht>on:<source>src/hasher512.cpp
|
<dht>on:<source>src/hasher512.cpp
|
||||||
|
<deprecated-functions>on:<source>src/lazy_bdecode.cpp
|
||||||
<variant>debug:<asserts>on
|
<variant>debug:<asserts>on
|
||||||
<variant>debug:<invariant-checks>on
|
<variant>debug:<invariant-checks>on
|
||||||
|
|
||||||
|
|
|
@ -39,7 +39,7 @@ POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include <functional>
|
#include <functional>
|
||||||
|
|
||||||
#include "libtorrent/storage_defs.hpp"
|
#include "libtorrent/storage_defs.hpp"
|
||||||
#include "libtorrent/peer_id.hpp" // sha1_hash
|
#include "libtorrent/sha1_hash.hpp"
|
||||||
#include "libtorrent/version.hpp"
|
#include "libtorrent/version.hpp"
|
||||||
#include "libtorrent/socket.hpp" // for tcp::endpoint
|
#include "libtorrent/socket.hpp" // for tcp::endpoint
|
||||||
#include "libtorrent/bitfield.hpp"
|
#include "libtorrent/bitfield.hpp"
|
||||||
|
|
|
@ -42,7 +42,6 @@ POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include <thread>
|
#include <thread>
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
#include <atomic>
|
#include <atomic>
|
||||||
#include <functional>
|
|
||||||
|
|
||||||
namespace libtorrent
|
namespace libtorrent
|
||||||
{
|
{
|
||||||
|
@ -77,7 +76,7 @@ namespace libtorrent
|
||||||
// it is expected that they will be called while holding the
|
// it is expected that they will be called while holding the
|
||||||
// job queue mutex
|
// job queue mutex
|
||||||
|
|
||||||
// theese functions should be called by the thread_fun to signal its state
|
// these functions should be called by the thread_fun to signal its state
|
||||||
// threads are considered active when they are started so thread_idle should
|
// threads are considered active when they are started so thread_idle should
|
||||||
// be called first
|
// be called first
|
||||||
// these calls are not thread safe
|
// these calls are not thread safe
|
||||||
|
@ -97,7 +96,7 @@ namespace libtorrent
|
||||||
// get the thread id of the first thread in the internal vector
|
// get the thread id of the first thread in the internal vector
|
||||||
// since this is the first thread it will remain the same until the first
|
// since this is the first thread it will remain the same until the first
|
||||||
// thread exits
|
// thread exits
|
||||||
// it can be used to trigger maintainance jobs which should only run on one thread
|
// it can be used to trigger maintenance jobs which should only run on one thread
|
||||||
std::thread::id first_thread_id();
|
std::thread::id first_thread_id();
|
||||||
int num_threads()
|
int num_threads()
|
||||||
{
|
{
|
||||||
|
|
|
@ -31,8 +31,9 @@ POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "libtorrent/disk_io_thread_pool.hpp"
|
#include "libtorrent/disk_io_thread_pool.hpp"
|
||||||
#include "libtorrent/disk_io_thread.hpp"
|
#include "libtorrent/assert.hpp"
|
||||||
#include <functional>
|
|
||||||
|
#include <algorithm>
|
||||||
|
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
|
@ -79,7 +80,7 @@ namespace libtorrent
|
||||||
if (wait)
|
if (wait)
|
||||||
{
|
{
|
||||||
// must release m_mutex to avoid a deadlock if the thread
|
// must release m_mutex to avoid a deadlock if the thread
|
||||||
// tries to aquire it
|
// tries to acquire it
|
||||||
l.unlock();
|
l.unlock();
|
||||||
t.join();
|
t.join();
|
||||||
l.lock();
|
l.lock();
|
||||||
|
@ -138,7 +139,7 @@ namespace libtorrent
|
||||||
void disk_io_thread_pool::job_queued(int queue_size)
|
void disk_io_thread_pool::job_queued(int queue_size)
|
||||||
{
|
{
|
||||||
// this check is not strictly necessary
|
// this check is not strictly necessary
|
||||||
// but do it to avoid aquiring the mutex in the trivial case
|
// but do it to avoid acquiring the mutex in the trivial case
|
||||||
if (m_num_idle_threads >= queue_size) return;
|
if (m_num_idle_threads >= queue_size) return;
|
||||||
std::lock_guard<std::mutex> l(m_mutex);
|
std::lock_guard<std::mutex> l(m_mutex);
|
||||||
if (m_abort) return;
|
if (m_abort) return;
|
||||||
|
|
|
@ -174,7 +174,6 @@ namespace
|
||||||
#include <winerror.h>
|
#include <winerror.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
using libtorrent::aux::session_impl;
|
|
||||||
using namespace std::placeholders;
|
using namespace std::placeholders;
|
||||||
|
|
||||||
#ifdef BOOST_NO_EXCEPTIONS
|
#ifdef BOOST_NO_EXCEPTIONS
|
||||||
|
@ -5156,10 +5155,9 @@ namespace aux {
|
||||||
void session_impl::update_count_slow()
|
void session_impl::update_count_slow()
|
||||||
{
|
{
|
||||||
error_code ec;
|
error_code ec;
|
||||||
for (torrent_map::const_iterator i = m_torrents.begin()
|
for (auto const& tp : m_torrents)
|
||||||
, end(m_torrents.end()); i != end; ++i)
|
|
||||||
{
|
{
|
||||||
i->second->on_inactivity_tick(ec);
|
tp.second->on_inactivity_tick(ec);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5173,7 +5171,7 @@ namespace aux {
|
||||||
|
|
||||||
// if not, don't tell the tracker anything if we're in force_proxy
|
// if not, don't tell the tracker anything if we're in force_proxy
|
||||||
// mode. We don't want to leak our listen port since it can
|
// mode. We don't want to leak our listen port since it can
|
||||||
// potentially identify us if it is leaked elsewere
|
// potentially identify us if it is leaked elsewhere
|
||||||
if (m_settings.get_bool(settings_pack::force_proxy)) return 0;
|
if (m_settings.get_bool(settings_pack::force_proxy)) return 0;
|
||||||
if (m_listen_sockets.empty()) return 0;
|
if (m_listen_sockets.empty()) return 0;
|
||||||
return m_listen_sockets.front().tcp_external_port;
|
return m_listen_sockets.front().tcp_external_port;
|
||||||
|
@ -5192,12 +5190,11 @@ namespace aux {
|
||||||
|
|
||||||
// if not, don't tell the tracker anything if we're in force_proxy
|
// if not, don't tell the tracker anything if we're in force_proxy
|
||||||
// mode. We don't want to leak our listen port since it can
|
// mode. We don't want to leak our listen port since it can
|
||||||
// potentially identify us if it is leaked elsewere
|
// potentially identify us if it is leaked elsewhere
|
||||||
if (m_settings.get_bool(settings_pack::force_proxy)) return 0;
|
if (m_settings.get_bool(settings_pack::force_proxy)) return 0;
|
||||||
for (std::list<listen_socket_t>::const_iterator i = m_listen_sockets.begin()
|
for (auto const& s : m_listen_sockets)
|
||||||
, end(m_listen_sockets.end()); i != end; ++i)
|
|
||||||
{
|
{
|
||||||
if (i->ssl) return i->tcp_external_port;
|
if (s.ssl) return s.tcp_external_port;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -101,7 +101,6 @@ POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include "libtorrent/aux_/session_impl.hpp" // for tracker_logger
|
#include "libtorrent/aux_/session_impl.hpp" // for tracker_logger
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
using namespace libtorrent;
|
|
||||||
using namespace std::placeholders;
|
using namespace std::placeholders;
|
||||||
|
|
||||||
namespace libtorrent
|
namespace libtorrent
|
||||||
|
|
Loading…
Reference in New Issue