Commit 94dbf7f0222d9585ea60166d4146c475cd888137

David Turner 2002-03-26T02:38:39

fixed a small bug in FT_CMaps support

diff --git a/ChangeLog b/ChangeLog
index cd1816e..d091263 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2002-03-26  David Turner    <david@freetype.org>
+
+	* 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    <david@freetype.org>
 
         * src/base/ftobjs.c, src/sfnt/ttcmap0.c, src/type1/t1objs.c:
diff --git a/src/sfnt/sfdriver.c b/src/sfnt/sfdriver.c
index cc291e8..c698022 100644
--- 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;
     }
diff --git a/src/sfnt/sfobjs.c b/src/sfnt/sfobjs.c
index 25030af..5d866ee 100644
--- 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 );
diff --git a/src/sfnt/ttcmap0.c b/src/sfnt/ttcmap0.c
index 7932db2..e3004e2 100644
--- 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,