From c7f2a52f86a28ef1e7dec5098d8c239e49dbb93e Mon Sep 17 00:00:00 2001 From: Dave Arnold Date: Mon, 21 Nov 2016 15:32:50 -0800 Subject: [PATCH] [cff] minor code cleanup --- src/cff/cf2font.h | 1 - src/cff/cf2intrp.c | 2 +- src/cff/cffload.c | 4 ++-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/cff/cf2font.h b/src/cff/cf2font.h index 32063c781..8eb945dba 100644 --- a/src/cff/cf2font.h +++ b/src/cff/cf2font.h @@ -46,7 +46,6 @@ FT_BEGIN_HEADER -#define CF2_CFF2_STACK_SIZE 193 #define CF2_OPERAND_STACK_SIZE 48 #define CF2_MAX_SUBR 16 /* maximum subroutine nesting; */ /* only 10 are allowed but there exist */ diff --git a/src/cff/cf2intrp.c b/src/cff/cf2intrp.c index 66a237111..06afe7ed1 100644 --- a/src/cff/cf2intrp.c +++ b/src/cff/cf2intrp.c @@ -474,7 +474,7 @@ CF2_Fixed hintOriginY = curY; CF2_Stack opStack = NULL; - FT_UInt stackSize = font->isCFF2 ? CF2_CFF2_STACK_SIZE : CF2_OPERAND_STACK_SIZE; + FT_UInt stackSize; FT_Byte op1; /* first opcode byte */ CF2_F16Dot16 storage[CF2_STORAGE_SIZE]; /* for `put' and `get' */ diff --git a/src/cff/cffload.c b/src/cff/cffload.c index 1a6454314..6a58de826 100644 --- a/src/cff/cffload.c +++ b/src/cff/cffload.c @@ -1260,7 +1260,7 @@ /* compute expected number of operands for this blend */ FT_UInt numOperands = (FT_UInt)(numBlends * blend->lenBV); - FT_UInt count = parser->top - 1 - parser->stack; + FT_UInt count = (FT_UInt)( parser->top - 1 - parser->stack ); if ( numOperands > count ) { @@ -1859,7 +1859,7 @@ Exit: top->cid_font_name = 0xFFFFU; /* set default stack size */ - top->maxstack = cff2 ? 193 : 48; + top->maxstack = cff2 ? CFF2_DEFAULT_STACK : 48; if ( idx->count ) /* count is nonzero for a real index */ error = cff_index_access_element( idx, font_index, &dict, &dict_len );