shithub: freetype+ttf2subf

Download patch

ref: 5a7a593c37268591c5d5bcf2dec9d987907650ce
parent: d5260597b23f0a30309b96e34e65d28e3f5ff821
author: Werner Lemberg <[email protected]>
date: Wed Nov 30 08:38:51 EST 2011

[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.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
 2011-11-30  Werner Lemberg  <[email protected]>
 
+	[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  <[email protected]>
+
 	[type1] Remove casts.
 
 	* src/type1/t1driver.c (t1_driver_class): Remove all casts and
--- 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,9 +213,9 @@
 
       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 ),
@@ -222,25 +222,25 @@
     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
   };
 
 
--- 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,16 +491,17 @@
 
 
   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;
@@ -504,7 +508,7 @@
 
 
     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,7 +529,7 @@
 
     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;
   }
@@ -531,10 +536,11 @@
 
 
   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 );
   }
 
--- 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,7 +65,7 @@
 
   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 );
@@ -72,29 +72,29 @@
 
 
   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_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 );
 
  /* */