[truetype] Fix compilation without bytecode.
Fixes #1351 and various warnings about unused variables.
* src/truetype/ttinterp.c: Put the entire body under #ifdef.
* src/truetype/ttgload.c (TT_Process_Composite_Glyph): Relocate
some declarations.
* src/truetype/ttinterp.h: Remove some #ifdef conditions.
* src/truetype/ttobjs.c (tt_size_done): Modified.
diff --git a/src/truetype/ttgload.c b/src/truetype/ttgload.c
index 0abfb0b..61731a5 100644
--- a/src/truetype/ttgload.c
+++ b/src/truetype/ttgload.c
@@ -1181,8 +1181,6 @@
{
FT_Error error;
FT_Outline* outline = &loader->gloader->base.outline;
- FT_Stream stream = loader->stream;
- FT_UShort n_ins;
FT_UInt i;
@@ -1201,8 +1199,10 @@
#ifdef TT_USE_BYTECODE_INTERPRETER
{
- TT_ExecContext exec = loader->exec;
+ TT_ExecContext exec = loader->exec;
FT_Memory memory = exec->memory;
+ FT_Stream stream = loader->stream;
+ FT_UShort n_ins;
if ( exec->glyphSize )
diff --git a/src/truetype/ttinterp.c b/src/truetype/ttinterp.c
index cfad9d7..d400e47 100644
--- a/src/truetype/ttinterp.c
+++ b/src/truetype/ttinterp.c
@@ -20,6 +20,9 @@
/* issues; many thanks! */
+#ifdef TT_USE_BYTECODE_INTERPRETER
+
+
#include <freetype/internal/ftdebug.h>
#include <freetype/internal/ftcalc.h>
#include <freetype/fttrigon.h>
@@ -34,9 +37,6 @@
#endif
-#ifdef TT_USE_BYTECODE_INTERPRETER
-
-
/**************************************************************************
*
* The macro FT_COMPONENT is used in trace mode. It is an implicit
diff --git a/src/truetype/ttinterp.h b/src/truetype/ttinterp.h
index c485371..f0e7cee 100644
--- a/src/truetype/ttinterp.h
+++ b/src/truetype/ttinterp.h
@@ -401,7 +401,6 @@
extern const TT_GraphicsState tt_default_graphics_state;
-#ifdef TT_USE_BYTECODE_INTERPRETER
FT_LOCAL( void )
TT_Set_CodeRange( TT_ExecContext exec,
FT_Int range,
@@ -411,7 +410,6 @@
FT_LOCAL( void )
TT_Clear_CodeRange( TT_ExecContext exec,
FT_Int range );
-#endif /* TT_USE_BYTECODE_INTERPRETER */
/**************************************************************************
@@ -438,7 +436,6 @@
TT_New_Context( TT_Driver driver );
-#ifdef TT_USE_BYTECODE_INTERPRETER
FT_LOCAL( void )
TT_Done_Context( TT_ExecContext exec );
@@ -454,7 +451,6 @@
FT_LOCAL( FT_Error )
TT_Run_Context( TT_ExecContext exec,
TT_Size size );
-#endif /* TT_USE_BYTECODE_INTERPRETER */
/**************************************************************************
diff --git a/src/truetype/ttobjs.c b/src/truetype/ttobjs.c
index ac54e01..e9a73bd 100644
--- a/src/truetype/ttobjs.c
+++ b/src/truetype/ttobjs.c
@@ -1156,11 +1156,10 @@
FT_LOCAL_DEF( void )
tt_size_done( FT_Size ttsize ) /* TT_Size */
{
- TT_Size size = (TT_Size)ttsize;
-
-
#ifdef TT_USE_BYTECODE_INTERPRETER
- tt_size_done_bytecode( size );
+ tt_size_done_bytecode( (TT_Size)ttsize );
+#else
+ FT_UNUSED( ttsize );
#endif
}