[Rcpp-commits] r3330 - pkg/int64/inst/include/int64

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sat Nov 12 12:19:20 CET 2011


Author: romain
Date: 2011-11-12 12:19:20 +0100 (Sat, 12 Nov 2011)
New Revision: 3330

Modified:
   pkg/int64/inst/include/int64/LongVector.h
   pkg/int64/inst/include/int64/compare.h
   pkg/int64/inst/include/int64/summary.h
Log:
oops

Modified: pkg/int64/inst/include/int64/LongVector.h
===================================================================
--- pkg/int64/inst/include/int64/LongVector.h	2011-11-12 10:41:00 UTC (rev 3329)
+++ pkg/int64/inst/include/int64/LongVector.h	2011-11-12 11:19:20 UTC (rev 3330)
@@ -172,8 +172,8 @@
         
         LongVector(int n, LONG value) : data(R_NilValue) {
             SEXP x = PROTECT( Rf_allocVector( VECSXP, n ) ) ;
-            int hb = get_high_bits<LONG>( value ) ;
-            int lb = get_low_bits<LONG>( value ) ;
+            int hb = internal::get_high_bits<LONG>( value ) ;
+            int lb = internal::get_low_bits<LONG>( value ) ;
             for( int i=0; i<n; i++){
                 SET_VECTOR_ELT( x, i, int64::internal::int2(hb,lb) ) ;    
             }

Modified: pkg/int64/inst/include/int64/compare.h
===================================================================
--- pkg/int64/inst/include/int64/compare.h	2011-11-12 10:41:00 UTC (rev 3329)
+++ pkg/int64/inst/include/int64/compare.h	2011-11-12 11:19:20 UTC (rev 3330)
@@ -46,22 +46,22 @@
     
     if( n1 == n2 ){
         for( i=0; i<n1; i++){
-            p_res[i] = ( x1 == na || x2 == na) ? na : Fun(x1.get(i), x2.get(i)) ;
+            p_res[i] = ( x1.get(i) == na || x2.get(i) == na) ? na : Fun(x1.get(i), x2.get(i)) ;
         }
     } else if( n1 == 1 ){
         tmp = x1.get(i) ;
         for( i=0; i<n2; i++){
-            p_res[i] = ( x1 == na || x2 == na) ? na : Fun(tmp,x2.get(i)) ;
+            p_res[i] = ( x1.get(i) == na || x2.get(i) == na) ? na : Fun(tmp,x2.get(i)) ;
         }
     } else if( n2 == 1) {
         tmp = x2.get(i) ;
         for( i=0; i<n1; i++){
-            p_res[i] = ( x1 == na || x2 == na) ? na : Fun(x1.get(i),tmp) ;
+            p_res[i] = ( x1.get(i) == na || x2.get(i) == na) ? na : Fun(x1.get(i),tmp) ;
         }
     } else {
         // recycling
         for (i=i1=i2=0; i<n; i1 = (++i1 == n1) ? 0 : i1, i2 = (++i2 == n2) ? 0 : i2, ++i){
-           p_res[i] = ( x1 == na || x2 == na) ? na : Fun(x1.get(i1), x2.get(i2)) ;
+           p_res[i] = ( x1.get(i) == na || x2.get(i) == na) ? na : Fun(x1.get(i1), x2.get(i2)) ;
         }
     }
     UNPROTECT(1) ; // res

Modified: pkg/int64/inst/include/int64/summary.h
===================================================================
--- pkg/int64/inst/include/int64/summary.h	2011-11-12 10:41:00 UTC (rev 3329)
+++ pkg/int64/inst/include/int64/summary.h	2011-11-12 11:19:20 UTC (rev 3330)
@@ -137,6 +137,7 @@
     int n = data.size() ;
     int res = 1 ;
     LONG tmp ;
+    bool seen_na = false ;
     for( int i=0; i<n; i++){
         tmp = data.get(i) ;
         if( tmp == na ) seen_na = true ;



More information about the Rcpp-commits mailing list