mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
[libpng15] Redo previous checkin; fold long lines and fix #ifdefs
This commit is contained in:
parent
354cd3930b
commit
fb908d6ae2
@ -26,7 +26,7 @@
|
|||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <stdio.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>
|
# include <config.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -1999,8 +1999,8 @@ static double digitize(PNG_CONST png_modifier *pm, double value,
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (defined PNG_READ_GAMMA_SUPPORTED) ||\
|
#if defined(PNG_READ_GAMMA_SUPPORTED) ||\
|
||||||
(defined PNG_READ_RGB_TO_GRAY_SUPPORTED)
|
defined(PNG_READ_RGB_TO_GRAY_SUPPORTED)
|
||||||
static double abserr(PNG_CONST png_modifier *pm, int in_depth, int out_depth)
|
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
|
/* 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);
|
PNG_COMPRESSION_TYPE_BASE, PNG_FILTER_TYPE_BASE);
|
||||||
|
|
||||||
#ifdef PNG_TEXT_SUPPORTED
|
#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
|
# define TEXT_COMPRESSION PNG_TEXT_COMPRESSION_zTXt
|
||||||
# else
|
# else
|
||||||
# define TEXT_COMPRESSION PNG_TEXT_COMPRESSION_NONE
|
# 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 */
|
#endif /* 16 to 8 bit conversion */
|
||||||
|
|
||||||
#if defined PNG_READ_BACKGROUND_SUPPORTED ||\
|
#if defined(PNG_READ_BACKGROUND_SUPPORTED) ||\
|
||||||
defined PNG_READ_ALPHA_MODE_SUPPORTED
|
defined(PNG_READ_ALPHA_MODE_SUPPORTED)
|
||||||
static void gamma_composition_test(png_modifier *pm,
|
static void gamma_composition_test(png_modifier *pm,
|
||||||
PNG_CONST png_byte colour_type, PNG_CONST png_byte bit_depth,
|
PNG_CONST png_byte colour_type, PNG_CONST png_byte bit_depth,
|
||||||
PNG_CONST int palette_number,
|
PNG_CONST int palette_number,
|
||||||
|
|||||||
10
png.c
10
png.c
@ -14,7 +14,7 @@
|
|||||||
#include "pngpriv.h"
|
#include "pngpriv.h"
|
||||||
|
|
||||||
/* Generate a compiler error if there is an old png.h in the search path. */
|
/* 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
|
/* 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
|
* 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
|
#else
|
||||||
# ifdef __STDC__
|
# ifdef __STDC__
|
||||||
return PNG_STRING_NEWLINE \
|
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) 1998-2013 Glenn Randers-Pehrson" PNG_STRING_NEWLINE \
|
||||||
"Copyright (c) 1996-1997 Andreas Dilger" PNG_STRING_NEWLINE \
|
"Copyright (c) 1996-1997 Andreas Dilger" PNG_STRING_NEWLINE \
|
||||||
"Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc." \
|
"Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc." \
|
||||||
PNG_STRING_NEWLINE;
|
PNG_STRING_NEWLINE;
|
||||||
# else
|
# 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) 1998-2013 Glenn Randers-Pehrson\
|
||||||
Copyright (c) 1996-1997 Andreas Dilger\
|
Copyright (c) 1996-1997 Andreas Dilger\
|
||||||
Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.";
|
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
|
#endif
|
||||||
|
|
||||||
#if defined(PNG_READ_GAMMA_SUPPORTED) || \
|
#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 */
|
/* muldiv functions */
|
||||||
/* This API takes signed arguments and rounds the result to the nearest
|
/* This API takes signed arguments and rounds the result to the nearest
|
||||||
* integer (or, for a fixed point number - the standard argument - to
|
* 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
|
#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. */
|
/* more fixed point functions for gamma and cHRM (xy/XYZ) suport. */
|
||||||
/* Calculate a reciprocal, return 0 on div-by-zero or overflow. */
|
/* Calculate a reciprocal, return 0 on div-by-zero or overflow. */
|
||||||
png_fixed_point
|
png_fixed_point
|
||||||
|
|||||||
10
png.h
10
png.h
@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
/* png.h - header file for PNG reference library
|
/* 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
|
* Copyright (c) 1998-2013 Glenn Randers-Pehrson
|
||||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||||
@ -11,7 +11,7 @@
|
|||||||
* Authors and maintainers:
|
* Authors and maintainers:
|
||||||
* libpng versions 0.71, May 1995, through 0.88, January 1996: Guy Schalnat
|
* 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.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.
|
* See also "Contributing Authors", below.
|
||||||
*
|
*
|
||||||
* Note about libpng version numbers:
|
* Note about libpng version numbers:
|
||||||
@ -216,7 +216,7 @@
|
|||||||
*
|
*
|
||||||
* This code is released under the libpng license.
|
* 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
|
* Copyright (c) 2004, 2006-2013 Glenn Randers-Pehrson, and are
|
||||||
* distributed according to the same disclaimer and license as libpng-1.2.5
|
* distributed according to the same disclaimer and license as libpng-1.2.5
|
||||||
* with the following individual added to the list of Contributing Authors:
|
* with the following individual added to the list of Contributing Authors:
|
||||||
@ -328,7 +328,7 @@
|
|||||||
* Y2K compliance in libpng:
|
* Y2K compliance in libpng:
|
||||||
* =========================
|
* =========================
|
||||||
*
|
*
|
||||||
* February 15, 2013
|
* February 17, 2013
|
||||||
*
|
*
|
||||||
* Since the PNG Development group is an ad-hoc body, we can't make
|
* Since the PNG Development group is an ad-hoc body, we can't make
|
||||||
* an official declaration.
|
* an official declaration.
|
||||||
@ -395,7 +395,7 @@
|
|||||||
/* Version information for png.h - this should match the version in png.c */
|
/* Version information for png.h - this should match the version in png.c */
|
||||||
#define PNG_LIBPNG_VER_STRING "1.5.15beta05"
|
#define PNG_LIBPNG_VER_STRING "1.5.15beta05"
|
||||||
#define PNG_HEADER_VERSION_STRING \
|
#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_SONUM 15
|
||||||
#define PNG_LIBPNG_VER_DLLNUM 15
|
#define PNG_LIBPNG_VER_DLLNUM 15
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
/* pngconf.h - machine configurable file for libpng
|
/* 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
|
* Copyright (c) 1998-2013 Glenn Randers-Pehrson
|
||||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
|
|||||||
@ -238,7 +238,7 @@
|
|||||||
/* Modern compilers support restrict, but assume not for anything not
|
/* Modern compilers support restrict, but assume not for anything not
|
||||||
* recognized here:
|
* recognized here:
|
||||||
*/
|
*/
|
||||||
# if defined __GNUC__ || defined _MSC_VER || defined __WATCOMC__
|
# if defined(__GNUC__) || defined(_MSC_VER) || defined(__WATCOMC__)
|
||||||
# define PNG_RESTRICT restrict
|
# define PNG_RESTRICT restrict
|
||||||
# else
|
# else
|
||||||
# define PNG_RESTRICT
|
# 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));
|
png_fixed_point a, png_int_32 multiplied_by, png_int_32 divided_by));
|
||||||
#endif
|
#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
|
/* Calculate a reciprocal - used for gamma values. This returns
|
||||||
* 0 if the argument is 0 in order to maintain an undefined value,
|
* 0 if the argument is 0 in order to maintain an undefined value,
|
||||||
* there are no warnings.
|
* there are no warnings.
|
||||||
|
|||||||
12
pngrtran.c
12
pngrtran.c
@ -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);
|
png_do_gray_to_rgb(row_info, png_ptr->row_buf + 1);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (defined PNG_READ_BACKGROUND_SUPPORTED) ||\
|
#if defined(PNG_READ_BACKGROUND_SUPPORTED) ||\
|
||||||
(defined PNG_READ_ALPHA_MODE_SUPPORTED)
|
defined(PNG_READ_ALPHA_MODE_SUPPORTED)
|
||||||
if (png_ptr->transformations & PNG_COMPOSE)
|
if (png_ptr->transformations & PNG_COMPOSE)
|
||||||
png_do_compose(row_info, png_ptr->row_buf + 1, png_ptr);
|
png_do_compose(row_info, png_ptr->row_buf + 1, png_ptr);
|
||||||
#endif
|
#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. */
|
/* Because RGB_TO_GRAY does the gamma transform. */
|
||||||
!(png_ptr->transformations & PNG_RGB_TO_GRAY) &&
|
!(png_ptr->transformations & PNG_RGB_TO_GRAY) &&
|
||||||
#endif
|
#endif
|
||||||
#if (defined PNG_READ_BACKGROUND_SUPPORTED) ||\
|
#if defined(PNG_READ_BACKGROUND_SUPPORTED) ||\
|
||||||
(defined PNG_READ_ALPHA_MODE_SUPPORTED)
|
defined(PNG_READ_ALPHA_MODE_SUPPORTED)
|
||||||
/* Because PNG_COMPOSE does the gamma transform if there is something to
|
/* Because PNG_COMPOSE does the gamma transform if there is something to
|
||||||
* do (if there is an alpha channel or transparency.)
|
* 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
|
#ifdef PNG_READ_TRANSFORMS_SUPPORTED
|
||||||
#if (defined PNG_READ_BACKGROUND_SUPPORTED) ||\
|
#if defined(PNG_READ_BACKGROUND_SUPPORTED) ||\
|
||||||
(defined PNG_READ_ALPHA_MODE_SUPPORTED)
|
defined(PNG_READ_ALPHA_MODE_SUPPORTED)
|
||||||
/* Replace any alpha or transparency with the supplied background color.
|
/* Replace any alpha or transparency with the supplied background color.
|
||||||
* "background" is already in the screen gamma, while "background_1" is
|
* "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.
|
* at a gamma of 1.0. Paletted files have already been taken care of.
|
||||||
|
|||||||
@ -352,6 +352,7 @@ struct png_struct_def
|
|||||||
/* New member added in libpng-1.5.6 */
|
/* New member added in libpng-1.5.6 */
|
||||||
png_bytep big_prev_row;
|
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,
|
void (*read_filter[PNG_FILTER_VALUE_LAST-1])(png_row_infop row_info,
|
||||||
png_bytep row, png_const_bytep prev_row);
|
png_bytep row, png_const_bytep prev_row);
|
||||||
};
|
};
|
||||||
|
|||||||
@ -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
|
/* 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
|
* 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.
|
* after IDAT.
|
||||||
*/
|
*/
|
||||||
write_chunks(write_ptr, after_IDAT);
|
write_chunks(write_ptr, after_IDAT);
|
||||||
@ -1948,4 +1949,4 @@ main(void)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Generate a compiler error if there is an old png.h in the search path. */
|
/* 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;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user