Fix some clang compiler warnings.

* src/base/ftoutln.c (FT_Outline_EmboldenXY), src/cff/cf2intrp.c
(cf2_interpT2CharString), src/truetype/ttgload.c
(load_truetype_glyph), src/truetype/ttgxvar.c (tt_handle_deltas),
src/truetype/ttinterp.c (Ins_INSTCTRL): Fix signedness issues.
This commit is contained in:
Werner Lemberg 2015-06-30 09:46:39 +02:00
parent 5aaabb44bc
commit eb1bba9be4
7 changed files with 32 additions and 22 deletions

View File

@ -1,3 +1,12 @@
2015-06-30 Werner Lemberg <wl@gnu.org>
Fix some clang compiler warnings.
* src/base/ftoutln.c (FT_Outline_EmboldenXY), src/cff/cf2intrp.c
(cf2_interpT2CharString), src/truetype/ttgload.c
(load_truetype_glyph), src/truetype/ttgxvar.c (tt_handle_deltas),
src/truetype/ttinterp.c (Ins_INSTCTRL): Fix signedness issues.
2015-06-29 Alexei Podtelezhnikov <apodtele@gmail.com>
[truetype] Speed up bytecode interpreter.
@ -8,7 +17,8 @@
[base] Speed up emboldening.
* src/base/ftoutln.c (FT_Outline_EmboldenXY): Use `FT_Vector_NormLen'.
* src/base/ftoutln.c (FT_Outline_EmboldenXY): Use
`FT_Vector_NormLen'.
2015-06-29 Alexei Podtelezhnikov <apodtele@gmail.com>

View File

@ -302,9 +302,9 @@ FT_BEGIN_HEADER
/*
* This function normalizes a vector and returns its original length.
* The normalized vector is a 16.16 fixed-point unit vector with length
* close to 0x10000. The accuracy of the returned length is limited to
* 16 bits also. The function utilizes quick inverse square root
* aproximation without divisions and square roots relying on Newton's
* close to 0x10000. The accuracy of the returned length is limited to
* 16 bits also. The function utilizes quick inverse square root
* approximation without divisions and square roots relying on Newton's
* iterations instead.
*/
FT_BASE( FT_UInt32 )

View File

@ -946,7 +946,7 @@
/* compute incoming normalized vector */
in.x = v_cur.x - v_prev.x;
in.y = v_cur.y - v_prev.y;
l_in = FT_Vector_NormLen( &in );
l_in = (FT_Fixed)FT_Vector_NormLen( &in );
for ( n = first; n <= last; n++ )
{
@ -958,7 +958,7 @@
/* compute outgoing normalized vector */
out.x = v_next.x - v_cur.x;
out.y = v_next.y - v_cur.y;
l_out = FT_Vector_NormLen( &out );
l_out = (FT_Fixed)FT_Vector_NormLen( &out );
d = FT_MulFix( in.x, out.x ) + FT_MulFix( in.y, out.y );

View File

@ -1305,7 +1305,7 @@
/* if `cf2_stack_count' isn't of the form 4n or 4n+1, */
/* we enforce it by clearing the second bit */
/* (and sorting the stack indexing to suit) */
count = count1 & ~2;
count = count1 & ~2U;
index += count1 - count;
FT_TRACE4(( " vvcurveto\n" ));
@ -1350,7 +1350,7 @@
/* if `cf2_stack_count' isn't of the form 4n or 4n+1, */
/* we enforce it by clearing the second bit */
/* (and sorting the stack indexing to suit) */
count = count1 & ~2;
count = count1 & ~2U;
index += count1 - count;
FT_TRACE4(( " hhcurveto\n" ));
@ -1399,7 +1399,7 @@
/* 8n+4, or 8n+5, we enforce it by clearing the */
/* second bit */
/* (and sorting the stack indexing to suit) */
count = count1 & ~2;
count = count1 & ~2U;
index += count1 - count;
FT_TRACE4(( alternate ? " hvcurveto\n" : " vhcurveto\n" ));

View File

@ -1582,7 +1582,7 @@
error = TT_Vary_Apply_Glyph_Deltas( (TT_Face)(loader->face),
glyph_index,
&outline,
outline.n_points );
(FT_UInt)outline.n_points );
if ( error )
goto Exit;
@ -1679,7 +1679,7 @@
if ( face->doblend )
{
FT_UInt i, limit;
short i, limit;
FT_SubGlyph subglyph;
FT_Outline outline;
@ -1690,11 +1690,11 @@
FT_Memory memory = face->root.memory;
limit = gloader->current.num_subglyphs;
limit = (short)gloader->current.num_subglyphs;
/* construct an outline structure for */
/* communication with `TT_Vary_Apply_Glyph_Deltas' */
outline.n_points = gloader->current.num_subglyphs + 4;
outline.n_points = (short)( gloader->current.num_subglyphs + 4 );
outline.n_contours = outline.n_points;
if ( FT_NEW_ARRAY( points, outline.n_points ) ||
@ -1748,7 +1748,7 @@
face,
glyph_index,
&outline,
outline.n_points ) ) != 0 )
(FT_UInt)outline.n_points ) ) != 0 )
goto Exit1;
subglyph = gloader->current.subglyphs + gloader->base.num_subglyphs;

View File

@ -1649,13 +1649,13 @@
{
FT_Vector* out_points;
FT_UInt first_point;
FT_UInt end_point;
FT_Int first_point;
FT_Int end_point;
FT_UInt first_delta;
FT_UInt cur_delta;
FT_Int first_delta;
FT_Int cur_delta;
FT_UInt point;
FT_Int point;
FT_Short contour;

View File

@ -5147,11 +5147,11 @@
Ins_INSTCTRL( TT_ExecContext exc,
FT_Long* args )
{
FT_Long K, L, Kf;
FT_ULong K, L, Kf;
K = args[1];
L = args[0];
K = (FT_ULong)args[1];
L = (FT_ULong)args[0];
/* selector values cannot be `OR'ed; */
/* they are indices starting with index 1, not flags */