diff options
author | Ritt Konstantin <ritt.ks@gmail.com> | 2009-06-08 08:42:42 (GMT) |
---|---|---|
committer | Marius Storm-Olsen <marius@trolltech.com> | 2009-06-08 08:43:01 (GMT) |
commit | eb8789ba06949974eb4108b115a30f96e1500a81 (patch) | |
tree | 523aa4541353053454fb3fd307aee4a742653827 /src/corelib | |
parent | ac30cbdceac428fa206a939e5d820b2bd77227fc (diff) | |
download | Qt-eb8789ba06949974eb4108b115a30f96e1500a81.zip Qt-eb8789ba06949974eb4108b115a30f96e1500a81.tar.gz Qt-eb8789ba06949974eb4108b115a30f96e1500a81.tar.bz2 |
Fix QT_NO_DATASTREAM macro checks and improve readability
Some checks where in the wrong locations, and some endifs where
hard to read.
Merge-request: 611
Reviewed-by: Marius Storm-Olsen <marius@trolltech.com>
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/io/qdatastream.h | 3 | ||||
-rw-r--r-- | src/corelib/kernel/qmetatype.cpp | 4 | ||||
-rw-r--r-- | src/corelib/kernel/qmetatype.h | 2 | ||||
-rw-r--r-- | src/corelib/plugin/quuid.cpp | 2 | ||||
-rw-r--r-- | src/corelib/tools/qbitarray.cpp | 5 | ||||
-rw-r--r-- | src/corelib/tools/qbytearray.cpp | 5 | ||||
-rw-r--r-- | src/corelib/tools/qchar.cpp | 2 | ||||
-rw-r--r-- | src/corelib/tools/qlocale.cpp | 2 | ||||
-rw-r--r-- | src/corelib/tools/qregexp.cpp | 2 | ||||
-rw-r--r-- | src/corelib/tools/qsize.h | 4 |
10 files changed, 18 insertions, 13 deletions
diff --git a/src/corelib/io/qdatastream.h b/src/corelib/io/qdatastream.h index ec5780c..077e720 100644 --- a/src/corelib/io/qdatastream.h +++ b/src/corelib/io/qdatastream.h @@ -65,9 +65,8 @@ template <typename T> class QSet; template <class Key, class T> class QHash; template <class Key, class T> class QMap; -class QDataStreamPrivate; - #ifndef QT_NO_DATASTREAM +class QDataStreamPrivate; class Q_CORE_EXPORT QDataStream { public: diff --git a/src/corelib/kernel/qmetatype.cpp b/src/corelib/kernel/qmetatype.cpp index a0b954f..6b40f46 100644 --- a/src/corelib/kernel/qmetatype.cpp +++ b/src/corelib/kernel/qmetatype.cpp @@ -360,7 +360,7 @@ void QMetaType::registerStreamOperators(const char *typeName, SaveOperator saveO inf.saveOp = saveOp; inf.loadOp = loadOp; } -#endif +#endif // QT_NO_DATASTREAM /*! Returns the type name associated with the given \a type, or 0 if no @@ -885,7 +885,7 @@ bool QMetaType::load(QDataStream &stream, int type, void *data) } return true; } -#endif +#endif // QT_NO_DATASTREAM /*! Returns a copy of \a copy, assuming it is of type \a type. If \a diff --git a/src/corelib/kernel/qmetatype.h b/src/corelib/kernel/qmetatype.h index be8a667..22214a4 100644 --- a/src/corelib/kernel/qmetatype.h +++ b/src/corelib/kernel/qmetatype.h @@ -183,7 +183,7 @@ void qRegisterMetaTypeStreamOperators(const char *typeName QMetaType::registerStreamOperators(typeName, reinterpret_cast<QMetaType::SaveOperator>(sptr), reinterpret_cast<QMetaType::LoadOperator>(lptr)); } -#endif +#endif // QT_NO_DATASTREAM template <typename T> struct QMetaTypeId diff --git a/src/corelib/plugin/quuid.cpp b/src/corelib/plugin/quuid.cpp index 3e05d28..cee8bf7 100644 --- a/src/corelib/plugin/quuid.cpp +++ b/src/corelib/plugin/quuid.cpp @@ -405,7 +405,7 @@ QDataStream &operator>>(QDataStream &s, QUuid &id) } return s; } -#endif +#endif // QT_NO_DATASTREAM /*! Returns true if this is the null UUID diff --git a/src/corelib/tools/qbitarray.cpp b/src/corelib/tools/qbitarray.cpp index a947ab5..591cfa9 100644 --- a/src/corelib/tools/qbitarray.cpp +++ b/src/corelib/tools/qbitarray.cpp @@ -653,6 +653,7 @@ QBitArray operator^(const QBitArray &a1, const QBitArray &a2) QBitArray stream functions *****************************************************************************/ +#ifndef QT_NO_DATASTREAM /*! \relates QBitArray @@ -660,7 +661,7 @@ QBitArray operator^(const QBitArray &a1, const QBitArray &a2) \sa \link datastreamformat.html Format of the QDataStream operators \endlink */ -#ifndef QT_NO_DATASTREAM + QDataStream &operator<<(QDataStream &out, const QBitArray &ba) { quint32 len = ba.size(); @@ -713,7 +714,7 @@ QDataStream &operator>>(QDataStream &in, QBitArray &ba) *ba.d.data() = ba.d.size() * 8 - len; return in; } -#endif +#endif // QT_NO_DATASTREAM /*! \fn DataPtr &QBitArray::data_ptr() diff --git a/src/corelib/tools/qbytearray.cpp b/src/corelib/tools/qbytearray.cpp index 49dd52d..cbd9d4e 100644 --- a/src/corelib/tools/qbytearray.cpp +++ b/src/corelib/tools/qbytearray.cpp @@ -2591,6 +2591,8 @@ void QByteArray::clear() d->ref.ref(); } +#ifndef QT_NO_DATASTREAM + /*! \relates QByteArray Writes byte array \a ba to the stream \a out and returns a reference @@ -2598,7 +2600,6 @@ void QByteArray::clear() \sa {Format of the QDataStream operators} */ -#ifndef QT_NO_DATASTREAM QDataStream &operator<<(QDataStream &out, const QByteArray &ba) { @@ -2641,7 +2642,7 @@ QDataStream &operator>>(QDataStream &in, QByteArray &ba) return in; } -#endif //QT_NO_DATASTREAM +#endif // QT_NO_DATASTREAM /*! \fn bool QByteArray::operator==(const QString &str) const diff --git a/src/corelib/tools/qchar.cpp b/src/corelib/tools/qchar.cpp index a940cda..250dad0 100644 --- a/src/corelib/tools/qchar.cpp +++ b/src/corelib/tools/qchar.cpp @@ -1321,7 +1321,7 @@ QDataStream &operator>>(QDataStream &in, QChar &chr) chr.unicode() = ushort(u); return in; } -#endif +#endif // QT_NO_DATASTREAM /*! \fn ushort & QChar::unicode() diff --git a/src/corelib/tools/qlocale.cpp b/src/corelib/tools/qlocale.cpp index 8c740bd..00132d7 100644 --- a/src/corelib/tools/qlocale.cpp +++ b/src/corelib/tools/qlocale.cpp @@ -1533,7 +1533,7 @@ QDataStream &operator>>(QDataStream &ds, QLocale &l) l = QLocale(s); return ds; } -#endif +#endif // QT_NO_DATASTREAM /*! diff --git a/src/corelib/tools/qregexp.cpp b/src/corelib/tools/qregexp.cpp index e1c3921..9c62c7a 100644 --- a/src/corelib/tools/qregexp.cpp +++ b/src/corelib/tools/qregexp.cpp @@ -4065,6 +4065,6 @@ QDataStream &operator>>(QDataStream &in, QRegExp ®Exp) regExp = newRegExp; return in; } -#endif +#endif // QT_NO_DATASTREAM QT_END_NAMESPACE diff --git a/src/corelib/tools/qsize.h b/src/corelib/tools/qsize.h index 34a6c99..237625e 100644 --- a/src/corelib/tools/qsize.h +++ b/src/corelib/tools/qsize.h @@ -98,8 +98,10 @@ Q_DECLARE_TYPEINFO(QSize, Q_MOVABLE_TYPE); QSize stream functions *****************************************************************************/ +#ifndef QT_NO_DATASTREAM Q_CORE_EXPORT QDataStream &operator<<(QDataStream &, const QSize &); Q_CORE_EXPORT QDataStream &operator>>(QDataStream &, QSize &); +#endif /***************************************************************************** @@ -249,8 +251,10 @@ Q_DECLARE_TYPEINFO(QSizeF, Q_MOVABLE_TYPE); QSizeF stream functions *****************************************************************************/ +#ifndef QT_NO_DATASTREAM Q_CORE_EXPORT QDataStream &operator<<(QDataStream &, const QSizeF &); Q_CORE_EXPORT QDataStream &operator>>(QDataStream &, QSizeF &); +#endif /***************************************************************************** |