Imported from libpng-1.2.30beta04.tar

This commit is contained in:
Glenn Randers-Pehrson
2008-07-10 09:10:58 -05:00
parent b96b342561
commit 4310a4d813
63 changed files with 737 additions and 708 deletions

View File

@@ -1,7 +1,7 @@
/* pngmem.c - stub functions for memory allocation
*
* Last changed in libpng 1.2.30 [July 6, 2008]
* Last changed in libpng 1.2.30 [July 10, 2008]
* For conditions of distribution and use, see copyright notice in png.h
* Copyright (c) 1998-2008 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
@@ -47,7 +47,7 @@ png_create_struct_2(int type, png_malloc_ptr malloc_fn, png_voidp mem_ptr)
return (png_get_copyright(NULL));
#ifdef PNG_USER_MEM_SUPPORTED
if(malloc_fn != NULL)
if (malloc_fn != NULL)
{
png_struct dummy_struct;
png_structp png_ptr = &dummy_struct;
@@ -79,7 +79,7 @@ png_destroy_struct_2(png_voidp struct_ptr, png_free_ptr free_fn,
if (struct_ptr != NULL)
{
#ifdef PNG_USER_MEM_SUPPORTED
if(free_fn != NULL)
if (free_fn != NULL)
{
png_struct dummy_struct;
png_structp png_ptr = &dummy_struct;
@@ -121,7 +121,7 @@ png_malloc(png_structp png_ptr, png_uint_32 size)
return (NULL);
#ifdef PNG_USER_MEM_SUPPORTED
if(png_ptr->malloc_fn != NULL)
if (png_ptr->malloc_fn != NULL)
ret = ((png_voidp)(*(png_ptr->malloc_fn))(png_ptr, (png_size_t)size));
else
ret = (png_malloc_default(png_ptr, size));
@@ -170,7 +170,7 @@ png_malloc_default(png_structp png_ptr, png_uint_32 size)
ret = NULL;
}
if(png_ptr->zlib_window_bits > 14)
if (png_ptr->zlib_window_bits > 14)
num_blocks = (int)(1 << (png_ptr->zlib_window_bits - 14));
else
num_blocks = 1;
@@ -292,7 +292,7 @@ png_free_default(png_structp png_ptr, png_voidp ptr)
{
#endif /* PNG_USER_MEM_SUPPORTED */
if(png_ptr == NULL || ptr == NULL) return;
if (png_ptr == NULL || ptr == NULL) return;
if (png_ptr->offset_table != NULL)
{
@@ -352,7 +352,7 @@ png_create_struct_2(int type, png_malloc_ptr malloc_fn, png_voidp mem_ptr)
return (NULL);
#ifdef PNG_USER_MEM_SUPPORTED
if(malloc_fn != NULL)
if (malloc_fn != NULL)
{
png_struct dummy_struct;
png_structp png_ptr = &dummy_struct;
@@ -397,7 +397,7 @@ png_destroy_struct_2(png_voidp struct_ptr, png_free_ptr free_fn,
if (struct_ptr != NULL)
{
#ifdef PNG_USER_MEM_SUPPORTED
if(free_fn != NULL)
if (free_fn != NULL)
{
png_struct dummy_struct;
png_structp png_ptr = &dummy_struct;
@@ -433,7 +433,7 @@ png_malloc(png_structp png_ptr, png_uint_32 size)
if (png_ptr == NULL || size == 0)
return (NULL);
if(png_ptr->malloc_fn != NULL)
if (png_ptr->malloc_fn != NULL)
ret = ((png_voidp)(*(png_ptr->malloc_fn))(png_ptr, (png_size_t)size));
else
ret = (png_malloc_default(png_ptr, size));
@@ -541,7 +541,7 @@ png_malloc_warn(png_structp png_ptr, png_uint_32 size)
{
png_voidp ptr;
png_uint_32 save_flags;
if(png_ptr == NULL) return (NULL);
if (png_ptr == NULL) return (NULL);
save_flags=png_ptr->flags;
png_ptr->flags|=PNG_FLAG_MALLOC_NULL_MEM_OK;
@@ -586,7 +586,7 @@ void PNGAPI
png_set_mem_fn(png_structp png_ptr, png_voidp mem_ptr, png_malloc_ptr
malloc_fn, png_free_ptr free_fn)
{
if(png_ptr != NULL) {
if (png_ptr != NULL) {
png_ptr->mem_ptr = mem_ptr;
png_ptr->malloc_fn = malloc_fn;
png_ptr->free_fn = free_fn;
@@ -600,7 +600,7 @@ png_set_mem_fn(png_structp png_ptr, png_voidp mem_ptr, png_malloc_ptr
png_voidp PNGAPI
png_get_mem_ptr(png_structp png_ptr)
{
if(png_ptr == NULL) return (NULL);
if (png_ptr == NULL) return (NULL);
return ((png_voidp)png_ptr->mem_ptr);
}
#endif /* PNG_USER_MEM_SUPPORTED */