[devel] Fixed some deprecated usages in the contrib directory.

This commit is contained in:
Glenn Randers-Pehrson 2009-11-09 10:49:12 -06:00
parent 884297323d
commit ec3f949874
8 changed files with 20 additions and 9 deletions

View File

@ -641,6 +641,10 @@ version 1.4.0beta94 [November 9, 2009]
Only #define PNG_DEPSTRUCT, etc. in pngconf.h if not already defined. Only #define PNG_DEPSTRUCT, etc. in pngconf.h if not already defined.
version 1.4.0beta95 [November 9, 2009] 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 Send comments/corrections/commendations to png-mng-implement at lists.sf.net
(subscription required; visit (subscription required; visit

View File

@ -2327,6 +2327,10 @@ version 1.4.0beta94 [November 9, 2009]
Only #define PNG_DEPSTRUCT, etc. in pngconf.h if not already defined. Only #define PNG_DEPSTRUCT, etc. in pngconf.h if not already defined.
version 1.4.0beta95 [November 9, 2009] 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 Send comments/corrections/commendations to png-mng-implement at lists.sf.net
(subscription required; visit (subscription required; visit

View File

@ -159,7 +159,7 @@ void readpng2_version_info(void)
int readpng2_check_sig(uch *sig, int num) 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; mainprog_info *mainprog_ptr;
int color_type, bit_depth; int color_type, bit_depth;
png_uint_32 width, height;
double gamma; 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 */ /* this is just like in the non-progressive case */
png_get_IHDR(png_ptr, info_ptr, &mainprog_ptr->width, png_get_IHDR(png_ptr, info_ptr, &width, &height, &bit_depth, &color_type,
&mainprog_ptr->height, &bit_depth, &color_type, NULL, NULL, NULL); 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 /* since we know we've read all of the PNG file's "header" (i.e., up

View File

@ -7,7 +7,7 @@ LD=$(CC)
RM=rm -f 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 -DdeflateParams\(a,b,c\)=Z_OK -I. -O1
C=.c C=.c

View File

@ -7,7 +7,7 @@ LD=$(CC)
RM=rm -f RM=rm -f
CFLAGS=-DPNG_USER_CONFIG -DNO_GZIP -I. -O1 CFLAGS=-DPNG_CONFIGURE_LIBPNG -DPNG_USER_CONFIG -DNO_GZIP -I. -O1
C=.c C=.c
O=.o O=.o

View File

@ -23,7 +23,7 @@ XLIB = -L/usr/X11R6/lib -lX11
#LIBS = $(XLIB) #LIBS = $(XLIB)
LIBS = $(XLIB) -lm #platforms that need libm 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 -DdeflateParams\(a,b,c\)=Z_OK -I. $(XINC) -O1
C=.c C=.c

View File

@ -211,8 +211,8 @@ BOOL png2pnm (FILE *png_file, FILE *pnm_file, FILE *alpha_file, BOOL raw, BOOL a
if (ret != 8) if (ret != 8)
return FALSE; return FALSE;
ret = png_check_sig (buf, 8); ret = png_sig_cmp (buf, 0, 8);
if (!ret) if (ret)
return FALSE; return FALSE;
/* create png and info structures */ /* create png and info structures */

View File

@ -126,7 +126,7 @@ BOOL PngLoadImage (PTSTR pstrFileName, png_byte **ppbImageData,
// first check the eight byte PNG signature // first check the eight byte PNG signature
fread(pbSig, 1, 8, pfFile); fread(pbSig, 1, 8, pfFile);
if (!png_check_sig(pbSig, 8)) if (png_sig_cmp(pbSig, 0, 8))
{ {
*ppbImageData = pbImageData = NULL; *ppbImageData = pbImageData = NULL;
return FALSE; return FALSE;