diff --git a/ANNOUNCE b/ANNOUNCE index 8d513d3dd..f2dc7be44 100644 --- a/ANNOUNCE +++ b/ANNOUNCE @@ -553,6 +553,8 @@ version 1.4.0beta80 [September 17, 2009] version 1.4.0beta81 [September 20, 2009] Eliminated unused PNG_FLAG_FREE_* defines from pngpriv.h Expanded TAB characters in pngrtran.c + Removed PNG_CONST from all "PNG_CONST PNG_CHNK" declarations to avoid + compiler complaints about doubly declaring things "const". version 1.4.0betaN [future] Build shared libraries with -lz and sometimes -lm. diff --git a/CHANGES b/CHANGES index 5e2cd3945..7f8ddbcbd 100644 --- a/CHANGES +++ b/CHANGES @@ -2239,6 +2239,8 @@ version 1.4.0beta80 [September 17, 2009] version 1.4.0beta81 [September 20, 2009] Eliminated unused PNG_FLAG_FREE_* defines from pngpriv.h Expanded TAB characters in pngrtran.c + Removed PNG_CONST from all "PNG_CONST PNG_CHNK" declarations to avoid + compiler complaints about doubly declaring things "const". version 1.4.0betaN [future] Build shared libraries with -lz and sometimes -lm. diff --git a/pngpread.c b/pngpread.c index 563b7f4d4..e5a668bd2 100644 --- a/pngpread.c +++ b/pngpread.c @@ -1,7 +1,7 @@ /* pngpread.c - read a png file in push mode * - * Last changed in libpng 1.4.0 [September 17, 2009] + * Last changed in libpng 1.4.0 [September 20, 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.) @@ -149,60 +149,60 @@ png_push_read_sig(png_structp png_ptr, png_infop info_ptr) void /* PRIVATE */ png_push_read_chunk(png_structp png_ptr, png_infop info_ptr) { - PNG_CONST PNG_IHDR; - PNG_CONST PNG_IDAT; - PNG_CONST PNG_IEND; - PNG_CONST PNG_PLTE; + PNG_IHDR; + PNG_IDAT; + PNG_IEND; + PNG_PLTE; #if defined(PNG_READ_bKGD_SUPPORTED) - PNG_CONST PNG_bKGD; + PNG_bKGD; #endif #if defined(PNG_READ_cHRM_SUPPORTED) - PNG_CONST PNG_cHRM; + PNG_cHRM; #endif #if defined(PNG_READ_gAMA_SUPPORTED) - PNG_CONST PNG_gAMA; + PNG_gAMA; #endif #if defined(PNG_READ_hIST_SUPPORTED) - PNG_CONST PNG_hIST; + PNG_hIST; #endif #if defined(PNG_READ_iCCP_SUPPORTED) - PNG_CONST PNG_iCCP; + PNG_iCCP; #endif #if defined(PNG_READ_iTXt_SUPPORTED) - PNG_CONST PNG_iTXt; + PNG_iTXt; #endif #if defined(PNG_READ_oFFs_SUPPORTED) - PNG_CONST PNG_oFFs; + PNG_oFFs; #endif #if defined(PNG_READ_pCAL_SUPPORTED) - PNG_CONST PNG_pCAL; + PNG_pCAL; #endif #if defined(PNG_READ_pHYs_SUPPORTED) - PNG_CONST PNG_pHYs; + PNG_pHYs; #endif #if defined(PNG_READ_sBIT_SUPPORTED) - PNG_CONST PNG_sBIT; + PNG_sBIT; #endif #if defined(PNG_READ_sCAL_SUPPORTED) - PNG_CONST PNG_sCAL; + PNG_sCAL; #endif #if defined(PNG_READ_sRGB_SUPPORTED) - PNG_CONST PNG_sRGB; + PNG_sRGB; #endif #if defined(PNG_READ_sPLT_SUPPORTED) - PNG_CONST PNG_sPLT; + PNG_sPLT; #endif #if defined(PNG_READ_tEXt_SUPPORTED) - PNG_CONST PNG_tEXt; + PNG_tEXt; #endif #if defined(PNG_READ_tIME_SUPPORTED) - PNG_CONST PNG_tIME; + PNG_tIME; #endif #if defined(PNG_READ_tRNS_SUPPORTED) - PNG_CONST PNG_tRNS; + PNG_tRNS; #endif #if defined(PNG_READ_zTXt_SUPPORTED) - PNG_CONST PNG_zTXt; + PNG_zTXt; #endif /* First we make sure we have enough data for the 4 byte chunk name * and the 4 byte chunk length before proceeding with decoding the @@ -726,7 +726,7 @@ png_push_restore_buffer(png_structp png_ptr, png_bytep buffer, void /* PRIVATE */ png_push_read_IDAT(png_structp png_ptr) { - PNG_CONST PNG_IDAT; + PNG_IDAT; if (!(png_ptr->mode & PNG_HAVE_CHUNK_HEADER)) { png_byte chunk_length[4]; diff --git a/pngpriv.h b/pngpriv.h index 2924f3171..fdc2031bb 100644 --- a/pngpriv.h +++ b/pngpriv.h @@ -199,38 +199,39 @@ (( ((png_size_t)(width) * ((png_size_t)(pixel_bits))) + 7) >> 3) ) /* PNG_OUT_OF_RANGE returns true if value is outside the range - ideal-delta..ideal+delta. Each argument is evaluated twice. - "ideal" and "delta" should be constants, normally simple - integers, "value" a variable. Added to libpng-1.2.6 JB */ + * ideal-delta..ideal+delta. Each argument is evaluated twice. + * "ideal" and "delta" should be constants, normally simple + * integers, "value" a variable. Added to libpng-1.2.6 JB + */ #define PNG_OUT_OF_RANGE(value, ideal, delta) \ ( (value) < (ideal)-(delta) || (value) > (ideal)+(delta) ) /* Constant strings for known chunk types. If you need to add a chunk, - * define the name here, and add an invocation of the macro in png.c and - * wherever it's needed. + * define the name here, and add an invocation of the macro wherever it's + * needed. */ -#define PNG_IHDR const png_byte png_IHDR[5] = { 73, 72, 68, 82, '\0'} -#define PNG_IDAT const png_byte png_IDAT[5] = { 73, 68, 65, 84, '\0'} -#define PNG_IEND const png_byte png_IEND[5] = { 73, 69, 78, 68, '\0'} -#define PNG_PLTE const png_byte png_PLTE[5] = { 80, 76, 84, 69, '\0'} -#define PNG_bKGD const png_byte png_bKGD[5] = { 98, 75, 71, 68, '\0'} -#define PNG_cHRM const png_byte png_cHRM[5] = { 99, 72, 82, 77, '\0'} -#define PNG_gAMA const png_byte png_gAMA[5] = {103, 65, 77, 65, '\0'} -#define PNG_hIST const png_byte png_hIST[5] = {104, 73, 83, 84, '\0'} -#define PNG_iCCP const png_byte png_iCCP[5] = {105, 67, 67, 80, '\0'} -#define PNG_iTXt const png_byte png_iTXt[5] = {105, 84, 88, 116, '\0'} -#define PNG_oFFs const png_byte png_oFFs[5] = {111, 70, 70, 115, '\0'} -#define PNG_pCAL const png_byte png_pCAL[5] = {112, 67, 65, 76, '\0'} -#define PNG_sCAL const png_byte png_sCAL[5] = {115, 67, 65, 76, '\0'} -#define PNG_pHYs const png_byte png_pHYs[5] = {112, 72, 89, 115, '\0'} -#define PNG_sBIT const png_byte png_sBIT[5] = {115, 66, 73, 84, '\0'} -#define PNG_sPLT const png_byte png_sPLT[5] = {115, 80, 76, 84, '\0'} -#define PNG_sRGB const png_byte png_sRGB[5] = {115, 82, 71, 66, '\0'} -#define PNG_sTER const png_byte png_sTER[5] = {115, 84, 69, 82, '\0'} -#define PNG_tEXt const png_byte png_tEXt[5] = {116, 69, 88, 116, '\0'} -#define PNG_tIME const png_byte png_tIME[5] = {116, 73, 77, 69, '\0'} -#define PNG_tRNS const png_byte png_tRNS[5] = {116, 82, 78, 83, '\0'} -#define PNG_zTXt const png_byte png_zTXt[5] = {122, 84, 88, 116, '\0'} +#define PNG_IHDR PNG_CONST png_byte png_IHDR[5] = { 73, 72, 68, 82, '\0'} +#define PNG_IDAT PNG_CONST png_byte png_IDAT[5] = { 73, 68, 65, 84, '\0'} +#define PNG_IEND PNG_CONST png_byte png_IEND[5] = { 73, 69, 78, 68, '\0'} +#define PNG_PLTE PNG_CONST png_byte png_PLTE[5] = { 80, 76, 84, 69, '\0'} +#define PNG_bKGD PNG_CONST png_byte png_bKGD[5] = { 98, 75, 71, 68, '\0'} +#define PNG_cHRM PNG_CONST png_byte png_cHRM[5] = { 99, 72, 82, 77, '\0'} +#define PNG_gAMA PNG_CONST png_byte png_gAMA[5] = {103, 65, 77, 65, '\0'} +#define PNG_hIST PNG_CONST png_byte png_hIST[5] = {104, 73, 83, 84, '\0'} +#define PNG_iCCP PNG_CONST png_byte png_iCCP[5] = {105, 67, 67, 80, '\0'} +#define PNG_iTXt PNG_CONST png_byte png_iTXt[5] = {105, 84, 88, 116, '\0'} +#define PNG_oFFs PNG_CONST png_byte png_oFFs[5] = {111, 70, 70, 115, '\0'} +#define PNG_pCAL PNG_CONST png_byte png_pCAL[5] = {112, 67, 65, 76, '\0'} +#define PNG_sCAL PNG_CONST png_byte png_sCAL[5] = {115, 67, 65, 76, '\0'} +#define PNG_pHYs PNG_CONST png_byte png_pHYs[5] = {112, 72, 89, 115, '\0'} +#define PNG_sBIT PNG_CONST png_byte png_sBIT[5] = {115, 66, 73, 84, '\0'} +#define PNG_sPLT PNG_CONST png_byte png_sPLT[5] = {115, 80, 76, 84, '\0'} +#define PNG_sRGB PNG_CONST png_byte png_sRGB[5] = {115, 82, 71, 66, '\0'} +#define PNG_sTER PNG_CONST png_byte png_sTER[5] = {115, 84, 69, 82, '\0'} +#define PNG_tEXt PNG_CONST png_byte png_tEXt[5] = {116, 69, 88, 116, '\0'} +#define PNG_tIME PNG_CONST png_byte png_tIME[5] = {116, 73, 77, 69, '\0'} +#define PNG_tRNS PNG_CONST png_byte png_tRNS[5] = {116, 82, 78, 83, '\0'} +#define PNG_zTXt PNG_CONST png_byte png_zTXt[5] = {122, 84, 88, 116, '\0'} /* Inhibit C++ name-mangling for libpng functions but not for system calls. */ diff --git a/pngread.c b/pngread.c index 9c3ab05db..7caa14e06 100644 --- a/pngread.c +++ b/pngread.c @@ -1,7 +1,7 @@ /* pngread.c - read a PNG file * - * Last changed in libpng 1.4.0 [September 17, 2009] + * Last changed in libpng 1.4.0 [September 20, 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.) @@ -231,60 +231,60 @@ png_read_info(png_structp png_ptr, png_infop info_ptr) for (;;) { - PNG_CONST PNG_IHDR; - PNG_CONST PNG_IDAT; - PNG_CONST PNG_IEND; - PNG_CONST PNG_PLTE; + PNG_IHDR; + PNG_IDAT; + PNG_IEND; + PNG_PLTE; #if defined(PNG_READ_bKGD_SUPPORTED) - PNG_CONST PNG_bKGD; + PNG_bKGD; #endif #if defined(PNG_READ_cHRM_SUPPORTED) - PNG_CONST PNG_cHRM; + PNG_cHRM; #endif #if defined(PNG_READ_gAMA_SUPPORTED) - PNG_CONST PNG_gAMA; + PNG_gAMA; #endif #if defined(PNG_READ_hIST_SUPPORTED) - PNG_CONST PNG_hIST; + PNG_hIST; #endif #if defined(PNG_READ_iCCP_SUPPORTED) - PNG_CONST PNG_iCCP; + PNG_iCCP; #endif #if defined(PNG_READ_iTXt_SUPPORTED) - PNG_CONST PNG_iTXt; + PNG_iTXt; #endif #if defined(PNG_READ_oFFs_SUPPORTED) - PNG_CONST PNG_oFFs; + PNG_oFFs; #endif #if defined(PNG_READ_pCAL_SUPPORTED) - PNG_CONST PNG_pCAL; + PNG_pCAL; #endif #if defined(PNG_READ_pHYs_SUPPORTED) - PNG_CONST PNG_pHYs; + PNG_pHYs; #endif #if defined(PNG_READ_sBIT_SUPPORTED) - PNG_CONST PNG_sBIT; + PNG_sBIT; #endif #if defined(PNG_READ_sCAL_SUPPORTED) - PNG_CONST PNG_sCAL; + PNG_sCAL; #endif #if defined(PNG_READ_sPLT_SUPPORTED) - PNG_CONST PNG_sPLT; + PNG_sPLT; #endif #if defined(PNG_READ_sRGB_SUPPORTED) - PNG_CONST PNG_sRGB; + PNG_sRGB; #endif #if defined(PNG_READ_tEXt_SUPPORTED) - PNG_CONST PNG_tEXt; + PNG_tEXt; #endif #if defined(PNG_READ_tIME_SUPPORTED) - PNG_CONST PNG_tIME; + PNG_tIME; #endif #if defined(PNG_READ_tRNS_SUPPORTED) - PNG_CONST PNG_tRNS; + PNG_tRNS; #endif #if defined(PNG_READ_zTXt_SUPPORTED) - PNG_CONST PNG_zTXt; + PNG_zTXt; #endif png_uint_32 length = png_read_chunk_header(png_ptr); PNG_CONST png_bytep chunk_name = png_ptr->chunk_name; @@ -445,7 +445,7 @@ png_start_read_image(png_structp png_ptr) void PNGAPI png_read_row(png_structp png_ptr, png_bytep row, png_bytep dsp_row) { - PNG_CONST PNG_IDAT; + PNG_IDAT; PNG_CONST int png_pass_dsp_mask[7] = {0xff, 0x0f, 0xff, 0x33, 0xff, 0x55, 0xff}; PNG_CONST int png_pass_mask[7] = {0x80, 0x08, 0x88, 0x22, 0xaa, 0x55, 0xff}; @@ -802,60 +802,60 @@ png_read_end(png_structp png_ptr, png_infop info_ptr) do { - PNG_CONST PNG_IHDR; - PNG_CONST PNG_IDAT; - PNG_CONST PNG_IEND; - PNG_CONST PNG_PLTE; + PNG_IHDR; + PNG_IDAT; + PNG_IEND; + PNG_PLTE; #if defined(PNG_READ_bKGD_SUPPORTED) - PNG_CONST PNG_bKGD; + PNG_bKGD; #endif #if defined(PNG_READ_cHRM_SUPPORTED) - PNG_CONST PNG_cHRM; + PNG_cHRM; #endif #if defined(PNG_READ_gAMA_SUPPORTED) - PNG_CONST PNG_gAMA; + PNG_gAMA; #endif #if defined(PNG_READ_hIST_SUPPORTED) - PNG_CONST PNG_hIST; + PNG_hIST; #endif #if defined(PNG_READ_iCCP_SUPPORTED) - PNG_CONST PNG_iCCP; + PNG_iCCP; #endif #if defined(PNG_READ_iTXt_SUPPORTED) - PNG_CONST PNG_iTXt; + PNG_iTXt; #endif #if defined(PNG_READ_oFFs_SUPPORTED) - PNG_CONST PNG_oFFs; + PNG_oFFs; #endif #if defined(PNG_READ_pCAL_SUPPORTED) - PNG_CONST PNG_pCAL; + PNG_pCAL; #endif #if defined(PNG_READ_pHYs_SUPPORTED) - PNG_CONST PNG_pHYs; + PNG_pHYs; #endif #if defined(PNG_READ_sBIT_SUPPORTED) - PNG_CONST PNG_sBIT; + PNG_sBIT; #endif #if defined(PNG_READ_sCAL_SUPPORTED) - PNG_CONST PNG_sCAL; + PNG_sCAL; #endif #if defined(PNG_READ_sPLT_SUPPORTED) - PNG_CONST PNG_sPLT; + PNG_sPLT; #endif #if defined(PNG_READ_sRGB_SUPPORTED) - PNG_CONST PNG_sRGB; + PNG_sRGB; #endif #if defined(PNG_READ_tEXt_SUPPORTED) - PNG_CONST PNG_tEXt; + PNG_tEXt; #endif #if defined(PNG_READ_tIME_SUPPORTED) - PNG_CONST PNG_tIME; + PNG_tIME; #endif #if defined(PNG_READ_tRNS_SUPPORTED) - PNG_CONST PNG_tRNS; + PNG_tRNS; #endif #if defined(PNG_READ_zTXt_SUPPORTED) - PNG_CONST PNG_zTXt; + PNG_zTXt; #endif png_uint_32 length = png_read_chunk_header(png_ptr); PNG_CONST png_bytep chunk_name = png_ptr->chunk_name;