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'.
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
diff --git a/ChangeLog b/ChangeLog
index 45bc370..32d7c1a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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>
[truetype] Add another tricky font.
diff --git a/src/autofit/afcjk.c b/src/autofit/afcjk.c
index 6598747..4ba5d22 100644
--- 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;
diff --git a/src/autofit/aflatin.c b/src/autofit/aflatin.c
index 394ea9f..8a45116 100644
--- 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;
diff --git a/src/base/ftcalc.c b/src/base/ftcalc.c
index e962371..67549d0 100644
--- 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
diff --git a/src/base/ftdbgmem.c b/src/base/ftdbgmem.c
index 35c6f5f..6ab5072 100644
--- 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 );
diff --git a/src/base/fthash.c b/src/base/fthash.c
index 13c18bc..779f795 100644
--- 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;
diff --git a/src/base/fttrigon.c b/src/base/fttrigon.c
index 3ed19be..7b582c8 100644
--- 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;
}
diff --git a/src/gxvalid/gxvcommn.c b/src/gxvalid/gxvcommn.c
index 4a0a92c..37a4c29 100644
--- 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;
diff --git a/src/type1/t1driver.c b/src/type1/t1driver.c
index 2692bc8..f1e60d4 100644
--- 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 )
diff --git a/src/type1/t1load.c b/src/type1/t1load.c
index 6be7d68..a53037c 100644
--- 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;