mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
[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:
11
pngtrans.c
11
pngtrans.c
@@ -79,7 +79,7 @@ png_set_packswap(png_structp png_ptr)
|
||||
|
||||
#if defined(PNG_READ_SHIFT_SUPPORTED) || defined(PNG_WRITE_SHIFT_SUPPORTED)
|
||||
void PNGAPI
|
||||
png_set_shift(png_structp png_ptr, png_color_8p true_bits)
|
||||
png_set_shift(png_structp png_ptr, png_const_color_8p true_bits)
|
||||
{
|
||||
png_debug(1, "in png_set_shift");
|
||||
|
||||
@@ -395,18 +395,19 @@ png_do_packswap(png_row_infop row_info, png_bytep row)
|
||||
|
||||
if (row_info->bit_depth < 8)
|
||||
{
|
||||
png_bytep rp, end, table;
|
||||
png_bytep rp;
|
||||
png_const_bytep end, table;
|
||||
|
||||
end = row + row_info->rowbytes;
|
||||
|
||||
if (row_info->bit_depth == 1)
|
||||
table = (png_bytep)onebppswaptable;
|
||||
table = onebppswaptable;
|
||||
|
||||
else if (row_info->bit_depth == 2)
|
||||
table = (png_bytep)twobppswaptable;
|
||||
table = twobppswaptable;
|
||||
|
||||
else if (row_info->bit_depth == 4)
|
||||
table = (png_bytep)fourbppswaptable;
|
||||
table = fourbppswaptable;
|
||||
|
||||
else
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user