ref: fc11af1ea23f8f905fb4ce8219d165613fb974eb
parent: 4cdfefd4bd0d1ae521a77385f5f0b635579c8771
author: Werner Lemberg <[email protected]>
date: Tue Jan 19 14:15:54 EST 2016
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'.
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,27 @@
+2016-01-19 Werner Lemberg <[email protected]>
+
+ 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 <[email protected]>
[truetype] Add another tricky font.
--- a/src/autofit/afcjk.c
+++ b/src/autofit/afcjk.c
@@ -104,7 +104,7 @@
const char* p;
#ifdef FT_DEBUG_LEVEL_TRACE
- FT_ULong ch;
+ FT_ULong ch = 0;
#endif
p = script_class->standard_charstring;
--- a/src/autofit/aflatin.c
+++ b/src/autofit/aflatin.c
@@ -95,7 +95,7 @@
const char* p;
#ifdef FT_DEBUG_LEVEL_TRACE
- FT_ULong ch;
+ FT_ULong ch = 0;
#endif
p = script_class->standard_charstring;
--- a/src/base/ftcalc.c
+++ b/src/base/ftcalc.c
@@ -233,7 +233,7 @@
{
#ifdef FT_MULFIX_ASSEMBLER
- return FT_MULFIX_ASSEMBLER( a_, b_ );
+ return FT_MULFIX_ASSEMBLER( (FT_Int32)a_, (FT_Int32)b_ );
#else
--- a/src/base/ftdbgmem.c
+++ b/src/base/ftdbgmem.c
@@ -367,7 +367,8 @@
{
printf(
"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 ),
node->source->line_no );
--- a/src/base/fthash.c
+++ b/src/base/fthash.c
@@ -64,7 +64,7 @@
static FT_ULong
hash_num_lookup( FT_Hashkey* key )
{
- FT_ULong num = key->num;
+ FT_ULong num = (FT_ULong)key->num;
FT_ULong res;
--- a/src/base/fttrigon.c
+++ b/src/base/fttrigon.c
@@ -71,7 +71,8 @@
/* 0x40000000 comes from regression analysis between true */
/* 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;
}
--- a/src/gxvalid/gxvcommn.c
+++ b/src/gxvalid/gxvcommn.c
@@ -1160,9 +1160,11 @@
glyphOffset.l = FT_NEXT_LONG( p );
break;
+#if 0
default:
GXV_SET_ERR_IF_PARANOID( FT_INVALID_FORMAT );
goto Exit;
+#endif
}
if ( NULL != gxvalid->statetable.entry_validate_func )
@@ -1174,7 +1176,9 @@
gxvalid );
}
+#if 0
Exit:
+#endif
*length_p = (FT_UShort)( p - table );
GXV_EXIT;
--- a/src/type1/t1driver.c
+++ b/src/type1/t1driver.c
@@ -337,7 +337,8 @@
if ( type1->subrs_hash )
{
/* 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 )
--- a/src/type1/t1load.c
+++ b/src/type1/t1load.c
@@ -1405,7 +1405,7 @@
FT_Memory memory = parser->root.memory;
FT_Error error;
FT_Int num_subrs;
- FT_Int count;
+ FT_UInt count;
FT_Hash hash = NULL;
PSAux_Service psaux = (PSAux_Service)face->psaux;