@@ -107,7 +107,7 @@ attribute_hidden SEXP do_matrix(SEXP call, SEXP op, SEXP args, SEXP rho)
107107 byrow0 = asLogical (CAR (args )); args = CDR (args );
108108 if (byrow0 == NA_INTEGER )
109109 error (_ ("invalid '%s' argument" ), "byrow" );
110- Rboolean byrow = (Rboolean ) byrow0 ;
110+ bool byrow = (bool ) byrow0 ;
111111 dimnames = CAR (args );
112112 args = CDR (args );
113113 miss_nr = asLogical (CAR (args )); args = CDR (args );
@@ -396,12 +396,12 @@ attribute_hidden SEXP DropDims(SEXP x)
396396 setAttrib (newdims , R_NamesSymbol , new_nms );
397397 UNPROTECT (1 );
398398 }
399- Rboolean havenames = FALSE ;
399+ bool havenames = false ;
400400 if (!isNull (dimnames )) {
401401 for (i = 0 ; i < ndims ; i ++ )
402402 if (dim [i ] != 1 &&
403403 VECTOR_ELT (dimnames , i ) != R_NilValue )
404- havenames = TRUE ;
404+ havenames = true ;
405405 if (havenames ) {
406406 PROTECT (newnames = allocVector (VECSXP , n ));
407407 PROTECT (newnamesnames = allocVector (STRSXP , n ));
@@ -551,7 +551,7 @@ attribute_hidden SEXP do_lengths(SEXP call, SEXP op, SEXP args, SEXP rho)
551551 if (DispatchOrEval (call , op , "lengths" , args , rho , & ans , 0 , 1 ))
552552 return (ans );
553553
554- Rboolean isList = isVectorList (x ) || isS4 (x );
554+ bool isList = isVectorList (x ) || isS4 (x );
555555 if (!isList ) switch (TYPEOF (x )) {
556556 case NILSXP :
557557 case CHARSXP :
@@ -640,14 +640,14 @@ attribute_hidden SEXP do_rowscols(SEXP call, SEXP op, SEXP args, SEXP rho)
640640
641641 for (R_xlen_t i = 0; i < n; i++)
642642 if (!R_FINITE(x[i])) return TRUE;
643- return FALSE ;
643+ return false ;
644644
645645 The present version is imprecise, but faster.
646646*/
647- static Rboolean mayHaveNaNOrInf (double * x , R_xlen_t n )
647+ static bool mayHaveNaNOrInf (double * x , R_xlen_t n )
648648{
649649 if ((n & 1 ) != 0 && !R_FINITE (x [0 ]))
650- return TRUE ;
650+ return true ;
651651 for (R_xlen_t i = n & 1 ; i < n ; i += 2 )
652652 /* A precise version could use this condition:
653653 *
@@ -661,8 +661,8 @@ static Rboolean mayHaveNaNOrInf(double *x, R_xlen_t n)
661661 * large finite values (e.g. 1e308) may be infinite.
662662 */
663663 if (!R_FINITE (x [i ]+ x [i + 1 ]))
664- return TRUE ;
665- return FALSE ;
664+ return true ;
665+ return false ;
666666}
667667
668668/*
@@ -672,7 +672,7 @@ static Rboolean mayHaveNaNOrInf(double *x, R_xlen_t n)
672672 safe here, because the result is only used for an imprecise test for
673673 the presence of NaN and Inf values.
674674*/
675- static Rboolean mayHaveNaNOrInf_simd (double * x , R_xlen_t n )
675+ static bool mayHaveNaNOrInf_simd (double * x , R_xlen_t n )
676676{
677677 double s = 0 ;
678678 /* SIMD reduction is supported since OpenMP 4.0. The value of _OPENMP is
@@ -687,21 +687,21 @@ static Rboolean mayHaveNaNOrInf_simd(double *x, R_xlen_t n)
687687 return !R_FINITE (s );
688688}
689689
690- static Rboolean cmayHaveNaNOrInf (Rcomplex * x , R_xlen_t n )
690+ static bool cmayHaveNaNOrInf (Rcomplex * x , R_xlen_t n )
691691{
692692 /* With HAVE_FORTRAN_DOUBLE_COMPLEX set, it should be clear that
693693 Rcomplex has no padding, so we could probably use mayHaveNaNOrInf,
694694 but better safe than sorry... */
695695 if ((n & 1 ) != 0 && (!R_FINITE (x [0 ].r ) || !R_FINITE (x [0 ].i )))
696- return TRUE ;
696+ return true ;
697697 for (R_xlen_t i = n & 1 ; i < n ; i += 2 )
698698 if (!R_FINITE (x [i ].r + x [i ].i + x [i + 1 ].r + x [i + 1 ].i ))
699- return TRUE ;
700- return FALSE ;
699+ return true ;
700+ return false ;
701701}
702702
703703/* experimental version for SIMD hardware (see also mayHaveNaNOrInf_simd) */
704- static Rboolean cmayHaveNaNOrInf_simd (Rcomplex * x , R_xlen_t n )
704+ static bool cmayHaveNaNOrInf_simd (Rcomplex * x , R_xlen_t n )
705705{
706706 double s = 0 ;
707707 /* _OPENMP >= 201307 - see mayHaveNaNOrInf_simd */
@@ -1254,7 +1254,7 @@ static void tccrossprod(Rcomplex *x, int nrx, int ncx,
12541254attribute_hidden SEXP do_matprod (SEXP call , SEXP op , SEXP args , SEXP rho )
12551255{
12561256 // .Primitive() ; may have 1 or 2 args, but some methods have more
1257- Rboolean cross = PRIMVAL (op ) != 0 ;
1257+ bool cross = PRIMVAL (op ) != 0 ;
12581258 int nargs , min_nargs = cross ? 1 : 2 ;
12591259 if (args == R_NilValue )
12601260 nargs = 0 ;
@@ -1285,7 +1285,7 @@ attribute_hidden SEXP do_matprod(SEXP call, SEXP op, SEXP args, SEXP rho)
12851285 if (CDDR (args ) != R_NilValue )
12861286 warningcall (call , _ ("more than 2 arguments passed to default method of '%s'" ),
12871287 PRIMNAME (op ));
1288- Rboolean sym = isNull (y );
1288+ bool sym = isNull (y );
12891289 if (sym && (PRIMVAL (op ) > 0 )) y = x ;
12901290 if ( !(isNumeric (x ) || isComplex (x )) || !(isNumeric (y ) || isComplex (y )) )
12911291 errorcall (call , _ ("requires numeric/complex matrix/vector arguments" ));
@@ -1910,7 +1910,7 @@ attribute_hidden SEXP do_colsum(SEXP call, SEXP op, SEXP args, SEXP rho)
19101910 if (p == NA_INTEGER || p < 0 )
19111911 error (_ ("invalid '%s' argument" ), "p" );
19121912 if (NaRm == NA_LOGICAL ) error (_ ("invalid '%s' argument" ), "na.rm" );
1913- Rboolean keepNA = !NaRm ;
1913+ bool keepNA = !NaRm ;
19141914
19151915 switch (type = TYPEOF (x )) {
19161916 case LGLSXP :
@@ -2158,7 +2158,7 @@ attribute_hidden SEXP do_array(SEXP call, SEXP op, SEXP args, SEXP rho)
21582158 /* Need to guard against possible sharing of values under
21592159 NAMED. This is not needed with reference
21602160 coutning. (PR#15919) */
2161- Rboolean needsmark = (lendat < nans || MAYBE_REFERENCED (vals ));
2161+ bool needsmark = (lendat < nans || MAYBE_REFERENCED (vals ));
21622162 for (i = 0 ; i < nans ; i ++ ) {
21632163 SEXP elt = VECTOR_ELT (vals , i % lendat );
21642164 if (needsmark || MAYBE_REFERENCED (elt ))
@@ -2366,7 +2366,7 @@ attribute_hidden SEXP do_asplit(SEXP call, SEXP op, SEXP args, SEXP rho)
23662366 SEXP drop = CAR (args );
23672367 SEXP y , e ;
23682368 int i , j , k , n1 , n2 ;
2369- Rboolean havednc , keepdim ;
2369+ bool havednc , keepdim ;
23702370 n1 = asInteger (d1 );
23712371 n2 = asInteger (d2 );
23722372 havednc = (!isNull (dnc ) && length (dnc ) > 0 );
0 commit comments