From 91770e1c567d87fc513e8d39576e51c3853b1f23 Mon Sep 17 00:00:00 2001 From: "Emil A Eklund (eae)" Date: Tue, 15 Aug 2017 16:25:18 -0700 Subject: [PATCH] Fix signed/unsigned warning (#522) Change hb_buffer_diff to explicitly cast result of abs to unsigned when comparing with position_fuzz to avoid unsafe signed/unsigned comparions warnings on windows. --- src/hb-buffer.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/hb-buffer.cc b/src/hb-buffer.cc index bfec0a7bb..9007cd0df 100644 --- a/src/hb-buffer.cc +++ b/src/hb-buffer.cc @@ -1925,10 +1925,10 @@ hb_buffer_diff (hb_buffer_t *buffer, const hb_glyph_position_t *ref_pos = reference->pos; for (unsigned int i = 0; i < count; i++) { - if (abs (buf_pos->x_advance - ref_pos->x_advance) > position_fuzz || - abs (buf_pos->y_advance - ref_pos->y_advance) > position_fuzz || - abs (buf_pos->x_offset - ref_pos->x_offset) > position_fuzz || - abs (buf_pos->y_offset - ref_pos->y_offset) > position_fuzz) + if ((unsigned int) abs (buf_pos->x_advance - ref_pos->x_advance) > position_fuzz || + (unsigned int) abs (buf_pos->y_advance - ref_pos->y_advance) > position_fuzz || + (unsigned int) abs (buf_pos->x_offset - ref_pos->x_offset) > position_fuzz || + (unsigned int) abs (buf_pos->y_offset - ref_pos->y_offset) > position_fuzz) { result |= HB_BUFFER_DIFF_FLAG_POSITION_MISMATCH; break;