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.
This commit is contained in:
Werner Lemberg 2016-07-11 05:56:26 +02:00
parent 84d3df7501
commit c3e83b4662
6 changed files with 24 additions and 8 deletions

View File

@ -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.

View File

@ -142,7 +142,7 @@
/**********************************************************************/
#define ft_atol atol
#define ft_strtol strtol
#define ft_getenv getenv

View File

@ -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 )

View File

@ -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 )

View File

@ -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;

View File

@ -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,