diff options
author | Cosmin Truta <ctruta@gmail.com> | 2018-08-18 21:01:02 -0400 |
---|---|---|
committer | Cosmin Truta <ctruta@gmail.com> | 2018-08-18 21:01:02 -0400 |
commit | 1ef88828146c23bfc6d81042c6d6ecd61ccc983b (patch) | |
tree | de8eafd6a8c372f3bdb70a51ed799896bdc99c30 /pngrtran.c | |
parent | 58eedced2578c143705c1d8503e4ed3a40aaa8b3 (diff) | |
download | libpng-1ef88828146c23bfc6d81042c6d6ecd61ccc983b.tar.gz |
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.
Diffstat (limited to 'pngrtran.c')
-rw-r--r-- | pngrtran.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/pngrtran.c b/pngrtran.c index 3302a7c63..e61be8782 100644 --- a/pngrtran.c +++ b/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: */ |