1
0
mirror of https://github.com/TomHarte/CLK.git synced 2026-04-25 11:17:26 +00:00

Resolves potential source of errors: specifying incorrect table size.

(Having made exactly this mistake with the ZX Spectrum)
This commit is contained in:
Thomas Harte
2021-04-24 12:10:28 -04:00
parent 17f11a3be3
commit 9cc747b3e2
7 changed files with 15 additions and 21 deletions
-10
View File
@@ -131,13 +131,3 @@ bool Typer::type_next_character() {
return true;
}
// MARK: - Character mapper
const uint16_t *CharacterMapper::table_lookup_sequence_for_character(const KeySequence *sequences, std::size_t length, char character) const {
std::size_t ucharacter = size_t((unsigned char)character);
if(ucharacter >= (length / sizeof(KeySequence))) return nullptr;
if(sequences[ucharacter][0] == MachineTypes::MappedKeyboardMachine::KeyNotMapped) return nullptr;
return sequences[ucharacter];
}