From 5f60af68ca8d8e4b5d74242a2f1de1b1df1dd088 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Wed, 4 Oct 2023 16:58:56 +0300 Subject: [PATCH] Refactoring. Code style. --- src/libs/vmisc/defglobal.h | 106 ++++++++++++++++++------------------- 1 file changed, 53 insertions(+), 53 deletions(-) diff --git a/src/libs/vmisc/defglobal.h b/src/libs/vmisc/defglobal.h index df83989da..541fb9674 100644 --- a/src/libs/vmisc/defglobal.h +++ b/src/libs/vmisc/defglobal.h @@ -34,90 +34,90 @@ constexpr qreal PrintDPI = 96.0; #if QT_VERSION < QT_VERSION_CHECK(5, 7, 0) // this adds const to non-const objects (like std::as_const) -template -Q_DECL_CONSTEXPR typename std::add_const::type &qAsConst(T &t) noexcept { return t; } +template Q_DECL_CONSTEXPR typename std::add_const::type &qAsConst(T &t) noexcept +{ + return t; +} // prevent rvalue arguments: -template -void qAsConst(const T &&) Q_DECL_EQ_DELETE; +template void qAsConst(const T &&) Q_DECL_EQ_DELETE; #endif #ifndef Q_DISABLE_ASSIGN -#define Q_DISABLE_ASSIGN(Class) \ - Class &operator=(const Class &) = delete; +#define Q_DISABLE_ASSIGN(Class) Class &operator=(const Class &) = delete; #endif #if QT_VERSION < QT_VERSION_CHECK(5, 13, 0) -#define Q_DISABLE_COPY_MOVE(Class) \ - Q_DISABLE_COPY(Class) \ - Class(Class &&) = delete; \ +#define Q_DISABLE_COPY_MOVE(Class) \ + Q_DISABLE_COPY(Class) \ + Class(Class &&) = delete; \ Class &operator=(Class &&) = delete; #endif #ifndef Q_DISABLE_ASSIGN_MOVE -#define Q_DISABLE_ASSIGN_MOVE(Class) \ - Q_DISABLE_ASSIGN(Class) \ - Class(Class &&) = delete; \ +#define Q_DISABLE_ASSIGN_MOVE(Class) \ + Q_DISABLE_ASSIGN(Class) \ + Class(Class &&) = delete; \ Class &operator=(Class &&) = delete; #endif -#define SUFFIX_APPEND(x, y) x ## y // NOLINT(cppcoreguidelines-macro-usage) +#define SUFFIX_APPEND(x, y) x##y // NOLINT(cppcoreguidelines-macro-usage) -#define HOURS_INT(x) ((x) * 3600000) // NOLINT(cppcoreguidelines-macro-usage) -#define MINUTES_INT(x) ((x) * 60000) // NOLINT(cppcoreguidelines-macro-usage) -#define SECONDS_INT(x) ((x) * 1000) // NOLINT(cppcoreguidelines-macro-usage) -#define MSECONDS_INT(x) (x) // NOLINT(cppcoreguidelines-macro-usage) -#define MICSECONDS_INT(x) (x) // NOLINT(cppcoreguidelines-macro-usage) -#define NANOSECONDS_INT(x) (x) // NOLINT(cppcoreguidelines-macro-usage) +#define HOURS_INT(x) ((x)*3600000) // NOLINT(cppcoreguidelines-macro-usage) +#define MINUTES_INT(x) ((x)*60000) // NOLINT(cppcoreguidelines-macro-usage) +#define SECONDS_INT(x) ((x)*1000) // NOLINT(cppcoreguidelines-macro-usage) +#define MSECONDS_INT(x) (x) // NOLINT(cppcoreguidelines-macro-usage) +#define MICSECONDS_INT(x) (x) // NOLINT(cppcoreguidelines-macro-usage) +#define NANOSECONDS_INT(x) (x) // NOLINT(cppcoreguidelines-macro-usage) #if (defined(Q_CC_GNU) && Q_CC_GNU < 409) && !defined(Q_CC_CLANG) -#define HOURS(x) HOURS_INT(x) // NOLINT(cppcoreguidelines-macro-usage) -#define MINUTES(x) MINUTES_INT(x) // NOLINT(cppcoreguidelines-macro-usage) -#define SECONDS(x) SECONDS_INT(x) // NOLINT(cppcoreguidelines-macro-usage) -#define MSECONDS(x) MSECONDS_INT(x) // NOLINT(cppcoreguidelines-macro-usage) -#define MICSECONDS(x) MICSECONDS_INT(x) // NOLINT(cppcoreguidelines-macro-usage) +#define HOURS(x) HOURS_INT(x) // NOLINT(cppcoreguidelines-macro-usage) +#define MINUTES(x) MINUTES_INT(x) // NOLINT(cppcoreguidelines-macro-usage) +#define SECONDS(x) SECONDS_INT(x) // NOLINT(cppcoreguidelines-macro-usage) +#define MSECONDS(x) MSECONDS_INT(x) // NOLINT(cppcoreguidelines-macro-usage) +#define MICSECONDS(x) MICSECONDS_INT(x) // NOLINT(cppcoreguidelines-macro-usage) #define NANOSECONDS(x) NANOSECONDS_INT(x) // NOLINT(cppcoreguidelines-macro-usage) #else #if __cplusplus >= 201402L -#define HOURS(x) SUFFIX_APPEND(x, h) // NOLINT(cppcoreguidelines-macro-usage) -#define MINUTES(x) SUFFIX_APPEND(x, min) // NOLINT(cppcoreguidelines-macro-usage) -#define SECONDS(x) SUFFIX_APPEND(x, s) // NOLINT(cppcoreguidelines-macro-usage) -#define MSECONDS(x) SUFFIX_APPEND(x, ms) // NOLINT(cppcoreguidelines-macro-usage) -#define MICSECONDS(x) SUFFIX_APPEND(x, us) // NOLINT(cppcoreguidelines-macro-usage) +#define HOURS(x) SUFFIX_APPEND(x, h) // NOLINT(cppcoreguidelines-macro-usage) +#define MINUTES(x) SUFFIX_APPEND(x, min) // NOLINT(cppcoreguidelines-macro-usage) +#define SECONDS(x) SUFFIX_APPEND(x, s) // NOLINT(cppcoreguidelines-macro-usage) +#define MSECONDS(x) SUFFIX_APPEND(x, ms) // NOLINT(cppcoreguidelines-macro-usage) +#define MICSECONDS(x) SUFFIX_APPEND(x, us) // NOLINT(cppcoreguidelines-macro-usage) #define NANOSECONDS(x) SUFFIX_APPEND(x, ns) // NOLINT(cppcoreguidelines-macro-usage) #else -#define HOURS(x) SUFFIX_APPEND(x, _h) // NOLINT(cppcoreguidelines-macro-usage) -#define MINUTES(x) SUFFIX_APPEND(x, _min) // NOLINT(cppcoreguidelines-macro-usage) -#define SECONDS(x) SUFFIX_APPEND(x, _s) // NOLINT(cppcoreguidelines-macro-usage) -#define MSECONDS(x) SUFFIX_APPEND(x, _ms) // NOLINT(cppcoreguidelines-macro-usage) -#define MICSECONDS(x) SUFFIX_APPEND(x, _us) // NOLINT(cppcoreguidelines-macro-usage) +#define HOURS(x) SUFFIX_APPEND(x, _h) // NOLINT(cppcoreguidelines-macro-usage) +#define MINUTES(x) SUFFIX_APPEND(x, _min) // NOLINT(cppcoreguidelines-macro-usage) +#define SECONDS(x) SUFFIX_APPEND(x, _s) // NOLINT(cppcoreguidelines-macro-usage) +#define MSECONDS(x) SUFFIX_APPEND(x, _ms) // NOLINT(cppcoreguidelines-macro-usage) +#define MICSECONDS(x) SUFFIX_APPEND(x, _us) // NOLINT(cppcoreguidelines-macro-usage) #define NANOSECONDS(x) SUFFIX_APPEND(x, _ns) // NOLINT(cppcoreguidelines-macro-usage) -#endif // __cplusplus >= 201402L -#endif // (defined(Q_CC_GNU) && Q_CC_GNU < 409) && !defined(Q_CC_CLANG) +#endif // __cplusplus >= 201402L +#endif // (defined(Q_CC_GNU) && Q_CC_GNU < 409) && !defined(Q_CC_CLANG) #if (defined(Q_CC_GNU) && Q_CC_GNU < 409) && !defined(Q_CC_CLANG) -#define V_HOURS(x) HOURS(x) // NOLINT(cppcoreguidelines-macro-usage) -#define V_MINUTES(x) MINUTES(x) // NOLINT(cppcoreguidelines-macro-usage) -#define V_SECONDS(x) SECONDS(x) // NOLINT(cppcoreguidelines-macro-usage) -#define V_MSECONDS(x) MSECONDS(x) // NOLINT(cppcoreguidelines-macro-usage) -#define V_MICSECONDS(x) MICSECONDS(x) // NOLINT(cppcoreguidelines-macro-usage) +#define V_HOURS(x) HOURS(x) // NOLINT(cppcoreguidelines-macro-usage) +#define V_MINUTES(x) MINUTES(x) // NOLINT(cppcoreguidelines-macro-usage) +#define V_SECONDS(x) SECONDS(x) // NOLINT(cppcoreguidelines-macro-usage) +#define V_MSECONDS(x) MSECONDS(x) // NOLINT(cppcoreguidelines-macro-usage) +#define V_MICSECONDS(x) MICSECONDS(x) // NOLINT(cppcoreguidelines-macro-usage) #define V_NANOSECONDS(x) NANOSECONDS(x) // NOLINT(cppcoreguidelines-macro-usage) #else #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) -#define V_HOURS(x) HOURS(x) // NOLINT(cppcoreguidelines-macro-usage) -#define V_MINUTES(x) MINUTES(x) // NOLINT(cppcoreguidelines-macro-usage) -#define V_SECONDS(x) SECONDS(x) // NOLINT(cppcoreguidelines-macro-usage) -#define V_MSECONDS(x) MSECONDS(x) // NOLINT(cppcoreguidelines-macro-usage) -#define V_MICSECONDS(x) MICSECONDS(x) // NOLINT(cppcoreguidelines-macro-usage) +#define V_HOURS(x) HOURS(x) // NOLINT(cppcoreguidelines-macro-usage) +#define V_MINUTES(x) MINUTES(x) // NOLINT(cppcoreguidelines-macro-usage) +#define V_SECONDS(x) SECONDS(x) // NOLINT(cppcoreguidelines-macro-usage) +#define V_MSECONDS(x) MSECONDS(x) // NOLINT(cppcoreguidelines-macro-usage) +#define V_MICSECONDS(x) MICSECONDS(x) // NOLINT(cppcoreguidelines-macro-usage) #define V_NANOSECONDS(x) NANOSECONDS(x) // NOLINT(cppcoreguidelines-macro-usage) #else -#define V_HOURS(x) HOURS_INT(x) // NOLINT(cppcoreguidelines-macro-usage) -#define V_MINUTES(x) MINUTES_INT(x) // NOLINT(cppcoreguidelines-macro-usage) -#define V_SECONDS(x) SECONDS_INT(x) // NOLINT(cppcoreguidelines-macro-usage) -#define V_MSECONDS(x) MSECONDS_INT(x) // NOLINT(cppcoreguidelines-macro-usage) -#define V_MICSECONDS(x) MICSECONDS_INT(x) // NOLINT(cppcoreguidelines-macro-usage) +#define V_HOURS(x) HOURS_INT(x) // NOLINT(cppcoreguidelines-macro-usage) +#define V_MINUTES(x) MINUTES_INT(x) // NOLINT(cppcoreguidelines-macro-usage) +#define V_SECONDS(x) SECONDS_INT(x) // NOLINT(cppcoreguidelines-macro-usage) +#define V_MSECONDS(x) MSECONDS_INT(x) // NOLINT(cppcoreguidelines-macro-usage) +#define V_MICSECONDS(x) MICSECONDS_INT(x) // NOLINT(cppcoreguidelines-macro-usage) #define V_NANOSECONDS(x) NANOSECONDS_INT(x) // NOLINT(cppcoreguidelines-macro-usage) -#endif // QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) -#endif // (defined(Q_CC_GNU) && Q_CC_GNU < 409) && !defined(Q_CC_CLANG) +#endif // QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) +#endif // (defined(Q_CC_GNU) && Q_CC_GNU < 409) && !defined(Q_CC_CLANG) #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) using vsizetype = qsizetype;