shithub: freetype+ttf2subf

Download patch

ref: d5bfa053f5854cc42966634e1b26a8024b7a51d4
parent: e5595784f4075a631f3d6606cecc6dad3100d642
author: Werner Lemberg <[email protected]>
date: Fri Mar 17 17:47:54 EDT 2017

Fixes for conditional compilation.

* src/autofit/afcjk.c, src/autofit/afindic.c: Include `afcjk.h'
earlier.

* src/sfnt/sfobjs.c (sfnt_init_face): Put `memory' variable into
TT_CONFIG_OPTION_GX_VAR_SUPPORT block.
(sfnt_done_face): Protect some code with
TT_CONFIG_OPTION_GX_VAR_SUPPORT.

* src/sfnt/ttsbit.c (tt_face_load_sbix_image): Remove compiler
warning.

* src/truetype/ttgload.c (TT_Load_Simple_Glyph): Put `tmp' variable
into TT_USE_BYTECODE_INTERPRETER block.

(tt_loader_init): Put `error' variable into
TT_USE_BYTECODE_INTERPRETER block.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,26 @@
 2017-03-17  Werner Lemberg  <[email protected]>
 
+	Fixes for conditional compilation.
+
+	* src/autofit/afcjk.c, src/autofit/afindic.c: Include `afcjk.h'
+	earlier.
+
+	* src/sfnt/sfobjs.c (sfnt_init_face): Put `memory' variable into
+	TT_CONFIG_OPTION_GX_VAR_SUPPORT block.
+	(sfnt_done_face): Protect some code with
+	TT_CONFIG_OPTION_GX_VAR_SUPPORT.
+
+	* src/sfnt/ttsbit.c (tt_face_load_sbix_image): Remove compiler
+	warning.
+
+	* src/truetype/ttgload.c (TT_Load_Simple_Glyph): Put `tmp' variable
+	into TT_USE_BYTECODE_INTERPRETER block.
+
+	(tt_loader_init): Put `error' variable into
+	TT_USE_BYTECODE_INTERPRETER block.
+
+2017-03-17  Werner Lemberg  <[email protected]>
+
 	Fix preprocessor warning.
 
 	* devel/ftoption.h, include/freetype/config/ftoption.h: Test whether
--- a/src/autofit/afcjk.c
+++ b/src/autofit/afcjk.c
@@ -29,6 +29,7 @@
 #include "afglobal.h"
 #include "afpic.h"
 #include "aflatin.h"
+#include "afcjk.h"
 
 
 #ifdef AF_CONFIG_OPTION_CJK
@@ -35,7 +36,6 @@
 
 #undef AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT
 
-#include "afcjk.h"
 #include "aferrors.h"
 
 
--- a/src/autofit/afindic.c
+++ b/src/autofit/afindic.c
@@ -18,6 +18,7 @@
 
 #include "aftypes.h"
 #include "aflatin.h"
+#include "afcjk.h"
 
 
 #ifdef AF_CONFIG_OPTION_INDIC
@@ -24,7 +25,6 @@
 
 #include "afindic.h"
 #include "aferrors.h"
-#include "afcjk.h"
 
 
 #ifdef AF_CONFIG_OPTION_USE_WARPER
--- a/src/sfnt/sfobjs.c
+++ b/src/sfnt/sfobjs.c
@@ -856,7 +856,6 @@
                   FT_Parameter*  params )
   {
     FT_Error      error;
-    FT_Memory     memory = face->root.memory;
     FT_Library    library = face->root.driver->root.library;
     SFNT_Service  sfnt;
     FT_Int        face_index;
@@ -943,6 +942,8 @@
 
 #ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
     {
+      FT_Memory  memory = face->root.memory;
+
       FT_ULong  fvar_len;
 
       FT_ULong  version;
@@ -1754,8 +1755,10 @@
     FT_FREE( face->sbit_strike_map );
     face->root.num_fixed_sizes = 0;
 
+#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
     FT_FREE( face->postscript_name );
     FT_FREE( face->var_postscript_prefix );
+#endif
 
     face->sfnt = NULL;
   }
--- a/src/sfnt/ttsbit.c
+++ b/src/sfnt/ttsbit.c
@@ -1460,6 +1460,9 @@
     FT_Byte*  p;
 
     FT_UNUSED( map );
+#ifndef FT_CONFIG_OPTION_USE_PNG
+    FT_UNUSED( metrics_only );
+#endif
 
 
     strike_index = face->sbit_strike_map[strike_index];
--- a/src/truetype/ttgload.c
+++ b/src/truetype/ttgload.c
@@ -332,7 +332,6 @@
     FT_Outline*     outline;
     FT_UShort       n_ins;
     FT_Int          n_points;
-    FT_ULong        tmp;
 
     FT_Byte         *flag, *flag_limit;
     FT_Byte         c, count;
@@ -402,6 +401,9 @@
 
     if ( IS_HINTED( load->load_flags ) )
     {
+      FT_ULong  tmp;
+
+
       /* check instructions size */
       if ( ( limit - p ) < n_ins )
       {
@@ -2270,16 +2272,16 @@
                   FT_Int32      load_flags,
                   FT_Bool       glyf_table_only )
   {
-    FT_Error  error;
-
     TT_Face    face;
     FT_Stream  stream;
+
 #ifdef TT_USE_BYTECODE_INTERPRETER
+    FT_Error   error;
     FT_Bool    pedantic = FT_BOOL( load_flags & FT_LOAD_PEDANTIC );
-#endif
 #if defined TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY || \
     defined TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
     TT_Driver  driver = (TT_Driver)FT_FACE_DRIVER( (TT_Face)glyph->face );
+#endif
 #endif