[HarfBuzz] harfbuzz: Branch 'master' - 2 commits

Behdad Esfahbod behdad at kemper.freedesktop.org
Tue Oct 30 21:04:44 UTC 2018


 docs/harfbuzz-sections.txt    |    3 -
 src/hb-debug.hh               |    6 +-
 src/hb-ot-color-cpal-table.hh |   12 ++---
 src/hb-ot-color.cc            |    6 +-
 src/hb-ot-color.h             |    4 -
 src/hb-ot-layout.cc           |   44 +++++++++---------
 src/hb-ot-layout.h            |   28 ++++++------
 src/hb-ot-name-table.hh       |    6 +-
 src/hb-ot-name.cc             |   38 ++++++++--------
 src/hb-ot-name.h              |   98 +++++++++++++++++++++---------------------
 src/hb-set.hh                 |    4 -
 test/api/test-ot-color.c      |   30 ++++++------
 test/api/test-ot-name.c       |    8 +--
 13 files changed, 144 insertions(+), 143 deletions(-)

New commits:
commit a7aba99baab2d6e6105675ceedbe22222fa0f166
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Tue Oct 30 14:04:09 2018 -0700

    [name] Rename hb_name_id_t to hb_ot_name_id_t
    
    https://github.com/harfbuzz/harfbuzz/pull/1254

diff --git a/docs/harfbuzz-sections.txt b/docs/harfbuzz-sections.txt
index c33a1c12..6a498e94 100644
--- a/docs/harfbuzz-sections.txt
+++ b/docs/harfbuzz-sections.txt
@@ -481,7 +481,8 @@ hb_ot_font_set_funcs
 
 <SECTION>
 <FILE>hb-ot-name</FILE>
-hb_name_id_t
+hb_ot_name_id_t
+HB_OT_NAME_ID_INVALID
 hb_ot_name_entry_t
 hb_ot_name_list_names
 hb_ot_name_get_utf16
diff --git a/src/hb-ot-color-cpal-table.hh b/src/hb-ot-color-cpal-table.hh
index 0b4bf377..df4d9b4e 100644
--- a/src/hb-ot-color-cpal-table.hh
+++ b/src/hb-ot-color-cpal-table.hh
@@ -58,21 +58,21 @@ struct CPALV1Tail
 	   hb_array (base+paletteFlagsZ, palette_count)[palette_index];
   }
 
-  inline hb_name_id_t
+  inline hb_ot_name_id_t
   get_palette_name_id (const void *base,
 		       unsigned int palette_index,
 		       unsigned int palette_count) const
   {
-    if (!paletteLabelsZ) return HB_NAME_ID_INVALID;
+    if (!paletteLabelsZ) return HB_OT_NAME_ID_INVALID;
     return hb_array (base+paletteLabelsZ, palette_count)[palette_index];
   }
 
-  inline hb_name_id_t
+  inline hb_ot_name_id_t
   get_color_name_id (const void *base,
 		     unsigned int color_index,
 		     unsigned int color_count) const
   {
-    if (!colorLabelsZ) return HB_NAME_ID_INVALID;
+    if (!colorLabelsZ) return HB_OT_NAME_ID_INVALID;
     return hb_array (base+colorLabelsZ, color_count)[color_index];
   }
 
@@ -123,10 +123,10 @@ struct CPAL
   inline hb_ot_color_palette_flags_t get_palette_flags (unsigned int palette_index) const
   { return v1 ().get_palette_flags (this, palette_index, numPalettes); }
 
-  inline hb_name_id_t get_palette_name_id (unsigned int palette_index) const
+  inline hb_ot_name_id_t get_palette_name_id (unsigned int palette_index) const
   { return v1 ().get_palette_name_id (this, palette_index, numPalettes); }
 
