Skip to content

Commit f5a94a2

Browse files
author
ripley
committed
Rboolean -> bool
git-svn-id: https://svn.r-project.org/R/trunk@87925 00db46b3-68df-0310-9c12-caf00c1e9a41
1 parent 2dd9c3c commit f5a94a2

File tree

6 files changed

+75
-72
lines changed

6 files changed

+75
-72
lines changed

src/appl/integrate.c

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* R : A Computer Language for Statistical Data Analysis
3-
* Copyright (C) 2001-2023 The R Core Team
3+
* Copyright (C) 2001-2025 The R Core Team
44
*
55
* This program is free software; you can redistribute it and/or modify
66
* it under the terms of the GNU General Public License as published by
@@ -267,7 +267,7 @@ void rdqagie(integr_fn f, void *ex, double *bound, int *inf, double *
267267
double a1, a2, b1, b2, defab1, defab2, oflow;
268268
int ktmin, nrmax;
269269
double uflow;
270-
Rboolean noext;
270+
bool noext;
271271
int iroff1, iroff2, iroff3;
272272
double res3la[3], error1, error2;
273273
int id;
@@ -278,7 +278,7 @@ void rdqagie(integr_fn f, void *ex, double *bound, int *inf, double *
278278
double erlast, errmax;
279279
int maxerr;
280280
double reseps;
281-
Rboolean extrap;
281+
bool extrap;
282282
double ertest = 0.0, errsum;
283283

284284
/**begin prologue dqagie
@@ -550,8 +550,8 @@ standard fortran subroutine
550550
nres = 0;
551551
ktmin = 0;
552552
numrl2 = 2;
553-
extrap = FALSE;
554-
noext = FALSE;
553+
extrap = false;
554+
noext = false;
555555
ierro = 0;
556556
iroff1 = 0;
557557
iroff2 = 0;
@@ -669,7 +669,7 @@ standard fortran subroutine
669669
if (fabs(blist[maxerr] - alist[maxerr]) > small) {
670670
continue;
671671
}
672-
extrap = TRUE;
672+
extrap = true;
673673
nrmax = 2;
674674
}
675675

@@ -718,15 +718,15 @@ standard fortran subroutine
718718

719719
L70:
720720
if (numrl2 == 1) {
721-
noext = TRUE;
721+
noext = true;
722722
}
723723
if (*ier == 5) {
724724
break;
725725
}
726726
maxerr = iord[1];
727727
errmax = elist[maxerr];
728728
nrmax = 1;
729-
extrap = FALSE;
729+
extrap = false;
730730
small *= .5;
731731
erlarg = errsum;
732732
L90:
@@ -978,7 +978,7 @@ void rdqagse(integr_fn f, void *ex, double *a, double *b, double *
978978
iord, int *last)
979979
{
980980
/* Local variables */
981-
Rboolean noext, extrap;
981+
bool noext, extrap;
982982
int k,ksgn, nres;
983983
int ierro;
984984
int ktmin, nrmax;
@@ -1259,8 +1259,8 @@ void rdqagse(integr_fn f, void *ex, double *a, double *b, double *
12591259
nres = 0;
12601260
numrl2 = 2;
12611261
ktmin = 0;
1262-
extrap = FALSE;
1263-
noext = FALSE;
1262+
extrap = false;
1263+
noext = false;
12641264
iroff1 = 0;
12651265
iroff2 = 0;
12661266
iroff3 = 0;
@@ -1373,7 +1373,7 @@ void rdqagse(integr_fn f, void *ex, double *a, double *b, double *
13731373
if (fabs(blist[maxerr] - alist[maxerr]) > small) {
13741374
continue;
13751375
}
1376-
extrap = TRUE;
1376+
extrap = true;
13771377
nrmax = 2;
13781378
}
13791379

@@ -1421,15 +1421,15 @@ void rdqagse(integr_fn f, void *ex, double *a, double *b, double *
14211421
/* prepare bisection of the smallest interval. L70: */
14221422

14231423
if (numrl2 == 1) {
1424-
noext = TRUE;
1424+
noext = true;
14251425
}
14261426
if (*ier == 5) {
14271427
break;
14281428
}
14291429
maxerr = iord[1];
14301430
errmax = elist[maxerr];
14311431
nrmax = 1;
1432-
extrap = FALSE;
1432+
extrap = false;
14331433
small *= .5;
14341434
erlarg = errsum;
14351435
L90:

src/appl/interv.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* R : A Computer Language for Statistical Data Analysis
3-
* Copyright (C) 2002--2016 The R Core Team
3+
* Copyright (C) 2002--2025 The R Core Team
44
*
55
* This program is free software; you can redistribute it and/or modify
66
* it under the terms of the GNU General Public License as published by
@@ -27,7 +27,9 @@
2727
#include <R_ext/Boolean.h>
2828
#include <R_ext/Utils.h>
2929

30-
/* This is called from stats/src/bvalue.f, 3 x stats/src/s*.f for smooth.spline()
30+
/* In API headers R_ext/Applic.h and R_ext/Utils.h
31+
32+
This is called from stats/src/bvalue.f, 3 x stats/src/s*.f for smooth.spline()
3133
and packages gam and mda */
3234
int F77_SUB(interv)(double *xt, int *n, double *x,
3335
Rboolean *rightmost_closed, Rboolean *all_inside,
@@ -36,6 +38,7 @@ int F77_SUB(interv)(double *xt, int *n, double *x,
3638
return findInterval(xt, *n, *x, *rightmost_closed, *all_inside, *ilo, mflag);
3739
}
3840

41+
/* In API header R_ext/Utils.h */
3942
int findInterval2(double *xt, int n, double x,
4043
Rboolean rightmost_closed, Rboolean all_inside,
4144
Rboolean left_open, // <- new in findInterval2()

src/appl/maxcol.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* R : A Computer Language for Statistical Data Analysis
33
4-
* Copyright (C) 2007-2021 The R Core Team
4+
* Copyright (C) 2007-2025 The R Core Team
55
* Copyright (C) 1994-9 W. N. Venables and B. D. Ripley
66
*
77
* This program is free software; you can redistribute it and/or modify
@@ -44,16 +44,16 @@ void R_max_col(double *matrix, int *nr, int *nc, int *maxes, int *ties_meth)
4444
int c, m;
4545
size_t n_r = *nr; // for indexing like r + c * n_r
4646
double a, b, large;
47-
Rboolean isna, used_random = FALSE, do_rand = *ties_meth == 1;
47+
bool isna, used_random = false, do_rand = *ties_meth == 1;
4848

4949
for (size_t r = 0; r < n_r; r++) {
5050
/* first check row for any NAs and find the largest abs(entry) */
5151
large = 0.0;
52-
isna = TRUE;
52+
isna = true;
5353
for (c = 0; c < *nc; c++) {
5454
a = matrix[r + c * n_r];
55-
if (ISNAN(a)) { isna = TRUE; break; }
56-
else if(isna) isna = FALSE;
55+
if (ISNAN(a)) { isna = true; break; }
56+
else if(isna) isna = false;
5757
if (!R_FINITE(a)) continue;
5858
if (do_rand) large = fmax2(large, fabs(a));
5959
}
@@ -71,7 +71,7 @@ void R_max_col(double *matrix, int *nr, int *nc, int *maxes, int *ties_meth)
7171
ntie = 1;
7272
} else if (b >= a - tol) { /* b ~= current max. a */
7373
ntie++;
74-
if (!used_random) { GetRNGstate(); used_random = TRUE; }
74+
if (!used_random) { GetRNGstate(); used_random = true; }
7575
if (ntie * unif_rand() < 1.) m = c;
7676
}
7777
}

src/appl/optim.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* R : A Computer Language for Statistical Data Analysis
3-
* Copyright (C) 1999-2014 The R Core Team
3+
* Copyright (C) 1999-2025 The R Core Team
44
*
55
* This program is free software; you can redistribute it and/or modify
66
* it under the terms of the GNU General Public License as published by
@@ -116,7 +116,7 @@ vmmin(int n0, double *b, double *Fmin, optimfn fminfn, optimgr fmingr,
116116
double abstol, double reltol, int nREPORT, void *ex,
117117
int *fncount, int *grcount, int *fail)
118118
{
119-
Rboolean accpoint, enough;
119+
bool accpoint, enough;
120120
double *g, *t, *X, *c, **B;
121121
int count, funcount, gradcount;
122122
double f, gradproj;
@@ -174,7 +174,7 @@ vmmin(int n0, double *b, double *Fmin, optimfn fminfn, optimgr fmingr,
174174

175175
if (gradproj < 0.0) { /* search direction is downhill */
176176
steplength = 1.0;
177-
accpoint = FALSE;
177+
accpoint = false;
178178
do {
179179
count = 0;
180180
for (i = 0; i < n; i++) {
@@ -272,7 +272,7 @@ void nmmin(int n, double *Bvec, double *X, double *Fmin, optimfn fminfn,
272272
{
273273
char action[50];
274274
int C;
275-
Rboolean calcvert;
275+
bool calcvert;
276276
double convtol, f;
277277
int funcount=0, H, i, j, L=0;
278278
int n1=0;
@@ -291,11 +291,11 @@ void nmmin(int n, double *Bvec, double *X, double *Fmin, optimfn fminfn,
291291
if (trace)
292292
Rprintf(" Nelder-Mead direct search function minimizer\n");
293293
P = matrix(n, n+1);
294-
*fail = FALSE;
294+
*fail = false;
295295
f = fminfn(n, Bvec, ex);
296296
if (!R_FINITE(f)) {
297297
error(_("function cannot be evaluated at initial parameters"));
298-
*fail = TRUE;
298+
*fail = true;
299299
} else {
300300
if (trace) Rprintf("function value for initial parameters = %f\n", f);
301301
funcount = 1;
@@ -330,7 +330,7 @@ void nmmin(int n, double *Bvec, double *X, double *Fmin, optimfn fminfn,
330330
size += trystep;
331331
}
332332
oldsize = size;
333-
calcvert = TRUE;
333+
calcvert = true;
334334
do {
335335
if (calcvert) {
336336
for (j = 0; j < n1; j++) {
@@ -343,7 +343,7 @@ void nmmin(int n, double *Bvec, double *X, double *Fmin, optimfn fminfn,
343343
P[n1 - 1][j] = f;
344344
}
345345
}
346-
calcvert = FALSE;
346+
calcvert = false;
347347
}
348348

349349
VL = P[n1 - 1][L - 1];
@@ -427,7 +427,7 @@ void nmmin(int n, double *Bvec, double *X, double *Fmin, optimfn fminfn,
427427
} else {
428428
if (VR >= VH) {
429429
strcpy(action, "SHRINK ");
430-
calcvert = TRUE;
430+
calcvert = true;
431431
size = 0.0;
432432
for (j = 0; j < n1; j++) {
433433
if (j + 1 != L) {
@@ -472,7 +472,7 @@ void cgmin(int n, double *Bvec, double *X, double *Fmin,
472472
double abstol, double intol, void *ex, int type, int trace,
473473
int *fncount, int *grcount, int maxit)
474474
{
475-
Rboolean accpoint;
475+
bool accpoint;
476476
double *c, *g, *t;
477477
int count, cycle, cyclimit;
478478
double f;
@@ -484,7 +484,7 @@ void cgmin(int n, double *Bvec, double *X, double *Fmin,
484484
if (maxit <= 0) {
485485
*Fmin = fminfn(n, Bvec, ex);
486486
*fncount = *grcount = 0;
487-
*fail = FALSE;
487+
*fail = false;
488488
return;
489489
}
490490
if (trace) {
@@ -578,7 +578,7 @@ void cgmin(int n, double *Bvec, double *X, double *Fmin,
578578
}
579579
steplength = oldstep;
580580

581-
accpoint = FALSE;
581+
accpoint = false;
582582
do {
583583
count = 0;
584584
for (i = 0; i < n; i++) {

src/appl/pretty.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,11 @@ double R_pretty(double *lo, double *up, int *ndiv, int min_n,
9393
up_ = *up,
9494
dx = up_ - lo_,
9595
cell, U;
96-
Rboolean i_small;
96+
bool i_small;
9797
/* cell := "scale" here */
9898
if(dx == 0 && up_ == 0) { /* up == lo == 0 */
9999
cell = 1;
100-
i_small = TRUE;
100+
i_small = true;
101101
} else {
102102
cell = fmax2(fabs(lo_),fabs(up_));
103103
/* U = upper bound on cell/unit */

0 commit comments

Comments
 (0)