From c3e83b4662962bdfd6cf9c6f4acaececea806ca0 Mon Sep 17 00:00:00 2001 From: Werner Lemberg Date: Mon, 11 Jul 2016 05:56:26 +0200 Subject: [PATCH] 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. --- ChangeLog | 14 ++++++++++++++ include/freetype/config/ftstdlib.h | 2 +- src/base/ftdbgmem.c | 6 +++--- src/cid/cidparse.c | 2 +- src/type42/t42drivr.c | 3 ++- src/type42/t42objs.c | 5 +++-- 6 files changed, 24 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4f917b2b8..830840e3e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +2016-07-11 Werner Lemberg + + 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 Implement handling of `FREETYPE_PROPERTIES' environment variable. diff --git a/include/freetype/config/ftstdlib.h b/include/freetype/config/ftstdlib.h index 58b95a75d..6eefa9f86 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 6ab507274..38d1a803f 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 73aca2ac6..cca4363e1 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 c63ed0c81..54c4eb328 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 4672c6e16..089ae0f5a 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,