mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
[devel] Replaced all "PNG_NO_FEATURE" tests with "PNG_FEATURE_SUPPORTED" tests
except in pngconf.h where they can be used to request that PNG_FEATURE_SUPPORTED not be defined.
This commit is contained in:
20
pngwrite.c
20
pngwrite.c
@@ -1,7 +1,7 @@
|
||||
|
||||
/* pngwrite.c - general routines to write a PNG file
|
||||
*
|
||||
* Last changed in libpng 1.4.0 [August 28, 2009]
|
||||
* Last changed in libpng 1.4.0 [August 31, 2009]
|
||||
* Copyright (c) 1998-2009 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.)
|
||||
@@ -189,7 +189,7 @@ png_write_info(png_structp png_ptr, png_infop info_ptr)
|
||||
#if defined(PNG_sCAL_SUPPORTED)
|
||||
if (info_ptr->valid & PNG_INFO_sCAL)
|
||||
#if defined(PNG_WRITE_sCAL_SUPPORTED)
|
||||
#if defined(PNG_FLOATING_POINT_SUPPORTED) && !defined(PNG_NO_STDIO)
|
||||
#if defined(PNG_FLOATING_POINT_SUPPORTED) && defined(PNG_STDIO_SUPPORTED)
|
||||
png_write_sCAL(png_ptr, (int)info_ptr->scal_unit,
|
||||
info_ptr->scal_pixel_width, info_ptr->scal_pixel_height);
|
||||
#else /* !FLOATING_POINT */
|
||||
@@ -532,7 +532,7 @@ png_create_write_struct_2(png_const_charp user_png_ver, png_voidp error_ptr,
|
||||
(user_png_ver[0] == '1' && user_png_ver[2] != png_libpng_ver[2]) ||
|
||||
(user_png_ver[0] == '0' && user_png_ver[2] < '9'))
|
||||
{
|
||||
#if !defined(PNG_NO_STDIO) && !defined(_WIN32_WCE)
|
||||
#if defined(PNG_STDIO_SUPPORTED) && !defined(_WIN32_WCE)
|
||||
char msg[80];
|
||||
if (user_png_ver)
|
||||
{
|
||||
@@ -984,7 +984,7 @@ png_write_destroy(png_structp png_ptr)
|
||||
/* Free our memory. png_free checks NULL for us. */
|
||||
png_free(png_ptr, png_ptr->zbuf);
|
||||
png_free(png_ptr, png_ptr->row_buf);
|
||||
#ifndef PNG_NO_WRITE_FILTER
|
||||
#ifdef PNG_WRITE_FILTER_SUPPORTED
|
||||
png_free(png_ptr, png_ptr->prev_row);
|
||||
png_free(png_ptr, png_ptr->sub_row);
|
||||
png_free(png_ptr, png_ptr->up_row);
|
||||
@@ -1047,14 +1047,14 @@ png_set_filter(png_structp png_ptr, int method, int filters)
|
||||
{
|
||||
switch (filters & (PNG_ALL_FILTERS | 0x07))
|
||||
{
|
||||
#ifndef PNG_NO_WRITE_FILTER
|
||||
#ifdef PNG_WRITE_FILTER_SUPPORTED
|
||||
case 5:
|
||||
case 6:
|
||||
case 7: png_warning(png_ptr, "Unknown row filter for method 0");
|
||||
#endif /* PNG_NO_WRITE_FILTER */
|
||||
#endif /* PNG_WRITE_FILTER_SUPPORTED */
|
||||
case PNG_FILTER_VALUE_NONE:
|
||||
png_ptr->do_filter=PNG_FILTER_NONE; break;
|
||||
#ifndef PNG_NO_WRITE_FILTER
|
||||
#ifdef PNG_WRITE_FILTER_SUPPORTED
|
||||
case PNG_FILTER_VALUE_SUB:
|
||||
png_ptr->do_filter=PNG_FILTER_SUB; break;
|
||||
case PNG_FILTER_VALUE_UP:
|
||||
@@ -1066,7 +1066,7 @@ png_set_filter(png_structp png_ptr, int method, int filters)
|
||||
default: png_ptr->do_filter = (png_byte)filters; break;
|
||||
#else
|
||||
default: png_warning(png_ptr, "Unknown row filter for method 0");
|
||||
#endif /* PNG_NO_WRITE_FILTER */
|
||||
#endif /* PNG_WRITE_FILTER_SUPPORTED */
|
||||
}
|
||||
|
||||
/* If we have allocated the row_buf, this means we have already started
|
||||
@@ -1080,7 +1080,7 @@ png_set_filter(png_structp png_ptr, int method, int filters)
|
||||
*/
|
||||
if (png_ptr->row_buf != NULL)
|
||||
{
|
||||
#ifndef PNG_NO_WRITE_FILTER
|
||||
#ifdef PNG_WRITE_FILTER_SUPPORTED
|
||||
if ((png_ptr->do_filter & PNG_FILTER_SUB) && png_ptr->sub_row == NULL)
|
||||
{
|
||||
png_ptr->sub_row = (png_bytep)png_malloc(png_ptr,
|
||||
@@ -1135,7 +1135,7 @@ png_set_filter(png_structp png_ptr, int method, int filters)
|
||||
}
|
||||
|
||||
if (png_ptr->do_filter == PNG_NO_FILTERS)
|
||||
#endif /* PNG_NO_WRITE_FILTER */
|
||||
#endif /* PNG_WRITE_FILTER_SUPPORTED */
|
||||
png_ptr->do_filter = PNG_FILTER_NONE;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user