On 10/07/19(Wed) 12:59, Martin Pieuchot wrote: > Some free(9) sizes & fix to make wsfont_remove() compile. This function > is #ifndef for the moment. That's mainly for coherency and to reduce > grep noise.
Simpler approach that removed compiled-out wsfont_remove(), so we don't have to keep track of the size separately from height & width since they can be different & swapper. Ok? Index: dev/wsfont/wsfont.c =================================================================== RCS file: /cvs/src/sys/dev/wsfont/wsfont.c,v retrieving revision 1.55 diff -u -p -r1.55 wsfont.c --- dev/wsfont/wsfont.c 9 Jan 2019 11:23:32 -0000 1.55 +++ dev/wsfont/wsfont.c 10 Jul 2019 17:23:30 -0000 @@ -533,42 +533,6 @@ wsfont_add(struct wsdisplay_font *font, } /* - * Remove a font. - */ -#ifdef notyet -int -wsfont_remove(int cookie) -{ - struct font *ent; - int s; - - s = splhigh(); - - if ((ent = wsfont_find0(cookie)) == NULL) { - splx(s); - return (-1); - } - - if ((ent->flg & WSFONT_BUILTIN) != 0 || ent->lockcount != 0) { - splx(s); - return (-1); - } - - /* Don't free statically allocated font data */ - if ((ent->flg & WSFONT_STATIC) != 0) { - free(ent->font->data, M_DEVBUF, 0); - free(ent->font, M_DEVBUF, 0); - } - - /* Remove from list, free entry */ - TAILQ_REMOVE(&list, ent, chain); - free(ent, M_DEVBUF, 0); - splx(s); - return (0); -} -#endif - -/* * Lock a given font and return new lockcount. This fails if the cookie * is invalid, or if the font is already locked and the bit/byte order * requested by the caller differs.