mirror of
https://github.com/TomHarte/CLK.git
synced 2024-12-26 09:29:45 +00:00
Adjusted the Acorn tape parser to avoid signed left shifts.
This commit is contained in:
parent
ba5f668338
commit
7c8e830b90
@ -41,14 +41,14 @@ int Parser::get_next_byte(const std::shared_ptr<Storage::Tape::Tape> &tape) {
|
||||
return value;
|
||||
}
|
||||
|
||||
int Parser::get_next_short(const std::shared_ptr<Storage::Tape::Tape> &tape) {
|
||||
int result = get_next_byte(tape);
|
||||
result |= get_next_byte(tape) << 8;
|
||||
unsigned int Parser::get_next_short(const std::shared_ptr<Storage::Tape::Tape> &tape) {
|
||||
unsigned int result = static_cast<unsigned int>(get_next_byte(tape));
|
||||
result |= static_cast<unsigned int>(get_next_byte(tape)) << 8;
|
||||
return result;
|
||||
}
|
||||
|
||||
int Parser::get_next_word(const std::shared_ptr<Storage::Tape::Tape> &tape) {
|
||||
int result = get_next_short(tape);
|
||||
unsigned int Parser::get_next_word(const std::shared_ptr<Storage::Tape::Tape> &tape) {
|
||||
unsigned int result = get_next_short(tape);
|
||||
result |= get_next_short(tape) << 8;
|
||||
return result;
|
||||
}
|
||||
|
@ -53,8 +53,8 @@ class Parser: public Storage::Tape::Parser<SymbolType>, public Shifter::Delegate
|
||||
|
||||
int get_next_bit(const std::shared_ptr<Storage::Tape::Tape> &tape);
|
||||
int get_next_byte(const std::shared_ptr<Storage::Tape::Tape> &tape);
|
||||
int get_next_short(const std::shared_ptr<Storage::Tape::Tape> &tape);
|
||||
int get_next_word(const std::shared_ptr<Storage::Tape::Tape> &tape);
|
||||
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();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user