Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/wsfont wsfont.c: use __arraycount instead of definin...



details:   https://anonhg.NetBSD.org/src/rev/7ebab9fe365e
branches:  trunk
changeset: 366691:7ebab9fe365e
user:      uwe <uwe%NetBSD.org@localhost>
date:      Wed Jun 08 19:47:10 2022 +0000

description:
wsfont.c: use __arraycount instead of defining it locally

diffstat:

 sys/dev/wsfont/wsfont.c |  7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diffs (35 lines):

diff -r c0e0c2ba67fa -r 7ebab9fe365e sys/dev/wsfont/wsfont.c
--- a/sys/dev/wsfont/wsfont.c   Wed Jun 08 19:27:37 2022 +0000
+++ b/sys/dev/wsfont/wsfont.c   Wed Jun 08 19:47:10 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: wsfont.c,v 1.77 2021/12/24 18:12:58 jmcneill Exp $     */
+/*     $NetBSD: wsfont.c,v 1.78 2022/06/08 19:47:10 uwe Exp $  */
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2002 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: wsfont.c,v 1.77 2021/12/24 18:12:58 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wsfont.c,v 1.78 2022/06/08 19:47:10 uwe Exp $");
 
 #include "opt_wsfont.h"
 
@@ -1045,7 +1045,6 @@
        { iso7_level1, 0, 0x26 },       /* WSDISPLAY_FONTENC_ISO7 */
 };
 
-#define MAX_ENCODING (sizeof(encodings) / sizeof(encodings[0]))
 
 /*
  * Remap Unicode character to glyph
@@ -1057,7 +1056,7 @@
        const struct wsfont_level2_glyphmap *map2;
        int hi, lo;
 
-       if (font->encoding < 0 || font->encoding >= MAX_ENCODING)
+       if (font->encoding < 0 || font->encoding >= __arraycount(encodings))
                return (-1);
 
        hi = (c >> 8);



Home | Main Index | Thread Index | Old Index