From c19c6b2cc1dacbc492483fe49f4b5dd4dda42cd1 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Fri, 24 Apr 2015 05:37:17 +0000 Subject: [PATCH] fix some warnings --- include/libtorrent/aux_/disable_warnings_push.hpp | 4 ++++ include/libtorrent/aux_/session_interface.hpp | 2 +- include/libtorrent/bdecode.hpp | 2 +- include/libtorrent/chained_buffer.hpp | 7 +++++-- include/libtorrent/close_reason.hpp | 3 +-- include/libtorrent/create_torrent.hpp | 2 +- include/libtorrent/disk_io_job.hpp | 2 +- include/libtorrent/disk_io_thread.hpp | 2 +- include/libtorrent/error_code.hpp | 2 +- include/libtorrent/link.hpp | 2 +- include/libtorrent/linked_list.hpp | 2 +- include/libtorrent/operations.hpp | 2 +- include/libtorrent/peer_list.hpp | 2 +- include/libtorrent/settings_pack.hpp | 2 +- include/libtorrent/stat_cache.hpp | 2 +- include/libtorrent/tailqueue.hpp | 2 +- include/libtorrent/torrent.hpp | 3 ++- include/libtorrent/torrent_handle.hpp | 2 +- src/lazy_bdecode.cpp | 2 +- 19 files changed, 27 insertions(+), 20 deletions(-) diff --git a/include/libtorrent/aux_/disable_warnings_push.hpp b/include/libtorrent/aux_/disable_warnings_push.hpp index f4ce52808..02ea941fe 100644 --- a/include/libtorrent/aux_/disable_warnings_push.hpp +++ b/include/libtorrent/aux_/disable_warnings_push.hpp @@ -46,6 +46,7 @@ POSSIBILITY OF SUCH DAMAGE. #ifdef __clang__ #pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wall" #pragma clang diagnostic ignored "-Weverything" #pragma clang diagnostic ignored "-Wsign-conversion" #pragma clang diagnostic ignored "-Wconversion" @@ -61,6 +62,9 @@ POSSIBILITY OF SUCH DAMAGE. #pragma clang diagnostic ignored "-Wundef" #pragma clang diagnostic ignored "-Wshadow" #pragma clang diagnostic ignored "-Wimplicit-fallthrough" +#pragma clang diagnostic ignored "-Wc++11-long-long" +#pragma clang diagnostic ignored "-Wc++11-extensions" +#pragma clang diagnostic ignored "-Wextra-semi" #endif #ifdef _MSC_VER diff --git a/include/libtorrent/aux_/session_interface.hpp b/include/libtorrent/aux_/session_interface.hpp index d63322e14..6a4991d0d 100644 --- a/include/libtorrent/aux_/session_interface.hpp +++ b/include/libtorrent/aux_/session_interface.hpp @@ -307,7 +307,7 @@ namespace libtorrent { namespace aux // all torrents that have resume data to save // torrent_want_save_resume, - num_torrent_lists, + num_torrent_lists }; virtual std::vector& torrent_list(int i) = 0; diff --git a/include/libtorrent/bdecode.hpp b/include/libtorrent/bdecode.hpp index b2536b4e8..35d3c2bea 100644 --- a/include/libtorrent/bdecode.hpp +++ b/include/libtorrent/bdecode.hpp @@ -164,7 +164,7 @@ struct bdecode_token { max_offset = (1 << 29) - 1, max_next_item = (1 << 29) - 1, - max_header = (1 << 3) - 1, + max_header = (1 << 3) - 1 }; bdecode_token(boost::uint32_t off, bdecode_token::type_t t) diff --git a/include/libtorrent/chained_buffer.hpp b/include/libtorrent/chained_buffer.hpp index 5c651b30c..46bfca12f 100644 --- a/include/libtorrent/chained_buffer.hpp +++ b/include/libtorrent/chained_buffer.hpp @@ -34,6 +34,10 @@ POSSIBILITY OF SUCH DAMAGE. #define TORRENT_CHAINED_BUFFER_HPP_INCLUDED #include "libtorrent/config.hpp" +#include "libtorrent/disk_io_job.hpp" // for block_cache_reference +#include "libtorrent/debug.hpp" + +#include "libtorrent/aux_/disable_warnings_push.hpp" #include #if BOOST_VERSION < 103500 @@ -45,8 +49,7 @@ POSSIBILITY OF SUCH DAMAGE. #include #include // for memcpy -#include "libtorrent/disk_io_job.hpp" // for block_cache_reference -#include "libtorrent/debug.hpp" +#include "libtorrent/aux_/disable_warnings_pop.hpp" namespace libtorrent { diff --git a/include/libtorrent/close_reason.hpp b/include/libtorrent/close_reason.hpp index e7da200f7..a4678b537 100644 --- a/include/libtorrent/close_reason.hpp +++ b/include/libtorrent/close_reason.hpp @@ -147,8 +147,7 @@ namespace libtorrent close_corrupt_pieces, close_pex_message_too_big, - close_pex_too_frequent, - + close_pex_too_frequent }; close_reason_t error_to_close_reason(error_code const& ec); diff --git a/include/libtorrent/create_torrent.hpp b/include/libtorrent/create_torrent.hpp index d854b3585..217d65813 100644 --- a/include/libtorrent/create_torrent.hpp +++ b/include/libtorrent/create_torrent.hpp @@ -148,7 +148,7 @@ namespace libtorrent // another torrent. // // .. _BEP38: http://www.bittorrent.org/beps/bep_0038.html - mutable_torrent_support = 16, + mutable_torrent_support = 16 }; // The ``piece_size`` is the size of each piece in bytes. It must diff --git a/include/libtorrent/disk_io_job.hpp b/include/libtorrent/disk_io_job.hpp index e7bfddbde..aea4919a9 100644 --- a/include/libtorrent/disk_io_job.hpp +++ b/include/libtorrent/disk_io_job.hpp @@ -133,7 +133,7 @@ namespace libtorrent in_progress = 0x20, // turns into file::coalesce_buffers in the file operation - coalesce_buffers = 0x40, + coalesce_buffers = 0x40 }; // for write jobs, returns true if its block diff --git a/include/libtorrent/disk_io_thread.hpp b/include/libtorrent/disk_io_thread.hpp index 6e37ab6c1..1d5af07d3 100644 --- a/include/libtorrent/disk_io_thread.hpp +++ b/include/libtorrent/disk_io_thread.hpp @@ -438,7 +438,7 @@ namespace libtorrent // the job cannot be completed right now, put it back in the // queue and try again later - retry_job = -201, + retry_job = -201 }; void add_completed_job(disk_io_job* j); diff --git a/include/libtorrent/error_code.hpp b/include/libtorrent/error_code.hpp index 01133facf..e77ba8bc3 100644 --- a/include/libtorrent/error_code.hpp +++ b/include/libtorrent/error_code.hpp @@ -581,7 +581,7 @@ namespace libtorrent partfile_read, partfile_write, check_resume, - hard_link, + hard_link }; // Returns a string literal representing the file operation diff --git a/include/libtorrent/link.hpp b/include/libtorrent/link.hpp index 7352927d4..c72036fc4 100644 --- a/include/libtorrent/link.hpp +++ b/include/libtorrent/link.hpp @@ -71,7 +71,7 @@ namespace libtorrent list.push_back(self); } }; -}; +} #endif diff --git a/include/libtorrent/linked_list.hpp b/include/libtorrent/linked_list.hpp index af4b2bcbe..e1f09ff91 100644 --- a/include/libtorrent/linked_list.hpp +++ b/include/libtorrent/linked_list.hpp @@ -145,7 +145,7 @@ namespace libtorrent list_node* m_last; int m_size; }; -}; +} #endif // LINKED_LIST_HPP diff --git a/include/libtorrent/operations.hpp b/include/libtorrent/operations.hpp index 841147b71..6bb263ba0 100644 --- a/include/libtorrent/operations.hpp +++ b/include/libtorrent/operations.hpp @@ -96,7 +96,7 @@ namespace libtorrent op_ssl_handshake, // a connection failed to satisfy the bind interface setting - op_get_interface, + op_get_interface }; } diff --git a/include/libtorrent/peer_list.hpp b/include/libtorrent/peer_list.hpp index 93f859be0..b97f6643a 100644 --- a/include/libtorrent/peer_list.hpp +++ b/include/libtorrent/peer_list.hpp @@ -124,7 +124,7 @@ namespace libtorrent flag_encryption = 0x1, flag_seed = 0x2, flag_utp = 0x4, - flag_holepunch = 0x8, + flag_holepunch = 0x8 }; // this is called once for every torrent_peer we get from diff --git a/include/libtorrent/settings_pack.hpp b/include/libtorrent/settings_pack.hpp index d99cb2d00..8299bcb3a 100644 --- a/include/libtorrent/settings_pack.hpp +++ b/include/libtorrent/settings_pack.hpp @@ -98,7 +98,7 @@ namespace libtorrent int_type_base = 0x4000, bool_type_base = 0x8000, type_mask = 0xc000, - index_mask = 0x3fff, + index_mask = 0x3fff }; enum string_types diff --git a/include/libtorrent/stat_cache.hpp b/include/libtorrent/stat_cache.hpp index 5a8ac0fc7..f7dd71fb9 100644 --- a/include/libtorrent/stat_cache.hpp +++ b/include/libtorrent/stat_cache.hpp @@ -51,7 +51,7 @@ namespace libtorrent { cache_error = -1, not_in_cache = -2, - no_exist = -3, + no_exist = -3 }; // returns the size of the file or one diff --git a/include/libtorrent/tailqueue.hpp b/include/libtorrent/tailqueue.hpp index 84ce6bfe3..af054f520 100644 --- a/include/libtorrent/tailqueue.hpp +++ b/include/libtorrent/tailqueue.hpp @@ -87,7 +87,7 @@ namespace libtorrent tailqueue_node* m_last; int m_size; }; -}; +} #endif // TAILQUEUE_HPP diff --git a/include/libtorrent/torrent.hpp b/include/libtorrent/torrent.hpp index 66e8a8ec1..cd6fa40ba 100644 --- a/include/libtorrent/torrent.hpp +++ b/include/libtorrent/torrent.hpp @@ -468,8 +468,9 @@ namespace libtorrent // the error occurred while loading the .torrent file via the user // supplied load function - error_file_metadata = -4, + error_file_metadata = -4 }; + void set_error(error_code const& ec, int file); bool has_error() const { return !!m_error; } error_code error() const { return m_error; } diff --git a/include/libtorrent/torrent_handle.hpp b/include/libtorrent/torrent_handle.hpp index 86008753f..85a6e3bac 100644 --- a/include/libtorrent/torrent_handle.hpp +++ b/include/libtorrent/torrent_handle.hpp @@ -610,7 +610,7 @@ namespace libtorrent // priorities having changed etc. If the resume data doesn't need // saving, a save_resume_data_failed_alert is posted with the error // resume_data_not_modified. - only_if_modified = 4, + only_if_modified = 4 }; // ``save_resume_data()`` generates fast-resume data and returns it as an diff --git a/src/lazy_bdecode.cpp b/src/lazy_bdecode.cpp index 960ea248e..6da0ea744 100644 --- a/src/lazy_bdecode.cpp +++ b/src/lazy_bdecode.cpp @@ -645,7 +645,7 @@ namespace libtorrent } return ret; } -}; +} #endif // TORRENT_NO_DEPRECATE