From ec3f94987458831a00481735f9096bc9a82229bb Mon Sep 17 00:00:00 2001 From: Glenn Randers-Pehrson Date: Mon, 9 Nov 2009 10:49:12 -0600 Subject: [PATCH] [devel] Fixed some deprecated usages in the contrib directory. --- ANNOUNCE | 4 ++++ CHANGES | 4 ++++ contrib/gregbook/readpng2.c | 9 ++++++--- contrib/pngminim/decoder/makefile | 2 +- contrib/pngminim/encoder/makefile | 2 +- contrib/pngminim/preader/makefile | 2 +- contrib/pngminus/png2pnm.c | 4 ++-- contrib/visupng/PngFile.c | 2 +- 8 files changed, 20 insertions(+), 9 deletions(-) diff --git a/ANNOUNCE b/ANNOUNCE index 0a3921d7b..be7a01583 100644 --- a/ANNOUNCE +++ b/ANNOUNCE @@ -641,6 +641,10 @@ version 1.4.0beta94 [November 9, 2009] Only #define PNG_DEPSTRUCT, etc. in pngconf.h if not already defined. version 1.4.0beta95 [November 9, 2009] + Changed png_check_sig() to !png_sig_cmp() in contrib programs. + Added -DPNG_CONFIGURE_LIBPNG to contrib/pngminm/*/makefile + Changed png_check_sig() to !png_sig_cmp() in contrib programs. + Corrected the png_get_IHDR() call in contrib/gregbook/readpng2.c Send comments/corrections/commendations to png-mng-implement at lists.sf.net (subscription required; visit diff --git a/CHANGES b/CHANGES index bf631baf7..28780e385 100644 --- a/CHANGES +++ b/CHANGES @@ -2327,6 +2327,10 @@ version 1.4.0beta94 [November 9, 2009] Only #define PNG_DEPSTRUCT, etc. in pngconf.h if not already defined. version 1.4.0beta95 [November 9, 2009] + Changed png_check_sig() to !png_sig_cmp() in contrib programs. + Added -DPNG_CONFIGURE_LIBPNG to contrib/pngminm/*/makefile + Changed png_check_sig() to !png_sig_cmp() in contrib programs. + Corrected the png_get_IHDR() call in contrib/gregbook/readpng2.c Send comments/corrections/commendations to png-mng-implement at lists.sf.net (subscription required; visit diff --git a/contrib/gregbook/readpng2.c b/contrib/gregbook/readpng2.c index 0874b0a1c..2ee6b681f 100644 --- a/contrib/gregbook/readpng2.c +++ b/contrib/gregbook/readpng2.c @@ -159,7 +159,7 @@ void readpng2_version_info(void) int readpng2_check_sig(uch *sig, int num) { - return (!png_sig_cmp(sig, 0, num)); + return !png_sig_cmp(sig, 0, num); } @@ -379,6 +379,7 @@ static void readpng2_info_callback(png_structp png_ptr, png_infop info_ptr) { mainprog_info *mainprog_ptr; int color_type, bit_depth; + png_uint_32 width, height; double gamma; @@ -414,8 +415,10 @@ static void readpng2_info_callback(png_structp png_ptr, png_infop info_ptr) /* this is just like in the non-progressive case */ - png_get_IHDR(png_ptr, info_ptr, &mainprog_ptr->width, - &mainprog_ptr->height, &bit_depth, &color_type, NULL, NULL, NULL); + png_get_IHDR(png_ptr, info_ptr, &width, &height, &bit_depth, &color_type, + NULL, NULL, NULL); + mainprog_ptr->width = (ulg)width; + mainprog_ptr->height = (ulg)height; /* since we know we've read all of the PNG file's "header" (i.e., up diff --git a/contrib/pngminim/decoder/makefile b/contrib/pngminim/decoder/makefile index 27e04cbde..5f468601e 100644 --- a/contrib/pngminim/decoder/makefile +++ b/contrib/pngminim/decoder/makefile @@ -7,7 +7,7 @@ LD=$(CC) RM=rm -f -CFLAGS=-DPNG_USER_CONFIG -DNO_GZCOMPRESS -DNO_GZIP \ +CFLAGS=-DPNG_CONFIGURE_LIBPNG -DPNG_USER_CONFIG -DNO_GZCOMPRESS -DNO_GZIP \ -DdeflateParams\(a,b,c\)=Z_OK -I. -O1 C=.c diff --git a/contrib/pngminim/encoder/makefile b/contrib/pngminim/encoder/makefile index 1182b5b23..5e86f8921 100644 --- a/contrib/pngminim/encoder/makefile +++ b/contrib/pngminim/encoder/makefile @@ -7,7 +7,7 @@ LD=$(CC) RM=rm -f -CFLAGS=-DPNG_USER_CONFIG -DNO_GZIP -I. -O1 +CFLAGS=-DPNG_CONFIGURE_LIBPNG -DPNG_USER_CONFIG -DNO_GZIP -I. -O1 C=.c O=.o diff --git a/contrib/pngminim/preader/makefile b/contrib/pngminim/preader/makefile index 74a17a38f..2dcb3fddc 100644 --- a/contrib/pngminim/preader/makefile +++ b/contrib/pngminim/preader/makefile @@ -23,7 +23,7 @@ XLIB = -L/usr/X11R6/lib -lX11 #LIBS = $(XLIB) LIBS = $(XLIB) -lm #platforms that need libm -CFLAGS=-DPNG_USER_CONFIG -DNO_GZCOMPRESS -DNO_GZIP \ +CFLAGS=-DPNG_CONFIGURE_LIBPNG -DPNG_USER_CONFIG -DNO_GZCOMPRESS -DNO_GZIP \ -DdeflateParams\(a,b,c\)=Z_OK -I. $(XINC) -O1 C=.c diff --git a/contrib/pngminus/png2pnm.c b/contrib/pngminus/png2pnm.c index 010870a76..326f1443a 100644 --- a/contrib/pngminus/png2pnm.c +++ b/contrib/pngminus/png2pnm.c @@ -211,8 +211,8 @@ BOOL png2pnm (FILE *png_file, FILE *pnm_file, FILE *alpha_file, BOOL raw, BOOL a if (ret != 8) return FALSE; - ret = png_check_sig (buf, 8); - if (!ret) + ret = png_sig_cmp (buf, 0, 8); + if (ret) return FALSE; /* create png and info structures */ diff --git a/contrib/visupng/PngFile.c b/contrib/visupng/PngFile.c index 953204bd3..db0219e35 100644 --- a/contrib/visupng/PngFile.c +++ b/contrib/visupng/PngFile.c @@ -126,7 +126,7 @@ BOOL PngLoadImage (PTSTR pstrFileName, png_byte **ppbImageData, // first check the eight byte PNG signature fread(pbSig, 1, 8, pfFile); - if (!png_check_sig(pbSig, 8)) + if (png_sig_cmp(pbSig, 0, 8)) { *ppbImageData = pbImageData = NULL; return FALSE;