summaryrefslogtreecommitdiff
path: root/Build/source/libs/libpng/libpng-src/contrib
diff options
context:
space:
mode:
authorAkira Kakuto <kakuto@fuk.kindai.ac.jp>2018-12-02 09:05:31 +0000
committerAkira Kakuto <kakuto@fuk.kindai.ac.jp>2018-12-02 09:05:31 +0000
commite01a29be909ef0469652f522b315a97262e7c3dd (patch)
tree7a2a7ac0d632db9d9abc11bde6d6da61c141321f /Build/source/libs/libpng/libpng-src/contrib
parent4b78ffedbc422e3cff903dc76f7a41d480aebf03 (diff)
libpng-1.6.36
git-svn-id: svn://tug.org/texlive/trunk@49305 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/libs/libpng/libpng-src/contrib')
-rw-r--r--Build/source/libs/libpng/libpng-src/contrib/conftest/pngcp.dfa2
-rw-r--r--Build/source/libs/libpng/libpng-src/contrib/examples/pngpixel.c6
-rw-r--r--Build/source/libs/libpng/libpng-src/contrib/gregbook/readpng2.c2
-rw-r--r--Build/source/libs/libpng/libpng-src/contrib/libtests/makepng.c32
-rw-r--r--Build/source/libs/libpng/libpng-src/contrib/libtests/pngimage.c6
-rw-r--r--Build/source/libs/libpng/libpng-src/contrib/libtests/pngstest.c27
-rw-r--r--Build/source/libs/libpng/libpng-src/contrib/libtests/pngunknown.c2
-rw-r--r--Build/source/libs/libpng/libpng-src/contrib/libtests/pngvalid.c167
-rw-r--r--Build/source/libs/libpng/libpng-src/contrib/libtests/tarith.c4
-rw-r--r--Build/source/libs/libpng/libpng-src/contrib/powerpc-vsx/linux_aux.c6
-rw-r--r--Build/source/libs/libpng/libpng-src/contrib/tools/makesRGB.c6
-rw-r--r--Build/source/libs/libpng/libpng-src/contrib/tools/pngcp.c16
-rw-r--r--Build/source/libs/libpng/libpng-src/contrib/tools/pngfix.c10
13 files changed, 142 insertions, 144 deletions
diff --git a/Build/source/libs/libpng/libpng-src/contrib/conftest/pngcp.dfa b/Build/source/libs/libpng/libpng-src/contrib/conftest/pngcp.dfa
index acf200d325d..31c411d5f82 100644
--- a/Build/source/libs/libpng/libpng-src/contrib/conftest/pngcp.dfa
+++ b/Build/source/libs/libpng/libpng-src/contrib/conftest/pngcp.dfa
@@ -52,6 +52,6 @@ option TEXT on
option USER_LIMITS on
option SET_USER_LIMITS on
-# these are are just required for specific customizations
+# these are just required for specific customizations
option WRITE_CUSTOMIZE_ZTXT_COMPRESSION on
option WRITE_CUSTOMIZE_COMPRESSION on
diff --git a/Build/source/libs/libpng/libpng-src/contrib/examples/pngpixel.c b/Build/source/libs/libpng/libpng-src/contrib/examples/pngpixel.c
index f762379ed3c..9185d518fba 100644
--- a/Build/source/libs/libpng/libpng-src/contrib/examples/pngpixel.c
+++ b/Build/source/libs/libpng/libpng-src/contrib/examples/pngpixel.c
@@ -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);
+ 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);
+ int index = component(row, x, 0, bit_depth, 1);
png_colorp palette = NULL;
int num_palette = 0;
diff --git a/Build/source/libs/libpng/libpng-src/contrib/gregbook/readpng2.c b/Build/source/libs/libpng/libpng-src/contrib/gregbook/readpng2.c
index 5d13e15300d..610b3cd87e0 100644
--- a/Build/source/libs/libpng/libpng-src/contrib/gregbook/readpng2.c
+++ b/Build/source/libs/libpng/libpng-src/contrib/gregbook/readpng2.c
@@ -146,7 +146,7 @@ int readpng2_init(mainprog_info *mainprog_ptr)
/* These byte strings were copied from png.h. If a future version
* of readpng2.c recognizes more chunks, add them to this list.
*/
- static PNG_CONST png_byte chunks_to_process[] = {
+ static const png_byte chunks_to_process[] = {
98, 75, 71, 68, '\0', /* bKGD */
103, 65, 77, 65, '\0', /* gAMA */
115, 82, 71, 66, '\0', /* sRGB */
diff --git a/Build/source/libs/libpng/libpng-src/contrib/libtests/makepng.c b/Build/source/libs/libpng/libpng-src/contrib/libtests/makepng.c
index e58a61d0234..312062bda7f 100644
--- a/Build/source/libs/libpng/libpng-src/contrib/libtests/makepng.c
+++ b/Build/source/libs/libpng/libpng-src/contrib/libtests/makepng.c
@@ -661,7 +661,7 @@ generate_row(png_bytep row, size_t rowbytes, unsigned int y, int color_type,
{
case 1:
{
- const png_uint_32 luma = colors[1];
+ png_uint_32 luma = colors[1];
png_uint_32 x;
for (x=0; x<=size_max; ++x)
@@ -672,8 +672,8 @@ generate_row(png_bytep row, size_t rowbytes, unsigned int y, int color_type,
case 2:
{
- const png_uint_32 luma = colors[1];
- const png_uint_32 alpha = colors[2];
+ png_uint_32 luma = colors[1];
+ png_uint_32 alpha = colors[2];
png_uint_32 x;
for (x=0; x<size_max; ++x)
@@ -688,9 +688,9 @@ generate_row(png_bytep row, size_t rowbytes, unsigned int y, int color_type,
case 3:
{
- const png_uint_32 red = colors[1];
- const png_uint_32 green = colors[2];
- const png_uint_32 blue = colors[3];
+ png_uint_32 red = colors[1];
+ png_uint_32 green = colors[2];
+ png_uint_32 blue = colors[3];
png_uint_32 x;
for (x=0; x<=size_max; ++x)
@@ -707,10 +707,10 @@ generate_row(png_bytep row, size_t rowbytes, unsigned int y, int color_type,
case 4:
{
- const png_uint_32 red = colors[1];
- const png_uint_32 green = colors[2];
- const png_uint_32 blue = colors[3];
- const png_uint_32 alpha = colors[4];
+ png_uint_32 red = colors[1];
+ png_uint_32 green = colors[2];
+ png_uint_32 blue = colors[3];
+ png_uint_32 alpha = colors[4];
png_uint_32 x;
for (x=0; x<=size_max; ++x)
@@ -812,7 +812,7 @@ write_png(const char **name, FILE *fp, int color_type, int bit_depth,
png_error(png_ptr, "OOM allocating info structure");
{
- const unsigned int size =
+ unsigned int size =
image_size_of_type(color_type, bit_depth, colors, small);
unsigned int ysize;
png_fixed_point real_gamma = 45455; /* For sRGB */
@@ -824,7 +824,7 @@ write_png(const char **name, FILE *fp, int color_type, int bit_depth,
*/
if (small)
{
- const unsigned int pixel_depth =
+ unsigned int pixel_depth =
pixel_depth_of_type(color_type, bit_depth);
if (pixel_depth <= 8U)
@@ -1378,10 +1378,10 @@ static void
insert_sBIT(png_structp png_ptr, png_infop info_ptr, int nparams,
png_charpp params)
{
- const int ct = png_get_color_type(png_ptr, info_ptr);
- const int c = (ct & PNG_COLOR_MASK_COLOR ? 3 : 1) +
+ int ct = png_get_color_type(png_ptr, info_ptr);
+ int c = (ct & PNG_COLOR_MASK_COLOR ? 3 : 1) +
(ct & PNG_COLOR_MASK_ALPHA ? 1 : 0);
- const unsigned int maxval =
+ unsigned int maxval =
ct & PNG_COLOR_MASK_PALETTE ? 8U : png_get_bit_depth(png_ptr, info_ptr);
png_color_8 sBIT;
@@ -1856,7 +1856,7 @@ main(int argc, char **argv)
/* Check the colors */
{
- const unsigned int lim = (color_type == PNG_COLOR_TYPE_PALETTE ? 255U :
+ unsigned int lim = (color_type == PNG_COLOR_TYPE_PALETTE ? 255U :
(1U<<bit_depth)-1);
unsigned int i;
diff --git a/Build/source/libs/libpng/libpng-src/contrib/libtests/pngimage.c b/Build/source/libs/libpng/libpng-src/contrib/libtests/pngimage.c
index 998d58c5049..f130c043dff 100644
--- a/Build/source/libs/libpng/libpng-src/contrib/libtests/pngimage.c
+++ b/Build/source/libs/libpng/libpng-src/contrib/libtests/pngimage.c
@@ -1446,7 +1446,7 @@ test_one_file(struct display *dp, const char *filename)
* unsigned, because some transforms are negative on a 16-bit system.
*/
unsigned int active = dp->active_transforms;
- const int exhaustive = (dp->options & EXHAUSTIVE) != 0;
+ int exhaustive = (dp->options & EXHAUSTIVE) != 0;
unsigned int current = first_transform(active);
unsigned int bad_transforms = 0;
unsigned int bad_combo = ~0U; /* bitwise AND of failing transforms */
@@ -1572,7 +1572,7 @@ do_test(struct display *dp, const char *file)
}
int
-main(const int argc, const char * const * const argv)
+main(int argc, char **argv)
{
/* For each file on the command line test it with a range of transforms */
int option_end, ilog = 0;
@@ -1674,7 +1674,7 @@ main(const int argc, const char * const * const argv)
/* Here on any return, including failures, except user/internal issues
*/
{
- const int pass = (d.options & STRICT) ?
+ int pass = (d.options & STRICT) ?
RESULT_STRICT(d.results) : RESULT_RELAXED(d.results);
if (!pass)
diff --git a/Build/source/libs/libpng/libpng-src/contrib/libtests/pngstest.c b/Build/source/libs/libpng/libpng-src/contrib/libtests/pngstest.c
index 74c8d100c88..a368bf0f4d7 100644
--- a/Build/source/libs/libpng/libpng-src/contrib/libtests/pngstest.c
+++ b/Build/source/libs/libpng/libpng-src/contrib/libtests/pngstest.c
@@ -372,7 +372,7 @@ print_opts(png_uint_32 opts)
*/
#define FORMAT_COUNT 64
#define FORMAT_MASK 0x3f
-static PNG_CONST char * PNG_CONST format_names[FORMAT_COUNT] =
+static const char * const format_names[FORMAT_COUNT] =
{
"sRGB-gray",
"sRGB-gray+alpha",
@@ -2346,8 +2346,8 @@ static int
logpixel(const Transform *transform, png_uint_32 x, png_uint_32 y,
const Pixel *in, const Pixel *calc, const Pixel *out, const char *reason)
{
- const png_uint_32 in_format = transform->in_image->image.format;
- const png_uint_32 out_format = transform->out_image->image.format;
+ png_uint_32 in_format = transform->in_image->image.format;
+ png_uint_32 out_format = transform->out_image->image.format;
png_uint_32 back_format = out_format & ~PNG_FORMAT_FLAG_ALPHA;
const char *via_linear = "";
@@ -2602,12 +2602,12 @@ compare_two_images(Image *a, Image *b, int via_linear,
ptrdiff_t strideb = b->stride;
png_const_bytep rowa = a->buffer+16;
png_const_bytep rowb = b->buffer+16;
- const png_uint_32 width = a->image.width;
- const png_uint_32 height = a->image.height;
- const png_uint_32 formata = a->image.format;
- const png_uint_32 formatb = b->image.format;
- const unsigned int a_sample = PNG_IMAGE_SAMPLE_SIZE(formata);
- const unsigned int b_sample = PNG_IMAGE_SAMPLE_SIZE(formatb);
+ png_uint_32 width = a->image.width;
+ png_uint_32 height = a->image.height;
+ png_uint_32 formata = a->image.format;
+ png_uint_32 formatb = b->image.format;
+ unsigned int a_sample = PNG_IMAGE_SAMPLE_SIZE(formata);
+ unsigned int b_sample = PNG_IMAGE_SAMPLE_SIZE(formatb);
int alpha_added, alpha_removed;
int bchannels;
png_uint_32 y;
@@ -2726,7 +2726,7 @@ compare_two_images(Image *a, Image *b, int via_linear,
result = 0;
}
- /* If reqested copy the error values back from the Transform. */
+ /* If requested, copy the error values back from the Transform. */
if (a->opts & ACCUMULATE)
{
tr.error_ptr[0] = tr.error[0];
@@ -2790,8 +2790,7 @@ compare_two_images(Image *a, Image *b, int via_linear,
(formata & (formatb ^ PNG_FORMAT_FLAG_COLOR) & PNG_FORMAT_FLAG_COLOR)))
{
/* Was an alpha channel changed? */
- const png_uint_32 alpha_changed = (formata ^ formatb) &
- PNG_FORMAT_FLAG_ALPHA;
+ png_uint_32 alpha_changed = (formata ^ formatb) & PNG_FORMAT_FLAG_ALPHA;
/* Was an alpha channel removed? (The third test.) If so the direct
* comparison is only possible if the input alpha is opaque.
@@ -2932,7 +2931,7 @@ compare_two_images(Image *a, Image *b, int via_linear,
}
}
- /* If reqested copy the error values back from the Transform. */
+ /* If requested, copy the error values back from the Transform. */
if (a->opts & ACCUMULATE)
{
tr.error_ptr[0] = tr.error[0];
@@ -3627,7 +3626,7 @@ main(int argc, char **argv)
if (arg[0] == '-')
{
- const int term = (arg[1] == '0' ? 0 : '\n');
+ int term = (arg[1] == '0' ? 0 : '\n');
unsigned int ich = 0;
/* Loop reading files, use a static buffer to simplify this and just
diff --git a/Build/source/libs/libpng/libpng-src/contrib/libtests/pngunknown.c b/Build/source/libs/libpng/libpng-src/contrib/libtests/pngunknown.c
index d9cc4488b80..05bdd833dbc 100644
--- a/Build/source/libs/libpng/libpng-src/contrib/libtests/pngunknown.c
+++ b/Build/source/libs/libpng/libpng-src/contrib/libtests/pngunknown.c
@@ -56,7 +56,7 @@
defined(PNG_SAVE_UNKNOWN_CHUNKS_SUPPORTED)
#if PNG_LIBPNG_VER < 10500
-/* This deliberately lacks the PNG_CONST. */
+/* This deliberately lacks the const. */
typedef png_byte *png_const_bytep;
/* This is copied from 1.5.1 png.h: */
diff --git a/Build/source/libs/libpng/libpng-src/contrib/libtests/pngvalid.c b/Build/source/libs/libpng/libpng-src/contrib/libtests/pngvalid.c
index e66f2fa61ad..d800110c7a4 100644
--- a/Build/source/libs/libpng/libpng-src/contrib/libtests/pngvalid.c
+++ b/Build/source/libs/libpng/libpng-src/contrib/libtests/pngvalid.c
@@ -21,6 +21,7 @@
#define _POSIX_SOURCE 1
#define _ISOC99_SOURCE 1 /* For floating point */
#define _GNU_SOURCE 1 /* For the floating point exception extension */
+#define _BSD_SOURCE 1 /* For the floating point exception extension */
#include <signal.h>
#include <stdio.h>
@@ -961,7 +962,7 @@ bits_of(png_uint_32 num)
return b; /* 0..32 */
}
-/* Main interface to file storeage, after writing a new PNG file (see the API
+/* Main interface to file storage, after writing a new PNG file (see the API
* below) call store_storefile to store the result with the given name and id.
*/
static void
@@ -2589,7 +2590,7 @@ static double digitize(double value, int depth, int do_round)
* rounding and 'do_round' should be 1, if it is 0 the digitized value will
* be truncated.
*/
- const unsigned int digitization_factor = (1U << depth) -1;
+ unsigned int digitization_factor = (1U << depth) - 1;
/* Limiting the range is done as a convenience to the caller - it's easier to
* do it once here than every time at the call site.
@@ -3687,8 +3688,8 @@ init_standard_palette(png_store *ps, png_structp pp, png_infop pi, int npalette,
#ifdef PNG_WRITE_tRNS_SUPPORTED
static void
-set_random_tRNS(png_structp pp, png_infop pi, const png_byte colour_type,
- const int bit_depth)
+set_random_tRNS(png_structp pp, png_infop pi, png_byte colour_type,
+ int bit_depth)
{
/* To make this useful the tRNS color needs to match at least one pixel.
* Random values are fine for gray, including the 16-bit case where we know
@@ -3696,7 +3697,7 @@ set_random_tRNS(png_structp pp, png_infop pi, const png_byte colour_type,
* method as only 65536 different RGB values are generated.
*/
png_color_16 tRNS;
- const png_uint_16 mask = (png_uint_16)((1U << bit_depth)-1);
+ png_uint_16 mask = (png_uint_16)((1U << bit_depth)-1);
R8(tRNS); /* makes unset fields random */
@@ -4337,7 +4338,7 @@ make_size_image(png_store* const ps, png_byte const colour_type,
/* Make a name and get an appropriate id for the store: */
char name[FILE_NAME_SIZE];
- const png_uint_32 id = FILEID(colour_type, bit_depth, 0/*palette*/,
+ png_uint_32 id = FILEID(colour_type, bit_depth, 0/*palette*/,
interlace_type, w, h, do_interlace);
standard_name_from_id(name, sizeof name, 0, id);
@@ -4413,7 +4414,7 @@ make_size_image(png_store* const ps, png_byte const colour_type,
for (pass=0; pass<npasses; ++pass)
{
/* The following two are for checking the macros: */
- const png_uint_32 wPass = PNG_PASS_COLS(w, pass);
+ png_uint_32 wPass = PNG_PASS_COLS(w, pass);
/* If do_interlace is set we don't call png_write_row for every
* row because some of them are empty. In fact, for a 1x1 image,
@@ -4645,7 +4646,7 @@ make_error(png_store* const ps, png_byte const colour_type,
Try
{
png_infop pi;
- const png_structp pp = set_store_for_write(ps, &pi, name);
+ png_structp pp = set_store_for_write(ps, &pi, name);
png_uint_32 w, h;
gnu_volatile(pp)
@@ -4705,7 +4706,7 @@ make_error(png_store* const ps, png_byte const colour_type,
else
{
/* Now write the whole image, just to make sure that the detected, or
- * undetected, errro has not created problems inside libpng. This
+ * undetected, error has not created problems inside libpng. This
* doesn't work if there was a png_error in png_write_info because that
* can abort before PLTE was written.
*/
@@ -5468,14 +5469,14 @@ progressive_row(png_structp ppIn, png_bytep new_row, png_uint_32 y, int pass)
static void
sequential_row(standard_display *dp, png_structp pp, png_infop pi,
- const int iImage, const int iDisplay)
+ int iImage, int iDisplay)
{
- const int npasses = dp->npasses;
- const int do_interlace = dp->do_interlace &&
+ int npasses = dp->npasses;
+ int do_interlace = dp->do_interlace &&
dp->interlace_type == PNG_INTERLACE_ADAM7;
- const png_uint_32 height = standard_height(pp, dp->id);
- const png_uint_32 width = standard_width(pp, dp->id);
- const png_store* ps = dp->ps;
+ png_uint_32 height = standard_height(pp, dp->id);
+ png_uint_32 width = standard_width(pp, dp->id);
+ const png_store* ps = dp->ps;
int pass;
for (pass=0; pass<npasses; ++pass)
@@ -5869,7 +5870,7 @@ test_size(png_modifier* const pm, png_byte const colour_type,
*/
static const png_byte hinc[] = {1, 3, 11, 1, 5};
static const png_byte winc[] = {1, 9, 5, 7, 1};
- const int save_bdlo = bdlo;
+ int save_bdlo = bdlo;
for (; bdlo <= bdhi; ++bdlo)
{
@@ -6077,12 +6078,12 @@ image_pixel_init(image_pixel *this, png_const_bytep row, png_byte colour_type,
png_byte bit_depth, png_uint_32 x, store_palette palette,
const image_pixel *format /*from pngvalid transform of input*/)
{
- const png_byte sample_depth = (png_byte)(colour_type ==
- PNG_COLOR_TYPE_PALETTE ? 8 : bit_depth);
- const unsigned int max = (1U<<sample_depth)-1;
- const int swap16 = (format != 0 && format->swap16);
- const int littleendian = (format != 0 && format->littleendian);
- const int sig_bits = (format != 0 && format->sig_bits);
+ png_byte sample_depth =
+ (png_byte)(colour_type == PNG_COLOR_TYPE_PALETTE ? 8 : bit_depth);
+ unsigned int max = (1U<<sample_depth)-1;
+ int swap16 = (format != 0 && format->swap16);
+ int littleendian = (format != 0 && format->littleendian);
+ int sig_bits = (format != 0 && format->sig_bits);
/* Initially just set everything to the same number and the alpha to opaque.
* Note that this currently assumes a simple palette where entry x has colour
@@ -6100,7 +6101,7 @@ image_pixel_init(image_pixel *this, png_const_bytep row, png_byte colour_type,
/* This permits the caller to default to the sample value. */
if (palette != 0)
{
- const unsigned int i = this->palette_index;
+ unsigned int i = this->palette_index;
this->red = palette[i].red;
this->green = palette[i].green;
@@ -6431,8 +6432,8 @@ static void
image_transform_mod_end(const image_transform *this, image_pixel *that,
png_const_structp pp, const transform_display *display)
{
- const unsigned int scale = (1U<<that->sample_depth)-1;
- const int sig_bits = that->sig_bits;
+ unsigned int scale = (1U<<that->sample_depth)-1;
+ int sig_bits = that->sig_bits;
UNUSED(this)
UNUSED(pp)
@@ -6755,19 +6756,19 @@ transform_image_validate(transform_display *dp, png_const_structp pp,
{
/* Constants for the loop below: */
const png_store* const ps = dp->this.ps;
- const png_byte in_ct = dp->this.colour_type;
- const png_byte in_bd = dp->this.bit_depth;
- const png_uint_32 w = dp->this.w;
- const png_uint_32 h = dp->this.h;
- const png_byte out_ct = dp->output_colour_type;
- const png_byte out_bd = dp->output_bit_depth;
- const png_byte sample_depth = (png_byte)(out_ct ==
- PNG_COLOR_TYPE_PALETTE ? 8 : out_bd);
- const png_byte red_sBIT = dp->this.red_sBIT;
- const png_byte green_sBIT = dp->this.green_sBIT;
- const png_byte blue_sBIT = dp->this.blue_sBIT;
- const png_byte alpha_sBIT = dp->this.alpha_sBIT;
- const int have_tRNS = dp->this.is_transparent;
+ png_byte in_ct = dp->this.colour_type;
+ png_byte in_bd = dp->this.bit_depth;
+ png_uint_32 w = dp->this.w;
+ png_uint_32 h = dp->this.h;
+ png_byte out_ct = dp->output_colour_type;
+ png_byte out_bd = dp->output_bit_depth;
+ png_byte sample_depth =
+ (png_byte)(out_ct == PNG_COLOR_TYPE_PALETTE ? 8 : out_bd);
+ png_byte red_sBIT = dp->this.red_sBIT;
+ png_byte green_sBIT = dp->this.green_sBIT;
+ png_byte blue_sBIT = dp->this.blue_sBIT;
+ png_byte alpha_sBIT = dp->this.alpha_sBIT;
+ int have_tRNS = dp->this.is_transparent;
double digitization_error;
store_palette out_palette;
@@ -6928,7 +6929,7 @@ transform_end(png_structp ppIn, png_infop pi)
/* A single test run. */
static void
-transform_test(png_modifier *pmIn, const png_uint_32 idIn,
+transform_test(png_modifier *pmIn, png_uint_32 idIn,
const image_transform* transform_listIn, const char * const name)
{
transform_display d;
@@ -7763,7 +7764,7 @@ static void
image_transform_png_set_rgb_to_gray_set(const image_transform *this,
transform_display *that, png_structp pp, png_infop pi)
{
- const int error_action = 1; /* no error, no defines in png.h */
+ int error_action = 1; /* no error, no defines in png.h */
# ifdef PNG_FLOATING_POINT_SUPPORTED
png_set_rgb_to_gray(pp, error_action, data.red_to_set, data.green_to_set);
@@ -7904,10 +7905,10 @@ image_transform_png_set_rgb_to_gray_mod(const image_transform *this,
# if DIGITIZE
{
png_modifier *pm = display->pm;
- const unsigned int sample_depth = that->sample_depth;
- const unsigned int calc_depth = (pm->assume_16_bit_calculations ? 16 :
+ unsigned int sample_depth = that->sample_depth;
+ unsigned int calc_depth = (pm->assume_16_bit_calculations ? 16 :
sample_depth);
- const unsigned int gamma_depth =
+ unsigned int gamma_depth =
(sample_depth == 16 ?
display->max_gamma_8 :
(pm->assume_16_bit_calculations ?
@@ -8001,7 +8002,7 @@ image_transform_png_set_rgb_to_gray_mod(const image_transform *this,
b * data.blue_coefficient;
{
- const int do_round = data.gamma != 1 || calc_depth == 16;
+ int do_round = data.gamma != 1 || calc_depth == 16;
const double ce = 2. / 32768;
graylo = DD(rlo * (data.red_coefficient-ce) +
@@ -8625,7 +8626,7 @@ image_transform_png_set_filler_mod(const image_transform *this,
(that->colour_type == PNG_COLOR_TYPE_RGB ||
that->colour_type == PNG_COLOR_TYPE_GRAY))
{
- const unsigned int max = (1U << that->bit_depth)-1;
+ unsigned int max = (1U << that->bit_depth)-1;
that->alpha = data.filler & max;
that->alphaf = ((double)that->alpha) / max;
that->alphae = 0;
@@ -8692,7 +8693,7 @@ image_transform_png_set_add_alpha_mod(const image_transform *this,
(that->colour_type == PNG_COLOR_TYPE_RGB ||
that->colour_type == PNG_COLOR_TYPE_GRAY))
{
- const unsigned int max = (1U << that->bit_depth)-1;
+ unsigned int max = (1U << that->bit_depth)-1;
that->alpha = data.filler & max;
that->alphaf = ((double)that->alpha) / max;
that->alphae = 0;
@@ -8883,7 +8884,7 @@ image_transform_png_set_shift_set(const image_transform *this,
* field is randomized independently. This acts as a check that
* libpng does use the correct field.
*/
- const unsigned int depth = that->this.bit_depth;
+ unsigned int depth = that->this.bit_depth;
data.red = (png_byte)/*SAFE*/(random_mod(depth)+1);
data.green = (png_byte)/*SAFE*/(random_mod(depth)+1);
@@ -9298,12 +9299,12 @@ gamma_info_imp(gamma_display *dp, png_structp pp, png_infop pi)
int mode = dp->do_background - ALPHA_MODE_OFFSET;
/* The gamma value is the output gamma, and is in the standard,
- * non-inverted, represenation. It provides a default for the PNG file
+ * non-inverted, representation. It provides a default for the PNG file
* gamma, but since the file has a gAMA chunk this does not matter.
*/
const double sg = dp->screen_gamma;
# ifndef PNG_FLOATING_POINT_SUPPORTED
- const png_fixed_point g = fix(sg);
+ png_fixed_point g = fix(sg);
# endif
# ifdef PNG_FLOATING_POINT_SUPPORTED
@@ -9351,7 +9352,7 @@ gamma_info_imp(gamma_display *dp, png_structp pp, png_infop pi)
*/
const double bg = dp->background_gamma;
# ifndef PNG_FLOATING_POINT_SUPPORTED
- const png_fixed_point g = fix(bg);
+ png_fixed_point g = fix(bg);
# endif
# ifdef PNG_FLOATING_POINT_SUPPORTED
@@ -9425,7 +9426,7 @@ static void
init_validate_info(validate_info *vi, gamma_display *dp, png_const_structp pp,
int in_depth, int out_depth)
{
- const unsigned int outmax = (1U<<out_depth)-1;
+ unsigned int outmax = (1U<<out_depth)-1;
vi->pp = pp;
vi->dp = dp;
@@ -9587,14 +9588,14 @@ gamma_component_compose(int do_background, double input_sample, double alpha,
/* This API returns the encoded *input* component, in the range 0..1 */
static double
gamma_component_validate(const char *name, const validate_info *vi,
- const unsigned int id, const unsigned int od,
+ unsigned int id, unsigned int od,
const double alpha /* <0 for the alpha channel itself */,
const double background /* component background value */)
{
- const unsigned int isbit = id >> vi->isbit_shift;
- const unsigned int sbit_max = vi->sbit_max;
- const unsigned int outmax = vi->outmax;
- const int do_background = vi->do_background;
+ unsigned int isbit = id >> vi->isbit_shift;
+ unsigned int sbit_max = vi->sbit_max;
+ unsigned int outmax = vi->outmax;
+ int do_background = vi->do_background;
double i;
@@ -10160,13 +10161,13 @@ gamma_image_validate(gamma_display *dp, png_const_structp pp,
{
/* Get some constants derived from the input and output file formats: */
const png_store* const ps = dp->this.ps;
- const png_byte in_ct = dp->this.colour_type;
- const png_byte in_bd = dp->this.bit_depth;
- const png_uint_32 w = dp->this.w;
- const png_uint_32 h = dp->this.h;
+ png_byte in_ct = dp->this.colour_type;
+ png_byte in_bd = dp->this.bit_depth;
+ png_uint_32 w = dp->this.w;
+ png_uint_32 h = dp->this.h;
const size_t cbRow = dp->this.cbRow;
- const png_byte out_ct = png_get_color_type(pp, pi);
- const png_byte out_bd = png_get_bit_depth(pp, pi);
+ png_byte out_ct = png_get_color_type(pp, pi);
+ png_byte out_bd = png_get_bit_depth(pp, pi);
/* There are three sources of error, firstly the quantization in the
* file encoding, determined by sbit and/or the file depth, secondly
@@ -10207,11 +10208,11 @@ gamma_image_validate(gamma_display *dp, png_const_structp pp,
* The basic tests below do not do this, however if 'use_input_precision'
* is set a subsequent test is performed above.
*/
- const unsigned int samples_per_pixel = (out_ct & 2U) ? 3U : 1U;
+ unsigned int samples_per_pixel = (out_ct & 2U) ? 3U : 1U;
int processing;
png_uint_32 y;
const store_palette_entry *in_palette = dp->this.palette;
- const int in_is_transparent = dp->this.is_transparent;
+ int in_is_transparent = dp->this.is_transparent;
int process_tRNS;
int out_npalette = -1;
int out_is_transparent = 0; /* Just refers to the palette case */
@@ -10259,9 +10260,9 @@ gamma_image_validate(gamma_display *dp, png_const_structp pp,
double alpha = 1; /* serves as a flag value */
/* Record the palette index for index images. */
- const unsigned int in_index =
+ unsigned int in_index =
in_ct == 3 ? sample(std, 3, in_bd, x, 0, 0, 0) : 256;
- const unsigned int out_index =
+ unsigned int out_index =
out_ct == 3 ? sample(std, 3, out_bd, x, 0, 0, 0) : 256;
/* Handle input alpha - png_set_background will cause the output
@@ -10270,7 +10271,7 @@ gamma_image_validate(gamma_display *dp, png_const_structp pp,
if ((in_ct & PNG_COLOR_MASK_ALPHA) != 0 ||
(in_ct == 3 && in_is_transparent))
{
- const unsigned int input_alpha = in_ct == 3 ?
+ unsigned int input_alpha = in_ct == 3 ?
dp->this.palette[in_index].alpha :
sample(std, in_ct, in_bd, x, samples_per_pixel, 0, 0);
@@ -10395,14 +10396,14 @@ gamma_end(png_structp ppIn, png_infop pi)
* maxpc: maximum percentage error (as a percentage)
*/
static void
-gamma_test(png_modifier *pmIn, const png_byte colour_typeIn,
- const png_byte bit_depthIn, const int palette_numberIn,
- const int interlace_typeIn,
+gamma_test(png_modifier *pmIn, png_byte colour_typeIn,
+ png_byte bit_depthIn, int palette_numberIn,
+ int interlace_typeIn,
const double file_gammaIn, const double screen_gammaIn,
- const png_byte sbitIn, const int threshold_testIn,
+ png_byte sbitIn, int threshold_testIn,
const char *name,
- const int use_input_precisionIn, const int scale16In,
- const int expand16In, const int do_backgroundIn,
+ int use_input_precisionIn, int scale16In,
+ int expand16In, int do_backgroundIn,
const png_color_16 *bkgd_colorIn, double bkgd_gammaIn)
{
gamma_display d;
@@ -10606,11 +10607,11 @@ perform_gamma_threshold_tests(png_modifier *pm)
}
static void gamma_transform_test(png_modifier *pm,
- const png_byte colour_type, const png_byte bit_depth,
- const int palette_number,
- const int interlace_type, const double file_gamma,
- const double screen_gamma, const png_byte sbit,
- const int use_input_precision, const int scale16)
+ png_byte colour_type, png_byte bit_depth,
+ int palette_number,
+ int interlace_type, const double file_gamma,
+ const double screen_gamma, png_byte sbit,
+ int use_input_precision, int scale16)
{
size_t pos = 0;
char name[64];
@@ -10767,12 +10768,12 @@ static void perform_gamma_scale16_tests(png_modifier *pm)
#if defined(PNG_READ_BACKGROUND_SUPPORTED) ||\
defined(PNG_READ_ALPHA_MODE_SUPPORTED)
static void gamma_composition_test(png_modifier *pm,
- const png_byte colour_type, const png_byte bit_depth,
- const int palette_number,
- const int interlace_type, const double file_gamma,
+ png_byte colour_type, png_byte bit_depth,
+ int palette_number,
+ int interlace_type, const double file_gamma,
const double screen_gamma,
- const int use_input_precision, const int do_background,
- const int expand_16)
+ int use_input_precision, int do_background,
+ int expand_16)
{
size_t pos = 0;
png_const_charp base;
diff --git a/Build/source/libs/libpng/libpng-src/contrib/libtests/tarith.c b/Build/source/libs/libpng/libpng-src/contrib/libtests/tarith.c
index c95226f030a..c03f05a80bd 100644
--- a/Build/source/libs/libpng/libpng-src/contrib/libtests/tarith.c
+++ b/Build/source/libs/libpng/libpng-src/contrib/libtests/tarith.c
@@ -331,8 +331,8 @@ static int check_one_character(checkfp_command *co, checkfp_control c, int ch)
*/
size_t index = 0;
const char test = (char)ch;
- const int number_is_valid = png_check_fp_number(&test, 1, &c.state, &index);
- const int character_accepted = (index == 1);
+ int number_is_valid = png_check_fp_number(&test, 1, &c.state, &index);
+ int character_accepted = (index == 1);
if (c.check_state != exponent && isdigit(ch) && ch != '0')
c.is_zero = 0;
diff --git a/Build/source/libs/libpng/libpng-src/contrib/powerpc-vsx/linux_aux.c b/Build/source/libs/libpng/libpng-src/contrib/powerpc-vsx/linux_aux.c
index 796922d77c1..7828acafb84 100644
--- a/Build/source/libs/libpng/libpng-src/contrib/powerpc-vsx/linux_aux.c
+++ b/Build/source/libs/libpng/libpng-src/contrib/powerpc-vsx/linux_aux.c
@@ -23,14 +23,12 @@
static int
png_have_vsx(png_structp png_ptr)
{
-
- const unsigned long auxv = getauxval( AT_HWCAP );
+ unsigned long auxv = getauxval(AT_HWCAP);
PNG_UNUSED(png_ptr)
- if(auxv & (PPC_FEATURE_HAS_ALTIVEC|PPC_FEATURE_HAS_VSX ))
+ if(auxv & (PPC_FEATURE_HAS_ALTIVEC|PPC_FEATURE_HAS_VSX))
return 1;
else
return 0;
}
-
diff --git a/Build/source/libs/libpng/libpng-src/contrib/tools/makesRGB.c b/Build/source/libs/libpng/libpng-src/contrib/tools/makesRGB.c
index e66c9f1576b..d0c0ca93149 100644
--- a/Build/source/libs/libpng/libpng-src/contrib/tools/makesRGB.c
+++ b/Build/source/libs/libpng/libpng-src/contrib/tools/makesRGB.c
@@ -388,7 +388,7 @@ main(int argc, char **argv)
if (!test_only)
{
- printf("PNG_CONST png_uint_16 png_sRGB_table[256] =\n{\n ");
+ printf("const png_uint_16 png_sRGB_table[256] =\n{\n ");
for (i=0; i<255; )
{
do
@@ -401,7 +401,7 @@ main(int argc, char **argv)
printf("%d\n};\n\n", png_sRGB_table[i]);
- printf("PNG_CONST png_uint_16 png_sRGB_base[512] =\n{\n ");
+ printf("const png_uint_16 png_sRGB_base[512] =\n{\n ");
for (i=0; i<511; )
{
do
@@ -413,7 +413,7 @@ main(int argc, char **argv)
}
printf("%d\n};\n\n", png_sRGB_base[i]);
- printf("PNG_CONST png_byte png_sRGB_delta[512] =\n{\n ");
+ printf("const png_byte png_sRGB_delta[512] =\n{\n ");
for (i=0; i<511; )
{
do
diff --git a/Build/source/libs/libpng/libpng-src/contrib/tools/pngcp.c b/Build/source/libs/libpng/libpng-src/contrib/tools/pngcp.c
index f6a0d50f436..16d4e7f4d1c 100644
--- a/Build/source/libs/libpng/libpng-src/contrib/tools/pngcp.c
+++ b/Build/source/libs/libpng/libpng-src/contrib/tools/pngcp.c
@@ -735,7 +735,7 @@ option_index(struct display *dp, const char *opt, size_t len)
static int
get_option(struct display *dp, const char *opt, int *value)
{
- const png_byte i = option_index(dp, opt, strlen(opt));
+ png_byte i = option_index(dp, opt, strlen(opt));
if (dp->entry[i]) /* option was set on command line */
{
@@ -789,7 +789,7 @@ record_opt(struct display *dp, png_byte opt, const char *entry_name)
* numerical value.
*/
{
- const unsigned int sp = dp->csp; /* stack entry of next searched option */
+ unsigned int sp = dp->csp; /* stack entry of next searched option */
if (sp >= dp->tsp)
{
@@ -797,7 +797,7 @@ record_opt(struct display *dp, png_byte opt, const char *entry_name)
* searched entry or the start of the dp->curr buffer if there is nothing
* on the stack yet (sp == 0).
*/
- const int offset = set_opt_string_(dp, sp, opt, entry_name);
+ int offset = set_opt_string_(dp, sp, opt, entry_name);
if (sp > 0)
dp->stack[sp-1].opt_string_end = offset;
@@ -1222,7 +1222,7 @@ advance_opt(struct display *dp, png_byte opt, int search)
}
static int
-getallopts_(struct display *dp, const png_byte opt, int *value, int record)
+getallopts_(struct display *dp, png_byte opt, int *value, int record)
/* Like getop but iterate over all the values if the option was set to "all".
*/
{
@@ -1259,7 +1259,7 @@ getsearchopts(struct display *dp, const char *opt_str, int *value)
/* As above except that if the option was not set try a search */
{
png_byte istrat;
- const png_byte opt = option_index(dp, opt_str, strlen(opt_str));
+ png_byte opt = option_index(dp, opt_str, strlen(opt_str));
int record = options[opt].search;
const char *entry_name;
@@ -2220,7 +2220,7 @@ cp_one_file(struct display *dp, const char *filename, const char *destname)
strcpy(dp->best, dp->curr);
dp->best_size = dp->write_size;
- if (dp->nsp > 0) /* interating over lists */
+ if (dp->nsp > 0) /* iterating over lists */
{
char *tmpname, tmpbuf[(sizeof dp->namebuf) + 4];
assert(dp->curr[0] == ' ' && dp->tsp > 0);
@@ -2302,7 +2302,7 @@ cppng(struct display *dp, const char *file, const char *gv dest)
}
int
-main(const int argc, const char * const * const argv)
+main(int argc, char **argv)
{
/* For each file on the command line test it with a range of transforms */
int option_end;
@@ -2379,7 +2379,7 @@ main(const int argc, const char * const * const argv)
/* Here on any return, including failures, except user/internal issues
*/
{
- const int pass = (d.options & STRICT) ?
+ int pass = (d.options & STRICT) ?
RESULT_STRICT(d.results) : RESULT_RELAXED(d.results);
if (!pass)
diff --git a/Build/source/libs/libpng/libpng-src/contrib/tools/pngfix.c b/Build/source/libs/libpng/libpng-src/contrib/tools/pngfix.c
index f494230d8ce..2fa5d13eaf8 100644
--- a/Build/source/libs/libpng/libpng-src/contrib/tools/pngfix.c
+++ b/Build/source/libs/libpng/libpng-src/contrib/tools/pngfix.c
@@ -772,7 +772,7 @@ skip_chunk_type(const struct global *global, png_uint_32 type)
return 0;
/* Chunks that specify gamma encoding which should therefore only be
- * removed the the user insists:
+ * removed if the user insists:
*/
case png_gAMA: case png_sRGB:
if (global->skip >= SKIP_ALL)
@@ -2514,7 +2514,7 @@ zlib_run(struct zlib *zlib)
*/
for (;;)
{
- const unsigned int count = list->count;
+ unsigned int count = list->count;
unsigned int i;
for (i = 0; i<count; ++i)
@@ -2791,7 +2791,7 @@ process_chunk(struct file *file, png_uint_32 file_crc, png_uint_32 next_length,
* to read_chunk.
*/
{
- const png_uint_32 type = file->type;
+ png_uint_32 type = file->type;
if (file->global->verbose > 1)
{
@@ -3152,7 +3152,7 @@ read_chunk(struct file *file)
}
}
- /* Control gets to here if the the stream seems invalid or damaged in some
+ /* Control gets to here if the stream seems invalid or damaged in some
* way. Either there was a problem reading all the expected data (this
* chunk's data, its CRC and the length and type of the next chunk) or the
* next chunk length/type are invalid. Notice that the cases that end up
@@ -3710,7 +3710,7 @@ usage(const char *prog)
" practice most programs will ignore it.",
" bKGD [transform]: This is used by libpng transforms."
" --max=<number>:",
-" Use IDAT chunks sized <number>. If no number is given the the IDAT",
+" Use IDAT chunks sized <number>. If no number is given the IDAT",
" chunks will be the maximum size permitted; 2^31-1 bytes. If the option",
" is omitted the original chunk sizes will not be changed. When the",
" option is given --strip=unsafe is set automatically. This may be",