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:
@@ -42,7 +42,7 @@ component(png_const_bytep row, png_uint_32 x, unsigned int c,
|
||||
png_uint_32 bit_offset_hi = bit_depth * ((x >> 6) * channels);
|
||||
png_uint_32 bit_offset_lo = bit_depth * ((x & 0x3f) * channels + c);
|
||||
|
||||
row = (png_const_bytep)(((PNG_CONST png_byte (*)[8])row) + bit_offset_hi);
|
||||
row = (png_const_bytep)(((const png_byte (*)[8])row) + bit_offset_hi);
|
||||
row += bit_offset_lo >> 3;
|
||||
bit_offset_lo &= 0x07;
|
||||
|
||||
@@ -73,7 +73,7 @@ static void
|
||||
print_pixel(png_structp png_ptr, png_infop info_ptr, png_const_bytep row,
|
||||
png_uint_32 x)
|
||||
{
|
||||
PNG_CONST unsigned int bit_depth = png_get_bit_depth(png_ptr, info_ptr);
|
||||
const unsigned int bit_depth = png_get_bit_depth(png_ptr, info_ptr);
|
||||
|
||||
switch (png_get_color_type(png_ptr, info_ptr))
|
||||
{
|
||||
@@ -87,7 +87,7 @@ print_pixel(png_structp png_ptr, png_infop info_ptr, png_const_bytep row,
|
||||
*/
|
||||
case PNG_COLOR_TYPE_PALETTE:
|
||||
{
|
||||
PNG_CONST int index = component(row, x, 0, bit_depth, 1);
|
||||
const int index = component(row, x, 0, bit_depth, 1);
|
||||
png_colorp palette = NULL;
|
||||
int num_palette = 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user