From 8f2cc27067774c0cdfef4a3ae5a1dbb72d062bb6 Mon Sep 17 00:00:00 2001 From: Bruce Evans Date: Fri, 10 Mar 2017 11:44:09 +0000 Subject: [PATCH] Start fixing some bugs in attribute handling. This change just does cleanups missed in r56043 17 years ago. The default attributes were still stored in structs for the purpose of changing them and passing around pointers to the defaults, but r56043 added another layer that made the defaults invariant and only used for initialization and reset. Just use the defaults directly. This was already done for the kernel defaults. The defaults for reverse attributes aren't actually used, but are ignored in layers that no longer support them. --- sys/dev/syscons/syscons.c | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/sys/dev/syscons/syscons.c b/sys/dev/syscons/syscons.c index d2994676006..d3a5899ad34 100644 --- a/sys/dev/syscons/syscons.c +++ b/sys/dev/syscons/syscons.c @@ -91,16 +91,6 @@ __FBSDID("$FreeBSD$"); /* NULL-safe version of "tty_opened()" */ #define tty_opened_ns(tp) ((tp) != NULL && tty_opened(tp)) -typedef struct default_attr { - int std_color; /* normal hardware color */ - int rev_color; /* reverse hardware color */ -} default_attr; - -static default_attr user_default = { - SC_NORM_ATTR, - SC_NORM_REV_ATTR, -}; - static u_char sc_kattrtab[MAXCPU]; static int sc_console_unit = -1; @@ -3162,9 +3152,7 @@ scinit(int unit, int flags) if (sc_init_emulator(scp, SC_DFLT_TERM)) sc_init_emulator(scp, "*"); - (*scp->tsw->te_default_attr)(scp, - user_default.std_color, - user_default.rev_color); + (*scp->tsw->te_default_attr)(scp, SC_NORM_ATTR, SC_NORM_REV_ATTR); } else { /* assert(sc_malloc) */ sc->dev = malloc(sizeof(struct tty *)*sc->vtys, M_DEVBUF, @@ -3578,8 +3566,7 @@ sc_init_emulator(scr_stat *scp, char *name) scp->rndr = rndr; scp->rndr->init(scp); - /* XXX */ - (*sw->te_default_attr)(scp, user_default.std_color, user_default.rev_color); + (*sw->te_default_attr)(scp, SC_NORM_ATTR, SC_NORM_REV_ATTR); sc_clear_screen(scp); return 0;