shithub: freetype+ttf2subf

Download patch

ref: 1f7a4e1f4004b1742e552cc10a0ad3c6b88f94e1
parent: 9daea2c90c08ad97cb164eb0ae89fc45123e1886
author: Werner Lemberg <[email protected]>
date: Tue Feb 17 05:17:56 EST 2015

[truetype] Finish compiler warning fixes for signedness issues.

* src/truetype/ttgxvar.c, src/truetype/ttsubpix.c,
src/truetype/ttsubpix.h: Apply.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2015-02-17  Werner Lemberg  <[email protected]>
 
+	[truetype] Finish compiler warning fixes for signedness issues.
+
+	* src/truetype/ttgxvar.c, src/truetype/ttsubpix.c,
+	src/truetype/ttsubpix.h: Apply.
+
+2015-02-17  Werner Lemberg  <[email protected]>
+
 	* src/truetype/ttsubpix.c: Adding missing `static' keywords.
 
 2015-02-17  Werner Lemberg  <[email protected]>
--- a/src/truetype/ttgxvar.c
+++ b/src/truetype/ttgxvar.c
@@ -286,7 +286,7 @@
     GX_Blend        blend  = face->blend;
     GX_AVarSegment  segment;
     FT_Error        error = FT_Err_Ok;
-    FT_ULong        version;
+    FT_Long         version;
     FT_Long         axisCount;
     FT_Int          i, j;
     FT_ULong        table_len;
@@ -428,7 +428,7 @@
         goto Exit;
 
       for ( i = 0; i <= blend->gv_glyphcnt; ++i )
-        blend->glyphoffsets[i] = offsetToData + FT_GET_LONG();
+        blend->glyphoffsets[i] = offsetToData + FT_GET_ULONG();
 
       FT_FRAME_EXIT();
     }
@@ -577,9 +577,9 @@
   typedef struct  fvar_axis_
   {
     FT_ULong   axisTag;
-    FT_ULong   minValue;
-    FT_ULong   defaultValue;
-    FT_ULong   maxValue;
+    FT_Fixed   minValue;
+    FT_Fixed   defaultValue;
+    FT_Fixed   maxValue;
     FT_UShort  flags;
     FT_UShort  nameID;
 
@@ -647,9 +647,9 @@
 
       FT_FRAME_START( 20 ),
         FT_FRAME_ULONG ( axisTag ),
-        FT_FRAME_ULONG ( minValue ),
-        FT_FRAME_ULONG ( defaultValue ),
-        FT_FRAME_ULONG ( maxValue ),
+        FT_FRAME_LONG  ( minValue ),
+        FT_FRAME_LONG  ( defaultValue ),
+        FT_FRAME_LONG  ( maxValue ),
         FT_FRAME_USHORT( flags ),
         FT_FRAME_USHORT( nameID ),
       FT_FRAME_END
@@ -742,9 +742,9 @@
         if ( FT_STREAM_READ_FIELDS( fvaraxis_fields, &axis_rec ) )
           goto Exit;
         a->tag     = axis_rec.axisTag;
-        a->minimum = axis_rec.minValue;     /* A Fixed */
-        a->def     = axis_rec.defaultValue; /* A Fixed */
-        a->maximum = axis_rec.maxValue;     /* A Fixed */
+        a->minimum = axis_rec.minValue;
+        a->def     = axis_rec.defaultValue;
+        a->maximum = axis_rec.maxValue;
         a->strid   = axis_rec.nameID;
 
         a->name[0] = (FT_String)(   a->tag >> 24 );
@@ -766,7 +766,7 @@
         (void) /* flags = */ FT_GET_USHORT();
 
         for ( j = 0; j < fvar_head.axisCount; ++j )
-          ns->coords[j] = FT_GET_ULONG();     /* A Fixed */
+          ns->coords[j] = FT_GET_LONG();
 
         FT_FRAME_EXIT();
       }
--- a/src/truetype/ttsubpix.c
+++ b/src/truetype/ttsubpix.c
@@ -905,7 +905,7 @@
   {
     TT_Face     face   = (TT_Face)loader->face;
     FT_String*  family = face->root.family_name;
-    int         ppem   = loader->size->metrics.x_ppem;
+    FT_UInt     ppem   = loader->size->metrics.x_ppem;
     FT_String*  style  = face->root.style_name;
 
 
--- a/src/truetype/ttsubpix.h
+++ b/src/truetype/ttsubpix.h
@@ -50,26 +50,26 @@
   /* Tweak flags that are set for each glyph by the below rules.           */
   /*                                                                       */
   /*                                                                       */
-#define SPH_TWEAK_ALLOW_X_DMOVE                   0x0000001
-#define SPH_TWEAK_ALWAYS_DO_DELTAP                0x0000002
-#define SPH_TWEAK_ALWAYS_SKIP_DELTAP              0x0000004
-#define SPH_TWEAK_COURIER_NEW_2_HACK              0x0000008
-#define SPH_TWEAK_DEEMBOLDEN                      0x0000010
-#define SPH_TWEAK_DO_SHPIX                        0x0000020
-#define SPH_TWEAK_EMBOLDEN                        0x0000040
-#define SPH_TWEAK_MIAP_HACK                       0x0000080
-#define SPH_TWEAK_NORMAL_ROUND                    0x0000100
-#define SPH_TWEAK_NO_ALIGNRP_AFTER_IUP            0x0000200
-#define SPH_TWEAK_NO_CALL_AFTER_IUP               0x0000400
-#define SPH_TWEAK_NO_DELTAP_AFTER_IUP             0x0000800
-#define SPH_TWEAK_PIXEL_HINTING                   0x0001000
-#define SPH_TWEAK_RASTERIZER_35                   0x0002000
-#define SPH_TWEAK_ROUND_NONPIXEL_Y_MOVES          0x0004000
-#define SPH_TWEAK_SKIP_IUP                        0x0008000
-#define SPH_TWEAK_SKIP_NONPIXEL_Y_MOVES           0x0010000
-#define SPH_TWEAK_SKIP_OFFPIXEL_Y_MOVES           0x0020000
-#define SPH_TWEAK_TIMES_NEW_ROMAN_HACK            0x0040000
-#define SPH_TWEAK_SKIP_NONPIXEL_Y_MOVES_DELTAP    0x0080000
+#define SPH_TWEAK_ALLOW_X_DMOVE                   0x0000001UL
+#define SPH_TWEAK_ALWAYS_DO_DELTAP                0x0000002UL
+#define SPH_TWEAK_ALWAYS_SKIP_DELTAP              0x0000004UL
+#define SPH_TWEAK_COURIER_NEW_2_HACK              0x0000008UL
+#define SPH_TWEAK_DEEMBOLDEN                      0x0000010UL
+#define SPH_TWEAK_DO_SHPIX                        0x0000020UL
+#define SPH_TWEAK_EMBOLDEN                        0x0000040UL
+#define SPH_TWEAK_MIAP_HACK                       0x0000080UL
+#define SPH_TWEAK_NORMAL_ROUND                    0x0000100UL
+#define SPH_TWEAK_NO_ALIGNRP_AFTER_IUP            0x0000200UL
+#define SPH_TWEAK_NO_CALL_AFTER_IUP               0x0000400UL
+#define SPH_TWEAK_NO_DELTAP_AFTER_IUP             0x0000800UL
+#define SPH_TWEAK_PIXEL_HINTING                   0x0001000UL
+#define SPH_TWEAK_RASTERIZER_35                   0x0002000UL
+#define SPH_TWEAK_ROUND_NONPIXEL_Y_MOVES          0x0004000UL
+#define SPH_TWEAK_SKIP_IUP                        0x0008000UL
+#define SPH_TWEAK_SKIP_NONPIXEL_Y_MOVES           0x0010000UL
+#define SPH_TWEAK_SKIP_OFFPIXEL_Y_MOVES           0x0020000UL
+#define SPH_TWEAK_TIMES_NEW_ROMAN_HACK            0x0040000UL
+#define SPH_TWEAK_SKIP_NONPIXEL_Y_MOVES_DELTAP    0x0080000UL
 
 
   FT_LOCAL( FT_Bool )