From c859fe3d28f0fbd63bee89bd24b6f7a5d02a2ff5992b58935053968bebca574f Mon Sep 17 00:00:00 2001 From: Martin Pluskal Date: Wed, 13 Jan 2016 08:00:14 +0000 Subject: [PATCH] Accepting request 353325 from home:gmg137 fix gcc5 build error OBS-URL: https://build.opensuse.org/request/show/353325 OBS-URL: https://build.opensuse.org/package/show/Application:Geo/zbar?expand=0&rev=14 --- fix-gcc5.patch | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++ zbar.spec | 2 ++ 2 files changed, 61 insertions(+) create mode 100644 fix-gcc5.patch diff --git a/fix-gcc5.patch b/fix-gcc5.patch new file mode 100644 index 0000000..e7c22a2 --- /dev/null +++ b/fix-gcc5.patch @@ -0,0 +1,59 @@ + 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..fe38eaa 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..fd42c33 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; diff --git a/zbar.spec b/zbar.spec index c091bd9..97b49ba 100644 --- a/zbar.spec +++ b/zbar.spec @@ -38,6 +38,7 @@ BuildRequires: xmlto Source: %{name}-%{version}.tar.bz2 BuildRoot: %{_tmppath}/%{name}-%{version}-build Patch1: fix_build.patch +Patch2: fix-gcc5.patch %description ZBar is an open source software suite for reading bar codes from various @@ -135,6 +136,7 @@ This package provides ZBar Python-Gtk bindings. %prep %setup -q %patch1 -p1 +%patch2 -p1 # for the Mercurial-based archive we need to get proper autoconf files autoreconf -fi