Skip to content

Commit ac8c131

Browse files
author
thirdwing
committed
working on vector/vector.h
1 parent f5ee99f commit ac8c131

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

inst/include/Rcpp/vector/Vector.h

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,7 @@ class Vector :
563563

564564
void push_back__impl(const stored_type& object, traits::true_type ) {
565565
Shield<SEXP> object_sexp( object ) ;
566-
int n = size() ;
566+
R_xlen_t n = size() ;
567567
Vector target( n + 1 ) ;
568568
SEXP names = RCPP_GET_NAMES(Storage::get__()) ;
569569
iterator target_it( target.begin() ) ;
@@ -588,7 +588,7 @@ class Vector :
588588
}
589589

590590
void push_back__impl(const stored_type& object, traits::false_type ) {
591-
int n = size() ;
591+
R_xlen_t n = size() ;
592592
Vector target( n + 1 ) ;
593593
SEXP names = RCPP_GET_NAMES(Storage::get__()) ;
594594
iterator target_it( target.begin() ) ;
@@ -614,7 +614,7 @@ class Vector :
614614

615615
void push_back_name__impl(const stored_type& object, const std::string& name, traits::true_type ) {
616616
Shield<SEXP> object_sexp( object ) ;
617-
int n = size() ;
617+
R_xlen_t n = size() ;
618618
Vector target( n + 1 ) ;
619619
iterator target_it( target.begin() ) ;
620620
iterator it(begin()) ;
@@ -640,7 +640,7 @@ class Vector :
640640
Storage::set__( target.get__() ) ;
641641
}
642642
void push_back_name__impl(const stored_type& object, const std::string& name, traits::false_type ) {
643-
int n = size() ;
643+
R_xlen_t n = size() ;
644644
Vector target( n + 1 ) ;
645645
iterator target_it( target.begin() ) ;
646646
iterator it(begin()) ;
@@ -669,7 +669,7 @@ class Vector :
669669

670670
void push_front__impl(const stored_type& object, traits::true_type ) {
671671
Shield<SEXP> object_sexp( object ) ;
672-
int n = size() ;
672+
R_xlen_t n = size() ;
673673
Vector target( n+1);
674674
iterator target_it(target.begin());
675675
iterator it(begin());
@@ -695,7 +695,7 @@ class Vector :
695695

696696
}
697697
void push_front__impl(const stored_type& object, traits::false_type ) {
698-
int n = size() ;
698+
R_xlen_t n = size() ;
699699
Vector target( n+1);
700700
iterator target_it(target.begin());
701701
iterator it(begin());
@@ -723,7 +723,7 @@ class Vector :
723723

724724
void push_front_name__impl(const stored_type& object, const std::string& name, traits::true_type ) {
725725
Shield<SEXP> object_sexp(object) ;
726-
int n = size() ;
726+
R_xlen_t n = size() ;
727727
Vector target( n + 1 ) ;
728728
iterator target_it( target.begin() ) ;
729729
iterator it(begin()) ;
@@ -751,7 +751,7 @@ class Vector :
751751

752752
}
753753
void push_front_name__impl(const stored_type& object, const std::string& name, traits::false_type ) {
754-
int n = size() ;
754+
R_xlen_t n = size() ;
755755
Vector target( n + 1 ) ;
756756
iterator target_it( target.begin() ) ;
757757
iterator it(begin()) ;
@@ -782,7 +782,7 @@ class Vector :
782782

783783
iterator insert__impl( iterator position, const stored_type& object_, traits::true_type ) {
784784
Shield<SEXP> object( object_ ) ;
785-
int n = size() ;
785+
R_xlen_t n = size() ;
786786
Vector target( n+1 ) ;
787787
iterator target_it = target.begin();
788788
iterator it = begin() ;
@@ -822,7 +822,7 @@ class Vector :
822822
}
823823

824824
iterator insert__impl( iterator position, const stored_type& object, traits::false_type ) {
825-
int n = size() ;
825+
R_xlen_t n = size() ;
826826
Vector target( n+1 ) ;
827827
iterator target_it = target.begin();
828828
iterator it = begin() ;
@@ -863,7 +863,7 @@ class Vector :
863863

864864
iterator erase_single__impl( iterator position ) {
865865
if( position < begin() || position > end() ) throw index_out_of_bounds( ) ;
866-
int n = size() ;
866+
R_xlen_t n = size() ;
867867
Vector target( n - 1 ) ;
868868
iterator target_it(target.begin()) ;
869869
iterator it(begin()) ;
@@ -907,7 +907,7 @@ class Vector :
907907
iterator it = begin() ;
908908
iterator this_end = end() ;
909909
int nremoved = std::distance(first,last) ;
910-
int target_size = size() - nremoved ;
910+
R_xlen_t target_size = size() - nremoved ;
911911
Vector target( target_size ) ;
912912
iterator target_it = target.begin() ;
913913

@@ -944,7 +944,7 @@ class Vector :
944944

945945
template <typename T>
946946
inline void assign_sugar_expression( const T& x ) {
947-
int n = size() ;
947+
R_xlen_t n = size() ;
948948
if( n == x.size() ){
949949
// just copy the data
950950
import_expression<T>(x, n ) ;
@@ -974,7 +974,7 @@ class Vector :
974974
template <bool NA, typename VEC>
975975
inline void import_sugar_expression( const Rcpp::VectorBase<RTYPE,NA,VEC>& other, traits::false_type ) {
976976
RCPP_DEBUG_4( "Vector<%d>::import_sugar_expression( VectorBase<%d,%d,%s>, false_type )", RTYPE, NA, RTYPE, DEMANGLE(VEC) ) ;
977-
int n = other.size() ;
977+
R_xlen_t n = other.size() ;
978978
Storage::set__( Rf_allocVector( RTYPE, n ) ) ;
979979
import_expression<VEC>( other.get_ref() , n ) ;
980980
}
@@ -1015,7 +1015,7 @@ class Vector :
10151015
// when this is not trivial, this is SEXP
10161016
Shield<SEXP> elem( converter_type::get( u ) );
10171017
iterator it(begin());
1018-
for( int i=0; i<size() ; i++, ++it){
1018+
for( R_xlen_t i=0; i<size() ; i++, ++it){
10191019
*it = ::Rf_duplicate( elem ) ;
10201020
}
10211021
}

0 commit comments

Comments
 (0)