Commit 1e1b6dff54ffcffebb63c7800b204c1265510af7

Werner Lemberg 2007-07-07T07:30:40

* src/pfr/pfrcmap.c: Include pfrerror.h. * src/autofit/afindic.c: Add some external declarations to pacify `make multi' compilation. * src/cid/cidgload.c (cid_load_glyph): Pacify compiler. * src/cff/cffdrivr.c (cff_ps_get_font_info), src/cff/cffobjs.c (cff_strcpy), include/freetype/internal/ftmemory.h (FT_MEM_STRDUP), src/autofit/aflatin.c (af_latin_hints_compute_edges), src/autofit/afcjk.c (af_cjk_hints_compute_edges), src/sfnt/ttmtx.c (tt_face_get_metrics), src/base/ftobjs.c (open_face) [FT_CONFIG_OPTION_INCREMENTAL]: Fix compilation with C++ compiler. * docs/release: Mention test compilation targets.

diff --git a/ChangeLog b/ChangeLog
index c5b80ce..8fc5ba7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,21 @@
+2007-07-06  Werner Lemberg  <wl@gnu.org>
+
+	* src/pfr/pfrcmap.c: Include pfrerror.h.
+
+	* src/autofit/afindic.c: Add some external declarations to pacify
+	`make multi' compilation.
+
+	* src/cid/cidgload.c (cid_load_glyph): Pacify compiler.
+
+	* src/cff/cffdrivr.c (cff_ps_get_font_info), src/cff/cffobjs.c
+	(cff_strcpy), include/freetype/internal/ftmemory.h (FT_MEM_STRDUP),
+	src/autofit/aflatin.c (af_latin_hints_compute_edges),
+	src/autofit/afcjk.c (af_cjk_hints_compute_edges), src/sfnt/ttmtx.c
+	(tt_face_get_metrics), src/base/ftobjs.c (open_face)
+	[FT_CONFIG_OPTION_INCREMENTAL]: Fix compilation with C++ compiler.
+
+	* docs/release: Mention test compilation targets.
+
 2007-07-04  Werner Lemberg  <wl@gnu.org>
 
 	* docs/PROBLEMS: Mention that some PS based fonts can't be
diff --git a/docs/release b/docs/release
index 36bcb47..d68da88 100644
--- a/docs/release
+++ b/docs/release
@@ -18,6 +18,21 @@ How to prepare a new release
 . ChangeLog: Announce  new release  (both in  freetype2  and  ft2demos
   modules).
 
+. Copy the CVS archive to another directory and run
+
+    make distclean; make devel; make
+    make distclean; make devel; make multi
+    make distclean; make devel CC=g++; make CC=g++
+    make distclean; make devel CC=g++; make multi CC=g++
+
+    sh autogen.sh
+    make distclean; ./configure; make
+    make distclean; ./configure CC=g++; make
+
+  to test compilation with both gcc and g++.
+
+. Test C++ compilation for ft2demos too.
+
 . Tag the CVS (freetype2, ft2demos).
 
   TODO: Tag the home page CVS on savannah.nongnu.org.
diff --git a/include/freetype/internal/ftmemory.h b/include/freetype/internal/ftmemory.h
index c6ddc42..2010ca9 100644
--- a/include/freetype/internal/ftmemory.h
+++ b/include/freetype/internal/ftmemory.h
@@ -333,8 +333,8 @@ FT_BEGIN_HEADER
               FT_ULong     size,
               FT_Error    *p_error );
 
-#define FT_MEM_STRDUP( dst, str )                                     \
-          (dst) = ft_mem_strdup( memory, (const char*)(str), &error )
+#define FT_MEM_STRDUP( dst, str )                                            \
+          (dst) = (char*)ft_mem_strdup( memory, (const char*)(str), &error )
 
 #define FT_STRDUP( dst, str )                           \
           FT_MEM_SET_ERROR( FT_MEM_STRDUP( dst, str ) )
diff --git a/src/autofit/afcjk.c b/src/autofit/afcjk.c
index c7ca266..7e9438b 100644
--- a/src/autofit/afcjk.c
+++ b/src/autofit/afcjk.c
@@ -45,7 +45,7 @@
   /*************************************************************************/
   /*************************************************************************/
 
