Commit 8cfc41ae955d99ff49214deea731527bbb8035f0

Werner Lemberg 2020-07-25T12:23:22

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.

diff --git a/ChangeLog b/ChangeLog
index 70a0805..677c0b0 100644
--- 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.
diff --git a/src/base/ftoutln.c b/src/base/ftoutln.c
index f449ee6..311f098 100644
--- 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:
diff --git a/src/bdf/bdfdrivr.c b/src/bdf/bdfdrivr.c
index e338808..1adf3eb 100644
--- a/src/bdf/bdfdrivr.c
+++ b/src/bdf/bdfdrivr.c
@@ -183,7 +183,8 @@ THE SOFTWARE.
   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 @@ THE SOFTWARE.
         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 @@ THE SOFTWARE.
         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;
diff --git a/src/cache/ftcbasic.c b/src/cache/ftcbasic.c
index 493fc0a..aa6e6a7 100644
--- 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 )
diff --git a/src/pcf/pcfdrivr.c b/src/pcf/pcfdrivr.c
index f68e60e..e9dd517 100644
--- a/src/pcf/pcfdrivr.c
+++ b/src/pcf/pcfdrivr.c
@@ -606,8 +606,9 @@ THE SOFTWARE.
         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 ));
         }
 
         /*
diff --git a/src/sfnt/sfwoff2.c b/src/sfnt/sfwoff2.c
index 30345c7..a26c711 100644
--- 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;
diff --git a/src/truetype/ttgxvar.c b/src/truetype/ttgxvar.c
index 22c7025..b462263 100644
--- 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;
       }