mirror of
https://github.com/opnsense/src.git
synced 2026-06-09 08:43:19 -04:00
vtfontcvt: add comments in add_glyph
During review for PR 205707. Event: Berlin Devsummit 2019
This commit is contained in:
parent
0b253f2ba4
commit
cfe607d5bf
1 changed files with 2 additions and 0 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue