[truetype] More signedness fixes. * include/internal/tttypes.h, src/truetype/ttinterp.h, src/truetype/ttobjs.h, src/truetype/ttinterp.c, src/truetype/ttobjs.c: Apply.
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 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230
diff --git a/ChangeLog b/ChangeLog
index 714288f..b309f23 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
2015-02-17 Werner Lemberg <wl@gnu.org>
+ [truetype] More signedness fixes.
+
+ * include/internal/tttypes.h, src/truetype/ttinterp.h,
+ src/truetype/ttobjs.h, src/truetype/ttinterp.c,
+ src/truetype/ttobjs.c: Apply.
+
+2015-02-17 Werner Lemberg <wl@gnu.org>
+
[truetype] Various signedness fixes.
* include/internal/ftgloadr.h, src/truetype/ttpload.c: Apply.
diff --git a/include/internal/tttypes.h b/include/internal/tttypes.h
index 6c1b52b..1d48f11 100644
--- a/include/internal/tttypes.h
+++ b/include/internal/tttypes.h
@@ -1440,7 +1440,7 @@ FT_BEGIN_HEADER
{
FT_Memory memory;
FT_UShort max_points;
- FT_UShort max_contours;
+ FT_Short max_contours;
FT_UShort n_points; /* number of points in zone */
FT_Short n_contours; /* number of contours */
diff --git a/src/truetype/ttinterp.c b/src/truetype/ttinterp.c
index 3709b8c..31c7bfa 100644
--- a/src/truetype/ttinterp.c
+++ b/src/truetype/ttinterp.c
@@ -158,7 +158,7 @@
/* which will return to the first byte *after* the code */
/* range, we test for IP <= Size instead of IP < Size. */
/* */
- FT_ASSERT( (FT_ULong)IP <= coderange->size );
+ FT_ASSERT( IP <= coderange->size );
exec->code = coderange->base;
exec->codeSize = coderange->size;
@@ -359,7 +359,7 @@
FT_LOCAL_DEF( FT_Error )
Update_Max( FT_Memory memory,
FT_ULong* size,
- FT_Long multiplier,
+ FT_ULong multiplier,
void* _pbuff,
FT_ULong new_max )
{
@@ -452,13 +452,13 @@
/* XXX: We reserve a little more elements on the stack to deal safely */
/* with broken fonts like arialbs, courbs, timesbs, etc. */
- tmp = exec->stackSize;
+ tmp = (FT_ULong)exec->stackSize;
error = Update_Max( exec->memory,
&tmp,
sizeof ( FT_F26Dot6 ),
(void*)&exec->stack,
maxp->maxStackElements + 32 );
- exec->stackSize = (FT_UInt)tmp;
+ exec->stackSize = (FT_Long)tmp;
if ( error )
return error;
@@ -1633,7 +1633,7 @@
static FT_Bool
Ins_Goto_CodeRange( TT_ExecContext exc,
FT_Int aRange,
- FT_ULong aIP )
+ FT_Long aIP )
{
TT_CodeRange* range;
@@ -2352,7 +2352,7 @@
FT_ASSERT( !exc->face->unpatented_hinting );
#endif
- return TT_DotFix14( (FT_UInt32)dx, (FT_UInt32)dy,
+ return TT_DotFix14( dx, dy,
exc->GS.projVector.x,
exc->GS.projVector.y );
}
@@ -2379,7 +2379,7 @@
FT_Pos dx,
FT_Pos dy )
{
- return TT_DotFix14( (FT_UInt32)dx, (FT_UInt32)dy,
+ return TT_DotFix14( dx, dy,
exc->GS.dualVector.x,
exc->GS.dualVector.y );
}
@@ -3621,7 +3621,7 @@
rec = exc->FDefs;
limit = rec + exc->numFDefs;
- n = args[0];
+ n = (FT_ULong)args[0];
for ( ; rec < limit; rec++ )
{
@@ -3863,7 +3863,7 @@
/* first of all, check the index */
- F = args[0];
+ F = (FT_ULong)args[0];
if ( BOUNDSL( F, exc->maxFunc + 1 ) )
goto Fail;
@@ -3951,7 +3951,7 @@
/* first of all, check the index */
- F = args[1];
+ F = (FT_ULong)args[1];
if ( BOUNDSL( F, exc->maxFunc + 1 ) )
goto Fail;
@@ -5528,7 +5528,7 @@
FT_UShort start, limit, i;
- contour = (FT_UShort)args[0];
+ contour = (FT_Short)args[0];
bounds = ( exc->GS.gep2 == 0 ) ? 1 : exc->zp2.n_contours;
if ( BOUNDS( contour, bounds ) )
@@ -5651,8 +5651,8 @@
else
#endif
{
- dx = TT_MulFix14( (FT_UInt32)args[0], exc->GS.freeVector.x );
- dy = TT_MulFix14( (FT_UInt32)args[0], exc->GS.freeVector.y );
+ dx = TT_MulFix14( args[0], exc->GS.freeVector.x );
+ dy = TT_MulFix14( args[0], exc->GS.freeVector.y );
}
while ( exc->GS.loop > 0 )
@@ -5953,9 +5953,9 @@
( !exc->ignore_x_mode ||
!exc->face->sph_compatibility_mode ) )
#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */
- exc->zp0.org[point].x = TT_MulFix14( (FT_UInt32)distance,
+ exc->zp0.org[point].x = TT_MulFix14( distance,
exc->GS.freeVector.x );
- exc->zp0.org[point].y = TT_MulFix14( (FT_UInt32)distance,
+ exc->zp0.org[point].y = TT_MulFix14( distance,
exc->GS.freeVector.y ),
exc->zp0.cur[point] = exc->zp0.org[point];
}
@@ -6206,10 +6206,10 @@
if ( exc->GS.gep1 == 0 )
{
exc->zp1.org[point].x = exc->zp0.org[exc->GS.rp0].x +
- TT_MulFix14( (FT_UInt32)cvt_dist,
+ TT_MulFix14( cvt_dist,
exc->GS.freeVector.x );
exc->zp1.org[point].y = exc->zp0.org[exc->GS.rp0].y +
- TT_MulFix14( (FT_UInt32)cvt_dist,
+ TT_MulFix14( cvt_dist,
exc->GS.freeVector.y );
exc->zp1.cur[point] = exc->zp1.org[point];
}
diff --git a/src/truetype/ttinterp.h b/src/truetype/ttinterp.h
index 832e4f6..bd16a0d 100644
--- a/src/truetype/ttinterp.h
+++ b/src/truetype/ttinterp.h
@@ -158,11 +158,11 @@ FT_BEGIN_HEADER
FT_Long top; /* top of exec. stack */
- FT_UInt stackSize; /* size of exec. stack */
+ FT_Long stackSize; /* size of exec. stack */
FT_Long* stack; /* current exec. stack */
FT_Long args;
- FT_UInt new_top; /* new top after exec. */
+ FT_Long new_top; /* new top after exec. */
TT_GlyphZoneRec zp0, /* zone records */
zp1,
@@ -303,7 +303,7 @@ FT_BEGIN_HEADER
FT_LOCAL( FT_Error )
Update_Max( FT_Memory memory,
FT_ULong* size,
- FT_Long multiplier,
+ FT_ULong multiplier,
void* _pbuff,
FT_ULong new_max );
#endif /* TT_USE_BYTECODE_INTERPRETER */
diff --git a/src/truetype/ttobjs.c b/src/truetype/ttobjs.c
index 9e10e16..aefabef 100644
--- a/src/truetype/ttobjs.c
+++ b/src/truetype/ttobjs.c
@@ -788,7 +788,7 @@
TT_Set_CodeRange( exec,
tt_coderange_font,
face->font_program,
- face->font_program_size );
+ (FT_Long)face->font_program_size );
/* disable CVT and glyph programs coderange */
TT_Clear_CodeRange( exec, tt_coderange_cvt );
@@ -854,7 +854,7 @@
TT_Set_CodeRange( exec,
tt_coderange_cvt,
face->cvt_program,
- face->cvt_program_size );
+ (FT_Long)face->cvt_program_size );
TT_Clear_CodeRange( exec, tt_coderange_glyph );
diff --git a/src/truetype/ttobjs.h b/src/truetype/ttobjs.h
index 769cf7c..7ac4123 100644
--- a/src/truetype/ttobjs.h
+++ b/src/truetype/ttobjs.h
@@ -160,7 +160,7 @@ FT_BEGIN_HEADER
typedef struct TT_CodeRange_
{
FT_Byte* base;
- FT_ULong size;
+ FT_Long size;
} TT_CodeRange;