1 From 7e69cdc8dfdf07701ba551985ee49d48e64d730f Mon Sep 17 00:00:00 2001
2 From: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
3 Date: Mon, 25 Jan 2016 11:58:59 +0000
4 Subject: [PATCH] Wrap logical not operations into parentheses
6 Otherwise it fails like this:
8 zbar/decoder/ean.c: In function 'ean_part_end4':
9 zbar/decoder/ean.c:297:13: error: logical not is only applied to the
10 left hand side of comparison [-Werror=logical-not-parentheses]
13 This patch has been sent upstream as a pull request:
15 https://github.com/ZBar/ZBar/pull/9
17 Signed-off-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
19 zbar/decoder/ean.c | 4 ++--
20 zbar/qrcode/qrdec.c | 8 ++++----
21 2 files changed, 6 insertions(+), 6 deletions(-)
23 diff --git a/zbar/decoder/ean.c b/zbar/decoder/ean.c
24 index c20f538..41d1493 100644
25 --- a/zbar/decoder/ean.c
26 +++ b/zbar/decoder/ean.c
27 @@ -294,7 +294,7 @@ static inline zbar_symbol_type_t ean_part_end4 (ean_pass_t *pass,
28 /* invalid parity combination */
33 /* reverse sampled digits */
34 unsigned char tmp = pass->raw[1];
35 pass->state |= STATE_REV;
36 @@ -380,7 +380,7 @@ static inline zbar_symbol_type_t ean_part_end7 (ean_decoder_t *ean,
37 /* invalid parity combination */
43 pass->state |= STATE_REV;
44 /* reverse sampled digits */
45 diff --git a/zbar/qrcode/qrdec.c b/zbar/qrcode/qrdec.c
46 index d8fa802..5d3d265 100644
47 --- a/zbar/qrcode/qrdec.c
48 +++ b/zbar/qrcode/qrdec.c
49 @@ -1219,8 +1219,8 @@ static int qr_finder_quick_crossing_check(const unsigned char *_img,
50 _x1<0||_x1>=_width||_y1<0||_y1>=_height){
53 - if(!_img[_y0*_width+_x0]!=_v||!_img[_y1*_width+_x1]!=_v)return 1;
54 - if(!_img[(_y0+_y1>>1)*_width+(_x0+_x1>>1)]==_v)return -1;
55 + if((!_img[_y0*_width+_x0])!=_v||(!_img[_y1*_width+_x1])!=_v)return 1;
56 + if((!_img[(_y0+_y1>>1)*_width+(_x0+_x1>>1)])==_v)return -1;
60 @@ -1261,7 +1261,7 @@ static int qr_finder_locate_crossing(const unsigned char *_img,
61 x0[1-steep]+=step[1-steep];
64 - if(!_img[x0[1]*_width+x0[0]]!=_v)break;
65 + if((!_img[x0[1]*_width+x0[0]])!=_v)break;
67 /*Find the last crossing from _v to !_v.*/
69 @@ -1273,7 +1273,7 @@ static int qr_finder_locate_crossing(const unsigned char *_img,
70 x1[1-steep]-=step[1-steep];
73 - if(!_img[x1[1]*_width+x1[0]]!=_v)break;
74 + if((!_img[x1[1]*_width+x1[0]])!=_v)break;
76 /*Return the midpoint of the _v segment.*/
77 _p[0]=(x0[0]+x1[0]+1<<QR_FINDER_SUBPREC)>>1;