1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-09-27 18:55:48 +00:00

More minor style improvements.

This commit is contained in:
Thomas Harte 2021-03-07 20:49:40 -05:00
parent e9177bbb2a
commit 5c90744f0c
3 changed files with 5 additions and 6 deletions

View File

@ -19,7 +19,7 @@ Parser::Parser(): crc_(0x1021) {
}
int Parser::get_next_bit(const std::shared_ptr<Storage::Tape::Tape> &tape) {
SymbolType symbol = get_next_symbol(tape);
const SymbolType symbol = get_next_symbol(tape);
return (symbol == SymbolType::One) ? 1 : 0;
}
@ -54,8 +54,8 @@ unsigned int Parser::get_next_word(const std::shared_ptr<Storage::Tape::Tape> &t
return result;
}
void Parser::reset_crc() { crc_.reset(); }
uint16_t Parser::get_crc() { return crc_.get_value(); }
void Parser::reset_crc() { crc_.reset(); }
uint16_t Parser::get_crc() const { return crc_.get_value(); }
void Parser::acorn_shifter_output_bit(int value) {
push_symbol(value ? SymbolType::One : SymbolType::Zero);

View File

@ -55,7 +55,7 @@ class Parser: public Storage::Tape::Parser<SymbolType>, public Shifter::Delegate
unsigned int get_next_short(const std::shared_ptr<Storage::Tape::Tape> &tape);
unsigned int get_next_word(const std::shared_ptr<Storage::Tape::Tape> &tape);
void reset_crc();
uint16_t get_crc();
uint16_t get_crc() const;
private:
void acorn_shifter_output_bit(int value) override;

View File

@ -45,8 +45,7 @@ class Parser: public Storage::Tape::PulseClassificationParser<WaveType, SymbolTy
bool wave_was_high_;
float cycle_length_;
struct Pattern
{
struct Pattern {
WaveType type;
int count = 0;
};