shithub: freetype+ttf2subf

Download patch

ref: 628bebe639007244ebd7a8d17dfcb6555f04c61a
parent: 5a7a593c37268591c5d5bcf2dec9d987907650ce
author: Werner Lemberg <[email protected]>
date: Wed Nov 30 08:55:56 EST 2011

[winfonts] Remove casts.

* src/winfonts/winfnt.c (winfnt_driver_class): Remove all casts and
update affected functions.
(FNT_Size_Select): Fix number of arguments.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2011-11-30  Werner Lemberg  <[email protected]>
 
+	[winfonts] Remove casts.
+
+	* src/winfonts/winfnt.c (winfnt_driver_class): Remove all casts and
+	update affected functions.
+	(FNT_Size_Select): Fix number of arguments.
+
+2011-11-30  Werner Lemberg  <[email protected]>
+
 	[type42] Remove casts.
 
 	* src/type42/t42driver.c (t42_driver_class): Remove all casts and
--- a/src/winfonts/winfnt.c
+++ b/src/winfonts/winfnt.c
@@ -665,8 +665,9 @@
 
 
   static void
-  FNT_Face_Done( FNT_Face  face )
+  FNT_Face_Done( FT_Face  fntface )       /* FNT_Face */
   {
+    FNT_Face   face = (FNT_Face)fntface;
     FT_Memory  memory;
 
 
@@ -677,18 +678,19 @@
 
     fnt_font_done( face );
 
-    FT_FREE( face->root.available_sizes );
-    face->root.num_fixed_sizes = 0;
+    FT_FREE( fntface->available_sizes );
+    fntface->num_fixed_sizes = 0;
   }
 
 
   static FT_Error
   FNT_Face_Init( FT_Stream      stream,
-                 FNT_Face       face,
+                 FT_Face        fntface,        /* FNT_Face */
                  FT_Int         face_index,
                  FT_Int         num_params,
                  FT_Parameter*  params )
   {
+    FNT_Face   face   = (FNT_Face)fntface;
     FT_Error   error;
     FT_Memory  memory = FT_FACE_MEMORY( face );
 
@@ -711,7 +713,7 @@
       if ( FT_NEW( face->font ) )
         goto Exit;
 
-      face->root.num_faces = 1;
+      fntface->num_faces = 1;
 
       font           = face->font;
       font->offset   = 0;
@@ -876,7 +878,7 @@
     goto Exit;
 
   Fail:
-    FNT_Face_Done( face );
+    FNT_Face_Done( fntface );
 
   Exit:
     return error;
@@ -884,12 +886,15 @@
 
 
   static FT_Error
-  FNT_Size_Select( FT_Size  size )
+  FNT_Size_Select( FT_Size   size,
+                   FT_ULong  strike_index )
   {
     FNT_Face          face   = (FNT_Face)size->face;
     FT_WinFNT_Header  header = &face->font->header;
 
+    FT_UNUSED( strike_index );
 
+
     FT_Select_Metrics( size->face, 0 );
 
     size->metrics.ascender    = header->ascent * 64;
@@ -935,7 +940,7 @@
     if ( error )
       return error;
     else
-      return FNT_Size_Select( size );
+      return FNT_Size_Select( size, 0 );
   }
 
 
@@ -1088,10 +1093,10 @@
 
 
   static FT_Module_Interface
-  winfnt_get_service( FT_Driver         driver,
+  winfnt_get_service( FT_Module         module,
                       const FT_String*  service_id )
   {
-    FT_UNUSED( driver );
+    FT_UNUSED( module );
 
     return ft_service_list_lookup( winfnt_services, service_id );
   }
@@ -1113,9 +1118,9 @@
 
       0,
 
-      (FT_Module_Constructor)0,
-      (FT_Module_Destructor) 0,
-      (FT_Module_Requester)  winfnt_get_service
+      0,                  /* FT_Module_Constructor */
+      0,                  /* FT_Module_Destructor  */
+      winfnt_get_service
     },
 
     sizeof ( FNT_FaceRec ),
@@ -1122,25 +1127,25 @@
     sizeof ( FT_SizeRec ),
     sizeof ( FT_GlyphSlotRec ),
 
-    (FT_Face_InitFunc)        FNT_Face_Init,
-    (FT_Face_DoneFunc)        FNT_Face_Done,
-    (FT_Size_InitFunc)        0,
-    (FT_Size_DoneFunc)        0,
-    (FT_Slot_InitFunc)        0,
-    (FT_Slot_DoneFunc)        0,
+    FNT_Face_Init,
+    FNT_Face_Done,
+    0,                    /* FT_Size_InitFunc */
+    0,                    /* FT_Size_DoneFunc */
+    0,                    /* FT_Slot_InitFunc */
+    0,                    /* FT_Slot_DoneFunc */
 
 #ifdef FT_CONFIG_OPTION_OLD_INTERNALS
     ft_stub_set_char_sizes,
     ft_stub_set_pixel_sizes,
 #endif
-    (FT_Slot_LoadFunc)        FNT_Load_Glyph,
+    FNT_Load_Glyph,
 
-    (FT_Face_GetKerningFunc)  0,
-    (FT_Face_AttachFunc)      0,
-    (FT_Face_GetAdvancesFunc) 0,
+    0,                    /* FT_Face_GetKerningFunc  */
+    0,                    /* FT_Face_AttachFunc      */
+    0,                    /* FT_Face_GetAdvancesFunc */
 
-    (FT_Size_RequestFunc)     FNT_Size_Request,
-    (FT_Size_SelectFunc)      FNT_Size_Select
+    FNT_Size_Request,
+    FNT_Size_Select
   };