[zbar-commits] push rev [279]: Fix ires rounding in qr_aff_unproject().
Status: Beta
Brought to you by:
spadix
|
From: <tte...@us...> - 2010-12-10 15:25:19
|
changeset: 279:274171009b92 user: tte...@us... date: Fri Dec 10 07:24:17 2010 -0800 details: http://zbar.hg.sourceforge.net:8000/hgroot/zbar/zbarzbar/rev/274171009b92 description: Fix ires rounding in qr_aff_unproject(). With the last commit, ires can now be zero, and so shifting by ires-1 was undefined. This also backs out the accidental removal of -Werror from configure.ac. diffstat: configure.ac | 4 ++-- zbar/qrcode/qrdec.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diffs (36 lines): diff -r 595ae6c5159f -r 274171009b92 configure.ac --- a/configure.ac Fri Dec 10 06:49:44 2010 -0800 +++ b/configure.ac Fri Dec 10 07:24:17 2010 -0800 @@ -3,7 +3,7 @@ AC_INIT([zbar], [0.10], [sp...@us...]) AC_CONFIG_AUX_DIR(config) AC_CONFIG_MACRO_DIR(config) -AM_INIT_AUTOMAKE([1.10 -Wall foreign subdir-objects std-options dist-bzip2]) +AM_INIT_AUTOMAKE([1.10 -Wall -Werror foreign subdir-objects std-options dist-bzip2]) AC_CONFIG_HEADERS([include/config.h]) AC_CONFIG_SRCDIR(zbar/scanner.c) LT_PREREQ([2.2]) @@ -47,7 +47,7 @@ [Library revision]) AM_CPPFLAGS="-I$srcdir/include" -AM_CFLAGS="-Wall -Wno-parentheses" +AM_CFLAGS="-Wall -Wno-parentheses -Werror" AM_CXXFLAGS="$AM_CFLAGS" AC_SUBST([AM_CPPFLAGS]) AC_SUBST([AM_CFLAGS]) diff -r 595ae6c5159f -r 274171009b92 zbar/qrcode/qrdec.c --- a/zbar/qrcode/qrdec.c Fri Dec 10 06:49:44 2010 -0800 +++ b/zbar/qrcode/qrdec.c Fri Dec 10 07:24:17 2010 -0800 @@ -667,9 +667,9 @@ static void qr_aff_unproject(qr_point _q,const qr_aff *_aff, int _x,int _y){ _q[0]=_aff->inv[0][0]*(_x-_aff->x0)+_aff->inv[0][1]*(_y-_aff->y0) - +(1<<_aff->ires-1)>>_aff->ires; + +(1<<_aff->ires>>1)>>_aff->ires; _q[1]=_aff->inv[1][0]*(_x-_aff->x0)+_aff->inv[1][1]*(_y-_aff->y0) - +(1<<_aff->ires-1)>>_aff->ires; + +(1<<_aff->ires>>1)>>_aff->ires; } /*Map from the square domain into the image (at subpel resolution).*/ |