diff options
| author | Craig Barnes <craigbarnes@protonmail.com> | 2021-06-09 08:51:48 +0000 |
|---|---|---|
| committer | Craig Barnes <craigbarnes@protonmail.com> | 2021-06-09 09:00:25 +0000 |
| commit | e030a2ca08d92eb431e9b8e494c63affeeb8c0e1 (patch) | |
| tree | ce71ee2fa54457c89e674dfb913cded9f7e9cef2 /vt.c | |
| parent | changelog: add issue links for previous 2 entries (diff) | |
terminal: add 'charset_designator' enum to make code more self-documenting
This commit also renames the term_set_single_shift_ascii_printer()
function to term_single_shift(), since the former is overly verbose
and not really even accurate.
Diffstat (limited to 'vt.c')
| -rw-r--r-- | vt.c | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -196,13 +196,13 @@ action_execute(struct terminal *term, uint8_t c) case '\x0e': /* SO - shift out */ - term->charsets.selected = 1; /* G1 */ + term->charsets.selected = G1; term_update_ascii_printer(term); break; case '\x0f': /* SI - shift in */ - term->charsets.selected = 0; /* G0 */ + term->charsets.selected = G0; term_update_ascii_printer(term); break; @@ -390,13 +390,13 @@ action_esc_dispatch(struct terminal *term, uint8_t final) case 'n': /* LS2 - Locking Shift 2 */ - term->charsets.selected = 2; /* G2 */ + term->charsets.selected = G2; term_update_ascii_printer(term); break; case 'o': /* LS3 - Locking Shift 3 */ - term->charsets.selected = 3; /* G3 */ + term->charsets.selected = G3; term_update_ascii_printer(term); break; @@ -426,12 +426,12 @@ action_esc_dispatch(struct terminal *term, uint8_t final) case 'N': /* SS2 - Single Shift 2 */ - term_set_single_shift_ascii_printer(term, 2); /* G2 */ + term_single_shift(term, G2); break; case 'O': /* SS3 - Single Shift 3 */ - term_set_single_shift_ascii_printer(term, 3); /* G3 */ + term_single_shift(term, G3); break; case '\\': @@ -460,7 +460,7 @@ action_esc_dispatch(struct terminal *term, uint8_t final) switch (final) { case '0': { size_t idx = term->vt.private - '('; - xassert(idx <= 3); + xassert(idx <= G3); term->charsets.set[idx] = CHARSET_GRAPHIC; term_update_ascii_printer(term); break; @@ -468,7 +468,7 @@ action_esc_dispatch(struct terminal *term, uint8_t final) case 'B': { size_t idx = term->vt.private - '('; - xassert(idx <= 3); + xassert(idx <= G3); term->charsets.set[idx] = CHARSET_ASCII; term_update_ascii_printer(term); break; |
