From 4cdbac05b9a17645cbecfcb18f7d1bcd573b67d6 Mon Sep 17 00:00:00 2001 From: Werner Lemberg Date: Mon, 25 Sep 2017 09:05:00 +0200 Subject: [PATCH] Fix compiler warnings. * src/psaux/psft.c (cf2_initLocalRegionBuffer): Remove redundant test. * src/psaux/psintrp.c (cf2_interpT2CharString) : Add casts. * src/psaux/psobjs.c (ps_decoder_init): Add cast. --- ChangeLog | 12 ++++++++++++ src/psaux/psft.c | 2 +- src/psaux/psintrp.c | 8 ++++---- src/psaux/psobjs.c | 2 +- 4 files changed, 18 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6930a8532..459182d39 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2017-09-25 Werner Lemberg + + [psaux] Fix compiler warnings. + + * src/psaux/psft.c (cf2_initLocalRegionBuffer): Remove redundant + test. + + * src/psaux/psintrp.c (cf2_interpT2CharString) + : Add casts. + + * src/psaux/psobjs.c (ps_decoder_init): Add cast. + 2017-09-25 Ewald Hew [psaux] Minor fixes. diff --git a/src/psaux/psft.c b/src/psaux/psft.c index 89e168a94..8ddabc26d 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 61fc8f856..9e6718702 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 0baba7aa6..1b0b094c0 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;