[HarfBuzz] harfbuzz: Branch 'master'

Behdad Esfahbod behdad at kemper.freedesktop.org
Tue Aug 15 23:30:47 UTC 2017


 src/hb-buffer.cc |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 91770e1c567d87fc513e8d39576e51c3853b1f23
Author: Emil A Eklund (eae) <eae at eae.net>
Date:   Tue Aug 15 16:25:18 2017 -0700

    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.

diff --git a/src/hb-buffer.cc b/src/hb-buffer.cc
index bfec0a7b..9007cd0d 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;


More information about the HarfBuzz mailing list