diff options
author | dholland <dholland@pkgsrc.org> | 2012-09-29 21:27:14 +0000 |
---|---|---|
committer | dholland <dholland@pkgsrc.org> | 2012-09-29 21:27:14 +0000 |
commit | 0bd7f00b9e4d5f0c35b0fd0e8c17120c78eaec54 (patch) | |
tree | f1dcabcffe76dddb3c2e509504e80909b7203f80 /emulators/vba/patches | |
parent | 82a8f753c2f4a8265f43d6d8e0e459b6903001aa (diff) | |
download | pkgsrc-0bd7f00b9e4d5f0c35b0fd0e8c17120c78eaec54.tar.gz |
Use const syntax correctly. const void * != void *const, and likewise,
given the libz typedef "voidp" for void *, "const voidp" does not magically
inject const inside the typedef'd type. Use the libz typedef "voidpc"
instead. May fix PR 46996.
Diffstat (limited to 'emulators/vba/patches')
-rw-r--r-- | emulators/vba/patches/patch-ag | 20 | ||||
-rw-r--r-- | emulators/vba/patches/patch-src_memgzio.c | 15 | ||||
-rw-r--r-- | emulators/vba/patches/patch-src_memgzio.h | 14 |
3 files changed, 44 insertions, 5 deletions
diff --git a/emulators/vba/patches/patch-ag b/emulators/vba/patches/patch-ag index f118f6c9345..dbbc13dee81 100644 --- a/emulators/vba/patches/patch-ag +++ b/emulators/vba/patches/patch-ag @@ -1,11 +1,21 @@ -$NetBSD: patch-ag,v 1.2 2012/07/18 21:55:41 marino Exp $ +$NetBSD: patch-ag,v 1.3 2012/09/29 21:27:14 dholland Exp $ -Fix build with png-1.5. -GzFile change from void * in libz 1.2.6 -This change required to compile with libz >= 1.2.6 +- Fix build with png-1.5. +- Do not use void * as a synonym for gzFile, as gzFile is no longer + void * in libz 1.2.6. +- Use const syntax correctly: const void * != void *const. --- src/Util.cpp.orig 2004-05-20 17:42:37.000000000 +0000 +++ src/Util.cpp +@@ -47,7 +47,7 @@ extern "C" { + #define _stricmp strcasecmp + #endif // ! _MSC_VER + +-static int (*utilGzWriteFunc)(gzFile, const voidp, unsigned int) = NULL; ++static int (*utilGzWriteFunc)(gzFile, voidpc, unsigned int) = NULL; + static int (*utilGzReadFunc)(gzFile, voidp, unsigned int) = NULL; + static int (*utilGzCloseFunc)(gzFile) = NULL; + @@ -79,7 +79,7 @@ bool utilWritePNGFile(const char *fileNa return false; } @@ -20,7 +30,7 @@ This change required to compile with libz >= 1.2.6 gzFile utilGzOpen(const char *file, const char *mode) { - utilGzWriteFunc = (int (*)(void *,void * const, unsigned int))gzwrite; -+ utilGzWriteFunc = (int (*)(gzFile, void * const, unsigned int))gzwrite; ++ utilGzWriteFunc = (int (*)(gzFile, const void *, unsigned int))gzwrite; utilGzReadFunc = gzread; utilGzCloseFunc = gzclose; diff --git a/emulators/vba/patches/patch-src_memgzio.c b/emulators/vba/patches/patch-src_memgzio.c new file mode 100644 index 00000000000..aff26d496ec --- /dev/null +++ b/emulators/vba/patches/patch-src_memgzio.c @@ -0,0 +1,15 @@ +$NetBSD: patch-src_memgzio.c,v 1.1 2012/09/29 21:27:14 dholland Exp $ + +- Use const types correctly: const void * != void *const. + +--- src/memgzio.c~ 2004-01-17 23:07:32.000000000 +0000 ++++ src/memgzio.c +@@ -540,7 +540,7 @@ int ZEXPORT memgzread (file, buf, len) + */ + int ZEXPORT memgzwrite (file, buf, len) + gzFile file; +- const voidp buf; ++ voidpc buf; + unsigned len; + { + mem_stream *s = (mem_stream*)file; diff --git a/emulators/vba/patches/patch-src_memgzio.h b/emulators/vba/patches/patch-src_memgzio.h new file mode 100644 index 00000000000..d494f9d1ea1 --- /dev/null +++ b/emulators/vba/patches/patch-src_memgzio.h @@ -0,0 +1,14 @@ +$NetBSD: patch-src_memgzio.h,v 1.1 2012/09/29 21:27:14 dholland Exp $ + +- Use const types correctly: const void * != void *const. + +--- src/memgzio.h~ 2003-07-24 13:21:52.000000000 +0000 ++++ src/memgzio.h +@@ -16,6 +16,6 @@ + + gzFile ZEXPORT memgzopen(char *memory, int, const char *); + int ZEXPORT memgzread(gzFile, voidp, unsigned); +-int ZEXPORT memgzwrite(gzFile, const voidp, unsigned); ++int ZEXPORT memgzwrite(gzFile, voidpc, unsigned); + int ZEXPORT memgzclose(gzFile); + long ZEXPORT memtell(gzFile); |