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.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184
diff --git a/ChangeLog b/ChangeLog
index eb6a627..11b2064 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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>
diff --git a/include/freetype/internal/ftcalc.h b/include/freetype/internal/ftcalc.h
index d4d4337..67ade7e 100644
--- a/include/freetype/internal/ftcalc.h
+++ b/include/freetype/internal/ftcalc.h
@@ -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 )
diff --git a/src/base/ftoutln.c b/src/base/ftoutln.c
index 066eb7e..f71a1e7 100644
--- a/src/base/ftoutln.c
+++ b/src/base/ftoutln.c
@@ -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 );
diff --git a/src/cff/cf2intrp.c b/src/cff/cf2intrp.c
index 537e060..ff3fa9a 100644
--- a/src/cff/cf2intrp.c
+++ b/src/cff/cf2intrp.c
@@ -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" ));
diff --git a/src/truetype/ttgload.c b/src/truetype/ttgload.c
index e1acd69..c35d835 100644
--- a/src/truetype/ttgload.c
+++ b/src/truetype/ttgload.c
@@ -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;
diff --git a/src/truetype/ttgxvar.c b/src/truetype/ttgxvar.c
index 2b12483..ee884ae 100644
--- a/src/truetype/ttgxvar.c
+++ b/src/truetype/ttgxvar.c
@@ -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;
diff --git a/src/truetype/ttinterp.c b/src/truetype/ttinterp.c
index caa4d0f..d00a0f8 100644
--- a/src/truetype/ttinterp.c
+++ b/src/truetype/ttinterp.c
@@ -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 */