Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/rasops rasops_mapchar: cosmetics, same object code.
details: https://anonhg.NetBSD.org/src/rev/34cfebadc11e
branches: trunk
changeset: 366130:34cfebadc11e
user: uwe <uwe%NetBSD.org@localhost>
date: Sun May 15 16:12:52 2022 +0000
description:
rasops_mapchar: cosmetics, same object code.
Don't hide the important function call inside an if condition. Don't
reuse a variable, changing what it means in the middle of an
expression.
diffstat:
sys/dev/rasops/rasops.c | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diffs (35 lines):
diff -r 7105b5ffbea3 -r 34cfebadc11e sys/dev/rasops/rasops.c
--- a/sys/dev/rasops/rasops.c Sun May 15 15:06:59 2022 +0000
+++ b/sys/dev/rasops/rasops.c Sun May 15 16:12:52 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rasops.c,v 1.126 2022/05/15 10:29:20 uwe Exp $ */
+/* $NetBSD: rasops.c,v 1.127 2022/05/15 16:12:52 uwe Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rasops.c,v 1.126 2022/05/15 10:29:20 uwe Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rasops.c,v 1.127 2022/05/15 16:12:52 uwe Exp $");
#ifdef _KERNEL_OPT
#include "opt_rasops.h"
@@ -596,13 +596,13 @@
KASSERT(ri->ri_font != NULL);
- if ((c = wsfont_map_unichar(ri->ri_font, c)) < 0 ||
- !CHAR_IN_FONT(c, PICK_FONT(ri, c))) {
+ int glyph = wsfont_map_unichar(ri->ri_font, c);
+ if (glyph < 0 || !CHAR_IN_FONT(glyph, PICK_FONT(ri, glyph))) {
*cp = ' ';
return 0;
}
- *cp = c;
+ *cp = glyph;
return 5;
}
Home |
Main Index |
Thread Index |
Old Index