summaryrefslogtreecommitdiff
path: root/Build
diff options
context:
space:
mode:
authorPeter Breitenlohner <peb@mppmu.mpg.de>2014-08-19 10:06:19 +0000
committerPeter Breitenlohner <peb@mppmu.mpg.de>2014-08-19 10:06:19 +0000
commit092fdbe5bdea0ae250210a394363a4f618b27eea (patch)
tree625e62a2a938d75aa17f7f6204bb588c36371802 /Build
parent495f660b981136a457e736a2e6cff8eda4a55e16 (diff)
LuaTeX, pdfTeX, XeTeX: Avoid PNG warnings
git-svn-id: svn://tug.org/texlive/trunk@34978 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build')
-rw-r--r--Build/source/texk/web2c/luatexdir/image/writepng.w7
-rw-r--r--Build/source/texk/web2c/pdftexdir/writepng.c7
-rw-r--r--Build/source/texk/web2c/xetexdir/image/pngimage.c7
3 files changed, 18 insertions, 3 deletions
diff --git a/Build/source/texk/web2c/luatexdir/image/writepng.w b/Build/source/texk/web2c/luatexdir/image/writepng.w
index 5e2f34e1570..50eec4636f2 100644
--- a/Build/source/texk/web2c/luatexdir/image/writepng.w
+++ b/Build/source/texk/web2c/luatexdir/image/writepng.w
@@ -45,6 +45,11 @@ static void close_and_cleanup_png(image_dict * idict)
}
@ @c
+static void warn(png_structp png_ptr, png_const_charp msg)
+{
+ (void)png_ptr; (void)msg; /* Make compiler happy */
+}
+
void read_png_info(image_dict * idict, img_readtype_e readtype)
{
png_structp png_p;
@@ -59,7 +64,7 @@ void read_png_info(image_dict * idict, img_readtype_e readtype)
assert(img_png_ptr(idict) == NULL);
img_png_ptr(idict) = xtalloc(1, png_img_struct);
if ((png_p = png_create_read_struct(PNG_LIBPNG_VER_STRING,
- NULL, NULL, NULL)) == NULL)
+ NULL, NULL, warn)) == NULL)
luatex_fail("libpng: png_create_read_struct() failed");
img_png_png_ptr(idict) = png_p;
if ((info_p = png_create_info_struct(png_p)) == NULL)
diff --git a/Build/source/texk/web2c/pdftexdir/writepng.c b/Build/source/texk/web2c/pdftexdir/writepng.c
index 6371e934089..5713880f6e1 100644
--- a/Build/source/texk/web2c/pdftexdir/writepng.c
+++ b/Build/source/texk/web2c/pdftexdir/writepng.c
@@ -22,12 +22,17 @@ with this program. If not, see <http://www.gnu.org/licenses/>.
static int transparent_page_group = 0;
+static void warn(png_structp png_ptr, png_const_charp msg)
+{
+ (void)png_ptr; (void)msg; /* Make compiler happy */
+}
+
void read_png_info(integer img)
{
FILE *png_file = xfopen(img_name(img), FOPEN_RBIN_MODE);
if ((png_ptr(img) = png_create_read_struct(PNG_LIBPNG_VER_STRING,
- NULL, NULL, NULL)) == NULL)
+ NULL, NULL, warn)) == NULL)
pdftex_fail("libpng: png_create_read_struct() failed");
if ((png_info(img) = png_create_info_struct(png_ptr(img))) == NULL)
pdftex_fail("libpng: png_create_info_struct() failed");
diff --git a/Build/source/texk/web2c/xetexdir/image/pngimage.c b/Build/source/texk/web2c/xetexdir/image/pngimage.c
index 27e74fbbfc3..ec677528130 100644
--- a/Build/source/texk/web2c/xetexdir/image/pngimage.c
+++ b/Build/source/texk/web2c/xetexdir/image/pngimage.c
@@ -94,6 +94,11 @@
#define PDF_TRANS_TYPE_BINARY 1
#define PDF_TRANS_TYPE_ALPHA 2
+static void warn(png_structp png_ptr, png_const_charp msg)
+{
+ (void)png_ptr; (void)msg; /* Make compiler happy */
+}
+
int
check_for_png (FILE *png_file)
{
@@ -118,7 +123,7 @@ png_scan_file (struct png_info *info, FILE *png_file)
png_uint_32 width, height;
rewind (png_file);
- png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
+ png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, warn);
if (png_ptr == NULL ||
(png_info_ptr = png_create_info_struct (png_ptr)) == NULL) {
fprintf(stderr, "WARNING: %s: Creating Libpng read/info struct failed.", PNG_DEBUG_STR);