Skip to content

Commit 5ee8edc

Browse files
authored
Use default initialization in Signal class (#3129)
* Use default initialization in Signal class * Fix header guard in deck_con.h
1 parent bb63be7 commit 5ee8edc

2 files changed

Lines changed: 5 additions & 10 deletions

File tree

gframe/deck_con.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,4 +91,4 @@ class DeckBuilder: public irr::IEventReceiver {
9191

9292
}
9393

94-
#endif //DECK_CON
94+
#endif //DECK_CON_H

gframe/mysignal.h

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,8 @@
88

99
class Signal {
1010
public:
11-
Signal() {
12-
_state = false;
13-
_nowait = false;
14-
}
15-
~Signal() {
16-
17-
}
11+
Signal() = default;
12+
~Signal() = default;
1813
void Set() {
1914
std::unique_lock<std::mutex> lock(_mutex);
2015
_state = true;
@@ -54,8 +49,8 @@ class Signal {
5449
private:
5550
std::mutex _mutex;
5651
std::condition_variable _cond;
57-
bool _state;
58-
std::atomic<bool> _nowait;
52+
bool _state{ false };
53+
std::atomic<bool> _nowait{ false };
5954
};
6055

6156
#endif // SIGNAL_H

0 commit comments

Comments
 (0)