From 5a7a593c37268591c5d5bcf2dec9d987907650ce Mon Sep 17 00:00:00 2001 From: Werner Lemberg Date: Wed, 30 Nov 2011 13:38:51 +0100 Subject: [PATCH] [type42] Remove casts. * src/type42/t42driver.c (t42_driver_class): Remove all casts and update affected functions. * src/type42/t42objs.c, src/type42/t42objs.h: Updated for t42driver changes. --- ChangeLog | 10 ++++++++ src/type42/t42drivr.c | 36 +++++++++++++------------- src/type42/t42objs.c | 59 +++++++++++++++++++++++++------------------ src/type42/t42objs.h | 22 ++++++++-------- 4 files changed, 74 insertions(+), 53 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3d96e5838..b450a5b86 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2011-11-30 Werner Lemberg + + [type42] Remove casts. + + * src/type42/t42driver.c (t42_driver_class): Remove all casts and + update affected functions. + + * src/type42/t42objs.c, src/type42/t42objs.h: Updated for t42driver + changes. + 2011-11-30 Werner Lemberg [type1] Remove casts. diff --git a/src/type42/t42drivr.c b/src/type42/t42drivr.c index f56d6e773..9b93209ad 100644 --- a/src/type42/t42drivr.c +++ b/src/type42/t42drivr.c @@ -184,11 +184,11 @@ }; - static FT_Module_Interface - T42_Get_Interface( FT_Driver driver, + FT_CALLBACK_DEF( FT_Module_Interface ) + T42_Get_Interface( FT_Module module, const FT_String* t42_interface ) { - FT_UNUSED( driver ); + FT_UNUSED( module ); return ft_service_list_lookup( t42_services, t42_interface ); } @@ -213,34 +213,34 @@ 0, /* format interface */ - (FT_Module_Constructor)T42_Driver_Init, - (FT_Module_Destructor) T42_Driver_Done, - (FT_Module_Requester) T42_Get_Interface, + T42_Driver_Init, + T42_Driver_Done, + T42_Get_Interface, }, sizeof ( T42_FaceRec ), sizeof ( T42_SizeRec ), sizeof ( T42_GlyphSlotRec ), - (FT_Face_InitFunc) T42_Face_Init, - (FT_Face_DoneFunc) T42_Face_Done, - (FT_Size_InitFunc) T42_Size_Init, - (FT_Size_DoneFunc) T42_Size_Done, - (FT_Slot_InitFunc) T42_GlyphSlot_Init, - (FT_Slot_DoneFunc) T42_GlyphSlot_Done, + T42_Face_Init, + T42_Face_Done, + T42_Size_Init, + T42_Size_Done, + T42_GlyphSlot_Init, + T42_GlyphSlot_Done, #ifdef FT_CONFIG_OPTION_OLD_INTERNALS ft_stub_set_char_sizes, ft_stub_set_pixel_sizes, #endif - (FT_Slot_LoadFunc) T42_GlyphSlot_Load, + T42_GlyphSlot_Load, - (FT_Face_GetKerningFunc) 0, - (FT_Face_AttachFunc) 0, + 0, /* FT_Face_GetKerningFunc */ + 0, /* FT_Face_AttachFunc */ - (FT_Face_GetAdvancesFunc) 0, - (FT_Size_RequestFunc) T42_Size_Request, - (FT_Size_SelectFunc) T42_Size_Select + 0, /* FT_Face_GetAdvancesFunc */ + T42_Size_Request, + T42_Size_Select }; diff --git a/src/type42/t42objs.c b/src/type42/t42objs.c index f146c3459..54d399c1c 100644 --- a/src/type42/t42objs.c +++ b/src/type42/t42objs.c @@ -154,11 +154,12 @@ FT_LOCAL_DEF( FT_Error ) T42_Face_Init( FT_Stream stream, - T42_Face face, + FT_Face t42face, /* T42_Face */ FT_Int face_index, FT_Int num_params, FT_Parameter* params ) { + T42_Face face = (T42_Face)t42face; FT_Error error; FT_Service_PsCMaps psnames; PSAux_Service psaux; @@ -400,8 +401,9 @@ FT_LOCAL_DEF( void ) - T42_Face_Done( T42_Face face ) + T42_Face_Done( FT_Face t42face ) { + T42_Face face = (T42_Face)t42face; T1_Font type1; PS_FontInfo info; FT_Memory memory; @@ -469,12 +471,13 @@ /* FreeType error code. 0 means success. */ /* */ FT_LOCAL_DEF( FT_Error ) - T42_Driver_Init( T42_Driver driver ) + T42_Driver_Init( FT_Module module ) /* T42_Driver */ { - FT_Module ttmodule; + T42_Driver driver = (T42_Driver)module; + FT_Module ttmodule; - ttmodule = FT_Get_Module( FT_MODULE(driver)->library, "truetype" ); + ttmodule = FT_Get_Module( module->library, "truetype" ); if ( !ttmodule ) { FT_ERROR(( "T42_Driver_Init: cannot access `truetype' module\n" )); @@ -488,23 +491,24 @@ FT_LOCAL_DEF( void ) - T42_Driver_Done( T42_Driver driver ) + T42_Driver_Done( FT_Module module ) { - FT_UNUSED( driver ); + FT_UNUSED( module ); } FT_LOCAL_DEF( FT_Error ) - T42_Size_Init( T42_Size size ) + T42_Size_Init( FT_Size size ) /* T42_Size */ { - FT_Face face = size->root.face; + T42_Size t42size = (T42_Size)size; + FT_Face face = size->face; T42_Face t42face = (T42_Face)face; FT_Size ttsize; FT_Error error = T42_Err_Ok; error = FT_New_Size( t42face->ttf_face, &ttsize ); - size->ttsize = ttsize; + t42size->ttsize = ttsize; FT_Activate_Size( ttsize ); @@ -513,10 +517,11 @@ FT_LOCAL_DEF( FT_Error ) - T42_Size_Request( T42_Size size, + T42_Size_Request( FT_Size t42size, /* T42_Size */ FT_Size_Request req ) { - T42_Face face = (T42_Face)size->root.face; + T42_Size size = (T42_Size)t42size; + T42_Face face = (T42_Face)t42size->face; FT_Error error; @@ -524,17 +529,18 @@ error = FT_Request_Size( face->ttf_face, req ); if ( !error ) - ( (FT_Size)size )->metrics = face->ttf_face->size->metrics; + t42size->metrics = face->ttf_face->size->metrics; return error; } FT_LOCAL_DEF( FT_Error ) - T42_Size_Select( T42_Size size, + T42_Size_Select( FT_Size t42size, /* T42_Size */ FT_ULong strike_index ) { - T42_Face face = (T42_Face)size->root.face; + T42_Size size = (T42_Size)t42size; + T42_Face face = (T42_Face)t42size->face; FT_Error error; @@ -542,7 +548,7 @@ error = FT_Select_Size( face->ttf_face, (FT_Int)strike_index ); if ( !error ) - ( (FT_Size)size )->metrics = face->ttf_face->size->metrics; + t42size->metrics = face->ttf_face->size->metrics; return error; @@ -550,9 +556,10 @@ FT_LOCAL_DEF( void ) - T42_Size_Done( T42_Size size ) + T42_Size_Done( FT_Size t42size ) /* T42_Size */ { - FT_Face face = size->root.face; + T42_Size size = (T42_Size)t42size; + FT_Face face = t42size->face; T42_Face t42face = (T42_Face)face; FT_ListNode node; @@ -567,12 +574,13 @@ FT_LOCAL_DEF( FT_Error ) - T42_GlyphSlot_Init( T42_GlyphSlot slot ) + T42_GlyphSlot_Init( FT_GlyphSlot t42slot ) /* T42_GlyphSlot */ { - FT_Face face = slot->root.face; - T42_Face t42face = (T42_Face)face; - FT_GlyphSlot ttslot; - FT_Error error = T42_Err_Ok; + T42_GlyphSlot slot = (T42_GlyphSlot)t42slot; + FT_Face face = t42slot->face; + T42_Face t42face = (T42_Face)face; + FT_GlyphSlot ttslot; + FT_Error error = T42_Err_Ok; if ( face->glyph == NULL ) @@ -591,8 +599,11 @@ FT_LOCAL_DEF( void ) - T42_GlyphSlot_Done( T42_GlyphSlot slot ) + T42_GlyphSlot_Done( FT_GlyphSlot t42slot ) /* T42_GlyphSlot */ { + T42_GlyphSlot slot = (T42_GlyphSlot)t42slot; + + FT_Done_GlyphSlot( slot->ttslot ); } diff --git a/src/type42/t42objs.h b/src/type42/t42objs.h index 289dedcc6..02d13259b 100644 --- a/src/type42/t42objs.h +++ b/src/type42/t42objs.h @@ -4,7 +4,7 @@ /* */ /* Type 42 objects manager (specification). */ /* */ -/* Copyright 2002, 2003, 2006, 2007 by Roberto Alameda. */ +/* Copyright 2002, 2003, 2006, 2007, 2011 by Roberto Alameda. */ /* */ /* This file is part of the FreeType project, and may only be used, */ /* modified, and distributed under the terms of the FreeType project */ @@ -65,36 +65,36 @@ FT_BEGIN_HEADER FT_LOCAL( FT_Error ) T42_Face_Init( FT_Stream stream, - T42_Face face, + FT_Face face, FT_Int face_index, FT_Int num_params, FT_Parameter* params ); FT_LOCAL( void ) - T42_Face_Done( T42_Face face ); + T42_Face_Done( FT_Face face ); FT_LOCAL( FT_Error ) - T42_Size_Init( T42_Size size ); + T42_Size_Init( FT_Size size ); FT_LOCAL( FT_Error ) - T42_Size_Request( T42_Size size, + T42_Size_Request( FT_Size size, FT_Size_Request req ); FT_LOCAL( FT_Error ) - T42_Size_Select( T42_Size size, + T42_Size_Select( FT_Size size, FT_ULong strike_index ); FT_LOCAL( void ) - T42_Size_Done( T42_Size size ); + T42_Size_Done( FT_Size size ); FT_LOCAL( FT_Error ) - T42_GlyphSlot_Init( T42_GlyphSlot slot ); + T42_GlyphSlot_Init( FT_GlyphSlot slot ); FT_LOCAL( FT_Error ) @@ -104,14 +104,14 @@ FT_BEGIN_HEADER FT_Int32 load_flags ); FT_LOCAL( void ) - T42_GlyphSlot_Done( T42_GlyphSlot slot ); + T42_GlyphSlot_Done( FT_GlyphSlot slot ); FT_LOCAL( FT_Error ) - T42_Driver_Init( T42_Driver driver ); + T42_Driver_Init( FT_Module module ); FT_LOCAL( void ) - T42_Driver_Done( T42_Driver driver ); + T42_Driver_Done( FT_Module module ); /* */