diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2023-08-30 13:38:18 +0400 |
---|---|---|
committer | Marc-André Lureau <marcandre.lureau@redhat.com> | 2023-09-04 14:57:44 +0400 |
commit | 9db018ac56119ee8e0a87a1a340276e4c8d86392 (patch) | |
tree | 37f7b15625b946966332d6c8ea515b9f64bf24a1 /ui/console.c | |
parent | 32aa1f8dee3b2e8a4606bc2836a022f1ff5e7f0c (diff) |
ui/vc: change the argument for QemuTextConsole
Those functions are specifc to text/vc console, make that explicit from
the argument type.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20230830093843.3531473-45-marcandre.lureau@redhat.com>
Diffstat (limited to 'ui/console.c')
-rw-r--r-- | ui/console.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/ui/console.c b/ui/console.c index e2b0b9ce06..e4d61794bb 100644 --- a/ui/console.c +++ b/ui/console.c @@ -1135,16 +1135,12 @@ static void kbd_send_chars(QemuTextConsole *s) } /* called when an ascii key is pressed */ -void kbd_put_keysym_console(QemuConsole *con, int keysym) +void kbd_put_keysym_console(QemuTextConsole *s, int keysym) { - QemuTextConsole *s = (QemuTextConsole *)object_dynamic_cast(OBJECT(con), TYPE_QEMU_TEXT_CONSOLE); uint8_t buf[16], *q; int c; uint32_t num_free; - if (!s) - return; - switch(keysym) { case QEMU_KEY_CTRL_UP: console_scroll(s, -1); @@ -1214,7 +1210,7 @@ static const int ctrl_qcode_to_keysym[Q_KEY_CODE__MAX] = { [Q_KEY_CODE_PGDN] = QEMU_KEY_CTRL_PAGEDOWN, }; -bool kbd_put_qcode_console(QemuConsole *s, int qcode, bool ctrl) +bool kbd_put_qcode_console(QemuTextConsole *s, int qcode, bool ctrl) { int keysym; @@ -1226,7 +1222,7 @@ bool kbd_put_qcode_console(QemuConsole *s, int qcode, bool ctrl) return true; } -void kbd_put_string_console(QemuConsole *s, const char *str, int len) +void kbd_put_string_console(QemuTextConsole *s, const char *str, int len) { int i; @@ -1237,7 +1233,9 @@ void kbd_put_string_console(QemuConsole *s, const char *str, int len) void kbd_put_keysym(int keysym) { - kbd_put_keysym_console(active_console, keysym); + if (QEMU_IS_TEXT_CONSOLE(active_console)) { + kbd_put_keysym_console(QEMU_TEXT_CONSOLE(active_console), keysym); + } } static void text_console_invalidate(void *opaque) |