Skip to content

Commit

Permalink
bits16: Modernize code
Browse files Browse the repository at this point in the history
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 <sw@weilnetz.de>
  • Loading branch information
stweil committed May 26, 2019
1 parent 3b210ec commit 7e7811f
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/ccutil/bits16.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,10 @@

class DLLSYM BITS16 {
public:
uint16_t val;
uint16_t val = 0;

BITS16() { val = 0; } // constructor

BITS16(uint16_t init) { val = init; }
BITS16() = default;
BITS16(uint16_t init) : val(init) {}

void turn_on_bit( // flip specified bit
uint8_t bit_num) { // bit to flip 0..7
Expand Down

0 comments on commit 7e7811f

Please sign in to comment.