mirror of
https://bitbucket.org/smil3y/katie.git
synced 2025-02-25 11:22:58 +00:00
review qglobal header comments, style, etc.
Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
This commit is contained in:
parent
0b3cf6cc2a
commit
bb90a1d87b
1 changed files with 59 additions and 98 deletions
|
@ -83,7 +83,6 @@
|
||||||
https://gcc.gnu.org/backends.html
|
https://gcc.gnu.org/backends.html
|
||||||
https://en.wikipedia.org/wiki/GNU_Compiler_Collection#Architectures
|
https://en.wikipedia.org/wiki/GNU_Compiler_Collection#Architectures
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if defined(__alpha__)
|
#if defined(__alpha__)
|
||||||
# define QT_ARCH_ALPHA
|
# define QT_ARCH_ALPHA
|
||||||
#elif defined(__arm__)
|
#elif defined(__arm__)
|
||||||
|
@ -124,7 +123,7 @@
|
||||||
# error Unable to detect architecture, please update above list
|
# error Unable to detect architecture, please update above list
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// detect target endianness
|
// Detect target endianness
|
||||||
#if defined (__BYTE_ORDER__) && \
|
#if defined (__BYTE_ORDER__) && \
|
||||||
(__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ || __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
|
(__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ || __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
|
||||||
# define Q_BYTE_ORDER __BYTE_ORDER__
|
# define Q_BYTE_ORDER __BYTE_ORDER__
|
||||||
|
@ -248,18 +247,16 @@ QT_USE_NAMESPACE
|
||||||
# error "Katie has not been ported to this OS"
|
# error "Katie has not been ported to this OS"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(Q_OS_UNIX)
|
// Compatibility, used to be conditional
|
||||||
|
#define Q_WS_X11
|
||||||
#define Q_OS_UNIX
|
#define Q_OS_UNIX
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef __LSB_VERSION__
|
#if defined(__LSB_VERSION__)
|
||||||
# if __LSB_VERSION__ < 40
|
# if __LSB_VERSION__ < 40
|
||||||
# error "This version of the Linux Standard Base is unsupported"
|
# error "This version of the Linux Standard Base is unsupported"
|
||||||
# endif
|
# endif
|
||||||
#ifndef QT_LINUXBASE
|
|
||||||
# define QT_LINUXBASE
|
# define QT_LINUXBASE
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
The compiler, must be one of: (Q_CC_x)
|
The compiler, must be one of: (Q_CC_x)
|
||||||
|
@ -269,7 +266,6 @@ QT_USE_NAMESPACE
|
||||||
|
|
||||||
Should be sorted most to least authoritative.
|
Should be sorted most to least authoritative.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if defined(__GNUC__)
|
#if defined(__GNUC__)
|
||||||
# define Q_CC_GNU
|
# define Q_CC_GNU
|
||||||
# define Q_C_CALLBACKS
|
# define Q_C_CALLBACKS
|
||||||
|
@ -319,7 +315,6 @@ QT_USE_NAMESPACE
|
||||||
* http://isocpp.org/std/standing-documents/sd-6-sg10-feature-test-recommendations
|
* http://isocpp.org/std/standing-documents/sd-6-sg10-feature-test-recommendations
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#if defined(Q_CC_GNU)
|
#if defined(Q_CC_GNU)
|
||||||
# if defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L
|
# if defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L
|
||||||
/* C++0x features supported in GCC 4.3: */
|
/* C++0x features supported in GCC 4.3: */
|
||||||
|
@ -365,16 +360,6 @@ QT_USE_NAMESPACE
|
||||||
} AFUNC ## __dest_instance__;
|
} AFUNC ## __dest_instance__;
|
||||||
#define Q_DESTRUCTOR_FUNCTION(AFUNC) Q_DESTRUCTOR_FUNCTION0(AFUNC)
|
#define Q_DESTRUCTOR_FUNCTION(AFUNC) Q_DESTRUCTOR_FUNCTION0(AFUNC)
|
||||||
|
|
||||||
/*
|
|
||||||
The window system, must be one of: (Q_WS_x)
|
|
||||||
|
|
||||||
X11 - X Window System
|
|
||||||
*/
|
|
||||||
|
|
||||||
#if defined(Q_OS_UNIX)
|
|
||||||
# define Q_WS_X11
|
|
||||||
#endif
|
|
||||||
|
|
||||||
QT_BEGIN_HEADER
|
QT_BEGIN_HEADER
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
|
@ -383,7 +368,6 @@ QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
Make sure to update QMetaType when changing these typedefs
|
Make sure to update QMetaType when changing these typedefs
|
||||||
*/
|
*/
|
||||||
|
|
||||||
typedef signed char qint8; /* 8 bit signed */
|
typedef signed char qint8; /* 8 bit signed */
|
||||||
typedef unsigned char quint8; /* 8 bit unsigned */
|
typedef unsigned char quint8; /* 8 bit unsigned */
|
||||||
typedef short qint16; /* 16 bit signed */
|
typedef short qint16; /* 16 bit signed */
|
||||||
|
@ -413,7 +397,6 @@ typedef quint64 qulonglong;
|
||||||
/*
|
/*
|
||||||
Useful type definitions for Qt
|
Useful type definitions for Qt
|
||||||
*/
|
*/
|
||||||
|
|
||||||
typedef std::uintptr_t quintptr;
|
typedef std::uintptr_t quintptr;
|
||||||
typedef std::ptrdiff_t qptrdiff;
|
typedef std::ptrdiff_t qptrdiff;
|
||||||
|
|
||||||
|
@ -434,7 +417,7 @@ QT_END_INCLUDE_NAMESPACE
|
||||||
#else
|
#else
|
||||||
# define Q_DECL_DEPRECATED
|
# define Q_DECL_DEPRECATED
|
||||||
#endif
|
#endif
|
||||||
#ifndef Q_DECL_CONSTRUCTOR_DEPRECATED
|
|
||||||
#if defined(Q_MOC_RUN)
|
#if defined(Q_MOC_RUN)
|
||||||
# define Q_DECL_CONSTRUCTOR_DEPRECATED Q_DECL_CONSTRUCTOR_DEPRECATED
|
# define Q_DECL_CONSTRUCTOR_DEPRECATED Q_DECL_CONSTRUCTOR_DEPRECATED
|
||||||
#elif defined(Q_NO_DEPRECATED_CONSTRUCTORS)
|
#elif defined(Q_NO_DEPRECATED_CONSTRUCTORS)
|
||||||
|
@ -442,10 +425,8 @@ QT_END_INCLUDE_NAMESPACE
|
||||||
#else
|
#else
|
||||||
# define Q_DECL_CONSTRUCTOR_DEPRECATED Q_DECL_DEPRECATED
|
# define Q_DECL_CONSTRUCTOR_DEPRECATED Q_DECL_DEPRECATED
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(QT_NO_DEPRECATED)
|
#if defined(QT_NO_DEPRECATED)
|
||||||
/* disable Qt3 support as well */
|
|
||||||
# undef QT3_SUPPORT_WARNINGS
|
# undef QT3_SUPPORT_WARNINGS
|
||||||
# undef QT3_SUPPORT
|
# undef QT3_SUPPORT
|
||||||
# undef QT_DEPRECATED
|
# undef QT_DEPRECATED
|
||||||
|
@ -495,7 +476,6 @@ typedef double qreal;
|
||||||
/*
|
/*
|
||||||
Utility macros and inline functions
|
Utility macros and inline functions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
Q_DECL_CONSTEXPR inline T qAbs(const T &t) { return t >= 0 ? t : -t; }
|
Q_DECL_CONSTEXPR inline T qAbs(const T &t) { return t >= 0 ? t : -t; }
|
||||||
|
|
||||||
|
@ -507,7 +487,6 @@ template <typename T>
|
||||||
Q_DECL_CONSTEXPR inline const T &qBound(const T &min, const T &val, const T &max)
|
Q_DECL_CONSTEXPR inline const T &qBound(const T &min, const T &val, const T &max)
|
||||||
{ return qMax(min, qMin(max, val)); }
|
{ return qMax(min, qMin(max, val)); }
|
||||||
|
|
||||||
#ifndef Q_DECL_EXPORT
|
|
||||||
#if defined(QT_VISIBILITY_AVAILABLE)
|
#if defined(QT_VISIBILITY_AVAILABLE)
|
||||||
# define Q_DECL_EXPORT __attribute__((visibility("default")))
|
# define Q_DECL_EXPORT __attribute__((visibility("default")))
|
||||||
# define Q_DECL_HIDDEN __attribute__((visibility("hidden")))
|
# define Q_DECL_HIDDEN __attribute__((visibility("hidden")))
|
||||||
|
@ -516,9 +495,7 @@ Q_DECL_CONSTEXPR inline const T &qBound(const T &min, const T &val, const T &max
|
||||||
# define Q_DECL_HIDDEN
|
# define Q_DECL_HIDDEN
|
||||||
#endif
|
#endif
|
||||||
#define Q_DECL_IMPORT
|
#define Q_DECL_IMPORT
|
||||||
#endif
|
|
||||||
|
|
||||||
#if !defined(Q_CORE_EXPORT)
|
|
||||||
#if defined(QT_SHARED)
|
#if defined(QT_SHARED)
|
||||||
# define Q_CORE_EXPORT Q_DECL_EXPORT
|
# define Q_CORE_EXPORT Q_DECL_EXPORT
|
||||||
# define Q_GUI_EXPORT Q_DECL_EXPORT
|
# define Q_GUI_EXPORT Q_DECL_EXPORT
|
||||||
|
@ -546,7 +523,6 @@ Q_DECL_CONSTEXPR inline const T &qBound(const T &min, const T &val, const T &max
|
||||||
# define Q_DBUS_EXPORT
|
# define Q_DBUS_EXPORT
|
||||||
# define Q_UITOOLS_EXPORT
|
# define Q_UITOOLS_EXPORT
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
|
|
||||||
#define Q_CORE_EXPORT_INLINE Q_CORE_EXPORT inline
|
#define Q_CORE_EXPORT_INLINE Q_CORE_EXPORT inline
|
||||||
#define Q_GUI_EXPORT_INLINE Q_GUI_EXPORT inline
|
#define Q_GUI_EXPORT_INLINE Q_GUI_EXPORT inline
|
||||||
|
@ -570,7 +546,6 @@ inline void qt_noop(void) {}
|
||||||
If you can't live with that constraint, don't use these macros.
|
If you can't live with that constraint, don't use these macros.
|
||||||
Use the QT_NO_EXCEPTIONS macro to protect your code instead.
|
Use the QT_NO_EXCEPTIONS macro to protect your code instead.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if !defined(QT_NO_EXCEPTIONS) && !defined(Q_COMPILER_EXCEPTIONS) && !defined(Q_MOC_RUN)
|
#if !defined(QT_NO_EXCEPTIONS) && !defined(Q_COMPILER_EXCEPTIONS) && !defined(Q_MOC_RUN)
|
||||||
# define QT_NO_EXCEPTIONS
|
# define QT_NO_EXCEPTIONS
|
||||||
#endif
|
#endif
|
||||||
|
@ -590,7 +565,6 @@ inline void qt_noop(void) {}
|
||||||
/*
|
/*
|
||||||
System information
|
System information
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class Q_CORE_EXPORT QSysInfo {
|
class Q_CORE_EXPORT QSysInfo {
|
||||||
public:
|
public:
|
||||||
enum Sizes {
|
enum Sizes {
|
||||||
|
@ -615,13 +589,11 @@ Q_CORE_EXPORT bool qSharedBuild();
|
||||||
/*
|
/*
|
||||||
Avoid "unused parameter" warnings
|
Avoid "unused parameter" warnings
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define Q_UNUSED(x) (void)x;
|
#define Q_UNUSED(x) (void)x;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Debugging and error handling
|
Debugging and error handling
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if (defined(QT_NO_DEBUG_OUTPUT) || defined(QT_NO_TEXTSTREAM)) && !defined(QT_NO_DEBUG_STREAM)
|
#if (defined(QT_NO_DEBUG_OUTPUT) || defined(QT_NO_TEXTSTREAM)) && !defined(QT_NO_DEBUG_STREAM)
|
||||||
# define QT_NO_DEBUG_STREAM
|
# define QT_NO_DEBUG_STREAM
|
||||||
#endif
|
#endif
|
||||||
|
@ -658,23 +630,19 @@ Q_CORE_EXPORT void qErrnoWarning(const char *msg, ...);
|
||||||
|
|
||||||
Q_CORE_EXPORT void qt_assert(const char *assertion, const char *file, int line);
|
Q_CORE_EXPORT void qt_assert(const char *assertion, const char *file, int line);
|
||||||
|
|
||||||
#if !defined(Q_ASSERT)
|
|
||||||
#ifndef QT_NO_DEBUG
|
#ifndef QT_NO_DEBUG
|
||||||
# define Q_ASSERT(cond) ((!(cond)) ? qt_assert(#cond,__FILE__,__LINE__) : qt_noop())
|
# define Q_ASSERT(cond) ((!(cond)) ? qt_assert(#cond,__FILE__,__LINE__) : qt_noop())
|
||||||
#else
|
#else
|
||||||
# define Q_ASSERT(cond) qt_noop()
|
# define Q_ASSERT(cond) qt_noop()
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
|
|
||||||
Q_CORE_EXPORT void qt_assert_x(const char *where, const char *what, const char *file, int line);
|
Q_CORE_EXPORT void qt_assert_x(const char *where, const char *what, const char *file, int line);
|
||||||
|
|
||||||
#if !defined(Q_ASSERT_X)
|
|
||||||
#ifndef QT_NO_DEBUG
|
#ifndef QT_NO_DEBUG
|
||||||
# define Q_ASSERT_X(cond, where, what) ((!(cond)) ? qt_assert_x(where, what,__FILE__,__LINE__) : qt_noop())
|
# define Q_ASSERT_X(cond, where, what) ((!(cond)) ? qt_assert_x(where, what,__FILE__,__LINE__) : qt_noop())
|
||||||
#else
|
#else
|
||||||
# define Q_ASSERT_X(cond, where, what) qt_noop()
|
# define Q_ASSERT_X(cond, where, what) qt_noop()
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
|
|
||||||
Q_CORE_EXPORT void qt_check_pointer(const char *, int);
|
Q_CORE_EXPORT void qt_check_pointer(const char *, int);
|
||||||
Q_CORE_EXPORT void qBadAlloc();
|
Q_CORE_EXPORT void qBadAlloc();
|
||||||
|
@ -745,9 +713,9 @@ public:
|
||||||
return thisGlobalStatic.pointer; \
|
return thisGlobalStatic.pointer; \
|
||||||
}
|
}
|
||||||
|
|
||||||
#else
|
#else // QT_NO_THREAD
|
||||||
|
|
||||||
// forward declaration, since qatomic.h needs qglobal.h
|
// Forward declaration, since qatomic.h needs qglobal.h
|
||||||
template <typename T> class QAtomicPointer;
|
template <typename T> class QAtomicPointer;
|
||||||
|
|
||||||
// POD for Q_GLOBAL_STATIC
|
// POD for Q_GLOBAL_STATIC
|
||||||
|
@ -824,7 +792,7 @@ public:
|
||||||
return this__StaticVar_.pointer; \
|
return this__StaticVar_.pointer; \
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif // QT_NO_THREAD
|
||||||
|
|
||||||
Q_DECL_CONSTEXPR static inline bool qFuzzyCompare(double p1, double p2)
|
Q_DECL_CONSTEXPR static inline bool qFuzzyCompare(double p1, double p2)
|
||||||
{
|
{
|
||||||
|
@ -892,7 +860,6 @@ static inline bool qIsNull(float f)
|
||||||
Just in case other code relies on it we better trigger a warning
|
Just in case other code relies on it we better trigger a warning
|
||||||
mandating a real implementation.
|
mandating a real implementation.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef Q_FULL_TEMPLATE_INSTANTIATION
|
#ifdef Q_FULL_TEMPLATE_INSTANTIATION
|
||||||
# define Q_DUMMY_COMPARISON_OPERATOR(C) \
|
# define Q_DUMMY_COMPARISON_OPERATOR(C) \
|
||||||
bool operator==(const C&) const { \
|
bool operator==(const C&) const { \
|
||||||
|
@ -903,11 +870,9 @@ static inline bool qIsNull(float f)
|
||||||
# define Q_DUMMY_COMPARISON_OPERATOR(C)
|
# define Q_DUMMY_COMPARISON_OPERATOR(C)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
QTypeInfo - type trait functionality
|
QTypeInfo - type trait functionality
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
class QTypeInfo
|
class QTypeInfo
|
||||||
{
|
{
|
||||||
|
@ -964,8 +929,6 @@ public: \
|
||||||
template<> \
|
template<> \
|
||||||
Q_DECLARE_TYPEINFO_BODY(TYPE, FLAGS)
|
Q_DECLARE_TYPEINFO_BODY(TYPE, FLAGS)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
inline void qSwap(T &value1, T &value2)
|
inline void qSwap(T &value1, T &value2)
|
||||||
{
|
{
|
||||||
|
@ -1014,7 +977,6 @@ Q_DECLARE_TYPEINFO(long double, Q_PRIMITIVE_TYPE);
|
||||||
These functions make it possible to use standard C++ functions with
|
These functions make it possible to use standard C++ functions with
|
||||||
a similar name from Qt header files (especially template classes).
|
a similar name from Qt header files (especially template classes).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class Q_CORE_EXPORT QFlag
|
class Q_CORE_EXPORT QFlag
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
@ -1110,7 +1072,7 @@ private:
|
||||||
#define Q_FOREACH(variable, container) \
|
#define Q_FOREACH(variable, container) \
|
||||||
for (variable: QForeachContainer<Q_TYPEOF(container)>(container))
|
for (variable: QForeachContainer<Q_TYPEOF(container)>(container))
|
||||||
|
|
||||||
#else
|
#else // QT_FOREACH_COMPAT
|
||||||
|
|
||||||
#define Q_FOREACH(variable, container) for (variable: container)
|
#define Q_FOREACH(variable, container) for (variable: container)
|
||||||
|
|
||||||
|
@ -1164,7 +1126,6 @@ template <typename Wrapper> static inline typename Wrapper::pointer qGetPtrHelpe
|
||||||
When RTTI is not available, define this macro to force any uses of
|
When RTTI is not available, define this macro to force any uses of
|
||||||
dynamic_cast to cause a compile failure.
|
dynamic_cast to cause a compile failure.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef QT_NO_DYNAMIC_CAST
|
#ifdef QT_NO_DYNAMIC_CAST
|
||||||
# define dynamic_cast QT_PREPEND_NAMESPACE(qt_dynamic_cast_check)
|
# define dynamic_cast QT_PREPEND_NAMESPACE(qt_dynamic_cast_check)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue