| @@ -1,27 +1,35 @@ | | | @@ -1,27 +1,35 @@ |
1 | $NetBSD: patch-af,v 1.2 2006/05/17 01:53:17 reed Exp $ | | 1 | $NetBSD: patch-af,v 1.3 2011/05/21 17:23:10 wiz Exp $ |
2 | | | 2 | |
3 | --- src/mngutil.c.orig 2004-02-14 11:55:36.000000000 +0100 | | 3 | Do not redeclare png functions. |
| | | 4 | png_ptr's members are hidden now, so don't access them. |
| | | 5 | XXX: this patch won't work if some bytes were already written, |
| | | 6 | but why should they have been? Should be done better by upstream. |
| | | 7 | |
| | | 8 | --- src/mngutil.c.orig 2004-02-14 10:55:36.000000000 +0000 |
4 | +++ src/mngutil.c | | 9 | +++ src/mngutil.c |
5 | @@ -30,13 +30,6 @@ | | 10 | @@ -30,13 +30,6 @@ |
6 | #include <png.h> | | 11 | #include <png.h> |
7 | #include "mngutil.h" | | 12 | #include "mngutil.h" |
8 | | | 13 | |
9 | -extern void png_write_data (png_structp png_ptr, | | 14 | -extern void png_write_data (png_structp png_ptr, |
10 | - png_bytep data,png_size_t length); | | 15 | - png_bytep data,png_size_t length); |
11 | -extern void png_save_uint_32 (png_bytep buf, png_uint_32 i); | | 16 | -extern void png_save_uint_32 (png_bytep buf, png_uint_32 i); |
12 | -extern void png_save_uint_16 (png_bytep buf, png_uint_16 i); | | 17 | -extern void png_save_uint_16 (png_bytep buf, png_uint_16 i); |
13 | -extern void png_write_chunk (png_structp png_ptr, | | 18 | -extern void png_write_chunk (png_structp png_ptr, |
14 | - png_bytep chunk_name, png_bytep data, png_size_t length); | | 19 | - png_bytep chunk_name, png_bytep data, png_size_t length); |
15 | - | | 20 | - |
16 | png_byte mng_sig[8] = {138, 77, 78, 71, 13, 10, 26, 10}; | | 21 | png_byte mng_sig[8] = {138, 77, 78, 71, 13, 10, 26, 10}; |
17 | | | 22 | |
18 | /* | | 23 | /* |
19 | @@ -46,7 +39,7 @@ void | | 24 | @@ -45,9 +38,8 @@ png_byte mng_sig[8] = {138, 77, 78, 71, |
| | | 25 | void |
20 | mng_write_sig (png_structp png_ptr) | | 26 | mng_write_sig (png_structp png_ptr) |
21 | { | | 27 | { |
22 | /* write the rest of the 8 byte signature */ | | 28 | - /* write the rest of the 8 byte signature */ |
23 | - png_write_data (png_ptr, &mng_sig[png_ptr->sig_bytes], | | 29 | - png_write_data (png_ptr, &mng_sig[png_ptr->sig_bytes], |
24 | + png_write_chunk_data (png_ptr, &mng_sig[png_ptr->sig_bytes], | | 30 | - (png_size_t)8 - png_ptr->sig_bytes); |
25 | (png_size_t)8 - png_ptr->sig_bytes); | | 31 | + /* write the 8 byte signature */ |
| | | 32 | + png_write_chunk_data (png_ptr, mng_sig, 8); |
26 | } | | 33 | } |
27 | | | 34 | |
| | | 35 | |