R-bitops/R-bitops-armfix.patch

13 lines
483 B
Diff

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 ) ;
}
}