Date: Sat, 15 Jun 2019 09:15:58 +0000 (UTC) From: Ed Maste <emaste@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349049 - head/usr.bin/vtfontcvt Message-ID: <201906150915.x5F9FwN6082540@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: emaste Date: Sat Jun 15 09:15:58 2019 New Revision: 349049 URL: https://svnweb.freebsd.org/changeset/base/349049 Log: vtfontcvt: add comments in add_glyph During review for PR 205707. Event: Berlin Devsummit 2019 Modified: head/usr.bin/vtfontcvt/vtfontcvt.c Modified: head/usr.bin/vtfontcvt/vtfontcvt.c ============================================================================== --- head/usr.bin/vtfontcvt/vtfontcvt.c Sat Jun 15 07:23:06 2019 (r349048) +++ head/usr.bin/vtfontcvt/vtfontcvt.c Sat Jun 15 09:15:58 2019 (r349049) @@ -176,6 +176,7 @@ add_glyph(const uint8_t *bytes, unsigned int map_idx, 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, } } + /* Allocate new glyph. */ gl = xmalloc(sizeof *gl); gl->g_data = xmalloc(wbytes * height); memcpy(gl->g_data, bytes, wbytes * height);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201906150915.x5F9FwN6082540>