[libpng16] Eliminated png_info_destroy. It is now used only in png.c

and only calls one other internal function and memset.
This commit is contained in:
John Bowler 2011-12-24 07:47:02 -06:00 committed by Glenn Randers-Pehrson
parent 5a956a7a58
commit df477e4652
4 changed files with 17 additions and 26 deletions

View File

@ -1,5 +1,5 @@
Libpng 1.6.0beta04 - December 22, 2011 Libpng 1.6.0beta04 - December 24, 2011
This is not intended to be a public release. It will be replaced This is not intended to be a public release. It will be replaced
within a few weeks by a public version or by another test version. within a few weeks by a public version or by another test version.
@ -29,7 +29,8 @@ Changes since the last public release (1.5.7):
Version 1.6.0beta01 [December 15, 2011] Version 1.6.0beta01 [December 15, 2011]
Removed machine-generated configure files from the GIT repository (they will Removed machine-generated configure files from the GIT repository (they will
continue to appear in the tarball distributions). continue to appear in the tarball distributions).
Restored the new 'simplified' API, which was deleted from libpng-1.5.7. Restored the new 'simplified' API, which was started in libpng-1.5.7beta02
but later deleted from libpng-1.5.7beta05.
Added example programs for the new 'simplified' API. Added example programs for the new 'simplified' API.
Added ANSI-C (C90) headers and require them, and take advantage of the Added ANSI-C (C90) headers and require them, and take advantage of the
change. Also fixed some of the projects/* and contrib/* files that needed change. Also fixed some of the projects/* and contrib/* files that needed
@ -76,7 +77,10 @@ Version 1.6.0beta03 [December 22, 2011]
decreases in code size by 1733 bytes. pngerror.o increases in size by decreases in code size by 1733 bytes. pngerror.o increases in size by
about 465 bytes because of the new functionality. about 465 bytes because of the new functionality.
Version 1.6.0beta04 [December 22, 2011] Version 1.6.0beta04 [December 24, 2011]
Regenerated configure scripts with automake-1.11.2
Eliminated png_info_destroy. It is now used only in png.c and only calls one
other internal functions and memset.
Send comments/corrections/commendations to png-mng-implement at lists.sf.net Send comments/corrections/commendations to png-mng-implement at lists.sf.net
(subscription required; visit (subscription required; visit

View File

@ -3780,7 +3780,8 @@ Version 1.5.7 [December 15, 2011]
Version 1.6.0beta01 [December 15, 2011] Version 1.6.0beta01 [December 15, 2011]
Removed machine-generated configure files from the GIT repository (they will Removed machine-generated configure files from the GIT repository (they will
continue to appear in the tarball distributions). continue to appear in the tarball distributions).
Restored the new 'simplified' API, which was deleted from libpng-1.5.7. Restored the new 'simplified' API, which was started in libpng-1.5.7beta02
but later deleted from libpng-1.5.7beta05.
Added example programs for the new 'simplified' API. Added example programs for the new 'simplified' API.
Added ANSI-C (C90) headers and require them, and take advantage of the Added ANSI-C (C90) headers and require them, and take advantage of the
change. Also fixed some of the projects/* and contrib/* files that needed change. Also fixed some of the projects/* and contrib/* files that needed
@ -3827,7 +3828,10 @@ Version 1.6.0beta03 [December 22, 2011]
decreases in code size by 1733 bytes. pngerror.o increases in size by decreases in code size by 1733 bytes. pngerror.o increases in size by
about 465 bytes because of the new functionality. about 465 bytes because of the new functionality.
Version 1.6.0beta04 [December 22, 2011] Version 1.6.0beta04 [December 24, 2011]
Regenerated configure scripts with automake-1.11.2
Eliminated png_info_destroy. It is now used only in png.c and only calls one
other internal functions and memset.
Send comments/corrections/commendations to png-mng-implement at lists.sf.net Send comments/corrections/commendations to png-mng-implement at lists.sf.net
(subscription required; visit (subscription required; visit

21
png.c
View File

@ -387,7 +387,8 @@ png_destroy_info_struct(png_const_structp png_ptr, png_infopp info_ptr_ptr)
*/ */
*info_ptr_ptr = NULL; *info_ptr_ptr = NULL;
png_info_destroy(png_ptr, info_ptr); png_free_data(png_ptr, info_ptr, PNG_FREE_ALL, -1);
png_memset(info_ptr, 0, sizeof *info_ptr);
png_free(png_ptr, info_ptr); png_free(png_ptr, info_ptr);
} }
} }
@ -641,20 +642,6 @@ png_free_data(png_const_structp png_ptr, png_infop info_ptr, png_uint_32 mask,
info_ptr->free_me &= ~mask; info_ptr->free_me &= ~mask;
} }
/* This is an internal routine to free any memory that the info struct is
* pointing to before re-using it or freeing the struct itself. Recall
* that png_free() checks for NULL pointers for us.
*/
void /* PRIVATE */
png_info_destroy(png_const_structp png_ptr, png_infop info_ptr)
{
png_debug(1, "in png_info_destroy");
png_free_data(png_ptr, info_ptr, PNG_FREE_ALL, -1);
png_memset(info_ptr, 0, sizeof *info_ptr);
}
#endif /* defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED) */ #endif /* defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED) */
/* This function returns a pointer to the io_ptr associated with the user /* This function returns a pointer to the io_ptr associated with the user
@ -775,13 +762,13 @@ png_get_copyright(png_const_structp png_ptr)
#else #else
# ifdef __STDC__ # ifdef __STDC__
return PNG_STRING_NEWLINE \ return PNG_STRING_NEWLINE \
"libpng version 1.6.0beta04 - December 22, 2011" PNG_STRING_NEWLINE \ "libpng version 1.6.0beta04 - December 24, 2011" PNG_STRING_NEWLINE \
"Copyright (c) 1998-2011 Glenn Randers-Pehrson" PNG_STRING_NEWLINE \ "Copyright (c) 1998-2011 Glenn Randers-Pehrson" PNG_STRING_NEWLINE \
"Copyright (c) 1996-1997 Andreas Dilger" PNG_STRING_NEWLINE \ "Copyright (c) 1996-1997 Andreas Dilger" PNG_STRING_NEWLINE \
"Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc." \ "Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc." \
PNG_STRING_NEWLINE; PNG_STRING_NEWLINE;
# else # else
return "libpng version 1.6.0beta04 - December 22, 2011\ return "libpng version 1.6.0beta04 - December 24, 2011\
Copyright (c) 1998-2011 Glenn Randers-Pehrson\ Copyright (c) 1998-2011 Glenn Randers-Pehrson\
Copyright (c) 1996-1997 Andreas Dilger\ Copyright (c) 1996-1997 Andreas Dilger\
Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc."; Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.";

View File

@ -710,10 +710,6 @@ PNG_EXTERN PNG_FUNCTION(png_structp,png_create_png_struct,
/* Free memory from internal libpng struct */ /* Free memory from internal libpng struct */
PNG_EXTERN void png_destroy_png_struct PNGARG((png_structp png_ptr)); PNG_EXTERN void png_destroy_png_struct PNGARG((png_structp png_ptr));
/* Free any memory that info_ptr points to and reset struct. */
PNG_EXTERN void png_info_destroy PNGARG((png_const_structp png_ptr,
png_infop info_ptr));
/* Free an allocated jmp_buf (always succeeds) */ /* Free an allocated jmp_buf (always succeeds) */
PNG_EXTERN void png_free_jmpbuf PNGARG((png_structp png_ptr)); PNG_EXTERN void png_free_jmpbuf PNGARG((png_structp png_ptr));