summaryrefslogtreecommitdiff
path: root/Build/source/libs/libpng/libpng-src/contrib/libtests/pngvalid.c
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/libs/libpng/libpng-src/contrib/libtests/pngvalid.c')
-rw-r--r--Build/source/libs/libpng/libpng-src/contrib/libtests/pngvalid.c73
1 files changed, 36 insertions, 37 deletions
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 4dc4f844765..e66f2fa61ad 100644
--- a/Build/source/libs/libpng/libpng-src/contrib/libtests/pngvalid.c
+++ b/Build/source/libs/libpng/libpng-src/contrib/libtests/pngvalid.c
@@ -102,7 +102,7 @@ typedef png_byte *png_const_bytep;
#define PNG_WRITE_16BIT_SUPPORTED
#define PNG_READ_16BIT_SUPPORTED
-/* This comes from pnglibconf.h afer 1.5: */
+/* This comes from pnglibconf.h after 1.5: */
#define PNG_FP_1 100000
#define PNG_GAMMA_THRESHOLD_FIXED\
((png_fixed_point)(PNG_GAMMA_THRESHOLD * PNG_FP_1))
@@ -711,7 +711,7 @@ typedef struct png_store_file
unsigned int IDAT_bits; /* Number of bits in IDAT size */
png_uint_32 IDAT_size; /* Total size of IDAT data */
png_uint_32 id; /* must be correct (see FILEID) */
- png_size_t datacount; /* In this (the last) buffer */
+ size_t datacount; /* In this (the last) buffer */
png_store_buffer data; /* Last buffer in file */
int npalette; /* Number of entries in palette */
store_palette_entry* palette; /* May be NULL */
@@ -777,10 +777,10 @@ typedef struct png_store
png_infop piread;
png_store_file* current; /* Set when reading */
png_store_buffer* next; /* Set when reading */
- png_size_t readpos; /* Position in *next */
+ size_t readpos; /* Position in *next */
png_byte* image; /* Buffer for reading interlaced images */
- png_size_t cb_image; /* Size of this buffer */
- png_size_t cb_row; /* Row size of the image(s) */
+ size_t cb_image; /* Size of this buffer */
+ size_t cb_row; /* Row size of the image(s) */
uLong IDAT_crc;
png_uint_32 IDAT_len; /* Used when re-chunking IDAT chunks */
png_uint_32 IDAT_pos; /* Used when re-chunking IDAT chunks */
@@ -791,7 +791,7 @@ typedef struct png_store
png_store_file* saved;
png_structp pwrite; /* Used when writing a new file */
png_infop piwrite;
- png_size_t writepos; /* Position in .new */
+ size_t writepos; /* Position in .new */
char wname[FILE_NAME_SIZE];
png_store_buffer new; /* The end of the new PNG file being written. */
store_pool write_memory_pool;
@@ -1125,7 +1125,7 @@ static png_bytep
store_image_row(const png_store* ps, png_const_structp pp, int nImage,
png_uint_32 y)
{
- png_size_t coffset = (nImage * ps->image_h + y) * (ps->cb_row + 5) + 2;
+ size_t coffset = (nImage * ps->image_h + y) * (ps->cb_row + 5) + 2;
if (ps->image == NULL)
png_error(pp, "no allocated image");
@@ -1160,9 +1160,9 @@ store_image_free(png_store *ps, png_const_structp pp)
static void
store_ensure_image(png_store *ps, png_const_structp pp, int nImages,
- png_size_t cbRow, png_uint_32 cRows)
+ size_t cbRow, png_uint_32 cRows)
{
- png_size_t cb = nImages * cRows * (cbRow + 5);
+ size_t cb = nImages * cRows * (cbRow + 5);
if (ps->cb_image < cb)
{
@@ -1234,7 +1234,7 @@ store_image_check(const png_store* ps, png_const_structp pp, int iImage)
png_error(pp, "image overwrite");
else
{
- png_size_t cbRow = ps->cb_row;
+ size_t cbRow = ps->cb_row;
png_uint_32 rows = ps->image_h;
image += iImage * (cbRow+5) * ps->image_h;
@@ -1278,7 +1278,7 @@ valid_chunktype(png_uint_32 chunktype)
}
static void PNGCBAPI
-store_write(png_structp ppIn, png_bytep pb, png_size_t st)
+store_write(png_structp ppIn, png_bytep pb, size_t st)
{
png_const_structp pp = ppIn;
png_store *ps = voidcast(png_store*, png_get_io_ptr(pp));
@@ -1346,13 +1346,13 @@ store_write(png_structp ppIn, png_bytep pb, png_size_t st)
else /* chunkpos >= 8 */
{
- png_size_t cb = st;
+ size_t cb = st;
if (cb > STORE_BUFFER_SIZE - writepos)
cb = STORE_BUFFER_SIZE - writepos;
if (cb > chunklen - chunkpos/* bytes left in chunk*/)
- cb = (png_size_t)/*SAFE*/(chunklen - chunkpos);
+ cb = (size_t)/*SAFE*/(chunklen - chunkpos);
memcpy(ps->new.buffer + writepos, pb, cb);
chunkpos += (png_uint_32)/*SAFE*/cb;
@@ -1440,7 +1440,7 @@ store_read_buffer_next(png_store *ps)
* during progressive read, where the io_ptr is set internally by libpng.
*/
static void
-store_read_imp(png_store *ps, png_bytep pb, png_size_t st)
+store_read_imp(png_store *ps, png_bytep pb, size_t st)
{
if (ps->current == NULL || ps->next == NULL)
png_error(ps->pread, "store state damaged");
@@ -1463,14 +1463,13 @@ store_read_imp(png_store *ps, png_bytep pb, png_size_t st)
}
}
-static png_size_t
-store_read_chunk(png_store *ps, png_bytep pb, const png_size_t max,
- const png_size_t min)
+static size_t
+store_read_chunk(png_store *ps, png_bytep pb, size_t max, size_t min)
{
png_uint_32 chunklen = ps->chunklen;
png_uint_32 chunktype = ps->chunktype;
png_uint_32 chunkpos = ps->chunkpos;
- png_size_t st = max;
+ size_t st = max;
if (st > 0) do
{
@@ -1601,8 +1600,8 @@ store_read_chunk(png_store *ps, png_bytep pb, const png_size_t max,
store_read_imp(ps, pb, avail);
ps->IDAT_crc = crc32(ps->IDAT_crc, pb, avail);
- pb += (png_size_t)/*SAFE*/avail;
- st -= (png_size_t)/*SAFE*/avail;
+ pb += (size_t)/*SAFE*/avail;
+ st -= (size_t)/*SAFE*/avail;
chunkpos += (png_uint_32)/*SAFE*/avail;
IDAT_size -= (png_uint_32)/*SAFE*/avail;
IDAT_pos += (png_uint_32)/*SAFE*/avail;
@@ -1669,10 +1668,10 @@ store_read_chunk(png_store *ps, png_bytep pb, const png_size_t max,
else /* Return chunk bytes, including the CRC */
{
- png_size_t avail = st;
+ size_t avail = st;
if (avail > chunklen - chunkpos)
- avail = (png_size_t)/*SAFE*/(chunklen - chunkpos);
+ avail = (size_t)/*SAFE*/(chunklen - chunkpos);
store_read_imp(ps, pb, avail);
pb += avail;
@@ -1698,7 +1697,7 @@ store_read_chunk(png_store *ps, png_bytep pb, const png_size_t max,
}
static void PNGCBAPI
-store_read(png_structp ppIn, png_bytep pb, png_size_t st)
+store_read(png_structp ppIn, png_bytep pb, size_t st)
{
png_const_structp pp = ppIn;
png_store *ps = voidcast(png_store*, png_get_io_ptr(pp));
@@ -1724,7 +1723,7 @@ store_progressive_read(png_store *ps, png_structp pp, png_infop pi)
while (store_read_buffer_avail(ps) > 0)
{
static png_uint_32 noise = 2;
- png_size_t cb;
+ size_t cb;
png_byte buffer[512];
/* Generate 15 more bits of stuff: */
@@ -2991,7 +2990,7 @@ modifier_setbuffer(png_modifier *pm)
* png_struct.
*/
static void
-modifier_read_imp(png_modifier *pm, png_bytep pb, png_size_t st)
+modifier_read_imp(png_modifier *pm, png_bytep pb, size_t st)
{
while (st > 0)
{
@@ -3137,7 +3136,7 @@ modifier_read_imp(png_modifier *pm, png_bytep pb, png_size_t st)
*/
if (len+12 <= sizeof pm->buffer)
{
- png_size_t s = len+12-pm->buffer_count;
+ size_t s = len+12-pm->buffer_count;
store_read_chunk(&pm->this, pm->buffer+pm->buffer_count, s, s);
pm->buffer_count = len+12;
@@ -3196,7 +3195,7 @@ modifier_read_imp(png_modifier *pm, png_bytep pb, png_size_t st)
/* The callback: */
static void PNGCBAPI
-modifier_read(png_structp ppIn, png_bytep pb, png_size_t st)
+modifier_read(png_structp ppIn, png_bytep pb, size_t st)
{
png_const_structp pp = ppIn;
png_modifier *pm = voidcast(png_modifier*, png_get_io_ptr(pp));
@@ -3226,7 +3225,7 @@ modifier_progressive_read(png_modifier *pm, png_structp pp, png_infop pi)
for (;;)
{
static png_uint_32 noise = 1;
- png_size_t cb, cbAvail;
+ size_t cb, cbAvail;
png_byte buffer[512];
/* Generate 15 more bits of stuff: */
@@ -5001,7 +5000,7 @@ standard_display_init(standard_display *dp, png_store* ps, png_uint_32 id,
dp->npalette = 0;
/* Preset the transparent color to black: */
memset(&dp->transparent, 0, sizeof dp->transparent);
- /* Preset the palette to full intensity/opaque througout: */
+ /* Preset the palette to full intensity/opaque throughout: */
memset(dp->palette, 0xff, sizeof dp->palette);
}
@@ -5270,7 +5269,7 @@ standard_info_part1(standard_display *dp, png_structp pp, png_infop pi)
*/
standard_palette_validate(dp, pp, pi);
- /* In any case always check for a tranparent color (notice that the
+ /* In any case always check for a transparent color (notice that the
* colour type 3 case must not give a successful return on the get_tRNS call
* with these arguments!)
*/
@@ -6780,7 +6779,7 @@ transform_image_validate(transform_display *dp, png_const_structp pp,
store_image_check(dp->this.ps, pp, 0);
/* Read the palette corresponding to the output if the output colour type
- * indicates a palette, othewise set out_palette to garbage.
+ * indicates a palette, otherwise set out_palette to garbage.
*/
if (out_ct == PNG_COLOR_TYPE_PALETTE)
{
@@ -7991,7 +7990,7 @@ image_transform_png_set_rgb_to_gray_mod(const image_transform *this,
/* Now calculate the actual gray values. Although the error in the
* coefficients depends on whether they were specified on the command
* line (in which case truncation to 15 bits happened) or not (rounding
- * was used) the maxium error in an individual coefficient is always
+ * was used) the maximum error in an individual coefficient is always
* 2/32768, because even in the rounding case the requirement that
* coefficients add up to 32768 can cause a larger rounding error.
*
@@ -8207,7 +8206,7 @@ image_transform_png_set_rgb_to_gray_mod(const image_transform *this,
that->bluef = that->greenf = that->redf = gray;
that->bluee = that->greene = that->rede = err;
- /* The sBIT is the minium of the three colour channel sBITs. */
+ /* The sBIT is the minimum of the three colour channel sBITs. */
if (that->red_sBIT > that->green_sBIT)
that->red_sBIT = that->green_sBIT;
if (that->red_sBIT > that->blue_sBIT)
@@ -9746,7 +9745,7 @@ gamma_component_validate(const char *name, const validate_info *vi,
*
* pngvalid calculations:
* input_sample: linear result; i linearized and composed, range 0..1
- * encoded_sample: encoded result; input_sample scaled to ouput bit depth
+ * encoded_sample: encoded result; input_sample scaled to output bit depth
*
* libpng calculations:
* output: linear result; od scaled to 0..1 and linearized
@@ -10183,10 +10182,10 @@ gamma_image_validate(gamma_display *dp, png_const_structp pp,
* Since the library must quantize the output to 8 or 16 bits there is
* a fundamental limit on the accuracy of the output of +/-.5 - this
* quantization limit is included in addition to the other limits
- * specified by the paramaters to the API. (Effectively, add .5
+ * specified by the parameters to the API. (Effectively, add .5
* everywhere.)
*
- * The behavior of the 'sbit' paramter is defined by section 12.5
+ * The behavior of the 'sbit' parameter is defined by section 12.5
* (sample depth scaling) of the PNG spec. That section forces the
* decoder to assume that the PNG values have been scaled if sBIT is
* present:
@@ -11729,7 +11728,7 @@ int main(int argc, char **argv)
/* Some default values (set the behavior for 'make check' here).
* These values simply control the maximum error permitted in the gamma
- * transformations. The practial limits for human perception are described
+ * transformations. The practical limits for human perception are described
* below (the setting for maxpc16), however for 8 bit encodings it isn't
* possible to meet the accepted capabilities of human vision - i.e. 8 bit
* images can never be good enough, regardless of encoding.