@@ -102,7 +102,7 @@ attribute_hidden SEXP do_agrep(SEXP call, SEXP op, SEXP args, SEXP env)
102102    int  opt_icase , opt_value , opt_fixed , useBytes ;
103103    R_xlen_t  i , j , n ;
104104    int  nmatches , patlen ;
105-     Rboolean  useWC  =  FALSE ;
105+     bool  useWC  =  false ;
106106    const  void  * vmax  =  NULL ;
107107
108108    regex_t  reg ;
@@ -139,22 +139,22 @@ attribute_hidden SEXP do_agrep(SEXP call, SEXP op, SEXP args, SEXP env)
139139
140140    n  =  XLENGTH (vec );
141141    if (!useBytes ) {
142- 	Rboolean  haveBytes  =  IS_BYTES (STRING_ELT (pat , 0 ));
142+ 	bool  haveBytes  =  IS_BYTES (STRING_ELT (pat , 0 ));
143143	if (!haveBytes )
144144	    for  (i  =  0 ; i  <  n ; i ++ )
145145		if (IS_BYTES (STRING_ELT (vec , i ))) {
146- 		    haveBytes  =  TRUE ;
146+ 		    haveBytes  =  true ;
147147		    break ;
148148		}
149- 	if (haveBytes ) useBytes  =  TRUE ;
149+ 	if (haveBytes ) useBytes  =  true ;
150150    }
151151    if (!useBytes ) {
152152	useWC  =  !IS_ASCII (STRING_ELT (pat , 0 ));
153153	if (!useWC ) {
154154	    for  (i  =  0  ; i  <  n  ; i ++ ) {
155155		if (STRING_ELT (vec , i ) ==  NA_STRING ) continue ;
156156		if (!IS_ASCII (STRING_ELT (vec , i ))) {
157- 		    useWC  =  TRUE ;
157+ 		    useWC  =  true ;
158158		    break ;
159159		}
160160	    }
@@ -295,7 +295,7 @@ attribute_hidden SEXP do_agrep(SEXP call, SEXP op, SEXP args, SEXP env)
295295#define  MAT (X , I , J )		X[I + (J) * nr]
296296
297297static  SEXP 
298- adist_full (SEXP  x , SEXP  y , double  * costs , Rboolean  opt_counts )
298+ adist_full (SEXP  x , SEXP  y , double  * costs , bool  opt_counts )
299299{
300300    SEXP  ans , counts , trafos  =  R_NilValue  /* -Wall */ , dimnames , names ;
301301    double  cost_ins , cost_del , cost_sub ;
@@ -490,12 +490,12 @@ attribute_hidden SEXP do_adist(SEXP call, SEXP op, SEXP args, SEXP env)
490490    SEXP  x , y ;
491491    SEXP  ans , counts , offsets , dimnames , names , elt ;
492492    SEXP  opt_costs ;
493-     Rboolean  opt_fixed , opt_partial , opt_counts , opt_icase , useBytes ;
493+     bool  opt_fixed , opt_partial , opt_counts , opt_icase , useBytes ;
494494    int  i  =  0 , j  =  0 , m , nx , ny , nxy ;
495495    const  char  * s , * t ;
496496    const  void  * vmax  =  NULL ;
497497
498-     Rboolean  haveBytes , useWC  =  FALSE ;
498+     bool  haveBytes , useWC  =  false ;
499499
500500    regex_t  reg ;
501501    regaparams_t  params ;
@@ -509,11 +509,11 @@ attribute_hidden SEXP do_adist(SEXP call, SEXP op, SEXP args, SEXP env)
509509    x  =  CAR (args ); args  =  CDR (args );
510510    y  =  CAR (args ); args  =  CDR (args );
511511    opt_costs  =  CAR (args ); args  =  CDR (args );
512-     opt_counts  =  asRbool (CAR (args ), call ); args  =  CDR (args );
513-     opt_fixed  =  asRbool (CAR (args ), call ); args  =  CDR (args );
514-     opt_partial  =  asRbool (CAR (args ), call ); args  =  CDR (args );
515-     opt_icase  =  asRbool (CAR (args ), call ); args  =  CDR (args );
516-     useBytes  =  asRbool (CAR (args ), call );
512+     opt_counts  =  asBool2 (CAR (args ), call ); args  =  CDR (args );
513+     opt_fixed  =  asBool2 (CAR (args ), call ); args  =  CDR (args );
514+     opt_partial  =  asBool2 (CAR (args ), call ); args  =  CDR (args );
515+     opt_icase  =  asBool2 (CAR (args ), call ); args  =  CDR (args );
516+     useBytes  =  asBool2 (CAR (args ), call );
517517
518518    if (opt_counts  ==  NA_INTEGER ) opt_counts  =  0 ;
519519    if (opt_fixed  ==  NA_INTEGER ) opt_fixed  =  1 ;
@@ -541,37 +541,37 @@ attribute_hidden SEXP do_adist(SEXP call, SEXP op, SEXP args, SEXP env)
541541    nxy  =  nx  *  ny ;
542542
543543    if (!useBytes ) {
544- 	haveBytes  =  FALSE ;
544+ 	haveBytes  =  false ;
545545	for (i  =  0 ; i  <  nx ; i ++ ) {
546546	    if (IS_BYTES (STRING_ELT (x , i ))) {
547- 		haveBytes  =  TRUE ;
547+ 		haveBytes  =  true ;
548548		break ;
549549	    }
550550	}
551551	if (!haveBytes ) {
552552	    for (j  =  0 ; j  <  ny ; j ++ ) {
553553		if (IS_BYTES (STRING_ELT (y , j ))) {
554- 		    haveBytes  =  TRUE ;
554+ 		    haveBytes  =  true ;
555555		    break ;
556556		}
557557	    }
558558	}
559- 	if (haveBytes ) useBytes  =  TRUE ;
559+ 	if (haveBytes ) useBytes  =  true ;
560560    }
561561
562562    if (!useBytes ) {
563563	for (i  =  0 ; i  <  nx ; i ++ ) {
564564	    if (STRING_ELT (x , i ) ==  NA_STRING ) continue ;
565565	    if (!IS_ASCII (STRING_ELT (x , i ))) {
566- 		useWC  =  TRUE ;
566+ 		useWC  =  true ;
567567		break ;
568568	    }
569569	}
570570	if (!useWC ) {
571571	    for (j  =  0 ; j  <  ny ; j ++ ) {
572572		if (STRING_ELT (y , j ) ==  NA_STRING ) continue ;
573573		if (!IS_ASCII (STRING_ELT (y , j ))) {
574- 		    useWC  =  TRUE ;
574+ 		    useWC  =  true ;
575575		    break ;
576576		}
577577	    }
@@ -739,7 +739,7 @@ attribute_hidden SEXP do_aregexec(SEXP call, SEXP op, SEXP args, SEXP env)
739739    SEXP  opt_bounds , opt_costs ;
740740    int  opt_icase , opt_fixed , useBytes ;
741741
742-     Rboolean  haveBytes , useWC  =  FALSE ;
742+     bool  haveBytes , useWC  =  false ;
743743    const  char  * s , * t ;
744744    const  void  * vmax  =  NULL ;
745745
@@ -789,11 +789,11 @@ attribute_hidden SEXP do_aregexec(SEXP call, SEXP op, SEXP args, SEXP env)
789789	if (!haveBytes )
790790	    for (R_xlen_t  i  =  0 ; i  <  n ; i ++ ) {
791791		if (IS_BYTES (STRING_ELT (vec , i ))) {
792- 		    haveBytes  =  TRUE ;
792+ 		    haveBytes  =  true ;
793793		    break ;
794794		}
795795	    }
796- 	if (haveBytes ) useBytes  =  TRUE ;
796+ 	if (haveBytes ) useBytes  =  true ;
797797    }
798798
799799    if (!useBytes ) {
@@ -802,7 +802,7 @@ attribute_hidden SEXP do_aregexec(SEXP call, SEXP op, SEXP args, SEXP env)
802802	    for (R_xlen_t  i  =  0  ; i  <  n  ; i ++ ) {
803803		if (STRING_ELT (vec , i ) ==  NA_STRING ) continue ;
804804		if (!IS_ASCII (STRING_ELT (vec , i ))) {
805- 		    useWC  =  TRUE ;
805+ 		    useWC  =  true ;
806806		    break ;
807807		}
808808	    }
@@ -891,7 +891,7 @@ attribute_hidden SEXP do_aregexec(SEXP call, SEXP op, SEXP args, SEXP env)
891891		setAttrib (matchpos , install ("match.length" ), matchlen );
892892		if (useBytes )
893893		    setAttrib (matchpos , install ("useBytes" ),
894- 			      ScalarLogical (TRUE ));
894+ 			      ScalarLogical (true ));
895895		SET_VECTOR_ELT (ans , i , matchpos );
896896		UNPROTECT (2 );
897897	    } else  {
0 commit comments