11/* 
22 *  R : A Computer Language for Statistical Data Analysis 
33 *  Copyright (C) 1995  Robert Gentleman and Ross Ihaka 
4-  *  Copyright (C) 1997--2024   The R Core Team 
4+  *  Copyright (C) 1997--2025   The R Core Team 
55 *  Copyright (C) 2003	      The R Foundation 
66 * 
77 *  This program is free software; you can redistribute it and/or modify 
@@ -79,7 +79,7 @@ R_FindNativeSymbolFromDLL(char *name, DllReference *dll,
7979static  SEXP  naokfind (SEXP  args , int  *  len , int  * naok , DllReference  * dll );
8080static  SEXP  pkgtrim (SEXP  args , DllReference  * dll );
8181
82- static  R_INLINE  Rboolean  isNativeSymbolInfo (SEXP  op )
82+ static  R_INLINE  bool  isNativeSymbolInfo (SEXP  op )
8383{
8484    /* was: inherits(op, "NativeSymbolInfo") 
8585     * inherits() is slow because of string comparisons, so use 
@@ -321,7 +321,7 @@ resolveNativeRoutine(SEXP args, DL_FUNC *fun,
321321}
322322
323323
324- static  Rboolean 
324+ static  bool 
325325checkNativeType (int  targetType , int  actualType )
326326{
327327    if (targetType  >  0 ) {
@@ -331,20 +331,20 @@ checkNativeType(int targetType, int actualType)
331331	return (targetType  ==  actualType );
332332    }
333333
334-     return (TRUE );
334+     return (true );
335335}
336336
337337
338- static  Rboolean 
338+ static  bool 
339339comparePrimitiveTypes (R_NativePrimitiveArgType  type , SEXP  s )
340340{
341341   if (type  ==  ANYSXP  ||  TYPEOF (s ) ==  type )
342-       return (TRUE );
342+       return (true );
343343
344344   if (type  ==  SINGLESXP )
345345      return (asLogical (getAttrib (s , install ("Csingle" ))) ==  TRUE);
346346
347-    return (FALSE );
347+    return (false );
348348}
349349
350350
@@ -525,10 +525,10 @@ static SEXP check_retval(SEXP call, SEXP val)
525525    static  int  check  =  FALSE;
526526
527527    if  (! inited ) {
528- 	inited  =  TRUE ;
528+ 	inited  =  true ;
529529	const  char  * p  =  getenv ("_R_CHECK_DOTCODE_RETVAL_" );
530530	if  (p  !=  NULL  &&  StringTrue (p ))
531- 	    check  =  TRUE ;
531+ 	    check  =  true ;
532532    }
533533
534534    if  (check ) {
@@ -1444,7 +1444,7 @@ attribute_hidden SEXP do_dotcall(SEXP call, SEXP op, SEXP args, SEXP env)
14441444	}
14451445	retval  =  PROTECT (R_doDotCall (ofun , nargs , cargs , call ));
14461446	nprotect ++ ;
1447- 	Rboolean  constsOK  =  TRUE ;
1447+ 	bool  constsOK  =  true ;
14481448	for (i  =  0 ; constsOK  &&  i  <  nargs ; i ++ )
14491449	    /* 39: not numerical comparison, not single NA, not attributes as 
14501450               set, do ignore byte-code, do ignore environments of closures, 
@@ -1455,7 +1455,7 @@ attribute_hidden SEXP do_dotcall(SEXP call, SEXP op, SEXP args, SEXP env)
14551455	    */ 
14561456            if  (!R_compute_identical (cargs [i ], cargscp [i ], 39 )
14571457		    &&  !R_checkConstants (FALSE))
1458- 		constsOK  =  FALSE ;
1458+ 		constsOK  =  false ;
14591459	if  (!constsOK ) {
14601460	    REprintf ("ERROR: detected compiler constant(s) modification after" 
14611461		" .Call invocation of function %s from library %s (%s).\n" ,
@@ -1501,13 +1501,13 @@ attribute_hidden SEXP do_Externalgr(SEXP call, SEXP op, SEXP args, SEXP env)
15011501{
15021502    SEXP  retval ;
15031503    pGEDevDesc  dd  =  GEcurrentDevice ();
1504-     Rboolean  record  =  dd -> recordGraphics ;
1504+     bool  record  =  dd -> recordGraphics ;
15051505#ifdef  R_GE_DEBUG 
15061506    if  (getenv ("R_GE_DEBUG_record" )) {
15071507        printf ("do_Externalgr: record = FALSE\n" );
15081508    }
15091509#endif 
1510-     dd -> recordGraphics  =  FALSE ;
1510+     dd -> recordGraphics  =  false ;
15111511    PROTECT (retval  =  do_External (call , op , args , env ));
15121512#ifdef  R_GE_DEBUG 
15131513    if  (getenv ("R_GE_DEBUG_record" )) {
@@ -1532,13 +1532,13 @@ attribute_hidden SEXP do_dotcallgr(SEXP call, SEXP op, SEXP args, SEXP env)
15321532{
15331533    SEXP  retval ;
15341534    pGEDevDesc  dd  =  GEcurrentDevice ();
1535-     Rboolean  record  =  dd -> recordGraphics ;
1535+     bool  record  =  dd -> recordGraphics ;
15361536#ifdef  R_GE_DEBUG 
15371537    if  (getenv ("R_GE_DEBUG_record" )) {
15381538        printf ("do_dotcallgr: record = FALSE\n" );
15391539    }
15401540#endif 
1541-     dd -> recordGraphics  =  FALSE ;
1541+     dd -> recordGraphics  =  false ;
15421542    PROTECT (retval  =  do_dotcall (call , op , args , env ));
15431543#ifdef  R_GE_DEBUG 
15441544    if  (getenv ("R_GE_DEBUG_record" )) {
@@ -1564,7 +1564,7 @@ Rf_getCallingDLL(void)
15641564    SEXP  e , ans ;
15651565    RCNTXT  * cptr ;
15661566    SEXP  rho  =  R_NilValue ;
1567-     Rboolean  found  =  FALSE ;
1567+     bool  found  =  false ;
15681568
15691569    /* First find the environment of the caller. 
15701570       Testing shows this is the right caller, despite the .C/.Call ... 
@@ -1583,7 +1583,7 @@ Rf_getCallingDLL(void)
15831583    while (rho  !=  R_NilValue ) {
15841584	if  (rho  ==  R_GlobalEnv ) break ;
15851585	else  if  (R_IsNamespaceEnv (rho )) {
1586- 	    found  =  TRUE ;
1586+ 	    found  =  true ;
15871587	    break ;
15881588	}
15891589	rho  =  ENCLOS (rho );
@@ -1662,7 +1662,7 @@ attribute_hidden SEXP do_dotCode(SEXP call, SEXP op, SEXP args, SEXP env)
16621662{
16631663    void  * * cargs , * * cargs0  =  NULL  /* -Wall */ ;
16641664    int  naok , na , nargs , Fort ;
1665-     Rboolean   havenames ,  copy  =  R_CBoundsCheck ; /* options(CboundsCheck) */ 
1665+     bool  copy  =  R_CBoundsCheck ; /* options(CboundsCheck) */ 
16661666    DL_FUNC  fun  =  NULL ;
16671667    SEXP  ans , pa , s ;
16681668    R_RegisteredNativeSymbol  symbol  =  {R_C_SYM , {NULL }, NULL };
@@ -1698,9 +1698,9 @@ attribute_hidden SEXP do_dotCode(SEXP call, SEXP op, SEXP args, SEXP env)
16981698
16991699    /* Construct the return value */ 
17001700    nargs  =  0 ;
1701-     havenames  =  FALSE ;
1701+     bool   havenames  =  false ;
17021702    for (pa  =  args  ; pa  !=  R_NilValue ; pa  =  CDR (pa )) {
1703- 	if  (TAG (pa ) !=  R_NilValue ) havenames  =  TRUE ;
1703+ 	if  (TAG (pa ) !=  R_NilValue ) havenames  =  true ;
17041704	nargs ++ ;
17051705    }
17061706
@@ -1739,7 +1739,7 @@ attribute_hidden SEXP do_dotCode(SEXP call, SEXP op, SEXP args, SEXP env)
17391739	   what is needed for non-atomic-vector inputs */ 
17401740	SET_VECTOR_ELT (ans , na , s );
17411741
1742- 	if (checkNativeType (targetType , TYPEOF (s )) ==  FALSE  && 
1742+ 	if (checkNativeType (targetType , TYPEOF (s )) ==  false  && 
17431743	   targetType  !=  SINGLESXP ) {
17441744	    /* Cannot be called if DUP = FALSE, so only needs to live 
17451745	       until copied in the switch. 
0 commit comments