From d5bfa053f5854cc42966634e1b26a8024b7a51d4 Mon Sep 17 00:00:00 2001 From: Werner Lemberg Date: Fri, 17 Mar 2017 21:47:54 +0100 Subject: [PATCH] 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. --- ChangeLog | 21 +++++++++++++++++++++ src/autofit/afcjk.c | 2 +- src/autofit/afindic.c | 2 +- src/sfnt/sfobjs.c | 5 ++++- src/sfnt/ttsbit.c | 3 +++ src/truetype/ttgload.c | 10 ++++++---- 6 files changed, 36 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 55733a0bc..1f0163b7c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,24 @@ +2017-03-17 Werner Lemberg + + 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 Fix preprocessor warning. diff --git a/src/autofit/afcjk.c b/src/autofit/afcjk.c index f172a9fd9..ec05ee4d9 100644 --- a/src/autofit/afcjk.c +++ b/src/autofit/afcjk.c @@ -29,13 +29,13 @@ #include "afglobal.h" #include "afpic.h" #include "aflatin.h" +#include "afcjk.h" #ifdef AF_CONFIG_OPTION_CJK #undef AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT -#include "afcjk.h" #include "aferrors.h" diff --git a/src/autofit/afindic.c b/src/autofit/afindic.c index 03c611b9f..23be46ed5 100644 --- a/src/autofit/afindic.c +++ b/src/autofit/afindic.c @@ -18,13 +18,13 @@ #include "aftypes.h" #include "aflatin.h" +#include "afcjk.h" #ifdef AF_CONFIG_OPTION_INDIC #include "afindic.h" #include "aferrors.h" -#include "afcjk.h" #ifdef AF_CONFIG_OPTION_USE_WARPER diff --git a/src/sfnt/sfobjs.c b/src/sfnt/sfobjs.c index 36400749a..0418d83ca 100644 --- 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; } diff --git a/src/sfnt/ttsbit.c b/src/sfnt/ttsbit.c index 98295932d..5a0215d01 100644 --- 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]; diff --git a/src/truetype/ttgload.c b/src/truetype/ttgload.c index 0fdaa85f2..eecf7afdd 100644 --- 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,17 +2272,17 @@ 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 face = (TT_Face)glyph->face;