diff options
author | Chris Young <chris@unsatisfactorysoftware.co.uk> | 2015-02-28 12:41:50 +0000 |
---|---|---|
committer | Chris Young <chris@unsatisfactorysoftware.co.uk> | 2015-02-28 12:41:50 +0000 |
commit | df25135a4d2007510b03487b517dad13b23f1a98 (patch) | |
tree | db7e40601006abff000ed78d2dea1ce0d0a2cd80 /amiga/font.c | |
parent | 5f72dd2f0f97222c8abf41b7ed06c7673aa2e532 (diff) | |
download | netsurf-df25135a4d2007510b03487b517dad13b23f1a98.tar.gz netsurf-df25135a4d2007510b03487b517dad13b23f1a98.tar.bz2 |
micro-optimisation
Diffstat (limited to 'amiga/font.c')
-rw-r--r-- | amiga/font.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/amiga/font.c b/amiga/font.c index f930f77d6..1f3269e5c 100644 --- a/amiga/font.c +++ b/amiga/font.c @@ -549,7 +549,7 @@ static struct OutlineFont *ami_open_outline_font(const plot_font_style_t *fstyle return NULL; } -static int32 ami_font_plot_glyph(struct OutlineFont *ofont, struct RastPort *rp, +static inline int32 ami_font_plot_glyph(struct OutlineFont *ofont, struct RastPort *rp, uint16 *char1, uint16 *char2, uint32 x, uint32 y, uint32 emwidth, bool aa) { struct GlyphMap *glyph; @@ -562,12 +562,12 @@ static int32 ami_font_plot_glyph(struct OutlineFont *ofont, struct RastPort *rp, struct BulletBase *BulletBase = ofont->BulletBase; #endif - if ((*char1 >= 0xD800) && (*char1 <= 0xDBFF)) { + if (__builtin_expect(((*char1 >= 0xD800) && (*char1 <= 0xDBFF)), 0)) { /* We don't support UTF-16 surrogates yet, so just return. */ return 0; } - if ((*char2 >= 0xD800) && (*char2 <= 0xDBFF)) { + if (__builtin_expect(((*char2 >= 0xD800) && (*char2 <= 0xDBFF)), 0)) { /* Don't attempt to kern a UTF-16 surrogate */ *char2 = 0; } @@ -640,7 +640,7 @@ static int32 ami_font_plot_glyph(struct OutlineFont *ofont, struct RastPort *rp, return char_advance; } -static int32 ami_font_width_glyph(struct OutlineFont *ofont, +static inline int32 ami_font_width_glyph(struct OutlineFont *ofont, const uint16 *char1, const uint16 *char2, uint32 emwidth) { int32 char_advance = 0; @@ -653,12 +653,12 @@ static int32 ami_font_width_glyph(struct OutlineFont *ofont, struct BulletBase *BulletBase = ofont->BulletBase; #endif - if ((*char1 >= 0xD800) && (*char1 <= 0xDBFF)) { + if (__builtin_expect(((*char1 >= 0xD800) && (*char1 <= 0xDBFF)), 0)) { /* We don't support UTF-16 surrogates yet, so just return. */ return 0; } - - if ((*char2 >= 0xD800) && (*char2 <= 0xDBFF)) { + + if (__builtin_expect(((*char2 >= 0xD800) && (*char2 <= 0xDBFF)), 0)) { /* Don't attempt to kern a UTF-16 surrogate */ skip_c2 = true; } |