Fix compiler warnings. * src/psaux/psft.c (cf2_initLocalRegionBuffer): Remove redundant test. * src/psaux/psintrp.c (cf2_interpT2CharString) <cf2_escCALLOTHERSUBR>: Add casts. * src/psaux/psobjs.c (ps_decoder_init): Add cast.
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
diff --git a/ChangeLog b/ChangeLog
index 6930a85..459182d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2017-09-25 Werner Lemberg <wl@gnu.org>
+
+ [psaux] Fix compiler warnings.
+
+ * src/psaux/psft.c (cf2_initLocalRegionBuffer): Remove redundant
+ test.
+
+ * src/psaux/psintrp.c (cf2_interpT2CharString)
+ <cf2_escCALLOTHERSUBR>: Add casts.
+
+ * src/psaux/psobjs.c (ps_decoder_init): Add cast.
+
2017-09-25 Ewald Hew <ewaldhew@gmail.com>
[psaux] Minor fixes.
diff --git a/src/psaux/psft.c b/src/psaux/psft.c
index 89e168a..8ddabc2 100644
--- a/src/psaux/psft.c
+++ b/src/psaux/psft.c
@@ -793,7 +793,7 @@
FT_ZERO( buf );
idx = (CF2_UInt)( subrNum + decoder->locals_bias );
- if ( idx < 0 || idx >= decoder->num_locals )
+ if ( idx >= decoder->num_locals )
return TRUE; /* error */
FT_ASSERT( decoder->locals );
diff --git a/src/psaux/psintrp.c b/src/psaux/psintrp.c
index 61fc8f8..9e67187 100644
--- a/src/psaux/psintrp.c
+++ b/src/psaux/psintrp.c
@@ -1642,9 +1642,9 @@
/* stack pointer as necessary */
count = cf2_stack_count( opStack );
- FT_ASSERT( arg_cnt <= count );
+ FT_ASSERT( (CF2_UInt)arg_cnt <= count );
- opIdx += count - arg_cnt;
+ opIdx += count - (CF2_UInt)arg_cnt;
known_othersubr_result_cnt = 0;
result_cnt = 0;
@@ -1840,7 +1840,7 @@
cf2_stack_setReal( opStack, values++, tmp );
}
cf2_stack_pop( opStack,
- arg_cnt - num_points );
+ (CF2_UInt)arg_cnt - num_points );
known_othersubr_result_cnt = (FT_Int)num_points;
break;
@@ -2052,7 +2052,7 @@
default:
if ( arg_cnt >= 0 && subr_no >= 0 )
{
- FT_UInt i;
+ FT_Int i;
FT_ERROR(( "cf2_interpT2CharString (Type 1 mode):"
" unknown othersubr [%d %d], wish me luck\n",
diff --git a/src/psaux/psobjs.c b/src/psaux/psobjs.c
index 0baba7a..1b0b094 100644
--- a/src/psaux/psobjs.c
+++ b/src/psaux/psobjs.c
@@ -2368,7 +2368,7 @@
ps_decoder->hint_mode = t1_decoder->hint_mode;
ps_decoder->blend = t1_decoder->blend;
- ps_decoder->num_locals = t1_decoder->num_subrs;
+ ps_decoder->num_locals = (FT_UInt)t1_decoder->num_subrs;
ps_decoder->locals = t1_decoder->subrs;
ps_decoder->locals_len = t1_decoder->subrs_len;
ps_decoder->locals_hash = t1_decoder->subrs_hash;