| Absolute File Name: | /home/qt/qt5_coco/qt5/qtbase/src/corelib/kernel/qcoreevent.cpp |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||||||||
| 2 | - | |||||||||||||||||||
| 3 | - | |||||||||||||||||||
| 4 | - | |||||||||||||||||||
| 5 | - | |||||||||||||||||||
| 6 | QEvent::QEvent(Type type) | - | ||||||||||||||||||
| 7 | : d(0), t(type), posted(false), spont(false), m_accept(true) | - | ||||||||||||||||||
| 8 | {} executed 2174144 times by 536 tests: end of blockExecuted by:
| 2174144 | ||||||||||||||||||
| 9 | QEvent::QEvent(const QEvent &other) | - | ||||||||||||||||||
| 10 | : d(other.d), t(other.t), posted(other.posted), spont(other.spont), | - | ||||||||||||||||||
| 11 | m_accept(other.m_accept) | - | ||||||||||||||||||
| 12 | { | - | ||||||||||||||||||
| 13 | - | |||||||||||||||||||
| 14 | - | |||||||||||||||||||
| 15 | ((!(!d)) ? qt_assert_x("QEvent", "Impossible, this can't happen: QEventPrivate isn't defined anywhere",__FILE__,305) : qt_noop()); | - | ||||||||||||||||||
| 16 | } executed 24 times by 1 test: end of blockExecuted by:
| 24 | ||||||||||||||||||
| 17 | QEvent &QEvent::operator=(const QEvent &other) | - | ||||||||||||||||||
| 18 | { | - | ||||||||||||||||||
| 19 | - | |||||||||||||||||||
| 20 | - | |||||||||||||||||||
| 21 | ((!(!other.d)) ? qt_assert_x("QEvent", "Impossible, this can't happen: QEventPrivate isn't defined anywhere",__FILE__,319) : qt_noop()); | - | ||||||||||||||||||
| 22 | - | |||||||||||||||||||
| 23 | t = other.t; | - | ||||||||||||||||||
| 24 | posted = other.posted; | - | ||||||||||||||||||
| 25 | spont = other.spont; | - | ||||||||||||||||||
| 26 | m_accept = other.m_accept; | - | ||||||||||||||||||
| 27 | return executed 6692 times by 47 tests: *this;return *this;Executed by:
executed 6692 times by 47 tests: return *this;Executed by:
| 6692 | ||||||||||||||||||
| 28 | } | - | ||||||||||||||||||
| 29 | - | |||||||||||||||||||
| 30 | - | |||||||||||||||||||
| 31 | - | |||||||||||||||||||
| 32 | - | |||||||||||||||||||
| 33 | - | |||||||||||||||||||
| 34 | - | |||||||||||||||||||
| 35 | QEvent::~QEvent() | - | ||||||||||||||||||
| 36 | { | - | ||||||||||||||||||
| 37 | if (posted
| 0-2174105 | ||||||||||||||||||
| 38 | QCoreApplicationPrivate::removePostedEvent(this); never executed: QCoreApplicationPrivate::removePostedEvent(this); | 0 | ||||||||||||||||||
| 39 | ((!(!d)) ? qt_assert_x("QEvent", "Impossible, this can't happen: QEventPrivate isn't defined anywhere",__FILE__,337) : qt_noop()); | - | ||||||||||||||||||
| 40 | } executed 2176394 times by 540 tests: end of blockExecuted by:
| 2176394 | ||||||||||||||||||
| 41 | namespace { | - | ||||||||||||||||||
| 42 | template <size_t N> | - | ||||||||||||||||||
| 43 | struct QBasicAtomicBitField { | - | ||||||||||||||||||
| 44 | enum { | - | ||||||||||||||||||
| 45 | BitsPerInt = std::numeric_limits<uint>::digits, | - | ||||||||||||||||||
| 46 | NumInts = (N + BitsPerInt - 1) / BitsPerInt, | - | ||||||||||||||||||
| 47 | NumBits = N | - | ||||||||||||||||||
| 48 | }; | - | ||||||||||||||||||
| 49 | - | |||||||||||||||||||
| 50 | - | |||||||||||||||||||
| 51 | - | |||||||||||||||||||
| 52 | QBasicAtomicInteger<uint> next; | - | ||||||||||||||||||
| 53 | QBasicAtomicInteger<uint> data[NumInts]; | - | ||||||||||||||||||
| 54 | - | |||||||||||||||||||
| 55 | bool allocateSpecific(int which) noexcept | - | ||||||||||||||||||
| 56 | { | - | ||||||||||||||||||
| 57 | QBasicAtomicInteger<uint> &entry = data[which / BitsPerInt]; | - | ||||||||||||||||||
| 58 | const uint old = entry.load(); | - | ||||||||||||||||||
| 59 | const uint bit = 1U << (which % BitsPerInt); | - | ||||||||||||||||||
| 60 | return executed 129072 times by 3 tests: !(old & bit)return !(old & bit) && entry.testAndSetRelaxed(old, old | bit);Executed by:
executed 129072 times by 3 tests: return !(old & bit) && entry.testAndSetRelaxed(old, old | bit);Executed by:
| 129072 | ||||||||||||||||||
| 61 | && entry.testAndSetRelaxed(old, old | bit); executed 129072 times by 3 tests: return !(old & bit) && entry.testAndSetRelaxed(old, old | bit);Executed by:
| 129072 | ||||||||||||||||||
| 62 | - | |||||||||||||||||||
| 63 | - | |||||||||||||||||||
| 64 | - | |||||||||||||||||||
| 65 | - | |||||||||||||||||||
| 66 | - | |||||||||||||||||||
| 67 | - | |||||||||||||||||||
| 68 | - | |||||||||||||||||||
| 69 | } | - | ||||||||||||||||||
| 70 | - | |||||||||||||||||||
| 71 | int allocateNext() noexcept | - | ||||||||||||||||||
| 72 | { | - | ||||||||||||||||||
| 73 | - | |||||||||||||||||||
| 74 | - | |||||||||||||||||||
| 75 | - | |||||||||||||||||||
| 76 | - | |||||||||||||||||||
| 77 | - | |||||||||||||||||||
| 78 | - | |||||||||||||||||||
| 79 | for (uint i = next.load(); i < NumBits
| 1-64538 | ||||||||||||||||||
| 80 | if (allocateSpecific(i)
| 7-64531 | ||||||||||||||||||
| 81 | - | |||||||||||||||||||
| 82 | const uint oldNext = next.load(); | - | ||||||||||||||||||
| 83 | next.testAndSetRelaxed(oldNext, qMax(i + 1, oldNext)); | - | ||||||||||||||||||
| 84 | return executed 7 times by 3 tests: i;return i;Executed by:
executed 7 times by 3 tests: return i;Executed by:
| 7 | ||||||||||||||||||
| 85 | } | - | ||||||||||||||||||
| 86 | } executed 64531 times by 1 test: end of blockExecuted by:
| 64531 | ||||||||||||||||||
| 87 | return executed 1 time by 1 test: -1;return -1;Executed by:
executed 1 time by 1 test: return -1;Executed by:
| 1 | ||||||||||||||||||
| 88 | } | - | ||||||||||||||||||
| 89 | }; | - | ||||||||||||||||||
| 90 | - | |||||||||||||||||||
| 91 | } | - | ||||||||||||||||||
| 92 | - | |||||||||||||||||||
| 93 | typedef QBasicAtomicBitField<QEvent::MaxUser - QEvent::User + 1> UserEventTypeRegistry; | - | ||||||||||||||||||
| 94 | - | |||||||||||||||||||
| 95 | static UserEventTypeRegistry userEventTypeRegistry; | - | ||||||||||||||||||
| 96 | - | |||||||||||||||||||
| 97 | static inline int registerEventTypeZeroBased(int id) noexcept | - | ||||||||||||||||||
| 98 | { | - | ||||||||||||||||||
| 99 | - | |||||||||||||||||||
| 100 | if (id < UserEventTypeRegistry::NumBits
| 1-64535 | ||||||||||||||||||
| 101 | return executed 64531 times by 1 test: id;return id;Executed by:
executed 64531 times by 1 test: return id;Executed by:
| 64531 | ||||||||||||||||||
| 102 | - | |||||||||||||||||||
| 103 | - | |||||||||||||||||||
| 104 | return executed 8 times by 3 tests: userEventTypeRegistry.allocateNext();return userEventTypeRegistry.allocateNext();Executed by:
executed 8 times by 3 tests: return userEventTypeRegistry.allocateNext();Executed by:
| 8 | ||||||||||||||||||
| 105 | } | - | ||||||||||||||||||
| 106 | int QEvent::registerEventType(int hint) noexcept | - | ||||||||||||||||||
| 107 | { | - | ||||||||||||||||||
| 108 | const int result = registerEventTypeZeroBased(QEvent::MaxUser - hint); | - | ||||||||||||||||||
| 109 | return executed 64539 times by 3 tests: result < 0 ? -1 : QEvent::MaxUser - result ;return result < 0 ? -1 : QEvent::MaxUser - result ;Executed by:
executed 64539 times by 3 tests: return result < 0 ? -1 : QEvent::MaxUser - result ;Executed by:
| 64539 | ||||||||||||||||||
| 110 | } | - | ||||||||||||||||||
| 111 | QTimerEvent::QTimerEvent(int timerId) | - | ||||||||||||||||||
| 112 | : QEvent(Timer), id(timerId) | - | ||||||||||||||||||
| 113 | {} executed 49574 times by 115 tests: end of blockExecuted by:
| 49574 | ||||||||||||||||||
| 114 | - | |||||||||||||||||||
| 115 | - | |||||||||||||||||||
| 116 | - | |||||||||||||||||||
| 117 | - | |||||||||||||||||||
| 118 | QTimerEvent::~QTimerEvent() | - | ||||||||||||||||||
| 119 | { | - | ||||||||||||||||||
| 120 | } | - | ||||||||||||||||||
| 121 | QChildEvent::QChildEvent(Type type, QObject *child) | - | ||||||||||||||||||
| 122 | : QEvent(type), c(child) | - | ||||||||||||||||||
| 123 | {} executed 325287 times by 510 tests: end of blockExecuted by:
| 325287 | ||||||||||||||||||
| 124 | - | |||||||||||||||||||
| 125 | - | |||||||||||||||||||
| 126 | - | |||||||||||||||||||
| 127 | - | |||||||||||||||||||
| 128 | QChildEvent::~QChildEvent() | - | ||||||||||||||||||
| 129 | { | - | ||||||||||||||||||
| 130 | } | - | ||||||||||||||||||
| 131 | QDynamicPropertyChangeEvent::QDynamicPropertyChangeEvent(const QByteArray &name) | - | ||||||||||||||||||
| 132 | : QEvent(QEvent::DynamicPropertyChange), n(name) | - | ||||||||||||||||||
| 133 | { | - | ||||||||||||||||||
| 134 | } executed 10046 times by 68 tests: end of blockExecuted by:
| 10046 | ||||||||||||||||||
| 135 | - | |||||||||||||||||||
| 136 | - | |||||||||||||||||||
| 137 | - | |||||||||||||||||||
| 138 | - | |||||||||||||||||||
| 139 | QDynamicPropertyChangeEvent::~QDynamicPropertyChangeEvent() | - | ||||||||||||||||||
| 140 | { | - | ||||||||||||||||||
| 141 | } | - | ||||||||||||||||||
| 142 | QDeferredDeleteEvent::QDeferredDeleteEvent() | - | ||||||||||||||||||
| 143 | : QEvent(QEvent::DeferredDelete) | - | ||||||||||||||||||
| 144 | , level(0) | - | ||||||||||||||||||
| 145 | { } executed 11751 times by 213 tests: end of blockExecuted by:
| 11751 | ||||||||||||||||||
| 146 | - | |||||||||||||||||||
| 147 | - | |||||||||||||||||||
| 148 | - | |||||||||||||||||||
| 149 | - | |||||||||||||||||||
| 150 | QDeferredDeleteEvent::~QDeferredDeleteEvent() | - | ||||||||||||||||||
| 151 | { } | - | ||||||||||||||||||
| 152 | - | |||||||||||||||||||
| Switch to Source code | Preprocessed file |