reduce some warnings

This commit is contained in:
Arvid Norberg 2010-10-22 05:39:32 +00:00
parent 5efd0a9c20
commit 9a461c5e46
2 changed files with 14 additions and 20 deletions

View File

@ -55,25 +55,6 @@ namespace libtorrent
public: public:
enum { history = 5 }; enum { history = 5 };
#if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_LOGGING || defined TORRENT_ERROR_LOGGING
#define PRINT_SIZEOF(x) l << "sizeof(" #x "): " << sizeof(x) << "\n";
#define PRINT_OFFSETOF(x, y) l << " offsetof(" #x "," #y "): " << offsetof(x, y) << "\n";
static void print_size(logger& l)
{
PRINT_SIZEOF(stat_channel)
PRINT_OFFSETOF(stat_channel, m_rate_history)
PRINT_OFFSETOF(stat_channel, m_window)
PRINT_OFFSETOF(stat_channel, m_counter)
PRINT_OFFSETOF(stat_channel, m_total_counter)
PRINT_OFFSETOF(stat_channel, m_rate_sum)
}
#undef PRINT_SIZEOF
#undef PRINT_OFFSETOF
#endif
stat_channel() stat_channel()
: m_window(3) : m_window(3)
, m_counter(0) , m_counter(0)

View File

@ -77,12 +77,18 @@ POSSIBILITY OF SUCH DAMAGE.
#include "libtorrent/peer_info.hpp" #include "libtorrent/peer_info.hpp"
#include "libtorrent/settings.hpp" #include "libtorrent/settings.hpp"
#if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_LOGGING || defined TORRENT_ERROR_LOGGING
#endif
#ifndef TORRENT_WINDOWS #ifndef TORRENT_WINDOWS
#include <sys/resource.h> #include <sys/resource.h>
#endif #endif
#if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_LOGGING || defined TORRENT_ERROR_LOGGING #if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_LOGGING || defined TORRENT_ERROR_LOGGING
// for logging stat layout
#include "libtorrent/stat.hpp"
// for logging the size of DHT structures // for logging the size of DHT structures
#ifndef TORRENT_DISABLE_DHT #ifndef TORRENT_DISABLE_DHT
#include <libtorrent/kademlia/find_data.hpp> #include <libtorrent/kademlia/find_data.hpp>
@ -618,7 +624,14 @@ namespace aux {
PRINT_SIZEOF(stat) PRINT_SIZEOF(stat)
PRINT_SIZEOF(bandwidth_channel) PRINT_SIZEOF(bandwidth_channel)
PRINT_SIZEOF(policy) PRINT_SIZEOF(policy)
stat_channel::print_size(*m_logger);
PRINT_SIZEOF(stat_channel)
PRINT_OFFSETOF(stat_channel, m_rate_history)
PRINT_OFFSETOF(stat_channel, m_window)
PRINT_OFFSETOF(stat_channel, m_counter)
PRINT_OFFSETOF(stat_channel, m_total_counter)
PRINT_OFFSETOF(stat_channel, m_rate_sum)
torrent::print_size(*m_logger); torrent::print_size(*m_logger);
PRINT_SIZEOF(peer_connection) PRINT_SIZEOF(peer_connection)