aboutsummaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorEd Maste <emaste@FreeBSD.org>2019-06-15 09:15:58 +0000
committerEd Maste <emaste@FreeBSD.org>2019-06-15 09:15:58 +0000
commitcfe607d5bf07971741f27c8dd779b635dcb86688 (patch)
treeac151e3ed61e9f569c0134dd75fe40e2c4d93368 /usr.bin
parent0b253f2ba45d9467f29fde8d56518f2ae7e9413d (diff)
downloadsrc-cfe607d5bf07971741f27c8dd779b635dcb86688.tar.gz
src-cfe607d5bf07971741f27c8dd779b635dcb86688.zip
vtfontcvt: add comments in add_glyph
During review for PR 205707. Event: Berlin Devsummit 2019
Notes
Notes: svn path=/head/; revision=349049
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/vtfontcvt/vtfontcvt.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/usr.bin/vtfontcvt/vtfontcvt.c b/usr.bin/vtfontcvt/vtfontcvt.c
index d3c43f424839..d4d17b23e7a9 100644
--- a/usr.bin/vtfontcvt/vtfontcvt.c
+++ b/usr.bin/vtfontcvt/vtfontcvt.c
@@ -176,6 +176,7 @@ add_glyph(const uint8_t *bytes, unsigned int map_idx, int fallback)
glyph_total++;
glyph_count[map_idx]++;
+ /* Return existing glyph if we have an identical one. */
hash = fnv_32_buf(bytes, wbytes * height, FNV1_32_INIT) % FONTCVT_NHASH;
SLIST_FOREACH(gl, &glyph_hash[hash], g_hash) {
if (memcmp(gl->g_data, bytes, wbytes * height) == 0) {
@@ -184,6 +185,7 @@ add_glyph(const uint8_t *bytes, unsigned int map_idx, int fallback)
}
}
+ /* Allocate new glyph. */
gl = xmalloc(sizeof *gl);
gl->g_data = xmalloc(wbytes * height);
memcpy(gl->g_data, bytes, wbytes * height);