Improve tracing messages by using singular and plural forms.

* src/*/*.c: Implement it.
This commit is contained in:
Werner Lemberg 2017-12-05 12:06:29 +01:00
parent 87ddad2007
commit 71fecc539e
10 changed files with 60 additions and 24 deletions

View File

@ -1,3 +1,9 @@
2017-12-05 Werner Lemberg <wl@gnu.org>
Improve tracing messages by using singular and plural forms.
* src/*/*.c: Implement it.
2017-12-04 Werner Lemberg <wl@gnu.org>
[truetype] Allow shared points in `cvar' table (#52532).

View File

@ -240,8 +240,10 @@
&dummy,
&ah );
FT_TRACE5(( " idx %d: advance height %d font units\n",
start + nn, ah ));
FT_TRACE5(( " idx %d: advance height %d font unit%s\n",
start + nn,
ah,
ah == 1 ? "" : "s" ));
advances[nn] = ah;
}
}
@ -269,8 +271,10 @@
&dummy,
&aw );
FT_TRACE5(( " idx %d: advance width %d font units\n",
start + nn, aw ));
FT_TRACE5(( " idx %d: advance width %d font unit%s\n",
start + nn,
aw,
aw == 1 ? "" : "s" ));
advances[nn] = aw;
}
}

View File

@ -1297,7 +1297,9 @@
if ( numOperands > count )
{
FT_TRACE4(( " cff_blend_doBlend: Stack underflow %d args\n", count ));
FT_TRACE4(( " cff_blend_doBlend: Stack underflow %d argument%s\n",
count,
count == 1 ? "" : "s" ));
error = FT_THROW( Stack_Underflow );
goto Exit;

View File

@ -949,7 +949,9 @@
goto Exit;
}
FT_TRACE4(( " %d values blended\n", numBlends ));
FT_TRACE4(( " %d value%s blended\n",
numBlends,
numBlends == 1 ? "" : "s" ));
error = cff_blend_doBlend( subFont, parser, numBlends );

View File

@ -840,7 +840,7 @@ THE SOFTWARE.
FT_TRACE4(( "pcf_get_bitmaps:\n"
" format: 0x%lX\n"
" (%s, %s,\n"
" padding=%d bits, scanning=%d bits)\n",
" padding=%d bit%s, scanning=%d bit%s)\n",
format,
PCF_BYTE_ORDER( format ) == MSBFirst
? "most significant byte first"
@ -849,7 +849,9 @@ THE SOFTWARE.
? "most significant bit first"
: "least significant bit first",
8 << PCF_GLYPH_PAD_INDEX( format ),
8 << PCF_SCAN_UNIT_INDEX( format ) ));
( 8 << PCF_GLYPH_PAD_INDEX( format ) ) == 1 ? "" : "s",
8 << PCF_SCAN_UNIT_INDEX( format ),
( 8 << PCF_SCAN_UNIT_INDEX( format ) ) == 1 ? "" : "s" ));
if ( !PCF_FORMAT_MATCH( format, PCF_DEFAULT_FORMAT ) )
return FT_THROW( Invalid_File_Format );

View File

@ -756,8 +756,10 @@
count = glyph->num_subs - old_count;
FT_TRACE4(( "compound glyph with %d elements (offset %lu):\n",
count, offset ));
FT_TRACE4(( "compound glyph with %d element%s (offset %lu):\n",
count,
count == 1 ? "" : "s",
offset ));
/* now, load each individual glyph */
for ( n = 0; n < count; n++ )
@ -810,7 +812,9 @@
/* proceed to next sub-glyph */
}
FT_TRACE4(( "end compound glyph with %d elements\n", count ));
FT_TRACE4(( "end compound glyph with %d element%s\n",
count,
count == 1 ? "" : "s" ));
}
else
{

View File

@ -1007,8 +1007,9 @@
goto Fail;
}
FT_TRACE3(( "tt_sbit_decoder_load_compound: loading %d components\n",
num_components ));
FT_TRACE3(( "tt_sbit_decoder_load_compound: loading %d component%s\n",
num_components,
num_components == 1 ? "" : "s" ));
for ( nn = 0; nn < num_components; nn++ )
{

View File

@ -1718,8 +1718,11 @@ typedef ptrdiff_t FT_PtrDist;
if ( !ras.invalid )
gray_record_cell( RAS_VAR );
FT_TRACE7(( "band [%d..%d]: %d cells\n",
ras.min_ey, ras.max_ey, ras.num_cells ));
FT_TRACE7(( "band [%d..%d]: %d cell%s\n",
ras.min_ey,
ras.max_ey,
ras.num_cells,
ras.num_cells == 1 ? "" : "s" ));
}
else
{

View File

@ -1043,10 +1043,11 @@
outerIndex,
innerIndex );
FT_TRACE5(( "%s value %d adjusted by %d units (%s)\n",
FT_TRACE5(( "%s value %d adjusted by %d unit%s (%s)\n",
vertical ? "vertical height" : "horizontal width",
*avalue,
delta,
delta == 1 ? "" : "s",
vertical ? "VVAR" : "HVAR" ));
*avalue += delta;
@ -1333,13 +1334,15 @@
if ( p )
{
FT_TRACE5(( "value %c%c%c%c (%d units) adjusted by %d units (MVAR)\n",
FT_TRACE5(( "value %c%c%c%c (%d unit%s) adjusted by %d unit%s (MVAR)\n",
(FT_Char)( value->tag >> 24 ),
(FT_Char)( value->tag >> 16 ),
(FT_Char)( value->tag >> 8 ),
(FT_Char)( value->tag ),
value->unmodified,
delta ));
value->unmodified == 1 ? "" : "s",
delta,
delta == 1 ? "" : "s" ));
/* since we handle both signed and unsigned values as FT_Short, */
/* ensure proper overflow arithmetic */
@ -1499,8 +1502,10 @@
blend->gv_glyphcnt = gvar_head.glyphCount;
offsetToData = gvar_start + gvar_head.offsetToData;
FT_TRACE5(( "gvar: there are %d shared coordinates:\n",
blend->tuplecount ));
FT_TRACE5(( "gvar: there %s %d shared coordinate%s:\n",
blend->tuplecount == 1 ? "is" : "are",
blend->tuplecount,
blend->tuplecount == 1 ? "" : "s" ));
if ( FT_NEW_ARRAY( blend->glyphoffsets, blend->gv_glyphcnt + 1 ) )
goto Exit;
@ -3027,7 +3032,10 @@
FT_Stream_SeekSet( stream, here );
}
FT_TRACE5(( "cvar: there are %d tuples:\n", tupleCount & 0xFFF ));
FT_TRACE5(( "cvar: there %s %d tuple%s:\n",
( tupleCount & 0xFFF ) == 1 ? "is" : "are",
tupleCount & 0xFFF,
( tupleCount & 0xFFF ) == 1 ? "" : "s" ));
for ( i = 0; i < ( tupleCount & 0xFFF ); i++ )
{
@ -3517,8 +3525,10 @@
FT_Stream_SeekSet( stream, here );
}
FT_TRACE5(( "gvar: there are %d tuples:\n",
tupleCount & GX_TC_TUPLE_COUNT_MASK ));
FT_TRACE5(( "gvar: there %s %d tuple%s:\n",
( tupleCount & GX_TC_TUPLE_COUNT_MASK ) == 1 ? "is" : "are",
tupleCount & GX_TC_TUPLE_COUNT_MASK,
( tupleCount & GX_TC_TUPLE_COUNT_MASK ) == 1 ? "" : "s" ));
for ( j = 0; j < n_points; j++ )
points_org[j] = outline->points[j];

View File

@ -8486,7 +8486,9 @@
} while ( !exc->instruction_trap );
LNo_Error_:
FT_TRACE4(( " %d instructions executed\n", ins_counter ));
FT_TRACE4(( " %d instruction%s executed\n",
ins_counter == 1 ? "" : "s",
ins_counter ));
return FT_Err_Ok;
LErrorCodeOverflow_: