From b92b9d7e5290eaa83e94fd40cddaee71628a3c2a Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Sun, 21 Oct 2018 17:42:51 -0700 Subject: [PATCH] [colr] Move compare function into a static Not sure if MSVC would be unhappy about this. --- src/hb-ot-color-colr-table.hh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/hb-ot-color-colr-table.hh b/src/hb-ot-color-colr-table.hh index 35e058c6c..aef364934 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;