-  static FT_Error
+  FT_LOCAL_DEF( FT_Error )
   af_cjk_metrics_init( AF_LatinMetrics  metrics,
                        FT_Face          face )
   {
@@ -91,7 +91,7 @@
   }
 
 
-  static void
+  FT_LOCAL_DEF( void )
   af_cjk_metrics_scale( AF_LatinMetrics  metrics,
                         AF_Scaler        scaler )
   {
@@ -427,7 +427,9 @@
 
         /* insert a new edge in the list and */
         /* sort according to the position    */
-        error = af_axis_hints_new_edge( axis, seg->pos, seg->dir, memory, &edge );
+        error = af_axis_hints_new_edge( axis, seg->pos,
+                                        (AF_Direction)seg->dir,
+                                        memory, &edge );
         if ( error )
           goto Exit;
 
@@ -596,7 +598,7 @@
   }
 
 
-  static FT_Error
+  FT_LOCAL_DEF( FT_Error )
   af_cjk_hints_init( AF_GlyphHints    hints,
                      AF_LatinMetrics  metrics )
   {
@@ -1350,7 +1352,7 @@
   }
 
 
-  static FT_Error
+  FT_LOCAL_DEF( FT_Error )
   af_cjk_hints_apply( AF_GlyphHints    hints,
                       FT_Outline*      outline,
                       AF_LatinMetrics  metrics )
diff --git a/src/autofit/afcjk.h b/src/autofit/afcjk.h
index 0de4a5a..9f77fda 100644
--- a/src/autofit/afcjk.h
+++ b/src/autofit/afcjk.h
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Auto-fitter hinting routines for CJK script (specification).         */
 /*                                                                         */
-/*  Copyright 2006 by                                                      */
+/*  Copyright 2006, 2007 by                                                */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -31,6 +31,23 @@ FT_BEGIN_HEADER
   af_cjk_script_class;
 
 
+  FT_LOCAL( FT_Error )
+  af_cjk_metrics_init( AF_LatinMetrics  metrics,
+                       FT_Face          face );
+
+  FT_LOCAL( void )
+  af_cjk_metrics_scale( AF_LatinMetrics  metrics,
+                        AF_Scaler        scaler );
+
+  FT_LOCAL( FT_Error )
+  af_cjk_hints_init( AF_GlyphHints    hints,
+                     AF_LatinMetrics  metrics );
+
+  FT_LOCAL( FT_Error )
+  af_cjk_hints_apply( AF_GlyphHints    hints,
+                      FT_Outline*      outline,
+                      AF_LatinMetrics  metrics );
+
 /* */
 
 FT_END_HEADER
diff --git a/src/autofit/aflatin.c b/src/autofit/aflatin.c
index 52e952d..b70da06 100644
--- a/src/autofit/aflatin.c
+++ b/src/autofit/aflatin.c
@@ -1004,12 +1004,14 @@
 
       if ( !found )
       {
-        AF_Edge   edge;
+        AF_Edge  edge;
 
 
         /* insert a new edge in the list and */
         /* sort according to the position    */
-        error = af_axis_hints_new_edge( axis, seg->pos, seg->dir, memory, &edge );
+        error = af_axis_hints_new_edge( axis, seg->pos,
+                                        (AF_Direction)seg->dir,
+                                        memory, &edge );
         if ( error )
           goto Exit;
 
diff --git a/src/base/ftobjs.c b/src/base/ftobjs.c
index fa08094..1bcccf7 100644
--- a/src/base/ftobjs.c
+++ b/src/base/ftobjs.c
@@ -1013,7 +1013,8 @@
       for ( i = 0; i < num_params && !face->internal->incremental_interface;
             i++ )
         if ( params[i].tag == FT_PARAM_TAG_INCREMENTAL )
-          face->internal->incremental_interface = params[i].data;
+          face->internal->incremental_interface =
+            (FT_Incremental_Interface)params[i].data;
     }
 #endif
 
