Skip to content

Commit 7e7811f

Browse files
committed
bits16: Modernize code
This also fixes warnings like the following one from clang++: src/ccmain/pgedit.cpp:114:15: warning: declaration requires a global constructor [-Wglobal-constructors] Signed-off-by: Stefan Weil <[email protected]>
1 parent 3b210ec commit 7e7811f

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/ccutil/bits16.h

+3-4
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,10 @@
2424

2525
class DLLSYM BITS16 {
2626
public:
27-
uint16_t val;
27+
uint16_t val = 0;
2828

29-
BITS16() { val = 0; } // constructor
30-
31-
BITS16(uint16_t init) { val = init; }
29+
BITS16() = default;
30+
BITS16(uint16_t init) : val(init) {}
3231

3332
void turn_on_bit( // flip specified bit
3433
uint8_t bit_num) { // bit to flip 0..7

0 commit comments

Comments
 (0)