mirror of
https://github.com/MoleskiCoder/EightBit.git
synced 2026-03-12 10:41:58 +00:00
Sort a bunch of missing argument const specifications.
Signed-off-by: Adrian Conlon <Adrian.conlon@gmail.com>
This commit is contained in:
@@ -27,13 +27,13 @@ void EightBit::Processor::handleIRQ() {
|
||||
|
||||
int EightBit::Processor::run(const int limit) {
|
||||
int current = 0;
|
||||
while (LIKELY(powered()) && current < limit)
|
||||
while (LIKELY(powered() && (current < limit)))
|
||||
current += step();
|
||||
return current;
|
||||
}
|
||||
|
||||
// http://graphics.stanford.edu/~seander/bithacks.html#FixedSignExtend
|
||||
int8_t EightBit::Processor::signExtend(int b, uint8_t x) {
|
||||
int8_t EightBit::Processor::signExtend(const int b, uint8_t x) {
|
||||
const uint8_t m = 1 << (b - 1); // mask can be pre-computed if b is fixed
|
||||
x = x & ((1 << b) - 1); // (Skip this if bits in x above position b are already zero.)
|
||||
const auto result = (x ^ m) - m;
|
||||
|
||||
Reference in New Issue
Block a user