Various minor clang fixes.

* src/autofit/afcjk.c (af_cjk_metrics_init_widths),
src/autofit/aflatin.c (af_latin_metrics_init_widths): Initialize
`ch'.

* src/base/ftcalc.c (FT_MulFix) [FT_LONG64]: Add cast.

* src/base/ftdbgmem.c (ft_mem_table_destroy): Add cast.

* src/base/fthash.c (hash_num_lookup): Add cast.

* src/base/fttrigon.c (ft_trig_downscale) [FT_LONG64]: Fix cast.

* src/gxvalid/gxvcommn.c (gxv_EntryTable_validate): Comment out
redundant code.

* src/type1/t1driver.c (t1_get_ps_font_value) <PS_DICT_SUBR>: Add
cast.

* src/type1/t1load.c (parse_subrs): Fix type of `count'.
This commit is contained in:
Werner Lemberg 2016-01-19 19:15:54 +01:00
parent 4cdfefd4bd
commit fc11af1ea2
10 changed files with 39 additions and 8 deletions

View File

@ -1,3 +1,27 @@
2016-01-19 Werner Lemberg <wl@gnu.org>
Various minor clang fixes.
* src/autofit/afcjk.c (af_cjk_metrics_init_widths),
src/autofit/aflatin.c (af_latin_metrics_init_widths): Initialize
`ch'.
* src/base/ftcalc.c (FT_MulFix) [FT_LONG64]: Add cast.
* src/base/ftdbgmem.c (ft_mem_table_destroy): Add cast.
* src/base/fthash.c (hash_num_lookup): Add cast.
* src/base/fttrigon.c (ft_trig_downscale) [FT_LONG64]: Fix cast.
* src/gxvalid/gxvcommn.c (gxv_EntryTable_validate): Comment out
redundant code.
* src/type1/t1driver.c (t1_get_ps_font_value) <PS_DICT_SUBR>: Add
cast.
* src/type1/t1load.c (parse_subrs): Fix type of `count'.
2016-01-19 Derek B. Noonburg <derekn@glyphandcog.com> 2016-01-19 Derek B. Noonburg <derekn@glyphandcog.com>
[truetype] Add another tricky font. [truetype] Add another tricky font.

View File

@ -104,7 +104,7 @@
const char* p; const char* p;
#ifdef FT_DEBUG_LEVEL_TRACE #ifdef FT_DEBUG_LEVEL_TRACE
FT_ULong ch; FT_ULong ch = 0;
#endif #endif
p = script_class->standard_charstring; p = script_class->standard_charstring;

View File

@ -95,7 +95,7 @@
const char* p; const char* p;
#ifdef FT_DEBUG_LEVEL_TRACE #ifdef FT_DEBUG_LEVEL_TRACE
FT_ULong ch; FT_ULong ch = 0;
#endif #endif
p = script_class->standard_charstring; p = script_class->standard_charstring;

View File

@ -233,7 +233,7 @@
{ {
#ifdef FT_MULFIX_ASSEMBLER #ifdef FT_MULFIX_ASSEMBLER
return FT_MULFIX_ASSEMBLER( a_, b_ ); return FT_MULFIX_ASSEMBLER( (FT_Int32)a_, (FT_Int32)b_ );
#else #else

View File

@ -367,7 +367,8 @@
{ {
printf( printf(
"leaked memory block at address %p, size %8ld in (%s:%ld)\n", "leaked memory block at address %p, size %8ld in (%s:%ld)\n",
node->address, node->size, (void*)node->address,
node->size,
FT_FILENAME( node->source->file_name ), FT_FILENAME( node->source->file_name ),
node->source->line_no ); node->source->line_no );

View File

@ -64,7 +64,7 @@
static FT_ULong static FT_ULong
hash_num_lookup( FT_Hashkey* key ) hash_num_lookup( FT_Hashkey* key )
{ {
FT_ULong num = key->num; FT_ULong num = (FT_ULong)key->num;
FT_ULong res; FT_ULong res;

View File

@ -71,7 +71,8 @@
/* 0x40000000 comes from regression analysis between true */ /* 0x40000000 comes from regression analysis between true */
/* and CORDIC hypotenuse, so it minimizes the error */ /* and CORDIC hypotenuse, so it minimizes the error */
val = (FT_Fixed)( ( (FT_Int64)val * FT_TRIG_SCALE + 0x40000000UL ) >> 32 ); val = (FT_Fixed)(
( (FT_UInt64)val * FT_TRIG_SCALE + 0x40000000UL ) >> 32 );
return s < 0 ? -val : val; return s < 0 ? -val : val;
} }

View File

@ -1160,9 +1160,11 @@
glyphOffset.l = FT_NEXT_LONG( p ); glyphOffset.l = FT_NEXT_LONG( p );
break; break;
#if 0
default: default:
GXV_SET_ERR_IF_PARANOID( FT_INVALID_FORMAT ); GXV_SET_ERR_IF_PARANOID( FT_INVALID_FORMAT );
goto Exit; goto Exit;
#endif
} }
if ( NULL != gxvalid->statetable.entry_validate_func ) if ( NULL != gxvalid->statetable.entry_validate_func )
@ -1174,7 +1176,9 @@
gxvalid ); gxvalid );
} }
#if 0
Exit: Exit:
#endif
*length_p = (FT_UShort)( p - table ); *length_p = (FT_UShort)( p - table );
GXV_EXIT; GXV_EXIT;

View File

@ -337,7 +337,8 @@
if ( type1->subrs_hash ) if ( type1->subrs_hash )
{ {
/* convert subr index to array index */ /* convert subr index to array index */
size_t* val = ft_hash_num_lookup( idx, type1->subrs_hash ); size_t* val = ft_hash_num_lookup( (FT_Int)idx,
type1->subrs_hash );
if ( val ) if ( val )

View File

@ -1405,7 +1405,7 @@
FT_Memory memory = parser->root.memory; FT_Memory memory = parser->root.memory;
FT_Error error; FT_Error error;
FT_Int num_subrs; FT_Int num_subrs;
FT_Int count; FT_UInt count;
FT_Hash hash = NULL; FT_Hash hash = NULL;
PSAux_Service psaux = (PSAux_Service)face->psaux; PSAux_Service psaux = (PSAux_Service)face->psaux;