From 9558414a12fb26a6a46d256d8c555ca103ba72ac Mon Sep 17 00:00:00 2001 From: Tom Callaway Date: Fri, 16 Aug 2013 10:00:52 -0400 Subject: [PATCH] fix behavior to be correct on arm (and all other platforms) --- R-bitops-armfix.patch | 12 ++++++++++++ R-bitops.spec | 8 +++++++- 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 R-bitops-armfix.patch diff --git a/R-bitops-armfix.patch b/R-bitops-armfix.patch new file mode 100644 index 0000000..8f65fcd --- /dev/null +++ b/R-bitops-armfix.patch @@ -0,0 +1,12 @@ +diff -up bitops/bitops/src/bit-ops.c.armfix bitops/bitops/src/bit-ops.c +--- bitops/bitops/src/bit-ops.c.armfix 2013-08-16 09:54:59.216088912 -0400 ++++ bitops/bitops/src/bit-ops.c 2013-08-16 09:55:23.444089276 -0400 +@@ -29,7 +29,7 @@ SEXP bitFlip(SEXP a, SEXP bitWidth ) { + if ( !R_FINITE(xa[i]) || logb(xa[i])>31 ) xaflip[i]=NA_REAL ; + + else { +- tmp=(unsigned int) xa[i] ; ++ tmp=xa[i] < 0 ? (int) xa[i] : (unsigned) xa[i]; + xaflip[i]=(double) ( ~tmp & mask ) ; + } + } diff --git a/R-bitops.spec b/R-bitops.spec index f158bf4..4bc22c4 100644 --- a/R-bitops.spec +++ b/R-bitops.spec @@ -3,13 +3,14 @@ Name: R-%{packname} Version: 1.0.5 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Functions for Bitwise operations Group: Applications/Productivity License: GPLv2+ URL: http://cran.r-project.org/web/packages/bitops/index.html Source0: http://cran.r-project.org/src/contrib/%{packname}_%{packvers}.tar.gz +Patch0: R-bitops-armfix.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) Requires: R-core >= 3.0.0 BuildRequires: R-devel >= 3.0.0, tex(latex) @@ -19,6 +20,7 @@ Functions for Bitwise operations on integer vectors. %prep %setup -c -q -n %{packname} +%patch0 -p1 -b .armfix %build %install @@ -48,6 +50,10 @@ test -d %{packname}/src && (cd %{packname}/src; rm -f *.o *.so) %{_libdir}/R/library/%{packname}/libs %changelog +* Fri Aug 16 2013 Tom Callaway - 1.0.5-3 +- fix bug on arm where casting double to unsigned is undefined if the value is negative + Many thanks to Florian Weimer. + * Fri Aug 02 2013 Fedora Release Engineering - 1.0.5-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild