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:
Alden Torres 2016-11-02 01:03:12 -04:00 committed by Arvid Norberg
parent 09cbd0a51d
commit aef614a74c
6 changed files with 19 additions and 32 deletions

17
Jamfile
View File

@ -27,15 +27,11 @@ if $(BOOST_ROOT)
else
{
local boost-lib-search-path =
<search>/opt/local/lib
<search>/usr/lib
<search>/usr/local/lib
<search>/sw/lib
<search>/usr/g++/lib
;
local boost-include-path =
<include>/opt/local/include
<include>/usr/local/include
<include>/usr/sfw/include
;
@ -125,11 +121,6 @@ rule linking ( properties * )
# gcrypt libraries, if enabled
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 ;
}
@ -556,10 +547,10 @@ lib gcc : : <name>gcc <link>static ;
lib libiconv : : <name>iconv <link>shared <search>/usr/local/lib ;
# 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 crypto : : <name>crypto <link>shared <use>z <search>/opt/local/lib : : <include>/opt/local/include ;
lib ssl : : <name>ssl <link>shared <use>crypto <search>/opt/local/lib : : <include>/opt/local/include ;
lib crypto : : <name>crypto <link>shared <use>z ;
lib ssl : : <name>ssl <link>shared <use>crypto ;
lib dl : : <link>shared <name>dl ;
# time functions used on linux require librt
@ -601,7 +592,6 @@ SOURCES =
entry
error_code
file_storage
lazy_bdecode
escape_string
string_util
file
@ -770,6 +760,7 @@ lib torrent
<dht>on:<source>src/kademlia/$(KADEMLIA_SOURCES).cpp
<dht>on:<source>ed25519/src/$(ED25519_SOURCES).cpp
<dht>on:<source>src/hasher512.cpp
<deprecated-functions>on:<source>src/lazy_bdecode.cpp
<variant>debug:<asserts>on
<variant>debug:<invariant-checks>on

View File

@ -39,7 +39,7 @@ POSSIBILITY OF SUCH DAMAGE.
#include <functional>
#include "libtorrent/storage_defs.hpp"
#include "libtorrent/peer_id.hpp" // sha1_hash
#include "libtorrent/sha1_hash.hpp"
#include "libtorrent/version.hpp"
#include "libtorrent/socket.hpp" // for tcp::endpoint
#include "libtorrent/bitfield.hpp"

View File

@ -42,7 +42,6 @@ POSSIBILITY OF SUCH DAMAGE.
#include <thread>
#include <mutex>
#include <atomic>
#include <functional>
namespace libtorrent
{
@ -77,7 +76,7 @@ namespace libtorrent
// it is expected that they will be called while holding the
// 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
// be called first
// these calls are not thread safe
@ -97,7 +96,7 @@ namespace libtorrent
// 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
// 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();
int num_threads()
{

View File

@ -31,8 +31,9 @@ POSSIBILITY OF SUCH DAMAGE.
*/
#include "libtorrent/disk_io_thread_pool.hpp"
#include "libtorrent/disk_io_thread.hpp"
#include <functional>
#include "libtorrent/assert.hpp"
#include <algorithm>
namespace
{
@ -79,7 +80,7 @@ namespace libtorrent
if (wait)
{
// must release m_mutex to avoid a deadlock if the thread
// tries to aquire it
// tries to acquire it
l.unlock();
t.join();
l.lock();
@ -138,7 +139,7 @@ namespace libtorrent
void disk_io_thread_pool::job_queued(int queue_size)
{
// 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;
std::lock_guard<std::mutex> l(m_mutex);
if (m_abort) return;

View File

@ -174,7 +174,6 @@ namespace
#include <winerror.h>
#endif
using libtorrent::aux::session_impl;
using namespace std::placeholders;
#ifdef BOOST_NO_EXCEPTIONS
@ -5156,10 +5155,9 @@ namespace aux {
void session_impl::update_count_slow()
{
error_code ec;
for (torrent_map::const_iterator i = m_torrents.begin()
, end(m_torrents.end()); i != end; ++i)
for (auto const& tp : m_torrents)
{
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
// 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_listen_sockets.empty()) return 0;
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
// 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;
for (std::list<listen_socket_t>::const_iterator i = m_listen_sockets.begin()
, end(m_listen_sockets.end()); i != end; ++i)
for (auto const& s : m_listen_sockets)
{
if (i->ssl) return i->tcp_external_port;
if (s.ssl) return s.tcp_external_port;
}
#endif
return 0;

View File

@ -101,7 +101,6 @@ POSSIBILITY OF SUCH DAMAGE.
#include "libtorrent/aux_/session_impl.hpp" // for tracker_logger
#endif
using namespace libtorrent;
using namespace std::placeholders;
namespace libtorrent