ref: c3e83b4662962bdfd6cf9c6f4acaececea806ca0
parent: 84d3df75012a4b5b0b94966bcfaffd73d7f52824
author: Werner Lemberg <[email protected]>
date: Mon Jul 11 01:56:26 EDT 2016
Replace calls to `atol' with `strtol'. We later on need strtol's `endptr' feature. * include/freetype/config/ftstdlib.h (ft_atol): Replace with... (ft_strtol): ... this. * src/base/ftdbgmem.c (ft_mem_debug_init): Updated. * src/cid/cidparse.c (cid_parser_new): Ditto. * src/type42/t42drivr.c (t42_get_name_index), src/type42/t42objs.c (T42_GlyphSlot_Load): Ditto.
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2016-07-11 Werner Lemberg <[email protected]>
+
+ Replace calls to `atol' with `strtol'.
+
+ We later on need strtol's `endptr' feature.
+
+ * include/freetype/config/ftstdlib.h (ft_atol): Replace with...
+ (ft_strtol): ... this.
+
+ * src/base/ftdbgmem.c (ft_mem_debug_init): Updated.
+ * src/cid/cidparse.c (cid_parser_new): Ditto.
+ * src/type42/t42drivr.c (t42_get_name_index), src/type42/t42objs.c
+ (T42_GlyphSlot_Load): Ditto.
+
2016-07-10 Werner Lemberg <[email protected]>
Implement handling of `FREETYPE_PROPERTIES' environment variable.
--- a/include/freetype/config/ftstdlib.h
+++ b/include/freetype/config/ftstdlib.h
@@ -142,7 +142,7 @@
/**********************************************************************/
-#define ft_atol atol
+#define ft_strtol strtol
#define ft_getenv getenv
--- a/src/base/ftdbgmem.c
+++ b/src/base/ftdbgmem.c
@@ -842,7 +842,7 @@
p = getenv( "FT2_ALLOC_TOTAL_MAX" );
if ( p != NULL )
{
- FT_Long total_max = ft_atol( p );
+ FT_Long total_max = ft_strtol( p, NULL, 10 );
if ( total_max > 0 )
@@ -855,7 +855,7 @@
p = getenv( "FT2_ALLOC_COUNT_MAX" );
if ( p != NULL )
{
- FT_Long total_count = ft_atol( p );
+ FT_Long total_count = ft_strtol( p, NULL, 10 );
if ( total_count > 0 )
@@ -868,7 +868,7 @@
p = getenv( "FT2_KEEP_ALIVE" );
if ( p != NULL )
{
- FT_Long keep_alive = ft_atol( p );
+ FT_Long keep_alive = ft_strtol( p, NULL, 10 );
if ( keep_alive > 0 )
--- a/src/cid/cidparse.c
+++ b/src/cid/cidparse.c
@@ -213,7 +213,7 @@
{
if ( ft_strncmp( (char*)arg1, "(Hex)", 5 ) == 0 )
{
- FT_Long tmp = ft_atol( (const char *)arg2 );
+ FT_Long tmp = ft_strtol( (const char *)arg2, NULL, 10 );
if ( tmp < 0 )
--- a/src/type42/t42drivr.c
+++ b/src/type42/t42drivr.c
@@ -81,7 +81,8 @@
if ( glyph_name[0] == gname[0] && !ft_strcmp( glyph_name, gname ) )
- return (FT_UInt)ft_atol( (const char *)face->type1.charstrings[i] );
+ return (FT_UInt)ft_strtol( (const char *)face->type1.charstrings[i],
+ NULL, 10 );
}
return 0;
--- a/src/type42/t42objs.c
+++ b/src/type42/t42objs.c
@@ -656,8 +656,9 @@
FT_TRACE1(( "T42_GlyphSlot_Load: glyph index %d\n", glyph_index ));
/* map T42 glyph index to embedded TTF's glyph index */
- glyph_index = (FT_UInt)ft_atol(
- (const char *)t42face->type1.charstrings[glyph_index] );
+ glyph_index = (FT_UInt)ft_strtol(
+ (const char *)t42face->type1.charstrings[glyph_index],
+ NULL, 10 );
t42_glyphslot_clear( t42slot->ttslot );
error = ttclazz->load_glyph( t42slot->ttslot,