mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
Replace the remaining uses of PNG_CONST with const
In v1.6.0, compiler support for const became a requirement. It should be used consistently. To maintain backwards compatibility, PNG_CONST is still maintained in deprecated form.
This commit is contained in:
20
pngrtran.c
20
pngrtran.c
@@ -2995,11 +2995,11 @@ png_do_rgb_to_gray(png_structrp png_ptr, png_row_infop row_info, png_bytep row)
|
||||
if ((row_info->color_type & PNG_COLOR_MASK_PALETTE) == 0 &&
|
||||
(row_info->color_type & PNG_COLOR_MASK_COLOR) != 0)
|
||||
{
|
||||
PNG_CONST png_uint_32 rc = png_ptr->rgb_to_gray_red_coeff;
|
||||
PNG_CONST png_uint_32 gc = png_ptr->rgb_to_gray_green_coeff;
|
||||
PNG_CONST png_uint_32 bc = 32768 - rc - gc;
|
||||
PNG_CONST png_uint_32 row_width = row_info->width;
|
||||
PNG_CONST int have_alpha =
|
||||
const png_uint_32 rc = png_ptr->rgb_to_gray_red_coeff;
|
||||
const png_uint_32 gc = png_ptr->rgb_to_gray_green_coeff;
|
||||
const png_uint_32 bc = 32768 - rc - gc;
|
||||
const png_uint_32 row_width = row_info->width;
|
||||
const int have_alpha =
|
||||
(row_info->color_type & PNG_COLOR_MASK_ALPHA) != 0;
|
||||
|
||||
if (row_info->bit_depth == 8)
|
||||
@@ -4143,11 +4143,11 @@ png_do_encode_alpha(png_row_infop row_info, png_bytep row, png_structrp png_ptr)
|
||||
{
|
||||
if (row_info->bit_depth == 8)
|
||||
{
|
||||
PNG_CONST png_bytep table = png_ptr->gamma_from_1;
|
||||
const png_bytep table = png_ptr->gamma_from_1;
|
||||
|
||||
if (table != NULL)
|
||||
{
|
||||
PNG_CONST int step =
|
||||
const int step =
|
||||
(row_info->color_type & PNG_COLOR_MASK_COLOR) ? 4 : 2;
|
||||
|
||||
/* The alpha channel is the last component: */
|
||||
@@ -4162,12 +4162,12 @@ png_do_encode_alpha(png_row_infop row_info, png_bytep row, png_structrp png_ptr)
|
||||
|
||||
else if (row_info->bit_depth == 16)
|
||||
{
|
||||
PNG_CONST png_uint_16pp table = png_ptr->gamma_16_from_1;
|
||||
PNG_CONST int gamma_shift = png_ptr->gamma_shift;
|
||||
const png_uint_16pp table = png_ptr->gamma_16_from_1;
|
||||
const int gamma_shift = png_ptr->gamma_shift;
|
||||
|
||||
if (table != NULL)
|
||||
{
|
||||
PNG_CONST int step =
|
||||
const int step =
|
||||
(row_info->color_type & PNG_COLOR_MASK_COLOR) ? 8 : 4;
|
||||
|
||||
/* The alpha channel is the last component: */
|
||||
|
||||
Reference in New Issue
Block a user