Imported from libpng-0.99j.tar

This commit is contained in:
Glenn Randers-Pehrson 1998-03-07 11:24:03 -06:00
parent 08a3343e05
commit 983ec160b4
3 changed files with 24 additions and 24 deletions

View File

@ -1704,7 +1704,7 @@ png_do_read_interlace(png_row_infop row_info, png_bytep row, int pass,
case 1: case 1:
{ {
png_bytep sp, dp; png_bytep sp, dp;
png_uint_32 sshift, dshift; int sshift, dshift;
int s_start, s_end, s_inc; int s_start, s_end, s_inc;
png_byte v; png_byte v;
png_uint_32 i; png_uint_32 i;
@ -1715,8 +1715,8 @@ png_do_read_interlace(png_row_infop row_info, png_bytep row, int pass,
#if defined(PNG_READ_PACKSWAP_SUPPORTED) #if defined(PNG_READ_PACKSWAP_SUPPORTED)
if (transformations & PNG_PACKSWAP) if (transformations & PNG_PACKSWAP)
{ {
sshift = (png_uint_32)((row_info->width + 7) & 7); sshift = (int)((row_info->width + 7) & 7);
dshift = (png_uint_32)((final_width + 7) & 7); dshift = (int)((final_width + 7) & 7);
s_start = 7; s_start = 7;
s_end = 0; s_end = 0;
s_inc = -1; s_inc = -1;
@ -1724,8 +1724,8 @@ png_do_read_interlace(png_row_infop row_info, png_bytep row, int pass,
else else
#endif #endif
{ {
sshift = 7 - (png_uint_32)((row_info->width + 7) & 7); sshift = 7 - (int)((row_info->width + 7) & 7);
dshift = 7 - (png_uint_32)((final_width + 7) & 7); dshift = 7 - (int)((final_width + 7) & 7);
s_start = 0; s_start = 0;
s_end = 7; s_end = 7;
s_inc = 1; s_inc = 1;
@ -1759,7 +1759,7 @@ png_do_read_interlace(png_row_infop row_info, png_bytep row, int pass,
case 2: case 2:
{ {
png_bytep sp, dp; png_bytep sp, dp;
png_uint_32 sshift, dshift; int sshift, dshift;
int s_start, s_end, s_inc; int s_start, s_end, s_inc;
png_uint_32 i; png_uint_32 i;
@ -1768,8 +1768,8 @@ png_do_read_interlace(png_row_infop row_info, png_bytep row, int pass,
#if defined(PNG_READ_PACKSWAP_SUPPORTED) #if defined(PNG_READ_PACKSWAP_SUPPORTED)
if (transformations & PNG_PACKSWAP) if (transformations & PNG_PACKSWAP)
{ {
sshift = (png_uint_32)(((row_info->width + 3) & 3) << 1); sshift = (int)(((row_info->width + 3) & 3) << 1);
dshift = (png_uint_32)(((final_width + 3) & 3) << 1); dshift = (int)(((final_width + 3) & 3) << 1);
s_start = 6; s_start = 6;
s_end = 0; s_end = 0;
s_inc = -2; s_inc = -2;
@ -1777,8 +1777,8 @@ png_do_read_interlace(png_row_infop row_info, png_bytep row, int pass,
else else
#endif #endif
{ {
sshift = (png_uint_32)((3 - ((row_info->width + 3) & 3)) << 1); sshift = (int)((3 - ((row_info->width + 3) & 3)) << 1);
dshift = (png_uint_32)((3 - ((final_width + 3) & 3)) << 1); dshift = (int)((3 - ((final_width + 3) & 3)) << 1);
s_start = 0; s_start = 0;
s_end = 6; s_end = 6;
s_inc = 2; s_inc = 2;
@ -1815,7 +1815,7 @@ png_do_read_interlace(png_row_infop row_info, png_bytep row, int pass,
case 4: case 4:
{ {
png_bytep sp, dp; png_bytep sp, dp;
png_uint_32 sshift, dshift; int sshift, dshift;
int s_start, s_end, s_inc; int s_start, s_end, s_inc;
png_uint_32 i; png_uint_32 i;
@ -1824,8 +1824,8 @@ png_do_read_interlace(png_row_infop row_info, png_bytep row, int pass,
#if defined(PNG_READ_PACKSWAP_SUPPORTED) #if defined(PNG_READ_PACKSWAP_SUPPORTED)
if (transformations & PNG_PACKSWAP) if (transformations & PNG_PACKSWAP)
{ {
sshift = (png_uint_32)(((row_info->width + 1) & 1) << 2); sshift = (int)(((row_info->width + 1) & 1) << 2);
dshift = (png_uint_32)(((final_width + 1) & 1) << 2); dshift = (int)(((final_width + 1) & 1) << 2);
s_start = 4; s_start = 4;
s_end = 0; s_end = 0;
s_inc = -4; s_inc = -4;
@ -1833,8 +1833,8 @@ png_do_read_interlace(png_row_infop row_info, png_bytep row, int pass,
else else
#endif #endif
{ {
sshift = (png_uint_32)((1 - ((row_info->width + 1) & 1)) << 2); sshift = (int)((1 - ((row_info->width + 1) & 1)) << 2);
dshift = (png_uint_32)((1 - ((final_width + 1) & 1)) << 2); dshift = (int)((1 - ((final_width + 1) & 1)) << 2);
s_start = 0; s_start = 0;
s_end = 4; s_end = 4;
s_inc = 4; s_inc = 4;

View File

@ -54,7 +54,7 @@ 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);
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 > 0x3fffffff) return; if(png_ptr == NULL || row_number > 0x3fffffffL) return;
if(status_pass != pass) if(status_pass != pass)
{ {
fprintf(stdout,"\n Pass %d: ",pass); fprintf(stdout,"\n Pass %d: ",pass);
@ -72,7 +72,7 @@ void read_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); 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) void write_row_callback(png_structp png_ptr, png_uint_32 row_number, int pass)
{ {
if(png_ptr == NULL || row_number > 0x3fffffff || pass > 7) return; if(png_ptr == NULL || row_number > 0x3fffffffL || pass > 7) return;
fprintf(stdout, "w"); fprintf(stdout, "w");
} }
@ -106,7 +106,7 @@ void count_black_pixels(png_structp png_ptr, png_row_infop row_info,
{ {
int pos=0; int pos=0;
png_uint_32 n; png_uint_32 n;
for (n=0; n<(int)row_info->width; n++) for (n=0; n<row_info->width; n++)
{ {
if(row_info->bit_depth == 1) if(row_info->bit_depth == 1)
if(((*dp << pos++ )& 0x80) == 0) black_pixels++; if(((*dp << pos++ )& 0x80) == 0) black_pixels++;
@ -869,8 +869,8 @@ int test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
PNG_CONST char *inname = "pngtest/png"; PNG_CONST char *inname = "pngtest/png";
PNG_CONST char *outname = "pngout/png"; PNG_CONST char *outname = "pngout/png";
#else #else
static char *inname = "pngtest.png"; static PNG_CONST char *inname = "pngtest.png";
static char *outname = "pngout.png"; static PNG_CONST char *outname = "pngout.png";
#endif #endif
int int

View File

@ -834,10 +834,10 @@ png_set_filter_heuristics(png_structp png_ptr, int heuristic_method,
if (png_ptr->filter_weights == NULL) if (png_ptr->filter_weights == NULL)
{ {
png_ptr->filter_weights = png_malloc(png_ptr, png_ptr->filter_weights = (png_uint_16p) png_malloc(png_ptr,
(png_uint_32)(sizeof(png_uint_16) * num_weights)); (png_uint_32)(sizeof(png_uint_16) * num_weights));
png_ptr->inv_filter_weights = png_malloc(png_ptr, png_ptr->inv_filter_weights = (png_uint_16p) png_malloc(png_ptr,
(png_uint_32)(sizeof(png_uint_16) * num_weights)); (png_uint_32)(sizeof(png_uint_16) * num_weights));
for (i = 0; i < num_weights; i++) for (i = 0; i < num_weights; i++)
@ -869,10 +869,10 @@ png_set_filter_heuristics(png_structp png_ptr, int heuristic_method,
*/ */
if (png_ptr->filter_costs == NULL) if (png_ptr->filter_costs == NULL)
{ {
png_ptr->filter_costs = png_malloc(png_ptr, png_ptr->filter_costs = (png_uint_16p) png_malloc(png_ptr,
(png_uint_32)(sizeof(png_uint_16) * PNG_FILTER_VALUE_LAST)); (png_uint_32)(sizeof(png_uint_16) * PNG_FILTER_VALUE_LAST));
png_ptr->inv_filter_costs = (png_uint_16p)png_malloc(png_ptr, png_ptr->inv_filter_costs = (png_uint_16p) png_malloc(png_ptr,
(png_uint_32)(sizeof(png_uint_16) * PNG_FILTER_VALUE_LAST)); (png_uint_32)(sizeof(png_uint_16) * PNG_FILTER_VALUE_LAST));
for (i = 0; i < PNG_FILTER_VALUE_LAST; i++) for (i = 0; i < PNG_FILTER_VALUE_LAST; i++)