* src/base/ftobjs.c (open_face_PS_from_sfnt_stream): Remove compiler warnings. Formatting.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213
diff --git a/ChangeLog b/ChangeLog
index ff89f68..b178e6b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,11 +1,15 @@
+2008-10-04 Werner Lemberg <wl@gnu.org>
+
+ * src/base/ftobjs.c (open_face_PS_from_sfnt_stream): Remove compiler
+ warnings.
+
2008-10-04 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
* 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 <mpsuzuki@hiroshima-u.ac.jp>
- * 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 <mpsuzuki@hiroshima-u.ac.jp>
- * 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.
diff --git a/builds/unix/ftconfig.in b/builds/unix/ftconfig.in
index b16d894..fc8e4a2 100644
--- a/builds/unix/ftconfig.in
+++ b/builds/unix/ftconfig.in
@@ -157,7 +157,7 @@ FT_BEGIN_HEADER
#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
diff --git a/builds/vms/ftconfig.h b/builds/vms/ftconfig.h
index 8026971..1659d03 100644
--- 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 @@ FT_BEGIN_HEADER
#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
diff --git a/include/freetype/config/ftconfig.h b/include/freetype/config/ftconfig.h
index 214cec2..169da3c 100644
--- a/include/freetype/config/ftconfig.h
+++ b/include/freetype/config/ftconfig.h
@@ -136,7 +136,7 @@ FT_BEGIN_HEADER
#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
diff --git a/src/base/ftbase.h b/src/base/ftbase.h
index d8c18ab..9cae85d 100644
--- a/src/base/ftbase.h
+++ b/src/base/ftbase.h
@@ -30,10 +30,10 @@ FT_BEGIN_HEADER
/* 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 );
diff --git a/src/base/ftobjs.c b/src/base/ftobjs.c
index a8fe744..4a4629a 100644
--- 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 )
{
@@ -1404,6 +1404,9 @@
FT_Bool is_sfnt_cid;
FT_Byte* sfnt_ps;
+ FT_UNUSED( num_params );
+ FT_UNUSED( params );
+
pos = FT_Stream_Pos( stream );