From 65f1d611cfad98817a2b6d350737f38638a57f96 Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Tue, 1 Jul 2025 20:55:53 -0400 Subject: kernel: cons_ansi: Use `scr' var for console calls Signed-off-by: Ian Moffett --- sys/dev/cons/cons_ansi.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'sys/dev/cons') diff --git a/sys/dev/cons/cons_ansi.c b/sys/dev/cons/cons_ansi.c index ab1f22a..fafb4ff 100644 --- a/sys/dev/cons/cons_ansi.c +++ b/sys/dev/cons/cons_ansi.c @@ -60,6 +60,8 @@ ansi_reset(struct ansi_state *statep) int ansi_feed(struct ansi_state *statep, char c) { + struct cons_screen *scr = &g_root_scr; + /* Standard colors */ static uint32_t colortab[] = { ANSI_BLACK, ANSI_RED, @@ -90,7 +92,7 @@ ansi_feed(struct ansi_state *statep, char c) return c; case 2: if (c == 'H') { - cons_clear_scr(&g_root_scr, g_root_scr.bg); + cons_clear_scr(scr, g_root_scr.bg); return ANSI_UPDATE_CURSOR; } break; @@ -100,7 +102,7 @@ ansi_feed(struct ansi_state *statep, char c) /* Reset attributes? */ if (statep->reset_color) { ansi_reset(statep); - cons_reset_color(&g_root_scr); + cons_reset_color(scr); return ANSI_UPDATE_COLOR; } @@ -149,7 +151,7 @@ ansi_feed(struct ansi_state *statep, char c) } if (c == 'm') { - cons_update_color(&g_root_scr, statep->fg, statep->bg); + cons_update_color(scr, statep->fg, statep->bg); ansi_reset(statep); return ANSI_UPDATE_COLOR; } -- cgit v1.2.3