shithub: freetype+ttf2subf

Download patch

ref: 45489589adb5e01cd2c8951dded6dced5bf7ef6e
parent: 1137d04f85079ff3b96b148ebcfed39690fdb09e
author: Werner Lemberg <[email protected]>
date: Sat Oct 4 07:39:03 EDT 2008

* src/base/ftobjs.c (open_face_PS_from_sfnt_stream): Remove compiler
warnings.

Formatting.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,11 +1,15 @@
+2008-10-04  Werner Lemberg  <[email protected]>
+
+	* src/base/ftobjs.c (open_face_PS_from_sfnt_stream): Remove compiler
+	warnings.
+
 2008-10-04  suzuki toshiya  <[email protected]>
 
 	* src/base/ftobjs.c (ft_lookup_PS_in_sfnt): Replaced by...
 	(ft_lookup_PS_in_sfnt_stream): This.
-	(open_face_PS_from_sfnt_stream): New function. It checks
-	whether the stream is sfnt-wrapped Type1 PS font or sfnt-
-	wrapped CID-keyed font, then try to open a face for given
-	face_index.
+	(open_face_PS_from_sfnt_stream): New function.  It checks whether
+	the stream is sfnt-wrapped Type1 PS font or sfnt-wrapped CID-keyed
+	font, then try to open a face for given face_index.
 	(Mac_Read_sfnt_Resource): Replace the combination of
 	`ft_lookup_PS_in_sfnt' and `open_face_from_buffer' by
 	`open_face_PS_from_sfnt_stream'.
@@ -16,22 +20,20 @@
 
 2008-10-03  suzuki toshiya  <[email protected]>
 
-	* src/base/ftobjs.c (ft_lookup_PS_in_sfnt): Set *is_sfnt_cid
-	to FALSE when neither `CID ' nor `TYP1' is found in the sfnt
-	container.
+	* src/base/ftobjs.c (ft_lookup_PS_in_sfnt): Set *is_sfnt_cid to
+	FALSE if neither `CID ' nor `TYP1' is found in the sfnt container.
 
 2008-10-03  suzuki toshiya  <[email protected]>
 
-	* include/freetype/config/ftconfig.h: Define FT_MACINTOSH when
-	SC or MrC compiler of MPW is used. These compilers do not
-	define the macro __APPLE__ by themselves.
+	* include/freetype/config/ftconfig.h: Define FT_MACINTOSH when SC or
+	MrC compiler of MPW is used.  These compilers do not define the
+	macro __APPLE__ by themselves.
 	* builds/unix/ftconfig.in: Ditto.
 	* builds/vms/ftconfig.h: Ditto.
-	* src/base/ftbase.c: Use FT_MACINTOSH instead of __APPLE__,
-	to include ftmac.c when FreeType2 is built by MPW.
-	* src/base/ftobjs.c: Use FT_MACINTOSH instead of __APPLE__,
-	to enable shared functions for ftmac.c when FreeType2 is
-	built by MPW.
+	* src/base/ftbase.c: Use FT_MACINTOSH instead of __APPLE__, to
+	include ftmac.c if FreeType 2 is built by MPW.
+	* src/base/ftobjs.c: Use FT_MACINTOSH instead of __APPLE__, to
+	enable shared functions for ftmac.c if FreeType 2 is built by MPW.
 
 	* builds/mac/ftmac.c: Include ftbase.h.
 	(memory_stream_close): Removed.
@@ -41,10 +43,9 @@
 	(ft_lookup_PS_in_sfnt): Ditto.
 
 	* builds/mac/FreeType.m68k_far.make.txt: Build ftmac.c as an
-	included part of ftbase.c, to share the functions in ftobjs.c.
-	The rule compiling ftmac.c separately is removed and the rule
-	copying ftbase.c from src/base/ftbase.c to builds/mac/ftbase.c
-	is added.
+	included part of ftbase.c, to share the functions in ftobjs.c.  The
+	rule compiling ftmac.c separately is removed and the rule copying
+	ftbase.c from src/base/ftbase.c to builds/mac/ftbase.c is added.
 	* builds/mac/FreeType.m68k_cfm.make.txt: Ditto.
 	* builds/mac/FreeType.ppc_classic.make.txt: Ditto.
 	* builds/mac/FreeType.ppc_carbon.make.txt: Ditto.
--- a/builds/unix/ftconfig.in
+++ b/builds/unix/ftconfig.in
@@ -157,7 +157,7 @@
 #define FT_MACINTOSH 1
 #endif
 
-#elif  defined( __SC__ ) || defined( __MRC__ )
+#elif defined( __SC__ ) || defined( __MRC__ )
   /* Classic MacOS compilers */
 #include "ConditionalMacros.h"
 #if TARGET_OS_MAC
