[devel] Added const_png_structp and const_png_infop types, and used them in

prototypes for most png_get_*() functions.
This commit is contained in:
Glenn Randers-Pehrson
2011-01-21 23:12:51 -06:00
parent 2cb633b915
commit b86b4928d6
11 changed files with 232 additions and 202 deletions

14
png.c
View File

@@ -14,7 +14,7 @@
#include "pngpriv.h"
/* Generate a compiler error if there is an old png.h in the search path. */
typedef png_libpng_version_1_5_1rc01 Your_png_h_is_not_version_1_5_1rc01;
typedef png_libpng_version_1_5_1beta07 Your_png_h_is_not_version_1_5_1beta07;
/* Tells libpng that we have already handled the first "num_bytes" bytes
* of the PNG file signature. If the PNG data is embedded into another
@@ -547,7 +547,7 @@ png_convert_to_rfc1123(png_structp png_ptr, png_const_timep ptime)
#endif /* defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED) */
png_const_charp PNGAPI
png_get_copyright(png_structp png_ptr)
png_get_copyright(const_png_structp png_ptr)
{
PNG_UNUSED(png_ptr) /* Silence compiler warning about unused png_ptr */
#ifdef PNG_STRING_COPYRIGHT
@@ -555,13 +555,13 @@ png_get_copyright(png_structp png_ptr)
#else
# ifdef __STDC__
return PNG_STRING_NEWLINE \
"libpng version 1.5.1rc01 - January 21, 2011" PNG_STRING_NEWLINE \
"libpng version 1.5.1beta07 - January 22, 2011" PNG_STRING_NEWLINE \
"Copyright (c) 1998-2011 Glenn Randers-Pehrson" PNG_STRING_NEWLINE \
"Copyright (c) 1996-1997 Andreas Dilger" PNG_STRING_NEWLINE \
"Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc." \
PNG_STRING_NEWLINE;
# else
return "libpng version 1.5.1rc01 - January 21, 2011\
return "libpng version 1.5.1beta07 - January 22, 2011\
Copyright (c) 1998-2011 Glenn Randers-Pehrson\
Copyright (c) 1996-1997 Andreas Dilger\
Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.";
@@ -578,14 +578,14 @@ png_get_copyright(png_structp png_ptr)
* it is guaranteed that png.c uses the correct version of png.h.
*/
png_const_charp PNGAPI
png_get_libpng_ver(png_structp png_ptr)
png_get_libpng_ver(const_png_structp png_ptr)
{
/* Version of *.c files used when building libpng */
return png_get_header_ver(png_ptr);
}
png_const_charp PNGAPI
png_get_header_ver(png_structp png_ptr)
png_get_header_ver(const_png_structp png_ptr)
{
/* Version of *.h files used when building libpng */
PNG_UNUSED(png_ptr) /* Silence compiler warning about unused png_ptr */
@@ -593,7 +593,7 @@ png_get_header_ver(png_structp png_ptr)
}
png_const_charp PNGAPI
png_get_header_version(png_structp png_ptr)
png_get_header_version(const_png_structp png_ptr)
{
/* Returns longer string containing both version and date */
PNG_UNUSED(png_ptr) /* Silence compiler warning about unused png_ptr */