diff --git a/include/QtPromise b/include/QtPromise index 65250eb..2e92a9f 100644 --- a/include/QtPromise +++ b/include/QtPromise @@ -1,8 +1,8 @@ -#ifndef _QTPROMISE_MODULE_H -#define _QTPROMISE_MODULE_H +#ifndef QTPROMISE_MODULE_H +#define QTPROMISE_MODULE_H #include "../src/qtpromise/qpromise.h" #include "../src/qtpromise/qpromisefuture.h" #include "../src/qtpromise/qpromisehelpers.h" -#endif // ifndef _QTPROMISE_MODULE_H +#endif // ifndef QTPROMISE_MODULE_H diff --git a/src/qtpromise/qpromise.h b/src/qtpromise/qpromise.h index e7aa208..3e7ec50 100644 --- a/src/qtpromise/qpromise.h +++ b/src/qtpromise/qpromise.h @@ -1,5 +1,5 @@ -#ifndef _QTPROMISE_QPROMISE_H -#define _QTPROMISE_QPROMISE_H +#ifndef QTPROMISE_QPROMISE_H +#define QTPROMISE_QPROMISE_H // QtPromise #include "qpromise_p.h" @@ -95,4 +95,4 @@ private: #include "qpromise.inl" -#endif // ifndef _QTPROMISE_QPROMISE_H +#endif // ifndef QTPROMISE_QPROMISE_H diff --git a/src/qtpromise/qpromise.inl b/src/qtpromise/qpromise.inl index 6a0ef99..ce288b5 100644 --- a/src/qtpromise/qpromise.inl +++ b/src/qtpromise/qpromise.inl @@ -12,7 +12,8 @@ public: : m_promise(new QPromise(std::move(p))) { } - void operator()(const T& value) const { + void operator()(const T& value) const + { resolve(value); } @@ -88,7 +89,7 @@ inline QPromiseBase::QPromiseBase(F resolver) try { resolver(resolve); - } catch(...) { + } catch (...) { reject(std::current_exception()); } } @@ -103,7 +104,7 @@ inline QPromiseBase::QPromiseBase(F resolver) try { resolver(resolve, reject); - } catch(...) { + } catch (...) { reject(std::current_exception()); } } diff --git a/src/qtpromise/qpromise_p.h b/src/qtpromise/qpromise_p.h index 86fac56..24ce195 100644 --- a/src/qtpromise/qpromise_p.h +++ b/src/qtpromise/qpromise_p.h @@ -1,5 +1,5 @@ -#ifndef _QTPROMISE_QPROMISE_P_H -#define _QTPROMISE_QPROMISE_P_H +#ifndef QTPROMISE_QPROMISE_P_H +#define QTPROMISE_QPROMISE_P_H // QtPromise #include "qpromiseerror.h" @@ -284,7 +284,7 @@ struct PromiseCatcher error.rethrow(); } catch (const TArg& error) { PromiseDispatch::call(error, handler, resolve, reject); - } catch(...) { + } catch (...) { reject(std::current_exception()); } }; @@ -332,7 +332,7 @@ struct PromiseCatcher template class PromiseData; template -class PromiseDataBase: public QSharedData +class PromiseDataBase : public QSharedData { public: using Error = QtPromise::QPromiseError; @@ -415,7 +415,7 @@ private: }; template -class PromiseData: public PromiseDataBase +class PromiseData : public PromiseDataBase { using Handler = std::pair, std::function >; @@ -463,7 +463,7 @@ private: }; template <> -class PromiseData: public PromiseDataBase +class PromiseData : public PromiseDataBase { using Handler = std::pair, std::function >; @@ -494,4 +494,4 @@ private: } // namespace QtPromise -#endif // ifndef _QTPROMISE_QPROMISE_H +#endif // ifndef QTPROMISE_QPROMISE_H diff --git a/src/qtpromise/qpromiseerror.h b/src/qtpromise/qpromiseerror.h index 2c96fdb..c84c9e8 100644 --- a/src/qtpromise/qpromiseerror.h +++ b/src/qtpromise/qpromiseerror.h @@ -1,5 +1,5 @@ -#ifndef _QTPROMISE_QPROMISEERROR_H -#define _QTPROMISE_QPROMISEERROR_H +#ifndef QTPROMISE_QPROMISEERROR_H +#define QTPROMISE_QPROMISEERROR_H // QtPromise #include "qpromiseglobal.h" @@ -14,7 +14,7 @@ public: { try { throw value; - } catch(...) { + } catch (...) { m_exception = std::current_exception(); } } @@ -55,4 +55,4 @@ private: } // namespace QtPromise -#endif // _QTPROMISE_QPROMISEERROR_H +#endif // QTPROMISE_QPROMISEERROR_H diff --git a/src/qtpromise/qpromisefuture.h b/src/qtpromise/qpromisefuture.h index d08f06c..3781b25 100644 --- a/src/qtpromise/qpromisefuture.h +++ b/src/qtpromise/qpromisefuture.h @@ -1,5 +1,5 @@ -#ifndef _QTPROMISE_QPROMISEFUTURE_P_H -#define _QTPROMISE_QPROMISEFUTURE_P_H +#ifndef QTPROMISE_QPROMISEFUTURE_P_H +#define QTPROMISE_QPROMISEFUTURE_P_H // Qt #include @@ -7,7 +7,7 @@ namespace QtPromise { -class QPromiseCanceledException: public QException +class QPromiseCanceledException : public QException { public: void raise() const Q_DECL_OVERRIDE { throw *this; } @@ -50,7 +50,7 @@ struct PromiseFulfill > } else { PromiseFulfill::call(watcher->result(), resolve, reject); } - } catch(...) { + } catch (...) { reject(std::current_exception()); } @@ -81,7 +81,7 @@ struct PromiseFulfill > } else { resolve(); } - } catch(...) { + } catch (...) { reject(std::current_exception()); } @@ -94,4 +94,4 @@ struct PromiseFulfill > } // namespace QtPromisePrivate -#endif // _QTPROMISE_QPROMISEFUTURE_P_H +#endif // QTPROMISE_QPROMISEFUTURE_P_H diff --git a/src/qtpromise/qpromiseglobal.h b/src/qtpromise/qpromiseglobal.h index 94bea65..92b543e 100644 --- a/src/qtpromise/qpromiseglobal.h +++ b/src/qtpromise/qpromiseglobal.h @@ -1,5 +1,5 @@ -#ifndef _QTPROMISE_QPROMISEGLOBAL_H -#define _QTPROMISE_QPROMISEGLOBAL_H +#ifndef QTPROMISE_QPROMISEGLOBAL_H +#define QTPROMISE_QPROMISEGLOBAL_H // QtCore #include @@ -122,4 +122,4 @@ struct ArgsOf : public ArgsOf } // namespace QtPromisePrivate -#endif // ifndef _QTPROMISE_QPROMISEGLOBAL_H +#endif // ifndef QTPROMISE_QPROMISEGLOBAL_H diff --git a/src/qtpromise/qpromisehelpers.h b/src/qtpromise/qpromisehelpers.h index 972729e..6f753fa 100644 --- a/src/qtpromise/qpromisehelpers.h +++ b/src/qtpromise/qpromisehelpers.h @@ -1,5 +1,5 @@ -#ifndef _QTPROMISE_QPROMISEHELPERS_H -#define _QTPROMISE_QPROMISEHELPERS_H +#ifndef QTPROMISE_QPROMISEHELPERS_H +#define QTPROMISE_QPROMISEHELPERS_H // QtPromise #include "qpromise_p.h" @@ -39,4 +39,4 @@ QPromise qPromiseAll(const QVector >& promises) } // namespace QtPromise -#endif // _QTPROMISE_QPROMISEHELPERS_H +#endif // QTPROMISE_QPROMISEHELPERS_H diff --git a/tests/auto/benchmark/tst_benchmark.cpp b/tests/auto/benchmark/tst_benchmark.cpp index f2b6e25..e109ed7 100644 --- a/tests/auto/benchmark/tst_benchmark.cpp +++ b/tests/auto/benchmark/tst_benchmark.cpp @@ -6,7 +6,7 @@ using namespace QtPromise; -class tst_benchmark: public QObject +class tst_benchmark : public QObject { Q_OBJECT @@ -50,7 +50,7 @@ public: // STATICS static Logs& logs() { static Logs logs; return logs; } }; -struct Data: public Logger +struct Data : public Logger { Data(int v): Logger(), m_value(v) {} int value() const { return m_value; } diff --git a/tests/auto/future/tst_future.cpp b/tests/auto/future/tst_future.cpp index be93309..a090f2d 100644 --- a/tests/auto/future/tst_future.cpp +++ b/tests/auto/future/tst_future.cpp @@ -7,7 +7,7 @@ using namespace QtPromise; -class tst_future: public QObject +class tst_future : public QObject { Q_OBJECT @@ -30,7 +30,7 @@ private Q_SLOTS: }; // class tst_future -class MyException: public QException +class MyException : public QException { public: MyException(const QString& error) diff --git a/tests/auto/helpers/tst_helpers.cpp b/tests/auto/helpers/tst_helpers.cpp index 0d073a9..8bb5bde 100644 --- a/tests/auto/helpers/tst_helpers.cpp +++ b/tests/auto/helpers/tst_helpers.cpp @@ -6,7 +6,7 @@ using namespace QtPromise; -class tst_helpers: public QObject +class tst_helpers : public QObject { Q_OBJECT diff --git a/tests/auto/qpromise/tst_qpromise.cpp b/tests/auto/qpromise/tst_qpromise.cpp index 2bbf752..dc72804 100644 --- a/tests/auto/qpromise/tst_qpromise.cpp +++ b/tests/auto/qpromise/tst_qpromise.cpp @@ -7,7 +7,7 @@ using namespace QtPromise; using namespace QtPromisePrivate; -class tst_qpromise: public QObject +class tst_qpromise : public QObject { Q_OBJECT diff --git a/tests/auto/requirements/tst_requirements.cpp b/tests/auto/requirements/tst_requirements.cpp index fc329cf..efbc519 100644 --- a/tests/auto/requirements/tst_requirements.cpp +++ b/tests/auto/requirements/tst_requirements.cpp @@ -8,7 +8,7 @@ using namespace QtPromise; using namespace QtPromisePrivate; // https://promisesaplus.com/#requirements -class tst_requirements: public QObject +class tst_requirements : public QObject { Q_OBJECT diff --git a/tests/auto/thread/tst_thread.cpp b/tests/auto/thread/tst_thread.cpp index 2743a71..c2fc4cb 100644 --- a/tests/auto/thread/tst_thread.cpp +++ b/tests/auto/thread/tst_thread.cpp @@ -7,7 +7,7 @@ using namespace QtPromise; -class tst_thread: public QObject +class tst_thread : public QObject { Q_OBJECT