Mercurial > hg > svcore
comparison base/ResizeableBitset.h @ 1038:cc27f35aa75c cxx11
Introducing the signed 64-bit frame index type, and fixing build failures from inclusion of -Wconversion with -Werror. Not finished yet.
author | Chris Cannam |
---|---|
date | Tue, 03 Mar 2015 15:18:24 +0000 |
parents | f3c97321e43d |
children | 106081811ccd |
comparison
equal
deleted
inserted
replaced
1037:bf0e5944289b | 1038:cc27f35aa75c |
---|---|
60 bool get(size_t column) const { | 60 bool get(size_t column) const { |
61 return ((*m_bits)[column >> 3]) & (1u << (column & 0x07)); | 61 return ((*m_bits)[column >> 3]) & (1u << (column & 0x07)); |
62 } | 62 } |
63 | 63 |
64 void set(size_t column) { | 64 void set(size_t column) { |
65 ((*m_bits)[column >> 3]) |= (uint8_t(1) << (column & 0x07)); | 65 ((*m_bits)[column >> 3]) |= uint8_t((1u << (column & 0x07)) & 0xff); |
66 } | 66 } |
67 | 67 |
68 void reset(size_t column) { | 68 void reset(size_t column) { |
69 ((*m_bits)[column >> 3]) &= ~(uint8_t(1) << (column & 0x07)); | 69 ((*m_bits)[column >> 3]) &= uint8_t((~(1u << (column & 0x07))) & 0xff); |
70 } | 70 } |
71 | 71 |
72 void copy(size_t source, size_t dest) { | 72 void copy(size_t source, size_t dest) { |
73 get(source) ? set(dest) : reset(dest); | 73 get(source) ? set(dest) : reset(dest); |
74 } | 74 } |