From 81ec543d800c4a94b5e608fd87e84d33d7dae8ac Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 22 Jan 2019 12:43:12 +0100 Subject: [PATCH] More -Wcast-error fixes --- src/hb-font.cc | 8 ++++---- src/hb-ft.cc | 2 +- src/hb-ot-font.cc | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/hb-font.cc b/src/hb-font.cc index b9d755536..ec09c0967 100644 --- a/src/hb-font.cc +++ b/src/hb-font.cc @@ -244,7 +244,7 @@ hb_font_get_glyph_h_advances_default (hb_font_t* font, #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wcast-align" first_glyph = (hb_codepoint_t *) &StructAtOffset (first_glyph, glyph_stride); - first_advance = &StructAtOffset (first_advance, advance_stride); + first_advance = (hb_position_t *) &StructAtOffset (first_advance, advance_stride); #pragma GCC diagnostic pop } return; @@ -258,7 +258,7 @@ hb_font_get_glyph_h_advances_default (hb_font_t* font, *first_advance = font->parent_scale_x_distance (*first_advance); #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wcast-align" - first_advance = &StructAtOffset (first_advance, advance_stride); + first_advance = (hb_position_t *) &StructAtOffset (first_advance, advance_stride); #pragma GCC diagnostic pop } } @@ -282,7 +282,7 @@ hb_font_get_glyph_v_advances_default (hb_font_t* font, #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wcast-align" first_glyph = (hb_codepoint_t *) &StructAtOffset (first_glyph, glyph_stride); - first_advance = &StructAtOffset (first_advance, advance_stride); + first_advance = (hb_position_t *) &StructAtOffset (first_advance, advance_stride); #pragma GCC diagnostic pop } return; @@ -296,7 +296,7 @@ hb_font_get_glyph_v_advances_default (hb_font_t* font, *first_advance = font->parent_scale_y_distance (*first_advance); #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wcast-align" - first_advance = &StructAtOffset (first_advance, advance_stride); + first_advance = (hb_position_t *) &StructAtOffset (first_advance, advance_stride); #pragma GCC diagnostic pop } } diff --git a/src/hb-ft.cc b/src/hb-ft.cc index 728fa5e49..653d4374f 100644 --- a/src/hb-ft.cc +++ b/src/hb-ft.cc @@ -298,7 +298,7 @@ hb_ft_get_glyph_h_advances (hb_font_t* font, void* font_data, #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wcast-align" first_glyph = (hb_codepoint_t *) &StructAtOffset (first_glyph, glyph_stride); - first_advance = &StructAtOffset (first_advance, advance_stride); + first_advance = (hb_position_t *) &StructAtOffset (first_advance, advance_stride); #pragma GCC diagnostic pop } } diff --git a/src/hb-ot-font.cc b/src/hb-ot-font.cc index 8ac1a2c77..7084d557b 100644 --- a/src/hb-ot-font.cc +++ b/src/hb-ot-font.cc @@ -115,7 +115,7 @@ hb_ot_get_glyph_h_advances (hb_font_t* font, void* font_data, #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wcast-align" first_glyph = (hb_codepoint_t *) &StructAtOffset (first_glyph, glyph_stride); - first_advance = &StructAtOffset (first_advance, advance_stride); + first_advance = (hb_position_t *) &StructAtOffset (first_advance, advance_stride); #pragma GCC diagnostic pop } } @@ -138,7 +138,7 @@ hb_ot_get_glyph_v_advances (hb_font_t* font, void* font_data, #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wcast-align" first_glyph = (hb_codepoint_t *) &StructAtOffset (first_glyph, glyph_stride); - first_advance = &StructAtOffset (first_advance, advance_stride); + first_advance = (hb_position_t *) &StructAtOffset (first_advance, advance_stride); #pragma GCC diagnostic pop } }