* src/cff/cffobjs.c (cff_face_init): fixed a small memory leak * src/autofit/afloader.c, src/autofit/afmodule.c, src/base/ftdebug.c: removed compiler warnings * src/autofit/aftypes.h, src/lzw/zopen.c, src/pcf/pcfdrivr.c, src/pcf/pcfread.c, src/psaux/psobjs.c, src/type42/t42drivr.c: changed data arrays to "const" to avoid populating the ".data" segment
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 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329
diff --git a/ChangeLog b/ChangeLog
index 7e17d65..587f83e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2004-04-21 David Turner <david@freetype.org>
+
+ * src/cff/cffobjs.c (cff_face_init): fixed a small memory leak
+
+ * src/autofit/afloader.c, src/autofit/afmodule.c, src/base/ftdebug.c:
+ removed compiler warnings
+
+ * src/autofit/aftypes.h, src/lzw/zopen.c, src/pcf/pcfdrivr.c,
+ src/pcf/pcfread.c, src/psaux/psobjs.c, src/type42/t42drivr.c:
+ changed data arrays to "const" to avoid populating the ".data"
+ segment
+
2004-04-20 Werner Lemberg <wl@gnu.org>
* src/psaux/psobjs.c (T1Radix): Renamed to...
@@ -262,7 +274,7 @@
(psh_blues_snap_stem): Don't use blue_shift but blue_threshold.
* src/pshinter/pshalgo.c (PSH_STRONG_THRESHOLD_MAXIMUM): New macro.
- (psh_glyph_find_string_points): Use PSH_STRONG_THRESHOLD_MAXIMUM.
+ (psh_glyph_find_string_points): Use PSH_STRONG_THRESHOLD_MAXIMUM.
(psh_glyph_find_blue_points): New function. Needed for fonts like
p052003l.pfb (URW Palladio L Roman) which have flex curves at the
base line within blue zones, but the flex curves aren't covered by
@@ -362,7 +374,7 @@
accordingly. These values are calculated outside of the function
now.
Add new argument `offsets'.
- (IsMacResource): Use `FT_Raccess_Get_HeaderInfo' and
+ (IsMacResource): Use `FT_Raccess_Get_HeaderInfo' and
`FT_Raccess_Get_DataOffsets'.
(load_face_in_embedded_rfork): New function.
(load_mac_face): Use load_face_in_embedded_rfork.
diff --git a/src/autofit/afloader.c b/src/autofit/afloader.c
index b2299ab..ed42238 100644
--- a/src/autofit/afloader.c
+++ b/src/autofit/afloader.c
@@ -71,7 +71,6 @@
{
FT_Error error = 0;
FT_Face face = loader->face;
- AF_FaceGlobals globals = loader->globals;
FT_GlyphLoader gloader = loader->gloader;
AF_ScriptMetrics metrics = loader->metrics;
AF_GlyphHints hints = &loader->hints;
diff --git a/src/autofit/afmodule.c b/src/autofit/afmodule.c
index d088c24..f266a7a 100644
--- a/src/autofit/afmodule.c
+++ b/src/autofit/afmodule.c
@@ -31,6 +31,8 @@
FT_UInt glyph_index,
FT_Int32 load_flags )
{
+ FT_UNUSED(size);
+
return af_loader_load_glyph( module->loader, slot->face,
glyph_index, load_flags );
}
diff --git a/src/autofit/aftypes.h b/src/autofit/aftypes.h
index 0e4d590..abd2ff5 100644
--- a/src/autofit/aftypes.h
+++ b/src/autofit/aftypes.h
@@ -17,7 +17,7 @@ FT_BEGIN_HEADER
/**************************************************************************/
/**************************************************************************/
-#define AF_DEBUG
+#define xxAF_DEBUG
#ifdef AF_DEBUG
diff --git a/src/base/ftdebug.c b/src/base/ftdebug.c
index b84edbf..a6c1841 100644
--- a/src/base/ftdebug.c
+++ b/src/base/ftdebug.c
@@ -159,7 +159,7 @@
q = p;
while ( *p && *p != ':' )
p++;
-
+
if ( *p == ':' && p > q )
{
FT_Int n, i, len = (FT_Int)( p - q );
@@ -221,16 +221,18 @@
FT_EXPORT_DEF( FT_Int )
- FT_Trace_Get_Count( void )
+ FT_Trace_Get_Count( void )
{
- return 0;
+ return 0;
}
FT_EXPORT_DEF( const char * )
- FT_Trace_Get_Name( FT_Int idx )
- {
- return NULL;
+ FT_Trace_Get_Name( FT_Int idx )
+ {
+ FT_UNUSED( idx );
+
+ return NULL;
}
diff --git a/src/cff/cffobjs.c b/src/cff/cffobjs.c
index 5e9e70a..bbe1654 100644
--- a/src/cff/cffobjs.c
+++ b/src/cff/cffobjs.c
@@ -73,7 +73,7 @@
sbit_metrics = &size->strike_metrics;
- error = sfnt->set_sbit_strike( face,
+ error = sfnt->set_sbit_strike( face,
metrics->x_ppem, metrics->y_ppem,
&strike_index );
@@ -100,7 +100,7 @@
size->strike_index = (FT_UInt)strike_index;
}
else
- {
+ {
size->strike_index = 0xFFFFU;
sbit_metrics->x_ppem = 0;
@@ -113,7 +113,7 @@
return error;
}
-
+
#endif /* TT_CONFIG_OPTION_EMBEDDED_BITMAPS */
@@ -503,33 +503,50 @@
char* fullp = full;
char* family = root->family_name;
-
+ /* we're going to try to extract the style name from the
+ * full name. We need to ignore spaces and dashes during
+ * the search.
+ */
if ( full )
{
while ( *fullp )
{
+ /* skip common characters at the start of both strings
+ */
if ( *fullp == *family )
{
family++;
fullp++;
+ continue;
}
- else
+
+ /* ignore spaces or dashes in full name during comparison
+ */
+ if ( *fullp == ' ' || *fullp == '-' )
+ {
+ fullp++;
+ continue;
+ }
+ /* ignore spaces and dashes in family name during comparison
+ */
+ if ( *family == ' ' || *family == '-' )
+ {
+ family++;
+ continue;
+ }
+
+ if ( !*family && *fullp )
{
- if ( *fullp == ' ' || *fullp == '-' )
- fullp++;
- else if ( *family == ' ' || *family == '-' )
- family++;
- else
- {
- if ( !*family )
- {
- style_name = cff_strcpy( memory, fullp );
- FT_FREE( full );
- }
- break;
- }
+ /* the full name begins with the same characters than the
+ * family name, with spaces and dashes removed. In this
+ * case, the remaining string in "fullp" will be used
+ * as the style name
+ */
+ style_name = cff_strcpy( memory, fullp );
}
+ break;
}
+ FT_FREE( full );
}
}
else
diff --git a/src/lzw/zopen.c b/src/lzw/zopen.c
index 75e619b..5267f16 100644
--- a/src/lzw/zopen.c
+++ b/src/lzw/zopen.c
@@ -173,7 +173,7 @@ zclose(s_zstate_t *zs)
* code in turn. When the buffer fills up empty it and start over.
*/
-static char_type rmask[9] =
+static const char_type rmask[9] =
{0x00, 0x01, 0x03, 0x07, 0x0f, 0x1f, 0x3f, 0x7f, 0xff};
/*
@@ -258,7 +258,7 @@ zread(s_zstate_t *zs)
*stackp++ = finchar = tab_suffixof(code);
/* And put them out in forward order. */
-middle:
+middle:
if (stackp == de_stack)
continue;
diff --git a/src/pcf/pcfdrivr.c b/src/pcf/pcfdrivr.c
index 5cf83e9..80f043f 100644
--- a/src/pcf/pcfdrivr.c
+++ b/src/pcf/pcfdrivr.c
@@ -501,7 +501,7 @@ THE SOFTWARE.
* BDF SERVICE
*
*/
-
+
static FT_Error
pcf_get_bdf_property( PCF_Face face,
const char* prop_name,
@@ -546,7 +546,7 @@ THE SOFTWARE.
}
- static FT_Service_BDFRec pcf_service_bdf =
+ static const FT_Service_BDFRec pcf_service_bdf =
{
(FT_BDF_GetCharsetIdFunc)pcf_get_charset_id,
(FT_BDF_GetPropertyFunc) pcf_get_bdf_property
@@ -559,14 +559,14 @@ THE SOFTWARE.
*
*/
- static FT_ServiceDescRec pcf_services[] =
+ static const FT_ServiceDescRec pcf_services[] =
{
{ FT_SERVICE_ID_BDF, &pcf_service_bdf },
{ FT_SERVICE_ID_XF86_NAME, FT_XF86_FORMAT_PCF },
{ NULL, NULL }
};
-
-
+
+
static FT_Module_Interface
pcf_driver_requester( FT_Module module,
const char* name )
diff --git a/src/pcf/pcfread.c b/src/pcf/pcfread.c
index c8a1404..3beabbf 100644
--- a/src/pcf/pcfread.c
+++ b/src/pcf/pcfread.c
@@ -49,7 +49,7 @@ THE SOFTWARE.
#if defined( FT_DEBUG_LEVEL_TRACE )
- static const char* tableNames[] =
+ static const char* const tableNames[] =
{
"prop", "accl", "mtrcs", "bmps", "imtrcs",
"enc", "swidth", "names", "accel"
diff --git a/src/psaux/psobjs.c b/src/psaux/psobjs.c
index accaf29..7087ca5 100644
--- a/src/psaux/psobjs.c
+++ b/src/psaux/psobjs.c
@@ -285,7 +285,7 @@
#if 'A' == 65
/* ASCII */
- char ft_char_table[128] =
+ static const char ft_char_table[128] =
{
/* 0x00 */
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
@@ -306,7 +306,7 @@
#if 'A' == 193
/* EBCDIC */
- char ft_char_table[128] =
+ static const char ft_char_table[128] =
{
/* 0x80 */
-1, 10, 11, 12, 13, 14, 15, 16, 17, 18, -1, -1, -1, -1, -1, -1,
diff --git a/src/type42/t42drivr.c b/src/type42/t42drivr.c
index f4a7bec..2afe2db 100644
--- a/src/type42/t42drivr.c
+++ b/src/type42/t42drivr.c
@@ -102,7 +102,7 @@
}
- static FT_Service_GlyphDictRec t42_service_glyph_dict =
+ static const FT_Service_GlyphDictRec t42_service_glyph_dict =
{
(FT_GlyphDict_GetNameFunc) t42_get_glyph_name,
(FT_GlyphDict_NameIndexFunc)t42_get_name_index
@@ -122,7 +122,7 @@
}
- static FT_Service_PsFontNameRec t42_service_ps_font_name =
+ static const FT_Service_PsFontNameRec t42_service_ps_font_name =
{
(FT_PsName_GetFunc)t42_get_ps_font_name
};