diff --git a/cc65-2.18-util_zlib_deflater_fix_several_compiler_warnings.patch b/cc65-2.18-util_zlib_deflater_fix_several_compiler_warnings.patch index b6a4c61..e6a20b8 100644 --- a/cc65-2.18-util_zlib_deflater_fix_several_compiler_warnings.patch +++ b/cc65-2.18-util_zlib_deflater_fix_several_compiler_warnings.patch @@ -1,7 +1,7 @@ -From de0ce0ea50b5925572da2aee65a3c39cae7a5ea4 Mon Sep 17 00:00:00 2001 +From e0ac9d5d8e843c0a14f22da0ba1922ae18bccbb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= Date: Sun, 9 Jun 2019 21:07:33 +0200 -Subject: [PATCH 1/2] util/zlib/deflater: Fix several compiler warnings. +Subject: [PATCH] util/zlib/deflater: Fix several compiler warnings. --- util/zlib/deflater.c | 6 +++--- @@ -31,87 +31,3 @@ index 32d01a36e..7e13600ad 100644 argv[1], inlen, argv[2], outlen); return 0; } - -From a30091a3400daa9f1a8ba503e735f52a1e6d775a Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= -Date: Sat, 15 Jun 2019 06:53:27 +0200 -Subject: [PATCH 2/2] zlib: Use correct (un)signedness of char in prototypes - and functions. - -Also ensure we are using the same constness qualifiers. ---- - include/zlib.h | 7 ++++--- - libsrc/zlib/inflatemem.s | 3 ++- - libsrc/zlib/uncompress.c | 9 ++++----- - 3 files changed, 10 insertions(+), 9 deletions(-) - -diff --git a/include/zlib.h b/include/zlib.h -index 8ced89800..3f6c2b27b 100644 ---- a/include/zlib.h -+++ b/include/zlib.h -@@ -48,7 +48,8 @@ - #define Z_NULL 0 - - --unsigned __fastcall__ inflatemem (char* dest, const char* source); -+unsigned __fastcall__ inflatemem (unsigned char* dest, -+ const unsigned char* source); - /* - Decompresses the source buffer into the destination buffer. - Returns the size of the uncompressed data (number of bytes written starting -@@ -83,8 +84,8 @@ unsigned __fastcall__ inflatemem (char* dest, const char* source); - */ - - --int __fastcall__ uncompress (char* dest, unsigned* destLen, -- const char* source, unsigned sourceLen); -+int __fastcall__ uncompress (unsigned char* dest, unsigned* destLen, -+ const unsigned char* source, unsigned sourceLen); - /* - Original zlib description: - -diff --git a/libsrc/zlib/inflatemem.s b/libsrc/zlib/inflatemem.s -index bc89f2016..80c19f223 100644 ---- a/libsrc/zlib/inflatemem.s -+++ b/libsrc/zlib/inflatemem.s -@@ -1,7 +1,8 @@ - ; - ; 2017-11-07, Piotr Fusik - ; --; unsigned __fastcall__ inflatemem (char* dest, const char* source); -+; unsigned __fastcall__ inflatemem (unsigned char* dest, -+; const unsigned char* source); - ; - ; NOTE: Be extremely careful with modifications, because this code is heavily - ; optimized for size (for example assumes certain register and flag values -diff --git a/libsrc/zlib/uncompress.c b/libsrc/zlib/uncompress.c -index 4e449a3ef..61838b47d 100644 ---- a/libsrc/zlib/uncompress.c -+++ b/libsrc/zlib/uncompress.c -@@ -6,11 +6,11 @@ - - #include - --int __fastcall__ uncompress (char* dest, unsigned* destLen, -- const char* source, unsigned sourceLen) -+int __fastcall__ uncompress (unsigned char* dest, unsigned* destLen, -+ const unsigned char* source, unsigned sourceLen) - { - unsigned len; -- unsigned char* ptr; -+ const unsigned char* ptr = source + sourceLen - 4; - unsigned long csum; - /* source[0]: Compression method and flags - bits 0 to 3: Compression method (must be Z_DEFLATED) -@@ -22,10 +22,9 @@ int __fastcall__ uncompress (char* dest, unsigned* destLen, - */ - if ((source[0] & 0x8f) != Z_DEFLATED || source[1] & 0x20) - return Z_DATA_ERROR; -- if ((((unsigned) source[0] << 8) | (unsigned char) source[1]) % 31) -+ if ((((unsigned) source[0] << 8) | source[1]) % 31) - return Z_DATA_ERROR; - *destLen = len = inflatemem(dest, source + 2); -- ptr = (unsigned char*) source + sourceLen - 4; - csum = adler32(adler32(0L, Z_NULL, 0), dest, len); - if ((unsigned char) csum != ptr[3] - || (unsigned char) (csum >> 8) != ptr[2] diff --git a/cc65-2.18-zlib_use_correct_signedness_and_constness_qualifiers.patch b/cc65-2.18-zlib_use_correct_signedness_and_constness_qualifiers.patch new file mode 100644 index 0000000..901b9b9 --- /dev/null +++ b/cc65-2.18-zlib_use_correct_signedness_and_constness_qualifiers.patch @@ -0,0 +1,83 @@ +From 93b6efcb2f969c6de0fd1eca5b07dbce18046c0a Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= +Date: Sat, 15 Jun 2019 06:53:27 +0200 +Subject: [PATCH] zlib: Use correct (un)signedness of char in prototypes and + functions. + +Also ensure we are using the same constness qualifiers. +--- + include/zlib.h | 7 ++++--- + libsrc/zlib/inflatemem.s | 3 ++- + libsrc/zlib/uncompress.c | 9 ++++----- + 3 files changed, 10 insertions(+), 9 deletions(-) + +diff --git a/include/zlib.h b/include/zlib.h +index 8ced89800..3f6c2b27b 100644 +--- a/include/zlib.h ++++ b/include/zlib.h +@@ -48,7 +48,8 @@ + #define Z_NULL 0 + + +-unsigned __fastcall__ inflatemem (char* dest, const char* source); ++unsigned __fastcall__ inflatemem (unsigned char* dest, ++ const unsigned char* source); + /* + Decompresses the source buffer into the destination buffer. + Returns the size of the uncompressed data (number of bytes written starting +@@ -83,8 +84,8 @@ unsigned __fastcall__ inflatemem (char* dest, const char* source); + */ + + +-int __fastcall__ uncompress (char* dest, unsigned* destLen, +- const char* source, unsigned sourceLen); ++int __fastcall__ uncompress (unsigned char* dest, unsigned* destLen, ++ const unsigned char* source, unsigned sourceLen); + /* + Original zlib description: + +diff --git a/libsrc/zlib/inflatemem.s b/libsrc/zlib/inflatemem.s +index bc89f2016..80c19f223 100644 +--- a/libsrc/zlib/inflatemem.s ++++ b/libsrc/zlib/inflatemem.s +@@ -1,7 +1,8 @@ + ; + ; 2017-11-07, Piotr Fusik + ; +-; unsigned __fastcall__ inflatemem (char* dest, const char* source); ++; unsigned __fastcall__ inflatemem (unsigned char* dest, ++; const unsigned char* source); + ; + ; NOTE: Be extremely careful with modifications, because this code is heavily + ; optimized for size (for example assumes certain register and flag values +diff --git a/libsrc/zlib/uncompress.c b/libsrc/zlib/uncompress.c +index 4e449a3ef..61838b47d 100644 +--- a/libsrc/zlib/uncompress.c ++++ b/libsrc/zlib/uncompress.c +@@ -6,11 +6,11 @@ + + #include + +-int __fastcall__ uncompress (char* dest, unsigned* destLen, +- const char* source, unsigned sourceLen) ++int __fastcall__ uncompress (unsigned char* dest, unsigned* destLen, ++ const unsigned char* source, unsigned sourceLen) + { + unsigned len; +- unsigned char* ptr; ++ const unsigned char* ptr = source + sourceLen - 4; + unsigned long csum; + /* source[0]: Compression method and flags + bits 0 to 3: Compression method (must be Z_DEFLATED) +@@ -22,10 +22,9 @@ int __fastcall__ uncompress (char* dest, unsigned* destLen, + */ + if ((source[0] & 0x8f) != Z_DEFLATED || source[1] & 0x20) + return Z_DATA_ERROR; +- if ((((unsigned) source[0] << 8) | (unsigned char) source[1]) % 31) ++ if ((((unsigned) source[0] << 8) | source[1]) % 31) + return Z_DATA_ERROR; + *destLen = len = inflatemem(dest, source + 2); +- ptr = (unsigned char*) source + sourceLen - 4; + csum = adler32(adler32(0L, Z_NULL, 0), dest, len); + if ((unsigned char) csum != ptr[3] + || (unsigned char) (csum >> 8) != ptr[2] diff --git a/cc65.spec b/cc65.spec index 4f1ef1e..092b2a9 100644 --- a/cc65.spec +++ b/cc65.spec @@ -30,7 +30,7 @@ infodir="%{_infodir}" Name: cc65 Version: 2.18 -Release: 2%{?dist} +Release: 3%{?dist} Summary: A free C compiler for 6502 based systems # For license clarification see: @@ -44,9 +44,8 @@ Patch0000: %{git_url}/commit/52695523465cb8bc72a0728b1f5b46ffc3eb2eef.patch Patch0001: %{git_url}/commit/e34ee329738b5b8f54e62e7dd63deff5e1088bff.patch#/%{name}-2.18-improve_doc_readability.patch Patch0002: %{git_url}/commit/83e0c70de509e0be2825fae1deadfcefb6366270.patch#/%{name}-2.18-replace_GIT_SHA_with_BUILD_ID.patch Patch0003: %{git_url}/commit/9faca05e6a028915bc4d6e3b2e5993bdf1fc1ada.patch#/%{name}-2.18-test_ref_otccex_fix_ramdomly_occurring_segfault.patch - -# Upstream PRs. -Patch1000: %{git_url}/pull/913.patch#/%{name}-2.18-util_zlib_deflater_fix_several_compiler_warnings.patch +Patch0004: %{git_url}/commit/e0ac9d5d8e843c0a14f22da0ba1922ae18bccbb9.patch#/%{name}-2.18-util_zlib_deflater_fix_several_compiler_warnings.patch +Patch0005: %{git_url}/commit/93b6efcb2f969c6de0fd1eca5b07dbce18046c0a.patch#/%{name}-2.18-zlib_use_correct_signedness_and_constness_qualifiers.patch BuildRequires: gcc BuildRequires: make @@ -236,6 +235,9 @@ they have been split into this package. %changelog +* Wed Jun 19 2019 Björn Esser - 2.18-3 +- Replace Patch1000 with actual upstream commits + * Sat Jun 15 2019 Björn Esser - 2.18-2 - Update Patch1000 - Add an option to disable %%check target