freetype-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[freetype2] OpenType-1.8 c7f2a52 4/5: [cff] minor code cleanup


From: Dave Arnold
Subject: [freetype2] OpenType-1.8 c7f2a52 4/5: [cff] minor code cleanup
Date: Tue, 22 Nov 2016 02:08:38 +0000 (UTC)

branch: OpenType-1.8
commit c7f2a52f86a28ef1e7dec5098d8c239e49dbb93e
Author: Dave Arnold <address@hidden>
Commit: Dave Arnold <address@hidden>

    [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 32063c7..8eb945d 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 66a2371..06afe7e 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 1a64543..6a58de8 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 );



reply via email to

[Prev in Thread] Current Thread [Next in Thread]