ref: 3c96681856f2d4ac8bdd1f6a1e64fbfd9fd30d8e
parent: e38acb0d5358e95f0ba6c9f09b0b9e7bb961861d
author: suzuki toshiya <[email protected]>
date: Sun Jan 15 18:35:31 EST 2012
Fix redundant declaration warning in PIC mode. Originally FT_DEFINE_{DRIVER,MODULE,RENDERER}() macros were designed to declare xxx_pic_{free,init} by themselves. Because these macros are used at the end of the module interface (e.g. ttdriver.c) and the wrapper source to build a module as a single object (e.g. truetype.c) includes the PIC file (e.g. ttpic.c) before the module interface, these macros are expanded AFTER xxx_pic_{free,init} body when the modules are built as single object. The declaration after the implementation causes the redundant declaration warnings, so the declarations are moved to module PIC headers (e.g. ttpic.h). Separating to other header files are needed for multi build. * include/freetype/internal/ftdriver.h (FT_DEFINE_DRIVER): Remove class_##_pic_free and class_##_pic_init declarations. * include/freetype/internal/ftobjs.h (FT_DEFINE_RENDERER, FT_DEFINE_MODULE): Ditto. * src/base/basepic.h: Insert a comment and fix coding style. * src/autofit/afpic.h: Declare autofit_module_class_pic_{free, init}. * src/cff/cffpic.h: Declare cff_driver_class_pic_{free,init}. * src/pshinter/pshpic.h: Declare pshinter_module_class_pic_{free, init}. * src/psnames/pspic.h: Declare psnames_module_class_pic_{free, init}. * src/raster/rastpic.h: Declare ft_raster{1,5}_renderer_class_pic_{free,init} * src/sfnt/sfntpic.h: Declare sfnt_module_class_pic_{free,init}. * src/smooth/ftspic.h: Declare ft_smooth_{,lcd_,lcdv_}renderer_class_pic_{free,init}. * src/truetype/ttpic.h: Declare tt_driver_class_pic_{free,init}.
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,42 @@
2012-01-15 suzuki toshiya <[email protected]>
+ Fix redundant declaration warning in PIC mode.
+
+ Originally FT_DEFINE_{DRIVER,MODULE,RENDERER}() macros were
+ designed to declare xxx_pic_{free,init} by themselves.
+ Because these macros are used at the end of the module
+ interface (e.g. ttdriver.c) and the wrapper source to build
+ a module as a single object (e.g. truetype.c) includes
+ the PIC file (e.g. ttpic.c) before the module interface,
+ these macros are expanded AFTER xxx_pic_{free,init} body
+ when the modules are built as single object.
+ The declaration after the implementation causes the redundant
+ declaration warnings, so the declarations are moved to module
+ PIC headers (e.g. ttpic.h). Separating to other header files
+ are needed for multi build.
+
+ * include/freetype/internal/ftdriver.h (FT_DEFINE_DRIVER):
+ Remove class_##_pic_free and class_##_pic_init declarations.
+ * include/freetype/internal/ftobjs.h (FT_DEFINE_RENDERER,
+ FT_DEFINE_MODULE): Ditto.
+
+ * src/base/basepic.h: Insert a comment and fix coding style.
+ * src/autofit/afpic.h: Declare autofit_module_class_pic_{free,
+ init}.
+ * src/cff/cffpic.h: Declare cff_driver_class_pic_{free,init}.
+ * src/pshinter/pshpic.h: Declare pshinter_module_class_pic_{free,
+ init}.
+ * src/psnames/pspic.h: Declare psnames_module_class_pic_{free,
+ init}.
+ * src/raster/rastpic.h: Declare
+ ft_raster{1,5}_renderer_class_pic_{free,init}
+ * src/sfnt/sfntpic.h: Declare sfnt_module_class_pic_{free,init}.
+ * src/smooth/ftspic.h: Declare
+ ft_smooth_{,lcd_,lcdv_}renderer_class_pic_{free,init}.
+ * src/truetype/ttpic.h: Declare tt_driver_class_pic_{free,init}.
+
+2012-01-15 suzuki toshiya <[email protected]>
+
Make pspic.c to include module error header to fix multi build.
* src/psnames/pspic.c: Include `psnamerr.h'.
--- a/include/freetype/internal/ftdriver.h
+++ b/include/freetype/internal/ftdriver.h
@@ -267,7 +267,9 @@
/* and initialize any additional global data, like module specific */
/* interface, and put them in the global pic container defined in */
/* ftpic.h. if you don't need them just implement the functions as */
- /* empty to resolve the link error. */
+ /* empty to resolve the link error. Also the pic_init and pic_free */
+ /* functions should be declared in pic.h, to be referred by driver */
+ /* definition calling FT_DEFINE_DRIVER() in following. */
/* */
/* When FT_CONFIG_OPTION_PIC is not defined the struct will be */
/* allocated in the global scope (or the scope where the macro */
@@ -347,8 +349,6 @@
old_set_char_sizes_, old_set_pixel_sizes_, \
load_glyph_, get_kerning_, attach_file_, \
get_advances_, request_size_, select_size_ ) \
- void class_##_pic_free( FT_Library library ); \
- FT_Error class_##_pic_init( FT_Library library ); \
\
void \
FT_Destroy_Class_##class_( FT_Library library, \
--- a/include/freetype/internal/ftobjs.h
+++ b/include/freetype/internal/ftobjs.h
@@ -1119,7 +1119,9 @@
/* and initialize any additional global data, like module specific */
/* interface, and put them in the global pic container defined in */
/* ftpic.h. if you don't need them just implement the functions as */
- /* empty to resolve the link error. */
+ /* empty to resolve the link error. Also the pic_init and pic_free */
+ /* functions should be declared in pic.h, to be referred by renderer */
+ /* definition calling FT_DEFINE_RENDERER() in following. */
/* */
/* When FT_CONFIG_OPTION_PIC is not defined the struct will be */
/* allocated in the global scope (or the scope where the macro */
@@ -1159,8 +1161,6 @@
interface_, init_, done_, get_interface_, \
glyph_format_, render_glyph_, transform_glyph_, \
get_glyph_cbox_, set_mode_, raster_class_ ) \
- void class_##_pic_free( FT_Library library ); \
- FT_Error class_##_pic_init( FT_Library library ); \
\
void \
FT_Destroy_Class_##class_( FT_Library library, \
@@ -1290,7 +1290,9 @@
/* and initialize any additional global data, like module specific */
/* interface, and put them in the global pic container defined in */
/* ftpic.h. if you don't need them just implement the functions as */
- /* empty to resolve the link error. */
+ /* empty to resolve the link error. Also the pic_init and pic_free */
+ /* functions should be declared in pic.h, to be referred by module */
+ /* definition calling FT_DEFINE_MODULE() in following. */
/* */
/* When FT_CONFIG_OPTION_PIC is not defined the struct will be */
/* allocated in the global scope (or the scope where the macro */
@@ -1371,8 +1373,6 @@
#define FT_DEFINE_MODULE(class_, flags_, size_, name_, version_, requires_, \
interface_, init_, done_, get_interface_) \
- void class_##_pic_free( FT_Library library ); \
- FT_Error class_##_pic_init( FT_Library library ); \
\
void \
FT_Destroy_Class_##class_( FT_Library library, \
--- a/src/autofit/afpic.h
+++ b/src/autofit/afpic.h
@@ -57,6 +57,13 @@
#define AF_AF_AUTOFITTER_SERVICE_GET \
( GET_PIC( library )->af_autofitter_service )
+ /* see afpic.c for the implementation */
+ void
+ autofit_module_class_pic_free( FT_Library library );
+
+ FT_Error
+ autofit_module_class_pic_init( FT_Library library );
+
#endif /* FT_CONFIG_OPTION_PIC */
/* */
--- a/src/base/basepic.h
+++ b/src/base/basepic.h
@@ -45,11 +45,12 @@
#define FT_BITMAP_GLYPH_CLASS_GET (&GET_PIC(library)->ft_bitmap_glyph_class)
#define FT_DEFAULT_MODULES_GET (GET_PIC(library)->default_module_classes)
+ /* see basepic.c for the implementation. */
void
- ft_base_pic_free( FT_Library library );
+ ft_base_pic_free( FT_Library library );
FT_Error
- ft_base_pic_init( FT_Library library );
+ ft_base_pic_init( FT_Library library );
#endif /* FT_CONFIG_OPTION_PIC */
/* */
--- a/src/cff/cffpic.h
+++ b/src/cff/cffpic.h
@@ -68,6 +68,13 @@
#define FT_CFF_CMAP_UNICODE_CLASS_REC_GET (GET_PIC(library)->cff_cmap_unicode_class_rec)
#define FT_CFF_FIELD_HANDLERS_GET (GET_PIC(library)->cff_field_handlers)
+ /* see cffpic.c for the implementation */
+ void
+ cff_driver_class_pic_free( FT_Library library );
+
+ FT_Error
+ cff_driver_class_pic_init( FT_Library library );
+
#endif /* FT_CONFIG_OPTION_PIC */
/* */
--- a/src/pshinter/pshpic.h
+++ b/src/pshinter/pshpic.h
@@ -40,6 +40,12 @@
#define GET_PIC(lib) ((PSHinterPIC*)((lib)->pic_container.autofit))
#define FTPSHINTER_INTERFACE_GET (GET_PIC(library)->pshinter_interface)
+ /* see pshpic.c for the implementation */
+ void
+ pshinter_module_class_pic_free( FT_Library library );
+
+ FT_Error
+ pshinter_module_class_pic_init( FT_Library library );
#endif /* FT_CONFIG_OPTION_PIC */
--- a/src/psnames/pspic.h
+++ b/src/psnames/pspic.h
@@ -42,6 +42,13 @@
#define FT_PSCMAPS_SERVICES_GET (GET_PIC(library)->pscmaps_services)
#define FT_PSCMAPS_INTERFACE_GET (GET_PIC(library)->pscmaps_interface)
+ /* see pspic.c for the implementation */
+ void
+ psnames_module_class_pic_free( FT_Library library );
+
+ FT_Error
+ psnames_module_class_pic_init( FT_Library library );
+
#endif /* FT_CONFIG_OPTION_PIC */
/* */
--- a/src/raster/rastpic.h
+++ b/src/raster/rastpic.h
@@ -38,6 +38,19 @@
#define GET_PIC(lib) ((RasterPIC*)((lib)->pic_container.raster))
#define FT_STANDARD_RASTER_GET (GET_PIC(library)->ft_standard_raster)
+ /* see rastpic.c for the implementation */
+ void
+ ft_raster1_renderer_class_pic_free( FT_Library library );
+
+ void
+ ft_raster5_renderer_class_pic_free( FT_Library library );
+
+ FT_Error
+ ft_raster1_renderer_class_pic_init( FT_Library library );
+
+ FT_Error
+ ft_raster5_renderer_class_pic_init( FT_Library library );
+
#endif /* FT_CONFIG_OPTION_PIC */
/* */
--- a/src/sfnt/sfntpic.h
+++ b/src/sfnt/sfntpic.h
@@ -76,6 +76,13 @@
#define FT_SFNT_SERVICE_BDF_GET (GET_PIC(library)->sfnt_service_bdf)
#define FT_SFNT_INTERFACE_GET (GET_PIC(library)->sfnt_interface)
+ /* see sfntpic.c for the implementation */
+ void
+ sfnt_module_class_pic_free( FT_Library library );
+
+ FT_Error
+ sfnt_module_class_pic_init( FT_Library library );
+
#endif /* FT_CONFIG_OPTION_PIC */
/* */
--- a/src/smooth/ftspic.h
+++ b/src/smooth/ftspic.h
@@ -38,6 +38,25 @@
#define GET_PIC(lib) ((SmoothPIC*)((lib)->pic_container.smooth))
#define FT_GRAYS_RASTER_GET (GET_PIC(library)->ft_grays_raster)
+ /* see ftspic.c for the implementation */
+ void
+ ft_smooth_renderer_class_pic_free( FT_Library library );
+
+ void
+ ft_smooth_lcd_renderer_class_pic_free( FT_Library library );
+
+ void
+ ft_smooth_lcdv_renderer_class_pic_free( FT_Library library );
+
+ FT_Error
+ ft_smooth_renderer_class_pic_init( FT_Library library );
+
+ FT_Error
+ ft_smooth_lcd_renderer_class_pic_init( FT_Library library );
+
+ FT_Error
+ ft_smooth_lcdv_renderer_class_pic_init( FT_Library library );
+
#endif /* FT_CONFIG_OPTION_PIC */
/* */
--- a/src/truetype/ttpic.h
+++ b/src/truetype/ttpic.h
@@ -47,6 +47,13 @@
#define FT_TT_SERVICE_GX_MULTI_MASTERS_GET (GET_PIC(library)->tt_service_gx_multi_masters)
#define FT_TT_SERVICE_TRUETYPE_GLYF_GET (GET_PIC(library)->tt_service_truetype_glyf)
+ /* see ttpic.c for the implementation */
+ void
+ tt_driver_class_pic_free( FT_Library library );
+
+ FT_Error
+ tt_driver_class_pic_init( FT_Library library );
+
#endif /* FT_CONFIG_OPTION_PIC */
/* */