1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-12-27 01:31:42 +00:00

Resolves signed comparison mismatches.

This commit is contained in:
Thomas Harte 2020-07-24 21:55:33 -04:00
parent 9b75287a52
commit 8af35bc6bb
2 changed files with 3 additions and 3 deletions

View File

@ -247,10 +247,10 @@ void TZX::get_data_block(const DataBlock &data_block) {
void TZX::get_data(const Data &data) {
// Output data.
for(unsigned int c = 0; c < data.data_length; c++) {
for(decltype(data.data_length) c = 0; c < data.data_length; c++) {
uint8_t next_byte = file_.get8();
unsigned int bits = (c != data.data_length-1) ? 8 : data.number_of_bits_in_final_byte;
auto bits = (c != data.data_length-1) ? 8 : data.number_of_bits_in_final_byte;
while(bits--) {
unsigned int pulse_length = (next_byte & 0x80) ? data.length_of_one_bit_pulse : data.length_of_zero_bit_pulse;
next_byte <<= 1;

View File

@ -77,7 +77,7 @@ class TZX: public PulseQueuedTape {
unsigned int length_of_one_bit_pulse;
unsigned int number_of_bits_in_final_byte;
unsigned int pause_after_block;
long data_length;
uint32_t data_length;
};
struct DataBlock {