2727#include  <Rinternals.h> 
2828#include  "statsErr.h" 
2929
30- // workhorse routines from fft.c 
31- void  fft_factor (int  n , int  * pmaxf , int  * pmaxp );
32- Rboolean  fft_work (double  * a , double  * b , int  nseg , int  n , int  nspn ,
33- 		  int  isn , double  * work , int  * iwork );
3430
3531#include  "statsR.h" 
32+ #include  "stats.h" 
3633
3734/* Fourier Transform for Univariate Spatial and Time Series */ 
3835
@@ -180,22 +177,22 @@ SEXP mvfft(SEXP z, SEXP inverse)
180177    return  z ;
181178}
182179
183- static  Rboolean  ok_n (int  n , const  int  f [], int  nf )
180+ static  bool  ok_n (int  n , const  int  f [], int  nf )
184181{
185182    for  (int  i  =  0 ; i  <  nf ; i ++ ) {
186183	while (n  % f [i ] ==  0 ) {
187184	    if  ((n  =  n  / f [i ]) ==  1 )
188- 		return  TRUE ;
185+ 		return  true ;
189186	}
190187    }
191188    return  n  ==  1 ;
192189}
193- static  Rboolean  ok_n_64 (uint64_t  n , const  int  f [], int  nf )
190+ static  bool  ok_n_64 (uint64_t  n , const  int  f [], int  nf )
194191{
195192    for  (int  i  =  0 ; i  <  nf ; i ++ ) {
196193	while (n  % f [i ] ==  0 ) {
197194	    if  ((n  =  n  / f [i ]) ==  1 )
198- 		return  TRUE ;
195+ 		return  true ;
199196	}
200197    }
201198    return  n  ==  1 ;
@@ -240,7 +237,7 @@ SEXP nextn(SEXP n, SEXP f)
240237	if  (f_ [i ] ==  NA_INTEGER  ||  f_ [i ] <= 1 )
241238	    error (_ ("invalid factors" ));
242239
243-     Rboolean  use_int  =  TYPEOF (n ) ==  INTSXP ;
240+     bool  use_int  =  TYPEOF (n ) ==  INTSXP ;
244241    if (!use_int  &&  TYPEOF (n ) !=  REALSXP )
245242	error (_ ("'n' must have typeof(.) \"integer\" or \"double\"" ));
246243    R_xlen_t  nn  =  XLENGTH (n );
@@ -250,7 +247,7 @@ SEXP nextn(SEXP n, SEXP f)
250247	    if  (!ISNAN (d_n [i ]) &&  d_n [i ] >  n_max ) n_max  =  d_n [i ];
251248	}
252249	if (n_max  <= INT_MAX  / f_ [0 ]) { // maximal n[] should not be too large to find "next n" 
253- 	    use_int  =  TRUE ;
250+ 	    use_int  =  true ;
254251	    n  =  PROTECT (n  =  coerceVector (n , INTSXP )); nprot ++ ;
255252	}
256253    }
0 commit comments