Skip to content

Commit

Permalink
src/ccutil/bits16.h remove warnings (#2726)
Browse files Browse the repository at this point in the history
  • Loading branch information
whosoonhwang authored and stweil committed Oct 23, 2019
1 parent 71e291b commit 4ee95a6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/ccutil/bits16.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,21 +31,21 @@ class DLLSYM BITS16 {

void turn_on_bit( // flip specified bit
uint8_t bit_num) { // bit to flip 0..7
val = val | 01 << bit_num;
val = static_cast<uint16_t>(val | 01 << bit_num);
}

void turn_off_bit( // flip specified bit
uint8_t bit_num) { // bit to flip 0..7
val = val & ~(01 << bit_num);
val = static_cast<uint16_t>(val & ~(01 << bit_num));
}

void set_bit( // flip specified bit
uint8_t bit_num, // bit to flip 0..7
bool value) { // value to flip to
if (value)
val = val | 01 << bit_num;
val = static_cast<uint16_t>(val | 01 << bit_num);
else
val = val & ~(01 << bit_num);
val = static_cast<uint16_t>(val & ~(01 << bit_num));
}

bool bit( // access bit
Expand Down

0 comments on commit 4ee95a6

Please sign in to comment.