summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/freetype/src/base/ftdbgmem.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/3rdparty/freetype/src/base/ftdbgmem.c')
-rw-r--r--src/3rdparty/freetype/src/base/ftdbgmem.c43
1 files changed, 22 insertions, 21 deletions
diff --git a/src/3rdparty/freetype/src/base/ftdbgmem.c b/src/3rdparty/freetype/src/base/ftdbgmem.c
index 6f20313b34..c33d8acb4e 100644
--- a/src/3rdparty/freetype/src/base/ftdbgmem.c
+++ b/src/3rdparty/freetype/src/base/ftdbgmem.c
@@ -4,7 +4,7 @@
/* */
/* Memory debugger (body). */
/* */
-/* Copyright 2001-2015 by */
+/* Copyright 2001-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -268,7 +268,7 @@
ft_mem_table_alloc(
table,
new_size * (FT_Long)sizeof ( FT_MemNode ) );
- if ( new_buckets == NULL )
+ if ( !new_buckets )
return;
FT_ARRAY_ZERO( new_buckets, new_size );
@@ -309,7 +309,7 @@
table = (FT_MemTable)memory->alloc( memory, sizeof ( *table ) );
- if ( table == NULL )
+ if ( !table )
goto Exit;
FT_ZERO( table );
@@ -367,7 +367,8 @@
{
printf(
"leaked memory block at address %p, size %8ld in (%s:%ld)\n",
- node->address, node->size,
+ (void*)node->address,
+ node->size,
FT_FILENAME( node->source->file_name ),
node->source->line_no );
@@ -462,10 +463,10 @@
(FT_UInt32)( 5 * _ft_debug_lineno );
pnode = &table->sources[hash % FT_MEM_SOURCE_BUCKETS];
- for ( ;; )
+ for (;;)
{
node = *pnode;
- if ( node == NULL )
+ if ( !node )
break;
if ( node->file_name == _ft_debug_file &&
@@ -476,7 +477,7 @@
}
node = (FT_MemSource)ft_mem_table_alloc( table, sizeof ( *node ) );
- if ( node == NULL )
+ if ( !node )
ft_mem_debug_panic(
"not enough memory to perform memory debugging\n" );
@@ -544,7 +545,7 @@
/* we need to create a new node in this table */
node = (FT_MemNode)ft_mem_table_alloc( table, sizeof ( *node ) );
- if ( node == NULL )
+ if ( !node )
ft_mem_debug_panic( "not enough memory to run memory tests" );
node->address = address;
@@ -716,7 +717,7 @@
FT_MemTable table = (FT_MemTable)memory->user;
- if ( block == NULL )
+ if ( !block )
ft_mem_debug_panic( "trying to free NULL in (%s:%ld)",
FT_FILENAME( _ft_debug_file ),
_ft_debug_lineno );
@@ -754,7 +755,7 @@
/* the following is valid according to ANSI C */
#if 0
- if ( block == NULL || cur_size == 0 )
+ if ( !block || !cur_size )
ft_mem_debug_panic( "trying to reallocate NULL in (%s:%ld)",
file_name, line_no );
#endif
@@ -798,7 +799,7 @@
return NULL;
new_block = (FT_Pointer)ft_mem_table_alloc( table, new_size );
- if ( new_block == NULL )
+ if ( !new_block )
return NULL;
ft_mem_table_set( table, (FT_Byte*)new_block, new_size, delta );
@@ -825,7 +826,7 @@
FT_Int result = 0;
- if ( getenv( "FT2_DEBUG_MEMORY" ) )
+ if ( ft_getenv( "FT2_DEBUG_MEMORY" ) )
{
table = ft_mem_table_new( memory );
if ( table )
@@ -838,10 +839,10 @@
memory->realloc = ft_mem_debug_realloc;
memory->free = ft_mem_debug_free;
- p = getenv( "FT2_ALLOC_TOTAL_MAX" );
- if ( p != NULL )
+ p = ft_getenv( "FT2_ALLOC_TOTAL_MAX" );
+ if ( p )
{
- FT_Long total_max = ft_atol( p );
+ FT_Long total_max = ft_strtol( p, NULL, 10 );
if ( total_max > 0 )
@@ -851,10 +852,10 @@
}
}
- p = getenv( "FT2_ALLOC_COUNT_MAX" );
- if ( p != NULL )
+ p = ft_getenv( "FT2_ALLOC_COUNT_MAX" );
+ if ( p )
{
- FT_Long total_count = ft_atol( p );
+ FT_Long total_count = ft_strtol( p, NULL, 10 );
if ( total_count > 0 )
@@ -864,10 +865,10 @@
}
}
- p = getenv( "FT2_KEEP_ALIVE" );
- if ( p != NULL )
+ p = ft_getenv( "FT2_KEEP_ALIVE" );
+ if ( p )
{
- FT_Long keep_alive = ft_atol( p );
+ FT_Long keep_alive = ft_strtol( p, NULL, 10 );
if ( keep_alive > 0 )