[master] Converted all PNG_NO_* tests to PNG_*_SUPPORTED

everywhere except pngconf.h as in libpng-1.4.0beta78 and later.
This commit is contained in:
Glenn Randers-Pehrson
2009-10-18 14:30:53 -05:00
parent 4560de58f4
commit 5d398a69fb
12 changed files with 68 additions and 64 deletions

View File

@@ -192,7 +192,7 @@ png_text_compress(png_structp png_ptr,
if (compression >= PNG_TEXT_COMPRESSION_LAST)
{
#if !defined(PNG_NO_STDIO) && !defined(_WIN32_WCE)
#if defined(PNG_STDIO_SUPPORTED) && !defined(_WIN32_WCE)
char msg[50];
png_snprintf(msg, 50, "Unknown compression type %d", compression);
png_warning(png_ptr, msg);
@@ -607,7 +607,7 @@ png_write_PLTE(png_structp png_ptr, png_colorp palette, png_uint_32 num_pal)
png_write_chunk_start(png_ptr, (png_bytep)png_PLTE,
(png_uint_32)(num_pal * 3));
#ifndef PNG_NO_POINTER_INDEXING
#ifdef PNG_POINTER_INDEXING_SUPPORTED
for (i = 0, pal_ptr = palette; i < num_pal; i++, pal_ptr++)
{
buf[0] = pal_ptr->red;
@@ -853,7 +853,7 @@ png_write_sPLT(png_structp png_ptr, png_sPLT_tp spalette)
int entry_size = (spalette->depth == 8 ? 6 : 10);
int palette_size = entry_size * spalette->nentries;
png_sPLT_entryp ep;
#ifdef PNG_NO_POINTER_INDEXING
#ifndef PNG_POINTER_INDEXING_SUPPORTED
int i;
#endif
@@ -870,7 +870,7 @@ png_write_sPLT(png_structp png_ptr, png_sPLT_tp spalette)
png_write_chunk_data(png_ptr, (png_bytep)&spalette->depth, (png_size_t)1);
/* Loop through each palette entry, writing appropriately */
#ifndef PNG_NO_POINTER_INDEXING
#ifdef PNG_POINTER_INDEXING_SUPPORTED
for (ep = spalette->entries; ep<spalette->entries + spalette->nentries; ep++)
{
if (spalette->depth == 8)
@@ -1004,7 +1004,7 @@ png_write_cHRM(png_structp png_ptr, double white_x, double white_y,
int_blue_x = (png_uint_32)(blue_x * 100000.0 + 0.5);
int_blue_y = (png_uint_32)(blue_y * 100000.0 + 0.5);
#ifndef PNG_NO_CHECK_cHRM
#ifdef PNG_CHECK_cHRM_SUPPORTED
if (png_check_cHRM_fixed(png_ptr, int_white_x, int_white_y,
int_red_x, int_red_y, int_green_x, int_green_y, int_blue_x, int_blue_y))
#endif
@@ -1042,7 +1042,7 @@ png_write_cHRM_fixed(png_structp png_ptr, png_fixed_point white_x,
png_debug(1, "in png_write_cHRM");
/* Each value is saved in 1/100,000ths */
#ifndef PNG_NO_CHECK_cHRM
#ifdef PNG_CHECK_cHRM_SUPPORTED
if (png_check_cHRM_fixed(png_ptr, white_x, white_y, red_x, red_y,
green_x, green_y, blue_x, blue_y))
#endif
@@ -1253,7 +1253,7 @@ png_check_keyword(png_structp png_ptr, png_charp key, png_charpp new_key)
if ((png_byte)*kp < 0x20 ||
((png_byte)*kp > 0x7E && (png_byte)*kp < 0xA1))
{
#if !defined(PNG_NO_STDIO) && !defined(_WIN32_WCE)
#if defined(PNG_STDIO_SUPPORTED) && !defined(_WIN32_WCE)
char msg[40];
png_snprintf(msg, 40,
@@ -1618,7 +1618,7 @@ png_write_pCAL(png_structp png_ptr, png_charp purpose, png_int_32 X0,
#ifdef PNG_WRITE_sCAL_SUPPORTED
/* Write the sCAL chunk */
#if defined(PNG_FLOATING_POINT_SUPPORTED) && !defined(PNG_NO_STDIO)
#if defined(PNG_FLOATING_POINT_SUPPORTED) && defined(PNG_STDIO_SUPPORTED)
void /* PRIVATE */
png_write_sCAL(png_structp png_ptr, int unit, double width, double height)
{
@@ -1780,7 +1780,7 @@ png_write_start_row(png_structp png_ptr)
(png_uint_32)buf_size);
png_ptr->row_buf[0] = PNG_FILTER_VALUE_NONE;
#ifndef PNG_NO_WRITE_FILTER
#ifdef PNG_WRITE_FILTER_SUPPORTED
/* Set up filtering buffer, if using this filter */
if (png_ptr->do_filter & PNG_FILTER_SUB)
{
@@ -2140,7 +2140,7 @@ void /* PRIVATE */
png_write_find_filter(png_structp png_ptr, png_row_infop row_info)
{
png_bytep best_row;
#ifndef PNG_NO_WRITE_FILTER
#ifdef PNG_WRITE_FILTER_SUPPORTED
png_bytep prev_row, row_buf;
png_uint_32 mins, bpp;
png_byte filter_to_do = png_ptr->do_filter;
@@ -2157,7 +2157,7 @@ png_write_find_filter(png_structp png_ptr, png_row_infop row_info)
prev_row = png_ptr->prev_row;
#endif
best_row = png_ptr->row_buf;
#ifndef PNG_NO_WRITE_FILTER
#ifdef PNG_WRITE_FILTER_SUPPORTED
row_buf = best_row;
mins = PNG_MAXSUM;
@@ -2738,7 +2738,7 @@ png_write_find_filter(png_structp png_ptr, png_row_infop row_info)
png_write_filtered_row(png_ptr, best_row);
#ifndef PNG_NO_WRITE_FILTER
#ifdef PNG_WRITE_FILTER_SUPPORTED
#ifdef PNG_WRITE_WEIGHTED_FILTER_SUPPORTED
/* Save the type of filter we picked this time for future calculations */
if (png_ptr->num_prev_filters > 0)