From e0e98cbed5f8893c7d35ad76c5d50bfbefcaea67 Mon Sep 17 00:00:00 2001 From: Jordan Lee Date: Sun, 8 Sep 2013 18:39:37 +0000 Subject: [PATCH] fix CL warnings in the Qt code. mikedld --- qt/formatter.h | 2 ++ qt/freespace-label.h | 3 ++- qt/make-dialog.h | 20 ++++++++++---------- qt/options.cc | 2 ++ qt/torrent-filter.cc | 2 +- qt/torrent.h | 4 ++++ qt/tracker-delegate.h | 6 +++--- 7 files changed, 24 insertions(+), 15 deletions(-) diff --git a/qt/formatter.h b/qt/formatter.h index 7ae4739ae..8b3be7363 100644 --- a/qt/formatter.h +++ b/qt/formatter.h @@ -17,6 +17,8 @@ #include #include +#include // int64_t + class Speed; class Formatter: public QObject diff --git a/qt/freespace-label.h b/qt/freespace-label.h index e79cc9c46..5ef0a821b 100644 --- a/qt/freespace-label.h +++ b/qt/freespace-label.h @@ -13,9 +13,10 @@ #ifndef QTR_FREESPACE_LABEL_H #define QTR_FREESPACE_LABEL_H +#include + #include #include - #include class Session; diff --git a/qt/make-dialog.h b/qt/make-dialog.h index 060a8074b..fda27f0e0 100644 --- a/qt/make-dialog.h +++ b/qt/make-dialog.h @@ -16,16 +16,16 @@ #include #include -struct QAbstractButton; -struct QPlainTextEdit; -struct QLineEdit; -struct QCheckBox; -struct QLabel; -struct QPushButton; -struct QRadioButton; -struct Session; -struct QProgressBar; -struct QDialogButtonBox; +class QAbstractButton; +class QPlainTextEdit; +class QLineEdit; +class QCheckBox; +class QLabel; +class QPushButton; +class QRadioButton; +class Session; +class QProgressBar; +class QDialogButtonBox; extern "C" { diff --git a/qt/options.cc b/qt/options.cc index 2f5ad80af..a1a388f74 100644 --- a/qt/options.cc +++ b/qt/options.cc @@ -10,6 +10,8 @@ * $Id$ */ +#include // std::min() + #include #include #include diff --git a/qt/torrent-filter.cc b/qt/torrent-filter.cc index e5eecc188..ba5c1f1d6 100644 --- a/qt/torrent-filter.cc +++ b/qt/torrent-filter.cc @@ -211,7 +211,7 @@ TorrentFilter :: hiddenRowCount( ) const void TorrentFilter :: countTorrentsPerMode (int * setmeCounts) const { - std::fill_n (setmeCounts, FilterMode::NUM_MODES, 0); + std::fill_n (setmeCounts, static_cast(FilterMode::NUM_MODES), 0); for (int row(0); ; ++row) { diff --git a/qt/torrent.h b/qt/torrent.h index 0b6470313..336d7ef95 100644 --- a/qt/torrent.h +++ b/qt/torrent.h @@ -29,6 +29,10 @@ #include "speed.h" #include "types.h" +#ifdef ERROR + #undef ERROR +#endif + extern "C" { struct tr_variant; diff --git a/qt/tracker-delegate.h b/qt/tracker-delegate.h index 1bef8398c..306069355 100644 --- a/qt/tracker-delegate.h +++ b/qt/tracker-delegate.h @@ -10,8 +10,8 @@ * $Id$ */ -#ifndef QTR_TORRENT_DELEGATE_H -#define QTR_TORRENT_DELEGATE_H +#ifndef QTR_TRACKER_DELEGATE_H +#define QTR_TRACKER_DELEGATE_H #include #include @@ -20,7 +20,7 @@ class QPainter; class QStyleOptionViewItem; class QStyle; class Session; -class TrackerInfo; +struct TrackerInfo; class TrackerDelegate: public QItemDelegate {