freetype-commit
[Top][All Lists]
Advanced

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

[freetype2] int-not32-changes-2017 7576da1 16/25: [cff] internal API is


From: suzuki toshiya
Subject: [freetype2] int-not32-changes-2017 7576da1 16/25: [cff] internal API is changed incompatibly for 16bit & ILP64 systems.
Date: Wed, 13 Sep 2017 04:15:06 -0400 (EDT)

branch: int-not32-changes-2017
commit 7576da1c3efd7d4c6471acb5be5caba161da6990
Author: suzuki toshiya <address@hidden>
Commit: suzuki toshiya <address@hidden>

    [cff] internal API is changed incompatibly for 16bit & ILP64 systems.
    bias calculation is expected to be ILP32, LP64 or LLP64 systems (int = 
32bit).
    Some internal variables and internal APIs are extended to use 32bit type 
for 16bit systems.
    Using long type is too large on LP64 systems,
    and induces the incompatible change of the internal API for 32bit systems,
    it should be avoided.
---
 src/cff/cffgload.c | 10 +++++-----
 src/cff/cffgload.h |  4 ++--
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/cff/cffgload.c b/src/cff/cffgload.c
index 20f3a2c..b461d0a 100644
--- a/src/cff/cffgload.c
+++ b/src/cff/cffgload.c
@@ -342,11 +342,11 @@
   /*                                                                       */
   /* <Return>                                                              */
   /*    The bias value.                                                    */
-  static FT_Int
+  static FT_Int32
   cff_compute_bias( FT_Int   in_charstring_type,
                     FT_UInt  num_subrs )
   {
-    FT_Int  result;
+    FT_Int32  result;
 
 
     if ( in_charstring_type == 1 )
@@ -2326,7 +2326,7 @@
               end = FT_MIN( idx + count, CFF_MAX_TRANS_ELEMENTS );
 
               if ( idx < end )
-                decoder->buildchar[idx] = 1 << 16;
+                decoder->buildchar[idx] = (FT_Fixed)1 << 16;
 
               for ( i = idx + 1; i < end; i++ )
                 decoder->buildchar[i] = 0;
@@ -2526,7 +2526,7 @@
 
         case cff_op_callsubr:
           {
-            FT_UInt  idx = (FT_UInt)( ( args[0] >> 16 ) +
+            FT_UInt32  idx = (FT_UInt32)( ( args[0] >> 16 ) +
                                       decoder->locals_bias );
 
 
@@ -2570,7 +2570,7 @@
 
         case cff_op_callgsubr:
           {
-            FT_UInt  idx = (FT_UInt)( ( args[0] >> 16 ) +
+            FT_UInt32  idx = (FT_UInt32)( ( args[0] >> 16 ) +
                                       decoder->globals_bias );
 
 
diff --git a/src/cff/cffgload.h b/src/cff/cffgload.h
index 0fa93b4..dfa1f75 100644
--- a/src/cff/cffgload.h
+++ b/src/cff/cffgload.h
@@ -183,8 +183,8 @@ FT_BEGIN_HEADER
     FT_UInt            num_locals;
     FT_UInt            num_globals;
 
-    FT_Int             locals_bias;
-    FT_Int             globals_bias;
+    FT_Int32           locals_bias;
+    FT_Int32           globals_bias;
 
     FT_Byte**          locals;
     FT_Byte**          globals;



reply via email to

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