shithub: freetype+ttf2subf

Download patch

ref: 8cfc41ae955d99ff49214deea731527bbb8035f0
parent: b6183ea369757f6f0126c9822d21eaa88903b7c5
author: Werner Lemberg <wl@gnu.org>
date: Sat Jul 25 08:23:22 EDT 2020

Fix `-Wformat' compiler warnings.

Problem reported by Priyesh kumar <priyeshkkumar@gmail.com>

* src/base/ftoutln.c (FT_Outline_Decompose): Fix number of arguments
to tracing macro.

* src/bdf/bdfdrivr.c (bdf_cmap_char_next, bdf_get_bdf_property):
Ditto.

* src/cache/ftcbasic.c (ftc_basic_family_get_count): Ditto.
Reformulate message.

* src/pcf/pcfdrivr.c (pcf_get_bdf_property): Ditto.

* src/sfnt/sfwoff2.c (woff2_open_font): Ditto.
Trace table offset, too.

* src/truetype/ttgxvar.c (ft_var_apply_tuple): Ditto.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,25 @@
+2020-07-25  Werner Lemberg  <wl@gnu.org>
+
+	Fix `-Wformat' compiler warnings.
+
+	Problem reported by Priyesh kumar <priyeshkkumar@gmail.com>
+
+	* src/base/ftoutln.c (FT_Outline_Decompose): Fix number of arguments
+	to tracing macro.
+
+	* src/bdf/bdfdrivr.c (bdf_cmap_char_next, bdf_get_bdf_property):
+	Ditto.
+
+	* src/cache/ftcbasic.c (ftc_basic_family_get_count): Ditto.
+	Reformulate message.
+
+	* src/pcf/pcfdrivr.c (pcf_get_bdf_property): Ditto.
+
+	* src/sfnt/sfwoff2.c (woff2_open_font): Ditto.
+	Trace table offset, too.
+
+	* src/truetype/ttgxvar.c (ft_var_apply_tuple): Ditto.
+
 2020-07-23  Werner Lemberg  <wl@gnu.org>
 
 	* src/sfnt/sfwoff2.c (woff2_decompress): Fix compiler warning.
--- a/src/base/ftoutln.c
+++ b/src/base/ftoutln.c
@@ -274,7 +274,7 @@
       first = (FT_UInt)last + 1;
     }
 
-    FT_TRACE5(( "FT_Outline_Decompose: Done\n", n ));
+    FT_TRACE5(( "FT_Outline_Decompose: Done\n" ));
     return FT_Err_Ok;
 
   Invalid_Outline:
--- a/src/bdf/bdfdrivr.c
+++ b/src/bdf/bdfdrivr.c
@@ -183,7 +183,8 @@
   Exit:
     if ( charcode > 0xFFFFFFFFUL )
     {
-      FT_TRACE1(( "bdf_cmap_char_next: charcode 0x%x > 32bit API" ));
+      FT_TRACE1(( "bdf_cmap_char_next: charcode 0x%lx > 32bit API",
+                  charcode ));
       *acharcode = 0;
       /* XXX: result should be changed to indicate an overflow error */
     }
@@ -901,7 +902,8 @@
         if ( prop->value.l > 0x7FFFFFFFL || prop->value.l < ( -1 - 0x7FFFFFFFL ) )
         {
           FT_TRACE1(( "bdf_get_bdf_property:"
-                      " too large integer 0x%x is truncated\n" ));
+                      " too large integer 0x%lx is truncated\n",
+                      prop->value.l ));
         }
         aproperty->type      = BDF_PROPERTY_TYPE_INTEGER;
         aproperty->u.integer = (FT_Int32)prop->value.l;
@@ -911,7 +913,8 @@
         if ( prop->value.ul > 0xFFFFFFFFUL )
         {
           FT_TRACE1(( "bdf_get_bdf_property:"
-                      " too large cardinal 0x%x is truncated\n" ));
+                      " too large cardinal 0x%lx is truncated\n",
+                      prop->value.ul ));
         }
         aproperty->type       = BDF_PROPERTY_TYPE_CARDINAL;
         aproperty->u.cardinal = (FT_UInt32)prop->value.ul;
--- a/src/cache/ftcbasic.c
+++ b/src/cache/ftcbasic.c
@@ -110,7 +110,9 @@
 
     if ( (FT_ULong)face->num_glyphs > FT_UINT_MAX || 0 > face->num_glyphs )
       FT_TRACE1(( "ftc_basic_family_get_count:"
-                  " too large number of glyphs in this face, truncated\n",
+                  " the number of glyphs in this face is %ld,\n"
+                  "                           "
+                  " which is too much and thus truncated\n",
                   face->num_glyphs ));
 
     if ( !error )
--- a/src/pcf/pcfdrivr.c
+++ b/src/pcf/pcfdrivr.c
@@ -606,8 +606,9 @@
         if ( prop->value.l > 0x7FFFFFFFL          ||
              prop->value.l < ( -1 - 0x7FFFFFFFL ) )
         {
-          FT_TRACE1(( "pcf_get_bdf_property:" ));
-          FT_TRACE1(( " too large integer 0x%x is truncated\n" ));
+          FT_TRACE1(( "pcf_get_bdf_property:"
+                      " too large integer 0x%lx is truncated\n",
+                      prop->value.l ));
         }
 
         /*
--- a/src/sfnt/sfwoff2.c
+++ b/src/sfnt/sfwoff2.c
@@ -1852,9 +1852,11 @@
          FT_NEW_ARRAY( indices, woff2.num_tables ) )
       goto Exit;
 
-    FT_TRACE2(( "\n"
-                "  tag    flags    transform   origLen   transformLen\n"
-                "  --------------------------------------------------\n" ));
+    FT_TRACE2((
+      "\n"
+      "  tag    flags    transform  origLen   transformLen   offset\n"
+      "  -----------------------------------------------------------\n" ));
+   /* "  XXXX  XXXXXXXX  XXXXXXXX   XXXXXXXX    XXXXXXXX    XXXXXXXX" */
 
     for ( nn = 0; nn < woff2.num_tables; nn++ )
     {
@@ -1924,7 +1926,7 @@
       src_offset       += table->TransformLength;
       table->flags      = flags;
 
-      FT_TRACE2(( "  %c%c%c%c  %08d  %08d    %08ld  %08ld\n",
+      FT_TRACE2(( "  %c%c%c%c  %08d  %08d   %08ld    %08ld    %08ld\n",
                   (FT_Char)( table->Tag >> 24 ),
                   (FT_Char)( table->Tag >> 16 ),
                   (FT_Char)( table->Tag >> 8  ),
@@ -1933,7 +1935,6 @@
                   ( table->FlagByte >> 6 ) & 0x03,
                   table->dst_length,
                   table->TransformLength,
-                  table->src_length,
                   table->src_offset ));
 
       indices[nn] = table;
--- a/src/truetype/ttgxvar.c
+++ b/src/truetype/ttgxvar.c
@@ -1729,7 +1729,7 @@
 
       if ( tuple_coords[i] == 0 )
       {
-        FT_TRACE6(( "      tuple coordinate is zero, ignore\n", i ));
+        FT_TRACE6(( "      tuple coordinate is zero, ignore\n" ));
         continue;
       }