--- a/builds/vms/ftconfig.h
+++ b/builds/vms/ftconfig.h
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    VMS-specific configuration file (specification only).                */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004, 2006, 2007 by                   */
+/*  Copyright 1996-2001, 2002, 2003, 2004, 2006, 2007, 2008 by             */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -110,7 +110,7 @@
 #define FT_MACINTOSH 1
 #endif
 
-#elif  defined( __SC__ ) || defined( __MRC__ )
+#elif defined( __SC__ ) || defined( __MRC__ )
   /* Classic MacOS compilers */
 #include "ConditionalMacros.h"
 #if TARGET_OS_MAC
--- a/include/freetype/config/ftconfig.h
+++ b/include/freetype/config/ftconfig.h
@@ -136,7 +136,7 @@
 #define FT_MACINTOSH 1
 #endif
 
-#elif  defined( __SC__ ) || defined( __MRC__ )
+#elif defined( __SC__ ) || defined( __MRC__ )
   /* Classic MacOS compilers */
 #include "ConditionalMacros.h"
 #if TARGET_OS_MAC
--- a/src/base/ftbase.h
+++ b/src/base/ftbase.h
@@ -30,10 +30,10 @@
   /* Assume the stream is sfnt-wrapped PS Type1 or sfnt-wrapped CID-keyed */
   /* font, and try to load a face specified by the face_index.            */
   FT_LOCAL_DEF( FT_Error )
-  open_face_PS_from_sfnt_stream( FT_Library    library,
-                                 FT_Stream     stream,
-                                 FT_Long       face_index,
-                                 FT_Int        num_params,
+  open_face_PS_from_sfnt_stream( FT_Library     library,
+                                 FT_Stream      stream,
+                                 FT_Long        face_index,
+                                 FT_Int         num_params,
                                  FT_Parameter  *params,
                                  FT_Face       *aface );
 
--- a/src/base/ftobjs.c
+++ b/src/base/ftobjs.c
@@ -1339,6 +1339,7 @@
 
     *offset = 0;
     *length = 0;
+
     *is_sfnt_cid = TRUE;
     /* TODO: support for sfnt-wrapped PS/CID in TTC format */
     *is_sfnt_cid = FALSE;
@@ -1349,24 +1350,23 @@
     if ( tag != FT_MAKE_TAG( 't', 'y', 'p', '1' ) )
       return FT_Err_Unknown_File_Format;
 
-
     if ( FT_READ_USHORT( numTables ) )
       return error;
     if ( FT_STREAM_SKIP( 2 * 3 ) ) /* skip binary search header */
       return error;
 
-
     pstable_index = -1;
-    *is_sfnt_cid = FALSE;
-    for ( i = 0; i < numTables; i ++ )
+    *is_sfnt_cid  = FALSE;
+
+    for ( i = 0; i < numTables; i++ )
     {
-      if ( FT_READ_ULONG( tag )     || FT_STREAM_SKIP( 4 )     ||
+      if ( FT_READ_ULONG( tag )     || FT_STREAM_SKIP( 4 )      ||
            FT_READ_ULONG( *offset ) || FT_READ_ULONG( *length ) )
         return error;
 
       if ( tag == FT_MAKE_TAG( 'C', 'I', 'D', ' ' ) )
       {
-        pstable_index ++;
+        pstable_index++;
         *offset += 22;
         *length -= 22;
         *is_sfnt_cid = TRUE;
@@ -1375,7 +1375,7 @@
       }
       else if ( tag == FT_MAKE_TAG( 'T', 'Y', 'P', '1' ) )
       {
-        pstable_index ++;
+        pstable_index++;
         *offset += 24;
         *length -= 24;
         *is_sfnt_cid = FALSE;
@@ -1390,10 +1390,10 @@
 
 
   FT_LOCAL_DEF( FT_Error )
-  open_face_PS_from_sfnt_stream( FT_Library    library,
-                                 FT_Stream     stream,
-                                 FT_Long       face_index,
-                                 FT_Int        num_params,
+  open_face_PS_from_sfnt_stream( FT_Library     library,
+                                 FT_Stream      stream,
+                                 FT_Long        face_index,
+                                 FT_Int         num_params,
                                  FT_Parameter  *params,
                                  FT_Face       *aface )
   {
@@ -1403,6 +1403,9 @@
     FT_Long    pos;
     FT_Bool    is_sfnt_cid;
     FT_Byte*   sfnt_ps;
+
+    FT_UNUSED( num_params );
+    FT_UNUSED( params );
 
 
     pos = FT_Stream_Pos( stream );