diff options
| author | Hannes Schulze <haschu0103@outlook.de> | 2025-01-23 22:38:06 +0100 |
|---|---|---|
| committer | Hannes Schulze <haschu0103@outlook.de> | 2025-01-23 22:38:06 +0100 |
| commit | a8fc40d4badfd73917171b081f57b88b80bd1e69 (patch) | |
| tree | 6435f8bbcdaedaafdc188a848d4377f7b4457278 /lib/nes/cartridge.cc | |
| parent | 0f24863561b7c609395b59ab73e634509d3111d8 (diff) | |
fix compiler warnings
Diffstat (limited to 'lib/nes/cartridge.cc')
| -rw-r--r-- | lib/nes/cartridge.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/nes/cartridge.cc b/lib/nes/cartridge.cc index 861dc13..d4ade23 100644 --- a/lib/nes/cartridge.cc +++ b/lib/nes/cartridge.cc @@ -25,7 +25,7 @@ namespace nes auto const chr_rom_banks = bytes[5]; auto const control_1 = bytes[6]; auto const control_2 = bytes[7]; - auto const ram_banks = (bytes[8] != 0) ? bytes[8] : 1; + auto const ram_banks = (bytes[8] != 0) ? bytes[8] : 1u; auto const has_trainer = (control_1 & 0b00000100) != 0; res.mapper_number_ = @@ -62,8 +62,8 @@ namespace nes stream.seekg(0, std::ios::end); auto const length = stream.tellg(); stream.seekg(0, std::ios::beg); - auto data = std::vector<std::uint8_t>(length); - stream.read(reinterpret_cast<char*>(data.data()), data.size()); + auto data = std::vector<std::uint8_t>(static_cast<std::size_t>(length)); + stream.read(reinterpret_cast<char*>(data.data()), length); return from_data(data.data(), data.size()); } |
