Module Name: src Committed By: uwe Date: Sun May 15 16:12:52 UTC 2022
Modified Files: src/sys/dev/rasops: rasops.c Log Message: 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. To generate a diff of this commit: cvs rdiff -u -r1.126 -r1.127 src/sys/dev/rasops/rasops.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/dev/rasops/rasops.c diff -u src/sys/dev/rasops/rasops.c:1.126 src/sys/dev/rasops/rasops.c:1.127 --- src/sys/dev/rasops/rasops.c:1.126 Sun May 15 10:29:20 2022 +++ src/sys/dev/rasops/rasops.c Sun May 15 16:12:52 2022 @@ -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 @@ rasops_mapchar(void *cookie, int c, u_in 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; }