diff --git a/Machines/Utility/MemoryFuzzer.cpp b/Machines/Utility/MemoryFuzzer.cpp index 8e6723e5e..e8b68f7c0 100644 --- a/Machines/Utility/MemoryFuzzer.cpp +++ b/Machines/Utility/MemoryFuzzer.cpp @@ -11,14 +11,14 @@ #include void Memory::Fuzz(uint8_t *buffer, std::size_t size) { - unsigned int divider = (unsigned(RAND_MAX) + 1) / 256; + const unsigned int divider = (unsigned(RAND_MAX) + 1) / 256; unsigned int shift = 1, value = 1; while(value < divider) { value <<= 1; - shift++; + ++shift; } - for(std::size_t c = 0; c < size; c++) { + for(size_t c = 0; c < size; c++) { buffer[c] = uint8_t(std::rand() >> shift); } } diff --git a/Machines/Utility/MemoryPacker.cpp b/Machines/Utility/MemoryPacker.cpp index 31f099aaa..a029897fc 100644 --- a/Machines/Utility/MemoryPacker.cpp +++ b/Machines/Utility/MemoryPacker.cpp @@ -9,7 +9,7 @@ #include "MemoryPacker.hpp" void Memory::PackBigEndian16(const std::vector &source, uint16_t *target) { - for(std::size_t c = 0; c < source.size(); c += 2) { + for(size_t c = 0; c < source.size(); c += 2) { target[c >> 1] = uint16_t(source[c] << 8) | uint16_t(source[c+1]); } } diff --git a/Machines/Utility/Typer.hpp b/Machines/Utility/Typer.hpp index 1e9967500..8f73b8c99 100644 --- a/Machines/Utility/Typer.hpp +++ b/Machines/Utility/Typer.hpp @@ -86,11 +86,11 @@ class Typer { std::string string_; std::size_t string_pointer_ = 0; - HalfCycles frequency_; + const HalfCycles frequency_; HalfCycles counter_; int phase_ = 0; - Delegate *delegate_; + Delegate *const delegate_; CharacterMapper &character_mapper_; uint16_t try_type_next_character();