From: Ivailo Monev Date: Sun, 21 Aug 2016 12:46:27 +0000 (+0000) Subject: various cleanups X-Git-Tag: 4.12.0~6812 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=f8897622dc78a83d25a3e1393710366e81fdfb69;p=kde%2FKatie.git various cleanups Signed-off-by: Ivailo Monev --- diff --git a/src/core/io/qfilesystemwatcher_fsevents.cpp b/src/core/io/qfilesystemwatcher_fsevents.cpp index abe5099e3..a3db6b4bf 100644 --- a/src/core/io/qfilesystemwatcher_fsevents.cpp +++ b/src/core/io/qfilesystemwatcher_fsevents.cpp @@ -51,7 +51,6 @@ #include #include #include -#include #include #include diff --git a/src/core/io/qfilesystemwatcher_kqueue.cpp b/src/core/io/qfilesystemwatcher_kqueue.cpp index 7b4acc76e..4a0987d00 100644 --- a/src/core/io/qfilesystemwatcher_kqueue.cpp +++ b/src/core/io/qfilesystemwatcher_kqueue.cpp @@ -50,7 +50,6 @@ #include #include #include -#include #include #include diff --git a/src/core/io/qfsfileengine_unix.cpp b/src/core/io/qfsfileengine_unix.cpp index 3f653826a..237c8310c 100644 --- a/src/core/io/qfsfileengine_unix.cpp +++ b/src/core/io/qfsfileengine_unix.cpp @@ -51,7 +51,6 @@ #include "qfile.h" #include "qdir.h" #include "qdatetime.h" -#include "qvarlengtharray.h" #include #include diff --git a/src/core/io/qfsfileengine_win.cpp b/src/core/io/qfsfileengine_win.cpp index 71c90a1b4..36097c719 100644 --- a/src/core/io/qfsfileengine_win.cpp +++ b/src/core/io/qfsfileengine_win.cpp @@ -48,7 +48,6 @@ #include "qfile.h" #include "qdir.h" -#include "qvarlengtharray.h" #include "qdatetime.h" #include "qt_windows.h" diff --git a/src/core/io/qurl.cpp b/src/core/io/qurl.cpp index 48f5bbb43..dc69ae869 100644 --- a/src/core/io/qurl.cpp +++ b/src/core/io/qurl.cpp @@ -201,7 +201,6 @@ #include "qstring.h" #include "qstringlist.h" #include "qstack.h" -#include "qvarlengtharray.h" #include "qdebug.h" #include "qlocale_tools_p.h" #ifndef QT_BOOTSTRAPPED diff --git a/src/core/statemachine/qabstractstate.cpp b/src/core/statemachine/qabstractstate.cpp index 3f69f145b..71ceb1f20 100644 --- a/src/core/statemachine/qabstractstate.cpp +++ b/src/core/statemachine/qabstractstate.cpp @@ -202,14 +202,6 @@ QStateMachine *QAbstractState::machine() const been called). */ -/*! - \reimp -*/ -bool QAbstractState::event(QEvent *e) -{ - return QObject::event(e); -} - #include "moc_qabstractstate.h" QT_END_NAMESPACE diff --git a/src/core/statemachine/qabstractstate.h b/src/core/statemachine/qabstractstate.h index 23ea01037..cfa07c116 100644 --- a/src/core/statemachine/qabstractstate.h +++ b/src/core/statemachine/qabstractstate.h @@ -76,8 +76,6 @@ protected: virtual void onEntry(QEvent *event) = 0; virtual void onExit(QEvent *event) = 0; - bool event(QEvent *e); - protected: QAbstractState(QAbstractStatePrivate &dd, QState *parent); diff --git a/src/core/statemachine/qeventtransition.cpp b/src/core/statemachine/qeventtransition.cpp index 87707fceb..1a9f26bcd 100644 --- a/src/core/statemachine/qeventtransition.cpp +++ b/src/core/statemachine/qeventtransition.cpp @@ -247,14 +247,6 @@ void QEventTransition::onTransition(QEvent *event) Q_UNUSED(event); } -/*! - \reimp -*/ -bool QEventTransition::event(QEvent *e) -{ - return QAbstractTransition::event(e); -} - QT_END_NAMESPACE #include "moc_qeventtransition.h" diff --git a/src/core/statemachine/qeventtransition.h b/src/core/statemachine/qeventtransition.h index d4debdcf3..b6684c87e 100644 --- a/src/core/statemachine/qeventtransition.h +++ b/src/core/statemachine/qeventtransition.h @@ -73,8 +73,6 @@ protected: bool eventTest(QEvent *event); void onTransition(QEvent *event); - bool event(QEvent *e); - protected: QEventTransition(QEventTransitionPrivate &dd, QState *parent); QEventTransition(QEventTransitionPrivate &dd, QObject *object, diff --git a/src/core/statemachine/qfinalstate.cpp b/src/core/statemachine/qfinalstate.cpp index 708c473d5..116aba0f3 100644 --- a/src/core/statemachine/qfinalstate.cpp +++ b/src/core/statemachine/qfinalstate.cpp @@ -127,14 +127,6 @@ void QFinalState::onExit(QEvent *event) Q_UNUSED(event); } -/*! - \reimp -*/ -bool QFinalState::event(QEvent *e) -{ - return QAbstractState::event(e); -} - #include "moc_qfinalstate.h" QT_END_NAMESPACE diff --git a/src/core/statemachine/qfinalstate.h b/src/core/statemachine/qfinalstate.h index c207435cf..1ef1b3a24 100644 --- a/src/core/statemachine/qfinalstate.h +++ b/src/core/statemachine/qfinalstate.h @@ -63,8 +63,6 @@ protected: void onEntry(QEvent *event); void onExit(QEvent *event); - bool event(QEvent *e); - private: Q_DISABLE_COPY(QFinalState) Q_DECLARE_PRIVATE(QFinalState) diff --git a/src/core/statemachine/qhistorystate.cpp b/src/core/statemachine/qhistorystate.cpp index abc8435aa..7c4a03ea4 100644 --- a/src/core/statemachine/qhistorystate.cpp +++ b/src/core/statemachine/qhistorystate.cpp @@ -217,14 +217,6 @@ void QHistoryState::onExit(QEvent *event) Q_UNUSED(event); } -/*! - \reimp -*/ -bool QHistoryState::event(QEvent *e) -{ - return QAbstractState::event(e); -} - #include "moc_qhistorystate.h" QT_END_NAMESPACE diff --git a/src/core/statemachine/qhistorystate.h b/src/core/statemachine/qhistorystate.h index ad9143ba2..c6435c193 100644 --- a/src/core/statemachine/qhistorystate.h +++ b/src/core/statemachine/qhistorystate.h @@ -78,8 +78,6 @@ protected: void onEntry(QEvent *event); void onExit(QEvent *event); - bool event(QEvent *e); - private: Q_DISABLE_COPY(QHistoryState) Q_DECLARE_PRIVATE(QHistoryState) diff --git a/src/core/statemachine/qsignaltransition.cpp b/src/core/statemachine/qsignaltransition.cpp index 3852d6bd4..da4808e24 100644 --- a/src/core/statemachine/qsignaltransition.cpp +++ b/src/core/statemachine/qsignaltransition.cpp @@ -236,14 +236,6 @@ void QSignalTransition::onTransition(QEvent *event) Q_UNUSED(event); } -/*! - \reimp -*/ -bool QSignalTransition::event(QEvent *e) -{ - return QAbstractTransition::event(e); -} - void QSignalTransitionPrivate::callOnTransition(QEvent *e) { Q_Q(QSignalTransition); diff --git a/src/core/statemachine/qsignaltransition.h b/src/core/statemachine/qsignaltransition.h index f1fba181a..2b83a60ee 100644 --- a/src/core/statemachine/qsignaltransition.h +++ b/src/core/statemachine/qsignaltransition.h @@ -73,8 +73,6 @@ protected: bool eventTest(QEvent *event); void onTransition(QEvent *event); - bool event(QEvent *e); - private: Q_DISABLE_COPY(QSignalTransition) Q_DECLARE_PRIVATE(QSignalTransition) diff --git a/src/core/thread/qwaitcondition.h b/src/core/thread/qwaitcondition.h index 6fc48f541..8c0fcb2a5 100644 --- a/src/core/thread/qwaitcondition.h +++ b/src/core/thread/qwaitcondition.h @@ -85,9 +85,9 @@ public: bool wait(QMutex *mutex, unsigned long time = ULONG_MAX) { - Q_UNUSED(mutex); - Q_UNUSED(time); - return true; + Q_UNUSED(mutex); + Q_UNUSED(time); + return true; } void wakeOne() {} diff --git a/src/core/tools/qbytearray.cpp b/src/core/tools/qbytearray.cpp index 69a536b76..59d901a5a 100644 --- a/src/core/tools/qbytearray.cpp +++ b/src/core/tools/qbytearray.cpp @@ -135,10 +135,10 @@ char *qstrcpy(char *dst, const char *src) return 0; #if defined(_MSC_VER) && _MSC_VER >= 1400 int len = qstrlen(src); - // This is actually not secure!!! It will be fixed - // properly in a later release! + // This is actually not secure!!! It will be fixed + // properly in a later release! if (len >= 0 && strcpy_s(dst, len+1, src) == 0) - return dst; + return dst; return 0; #else return strcpy(dst, src); diff --git a/src/core/tools/qelapsedtimer_generic.cpp b/src/core/tools/qelapsedtimer_generic.cpp index 712de7768..9a8413658 100644 --- a/src/core/tools/qelapsedtimer_generic.cpp +++ b/src/core/tools/qelapsedtimer_generic.cpp @@ -159,8 +159,7 @@ qint64 QElapsedTimer::msecsSinceReference() const */ qint64 QElapsedTimer::msecsTo(const QElapsedTimer &other) const { - qint64 diff = other.t1 - t1; - return diff; + return other.t1 - t1; } /*! diff --git a/src/core/tools/qelapsedtimer_unix.cpp b/src/core/tools/qelapsedtimer_unix.cpp index 8f1644420..4809c1925 100644 --- a/src/core/tools/qelapsedtimer_unix.cpp +++ b/src/core/tools/qelapsedtimer_unix.cpp @@ -66,18 +66,13 @@ static int monotonicClockChecked = false; static int monotonicClockAvailable = false; #endif -#ifdef Q_CC_GNU -# define is_likely(x) __builtin_expect((x), 1) -#else -# define is_likely(x) (x) -#endif #define load_acquire(x) ((volatile const int&)(x)) #define store_release(x,v) ((volatile int&)(x) = (v)) -static void unixCheckClockType() +static inline void unixCheckClockType() { #if (_POSIX_MONOTONIC_CLOCK-0 == 0) - if (is_likely(load_acquire(monotonicClockChecked))) + if (Q_LIKELY(load_acquire(monotonicClockChecked))) return; # if defined(_SC_MONOTONIC_CLOCK) @@ -122,7 +117,7 @@ static inline void do_gettime(qint64 *sec, qint64 *frac) { #if (_POSIX_MONOTONIC_CLOCK-0 >= 0) unixCheckClockType(); - if (is_likely(monotonicClockAvailable)) { + if (Q_LIKELY(monotonicClockAvailable)) { timespec ts; clock_gettime(CLOCK_MONOTONIC, &ts); *sec = ts.tv_sec; diff --git a/src/dbus/qdbusconnection_p.h b/src/dbus/qdbusconnection_p.h index 656c69946..43ea6cad8 100644 --- a/src/dbus/qdbusconnection_p.h +++ b/src/dbus/qdbusconnection_p.h @@ -64,7 +64,6 @@ #include #include #include -#include #include #include diff --git a/src/dbus/qdbuserror.cpp b/src/dbus/qdbuserror.cpp index 5318b9bdc..12cc10247 100644 --- a/src/dbus/qdbuserror.cpp +++ b/src/dbus/qdbuserror.cpp @@ -42,7 +42,6 @@ #include "qdbuserror.h" #include -#include #include "qdbusmessage.h" #include "qdbusmessage_p.h" diff --git a/src/declarative/qml/qdeclarativecontext.cpp b/src/declarative/qml/qdeclarativecontext.cpp index 4cf766471..e28a399e1 100644 --- a/src/declarative/qml/qdeclarativecontext.cpp +++ b/src/declarative/qml/qdeclarativecontext.cpp @@ -50,8 +50,7 @@ #include "qdeclarativeglobalscriptclass_p.h" #include -#include -#include +#include #include diff --git a/src/declarative/qml/qdeclarativevme_p.h b/src/declarative/qml/qdeclarativevme_p.h index cc5e07467..a730d84c7 100644 --- a/src/declarative/qml/qdeclarativevme_p.h +++ b/src/declarative/qml/qdeclarativevme_p.h @@ -57,7 +57,6 @@ #include #include -#include QT_BEGIN_NAMESPACE diff --git a/src/gui/accessible/qaccessibleobject.cpp b/src/gui/accessible/qaccessibleobject.cpp index 9a99b3c56..0fe73fc8e 100644 --- a/src/gui/accessible/qaccessibleobject.cpp +++ b/src/gui/accessible/qaccessibleobject.cpp @@ -47,7 +47,6 @@ #include "qwidget.h" #include "qpointer.h" #include "qmetaobject.h" -#include "qvarlengtharray.h" QT_BEGIN_NAMESPACE diff --git a/src/gui/dialogs/qfiledialog_mac.mm b/src/gui/dialogs/qfiledialog_mac.mm index 8e714c2b7..2fbdaaa6d 100644 --- a/src/gui/dialogs/qfiledialog_mac.mm +++ b/src/gui/dialogs/qfiledialog_mac.mm @@ -59,7 +59,6 @@ #include #include #include -#include #include #include #include diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp index 423af2c6b..89f811931 100644 --- a/src/gui/graphicsview/qgraphicsitem.cpp +++ b/src/gui/graphicsview/qgraphicsitem.cpp @@ -733,7 +733,6 @@ #include #include #include -#include #include #include #include diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp index 6c68e24cc..a3dc21093 100644 --- a/src/gui/graphicsview/qgraphicsscene.cpp +++ b/src/gui/graphicsview/qgraphicsscene.cpp @@ -227,7 +227,6 @@ #include #include #include -#include #include #include #include diff --git a/src/gui/image/qpixmapfilter.cpp b/src/gui/image/qpixmapfilter.cpp index 9d9d7a750..f9cea1d4e 100644 --- a/src/gui/image/qpixmapfilter.cpp +++ b/src/gui/image/qpixmapfilter.cpp @@ -46,7 +46,6 @@ #include "qpainter.h" #include "qpixmap.h" #include "qpixmapfilter_p.h" -#include "qvarlengtharray.h" #include "qapplication_p.h" #include "qgraphicssystem_p.h" diff --git a/src/gui/painting/qpaintengine_mac.cpp b/src/gui/painting/qpaintengine_mac.cpp index 84667c99d..c73691e2e 100644 --- a/src/gui/painting/qpaintengine_mac.cpp +++ b/src/gui/painting/qpaintengine_mac.cpp @@ -50,7 +50,6 @@ #include #include #include -#include #include #include #include diff --git a/src/gui/painting/qpathclipper.cpp b/src/gui/painting/qpathclipper.cpp index ffa743703..b7dccb1dd 100644 --- a/src/gui/painting/qpathclipper.cpp +++ b/src/gui/painting/qpathclipper.cpp @@ -42,7 +42,6 @@ #include "qpathclipper_p.h" #include -#include #include #include diff --git a/src/gui/painting/qrasterizer.cpp b/src/gui/painting/qrasterizer.cpp index 4c92e4485..39c7bed28 100644 --- a/src/gui/painting/qrasterizer.cpp +++ b/src/gui/painting/qrasterizer.cpp @@ -188,8 +188,7 @@ private: QDataBuffer m_active; - template - friend void qScanConvert(QScanConverter &d, T allVertical); + friend void qScanConvert(QScanConverter &d, bool allVertical); }; class QRasterizerPrivate @@ -271,7 +270,7 @@ void QScanConverter::emitSpans(int chunk) // split control points b[0] ... b[3] into // left (b[0] ... b[3]) and right (b[3] ... b[6]) -static void split(QT_FT_Vector *b) +static inline void split(QT_FT_Vector *b) { b[6] = b[3]; @@ -305,18 +304,8 @@ static inline bool xOrder(const QScanConverter::Line *a, const QScanConverter::L return a->x < b->x; } -template -struct QBoolToType -{ - inline bool operator()() const - { - return B; - } -}; - // should be a member function but VC6 doesn't support member template functions -template -void qScanConvert(QScanConverter &d, T allVertical) +void qScanConvert(QScanConverter &d, bool allVertical) { if (!d.m_lines.size()) { d.m_active.reset(); @@ -327,7 +316,7 @@ void qScanConvert(QScanConverter &d, T allVertical) for (int y = d.m_lines.first().top; y <= d.m_bottom; ++y) { for (; line < d.m_lines.size() && d.m_lines.at(line).top == y; ++line) { // add node to active list - if (allVertical()) { + if (allVertical) { QScanConverter::Line *l = &d.m_lines.at(line); d.m_active.resize(d.m_active.size() + 1); int j; @@ -340,7 +329,7 @@ void qScanConvert(QScanConverter &d, T allVertical) } int numActive = d.m_active.size(); - if (!allVertical()) { + if (!allVertical) { // use insertion sort instead of qSort, as the active edge list is quite small // and in the average case already sorted for (int i = 1; i < numActive; ++i) { @@ -371,7 +360,7 @@ void qScanConvert(QScanConverter &d, T allVertical) d.m_active.resize(--numActive); --i; - } else if (!allVertical()) + } else if (!allVertical) node->x += node->delta; } } @@ -391,10 +380,7 @@ void QScanConverter::end() break; } } - if (allVertical) - qScanConvert(*this, QBoolToType()); - else - qScanConvert(*this, QBoolToType()); + qScanConvert(*this, allVertical); } else { for (int chunkTop = m_top; chunkTop <= m_bottom; chunkTop += CHUNK_SIZE) { prepareChunk(); diff --git a/src/gui/text/qfontdatabase.cpp b/src/gui/text/qfontdatabase.cpp index 1226b8519..9d668b377 100644 --- a/src/gui/text/qfontdatabase.cpp +++ b/src/gui/text/qfontdatabase.cpp @@ -44,7 +44,6 @@ #include "qdebug.h" #include "qalgorithms.h" #include "qapplication.h" -#include "qvarlengtharray.h" // here or earlier - workaround for VC++6 #include "qthread.h" #include "qmutex.h" #include "qunicodetables_p.h" diff --git a/src/gui/text/qfontengine_win.cpp b/src/gui/text/qfontengine_win.cpp index b538e81c0..ed7c9fc44 100644 --- a/src/gui/text/qfontengine_win.cpp +++ b/src/gui/text/qfontengine_win.cpp @@ -64,7 +64,6 @@ #include #include "qpaintengine.h" -#include "qvarlengtharray.h" #include #include diff --git a/src/gui/text/qfontengineglyphcache_p.h b/src/gui/text/qfontengineglyphcache_p.h index 5b7b77941..409edcbd3 100644 --- a/src/gui/text/qfontengineglyphcache_p.h +++ b/src/gui/text/qfontengineglyphcache_p.h @@ -56,7 +56,6 @@ #include "QtCore/qglobal.h" #include "QtCore/qatomic.h" -#include #include "qfont_p.h" #ifdef Q_WS_WIN diff --git a/src/gui/text/qtextdocumentfragment_p.h b/src/gui/text/qtextdocumentfragment_p.h index 83c16c82f..add332ad8 100644 --- a/src/gui/text/qtextdocumentfragment_p.h +++ b/src/gui/text/qtextdocumentfragment_p.h @@ -61,7 +61,6 @@ #include "QtCore/qlist.h" #include "QtCore/qmap.h" #include "QtCore/qpointer.h" -#include "QtCore/qvarlengtharray.h" #include "QtCore/qdatastream.h" QT_BEGIN_NAMESPACE diff --git a/src/gui/widgets/qmainwindowlayout.cpp b/src/gui/widgets/qmainwindowlayout.cpp index 748e8109b..9fe333ada 100644 --- a/src/gui/widgets/qmainwindowlayout.cpp +++ b/src/gui/widgets/qmainwindowlayout.cpp @@ -59,7 +59,6 @@ #include #include #include -#include #include #include #include diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp index f024149a6..3ca63ab0d 100644 --- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp +++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp @@ -77,7 +77,6 @@ #include #include #include -#include #include #include diff --git a/src/opengl/gl2paintengineex/qtriangulator.cpp b/src/opengl/gl2paintengineex/qtriangulator.cpp index 75a225ef9..5dcb995bc 100644 --- a/src/opengl/gl2paintengineex/qtriangulator.cpp +++ b/src/opengl/gl2paintengineex/qtriangulator.cpp @@ -46,8 +46,7 @@ #include #include #include -// FIXME: generate -#include +#include #include #include #include diff --git a/src/opengl/qgl_wince.cpp b/src/opengl/qgl_wince.cpp index 52afa108f..10360d586 100644 --- a/src/opengl/qgl_wince.cpp +++ b/src/opengl/qgl_wince.cpp @@ -47,7 +47,6 @@ #include #include #include -#include #include #include #include