-  inline hb_name_id_t get_color_name_id (unsigned int color_index) const
+  inline hb_ot_name_id_t get_color_name_id (unsigned int color_index) const
   { return v1 ().get_color_name_id (this, color_index, numColors); }
 
   inline unsigned int get_palette_colors (unsigned int  palette_index,
diff --git a/src/hb-ot-color.cc b/src/hb-ot-color.cc
index a3cd6190..11fc12af 100644
--- a/src/hb-ot-color.cc
+++ b/src/hb-ot-color.cc
@@ -129,11 +129,11 @@ hb_ot_color_palette_get_count (hb_face_t *face)
  * have themed palettes like "Spring", "Summer", "Fall", and "Winter".
  *
  * Returns: an identifier within @face's `name` table.
- * If the requested palette has no name the result is #HB_NAME_ID_INVALID.
+ * If the requested palette has no name the result is #HB_OT_NAME_ID_INVALID.
  *
  * Since: 2.1.0
  */
-hb_name_id_t
+hb_ot_name_id_t
 hb_ot_color_palette_get_name_id (hb_face_t *face,
 				 unsigned int palette_index)
 {
@@ -149,7 +149,7 @@ hb_ot_color_palette_get_name_id (hb_face_t *face,
  *
  * Since: 2.1.0
  */
-hb_name_id_t
+hb_ot_name_id_t
 hb_ot_color_palette_color_get_name_id (hb_face_t *face,
 				       unsigned int color_index)
 {
diff --git a/src/hb-ot-color.h b/src/hb-ot-color.h
index 1cc04d4f..e2d9a962 100644
--- a/src/hb-ot-color.h
+++ b/src/hb-ot-color.h
@@ -49,11 +49,11 @@ hb_ot_color_has_palettes (hb_face_t *face);
 HB_EXTERN unsigned int
 hb_ot_color_palette_get_count (hb_face_t *face);
 
-HB_EXTERN hb_name_id_t
+HB_EXTERN hb_ot_name_id_t
 hb_ot_color_palette_get_name_id (hb_face_t *face,
 				 unsigned int palette_index);
 
-HB_EXTERN hb_name_id_t
+HB_EXTERN hb_ot_name_id_t
 hb_ot_color_palette_color_get_name_id (hb_face_t *face,
 				       unsigned int color_index);
 
diff --git a/src/hb-ot-layout.cc b/src/hb-ot-layout.cc
index ea59b835..a8cfcf55 100644
--- a/src/hb-ot-layout.cc
+++ b/src/hb-ot-layout.cc
@@ -1053,12 +1053,12 @@ hb_ot_layout_position_finish_offsets (hb_font_t *font, hb_buffer_t *buffer)
  * Since: 0.9.10
  **/
 hb_bool_t
-hb_ot_layout_get_size_params (hb_face_t    *face,
-			      unsigned int *design_size,       /* OUT.  May be NULL */
-			      unsigned int *subfamily_id,      /* OUT.  May be NULL */
-			      hb_name_id_t *subfamily_name_id, /* OUT.  May be NULL */
-			      unsigned int *range_start,       /* OUT.  May be NULL */
-			      unsigned int *range_end          /* OUT.  May be NULL */)
+hb_ot_layout_get_size_params (hb_face_t       *face,
+			      unsigned int    *design_size,       /* OUT.  May be NULL */
+			      unsigned int    *subfamily_id,      /* OUT.  May be NULL */
+			      hb_ot_name_id_t *subfamily_name_id, /* OUT.  May be NULL */
+			      unsigned int    *range_start,       /* OUT.  May be NULL */
+			      unsigned int    *range_end          /* OUT.  May be NULL */)
 {
   const OT::GPOS &gpos = _get_gpos (face);
   const hb_tag_t tag = HB_TAG ('s','i','z','e');
@@ -1086,7 +1086,7 @@ hb_ot_layout_get_size_params (hb_face_t    *face,
 
   if (design_size) *design_size = 0;
   if (subfamily_id) *subfamily_id = 0;
-  if (subfamily_name_id) *subfamily_name_id = HB_NAME_ID_INVALID;
+  if (subfamily_name_id) *subfamily_name_id = HB_OT_NAME_ID_INVALID;
   if (range_start) *range_start = 0;
   if (range_end) *range_end = 0;
 
@@ -1118,14 +1118,14 @@ hb_ot_layout_get_size_params (hb_face_t    *face,
  * Since: 2.0.0
  **/
 hb_bool_t
-hb_ot_layout_feature_get_name_ids (hb_face_t    *face,
-				   hb_tag_t      table_tag,
-				   unsigned int  feature_index,
-				   hb_name_id_t *label_id,             /* OUT.  May be NULL */
-				   hb_name_id_t *tooltip_id,           /* OUT.  May be NULL */
-				   hb_name_id_t *sample_id,            /* OUT.  May be NULL */
-				   unsigned int *num_named_parameters, /* OUT.  May be NULL */
-				   hb_name_id_t *first_param_id        /* OUT.  May be NULL */)
+hb_ot_layout_feature_get_name_ids (hb_face_t       *face,
+				   hb_tag_t         table_tag,
+				   unsigned int     feature_index,
+				   hb_ot_name_id_t *label_id,             /* OUT.  May be NULL */
+				   hb_ot_name_id_t *tooltip_id,           /* OUT.  May be NULL */
+				   hb_ot_name_id_t *sample_id,            /* OUT.  May be NULL */
+				   unsigned int    *num_named_parameters, /* OUT.  May be NULL */
+				   hb_ot_name_id_t *first_param_id        /* OUT.  May be NULL */)
 {
   const OT::GSUBGPOS &g = get_gsubgpos_table (face, table_tag);
 
@@ -1141,10 +1141,10 @@ hb_ot_layout_feature_get_name_ids (hb_face_t    *face,
     {
       if (label_id) *label_id = ss_params.uiNameID;
       // ssXX features don't have the rest
-      if (tooltip_id) *tooltip_id = HB_NAME_ID_INVALID;
-      if (sample_id) *sample_id = HB_NAME_ID_INVALID;
+      if (tooltip_id) *tooltip_id = HB_OT_NAME_ID_INVALID;
+      if (sample_id) *sample_id = HB_OT_NAME_ID_INVALID;
       if (num_named_parameters) *num_named_parameters = 0;
-      if (first_param_id) *first_param_id = HB_NAME_ID_INVALID;
+      if (first_param_id) *first_param_id = HB_OT_NAME_ID_INVALID;
       return true;
     }
     const OT::FeatureParamsCharacterVariants& cv_params =
@@ -1160,11 +1160,11 @@ hb_ot_layout_feature_get_name_ids (hb_face_t    *face,
     }
   }
 
-  if (label_id) *label_id = HB_NAME_ID_INVALID;
-  if (tooltip_id) *tooltip_id = HB_NAME_ID_INVALID;
-  if (sample_id) *sample_id = HB_NAME_ID_INVALID;
+  if (label_id) *label_id = HB_OT_NAME_ID_INVALID;
+  if (tooltip_id) *tooltip_id = HB_OT_NAME_ID_INVALID;
+  if (sample_id) *sample_id = HB_OT_NAME_ID_INVALID;
   if (num_named_parameters) *num_named_parameters = 0;
-  if (first_param_id) *first_param_id = HB_NAME_ID_INVALID;
+  if (first_param_id) *first_param_id = HB_OT_NAME_ID_INVALID;
   return false;
 }
 
diff --git a/src/hb-ot-layout.h b/src/hb-ot-layout.h
index 287d0221..7a016c39 100644
--- a/src/hb-ot-layout.h
+++ b/src/hb-ot-layout.h
@@ -364,23 +364,23 @@ Xhb_ot_layout_lookup_position (hb_font_t            *font,
 /* Optical 'size' feature info.  Returns true if found.
  * https://docs.microsoft.com/en-us/typography/opentype/spec/features_pt#size */
 HB_EXTERN hb_bool_t
-hb_ot_layout_get_size_params (hb_face_t    *face,
-			      unsigned int *design_size,       /* OUT.  May be NULL */
-			      unsigned int *subfamily_id,      /* OUT.  May be NULL */
-			      hb_name_id_t *subfamily_name_id, /* OUT.  May be NULL */
-			      unsigned int *range_start,       /* OUT.  May be NULL */
-			      unsigned int *range_end          /* OUT.  May be NULL */);
+hb_ot_layout_get_size_params (hb_face_t       *face,
+			      unsigned int    *design_size,       /* OUT.  May be NULL */
+			      unsigned int    *subfamily_id,      /* OUT.  May be NULL */
+			      hb_ot_name_id_t *subfamily_name_id, /* OUT.  May be NULL */
+			      unsigned int    *range_start,       /* OUT.  May be NULL */
+			      unsigned int    *range_end          /* OUT.  May be NULL */);
 
 
 HB_EXTERN hb_bool_t
-hb_ot_layout_feature_get_name_ids (hb_face_t    *face,
-				   hb_tag_t      table_tag,
-				   unsigned int  feature_index,
-				   hb_name_id_t *label_id             /* OUT.  May be NULL */,
-				   hb_name_id_t *tooltip_id           /* OUT.  May be NULL */,
-				   hb_name_id_t *sample_id            /* OUT.  May be NULL */,
-				   unsigned int *num_named_parameters /* OUT.  May be NULL */,
-				   hb_name_id_t *first_param_id       /* OUT.  May be NULL */);
+hb_ot_layout_feature_get_name_ids (hb_face_t       *face,
+				   hb_tag_t         table_tag,
+				   unsigned int     feature_index,
+				   hb_ot_name_id_t *label_id             /* OUT.  May be NULL */,
+				   hb_ot_name_id_t *tooltip_id           /* OUT.  May be NULL */,
+				   hb_ot_name_id_t *sample_id            /* OUT.  May be NULL */,
+				   unsigned int    *num_named_parameters /* OUT.  May be NULL */,
+				   hb_ot_name_id_t *first_param_id       /* OUT.  May be NULL */);
 
 
 HB_EXTERN unsigned int
diff --git a/src/hb-ot-name-table.hh b/src/hb-ot-name-table.hh
index b84edd18..9f67b574 100644
--- a/src/hb-ot-name-table.hh
+++ b/src/hb-ot-name-table.hh
@@ -224,9 +224,9 @@ struct name
       hb_blob_destroy (this->blob);
     }
 
-    inline int get_index (hb_name_id_t   name_id,
-			  hb_language_t  language,
-			  unsigned int  *width=nullptr) const
+    inline int get_index (hb_ot_name_id_t   name_id,
+			  hb_language_t     language,
+			  unsigned int     *width=nullptr) const
     {
       const hb_ot_name_entry_t key = {name_id, {0}, language};
       const hb_ot_name_entry_t *entry = (const hb_ot_name_entry_t *)
diff --git a/src/hb-ot-name.cc b/src/hb-ot-name.cc
index e8aa3d8e..e0c97108 100644
--- a/src/hb-ot-name.cc
+++ b/src/hb-ot-name.cc
@@ -118,10 +118,10 @@ hb_ot_name_convert_utf (const hb_bytes_t                *bytes,
 
 template <typename utf_t>
 static inline unsigned int
-hb_ot_name_get_utf (hb_face_t     *face,
-		    hb_name_id_t   name_id,
-		    hb_language_t  language,
-		    unsigned int  *text_size /* IN/OUT */,
+hb_ot_name_get_utf (hb_face_t       *face,
+		    hb_ot_name_id_t  name_id,
+		    hb_language_t    language,
+		    unsigned int    *text_size /* IN/OUT */,
 		    typename utf_t::codepoint_t *text /* OUT */)
 {
   const OT::name_accelerator_t &name = _get_name (face);
@@ -168,11 +168,11 @@ hb_ot_name_get_utf (hb_face_t     *face,
  * Since: 2.1.0
  **/
 unsigned int
-hb_ot_name_get_utf8 (hb_face_t     *face,
-		     hb_name_id_t   name_id,
-		     hb_language_t  language,
-		     unsigned int  *text_size /* IN/OUT */,
-		     char          *text      /* OUT */)
+hb_ot_name_get_utf8 (hb_face_t       *face,
+		     hb_ot_name_id_t  name_id,
+		     hb_language_t    language,
+		     unsigned int    *text_size /* IN/OUT */,
+		     char            *text      /* OUT */)
 {
   return hb_ot_name_get_utf<hb_utf8_t> (face, name_id, language, text_size,
 					(hb_utf8_t::codepoint_t *) text);
@@ -195,11 +195,11 @@ hb_ot_name_get_utf8 (hb_face_t     *face,
  * Since: 2.1.0
  **/
 unsigned int
-hb_ot_name_get_utf16 (hb_face_t     *face,
-		      hb_name_id_t   name_id,
-		      hb_language_t  language,
-		      unsigned int  *text_size /* IN/OUT */,
-		      uint16_t      *text      /* OUT */)
+hb_ot_name_get_utf16 (hb_face_t       *face,
+		      hb_ot_name_id_t  name_id,
+		      hb_language_t    language,
+		      unsigned int    *text_size /* IN/OUT */,
+		      uint16_t        *text      /* OUT */)
 {
   return hb_ot_name_get_utf<hb_utf16_t> (face, name_id, language, text_size, text);
 }
@@ -221,11 +221,11 @@ hb_ot_name_get_utf16 (hb_face_t     *face,
  * Since: 2.1.0
  **/
 unsigned int
-hb_ot_name_get_utf32 (hb_face_t     *face,
-		      hb_name_id_t   name_id,
-		      hb_language_t  language,
-		      unsigned int  *text_size /* IN/OUT */,
-		      uint32_t      *text      /* OUT */)
+hb_ot_name_get_utf32 (hb_face_t       *face,
+		      hb_ot_name_id_t  name_id,
+		      hb_language_t    language,
+		      unsigned int    *text_size /* IN/OUT */,
+		      uint32_t        *text      /* OUT */)
 {
   return hb_ot_name_get_utf<hb_utf32_t> (face, name_id, language, text_size, text);
 }
diff --git a/src/hb-ot-name.h b/src/hb-ot-name.h
index e4ef5f07..8b831688 100644
--- a/src/hb-ot-name.h
+++ b/src/hb-ot-name.h
@@ -35,8 +35,8 @@ HB_BEGIN_DECLS
 
 
 /**
- * hb_name_id_t:
- * @HB_NAME_ID_INVALID: Value to represent a nonexistent name ID.
+ * hb_ot_name_id_t:
+ * @HB_OT_NAME_ID_INVALID: Value to represent a nonexistent name ID.
  *
  * An integral type representing an OpenType 'name' table name identifier.
  * There are predefined name IDs, as well as name IDs return from other
@@ -46,37 +46,37 @@ HB_BEGIN_DECLS
  **/
 enum
 {
-  HB_NAME_ID_COPYRIGHT			= 0,
-  HB_NAME_ID_FONT_FAMILY		= 1,
-  HB_NAME_ID_FONT_SUBFAMILY		= 2,
-  HB_NAME_ID_UNIQUE_ID			= 3,
-  HB_NAME_ID_FULL_NAME			= 4,
-  HB_NAME_ID_VERSION_STRING		= 5,
-  HB_NAME_ID_POSTSCRIPT_NAME		= 6,
-  HB_NAME_ID_TRADEMARK			= 7,
-  HB_NAME_ID_MANUFACTURER		= 8,
-  HB_NAME_ID_DESIGNER			= 9,
-  HB_NAME_ID_DESCRIPTION		= 10,
-  HB_NAME_ID_VENDOR_URL			= 11,
-  HB_NAME_ID_DESIGNER_URL		= 12,
-  HB_NAME_ID_LICENSE			= 13,
-  HB_NAME_ID_LICENSE_URL		= 14,
-/*HB_NAME_ID_RESERVED			= 15,*/
-  HB_NAME_ID_TYPOGRAPHIC_FAMILY		= 16,
-  HB_NAME_ID_TYPOGRAPHIC_SUBFAMILY	= 17,
-  HB_NAME_ID_MAC_FULL_NAME		= 18,
-  HB_NAME_ID_SAMPLE_TEXT		= 19,
-  HB_NAME_ID_CID_FINDFONT_NAME		= 20,
-  HB_NAME_ID_WWS_FAMILY			= 21,
-  HB_NAME_ID_WWS_SUBFAMILY		= 22,
-  HB_NAME_ID_LIGHT_BACKGROUND		= 23,
-  HB_NAME_ID_DARK_BACKGROUND		= 24,
-  HB_NAME_ID_VARIATIONS_PS_PREFIX	= 25,
-
-  HB_NAME_ID_INVALID			= 0xFFFF,
+  HB_OT_NAME_ID_COPYRIGHT		= 0,
+  HB_OT_NAME_ID_FONT_FAMILY		= 1,
+  HB_OT_NAME_ID_FONT_SUBFAMILY		= 2,
+  HB_OT_NAME_ID_UNIQUE_ID		= 3,
+  HB_OT_NAME_ID_FULL_NAME		= 4,
+  HB_OT_NAME_ID_VERSION_STRING		= 5,
+  HB_OT_NAME_ID_POSTSCRIPT_NAME		= 6,
+  HB_OT_NAME_ID_TRADEMARK		= 7,
+  HB_OT_NAME_ID_MANUFACTURER		= 8,
+  HB_OT_NAME_ID_DESIGNER		= 9,
+  HB_OT_NAME_ID_DESCRIPTION		= 10,
+  HB_OT_NAME_ID_VENDOR_URL		= 11,
+  HB_OT_NAME_ID_DESIGNER_URL		= 12,
+  HB_OT_NAME_ID_LICENSE			= 13,
+  HB_OT_NAME_ID_LICENSE_URL		= 14,
+/*HB_OT_NAME_ID_RESERVED		= 15,*/
+  HB_OT_NAME_ID_TYPOGRAPHIC_FAMILY	= 16,
+  HB_OT_NAME_ID_TYPOGRAPHIC_SUBFAMILY	= 17,
+  HB_OT_NAME_ID_MAC_FULL_NAME		= 18,
+  HB_OT_NAME_ID_SAMPLE_TEXT		= 19,
+  HB_OT_NAME_ID_CID_FINDFONT_NAME	= 20,
+  HB_OT_NAME_ID_WWS_FAMILY		= 21,
+  HB_OT_NAME_ID_WWS_SUBFAMILY		= 22,
+  HB_OT_NAME_ID_LIGHT_BACKGROUND	= 23,
+  HB_OT_NAME_ID_DARK_BACKGROUND		= 24,
+  HB_OT_NAME_ID_VARIATIONS_PS_PREFIX	= 25,
+
+  HB_OT_NAME_ID_INVALID			= 0xFFFF,
 };
 
-typedef unsigned int hb_name_id_t;
+typedef unsigned int hb_ot_name_id_t;
 
 
 /**
@@ -90,11 +90,11 @@ typedef unsigned int hb_name_id_t;
  **/
 typedef struct hb_ot_name_entry_t
 {
-  hb_name_id_t  name_id;
+  hb_ot_name_id_t name_id;
   /*< private >*/
-  hb_var_int_t  var;
+  hb_var_int_t    var;
   /*< public >*/
-  hb_language_t language;
+  hb_language_t   language;
 } hb_ot_name_entry_t;
 
 HB_EXTERN const hb_ot_name_entry_t *
@@ -103,25 +103,25 @@ hb_ot_name_list_names (hb_face_t    *face,
 
 
 HB_EXTERN unsigned int
-hb_ot_name_get_utf8 (hb_face_t     *face,
-		     hb_name_id_t   name_id,
-		     hb_language_t  language,
-		     unsigned int  *text_size /* IN/OUT */,
-		     char          *text      /* OUT */);
+hb_ot_name_get_utf8 (hb_face_t       *face,
+		     hb_ot_name_id_t  name_id,
+		     hb_language_t    language,
+		     unsigned int    *text_size /* IN/OUT */,
+		     char            *text      /* OUT */);
 
 HB_EXTERN unsigned int
-hb_ot_name_get_utf16 (hb_face_t     *face,
-		      hb_name_id_t   name_id,
-		      hb_language_t  language,
-		      unsigned int  *text_size /* IN/OUT */,
-		      uint16_t      *text      /* OUT */);
+hb_ot_name_get_utf16 (hb_face_t       *face,
+		      hb_ot_name_id_t  name_id,
+		      hb_language_t    language,
+		      unsigned int    *text_size /* IN/OUT */,
+		      uint16_t        *text      /* OUT */);
 
 HB_EXTERN unsigned int
-hb_ot_name_get_utf32 (hb_face_t     *face,
-		      hb_name_id_t   name_id,
-		      hb_language_t  language,
-		      unsigned int  *text_size /* IN/OUT */,
-		      uint32_t      *text      /* OUT */);
+hb_ot_name_get_utf32 (hb_face_t       *face,
+		      hb_ot_name_id_t  name_id,
+		      hb_language_t    language,
+		      unsigned int    *text_size /* IN/OUT */,
+		      uint32_t        *text      /* OUT */);
 
 
 HB_END_DECLS
diff --git a/test/api/test-ot-color.c b/test/api/test-ot-color.c
index ba3a0abc..e93f5d7b 100644
--- a/test/api/test-ot-color.c
+++ b/test/api/test-ot-color.c
@@ -141,19 +141,19 @@ static void
 test_hb_ot_color_palette_get_name_id_empty (void)
 {
   /* numPalettes=0, so all calls are for out-of-bounds palette indices */
-  g_assert_cmpint (hb_ot_color_palette_get_name_id (hb_face_get_empty(), 0), ==, HB_NAME_ID_INVALID);
-  g_assert_cmpint (hb_ot_color_palette_get_name_id (hb_face_get_empty(), 1), ==, HB_NAME_ID_INVALID);
+  g_assert_cmpint (hb_ot_color_palette_get_name_id (hb_face_get_empty(), 0), ==, HB_OT_NAME_ID_INVALID);
+  g_assert_cmpint (hb_ot_color_palette_get_name_id (hb_face_get_empty(), 1), ==, HB_OT_NAME_ID_INVALID);
 }
 
 
 static void
 test_hb_ot_color_palette_get_name_id_v0 (void)
 {
-  g_assert_cmpint (hb_ot_color_palette_get_name_id (cpal_v0, 0), ==, HB_NAME_ID_INVALID);
-  g_assert_cmpint (hb_ot_color_palette_get_name_id (cpal_v0, 1), ==, HB_NAME_ID_INVALID);
+  g_assert_cmpint (hb_ot_color_palette_get_name_id (cpal_v0, 0), ==, HB_OT_NAME_ID_INVALID);
+  g_assert_cmpint (hb_ot_color_palette_get_name_id (cpal_v0, 1), ==, HB_OT_NAME_ID_INVALID);
 
   /* numPalettes=2, so palette #2 is out of bounds */
-  g_assert_cmpint (hb_ot_color_palette_get_name_id (cpal_v0, 2), ==, HB_NAME_ID_INVALID);
+  g_assert_cmpint (hb_ot_color_palette_get_name_id (cpal_v0, 2), ==, HB_OT_NAME_ID_INVALID);
 }
 
 
@@ -161,11 +161,11 @@ static void
 test_hb_ot_color_palette_get_name_id_v1 (void)
 {
   g_assert_cmpint (hb_ot_color_palette_get_name_id (cpal_v1, 0), ==, 257);
-  g_assert_cmpint (hb_ot_color_palette_get_name_id (cpal_v1, 1), ==, HB_NAME_ID_INVALID);
+  g_assert_cmpint (hb_ot_color_palette_get_name_id (cpal_v1, 1), ==, HB_OT_NAME_ID_INVALID);
   g_assert_cmpint (hb_ot_color_palette_get_name_id (cpal_v1, 2), ==, 258);
 
   /* numPalettes=3, so palette #3 is out of bounds */
-  g_assert_cmpint (hb_ot_color_palette_get_name_id (cpal_v1, 3), ==, HB_NAME_ID_INVALID);
+  g_assert_cmpint (hb_ot_color_palette_get_name_id (cpal_v1, 3), ==, HB_OT_NAME_ID_INVALID);
 }
 
 
@@ -302,15 +302,15 @@ test_hb_ot_color_palette_get_colors_v1 (void)
 static void
 test_hb_ot_color_palette_color_get_name_id (void)
 {
-  g_assert_cmpuint (hb_ot_color_palette_color_get_name_id (empty, 0), ==, HB_NAME_ID_INVALID);
-  g_assert_cmpuint (hb_ot_color_palette_color_get_name_id (empty, 1), ==, HB_NAME_ID_INVALID);
-  g_assert_cmpuint (hb_ot_color_palette_color_get_name_id (empty, 2), ==, HB_NAME_ID_INVALID);
-  g_assert_cmpuint (hb_ot_color_palette_color_get_name_id (cpal_v0, 0), ==, HB_NAME_ID_INVALID);
-  g_assert_cmpuint (hb_ot_color_palette_color_get_name_id (cpal_v0, 1), ==, HB_NAME_ID_INVALID);
-  g_assert_cmpuint (hb_ot_color_palette_color_get_name_id (cpal_v0, 2), ==, HB_NAME_ID_INVALID);
-  g_assert_cmpuint (hb_ot_color_palette_color_get_name_id (cpal_v1, 0), ==, HB_NAME_ID_INVALID);
+  g_assert_cmpuint (hb_ot_color_palette_color_get_name_id (empty, 0), ==, HB_OT_NAME_ID_INVALID);
+  g_assert_cmpuint (hb_ot_color_palette_color_get_name_id (empty, 1), ==, HB_OT_NAME_ID_INVALID);
+  g_assert_cmpuint (hb_ot_color_palette_color_get_name_id (empty, 2), ==, HB_OT_NAME_ID_INVALID);
+  g_assert_cmpuint (hb_ot_color_palette_color_get_name_id (cpal_v0, 0), ==, HB_OT_NAME_ID_INVALID);
+  g_assert_cmpuint (hb_ot_color_palette_color_get_name_id (cpal_v0, 1), ==, HB_OT_NAME_ID_INVALID);
+  g_assert_cmpuint (hb_ot_color_palette_color_get_name_id (cpal_v0, 2), ==, HB_OT_NAME_ID_INVALID);
+  g_assert_cmpuint (hb_ot_color_palette_color_get_name_id (cpal_v1, 0), ==, HB_OT_NAME_ID_INVALID);
   g_assert_cmpuint (hb_ot_color_palette_color_get_name_id (cpal_v1, 1), ==, 256);
-  g_assert_cmpuint (hb_ot_color_palette_color_get_name_id (cpal_v1, 2), ==, HB_NAME_ID_INVALID);
+  g_assert_cmpuint (hb_ot_color_palette_color_get_name_id (cpal_v1, 2), ==, HB_OT_NAME_ID_INVALID);
 }
 
 
diff --git a/test/api/test-ot-name.c b/test/api/test-ot-name.c
index d7333978..431ee3a2 100644
--- a/test/api/test-ot-name.c
+++ b/test/api/test-ot-name.c
@@ -41,11 +41,11 @@ test_ot_layout_feature_get_name_ids_and_characters (void)
 					   &feature_index))
      g_error ("Failed to find feature index");
 
-  hb_name_id_t label_id;
-  hb_name_id_t tooltip_id;
-  hb_name_id_t sample_id;
+  hb_ot_name_id_t label_id;
+  hb_ot_name_id_t tooltip_id;
+  hb_ot_name_id_t sample_id;
   unsigned int num_named_parameters;
-  hb_name_id_t first_param_id;
+  hb_ot_name_id_t first_param_id;
   if (!hb_ot_layout_feature_get_name_ids (face, HB_OT_TAG_GSUB, feature_index,
 					  &label_id, &tooltip_id, &sample_id,
 					  &num_named_parameters, &first_param_id))
commit 881e1054bc66fd07489d661dd5c3f84a5d077edc
Author: Simon Tooke <stooke at redhat.com>
Date:   Tue Oct 30 14:16:23 2018 -0400

    fix various GCC function pointer warnings

diff --git a/src/hb-debug.hh b/src/hb-debug.hh
index 58c190d2..d218e432 100644
--- a/src/hb-debug.hh
+++ b/src/hb-debug.hh
@@ -173,7 +173,7 @@ _hb_debug_msg_va (const char *what,
 
   fprintf (stderr, "\n");
 }
-template <> inline void
+template <> inline void HB_PRINTF_FUNC(7, 0)
 _hb_debug_msg_va<0> (const char *what HB_UNUSED,
 		     const void *obj HB_UNUSED,
 		     const char *func HB_UNUSED,
@@ -192,7 +192,7 @@ _hb_debug_msg (const char *what,
 	       int level_dir,
 	       const char *message,
 	       ...) HB_PRINTF_FUNC(7, 8);
-template <int max_level> static inline void
+template <int max_level> static inline void HB_PRINTF_FUNC(7, 8)
 _hb_debug_msg (const char *what,
 	       const void *obj,
 	       const char *func,
@@ -216,7 +216,7 @@ _hb_debug_msg<0> (const char *what HB_UNUSED,
 		  int level_dir HB_UNUSED,
 		  const char *message HB_UNUSED,
 		  ...) HB_PRINTF_FUNC(7, 8);
-template <> inline void
+template <> inline void HB_PRINTF_FUNC(7, 8)
 _hb_debug_msg<0> (const char *what HB_UNUSED,
 		  const void *obj HB_UNUSED,
 		  const char *func HB_UNUSED,
diff --git a/src/hb-set.hh b/src/hb-set.hh
index 0755498b..2dfcc242 100644
--- a/src/hb-set.hh
+++ b/src/hb-set.hh
@@ -53,8 +53,8 @@ struct hb_set_t
 
   struct page_t
   {
-    inline void init0 (void) { memset (&v, 0, sizeof (v)); }
-    inline void init1 (void) { memset (&v, 0xff, sizeof (v)); }
+    inline void init0 (void) { memset (reinterpret_cast<char*>(&v), 0, sizeof (v)); }
+    inline void init1 (void) { memset (reinterpret_cast<char*>(&v), 0xff, sizeof (v)); }
 
     inline unsigned int len (void) const
     { return ARRAY_LENGTH_CONST (v); }


More information about the HarfBuzz mailing list