[HarfBuzz] harfbuzz: Branch 'master'

Behdad Esfahbod behdad at kemper.freedesktop.org
Tue Jul 22 13:26:53 PDT 2014


 src/hb-face.cc    |    8 ++++----
 src/hb-font.cc    |    4 ++--
 src/hb-unicode.cc |    2 +-
 3 files changed, 7 insertions(+), 7 deletions(-)

New commits:
commit 3f310dc0cae9015c45ba642b9b83d5695c807aad
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Tue Jul 22 16:26:27 2014 -0400

    Disallow changing settings on immutable face
    
    Ouch!

diff --git a/src/hb-face.cc b/src/hb-face.cc
index 71cf49a..9348af7 100644
--- a/src/hb-face.cc
+++ b/src/hb-face.cc
@@ -298,7 +298,7 @@ hb_face_get_user_data (hb_face_t          *face,
 void
 hb_face_make_immutable (hb_face_t *face)
 {
-  if (hb_object_is_inert (face))
+  if (unlikely (hb_object_is_inert (face)))
     return;
 
   face->immutable = true;
@@ -368,7 +368,7 @@ void
 hb_face_set_index (hb_face_t    *face,
 		   unsigned int  index)
 {
-  if (hb_object_is_inert (face))
+  if (face->immutable)
     return;
 
   face->index = index;
@@ -403,7 +403,7 @@ void
 hb_face_set_upem (hb_face_t    *face,
 		  unsigned int  upem)
 {
-  if (hb_object_is_inert (face))
+  if (face->immutable)
     return;
 
   face->upem = upem;
@@ -447,7 +447,7 @@ void
 hb_face_set_glyph_count (hb_face_t    *face,
 			 unsigned int  glyph_count)
 {
-  if (hb_object_is_inert (face))
+  if (face->immutable)
     return;
 
   face->num_glyphs = glyph_count;
diff --git a/src/hb-font.cc b/src/hb-font.cc
index fc4c8eb..4364ca7 100644
--- a/src/hb-font.cc
+++ b/src/hb-font.cc
@@ -357,7 +357,7 @@ hb_font_funcs_get_user_data (hb_font_funcs_t    *ffuncs,
 void
 hb_font_funcs_make_immutable (hb_font_funcs_t *ffuncs)
 {
-  if (hb_object_is_inert (ffuncs))
+  if (unlikely (hb_object_is_inert (ffuncs)))
     return;
 
   ffuncs->immutable = true;
@@ -1034,7 +1034,7 @@ hb_font_get_user_data (hb_font_t          *font,
 void
 hb_font_make_immutable (hb_font_t *font)
 {
-  if (hb_object_is_inert (font))
+  if (unlikely (hb_object_is_inert (font)))
     return;
 
   font->immutable = true;
diff --git a/src/hb-unicode.cc b/src/hb-unicode.cc
index 84e5c06..d59dfb2 100644
--- a/src/hb-unicode.cc
+++ b/src/hb-unicode.cc
@@ -310,7 +310,7 @@ hb_unicode_funcs_get_user_data (hb_unicode_funcs_t *ufuncs,
 void
 hb_unicode_funcs_make_immutable (hb_unicode_funcs_t *ufuncs)
 {
-  if (hb_object_is_inert (ufuncs))
+  if (unlikely (hb_object_is_inert (ufuncs)))
     return;
 
   ufuncs->immutable = true;


More information about the HarfBuzz mailing list