1
0
mirror of https://github.com/adtools/clib2.git synced 2025-12-08 14:59:05 +00:00

Use IsMinListEmpty() for MinList rather than IsListEmpty().

This removes the warnings about breaking the strict-aliasing rules.
This commit is contained in:
Sebastian Bauer
2018-04-10 23:20:20 +02:00
parent 85c36839d5
commit 397013922c
8 changed files with 23 additions and 15 deletions

View File

@ -75,14 +75,15 @@ struct MinList NOCOMMON __memory_list;
/****************************************************************************/
void *
__allocate_memory(size_t size,BOOL never_free,const char * UNUSED debug_file_name,int UNUSED debug_line_number)
__allocate_memory(size_t size,BOOL never_free,const char *debug_file_name UNUSED,int debug_line_number UNUSED)
{
struct MemoryNode * mn;
size_t allocation_size;
void * result = NULL;
size_t original_size;
#if defined(UNIX_PATH_SEMANTICS)
size_t original_size;
{
original_size = size;
@ -417,7 +418,7 @@ STDLIB_DESTRUCTOR(stdlib_memory_exit)
if(__memory_list.mlh_Head != NULL)
{
while(NOT IsListEmpty((struct List *)&__memory_list))
while(NOT IsMinListEmpty(&__memory_list))
{
((struct MemoryNode *)__memory_list.mlh_Head)->mn_AlreadyFree = FALSE;
@ -453,12 +454,12 @@ STDLIB_DESTRUCTOR(stdlib_memory_exit)
{
#ifdef __MEM_DEBUG
{
while(NOT IsListEmpty((struct List *)&__memory_list))
while(NOT IsMinListEmpty(&__memory_list))
__free_memory_node((struct MemoryNode *)__memory_list.mlh_Head,__FILE__,__LINE__);
}
#else
{
while(NOT IsListEmpty((struct List *)&__memory_list))
while(NOT IsMinListEmpty(&__memory_list))
__free_memory_node((struct MemoryNode *)__memory_list.mlh_Head,NULL,0);
}
#endif /* __MEM_DEBUG */
@ -478,12 +479,12 @@ STDLIB_DESTRUCTOR(stdlib_memory_exit)
{
#ifdef __MEM_DEBUG
{
while(NOT IsListEmpty((struct List *)&__memory_list))
while(NOT IsMinListEmpty(&__memory_list))
__free_memory_node((struct MemoryNode *)__memory_list.mlh_Head,__FILE__,__LINE__);
}
#else
{
while(NOT IsListEmpty((struct List *)&__memory_list))
while(NOT IsMinListEmpty(&__memory_list))
__free_memory_node((struct MemoryNode *)__memory_list.mlh_Head,NULL,0);
}
#endif /* __MEM_DEBUG */