Imported from libpng-0.99k.tar
diff --git a/pngtest.c b/pngtest.c
index 9481427..700ad74 100644
--- a/pngtest.c
+++ b/pngtest.c
@@ -32,12 +32,12 @@
/* Makes pngtest verbose so we can find problems (needs to be before png.h) */
#ifndef PNG_DEBUG
-#endif
#define PNG_DEBUG 0
+#endif
#include "png.h"
-int test_one_file(PNG_CONST char *inname, PNG_CONST char *outname);
+int test_one_file PNGARG((PNG_CONST char *inname, PNG_CONST char *outname));
#ifdef __TURBOC__
#include <mem.h>
@@ -51,7 +51,7 @@
static int status_pass=1;
static int status_dots_requested=0;
static int status_dots=1;
-void read_row_callback(png_structp png_ptr, png_uint_32 row_number, int pass);
+
void read_row_callback(png_structp png_ptr, png_uint_32 row_number, int pass)
{
if(png_ptr == NULL || row_number > 0x3fffffffL) return;
@@ -69,7 +69,7 @@
}
fprintf(stdout, "r");
}
-void write_row_callback(png_structp png_ptr, png_uint_32 row_number, int pass);
+
void write_row_callback(png_structp png_ptr, png_uint_32 row_number, int pass)
{
if(png_ptr == NULL || row_number > 0x3fffffffL || pass > 7) return;
@@ -83,10 +83,9 @@
but merely count the black pixels) */
static png_uint_32 black_pixels;
+
void count_black_pixels(png_structp png_ptr, png_row_infop row_info,
- png_bytep data);
-void count_black_pixels(png_structp png_ptr, png_row_infop row_info,
- png_bytep data)
+ png_bytep data)
{
png_bytep dp = data;
if(png_ptr == NULL)return;
@@ -180,8 +179,6 @@
than changing the library. */
#ifndef USE_FAR_KEYWORD
static void
-png_default_read_data(png_structp png_ptr, png_bytep data, png_size_t length);
-static void
png_default_read_data(png_structp png_ptr, png_bytep data, png_size_t length)
{
png_size_t check;
@@ -206,10 +203,8 @@
#define NEAR_BUF_SIZE 1024
#define MIN(a,b) (a <= b ? a : b)
-static void
-png_default_read_data(png_structp png_ptr, png_bytep data, png_size_t length);
-static void
-png_default_read_data(png_structp png_ptr, png_bytep data, png_size_t length)
+static void png_default_read_data(png_structp png_ptr, png_bytep data,
+ png_size_t length)
{
int check;
png_byte *n_data;
@@ -250,10 +245,7 @@
#endif /* USE_FAR_KEYWORD */
#if defined(PNG_WRITE_FLUSH_SUPPORTED)
-static void
-png_default_flush(png_structp png_ptr);
-static void
-png_default_flush(png_structp png_ptr)
+static void png_default_flush(png_structp png_ptr)
{
FILE *io_ptr;
io_ptr = (FILE *)CVT_PTR((png_ptr->io_ptr));
@@ -268,8 +260,6 @@
than changing the library. */
#ifndef USE_FAR_KEYWORD
static void
-png_default_write_data(png_structp png_ptr, png_bytep data, png_size_t length);
-static void
png_default_write_data(png_structp png_ptr, png_bytep data, png_size_t length)
{
png_uint_32 check;
@@ -290,8 +280,6 @@
#define MIN(a,b) (a <= b ? a : b)
static void
-png_default_write_data(png_structp png_ptr, png_bytep data, png_size_t length);
-static void
png_default_write_data(png_structp png_ptr, png_bytep data, png_size_t length)
{
png_uint_32 check;
@@ -808,7 +796,7 @@
return (1);
}
- while (1)
+ for(;;)
{
png_size_t num_in, num_out;
@@ -886,13 +874,13 @@
not sure this matters, but it is nice to know, the first of these
tests should be impossible because of the way the macros are set
in pngconf.h */
- #if defined(MAXSEG_64K) && !defined(PNG_MAX_MALLOC_64K)
+#if defined(MAXSEG_64K) && !defined(PNG_MAX_MALLOC_64K)
fprintf(STDERR, " NOTE: Zlib compiled for max 64k, libpng not\n");
- #endif
+#endif
/* I think the following can happen. */
- #if !defined(MAXSEG_64K) && defined(PNG_MAX_MALLOC_64K)
+#if !defined(MAXSEG_64K) && defined(PNG_MAX_MALLOC_64K)
fprintf(STDERR, " NOTE: libpng compiled for max 64k, zlib not\n");
- #endif
+#endif
if (strcmp(png_libpng_ver, PNG_LIBPNG_VER_STRING))
{