From 8cfc41ae955d99ff49214deea731527bbb8035f0 Mon Sep 17 00:00:00 2001 From: Werner Lemberg Date: Sat, 25 Jul 2020 12:23:22 +0200 Subject: [PATCH] Fix `-Wformat' compiler warnings. Problem reported by Priyesh kumar * 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. --- ChangeLog | 22 ++++++++++++++++++++++ src/base/ftoutln.c | 2 +- src/bdf/bdfdrivr.c | 9 ++++++--- src/cache/ftcbasic.c | 4 +++- src/pcf/pcfdrivr.c | 5 +++-- src/sfnt/sfwoff2.c | 11 ++++++----- src/truetype/ttgxvar.c | 2 +- 7 files changed, 42 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index 70a080578..677c0b06c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,25 @@ +2020-07-25 Werner Lemberg + + Fix `-Wformat' compiler warnings. + + Problem reported by Priyesh kumar + + * 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 * src/sfnt/sfwoff2.c (woff2_decompress): Fix compiler warning. diff --git a/src/base/ftoutln.c b/src/base/ftoutln.c index f449ee68e..311f098e3 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 e338808ac..1adf3eb38 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 493fc0af7..aa6e6a70a 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 f68e60e51..e9dd51752 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 30345c775..a26c71188 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 22c7025f5..b462263de 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; }