[libpng16] Use parentheses consistently in "#if defined()" tests.
Folded some long lines.
This commit is contained in:
parent
9e8fd50d76
commit
b4ef7c4af2
@ -83,7 +83,7 @@
|
||||
#include <math.h>
|
||||
#include <errno.h>
|
||||
|
||||
#if (defined HAVE_CONFIG_H) && !(defined PNG_NO_CONFIG_H)
|
||||
#if defined(HAVE_CONFIG_H) && !defined(PNG_NO_CONFIG_H)
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
|
@ -22,7 +22,7 @@
|
||||
#include <ctype.h>
|
||||
#include <math.h>
|
||||
|
||||
#if (defined HAVE_CONFIG_H) && !(defined PNG_NO_CONFIG_H)
|
||||
#if defined(HAVE_CONFIG_H) && !defined(PNG_NO_CONFIG_H)
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
|
@ -26,7 +26,7 @@
|
||||
#include <signal.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#if (defined HAVE_CONFIG_H) && !(defined PNG_NO_CONFIG_H)
|
||||
#if defined(HAVE_CONFIG_H) && !defined(PNG_NO_CONFIG_H)
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
@ -1999,8 +1999,8 @@ static double digitize(PNG_CONST png_modifier *pm, double value,
|
||||
}
|
||||
#endif
|
||||
|
||||
#if (defined PNG_READ_GAMMA_SUPPORTED) ||\
|
||||
(defined PNG_READ_RGB_TO_GRAY_SUPPORTED)
|
||||
#if defined(PNG_READ_GAMMA_SUPPORTED) ||\
|
||||
defined(PNG_READ_RGB_TO_GRAY_SUPPORTED)
|
||||
static double abserr(PNG_CONST png_modifier *pm, int in_depth, int out_depth)
|
||||
{
|
||||
/* Absolute error permitted in linear values - affected by the bit depth of
|
||||
@ -3357,7 +3357,7 @@ make_transform_image(png_store* PNG_CONST ps, png_byte PNG_CONST colour_type,
|
||||
PNG_COMPRESSION_TYPE_BASE, PNG_FILTER_TYPE_BASE);
|
||||
|
||||
#ifdef PNG_TEXT_SUPPORTED
|
||||
# if (defined PNG_READ_zTXt_SUPPORTED) && (defined PNG_WRITE_zTXt_SUPPORTED)
|
||||
# if defined(PNG_READ_zTXt_SUPPORTED) && defined(PNG_WRITE_zTXt_SUPPORTED)
|
||||
# define TEXT_COMPRESSION PNG_TEXT_COMPRESSION_zTXt
|
||||
# else
|
||||
# define TEXT_COMPRESSION PNG_TEXT_COMPRESSION_NONE
|
||||
@ -8895,8 +8895,8 @@ static void perform_gamma_scale16_tests(png_modifier *pm)
|
||||
}
|
||||
#endif /* 16 to 8 bit conversion */
|
||||
|
||||
#if defined PNG_READ_BACKGROUND_SUPPORTED ||\
|
||||
defined PNG_READ_ALPHA_MODE_SUPPORTED
|
||||
#if defined(PNG_READ_BACKGROUND_SUPPORTED) ||\
|
||||
defined(PNG_READ_ALPHA_MODE_SUPPORTED)
|
||||
static void gamma_composition_test(png_modifier *pm,
|
||||
PNG_CONST png_byte colour_type, PNG_CONST png_byte bit_depth,
|
||||
PNG_CONST int palette_number,
|
||||
|
@ -18,7 +18,7 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#if (defined HAVE_CONFIG_H) && !(defined PNG_NO_CONFIG_H)
|
||||
#if defined(HAVE_CONFIG_H) && !defined(PNG_NO_CONFIG_H)
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
|
@ -22,7 +22,7 @@
|
||||
|
||||
#include <time.h>
|
||||
|
||||
#if (defined HAVE_CONFIG_H) && !(defined PNG_NO_CONFIG_H)
|
||||
#if defined(HAVE_CONFIG_H) && !defined(PNG_NO_CONFIG_H)
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
|
6
png.c
6
png.c
@ -1407,8 +1407,10 @@ png_XYZ_from_xy(png_XYZ *XYZ, const png_xy *xy)
|
||||
red_inverse))
|
||||
return 1;
|
||||
|
||||
if (!png_muldiv(&XYZ->green_X, xy->greenx, PNG_FP_1, green_inverse)) return 1;
|
||||
if (!png_muldiv(&XYZ->green_Y, xy->greeny, PNG_FP_1, green_inverse)) return 1;
|
||||
if (!png_muldiv(&XYZ->green_X, xy->greenx, PNG_FP_1, green_inverse))
|
||||
return 1;
|
||||
if (!png_muldiv(&XYZ->green_Y, xy->greeny, PNG_FP_1, green_inverse))
|
||||
return 1;
|
||||
if (!png_muldiv(&XYZ->green_Z, PNG_FP_1 - xy->greenx - xy->greeny, PNG_FP_1,
|
||||
green_inverse))
|
||||
return 1;
|
||||
|
14
png.h
14
png.h
@ -1,7 +1,7 @@
|
||||
|
||||
/* png.h - header file for PNG reference library
|
||||
*
|
||||
* libpng version 1.6.1beta02 - February 16, 2013
|
||||
* libpng version 1.6.1beta02 - February 17, 2013
|
||||
* Copyright (c) 1998-2013 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||
@ -11,7 +11,7 @@
|
||||
* Authors and maintainers:
|
||||
* libpng versions 0.71, May 1995, through 0.88, January 1996: Guy Schalnat
|
||||
* libpng versions 0.89c, June 1996, through 0.96, May 1997: Andreas Dilger
|
||||
* libpng versions 0.97, January 1998, through 1.6.1beta02 - February 16, 2013: Glenn
|
||||
* libpng versions 0.97, January 1998, through 1.6.1beta02 - February 17, 2013: Glenn
|
||||
* See also "Contributing Authors", below.
|
||||
*
|
||||
* Note about libpng version numbers:
|
||||
@ -201,7 +201,7 @@
|
||||
*
|
||||
* This code is released under the libpng license.
|
||||
*
|
||||
* libpng versions 1.2.6, August 15, 2004, through 1.6.1beta02, February 16, 2013, are
|
||||
* libpng versions 1.2.6, August 15, 2004, through 1.6.1beta02, February 17, 2013, are
|
||||
* Copyright (c) 2004, 2006-2013 Glenn Randers-Pehrson, and are
|
||||
* distributed according to the same disclaimer and license as libpng-1.2.5
|
||||
* with the following individual added to the list of Contributing Authors:
|
||||
@ -313,7 +313,7 @@
|
||||
* Y2K compliance in libpng:
|
||||
* =========================
|
||||
*
|
||||
* February 16, 2013
|
||||
* February 17, 2013
|
||||
*
|
||||
* Since the PNG Development group is an ad-hoc body, we can't make
|
||||
* an official declaration.
|
||||
@ -381,7 +381,7 @@
|
||||
/* Version information for png.h - this should match the version in png.c */
|
||||
#define PNG_LIBPNG_VER_STRING "1.6.1beta02"
|
||||
#define PNG_HEADER_VERSION_STRING \
|
||||
" libpng version 1.6.1beta02 - February 16, 2013\n"
|
||||
" libpng version 1.6.1beta02 - February 17, 2013\n"
|
||||
|
||||
#define PNG_LIBPNG_VER_SONUM 16
|
||||
#define PNG_LIBPNG_VER_DLLNUM 16
|
||||
@ -2332,8 +2332,8 @@ PNG_EXPORT(167, void, png_set_tRNS, (png_structrp png_ptr,
|
||||
#ifdef PNG_sCAL_SUPPORTED
|
||||
PNG_FP_EXPORT(168, png_uint_32, png_get_sCAL, (png_const_structrp png_ptr,
|
||||
png_const_inforp info_ptr, int *unit, double *width, double *height))
|
||||
#if (defined PNG_FLOATING_ARITHMETIC_SUPPORTED) || \
|
||||
(defined PNG_FLOATING_POINT_SUPPORTED)
|
||||
#if defined(PNG_FLOATING_ARITHMETIC_SUPPORTED) || \
|
||||
defined(PNG_FLOATING_POINT_SUPPORTED)
|
||||
/* NOTE: this API is currently implemented using floating point arithmetic,
|
||||
* consequently it can only be used on systems with floating point support.
|
||||
* In any case the range of values supported by png_fixed_point is small and it
|
||||
|
@ -1,7 +1,7 @@
|
||||
|
||||
/* pngconf.h - machine configurable file for libpng
|
||||
*
|
||||
* libpng version 1.6.1beta02 - February 16, 2013
|
||||
* libpng version 1.6.1beta02 - February 17, 2013
|
||||
*
|
||||
* Copyright (c) 1998-2013 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
|
@ -516,7 +516,7 @@ png_chunk_report(png_const_structrp png_ptr, png_const_charp message, int error)
|
||||
/* This is always supported, but for just read or just write it
|
||||
* unconditionally does the right thing.
|
||||
*/
|
||||
# if (defined PNG_READ_SUPPORTED) && (defined PNG_WRITE_SUPPORTED)
|
||||
# if defined(PNG_READ_SUPPORTED) && defined(PNG_WRITE_SUPPORTED)
|
||||
if (png_ptr->mode & PNG_IS_READ_STRUCT)
|
||||
# endif
|
||||
|
||||
@ -530,7 +530,7 @@ png_chunk_report(png_const_structrp png_ptr, png_const_charp message, int error)
|
||||
}
|
||||
# endif
|
||||
|
||||
# if (defined PNG_READ_SUPPORTED) && (defined PNG_WRITE_SUPPORTED)
|
||||
# if defined(PNG_READ_SUPPORTED) && defined(PNG_WRITE_SUPPORTED)
|
||||
else if (!(png_ptr->mode & PNG_IS_READ_STRUCT))
|
||||
# endif
|
||||
|
||||
|
16
pngget.c
16
pngget.c
@ -552,14 +552,14 @@ png_get_cHRM_XYZ(png_const_structrp png_ptr, png_const_inforp info_ptr,
|
||||
*green_Z = png_float(png_ptr,
|
||||
info_ptr->colorspace.end_points_XYZ.green_Z, "cHRM green Z");
|
||||
if (blue_X != NULL)
|
||||
*blue_X = png_float(png_ptr, info_ptr->colorspace.end_points_XYZ.blue_X,
|
||||
"cHRM blue X");
|
||||
*blue_X = png_float(png_ptr,
|
||||
info_ptr->colorspace.end_points_XYZ.blue_X, "cHRM blue X");
|
||||
if (blue_Y != NULL)
|
||||
*blue_Y = png_float(png_ptr, info_ptr->colorspace.end_points_XYZ.blue_Y,
|
||||
"cHRM blue Y");
|
||||
*blue_Y = png_float(png_ptr,
|
||||
info_ptr->colorspace.end_points_XYZ.blue_Y, "cHRM blue Y");
|
||||
if (blue_Z != NULL)
|
||||
*blue_Z = png_float(png_ptr, info_ptr->colorspace.end_points_XYZ.blue_Z,
|
||||
"cHRM blue Z");
|
||||
*blue_Z = png_float(png_ptr,
|
||||
info_ptr->colorspace.end_points_XYZ.blue_Z, "cHRM blue Z");
|
||||
return (PNG_INFO_cHRM);
|
||||
}
|
||||
|
||||
@ -844,8 +844,8 @@ png_get_pCAL(png_const_structrp png_ptr, png_inforp info_ptr,
|
||||
|
||||
#ifdef PNG_sCAL_SUPPORTED
|
||||
# ifdef PNG_FIXED_POINT_SUPPORTED
|
||||
# if (defined PNG_FLOATING_ARITHMETIC_SUPPORTED) || \
|
||||
(defined PNG_FLOATING_POINT_SUPPORTED)
|
||||
# if defined(PNG_FLOATING_ARITHMETIC_SUPPORTED) || \
|
||||
defined(PNG_FLOATING_POINT_SUPPORTED)
|
||||
png_uint_32 PNGAPI
|
||||
png_get_sCAL_fixed(png_const_structrp png_ptr, png_const_inforp info_ptr,
|
||||
int *unit, png_fixed_point *width, png_fixed_point *height)
|
||||
|
@ -56,7 +56,7 @@
|
||||
* configure generated config.h. Libpng is expected to compile without *any*
|
||||
* special build system support on a reasonably ANSI-C compliant system.
|
||||
*/
|
||||
#if (defined HAVE_CONFIG_H) && !(defined PNG_NO_CONFIG_H)
|
||||
#if defined(HAVE_CONFIG_H) && !defined(PNG_NO_CONFIG_H)
|
||||
# include <config.h>
|
||||
|
||||
/* Pick up the definition of 'restrict' from config.h if it was read: */
|
||||
|
@ -877,8 +877,8 @@ png_read_destroy(png_structrp png_ptr)
|
||||
png_free(png_ptr, png_ptr->save_buffer);
|
||||
#endif
|
||||
|
||||
#if (defined PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED) &&\
|
||||
(defined PNG_READ_UNKNOWN_CHUNKS_SUPPORTED)
|
||||
#if defined(PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED) &&\
|
||||
defined(PNG_READ_UNKNOWN_CHUNKS_SUPPORTED)
|
||||
png_free(png_ptr, png_ptr->unknown_chunk.data);
|
||||
#endif
|
||||
|
||||
|
12
pngrtran.c
12
pngrtran.c
@ -2239,8 +2239,8 @@ png_do_read_transformations(png_structrp png_ptr, png_row_infop row_info)
|
||||
png_do_gray_to_rgb(row_info, png_ptr->row_buf + 1);
|
||||
#endif
|
||||
|
||||
#if (defined PNG_READ_BACKGROUND_SUPPORTED) ||\
|
||||
(defined PNG_READ_ALPHA_MODE_SUPPORTED)
|
||||
#if defined(PNG_READ_BACKGROUND_SUPPORTED) ||\
|
||||
defined(PNG_READ_ALPHA_MODE_SUPPORTED)
|
||||
if (png_ptr->transformations & PNG_COMPOSE)
|
||||
png_do_compose(row_info, png_ptr->row_buf + 1, png_ptr);
|
||||
#endif
|
||||
@ -2251,8 +2251,8 @@ png_do_read_transformations(png_structrp png_ptr, png_row_infop row_info)
|
||||
/* Because RGB_TO_GRAY does the gamma transform. */
|
||||
!(png_ptr->transformations & PNG_RGB_TO_GRAY) &&
|
||||
#endif
|
||||
#if (defined PNG_READ_BACKGROUND_SUPPORTED) ||\
|
||||
(defined PNG_READ_ALPHA_MODE_SUPPORTED)
|
||||
#if defined(PNG_READ_BACKGROUND_SUPPORTED) ||\
|
||||
defined(PNG_READ_ALPHA_MODE_SUPPORTED)
|
||||
/* Because PNG_COMPOSE does the gamma transform if there is something to
|
||||
* do (if there is an alpha channel or transparency.)
|
||||
*/
|
||||
@ -3518,8 +3518,8 @@ png_build_grayscale_palette(int bit_depth, png_colorp palette)
|
||||
|
||||
|
||||
#ifdef PNG_READ_TRANSFORMS_SUPPORTED
|
||||
#if (defined PNG_READ_BACKGROUND_SUPPORTED) ||\
|
||||
(defined PNG_READ_ALPHA_MODE_SUPPORTED)
|
||||
#if defined(PNG_READ_BACKGROUND_SUPPORTED) ||\
|
||||
defined(PNG_READ_ALPHA_MODE_SUPPORTED)
|
||||
/* Replace any alpha or transparency with the supplied background color.
|
||||
* "background" is already in the screen gamma, while "background_1" is
|
||||
* at a gamma of 1.0. Paletted files have already been taken care of.
|
||||
|
8
pngset.c
8
pngset.c
@ -1116,16 +1116,16 @@ png_set_unknown_chunks(png_const_structrp png_ptr,
|
||||
* code) but may be meaningless if the read or write handling of unknown
|
||||
* chunks is not compiled in.
|
||||
*/
|
||||
# if !(defined PNG_READ_UNKNOWN_CHUNKS_SUPPORTED) && \
|
||||
(defined PNG_READ_SUPPORTED)
|
||||
# if !defined(PNG_READ_UNKNOWN_CHUNKS_SUPPORTED) && \
|
||||
defined(PNG_READ_SUPPORTED)
|
||||
if (png_ptr->mode & PNG_IS_READ_STRUCT)
|
||||
{
|
||||
png_app_error(png_ptr, "no unknown chunk support on read");
|
||||
return;
|
||||
}
|
||||
# endif
|
||||
# if !(defined PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED) && \
|
||||
(defined PNG_WRITE_SUPPORTED)
|
||||
# if !defined(PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED) && \
|
||||
defined(PNG_WRITE_SUPPORTED)
|
||||
if (!(png_ptr->mode & PNG_IS_READ_STRUCT))
|
||||
{
|
||||
png_app_error(png_ptr, "no unknown chunk support on write");
|
||||
|
@ -1470,7 +1470,8 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
|
||||
|
||||
/* When the unknown vpAg/sTER chunks are written by pngtest the only way to
|
||||
* do it is to write them *before* calling png_write_end. When unknown
|
||||
* chunks are written by libpng, however, they are written just before IEND. * There seems to be no way round this, however vpAg/sTER are not expected
|
||||
* chunks are written by libpng, however, they are written just before IEND.
|
||||
* There seems to be no way round this, however vpAg/sTER are not expected
|
||||
* after IDAT.
|
||||
*/
|
||||
write_chunks(write_ptr, after_IDAT);
|
||||
|
Loading…
Reference in New Issue
Block a user