Subject: | [PATCH] Wrong APPEND_OUTPUT logic |
clang-4 with its new -Wlogical-not-parentheses warning detected that
if(! s->flags & FLAG_APPEND_OUTPUT) is wrong.
! binds stringer than &
Fixed with attached patch (-p2)
--
Reini Urban
Subject: | 0001-Compress-Raw-Bzip2-fix-APPEND_OUTPUT-logic.patch |
From 4f0b9ac54fc9755a204a6a18a221f2372cd896b4 Mon Sep 17 00:00:00 2001
From: Reini Urban <rurban@cpanel.net>
Date: Sun, 27 Nov 2016 22:20:17 +0100
Subject: [PATCH] Compress-Raw-Bzip2: fix APPEND_OUTPUT logic
clang-4 detected that if(! s->flags & FLAG_APPEND_OUTPUT) is wrong.
! binds stronger than &.
---
cpan/Compress-Raw-Bzip2/Bzip2.xs | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git cpan/Compress-Raw-Bzip2/Bzip2.xs cpan/Compress-Raw-Bzip2/Bzip2.xs
index e47dbae..15ff6b9 100644
--- cpan/Compress-Raw-Bzip2/Bzip2.xs
+++ cpan/Compress-Raw-Bzip2/Bzip2.xs
@@ -558,7 +558,7 @@ bzclose(s, output)
if (DO_UTF8(output) && !sv_utf8_downgrade(output, 1))
croak("Wide character in " COMPRESS_CLASS "::bzclose input parameter");
#endif
- if(! s->flags & FLAG_APPEND_OUTPUT) {
+ if (!(s->flags & FLAG_APPEND_OUTPUT)) {
SvCUR_set(output, 0);
/* sv_setpvn(output, "", 0); */
}
@@ -619,7 +619,7 @@ bzflush(s, output)
if (DO_UTF8(output) && !sv_utf8_downgrade(output, 1))
croak("Wide character in " COMPRESS_CLASS "::bzflush input parameter");
#endif
- if(! s->flags & FLAG_APPEND_OUTPUT) {
+ if (!(s->flags & FLAG_APPEND_OUTPUT)) {
SvCUR_set(output, 0);
/* sv_setpvn(output, "", 0); */
}
--
2.10.2