From 64ebfa04f298dd98aa364852eb22bb810895b49e Mon Sep 17 00:00:00 2001 From: Jan Kelemen Date: Thu, 24 Jul 2025 17:20:45 +0200 Subject: [PATCH] Fix unary minus operator applied to unsigned type, result still unsigned --- src/hb-ot-font.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/hb-ot-font.cc b/src/hb-ot-font.cc index 2e6554e73..5fcfae165 100644 --- a/src/hb-ot-font.cc +++ b/src/hb-ot-font.cc @@ -678,7 +678,7 @@ hb_ot_get_glyph_v_origins (hb_font_t *font, hb_position_t origin; unsigned cv; if (origin_cache->get (*first_glyph, &cv)) - origin = font->y_scale < 0 ? -cv : cv; + origin = font->y_scale < 0 ? -static_cast(cv) : static_cast(cv); else { origin = font->em_scalef_y (VORG.get_y_origin (*first_glyph)); @@ -702,7 +702,7 @@ hb_ot_get_glyph_v_origins (hb_font_t *font, hb_position_t origin; unsigned cv; if (origin_cache->get (*first_glyph, &cv)) - origin = font->y_scale < 0 ? -cv : cv; + origin = font->y_scale < 0 ? -static_cast(cv) : static_cast(cv); else { origin = font->em_scalef_y (VORG.get_y_origin (*first_glyph) + @@ -745,7 +745,7 @@ hb_ot_get_glyph_v_origins (hb_font_t *font, hb_position_t origin; unsigned cv; if (origin_cache->get (*first_glyph, &cv)) - origin = font->y_scale < 0 ? -cv : cv; + origin = font->y_scale < 0 ? -static_cast(cv) : static_cast(cv); else { origin = font->em_scalef_y (glyf.get_v_origin_with_var_unscaled (*first_glyph, font, *scratch, gvar_cache)); @@ -779,7 +779,7 @@ hb_ot_get_glyph_v_origins (hb_font_t *font, unsigned cv; if (origin_cache->get (*first_glyph, &cv)) - origin = font->y_scale < 0 ? -cv : cv; + origin = font->y_scale < 0 ? -static_cast(cv) : static_cast(cv); else { hb_glyph_extents_t extents = {0};