[master] Ported some cosmetic changes from the devel branch

This commit is contained in:
Glenn Randers-Pehrson
2009-10-05 13:53:19 -05:00
parent 48fac4e8ce
commit 9023e8f7bb
9 changed files with 172 additions and 125 deletions

View File

@@ -1,7 +1,7 @@
/* pngwio.c - functions for data output
*
* Last changed in libpng 1.2.37 [June 4, 2009]
* Last changed in libpng 1.2.41 [October 5, 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.)
@@ -38,7 +38,7 @@ png_write_data(png_structp png_ptr, png_bytep data, png_size_t length)
png_error(png_ptr, "Call to NULL write function");
}
#if !defined(PNG_NO_STDIO)
#ifndef PNG_NO_STDIO
/* This is the function that does the actual writing of data. If you are
* not writing to a standard C stream, you should create a replacement
* write_data function and use it at run time with png_set_write_fn(), rather
@@ -52,7 +52,7 @@ png_default_write_data(png_structp png_ptr, png_bytep data, png_size_t length)
if (png_ptr == NULL)
return;
#if defined(_WIN32_WCE)
#ifdef _WIN32_WCE
if ( !WriteFile((HANDLE)(png_ptr->io_ptr), data, length, &check, NULL) )
check = 0;
#else
@@ -84,7 +84,7 @@ png_default_write_data(png_structp png_ptr, png_bytep data, png_size_t length)
io_ptr = (png_FILE_p)CVT_PTR(png_ptr->io_ptr);
if ((png_bytep)near_data == data)
{
#if defined(_WIN32_WCE)
#ifdef _WIN32_WCE
if ( !WriteFile(io_ptr, near_data, length, &check, NULL) )
check = 0;
#else
@@ -101,7 +101,7 @@ png_default_write_data(png_structp png_ptr, png_bytep data, png_size_t length)
{
written = MIN(NEAR_BUF_SIZE, remaining);
png_memcpy(buf, data, written); /* Copy far buffer to near buffer */
#if defined(_WIN32_WCE)
#ifdef _WIN32_WCE
if ( !WriteFile(io_ptr, buf, written, &err, NULL) )
err = 0;
#else
@@ -129,7 +129,7 @@ png_default_write_data(png_structp png_ptr, png_bytep data, png_size_t length)
* to disk). After png_flush is called, there should be no data pending
* writing in any buffers.
*/
#if defined(PNG_WRITE_FLUSH_SUPPORTED)
#ifdef PNG_WRITE_FLUSH_SUPPORTED
void /* PRIVATE */
png_flush(png_structp png_ptr)
{
@@ -137,16 +137,16 @@ png_flush(png_structp png_ptr)
(*(png_ptr->output_flush_fn))(png_ptr);
}
#if !defined(PNG_NO_STDIO)
#ifndef PNG_NO_STDIO
void PNGAPI
png_default_flush(png_structp png_ptr)
{
#if !defined(_WIN32_WCE)
#ifndef _WIN32_WCE
png_FILE_p io_ptr;
#endif
if (png_ptr == NULL)
return;
#if !defined(_WIN32_WCE)
#ifndef _WIN32_WCE
io_ptr = (png_FILE_p)CVT_PTR((png_ptr->io_ptr));
fflush(io_ptr);
#endif
@@ -192,7 +192,7 @@ png_set_write_fn(png_structp png_ptr, png_voidp io_ptr,
png_ptr->io_ptr = io_ptr;
#if !defined(PNG_NO_STDIO)
#ifndef PNG_NO_STDIO
if (write_data_fn != NULL)
png_ptr->write_data_fn = write_data_fn;
@@ -202,8 +202,8 @@ png_set_write_fn(png_structp png_ptr, png_voidp io_ptr,
png_ptr->write_data_fn = write_data_fn;
#endif
#if defined(PNG_WRITE_FLUSH_SUPPORTED)
#if !defined(PNG_NO_STDIO)
#ifdef PNG_WRITE_FLUSH_SUPPORTED
#ifndef PNG_NO_STDIO
if (output_flush_fn != NULL)
png_ptr->output_flush_fn = output_flush_fn;
@@ -225,8 +225,8 @@ png_set_write_fn(png_structp png_ptr, png_voidp io_ptr,
}
}
#if defined(USE_FAR_KEYWORD)
#if defined(_MSC_VER)
#ifdef USE_FAR_KEYWORD
#ifdef _MSC_VER
void *png_far_to_near(png_structp png_ptr, png_voidp ptr, int check)
{
void *near_ptr;