From 03348ce0051cfae7172ac0d09b83ed5f82fa842a Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Mon, 5 Nov 2018 12:59:32 -0500 Subject: [PATCH] Minor --- src/hb-aat-layout.cc | 12 ++++++------ src/hb-ot-color.cc | 10 +++++----- src/hb-ot-font.cc | 18 +++++++++--------- src/hb-ot-layout.cc | 2 +- src/hb-ot-math.cc | 2 +- src/hb-ot-name.cc | 2 +- src/hb-ot-var.cc | 6 ++---- 7 files changed, 25 insertions(+), 27 deletions(-) diff --git a/src/hb-aat-layout.cc b/src/hb-aat-layout.cc index 80bf2d766..9e0eb92fa 100644 --- a/src/hb-aat-layout.cc +++ b/src/hb-aat-layout.cc @@ -181,7 +181,7 @@ _get_mort (hb_face_t *face, hb_blob_t **blob = nullptr) *blob = hb_blob_get_empty (); return Null(AAT::mort); } - const AAT::mort& mort = *(hb_ot_face_data (face)->mort.get ()); + const AAT::mort& mort = *(hb_ot_face_data (face)->mort); if (blob) *blob = hb_ot_face_data (face)->mort.get_blob (); return mort; @@ -195,7 +195,7 @@ _get_morx (hb_face_t *face, hb_blob_t **blob = nullptr) *blob = hb_blob_get_empty (); return Null(AAT::morx); } - const AAT::morx& morx = *(hb_ot_face_data (face)->morx.get ()); + const AAT::morx& morx = *(hb_ot_face_data (face)->morx); if (blob) *blob = hb_ot_face_data (face)->morx.get_blob (); return morx; @@ -209,7 +209,7 @@ _get_kerx (hb_face_t *face, hb_blob_t **blob = nullptr) *blob = hb_blob_get_empty (); return Null(AAT::kerx); } - const AAT::kerx& kerx = *(hb_ot_face_data (face)->kerx.get ()); + const AAT::kerx& kerx = *(hb_ot_face_data (face)->kerx); if (blob) *blob = hb_ot_face_data (face)->kerx.get_blob (); return kerx; @@ -223,7 +223,7 @@ _get_ankr (hb_face_t *face, hb_blob_t **blob = nullptr) *blob = hb_blob_get_empty (); return Null(AAT::ankr); } - const AAT::ankr& ankr = *(hb_ot_face_data (face)->ankr.get ()); + const AAT::ankr& ankr = *(hb_ot_face_data (face)->ankr); if (blob) *blob = hb_ot_face_data (face)->ankr.get_blob (); return ankr; @@ -232,13 +232,13 @@ static inline const AAT::trak& _get_trak (hb_face_t *face) { if (unlikely (!hb_ot_shaper_face_data_ensure (face))) return Null(AAT::trak); - return *(hb_ot_face_data (face)->trak.get ()); + return *(hb_ot_face_data (face)->trak); } static inline const AAT::ltag& _get_ltag (hb_face_t *face) { if (unlikely (!hb_ot_shaper_face_data_ensure (face))) return Null(AAT::ltag); - return *(hb_ot_face_data (face)->ltag.get ()); + return *(hb_ot_face_data (face)->ltag); } diff --git a/src/hb-ot-color.cc b/src/hb-ot-color.cc index b87ed56fa..853f65dcf 100644 --- a/src/hb-ot-color.cc +++ b/src/hb-ot-color.cc @@ -54,35 +54,35 @@ static inline const OT::COLR& _get_colr (hb_face_t *face) { if (unlikely (!hb_ot_shaper_face_data_ensure (face))) return Null(OT::COLR); - return *(hb_ot_face_data (face)->COLR.get ()); + return *(hb_ot_face_data (face)->COLR); } static inline const OT::CBDT_accelerator_t& _get_cbdt (hb_face_t *face) { if (unlikely (!hb_ot_shaper_face_data_ensure (face))) return Null(OT::CBDT_accelerator_t); - return *(hb_ot_face_data (face)->CBDT.get ()); + return *(hb_ot_face_data (face)->CBDT); } static inline const OT::CPAL& _get_cpal (hb_face_t *face) { if (unlikely (!hb_ot_shaper_face_data_ensure (face))) return Null(OT::CPAL); - return *(hb_ot_face_data (face)->CPAL.get ()); + return *(hb_ot_face_data (face)->CPAL); } static inline const OT::sbix_accelerator_t& _get_sbix (hb_face_t *face) { if (unlikely (!hb_ot_shaper_face_data_ensure (face))) return Null(OT::sbix_accelerator_t); - return *(hb_ot_face_data (face)->sbix.get ()); + return *(hb_ot_face_data (face)->sbix); } static inline const OT::SVG_accelerator_t& _get_svg (hb_face_t *face) { if (unlikely (!hb_ot_shaper_face_data_ensure (face))) return Null(OT::SVG_accelerator_t); - return *(hb_ot_face_data (face)->SVG.get ()); + return *(hb_ot_face_data (face)->SVG); } diff --git a/src/hb-ot-font.cc b/src/hb-ot-font.cc index 33a4388ce..41bea1405 100644 --- a/src/hb-ot-font.cc +++ b/src/hb-ot-font.cc @@ -62,7 +62,7 @@ hb_ot_get_nominal_glyph (hb_font_t *font HB_UNUSED, void *user_data HB_UNUSED) { const hb_ot_face_data_t *ot_face = (const hb_ot_face_data_t *) font_data; - return ot_face->cmap.get ()->get_nominal_glyph (unicode, glyph); + return ot_face->cmap->get_nominal_glyph (unicode, glyph); } static unsigned int @@ -76,7 +76,7 @@ hb_ot_get_nominal_glyphs (hb_font_t *font HB_UNUSED, void *user_data HB_UNUSED) { const hb_ot_face_data_t *ot_face = (const hb_ot_face_data_t *) font_data; - const OT::cmap_accelerator_t &cmap = *ot_face->cmap.get (); + const OT::cmap_accelerator_t &cmap = *ot_face->cmap; unsigned int done; for (done = 0; done < count && cmap.get_nominal_glyph (*first_unicode, first_glyph); @@ -97,7 +97,7 @@ hb_ot_get_variation_glyph (hb_font_t *font HB_UNUSED, void *user_data HB_UNUSED) { const hb_ot_face_data_t *ot_face = (const hb_ot_face_data_t *) font_data; - return ot_face->cmap.get ()->get_variation_glyph (unicode, variation_selector, glyph); + return ot_face->cmap->get_variation_glyph (unicode, variation_selector, glyph); } static void @@ -110,7 +110,7 @@ hb_ot_get_glyph_h_advances (hb_font_t* font, void* font_data, void *user_data HB_UNUSED) { const hb_ot_face_data_t *ot_face = (const hb_ot_face_data_t *) font_data; - const OT::hmtx_accelerator_t &hmtx = *ot_face->hmtx.get (); + const OT::hmtx_accelerator_t &hmtx = *ot_face->hmtx; for (unsigned int i = 0; i < count; i++) { @@ -130,7 +130,7 @@ hb_ot_get_glyph_v_advances (hb_font_t* font, void* font_data, void *user_data HB_UNUSED) { const hb_ot_face_data_t *ot_face = (const hb_ot_face_data_t *) font_data; - const OT::vmtx_accelerator_t &vmtx = *ot_face->vmtx.get (); + const OT::vmtx_accelerator_t &vmtx = *ot_face->vmtx; for (unsigned int i = 0; i < count; i++) { @@ -152,7 +152,7 @@ hb_ot_get_glyph_v_origin (hb_font_t *font, *x = font->get_glyph_h_advance (glyph) / 2; - const OT::VORG &VORG = *ot_face->VORG.get (); + const OT::VORG &VORG = *ot_face->VORG; if (VORG.has_data ()) { *y = font->em_scale_y (VORG.get_y_origin (glyph)); @@ -162,7 +162,7 @@ hb_ot_get_glyph_v_origin (hb_font_t *font, hb_glyph_extents_t extents = {0}; if (ot_face->glyf->get_extents (glyph, &extents)) { - const OT::vmtx_accelerator_t &vmtx = *ot_face->vmtx.get (); + const OT::vmtx_accelerator_t &vmtx = *ot_face->vmtx; hb_position_t tsb = vmtx.get_side_bearing (glyph); *y = font->em_scale_y (extents.y_bearing + tsb); return true; @@ -225,7 +225,7 @@ hb_ot_get_font_h_extents (hb_font_t *font, void *user_data HB_UNUSED) { const hb_ot_face_data_t *ot_face = (const hb_ot_face_data_t *) font_data; - const OT::hmtx_accelerator_t &hmtx = *ot_face->hmtx.get (); + const OT::hmtx_accelerator_t &hmtx = *ot_face->hmtx; metrics->ascender = font->em_scale_y (hmtx.ascender); metrics->descender = font->em_scale_y (hmtx.descender); metrics->line_gap = font->em_scale_y (hmtx.line_gap); @@ -240,7 +240,7 @@ hb_ot_get_font_v_extents (hb_font_t *font, void *user_data HB_UNUSED) { const hb_ot_face_data_t *ot_face = (const hb_ot_face_data_t *) font_data; - const OT::vmtx_accelerator_t &vmtx = *ot_face->vmtx.get (); + const OT::vmtx_accelerator_t &vmtx = *ot_face->vmtx; metrics->ascender = font->em_scale_x (vmtx.ascender); metrics->descender = font->em_scale_x (vmtx.descender); metrics->line_gap = font->em_scale_x (vmtx.line_gap); diff --git a/src/hb-ot-layout.cc b/src/hb-ot-layout.cc index f1f09c76d..fcdc79ee9 100644 --- a/src/hb-ot-layout.cc +++ b/src/hb-ot-layout.cc @@ -62,7 +62,7 @@ _get_kern (hb_face_t *face, hb_blob_t **blob = nullptr) *blob = hb_blob_get_empty (); return Null(OT::kern); } - const OT::kern& kern = *(hb_ot_face_data (face)->kern.get ()); + const OT::kern& kern = *(hb_ot_face_data (face)->kern); if (blob) *blob = hb_ot_face_data (face)->kern.get_blob (); return kern; diff --git a/src/hb-ot-math.cc b/src/hb-ot-math.cc index 92c29480d..3fb720b20 100644 --- a/src/hb-ot-math.cc +++ b/src/hb-ot-math.cc @@ -45,7 +45,7 @@ _get_math (hb_face_t *face) { if (unlikely (!hb_ot_shaper_face_data_ensure (face))) return Null(OT::MATH); hb_ot_face_data_t * data = hb_ot_face_data (face); - return *(data->MATH.get ()); + return *(data->MATH); } /* diff --git a/src/hb-ot-name.cc b/src/hb-ot-name.cc index f5ac18d79..f2d1f0c2f 100644 --- a/src/hb-ot-name.cc +++ b/src/hb-ot-name.cc @@ -46,7 +46,7 @@ static inline const OT::name_accelerator_t& _get_name (hb_face_t *face) { if (unlikely (!hb_ot_shaper_face_data_ensure (face))) return Null(OT::name_accelerator_t); - return *(hb_ot_face_data (face)->name.get ()); + return *(hb_ot_face_data (face)->name); } /** diff --git a/src/hb-ot-var.cc b/src/hb-ot-var.cc index 64087be81..4363f85ee 100644 --- a/src/hb-ot-var.cc +++ b/src/hb-ot-var.cc @@ -51,15 +51,13 @@ static inline const OT::fvar& _get_fvar (hb_face_t *face) { if (unlikely (!hb_ot_shaper_face_data_ensure (face))) return Null(OT::fvar); - hb_ot_face_data_t *layout = hb_ot_face_data (face); - return *(layout->fvar.get ()); + return *(hb_ot_face_data (face)->fvar); } static inline const OT::avar& _get_avar (hb_face_t *face) { if (unlikely (!hb_ot_shaper_face_data_ensure (face))) return Null(OT::avar); - hb_ot_face_data_t *layout = hb_ot_face_data (face); - return *(layout->avar.get ()); + return *(hb_ot_face_data (face)->avar); } /**