1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-11-26 08:49:37 +00:00

Improves const correctness.

This commit is contained in:
Thomas Harte 2021-03-23 16:59:26 -04:00
parent 496a294c71
commit ad8cb52f11
2 changed files with 2 additions and 2 deletions

View File

@ -134,7 +134,7 @@ bool Typer::type_next_character() {
// MARK: - Character mapper // MARK: - Character mapper
uint16_t *CharacterMapper::table_lookup_sequence_for_character(KeySequence *sequences, std::size_t length, char character) const { 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); std::size_t ucharacter = size_t((unsigned char)character);
if(ucharacter >= (length / sizeof(KeySequence))) return nullptr; if(ucharacter >= (length / sizeof(KeySequence))) return nullptr;
if(sequences[ucharacter][0] == MachineTypes::MappedKeyboardMachine::KeyNotMapped) return nullptr; if(sequences[ucharacter][0] == MachineTypes::MappedKeyboardMachine::KeyNotMapped) return nullptr;

View File

@ -48,7 +48,7 @@ class CharacterMapper {
with @c length entries, returns the sequence for character @c character if it exists; otherwise with @c length entries, returns the sequence for character @c character if it exists; otherwise
returns @c nullptr. returns @c nullptr.
*/ */
uint16_t *table_lookup_sequence_for_character(KeySequence *sequences, std::size_t length, char character) const; const uint16_t *table_lookup_sequence_for_character(const KeySequence *sequences, std::size_t length, char character) const;
}; };
/*! /*!