mirror of
https://github.com/azahar-emu/sirit.git
synced 2026-03-26 05:31:03 +01:00
cmake: Always treat warnings as errors
Enable cast warnings in gcc and clang and always treat warnings as errors. GetWordCount now returns std::size_t for simplicity and the word count is asserted and casted in WordCount (now called CalculateTotalWords. Silence warnings.
This commit is contained in:
@@ -15,7 +15,9 @@ Stream::~Stream() = default;
|
||||
void Stream::Write(std::string_view string) {
|
||||
constexpr std::size_t word_size = 4;
|
||||
const auto size = string.size();
|
||||
auto read = [string, size](std::size_t offset) { return offset < size ? string[offset] : 0; };
|
||||
const auto read = [string, size](std::size_t offset) {
|
||||
return offset < size ? static_cast<u8>(string[offset]) : u8(0);
|
||||
};
|
||||
|
||||
words.reserve(words.size() + size / word_size + 1);
|
||||
for (std::size_t i = 0; i < size; i += word_size) {
|
||||
|
||||
Reference in New Issue
Block a user