shithub: freetype+ttf2subf

Download patch

ref: 94dbf7f0222d9585ea60166d4146c475cd888137
parent: 4b29d58761b6ad46eff097db54ab94d3925963ca
author: David Turner <[email protected]>
date: Mon Mar 25 21:38:39 EST 2002

fixed a small bug in FT_CMaps support

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2002-03-26  David Turner    <[email protected]>
+
+	* src/sfnt/sfdriver.c, src/sfnt/sfobjs.c, src/sfnt/ttcmap0.c:
+	  fixed a small bug in the FT_CMaps support code
+
 2002-03-22  David Turner    <[email protected]>
 
         * src/base/ftobjs.c, src/sfnt/ttcmap0.c, src/type1/t1objs.c:
--- a/src/sfnt/sfdriver.c
+++ b/src/sfnt/sfdriver.c
@@ -174,12 +174,11 @@
       TT_NameEntryRec*  name   = face->name_table.names + found_win;
       FT_UInt           len    = name->stringLength;
       FT_Error          error;
-      FT_String*        result;
-      
+
       if ( !FT_ALLOC( result, len+1 ) )
       {
-        FT_MEM_COPY( result, name->string, len );
-        result[len] = '\0';
+        FT_MEM_COPY( (char*)result, name->string, len );
+        ((char*)result)[len] = '\0';
       }
       goto Exit;
     }
--- a/src/sfnt/sfobjs.c
+++ b/src/sfnt/sfobjs.c
@@ -461,11 +461,11 @@
       
       /* set the encoding fields */
       {
-        FT_Int  n;
+        FT_Int  m;
         
-        for ( n = 0; n < root->num_charmaps; n++ )
+        for ( m = 0; m < root->num_charmaps; m++ )
         {
-          FT_CharMap  charmap = root->charmaps[n];
+          FT_CharMap  charmap = root->charmaps[m];
           
           charmap->encoding = sfnt_find_encoding( charmap->platform_id,
                                                   charmap->encoding_id );
--- a/src/sfnt/ttcmap0.c
+++ b/src/sfnt/ttcmap0.c
@@ -144,7 +144,7 @@
   FT_CALLBACK_TABLE_DEF const TT_CMap_ClassRec  tt_cmap0_class_rec =
   {
     {
-      sizeof( FT_CMapRec ),
+      sizeof( TT_CMapRec ),
 
       (FT_CMap_InitFunc)      tt_cmap_init,
       (FT_CMap_DoneFunc)      NULL,
@@ -488,7 +488,7 @@
   FT_CALLBACK_TABLE_DEF const TT_CMap_ClassRec  tt_cmap2_class_rec =
   {
     {
-      sizeof( FT_CMapRec ),
+      sizeof( TT_CMapRec ),
 
       (FT_CMap_InitFunc)      tt_cmap_init,
       (FT_CMap_DoneFunc)      NULL,
@@ -817,7 +817,7 @@
   FT_CALLBACK_TABLE_DEF const TT_CMap_ClassRec  tt_cmap4_class_rec =
   {
     {
-      sizeof( FT_CMapRec ),
+      sizeof( TT_CMapRec ),
 
       (FT_CMap_InitFunc)      tt_cmap_init,
       (FT_CMap_DoneFunc)      NULL,
@@ -957,7 +957,7 @@
   FT_CALLBACK_TABLE_DEF const TT_CMap_ClassRec  tt_cmap6_class_rec =
   {
     {
-      sizeof( FT_CMapRec ),
+      sizeof( TT_CMapRec ),
 
       (FT_CMap_InitFunc)      tt_cmap_init,
       (FT_CMap_DoneFunc)      NULL,
@@ -1150,8 +1150,7 @@
 
   FT_CALLBACK_DEF( FT_UInt )
   tt_cmap8_char_next( TT_CMap    cmap,
-                      FT_UInt32 *pchar_code,
-                      FT_UInt   *agindex )
+                      FT_UInt32 *pchar_code )
   {
     FT_UInt32  result     = 0;
     FT_UInt32  char_code  = *pchar_code + 1;
@@ -1192,7 +1191,7 @@
   FT_CALLBACK_TABLE_DEF const TT_CMap_ClassRec  tt_cmap8_class_rec =
   {
     {
-      sizeof( FT_CMapRec ),
+      sizeof( TT_CMapRec ),
 
       (FT_CMap_InitFunc)      tt_cmap_init,
       (FT_CMap_DoneFunc)      NULL,
@@ -1323,7 +1322,7 @@
   FT_CALLBACK_TABLE_DEF const TT_CMap_ClassRec  tt_cmap10_class_rec =
   {
     {
-      sizeof( FT_CMapRec ),
+      sizeof( TT_CMapRec ),
 
       (FT_CMap_InitFunc)      tt_cmap_init,
       (FT_CMap_DoneFunc)      NULL,