Remove clang compiler warnings (#50548).
* include/freetype/internal/tttypes.h (TT_FaceRec): Make `var_postscript_prefix_len' unsigned. * src/autofit/afwarp.c (af_warper_compute_line_best): Remove redundant assignment. * src/cff/cffload.c (cff_subfont_load): Add casts. * src/cff/cffparse.c (cff_parse_blend): Remove redundant assignment. * src/sfnt/sfdriver.c (fmix32, murmur_hash_3_128): Add `static' keyword. Add casts. (fixed2float): Add cast. (sfnt_get_var_ps_name): Make `p' always initialized. Add casts. * src/truetype/ttgxvar.c (TT_Get_MM_Var): Add casts.
This commit is contained in:
parent
3f92048ab1
commit
981c23b75e
23
ChangeLog
23
ChangeLog
@ -1,3 +1,26 @@
|
||||
2017-03-15 Werner Lemberg <wl@gnu.org>
|
||||
|
||||
Remove clang compiler warnings (#50548).
|
||||
|
||||
* include/freetype/internal/tttypes.h (TT_FaceRec): Make
|
||||
`var_postscript_prefix_len' unsigned.
|
||||
|
||||
* src/autofit/afwarp.c (af_warper_compute_line_best): Remove
|
||||
redundant assignment.
|
||||
|
||||
* src/cff/cffload.c (cff_subfont_load): Add casts.
|
||||
|
||||
* src/cff/cffparse.c (cff_parse_blend): Remove redundant assignment.
|
||||
|
||||
* src/sfnt/sfdriver.c (fmix32, murmur_hash_3_128): Add `static'
|
||||
keyword.
|
||||
Add casts.
|
||||
(fixed2float): Add cast.
|
||||
(sfnt_get_var_ps_name): Make `p' always initialized.
|
||||
Add casts.
|
||||
|
||||
* src/truetype/ttgxvar.c (TT_Get_MM_Var): Add casts.
|
||||
|
||||
2017-03-15 Werner Lemberg <wl@gnu.org>
|
||||
|
||||
[ftfuzzer] Limit number of tested faces and instances.
|
||||
|
@ -1513,7 +1513,7 @@ FT_BEGIN_HEADER
|
||||
FT_UInt32 variation_support; /* since 2.7.1 */
|
||||
|
||||
const char* var_postscript_prefix; /* since 2.7.2 */
|
||||
FT_Int var_postscript_prefix_len; /* since 2.7.2 */
|
||||
FT_UInt var_postscript_prefix_len; /* since 2.7.2 */
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -98,7 +98,6 @@
|
||||
if ( xx1min + w < warper->x2min )
|
||||
xx1min = warper->x2min - w;
|
||||
|
||||
xx1max = warper->x1max;
|
||||
if ( xx1max + w > warper->x2max )
|
||||
xx1max = warper->x2max - w;
|
||||
|
||||
|
@ -2084,7 +2084,8 @@
|
||||
{
|
||||
do
|
||||
{
|
||||
driver->random_seed = (FT_Int32)cff_random( driver->random_seed );
|
||||
driver->random_seed =
|
||||
(FT_Int32)cff_random( (FT_UInt32)driver->random_seed );
|
||||
|
||||
} while ( driver->random_seed < 0 );
|
||||
}
|
||||
@ -2097,7 +2098,7 @@
|
||||
do
|
||||
{
|
||||
face->root.internal->random_seed =
|
||||
(FT_Int32)cff_random( face->root.internal->random_seed );
|
||||
(FT_Int32)cff_random( (FT_UInt32)face->root.internal->random_seed );
|
||||
|
||||
} while ( face->root.internal->random_seed < 0 );
|
||||
}
|
||||
|
@ -894,8 +894,6 @@
|
||||
FT_Error error;
|
||||
|
||||
|
||||
error = FT_ERR( Stack_Underflow );
|
||||
|
||||
if ( !priv || !priv->subfont )
|
||||
{
|
||||
error = FT_THROW( Invalid_File_Format );
|
||||
|
@ -271,7 +271,7 @@
|
||||
#define ROTL32( x, r ) ( x << r ) | ( x >> ( 32 - r ) )
|
||||
|
||||
|
||||
FT_UInt32
|
||||
static FT_UInt32
|
||||
fmix32( FT_UInt32 h )
|
||||
{
|
||||
h ^= h >> 16;
|
||||
@ -284,14 +284,14 @@
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
murmur_hash_3_128( const void* key,
|
||||
const int len,
|
||||
FT_UInt32 seed,
|
||||
void* out )
|
||||
static void
|
||||
murmur_hash_3_128( const void* key,
|
||||
const unsigned int len,
|
||||
FT_UInt32 seed,
|
||||
void* out )
|
||||
{
|
||||
const FT_Byte* data = (const FT_Byte*)key;
|
||||
const int nblocks = len / 16;
|
||||
const int nblocks = (int)len / 16;
|
||||
|
||||
FT_UInt32 h1 = seed;
|
||||
FT_UInt32 h2 = seed;
|
||||
@ -365,50 +365,50 @@
|
||||
switch ( len & 15 )
|
||||
{
|
||||
case 15:
|
||||
k4 ^= tail[14] << 16;
|
||||
k4 ^= (FT_UInt32)tail[14] << 16;
|
||||
case 14:
|
||||
k4 ^= tail[13] << 8;
|
||||
k4 ^= (FT_UInt32)tail[13] << 8;
|
||||
case 13:
|
||||
k4 ^= tail[12] << 0;
|
||||
k4 ^= (FT_UInt32)tail[12];
|
||||
k4 *= c4;
|
||||
k4 = ROTL32( k4, 18 );
|
||||
k4 *= c1;
|
||||
h4 ^= k4;
|
||||
|
||||
case 12:
|
||||
k3 ^= tail[11] << 24;
|
||||
k3 ^= (FT_UInt32)tail[11] << 24;
|
||||
case 11:
|
||||
k3 ^= tail[10] << 16;
|
||||
k3 ^= (FT_UInt32)tail[10] << 16;
|
||||
case 10:
|
||||
k3 ^= tail[9] << 8;
|
||||
k3 ^= (FT_UInt32)tail[9] << 8;
|
||||
case 9:
|
||||
k3 ^= tail[8] << 0;
|
||||
k3 ^= (FT_UInt32)tail[8];
|
||||
k3 *= c3;
|
||||
k3 = ROTL32( k3, 17 );
|
||||
k3 *= c4;
|
||||
h3 ^= k3;
|
||||
|
||||
case 8:
|
||||
k2 ^= tail[7] << 24;
|
||||
k2 ^= (FT_UInt32)tail[7] << 24;
|
||||
case 7:
|
||||
k2 ^= tail[6] << 16;
|
||||
k2 ^= (FT_UInt32)tail[6] << 16;
|
||||
case 6:
|
||||
k2 ^= tail[5] << 8;
|
||||
k2 ^= (FT_UInt32)tail[5] << 8;
|
||||
case 5:
|
||||
k2 ^= tail[4] << 0;
|
||||
k2 ^= (FT_UInt32)tail[4];
|
||||
k2 *= c2;
|
||||
k2 = ROTL32( k2, 16 );
|
||||
k2 *= c3;
|
||||
h2 ^= k2;
|
||||
|
||||
case 4:
|
||||
k1 ^= tail[3] << 24;
|
||||
k1 ^= (FT_UInt32)tail[3] << 24;
|
||||
case 3:
|
||||
k1 ^= tail[2] << 16;
|
||||
k1 ^= (FT_UInt32)tail[2] << 16;
|
||||
case 2:
|
||||
k1 ^= tail[1] << 8;
|
||||
k1 ^= (FT_UInt32)tail[1] << 8;
|
||||
case 1:
|
||||
k1 ^= tail[0] << 0;
|
||||
k1 ^= (FT_UInt32)tail[0];
|
||||
k1 *= c1;
|
||||
k1 = ROTL32( k1, 15 );
|
||||
k1 *= c2;
|
||||
@ -699,7 +699,7 @@
|
||||
/* get digits of fractional part */
|
||||
for ( i = 0; i < 5; i++ )
|
||||
{
|
||||
*p++ = '0' + frac_part / 0x10000L;
|
||||
*p++ = '0' + (char)( frac_part / 0x10000L );
|
||||
|
||||
frac_part %= 0x10000L;
|
||||
if ( !frac_part )
|
||||
@ -875,6 +875,8 @@
|
||||
if ( ps_name )
|
||||
{
|
||||
result = ps_name;
|
||||
p = result + ft_strlen( result ) + 1;
|
||||
|
||||
goto check_length;
|
||||
}
|
||||
else
|
||||
@ -940,7 +942,7 @@
|
||||
|
||||
for ( i = 0; i < num_coords; i++, coords++, axis++ )
|
||||
{
|
||||
FT_ULong t;
|
||||
char t;
|
||||
|
||||
|
||||
/* omit axis value descriptor if it is identical */
|
||||
@ -951,16 +953,16 @@
|
||||
*p++ = '_';
|
||||
p = fixed2float( *coords, p );
|
||||
|
||||
t = axis->tag >> 24 & 0xFF;
|
||||
t = (char)( axis->tag >> 24 );
|
||||
if ( t != ' ' && ft_isalnum( t ) )
|
||||
*p++ = t;
|
||||
t = axis->tag >> 16 & 0xFF;
|
||||
t = (char)( axis->tag >> 16 );
|
||||
if ( t != ' ' && ft_isalnum( t ) )
|
||||
*p++ = t;
|
||||
t = axis->tag >> 8 & 0xFF;
|
||||
t = (char)( axis->tag >> 8 );
|
||||
if ( t != ' ' && ft_isalnum( t ) )
|
||||
*p++ = t;
|
||||
t = axis->tag & 0xFF;
|
||||
t = (char)axis->tag;
|
||||
if ( t != ' ' && ft_isalnum( t ) )
|
||||
*p++ = t;
|
||||
}
|
||||
|
@ -2205,8 +2205,8 @@
|
||||
|
||||
ns = &mmvar->namedstyle[fvar_head.instanceCount];
|
||||
|
||||
ns->strid = strid;
|
||||
ns->psid = psid;
|
||||
ns->strid = (FT_UInt)strid;
|
||||
ns->psid = (FT_UInt)psid;
|
||||
|
||||
a = mmvar->axis;
|
||||
c = ns->coords;
|
||||
|
Loading…
Reference in New Issue
Block a user