parent
3ec48ec5b4
commit
c299149dc0
|
@ -172,19 +172,24 @@ script:
|
||||||
- 'if [[ "$analyze" == "1" ]]; then
|
- 'if [[ "$analyze" == "1" ]]; then
|
||||||
cppcheck --version &&
|
cppcheck --version &&
|
||||||
find src test examples tools -type f | grep ".*\.cpp$" >cppcheck.files &&
|
find src test examples tools -type f | grep ".*\.cpp$" >cppcheck.files &&
|
||||||
find simulation -type f -depth -2 | grep ".*\.cpp$" >>cppcheck.files &&
|
find simulation -maxdepth 1 -type f | grep ".*\.cpp$" >>cppcheck.files &&
|
||||||
cppcheck -DTORRENT_USE_IPV6="1" -DTORRENT_USE_I2P="1"
|
cppcheck -DTORRENT_USE_IPV6="1" -DTORRENT_USE_I2P="1"
|
||||||
-DTORRENT_USE_OPENSSL="1" -DTORRENT_USE_INVARIANT_CHECKS="1"
|
-DTORRENT_USE_OPENSSL="1" -DTORRENT_USE_INVARIANT_CHECKS="1"
|
||||||
-DTORRENT_EXPENSIVE_INVARIANT_CHECKS="1" -DTORRENT_USE_ASSERTS="1"
|
-DTORRENT_EXPENSIVE_INVARIANT_CHECKS="1" -DTORRENT_USE_ASSERTS="1"
|
||||||
-UTORRENT_DISABLE_MUTABLE_TORRENTS -UTORRENT_DISABLE_LOGGING
|
-UTORRENT_DISABLE_MUTABLE_TORRENTS -UTORRENT_DISABLE_LOGGING
|
||||||
-UTORRENT_DEBUG_BUFFERS -UTORRENT_EXPORT_EXTRA
|
-UTORRENT_DEBUG_BUFFERS -UTORRENT_EXPORT_EXTRA
|
||||||
--suppress=preprocessorErrorDirective
|
--suppress=preprocessorErrorDirective
|
||||||
|
--suppress=uninitVar
|
||||||
|
--suppress=arrayIndexOutOfBounds
|
||||||
|
--suppress=unusedStructMember
|
||||||
|
--suppress=operatorEqVarError
|
||||||
--suppress=noConstructor
|
--suppress=noConstructor
|
||||||
--suppress=syntaxError
|
--suppress=syntaxError
|
||||||
--enable=style
|
--enable=style
|
||||||
--template "{file}({line}): {severity} ({id}): {message}"
|
--template "{file}({line}): {severity} ({id}): {message}"
|
||||||
--inline-suppr --force --std=c++11 -j2 -I include -I /usr/local/include
|
--inline-suppr --force --std=c++11 -j2 -I include -I /usr/local/include
|
||||||
--file-list=cppcheck.files 2> cppcheck.txt;
|
-I test -I simulation/libsimulator/include
|
||||||
|
--file-list=cppcheck.files 2> cppcheck.txt &&
|
||||||
if [ -s cppcheck.txt ]; then
|
if [ -s cppcheck.txt ]; then
|
||||||
echo " ======= CPPCHECK ERRORS =====";
|
echo " ======= CPPCHECK ERRORS =====";
|
||||||
cat cppcheck.txt;
|
cat cppcheck.txt;
|
||||||
|
|
|
@ -73,7 +73,7 @@ namespace libtorrent
|
||||||
void open(receive_handler_t const& handler, io_service& ios
|
void open(receive_handler_t const& handler, io_service& ios
|
||||||
, error_code& ec, bool loopback = true);
|
, error_code& ec, bool loopback = true);
|
||||||
|
|
||||||
enum flags_t { broadcast = 1 };
|
enum flags_t { flag_broadcast = 1 };
|
||||||
void send(char const* buffer, int size, error_code& ec, int flags = 0);
|
void send(char const* buffer, int size, error_code& ec, int flags = 0);
|
||||||
|
|
||||||
void close();
|
void close();
|
||||||
|
@ -117,7 +117,7 @@ namespace libtorrent
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
void on_receive(socket_entry* s, error_code const& ec
|
void on_receive(socket_entry* s, error_code const& ec
|
||||||
, std::size_t bytes_transferred);
|
, std::size_t bytes_transferred);
|
||||||
void open_unicast_socket(io_service& ios, address const& addr
|
void open_unicast_socket(io_service& ios, address const& addr
|
||||||
|
|
|
@ -39,9 +39,7 @@ namespace lt = libtorrent;
|
||||||
|
|
||||||
struct test_threads : lt::pool_thread_interface
|
struct test_threads : lt::pool_thread_interface
|
||||||
{
|
{
|
||||||
test_threads()
|
test_threads() {}
|
||||||
: m_active_threads(0)
|
|
||||||
{}
|
|
||||||
|
|
||||||
virtual void notify_all() override { m_cond.notify_all(); }
|
virtual void notify_all() override { m_cond.notify_all(); }
|
||||||
virtual void thread_fun(lt::io_service::work w) override
|
virtual void thread_fun(lt::io_service::work w) override
|
||||||
|
@ -106,9 +104,9 @@ struct test_threads : lt::pool_thread_interface
|
||||||
std::condition_variable m_exit_cond;
|
std::condition_variable m_exit_cond;
|
||||||
|
|
||||||
// must hold m_mutex to access
|
// must hold m_mutex to access
|
||||||
int m_active_threads;
|
int m_active_threads = 0;
|
||||||
// must hold m_mutex to access
|
// must hold m_mutex to access
|
||||||
int m_target_active_threads;
|
int m_target_active_threads = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
TORRENT_TEST(disk_io_thread_pool_idle_reaping)
|
TORRENT_TEST(disk_io_thread_pool_idle_reaping)
|
||||||
|
|
|
@ -276,7 +276,7 @@ namespace libtorrent
|
||||||
|
|
||||||
// if the user specified the broadcast flag, send one to the broadcast
|
// if the user specified the broadcast flag, send one to the broadcast
|
||||||
// address as well
|
// address as well
|
||||||
if ((flags & broadcast_socket::broadcast) && i->can_broadcast())
|
if ((flags & broadcast_socket::flag_broadcast) && i->can_broadcast())
|
||||||
i->socket->send_to(boost::asio::buffer(buffer, size)
|
i->socket->send_to(boost::asio::buffer(buffer, size)
|
||||||
, udp::endpoint(i->broadcast_address(), m_multicast_endpoint.port()), 0, e);
|
, udp::endpoint(i->broadcast_address(), m_multicast_endpoint.port()), 0, e);
|
||||||
|
|
||||||
|
|
|
@ -154,7 +154,7 @@ void lsd::announce_impl(sha1_hash const& ih, int listen_port, bool broadcast
|
||||||
{
|
{
|
||||||
int msg_len = render_lsd_packet(msg, sizeof(msg), listen_port, ih_hex
|
int msg_len = render_lsd_packet(msg, sizeof(msg), listen_port, ih_hex
|
||||||
, m_cookie, "239.192.152.143");
|
, m_cookie, "239.192.152.143");
|
||||||
m_socket.send(msg, msg_len, ec, broadcast ? broadcast_socket::broadcast : 0);
|
m_socket.send(msg, msg_len, ec, broadcast ? broadcast_socket::flag_broadcast : 0);
|
||||||
if (ec)
|
if (ec)
|
||||||
{
|
{
|
||||||
m_disabled = true;
|
m_disabled = true;
|
||||||
|
@ -170,7 +170,7 @@ void lsd::announce_impl(sha1_hash const& ih, int listen_port, bool broadcast
|
||||||
{
|
{
|
||||||
int msg_len = render_lsd_packet(msg, sizeof(msg), listen_port, ih_hex
|
int msg_len = render_lsd_packet(msg, sizeof(msg), listen_port, ih_hex
|
||||||
, m_cookie, "[ff15::efc0:988f]");
|
, m_cookie, "[ff15::efc0:988f]");
|
||||||
m_socket6.send(msg, msg_len, ec, broadcast ? broadcast_socket::broadcast : 0);
|
m_socket6.send(msg, msg_len, ec, broadcast ? broadcast_socket::flag_broadcast : 0);
|
||||||
if (ec)
|
if (ec)
|
||||||
{
|
{
|
||||||
m_disabled6 = true;
|
m_disabled6 = true;
|
||||||
|
|
|
@ -373,7 +373,7 @@ int main(int argc, char const* argv[])
|
||||||
}
|
}
|
||||||
|
|
||||||
bdecode_node e;
|
bdecode_node e;
|
||||||
if (buf.size() == 0 || bdecode(&buf[0], &buf[0] + buf.size(), e, ec) != 0)
|
if (buf.empty() || bdecode(&buf[0], &buf[0] + buf.size(), e, ec) != 0)
|
||||||
{
|
{
|
||||||
std::fprintf(stderr, "ERROR parsing file: %s\n%s\n"
|
std::fprintf(stderr, "ERROR parsing file: %s\n%s\n"
|
||||||
, *argv, ec.message().c_str());
|
, *argv, ec.message().c_str());
|
||||||
|
|
Loading…
Reference in New Issue