fixed a small bug in FT_CMaps support
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120
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,