[devel]Made all API functions that have const arguments and constant string

literal pointers declare them (John Bowler).
Many APIs did not change their arguments but were not declared using
PNG_CONST.  This change corrects this.  In a few cases APIs that return
constant string literal pointers have also been changed to declare this.
Unlike the argument change this may require app changes; however the
results could never be written to (the app would crash on some platforms
where strings are not writable), so this seems advisable.
This commit is contained in:
Glenn Randers-Pehrson
2010-08-18 07:25:46 -05:00
parent 21b4b339d9
commit e600c51355
17 changed files with 406 additions and 355 deletions

View File

@@ -465,7 +465,7 @@ png_get_channels(png_structp png_ptr, png_infop info_ptr)
return (0);
}
png_bytep PNGAPI
png_const_bytep PNGAPI
png_get_signature(png_structp png_ptr, png_infop info_ptr)
{
if (png_ptr != NULL && info_ptr != NULL)
@@ -1035,7 +1035,7 @@ png_get_io_state (png_structp png_ptr)
return png_ptr->io_state;
}
png_bytep PNGAPI
png_const_bytep PNGAPI
png_get_io_chunk_name (png_structp png_ptr)
{
return png_ptr->chunk_name;