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.
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
diff --git a/ChangeLog b/ChangeLog
index 4f917b2..830840e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2016-07-11 Werner Lemberg <wl@gnu.org>
+
+ 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 <wl@gnu.org>
Implement handling of `FREETYPE_PROPERTIES' environment variable.
diff --git a/include/freetype/config/ftstdlib.h b/include/freetype/config/ftstdlib.h
index 58b95a7..6eefa9f 100644
--- 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
diff --git a/src/base/ftdbgmem.c b/src/base/ftdbgmem.c
index 6ab5072..38d1a80 100644
--- 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 )
diff --git a/src/cid/cidparse.c b/src/cid/cidparse.c
index 73aca2a..cca4363 100644
--- 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 )
diff --git a/src/type42/t42drivr.c b/src/type42/t42drivr.c
index c63ed0c..54c4eb3 100644
--- 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;
diff --git a/src/type42/t42objs.c b/src/type42/t42objs.c
index 4672c6e..089ae0f 100644
--- 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,