@@ -52,14 +52,14 @@ class IfElse : public VectorBase<
5252 RCPP_DEBUG ( DEMANGLE (IfElse) ) ;
5353 }
5454
55- inline STORAGE operator []( int i ) const {
55+ inline STORAGE operator []( R_xlen_t i ) const {
5656 int x = cond[i] ;
5757 if ( Rcpp::traits::is_na<LGLSXP>(x) ) return Rcpp::traits::get_na<RTYPE>() ;
5858 if ( x ) return lhs[i] ;
5959 return rhs[i] ;
6060 }
6161
62- inline int size () const { return cond.size () ; }
62+ inline R_xlen_t size () const { return cond.size () ; }
6363
6464private:
6565 const COND_TYPE& cond ;
@@ -93,12 +93,12 @@ class IfElse<RTYPE,false,COND_T,LHS_NA,LHS_T,RHS_NA,RHS_T> : public VectorBase<
9393 /* FIXME : cond, lhs and rhs must all have the same size */
9494 }
9595
96- inline STORAGE operator []( int i ) const {
96+ inline STORAGE operator []( R_xlen_t i ) const {
9797 if ( cond[i] ) return lhs[i] ;
9898 return rhs[i] ;
9999 }
100100
101- inline int size () const { return cond.size () ; }
101+ inline R_xlen_t size () const { return cond.size () ; }
102102
103103private:
104104
@@ -133,14 +133,14 @@ class IfElse_Primitive_Vector : public VectorBase<
133133 /* FIXME : cond, lhs and rhs must all have the sale size */
134134 }
135135
136- inline STORAGE operator []( int i ) const {
136+ inline STORAGE operator []( R_xlen_t i ) const {
137137 int x = cond[i] ;
138138 if ( Rcpp::traits::is_na<LGLSXP>(x) ) return x ;
139139 if ( x ) return lhs ;
140140 return rhs[i] ;
141141 }
142142
143- inline int size () const { return cond.size () ; }
143+ inline R_xlen_t size () const { return cond.size () ; }
144144
145145private:
146146 const COND_TYPE& cond ;
@@ -170,12 +170,12 @@ class IfElse_Primitive_Vector<RTYPE,false,COND_T,RHS_NA,RHS_T> : public VectorBa
170170 /* FIXME : cond, lhs and rhs must all have the same size */
171171 }
172172
173- inline STORAGE operator []( int i ) const {
173+ inline STORAGE operator []( R_xlen_t i ) const {
174174 if ( cond[i] ) return lhs ;
175175 return rhs[i] ;
176176 }
177177
178- inline int size () const { return cond.size () ; }
178+ inline R_xlen_t size () const { return cond.size () ; }
179179
180180private:
181181 const COND_TYPE& cond ;
@@ -209,14 +209,14 @@ class IfElse_Vector_Primitive : public VectorBase<
209209 /* FIXME : cond, lhs and rhs must all have the same size */
210210 }
211211
212- inline STORAGE operator []( int i ) const {
212+ inline STORAGE operator []( R_xlen_t i ) const {
213213 int x = cond[i] ;
214214 if ( Rcpp::traits::is_na<LGLSXP>(x) ) return Rcpp::traits::get_na<RTYPE>() ;
215215 if ( x ) return lhs[i] ;
216216 return rhs ;
217217 }
218218
219- inline int size () const { return cond.size () ; }
219+ inline R_xlen_t size () const { return cond.size () ; }
220220
221221private:
222222 const COND_TYPE& cond ;
@@ -246,12 +246,12 @@ class IfElse_Vector_Primitive<RTYPE,false,COND_T,LHS_NA,LHS_T> : public VectorBa
246246 /* FIXME : cond, lhs and rhs must all have the sale size */
247247 }
248248
249- inline STORAGE operator []( int i ) const {
249+ inline STORAGE operator []( R_xlen_t i ) const {
250250 if ( cond[i] ) return lhs[i] ;
251251 return rhs ;
252252 }
253253
254- inline int size () const { return cond.size () ; }
254+ inline R_xlen_t size () const { return cond.size () ; }
255255
256256private:
257257 const COND_TYPE& cond ;
@@ -284,13 +284,13 @@ class IfElse_Primitive_Primitive : public VectorBase<
284284 /* FIXME : cond, lhs and rhs must all have the same size */
285285 }
286286
287- inline STORAGE operator []( int i ) const {
287+ inline STORAGE operator []( R_xlen_t i ) const {
288288 int x = cond[i] ;
289289 if ( Rcpp::traits::is_na<LGLSXP>(x) ) return Rcpp::traits::get_na<RTYPE>() ;
290290 return x ? lhs : rhs ;
291291 }
292292
293- inline int size () const { return cond.size () ; }
293+ inline R_xlen_t size () const { return cond.size () ; }
294294
295295private:
296296 const COND_TYPE& cond ;
@@ -317,11 +317,11 @@ class IfElse_Primitive_Primitive<RTYPE,false,COND_T> : public VectorBase<
317317 /* FIXME : cond, lhs and rhs must all have the same size */
318318 }
319319
320- inline STORAGE operator []( int i ) const {
320+ inline STORAGE operator []( R_xlen_t i ) const {
321321 return cond[i] ? lhs : rhs ;
322322 }
323323
324- inline int size () const { return cond.size () ; }
324+ inline R_xlen_t size () const { return cond.size () ; }
325325
326326private:
327327 const COND_TYPE& cond ;
@@ -394,8 +394,8 @@ template<
394394inline sugar::IfElse_Primitive_Primitive< INTSXP,COND_NA,COND_T >
395395ifelse (
396396 const Rcpp::VectorBase<LGLSXP,COND_NA,COND_T>& cond,
397- int lhs,
398- int rhs
397+ R_xlen_t lhs,
398+ R_xlen_t rhs
399399 ){
400400 return sugar::IfElse_Primitive_Primitive<INTSXP,COND_NA,COND_T>( cond, lhs, rhs ) ;
401401}
0 commit comments