freetype-commit
[Top][All Lists]
Advanced

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

[freetype2] parthw-cleaned 921d735: [tfm] Minor Fixes.


From: Parth Wazurkar
Subject: [freetype2] parthw-cleaned 921d735: [tfm] Minor Fixes.
Date: Fri, 27 Jul 2018 00:27:31 -0400 (EDT)

branch: parthw-cleaned
commit 921d7350416c2d1077ed1788ea2fa383cdef326a
Author: Parth Wazurkar <address@hidden>
Commit: Parth Wazurkar <address@hidden>

    [tfm] Minor Fixes.
---
 src/tfm/tfmobjs.c | 48 ++++++++++++++++++++++++------------------------
 1 file changed, 24 insertions(+), 24 deletions(-)

diff --git a/src/tfm/tfmobjs.c b/src/tfm/tfmobjs.c
index 529ad58..72bddc7 100644
--- a/src/tfm/tfmobjs.c
+++ b/src/tfm/tfmobjs.c
@@ -50,8 +50,8 @@
   unsigned long  tfm_read_uintn(FT_Stream,int);
 
 #define READ_UINT2( stream )    (FT_Byte)tfm_read_uintn( stream, 2)
-#define READ_FT_ULong( stream )    (FT_Byte)tfm_read_uintn( stream, 4)
-#define READ_FT_Long( stream )     (FT_Long)tfm_read_intn( stream, 4)
+#define READ_UINT4( stream )    (FT_Byte)tfm_read_uintn( stream, 4)
+#define READ_INT4( stream )     (FT_Long)tfm_read_intn( stream, 4)
 
 /*
  * Reading a Number from file
@@ -184,8 +184,8 @@
       tfm->type_aux    = READ_INT2(fp);    /* ofm_level */
       if ((tfm->type_aux < 0) || (1 < tfm->type_aux))
         tfm->type_aux = 0;  /* broken, maybe */
-      lf               = READ_FT_ULong(fp);
-      lh               = READ_FT_ULong(fp);
+      lf               = READ_UINT4(fp);
+      lh               = READ_UINT4(fp);
       if (tfm->type_aux == 0)
       {   /* level 0 OFM */
         offset_header    = 4*14;
@@ -208,18 +208,18 @@
     #if 0
     if (tfm->type == METRIC_TYPE_OFM)
     {
-      tfm->begin_char  = READ_FT_ULong(fp);
-      tfm->end_char    = READ_FT_ULong(fp);
-      nw   = READ_FT_ULong(fp);
-      nh   = READ_FT_ULong(fp);
-      nd   = READ_FT_ULong(fp);
-
-      ni   = READ_FT_ULong(fp);
-      nl   = READ_FT_ULong(fp);
-      nk   = READ_FT_ULong(fp);
-      neng = READ_FT_ULong(fp);
-      np   = READ_FT_ULong(fp);
-      dir  = READ_FT_ULong(fp);
+      tfm->begin_char  = READ_UINT4(fp);
+      tfm->end_char    = READ_UINT4(fp);
+      nw   = READ_UINT4(fp);
+      nh   = READ_UINT4(fp);
+      nd   = READ_UINT4(fp);
+
+      ni   = READ_UINT4(fp);
+      nl   = READ_UINT4(fp);
+      nk   = READ_UINT4(fp);
+      neng = READ_UINT4(fp);
+      np   = READ_UINT4(fp);
+      dir  = READ_UINT4(fp);
 
       if (((signed)(tfm->begin_char-1) > (signed)tfm->end_char) ||
         (tfm->end_char > 65535))
@@ -258,9 +258,9 @@
     /* fseek(fp, offset_header, SEEK_SET); */
     if (FT_STREAM_SEEK( offset_header ) )
       goto Exit;
-    fi->cs          = READ_FT_ULong( stream );
-    fi->ds          = READ_FT_ULong( stream );
-    fi->design_size = (double)(fi->ds)/(double)(1<<20);
+    fi->cs          = READ_UINT4( stream );
+    fi->ds          = READ_UINT4( stream );
+    fi->design_size = (FT_ULong)(fi->ds)/(FT_ULong)(1<<20);
 
     nc  = fi->end_char - fi->begin_char + 1;
     nci = nc;
@@ -281,17 +281,17 @@
     if( FT_STREAM_SEEK( offset_char_info ) )
       goto Exit;
     for (i = 0; i < nci; i++)
-      ci[i] = READ_FT_ULong( stream );
+      ci[i] = READ_UINT4( stream );
 
     /* offset_param = ftell(fp) + 4*(nw + nh + nd + ni + nl + nk + neng); */
     offset_param = stream->pos + 4*(nw + nh + nd + ni + nl + nk + neng);
 
     for (i = 0; i < nw; i++)
-      w[i] = READ_FT_Long( stream );
+      w[i] = READ_INT4( stream );
     for (i = 0; i < nh; i++)
-      h[i] = READ_FT_Long( stream );
+      h[i] = READ_INT4( stream );
     for (i = 0; i < nd; i++)
-      d[i] = READ_FT_Long( stream );
+      d[i] = READ_INT4( stream );
 
     fi->width  = (FT_Long*)calloc(nc, sizeof(FT_Long));
     fi->height = (FT_Long*)calloc(nc, sizeof(FT_Long));
@@ -367,7 +367,7 @@
       }
       for (i = 0; i < tfm->nt; i++)
       {
-        v = READ_FT_ULong(fp);
+        v = READ_UINT4(fp);
         tfm->ct_kcode[i] = v/0x10000L;
         tfm->ct_ctype[i] = v%0x10000L;
       }



reply via email to

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