[vlc-commits] freetype: use labs for FT_Fixed values

Alexandre Janniaux git at videolan.org
Sat May 2 15:52:39 CEST 2020


vlc | branch: master | Alexandre Janniaux <ajanni at videolabs.io> | Fri May  1 12:29:33 2020 +0200| [d761abd891a4c4caa35d3f53dce8250127954c4d] | committer: Alexandre Janniaux

freetype: use labs for FT_Fixed values

FT_Fixed is defined as a signed long and most operation in freetype are
historically using FT_Long. Fix a truncation warning.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d761abd891a4c4caa35d3f53dce8250127954c4d
---

 modules/text_renderer/freetype/text_layout.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/modules/text_renderer/freetype/text_layout.c b/modules/text_renderer/freetype/text_layout.c
index d59aa0d1ec..6dc3854cd6 100644
--- a/modules/text_renderer/freetype/text_layout.c
+++ b/modules/text_renderer/freetype/text_layout.c
@@ -1294,12 +1294,12 @@ static int LayoutLine( filter_t *p_filter,
         if( p_ch->p_style->i_style_flags & (STYLE_UNDERLINE | STYLE_STRIKEOUT) )
         {
             i_line_offset =
-                abs( FT_FLOOR( FT_MulFix( p_face->underline_position,
-                                          p_face->size->metrics.y_scale ) ) );
+                labs( FT_FLOOR( FT_MulFix( p_face->underline_position,
+                                           p_face->size->metrics.y_scale ) ) );
 
             i_line_thickness =
-                abs( FT_CEIL( FT_MulFix( p_face->underline_thickness,
-                                         p_face->size->metrics.y_scale ) ) );
+                labs( FT_CEIL( FT_MulFix( p_face->underline_thickness,
+                                          p_face->size->metrics.y_scale ) ) );
 
             if( p_ch->p_style->i_style_flags & STYLE_STRIKEOUT )
             {
@@ -1307,8 +1307,8 @@ static int LayoutLine( filter_t *p_filter,
                  * underline. That means that strikethrough takes precedence
                  */
                 i_line_offset -=
-                    abs( FT_FLOOR( FT_MulFix( p_face->descender * 2,
-                                              p_face->size->metrics.y_scale ) ) );
+                    labs( FT_FLOOR( FT_MulFix( p_face->descender * 2,
+                                               p_face->size->metrics.y_scale ) ) );
                 p_bitmaps->glyph_bbox.yMax =
                     __MAX( p_bitmaps->glyph_bbox.yMax,
                            - i_line_offset );
@@ -1352,7 +1352,7 @@ static int LayoutLine( filter_t *p_filter,
         /* Get max advance for grid mode */
         if( b_grid && i_font_max_advance_y == 0 && p_face )
         {
-            i_font_max_advance_y = abs( FT_FLOOR( FT_MulFix( p_face->max_advance_height,
+            i_font_max_advance_y = labs( FT_FLOOR( FT_MulFix( p_face->max_advance_height,
                                       p_face->size->metrics.y_scale ) ) );
         }
 



More information about the vlc-commits mailing list