ref: 1aa73fa83d7649da6344280bf569e364acaef433
parent: c8ef0fd07cdaef66c8581a7269b31248e26fe3d2
author: Werner Lemberg <[email protected]>
date: Fri Aug 10 01:41:32 EDT 2018
* src/base/ftobjs.c (FT_Render_Glyph_Internal): Improve tracing.
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
2018-08-10 Werner Lemberg <[email protected]>
+ * src/base/ftobjs.c (FT_Render_Glyph_Internal): Improve tracing.
+
+2018-08-10 Werner Lemberg <[email protected]>
+
Fix clang warnings.
* src/base/ftdebug.c (ft_trace_level_enabled,
--- a/src/base/ftobjs.c
+++ b/src/base/ftobjs.c
@@ -4683,44 +4683,51 @@
/* we use FT_TRACE7 in this block */
if ( !error &&
- ft_trace_levels[trace_checksum] >= 7 &&
- slot->bitmap.rows < 128U &&
- slot->bitmap.width < 128U &&
- slot->bitmap.buffer )
+ ft_trace_levels[trace_checksum] >= 7 )
{
- int rows = (int)slot->bitmap.rows;
- int width = (int)slot->bitmap.width;
- int pitch = slot->bitmap.pitch;
- int i, j, m;
- unsigned char* topleft = slot->bitmap.buffer;
+ if ( slot->bitmap.rows < 128U &&
+ slot->bitmap.width < 128U &&
+ slot->bitmap.buffer )
+ {
+ int rows = (int)slot->bitmap.rows;
+ int width = (int)slot->bitmap.width;
+ int pitch = slot->bitmap.pitch;
+ int i, j, m;
- if ( pitch < 0 )
- topleft -= pitch * ( rows - 1 );
+ unsigned char* topleft = slot->bitmap.buffer;
- FT_TRACE7(( "Netpbm image: start\n" ));
- switch ( slot->bitmap.pixel_mode )
- {
- case FT_PIXEL_MODE_MONO:
- FT_TRACE7(( "P1 %d %d\n", width, rows ));
- for ( i = 0; i < rows; i++ )
- {
- for ( j = 0; j < width; )
- for ( m = 128; m > 0 && j < width; m >>= 1, j++ )
- FT_TRACE7(( " %d", ( topleft[i * pitch + j / 8] & m ) != 0 ));
- FT_TRACE7(( "\n" ));
- }
- break;
- default:
- FT_TRACE7(( "P2 %d %d 255\n", width, rows ));
- for ( i = 0; i < rows; i++ )
+ if ( pitch < 0 )
+ topleft -= pitch * ( rows - 1 );
+
+ FT_TRACE7(( "Netpbm image: start\n" ));
+ switch ( slot->bitmap.pixel_mode )
{
- for ( j = 0; j < width; j += 1 )
- FT_TRACE7(( " %3u", topleft[i * pitch + j] ));
- FT_TRACE7(( "\n" ));
+ case FT_PIXEL_MODE_MONO:
+ FT_TRACE7(( "P1 %d %d\n", width, rows ));
+ for ( i = 0; i < rows; i++ )
+ {
+ for ( j = 0; j < width; )
+ for ( m = 128; m > 0 && j < width; m >>= 1, j++ )
+ FT_TRACE7(( " %d",
+ ( topleft[i * pitch + j / 8] & m ) != 0 ));
+ FT_TRACE7(( "\n" ));
+ }
+ break;
+
+ default:
+ FT_TRACE7(( "P2 %d %d 255\n", width, rows ));
+ for ( i = 0; i < rows; i++ )
+ {
+ for ( j = 0; j < width; j += 1 )
+ FT_TRACE7(( " %3u", topleft[i * pitch + j] ));
+ FT_TRACE7(( "\n" ));
+ }
}
+ FT_TRACE7(( "Netpbm image: end\n" ));
}
- FT_TRACE7(( "Netpbm image: end\n" ));
+ else
+ FT_TRACE7(( "Netpbm image: too large, omitted\n" ));
}
#undef FT_COMPONENT