diff --git a/src/cff/cffdrivr.c b/src/cff/cffdrivr.c
index 952e88e..ff2edb3 100644
--- a/src/cff/cffdrivr.c
+++ b/src/cff/cffdrivr.c
@@ -306,9 +306,10 @@
 
     if ( cff && cff->font_info == NULL )
     {
-      CFF_FontRecDict  dict = &cff->top_font.font_dict;
-      PS_FontInfoRec  *font_info;
-      FT_Memory        memory = face->root.memory;
+      CFF_FontRecDict     dict    = &cff->top_font.font_dict;
+      PS_FontInfoRec     *font_info;
+      FT_Memory           memory  = face->root.memory;
+      FT_Service_PsCMaps  psnames = (FT_Service_PsCMaps)cff->psnames;
 
 
       if ( FT_ALLOC( font_info, sizeof ( *font_info ) ) )
@@ -316,19 +317,19 @@
 
       font_info->version     = cff_index_get_sid_string( &cff->string_index,
                                                          dict->version,
-                                                         cff->psnames );
+                                                         psnames );
       font_info->notice      = cff_index_get_sid_string( &cff->string_index,
                                                          dict->notice,
-                                                         cff->psnames );
+                                                         psnames );
       font_info->full_name   = cff_index_get_sid_string( &cff->string_index,
                                                          dict->full_name,
-                                                         cff->psnames );
+                                                         psnames );
       font_info->family_name = cff_index_get_sid_string( &cff->string_index,
                                                          dict->family_name,
-                                                         cff->psnames );
+                                                         psnames );
       font_info->weight      = cff_index_get_sid_string( &cff->string_index,
                                                          dict->weight,
-                                                         cff->psnames );
+                                                         psnames );
       font_info->italic_angle        = dict->italic_angle;
       font_info->is_fixed_pitch      = dict->is_fixed_pitch;
       font_info->underline_position  = (FT_Short)dict->underline_position;
diff --git a/src/cff/cffobjs.c b/src/cff/cffobjs.c
index c02cf33..544deea 100644
--- a/src/cff/cffobjs.c
+++ b/src/cff/cffobjs.c
@@ -288,7 +288,9 @@
     FT_String*  result;
 
 
-    result = ft_mem_strdup( memory, source, &error );
+    (void)FT_STRDUP( result, source );
+
+    FT_UNUSED( error );
 
     return result;
   }
diff --git a/src/cid/cidgload.c b/src/cid/cidgload.c
index 8bec6e1..64994b4 100644
--- a/src/cid/cidgload.c
+++ b/src/cid/cidgload.c
@@ -74,7 +74,7 @@
       if ( glyph_data.length != 0 )
       {
         glyph_length = glyph_data.length - cid->fd_bytes;
-        FT_ALLOC( charstring, glyph_length );
+        (void)FT_ALLOC( charstring, glyph_length );
         if ( !error )
           ft_memcpy( charstring, glyph_data.pointer + cid->fd_bytes,
                      glyph_length );
diff --git a/src/pfr/pfrcmap.c b/src/pfr/pfrcmap.c
index c8faee0..fe9eb69 100644
--- a/src/pfr/pfrcmap.c
+++ b/src/pfr/pfrcmap.c
@@ -20,6 +20,8 @@
 #include "pfrobjs.h"
 #include FT_INTERNAL_DEBUG_H
 
+#include "pfrerror.h"
+
 
   FT_CALLBACK_DEF( FT_Error )
   pfr_cmap_init( PFR_CMap  cmap )
diff --git a/src/sfnt/ttmtx.c b/src/sfnt/ttmtx.c
index 286bd0c..55f681a 100644
--- a/src/sfnt/ttmtx.c
+++ b/src/sfnt/ttmtx.c
@@ -431,7 +431,8 @@
   {
     void*           v = &face->vertical;
     void*           h = &face->horizontal;
-    TT_HoriHeader*  header = vertical ? (TT_HoriHeader*)v : h;
+    TT_HoriHeader*  header = vertical ? (TT_HoriHeader*)v
+                                      : (TT_HoriHeader*)h;
     TT_LongMetrics  longs_m;
     FT_UShort       k = header->number_Of_HMetrics;