[libpng15] Redo previous checkin; fold long lines and fix #ifdefs

This commit is contained in:
Glenn Randers-Pehrson 2013-02-17 21:41:43 -06:00
parent 354cd3930b
commit fb908d6ae2
8 changed files with 30 additions and 28 deletions

View File

@ -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 (NG_READ_zTXt_SUPPORTED) && defined(PNG_WRITE_zTXt_SUPPORTED)
# define TEXT_COMPRESSION PNG_TEXT_COMPRESSION_zTXt
# else
# define TEXT_COMPRESSION PNG_TEXT_COMPRESSION_NONE
@ -8902,8 +8902,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,

10
png.c
View File

@ -14,7 +14,7 @@
#include "pngpriv.h"
/* Generate a compiler error if there is an old png.h in the search path. */
typedef png_libpng_version_1_5_15beta02 Your_png_h_is_not_version_1_5_15beta02;
typedef png_libpng_version_1_5_15beta05 Your_png_h_is_not_version_1_5_15beta05;
/* Tells libpng that we have already handled the first "num_bytes" bytes
* of the PNG file signature. If the PNG data is embedded into another
@ -658,13 +658,13 @@ png_get_copyright(png_const_structp png_ptr)
#else
# ifdef __STDC__
return PNG_STRING_NEWLINE \
"libpng version 1.5.15beta02 - February 5, 2013" PNG_STRING_NEWLINE \
"libpng version 1.5.15beta05 - February 17, 2013" PNG_STRING_NEWLINE \
"Copyright (c) 1998-2013 Glenn Randers-Pehrson" PNG_STRING_NEWLINE \
"Copyright (c) 1996-1997 Andreas Dilger" PNG_STRING_NEWLINE \
"Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc." \
PNG_STRING_NEWLINE;
# else
return "libpng version 1.5.15beta02 - February 5, 2013\
return "libpng version 1.5.15beta05 - February 17, 2013\
Copyright (c) 1998-2013 Glenn Randers-Pehrson\
Copyright (c) 1996-1997 Andreas Dilger\
Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.";
@ -1907,7 +1907,7 @@ png_fixed(png_structp png_ptr, double fp, png_const_charp text)
#endif
#if defined(PNG_READ_GAMMA_SUPPORTED) || \
defined(PNG_INCH_CONVERSIONS_SUPPORTED) || defined(PNG__READ_pHYs_SUPPORTED)
defined(PNG_INCH_CONVERSIONS_SUPPORTED) || defined(PNG_READ_pHYs_SUPPORTED)
/* muldiv functions */
/* This API takes signed arguments and rounds the result to the nearest
* integer (or, for a fixed point number - the standard argument - to
@ -2047,7 +2047,7 @@ png_muldiv_warn(png_structp png_ptr, png_fixed_point a, png_int_32 times,
}
#endif
#if (defined PNG_READ_GAMMA_SUPPORTED) || (defined PNG_cHRM_SUPPORTED)
#if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_cHRM_SUPPORTED)
/* more fixed point functions for gamma and cHRM (xy/XYZ) suport. */
/* Calculate a reciprocal, return 0 on div-by-zero or overflow. */
png_fixed_point

10
png.h
View File

@ -1,7 +1,7 @@
/* png.h - header file for PNG reference library
*
* libpng version 1.5.15beta05 - February 15, 2013
* libpng version 1.5.15beta05 - 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.5.15beta05 - February 15, 2013: Glenn
* libpng versions 0.97, January 1998, through 1.5.15beta05 - February 17, 2013: Glenn
* See also "Contributing Authors", below.
*
* Note about libpng version numbers:
@ -216,7 +216,7 @@
*
* This code is released under the libpng license.
*
* libpng versions 1.2.6, August 15, 2004, through 1.5.15beta05, February 15, 2013, are
* libpng versions 1.2.6, August 15, 2004, through 1.5.15beta05, 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:
@ -328,7 +328,7 @@
* Y2K compliance in libpng:
* =========================
*
* February 15, 2013
* February 17, 2013
*
* Since the PNG Development group is an ad-hoc body, we can't make
* an official declaration.
@ -395,7 +395,7 @@
/* Version information for png.h - this should match the version in png.c */
#define PNG_LIBPNG_VER_STRING "1.5.15beta05"
#define PNG_HEADER_VERSION_STRING \
" libpng version 1.5.15beta05 - February 15, 2013\n"
" libpng version 1.5.15beta05 - February 17, 2013\n"
#define PNG_LIBPNG_VER_SONUM 15
#define PNG_LIBPNG_VER_DLLNUM 15

View File

@ -1,7 +1,7 @@
/* pngconf.h - machine configurable file for libpng
*
* libpng version 1.5.15beta02 - February 5, 2013
* libpng version 1.5.15beta05 - February 17, 2013
*
* Copyright (c) 1998-2013 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
@ -197,7 +197,7 @@
# define PNGCAPI __watcall
# endif
# if defined(__GNUC__) || (defined (_MSC_VER) && (_MSC_VER >= 800))
# if defined(__GNUC__) || (defined(_MSC_VER) && (_MSC_VER >= 800))
# define PNGCAPI __cdecl
# if PNG_API_RULE == 1
/* If this line results in an error __stdcall is not understood and

View File

@ -238,7 +238,7 @@
/* Modern compilers support restrict, but assume not for anything not
* recognized here:
*/
# if defined __GNUC__ || defined _MSC_VER || defined __WATCOMC__
# if defined(__GNUC__) || defined(_MSC_VER) || defined(__WATCOMC__)
# define PNG_RESTRICT restrict
# else
# define PNG_RESTRICT
@ -1637,7 +1637,7 @@ PNG_EXTERN png_fixed_point png_muldiv_warn PNGARG((png_structp png_ptr,
png_fixed_point a, png_int_32 multiplied_by, png_int_32 divided_by));
#endif
#if (defined PNG_READ_GAMMA_SUPPORTED) || (defined PNG_cHRM_SUPPORTED)
#if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_cHRM_SUPPORTED)
/* Calculate a reciprocal - used for gamma values. This returns
* 0 if the argument is 0 in order to maintain an undefined value,
* there are no warnings.

View File

@ -2198,8 +2198,8 @@ png_do_read_transformations(png_structp 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
@ -2210,8 +2210,8 @@ png_do_read_transformations(png_structp 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.)
*/
@ -3477,8 +3477,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.

View File

@ -352,6 +352,7 @@ struct png_struct_def
/* New member added in libpng-1.5.6 */
png_bytep big_prev_row;
/* New member added in libpng-1.5.7 */
void (*read_filter[PNG_FILTER_VALUE_LAST-1])(png_row_infop row_info,
png_bytep row, png_const_bytep prev_row);
};

View File

@ -1469,7 +1469,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);
@ -1948,4 +1949,4 @@ main(void)
#endif
/* Generate a compiler error if there is an old png.h in the search path. */
typedef png_libpng_version_1_5_15beta02 Your_png_h_is_not_version_1_5_15beta02;
typedef png_libpng_version_1_5_15beta05 Your_png_h_is_not_version_1_5_15beta05;