diff options
author | Thomas Deutschmann <whissi@gentoo.org> | 2020-03-19 13:53:45 +0100 |
---|---|---|
committer | Thomas Deutschmann <whissi@gentoo.org> | 2020-08-13 11:28:25 +0200 |
commit | dc2ba49207af71193f1390d84bba4e15aeea0ce0 (patch) | |
tree | 79c2a51cb5fa2b87800b1113e0015a7108cd2eb3 /libpng/contrib/libtests/pngstest.c | |
parent | Import Ghostscript 9.50 (diff) | |
download | ghostscript-gpl-patches-dc2ba49207af71193f1390d84bba4e15aeea0ce0.tar.gz ghostscript-gpl-patches-dc2ba49207af71193f1390d84bba4e15aeea0ce0.tar.bz2 ghostscript-gpl-patches-dc2ba49207af71193f1390d84bba4e15aeea0ce0.zip |
Import Ghostscript 9.52ghostscript-9.52
Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
Diffstat (limited to 'libpng/contrib/libtests/pngstest.c')
-rw-r--r-- | libpng/contrib/libtests/pngstest.c | 39 |
1 files changed, 19 insertions, 20 deletions
diff --git a/libpng/contrib/libtests/pngstest.c b/libpng/contrib/libtests/pngstest.c index ab450893..a368bf0f 100644 --- a/libpng/contrib/libtests/pngstest.c +++ b/libpng/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", @@ -578,11 +578,11 @@ typedef struct int stride_extra; FILE *input_file; png_voidp input_memory; - png_size_t input_memory_size; + size_t input_memory_size; png_bytep buffer; ptrdiff_t stride; - png_size_t bufsize; - png_size_t allocsize; + size_t bufsize; + size_t allocsize; char tmpfile_name[32]; png_uint_16 colormap[256*4]; } @@ -665,7 +665,7 @@ static void initimage(Image *image, png_uint_32 opts, const char *file_name, static void allocbuffer(Image *image) { - png_size_t size = PNG_IMAGE_BUFFER_SIZE(image->image, image->stride); + size_t size = PNG_IMAGE_BUFFER_SIZE(image->image, image->stride); if (size+32 > image->bufsize) { @@ -1142,7 +1142,7 @@ get_pixel(png_uint_32 format))(Pixel *p, png_const_voidp pb) } } -/* Convertion between pixel formats. The code above effectively eliminates the +/* Conversion between pixel formats. The code above effectively eliminates the * component ordering changes leaving three basic changes: * * 1) Remove an alpha channel by pre-multiplication or compositing on a @@ -2036,7 +2036,7 @@ typedef struct /* Precalculated values: */ int in_opaque; /* Value of input alpha that is opaque */ int is_palette; /* Sample values come from the palette */ - int accumulate; /* Accumlate component errors (don't log) */ + int accumulate; /* Accumulate component errors (don't log) */ int output_8bit; /* Output is 8-bit (else 16-bit) */ void (*in_gp)(Pixel*, png_const_voidp); @@ -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 |