Skip to content

Commit a0b9cc0

Browse files
author
QL
committed
6.8.1
1 parent caa9f80 commit a0b9cc0

File tree

3 files changed

+24
-22
lines changed

3 files changed

+24
-22
lines changed

libraries/qpcpp_sam/src/qep.hpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
/// @cond
55
///***************************************************************************
66
/// Last updated for version 6.8.1
7-
/// Last updated on 2020-04-02
7+
/// Last updated on 2020-04-05
88
///
99
/// Q u a n t u m L e a P s
1010
/// ------------------------
@@ -155,18 +155,18 @@ namespace QP {
155155
//************************************************************************
156156
class QEvt {
157157
public:
158-
//! public constructor (dynamic event)
158+
//! public constructor (overload for dynamic events)
159159
QEvt(QSignal const s) noexcept
160160
: sig(s)
161161
// poolId_/refCtr_ intentionally uninitialized
162162
{}
163-
enum StaticEvt : std::uint8_t { STATIC_EVT };
164163

165-
//! public constructor (static event)
166-
QEvt(QSignal const s, StaticEvt /*dummy*/) noexcept
164+
//! public constructor (overload for static events)
165+
enum StaticEvt : std::uint8_t { STATIC_EVT };
166+
constexpr QEvt(QSignal const s, StaticEvt /*dummy*/) noexcept
167167
: sig(s),
168168
poolId_(0U),
169-
refCtr_(0U))
169+
refCtr_(0U)
170170
{}
171171

172172
#ifdef Q_EVT_VIRTUAL
@@ -188,10 +188,10 @@ namespace QP {
188188
friend class QEQueue;
189189
friend class QTicker;
190190
friend class QXThread;
191-
friend std::uint8_t QF_EVT_POOL_ID_ (QEvt const * const e);
192-
friend std::uint8_t QF_EVT_REF_CTR_ (QEvt const * const e);
193-
friend void QF_EVT_REF_CTR_INC_(QEvt const * const e);
194-
friend void QF_EVT_REF_CTR_DEC_(QEvt const * const e);
191+
friend std::uint8_t QF_EVT_POOL_ID_ (QEvt const * const e) noexcept;
192+
friend std::uint8_t QF_EVT_REF_CTR_ (QEvt const * const e) noexcept;
193+
friend void QF_EVT_REF_CTR_INC_(QEvt const * const e) noexcept;
194+
friend void QF_EVT_REF_CTR_DEC_(QEvt const * const e) noexcept;
195195
};
196196

197197
#else // QEvt is a POD (Plain Old Datatype)
@@ -302,7 +302,7 @@ class QHsm {
302302

303303
protected:
304304
//! Protected constructor of QHsm.
305-
QHsm(QStateHandler const initial) noexcept;
305+
explicit QHsm(QStateHandler const initial) noexcept;
306306

307307
public:
308308
// facilities for the QHsm implementation strategy...
@@ -513,7 +513,7 @@ class QMsm : public QHsm {
513513

514514
protected:
515515
//! Protected constructor
516-
QMsm(QStateHandler const initial) noexcept;
516+
explicit QMsm(QStateHandler const initial) noexcept;
517517

518518
private:
519519
//! disallow the inhertited isIn() function in QP::QMsm and subclasses

libraries/qpcpp_sam/src/qep_hsm.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,12 @@ enum : QSignal {
9393
/// to state handler functions of QP::QHsm and QP::QFsm subclasses to execute
9494
/// entry actions, exit actions, and initial transitions.
9595
///
96-
static QEvt const QEP_reservedEvt_[4] = {
96+
static QEvt const QEP_reservedEvt_[4] {
9797
#ifdef Q_EVT_CTOR // Is the QEvt constructor provided?
98-
0U,
99-
1U,
100-
2U,
101-
3U
98+
QEvt(0U, QEvt::STATIC_EVT),
99+
QEvt(1U, QEvt::STATIC_EVT),
100+
QEvt(2U, QEvt::STATIC_EVT),
101+
QEvt(3U, QEvt::STATIC_EVT)
102102
#else // QEvt is a POD (Plain Old Datatype)
103103
{ 0U, 0U, 0U },
104104
{ 1U, 0U, 0U },

libraries/qpcpp_sam/src/qf_time.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
/// @ingroup qf
44
/// @cond
55
///***************************************************************************
6-
/// Last updated for version 6.8.0
7-
/// Last updated on 2020-03-29
6+
/// Last updated for version 6.8.1
7+
/// Last updated on 2020-04-05
88
///
99
/// Q u a n t u m L e a P s
1010
/// ------------------------
@@ -231,7 +231,7 @@ QTimeEvt::QTimeEvt(QActive * const act,
231231
enum_t const sgnl, std::uint_fast8_t const tickRate) noexcept
232232
:
233233
#ifdef Q_EVT_CTOR
234-
QEvt(static_cast<QSignal>(sgnl)),
234+
QEvt(static_cast<QSignal>(sgnl), QEvt::STATIC_EVT),
235235
#else
236236
QEvt(),
237237
#endif
@@ -267,7 +267,7 @@ QTimeEvt::QTimeEvt(QActive * const act,
267267
QTimeEvt::QTimeEvt() noexcept
268268
:
269269
#ifdef Q_EVT_CTOR
270-
QEvt(0U),
270+
QEvt(0U, QEvt::STATIC_EVT),
271271
#else
272272
QEvt(),
273273
#endif // Q_EVT_CTOR
@@ -278,7 +278,6 @@ QTimeEvt::QTimeEvt() noexcept
278278
{
279279
#ifndef Q_EVT_CTOR
280280
sig = 0U;
281-
#endif // Q_EVT_CTOR
282281

283282
// Setting the POOL_ID event attribute to zero is correct only for
284283
// events not allocated from event pools, which must be the case
@@ -290,6 +289,9 @@ QTimeEvt::QTimeEvt() noexcept
290289
// reused to hold the tickRate as well as other information
291290
//
292291
refCtr_ = 0U; // default rate 0
292+
293+
#endif // Q_EVT_CTOR
294+
293295
}
294296

295297
//****************************************************************************

0 commit comments

Comments
 (0)