@@ -48,7 +48,7 @@ attribute_hidden SEXP do_lapply(SEXP call, SEXP op, SEXP args, SEXP rho)
4848 XX = PROTECT (eval (CAR (args ), rho ));
4949 R_xlen_t n = xlength (XX ); // a vector, so will be valid.
5050 FUN = checkArgIsSymbol (CADR (args ));
51- Rboolean realIndx = n > INT_MAX ;
51+ bool realIndx = n > INT_MAX ;
5252
5353 SEXP ans = PROTECT (allocVector (VECSXP , n ));
5454 SEXP names = getAttrib (XX , R_NamesSymbol );
@@ -99,7 +99,7 @@ attribute_hidden SEXP do_vapply(SEXP call, SEXP op, SEXP args, SEXP rho)
9999 R_xlen_t i , n ;
100100 int commonLen ;
101101 int useNames , rnk_v = -1 ; // = array_rank(value) := length(dim(value))
102- Rboolean array_value ;
102+ bool array_value ;
103103 SEXPTYPE commonType ;
104104 PROTECT_INDEX index = 0 ; /* initialize to avoid a warning */
105105
@@ -116,7 +116,7 @@ attribute_hidden SEXP do_vapply(SEXP call, SEXP op, SEXP args, SEXP rho)
116116
117117 n = xlength (XX );
118118 if (n == NA_INTEGER ) error (_ ("invalid length" ));
119- Rboolean realIndx = n > INT_MAX ;
119+ bool realIndx = n > INT_MAX ;
120120
121121 commonLen = length (value );
122122 if (commonLen > 1 && n > INT_MAX )
@@ -179,7 +179,7 @@ attribute_hidden SEXP do_vapply(SEXP call, SEXP op, SEXP args, SEXP rho)
179179 commonLen , (long long )i + 1 , length (val ));
180180 valType = TYPEOF (val );
181181 if (valType != commonType ) {
182- Rboolean okay = FALSE ;
182+ bool okay = false ;
183183 switch (commonType ) {
184184 case CPLXSXP : okay = (valType == REALSXP ) || (valType == INTSXP )
185185 || (valType == LGLSXP ); break ;
@@ -284,10 +284,10 @@ attribute_hidden SEXP do_vapply(SEXP call, SEXP op, SEXP args, SEXP rho)
284284
285285// Apply FUN() to X recursively; workhorse of rapply()
286286static SEXP do_one (SEXP X , SEXP FUN , SEXP classes , SEXP deflt ,
287- Rboolean replace , SEXP rho )
287+ bool replace , SEXP rho )
288288{
289289 SEXP ans , names , klass ;
290- Rboolean matched = FALSE ;
290+ bool matched = false ;
291291
292292 /* if X is a list, recurse. Otherwise if it matches classes call f */
293293 if (X == R_NilValue || isVectorList (X )) {
@@ -306,13 +306,13 @@ static SEXP do_one(SEXP X, SEXP FUN, SEXP classes, SEXP deflt,
306306 return ans ;
307307 }
308308 if (strcmp (CHAR (STRING_ELT (classes , 0 )), "ANY" ) == 0 ) /* ASCII */
309- matched = TRUE ;
309+ matched = true ;
310310 else {
311- PROTECT (klass = R_data_class (X , FALSE ));
311+ PROTECT (klass = R_data_class (X , false ));
312312 for (int i = 0 ; i < LENGTH (klass ); i ++ )
313313 for (int j = 0 ; j < length (classes ); j ++ )
314314 if (Seql (STRING_ELT (klass , i ), STRING_ELT (classes , j )))
315- matched = TRUE ;
315+ matched = true ;
316316 UNPROTECT (1 );
317317 }
318318 if (matched ) {
@@ -349,7 +349,7 @@ attribute_hidden SEXP do_rapply(SEXP call, SEXP op, SEXP args, SEXP rho)
349349 deflt = CAR (args ); args = CDR (args );
350350 how = CAR (args );
351351 if (!isString (how )) error (_ ("invalid '%s' argument" ), "how" );
352- Rboolean replace = strcmp (CHAR (STRING_ELT (how , 0 )), "replace" ) == 0 ; /* ASCII */
352+ bool replace = strcmp (CHAR (STRING_ELT (how , 0 )), "replace" ) == 0 ; /* ASCII */
353353 R_xlen_t n = xlength (X );
354354 if (replace ) {
355355 PROTECT (ans = shallow_duplicate (X ));
@@ -380,9 +380,9 @@ static int islistfactor(SEXP X)
380380 for (int i = 0 ; i < n ; i ++ ) {
381381 int isLF = islistfactor (VECTOR_ELT (X , i ));
382382 if (!isLF )
383- return FALSE ;
384- else if (isLF == TRUE )
385- ans = TRUE ;
383+ return false ;
384+ else if (isLF == true )
385+ ans = true ;
386386 // else isLF is NA
387387 }
388388 return ans ;
@@ -399,19 +399,19 @@ attribute_hidden SEXP do_islistfactor(SEXP call, SEXP op, SEXP args, SEXP rho)
399399{
400400 checkArity (op , args );
401401 SEXP X = CAR (args );
402- Rboolean recursive = asRbool (CADR (args ), call );
402+ bool recursive = asBool2 (CADR (args ), call );
403403 int n = length (X );
404404 if (n == 0 || !isVectorList (X ))
405- return ScalarLogical (FALSE );
405+ return ScalarLogical (false );
406406
407407 if (!recursive ) {
408408 for (int i = 0 ; i < n ; i ++ )
409409 if (!isFactor (VECTOR_ELT (X , i )))
410- return ScalarLogical (FALSE );
410+ return ScalarLogical (false );
411411
412- return ScalarLogical (TRUE );
412+ return ScalarLogical (true );
413413 }
414414 else { // recursive: isVectorList(X) <==> X is VECSXP or EXPRSXP
415- return ScalarLogical ((islistfactor (X ) == TRUE ) ? TRUE : FALSE );
415+ return ScalarLogical ((islistfactor (X ) == true ) ? true : false );
416416 }
417417}
0 commit comments