From patchwork Mon Jan 25 12:17:50 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vicente Olivert Riera X-Patchwork-Id: 572716 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ozlabs.org (Postfix) with ESMTP id 4AAFF1402A9 for ; Mon, 25 Jan 2016 23:18:08 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 6F9213220A; Mon, 25 Jan 2016 12:18:06 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id RmPS4RuvhNJM; Mon, 25 Jan 2016 12:18:02 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 01D6432DA2; Mon, 25 Jan 2016 12:18:01 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 98AFB1C101F for ; Mon, 25 Jan 2016 12:18:00 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 94DDA89515 for ; Mon, 25 Jan 2016 12:18:00 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id IOW1If3FItTJ for ; Mon, 25 Jan 2016 12:17:59 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mailapp01.imgtec.com (mailapp01.imgtec.com [195.59.15.196]) by hemlock.osuosl.org (Postfix) with ESMTP id B5248873EF for ; Mon, 25 Jan 2016 12:17:59 +0000 (UTC) Received: from hhmail02.hh.imgtec.org (unknown [10.100.10.20]) by Websense Email Security Gateway with ESMTPS id 0B037EB7B186D for ; Mon, 25 Jan 2016 12:17:55 +0000 (GMT) Received: from LEMAIL01.le.imgtec.org (192.168.152.62) by hhmail02.hh.imgtec.org (10.100.10.20) with Microsoft SMTP Server (TLS) id 14.3.235.1; Mon, 25 Jan 2016 12:17:57 +0000 Received: from vriera-linux.le.imgtec.org (192.168.154.36) by LEMAIL01.le.imgtec.org (192.168.152.62) with Microsoft SMTP Server (TLS) id 14.3.210.2; Mon, 25 Jan 2016 12:17:56 +0000 From: Vicente Olivert Riera To: Date: Mon, 25 Jan 2016 12:17:50 +0000 Message-ID: <1453724270-22823-1-git-send-email-Vincent.Riera@imgtec.com> X-Mailer: git-send-email 2.4.10 MIME-Version: 1.0 X-Originating-IP: [192.168.154.36] Subject: [Buildroot] [PATCH] zbar: add a patch to wrap logical not operations into parenthesis X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" This fixes build failures like this one: zbar/decoder/ean.c: In function 'ean_part_end4': zbar/decoder/ean.c:297:13: error: logical not is only applied to the left hand side of comparison [-Werror=logical-not-parentheses] if(!par == fwd) { This patch has been sent upstream as a pull request: https://github.com/ZBar/ZBar/pull/9 Fixes: http://autobuild.buildroot.net/results/299/299dc845af082167085d366b38daf1dfd95d7047/ Signed-off-by: Vicente Olivert Riera --- ...p-logical-not-operations-into-parentheses.patch | 80 ++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 package/zbar/0004-Wrap-logical-not-operations-into-parentheses.patch diff --git a/package/zbar/0004-Wrap-logical-not-operations-into-parentheses.patch b/package/zbar/0004-Wrap-logical-not-operations-into-parentheses.patch new file mode 100644 index 0000000..6d39b1b --- /dev/null +++ b/package/zbar/0004-Wrap-logical-not-operations-into-parentheses.patch @@ -0,0 +1,80 @@ +From 7e69cdc8dfdf07701ba551985ee49d48e64d730f Mon Sep 17 00:00:00 2001 +From: Vicente Olivert Riera +Date: Mon, 25 Jan 2016 11:58:59 +0000 +Subject: [PATCH] Wrap logical not operations into parentheses + +Otherwise it fails like this: + +zbar/decoder/ean.c: In function 'ean_part_end4': +zbar/decoder/ean.c:297:13: error: logical not is only applied to the +left hand side of comparison [-Werror=logical-not-parentheses] + if(!par == fwd) { + +This patch has been sent upstream as a pull request: + + https://github.com/ZBar/ZBar/pull/9 + +Signed-off-by: Vicente Olivert Riera +--- + zbar/decoder/ean.c | 4 ++-- + zbar/qrcode/qrdec.c | 8 ++++---- + 2 files changed, 6 insertions(+), 6 deletions(-) + +diff --git a/zbar/decoder/ean.c b/zbar/decoder/ean.c +index c20f538..41d1493 100644 +--- a/zbar/decoder/ean.c ++++ b/zbar/decoder/ean.c +@@ -294,7 +294,7 @@ static inline zbar_symbol_type_t ean_part_end4 (ean_pass_t *pass, + /* invalid parity combination */ + return(ZBAR_NONE); + +- if(!par == fwd) { ++ if((!par) == fwd) { + /* reverse sampled digits */ + unsigned char tmp = pass->raw[1]; + pass->state |= STATE_REV; +@@ -380,7 +380,7 @@ static inline zbar_symbol_type_t ean_part_end7 (ean_decoder_t *ean, + /* invalid parity combination */ + return(ZBAR_NONE); + +- if(!par == fwd) { ++ if((!par) == fwd) { + unsigned char i; + pass->state |= STATE_REV; + /* reverse sampled digits */ +diff --git a/zbar/qrcode/qrdec.c b/zbar/qrcode/qrdec.c +index d8fa802..5d3d265 100644 +--- a/zbar/qrcode/qrdec.c ++++ b/zbar/qrcode/qrdec.c +@@ -1219,8 +1219,8 @@ static int qr_finder_quick_crossing_check(const unsigned char *_img, + _x1<0||_x1>=_width||_y1<0||_y1>=_height){ + return -1; + } +- if(!_img[_y0*_width+_x0]!=_v||!_img[_y1*_width+_x1]!=_v)return 1; +- if(!_img[(_y0+_y1>>1)*_width+(_x0+_x1>>1)]==_v)return -1; ++ if((!_img[_y0*_width+_x0])!=_v||(!_img[_y1*_width+_x1])!=_v)return 1; ++ if((!_img[(_y0+_y1>>1)*_width+(_x0+_x1>>1)])==_v)return -1; + return 0; + } + +@@ -1261,7 +1261,7 @@ static int qr_finder_locate_crossing(const unsigned char *_img, + x0[1-steep]+=step[1-steep]; + err-=dx[steep]; + } +- if(!_img[x0[1]*_width+x0[0]]!=_v)break; ++ if((!_img[x0[1]*_width+x0[0]])!=_v)break; + } + /*Find the last crossing from _v to !_v.*/ + err=0; +@@ -1273,7 +1273,7 @@ static int qr_finder_locate_crossing(const unsigned char *_img, + x1[1-steep]-=step[1-steep]; + err-=dx[steep]; + } +- if(!_img[x1[1]*_width+x1[0]]!=_v)break; ++ if((!_img[x1[1]*_width+x1[0]])!=_v)break; + } + /*Return the midpoint of the _v segment.*/ + _p[0]=(x0[0]+x1[0]+1<>1; +-- +2.4.10 +