shithub: freetype+ttf2subf

Download patch

ref: 4cdbac05b9a17645cbecfcb18f7d1bcd573b67d6
parent: a1a6a1f6799da772ae1b625ea2fb09d5f5bbce5d
author: Werner Lemberg <[email protected]>
date: Mon Sep 25 05:05:00 EDT 2017

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.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2017-09-25  Werner Lemberg  <[email protected]>
+
+	[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  <[email protected]>
 
 	[psaux] Minor fixes.
--- 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 );
--- 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",
--- 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;