shithub: freetype+ttf2subf

Download patch

ref: 76abc75c2637cffc692fee6b16396c8f56091252
parent: 10aa8585932c08f048684231acb6fe1030152338
author: Werner Lemberg <[email protected]>
date: Mon Feb 16 17:00:27 EST 2015

[base] Finish compiler warning fixes for signedness issues.

* src/base/ftglyph.c, src/base/ftlcdfil.c, src/base/ftstroke.c:
Apply.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2015-02-16  Werner Lemberg  <[email protected]>
 
+	[base] Finish compiler warning fixes for signedness issues.
+
+	* src/base/ftglyph.c, src/base/ftlcdfil.c, src/base/ftstroke.c:
+	Apply.
+
+2015-02-16  Werner Lemberg  <[email protected]>
+
 	* include/tttables.h (TT_OS2): `fsType' must be FT_UShort.
 
 2015-02-16  Werner Lemberg  <[email protected]>
--- a/src/base/ftglyph.c
+++ b/src/base/ftglyph.c
@@ -126,9 +126,9 @@
 
 
     cbox->xMin = glyph->left << 6;
-    cbox->xMax = cbox->xMin + ( glyph->bitmap.width << 6 );
+    cbox->xMax = cbox->xMin + (FT_Pos)( glyph->bitmap.width << 6 );
     cbox->yMax = glyph->top << 6;
-    cbox->yMin = cbox->yMax - ( glyph->bitmap.rows << 6 );
+    cbox->yMin = cbox->yMax - (FT_Pos)( glyph->bitmap.rows << 6 );
   }
 
 
@@ -173,7 +173,9 @@
     }
 
     /* allocate new outline */
-    error = FT_Outline_New( library, source->n_points, source->n_contours,
+    error = FT_Outline_New( library,
+                            (FT_UInt)source->n_points,
+                            source->n_contours,
                             &glyph->outline );
     if ( error )
       goto Exit;
@@ -205,8 +207,10 @@
     FT_Library       library = FT_GLYPH( source )->library;
 
 
-    error = FT_Outline_New( library, source->outline.n_points,
-                            source->outline.n_contours, &target->outline );
+    error = FT_Outline_New( library,
+                            (FT_UInt)source->outline.n_points,
+                            source->outline.n_contours,
+                            &target->outline );
     if ( !error )
       FT_Outline_Copy( &source->outline, &target->outline );
 
--- a/src/base/ftlcdfil.c
+++ b/src/base/ftlcdfil.c
@@ -48,7 +48,7 @@
 
       /* take care of bitmap flow */
       if ( bitmap->pitch < 0 )
-        line -= bitmap->pitch * ( bitmap->rows - 1 );
+        line -= bitmap->pitch * (FT_Int)( bitmap->rows - 1 );
 
       /* `fir' and `pix' must be at least 32 bit wide, since the sum of */
       /* the values in `weights' can exceed 0xFF                        */
@@ -112,7 +112,7 @@
 
       /* take care of bitmap flow */
       if ( bitmap->pitch < 0 )
-        column -= bitmap->pitch * ( bitmap->rows - 1 );
+        column -= bitmap->pitch * (FT_Int)( bitmap->rows - 1 );
 
       for ( ; width > 0; width--, column++ )
       {
@@ -182,7 +182,7 @@
     FT_UInt  height = (FT_UInt)bitmap->rows;
     FT_Int   pitch  = bitmap->pitch;
 
-    static const int  filters[3][3] =
+    static const unsigned int  filters[3][3] =
     {
       { 65538 * 9/13, 65538 * 1/6, 65538 * 1/13 },
       { 65538 * 3/13, 65538 * 4/6, 65538 * 3/13 },
@@ -200,7 +200,7 @@
 
       /* take care of bitmap flow */
       if ( bitmap->pitch < 0 )
-        line -= bitmap->pitch * ( bitmap->rows - 1 );
+        line -= bitmap->pitch * (FT_Int)( bitmap->rows - 1 );
 
       for ( ; height > 0; height--, line += pitch )
       {
@@ -243,12 +243,12 @@
 
       /* take care of bitmap flow */
       if ( bitmap->pitch < 0 )
-        column -= bitmap->pitch * ( bitmap->rows - 1 );
+        column -= bitmap->pitch * (FT_Int)( bitmap->rows - 1 );
 
       for ( ; width > 0; width--, column++ )
       {
         FT_Byte*  col     = column;
-        FT_Byte*  col_end = col + height * pitch;
+        FT_Byte*  col_end = col + (FT_Int)height * pitch;
 
 
         for ( ; col < col_end; col += 3 * pitch )
--- a/src/base/ftstroke.c
+++ b/src/base/ftstroke.c
@@ -347,7 +347,7 @@
   ft_stroke_border_close( FT_StrokeBorder  border,
                           FT_Bool          reverse )
   {
-    FT_UInt  start = border->start;
+    FT_UInt  start = (FT_UInt)border->start;
     FT_UInt  count = border->num_points;
 
 
@@ -599,7 +599,7 @@
     if ( border->start >= 0 )
       ft_stroke_border_close( border, FALSE );
 
-    border->start = border->num_points;
+    border->start = (FT_Int)border->num_points;
     border->movable = FALSE;
 
     return ft_stroke_border_lineto( border, to, FALSE );
@@ -742,7 +742,7 @@
       }
     }
 
-    outline->n_points = (short)( outline->n_points + border->num_points );
+    outline->n_points += (short)border->num_points;
 
     FT_ASSERT( FT_Outline_Check( outline ) == 0 );
   }
@@ -1822,7 +1822,7 @@
 
     FT_ASSERT( left->start >= 0 );
 
-    new_points = left->num_points - left->start;
+    new_points = (FT_Int)left->num_points - left->start;
     if ( new_points > 0 )
     {
       error = ft_stroke_border_grow( right, (FT_UInt)new_points );
@@ -1862,8 +1862,8 @@
         }
       }
 
-      left->num_points   = left->start;
-      right->num_points += new_points;
+      left->num_points   = (FT_UInt)left->start;
+      right->num_points += (FT_UInt)new_points;
 
       right->movable = FALSE;
       left->movable  = FALSE;
@@ -2118,7 +2118,7 @@
       FT_UInt  last;  /* index of last point in contour */
 
 
-      last  = outline->contours[n];
+      last  = (FT_UInt)outline->contours[n];
       limit = outline->points + last;
 
       /* skip empty points; we don't stroke these */
@@ -2347,7 +2347,9 @@
       FT_Outline_Done( glyph->library, outline );
 
       error = FT_Outline_New( glyph->library,
-                              num_points, num_contours, outline );
+                              num_points,
+                              (FT_Int)num_contours,
+                              outline );
       if ( error )
         goto Fail;
 
@@ -2437,7 +2439,7 @@
 
       error = FT_Outline_New( glyph->library,
                               num_points,
-                              num_contours,
+                              (FT_Int)num_contours,
                               outline );
       if ( error )
         goto Fail;