diff options
author | Behdad Esfahbod <behdad@behdad.org> | 2018-10-21 17:42:51 -0700 |
---|---|---|
committer | Behdad Esfahbod <behdad@behdad.org> | 2018-10-21 17:42:51 -0700 |
commit | a8f420350ac11f4ce571be748b386fe3f5db3aff (patch) | |
tree | 103515f93d4ab05cdf94f4486028f42fbe5a1af0 | |
parent | e63817e444a599f1fbd35850f0d6d20dbd9374db (diff) | |
download | harfbuzz-ot-color.tar.gz |
[colr] Move compare function into a staticot-color
Not sure if MSVC would be unhappy about this.
-rw-r--r-- | src/hb-ot-color-colr-table.hh | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/hb-ot-color-colr-table.hh b/src/hb-ot-color-colr-table.hh index 35e058c6..aef36493 100644 --- a/src/hb-ot-color-colr-table.hh +++ b/src/hb-ot-color-colr-table.hh @@ -73,6 +73,13 @@ struct BaseGlyphRecord return g < glyphId ? -1 : g > glyphId ? 1 : 0; } + static int cmp (const void *pa, const void *pb) + { + const hb_codepoint_t *a = (const hb_codepoint_t *) pa; + const BaseGlyphRecord *b = (const BaseGlyphRecord *) pb; + return b->cmp (*a); + } + public: GlyphID glyphId; /* Glyph ID of reference glyph */ HBUINT16 firstLayerIdx; /* Index (from beginning of @@ -86,13 +93,6 @@ struct BaseGlyphRecord DEFINE_SIZE_STATIC (6); }; -static int compare_bgr (const void *pa, const void *pb) -{ - const hb_codepoint_t *a = (const hb_codepoint_t *) pa; - const BaseGlyphRecord *b = (const BaseGlyphRecord *) pb; - return b->cmp (*a); -} - struct COLR { static const hb_tag_t tableTag = HB_OT_TAG_COLR; @@ -103,7 +103,7 @@ struct COLR { const BaseGlyphRecord* record; record = (BaseGlyphRecord *) bsearch (&glyph_id, &(this+baseGlyphsZ), numBaseGlyphs, - sizeof (BaseGlyphRecord), compare_bgr); + sizeof (BaseGlyphRecord), BaseGlyphRecord::cmp); if (unlikely (!record)) return false; |