fix some warnings

This commit is contained in:
Arvid Norberg 2015-04-24 05:37:17 +00:00
parent 924fb5d03c
commit c19c6b2cc1
19 changed files with 27 additions and 20 deletions

View File

@ -46,6 +46,7 @@ POSSIBILITY OF SUCH DAMAGE.
#ifdef __clang__ #ifdef __clang__
#pragma clang diagnostic push #pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wall"
#pragma clang diagnostic ignored "-Weverything" #pragma clang diagnostic ignored "-Weverything"
#pragma clang diagnostic ignored "-Wsign-conversion" #pragma clang diagnostic ignored "-Wsign-conversion"
#pragma clang diagnostic ignored "-Wconversion" #pragma clang diagnostic ignored "-Wconversion"
@ -61,6 +62,9 @@ POSSIBILITY OF SUCH DAMAGE.
#pragma clang diagnostic ignored "-Wundef" #pragma clang diagnostic ignored "-Wundef"
#pragma clang diagnostic ignored "-Wshadow" #pragma clang diagnostic ignored "-Wshadow"
#pragma clang diagnostic ignored "-Wimplicit-fallthrough" #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 #endif
#ifdef _MSC_VER #ifdef _MSC_VER

View File

@ -307,7 +307,7 @@ namespace libtorrent { namespace aux
// all torrents that have resume data to save // all torrents that have resume data to save
// torrent_want_save_resume, // torrent_want_save_resume,
num_torrent_lists, num_torrent_lists
}; };
virtual std::vector<torrent*>& torrent_list(int i) = 0; virtual std::vector<torrent*>& torrent_list(int i) = 0;

View File

@ -164,7 +164,7 @@ struct bdecode_token
{ {
max_offset = (1 << 29) - 1, max_offset = (1 << 29) - 1,
max_next_item = (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) bdecode_token(boost::uint32_t off, bdecode_token::type_t t)

View File

@ -34,6 +34,10 @@ POSSIBILITY OF SUCH DAMAGE.
#define TORRENT_CHAINED_BUFFER_HPP_INCLUDED #define TORRENT_CHAINED_BUFFER_HPP_INCLUDED
#include "libtorrent/config.hpp" #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 <boost/version.hpp> #include <boost/version.hpp>
#if BOOST_VERSION < 103500 #if BOOST_VERSION < 103500
@ -45,8 +49,7 @@ POSSIBILITY OF SUCH DAMAGE.
#include <vector> #include <vector>
#include <string.h> // for memcpy #include <string.h> // for memcpy
#include "libtorrent/disk_io_job.hpp" // for block_cache_reference #include "libtorrent/aux_/disable_warnings_pop.hpp"
#include "libtorrent/debug.hpp"
namespace libtorrent namespace libtorrent
{ {

View File

@ -147,8 +147,7 @@ namespace libtorrent
close_corrupt_pieces, close_corrupt_pieces,
close_pex_message_too_big, close_pex_message_too_big,
close_pex_too_frequent, close_pex_too_frequent
}; };
close_reason_t error_to_close_reason(error_code const& ec); close_reason_t error_to_close_reason(error_code const& ec);

View File

@ -148,7 +148,7 @@ namespace libtorrent
// another torrent. // another torrent.
// //
// .. _BEP38: http://www.bittorrent.org/beps/bep_0038.html // .. _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 // The ``piece_size`` is the size of each piece in bytes. It must

View File

@ -133,7 +133,7 @@ namespace libtorrent
in_progress = 0x20, in_progress = 0x20,
// turns into file::coalesce_buffers in the file operation // turns into file::coalesce_buffers in the file operation
coalesce_buffers = 0x40, coalesce_buffers = 0x40
}; };
// for write jobs, returns true if its block // for write jobs, returns true if its block

View File

@ -438,7 +438,7 @@ namespace libtorrent
// the job cannot be completed right now, put it back in the // the job cannot be completed right now, put it back in the
// queue and try again later // queue and try again later
retry_job = -201, retry_job = -201
}; };
void add_completed_job(disk_io_job* j); void add_completed_job(disk_io_job* j);

View File

@ -581,7 +581,7 @@ namespace libtorrent
partfile_read, partfile_read,
partfile_write, partfile_write,
check_resume, check_resume,
hard_link, hard_link
}; };
// Returns a string literal representing the file operation // Returns a string literal representing the file operation

View File

@ -71,7 +71,7 @@ namespace libtorrent
list.push_back(self); list.push_back(self);
} }
}; };
}; }
#endif #endif

View File

@ -145,7 +145,7 @@ namespace libtorrent
list_node* m_last; list_node* m_last;
int m_size; int m_size;
}; };
}; }
#endif // LINKED_LIST_HPP #endif // LINKED_LIST_HPP

View File

@ -96,7 +96,7 @@ namespace libtorrent
op_ssl_handshake, op_ssl_handshake,
// a connection failed to satisfy the bind interface setting // a connection failed to satisfy the bind interface setting
op_get_interface, op_get_interface
}; };
} }

View File

@ -124,7 +124,7 @@ namespace libtorrent
flag_encryption = 0x1, flag_encryption = 0x1,
flag_seed = 0x2, flag_seed = 0x2,
flag_utp = 0x4, flag_utp = 0x4,
flag_holepunch = 0x8, flag_holepunch = 0x8
}; };
// this is called once for every torrent_peer we get from // this is called once for every torrent_peer we get from

View File

@ -98,7 +98,7 @@ namespace libtorrent
int_type_base = 0x4000, int_type_base = 0x4000,
bool_type_base = 0x8000, bool_type_base = 0x8000,
type_mask = 0xc000, type_mask = 0xc000,
index_mask = 0x3fff, index_mask = 0x3fff
}; };
enum string_types enum string_types

View File

@ -51,7 +51,7 @@ namespace libtorrent
{ {
cache_error = -1, cache_error = -1,
not_in_cache = -2, not_in_cache = -2,
no_exist = -3, no_exist = -3
}; };
// returns the size of the file or one // returns the size of the file or one

View File

@ -87,7 +87,7 @@ namespace libtorrent
tailqueue_node* m_last; tailqueue_node* m_last;
int m_size; int m_size;
}; };
}; }
#endif // TAILQUEUE_HPP #endif // TAILQUEUE_HPP

View File

@ -468,8 +468,9 @@ namespace libtorrent
// the error occurred while loading the .torrent file via the user // the error occurred while loading the .torrent file via the user
// supplied load function // supplied load function
error_file_metadata = -4, error_file_metadata = -4
}; };
void set_error(error_code const& ec, int file); void set_error(error_code const& ec, int file);
bool has_error() const { return !!m_error; } bool has_error() const { return !!m_error; }
error_code error() const { return m_error; } error_code error() const { return m_error; }

View File

@ -610,7 +610,7 @@ namespace libtorrent
// priorities having changed etc. If the resume data doesn't need // priorities having changed etc. If the resume data doesn't need
// saving, a save_resume_data_failed_alert is posted with the error // saving, a save_resume_data_failed_alert is posted with the error
// resume_data_not_modified. // resume_data_not_modified.
only_if_modified = 4, only_if_modified = 4
}; };
// ``save_resume_data()`` generates fast-resume data and returns it as an // ``save_resume_data()`` generates fast-resume data and returns it as an

View File

@ -645,7 +645,7 @@ namespace libtorrent
} }
return ret; return ret;
} }
}; }
#endif // TORRENT_NO_DEPRECATE #endif // TORRENT_NO_DEPRECATE