Skip to content

Commit 639b93a

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

File tree

9 files changed

+169
-167
lines changed

9 files changed

+169
-167
lines changed

src/library/parallel/src/ncpus.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ static DWORD CountSetBits(ULONG_PTR bitMask)
5252
}
5353

5454
// Detect CPUs using GetLogicaProcessInformationEx, if available.
55-
static Rboolean ncpus_ex(int *ians)
55+
static bool ncpus_ex(int *ians)
5656
{
5757
LPFN_GLPI_EX glpi;
5858
BOOL done = FALSE;
@@ -69,7 +69,7 @@ static Rboolean ncpus_ex(int *ians)
6969
GetProcAddress(GetModuleHandle(TEXT("kernel32")),
7070
"GetLogicalProcessorInformationEx");
7171
if (NULL == glpi)
72-
return FALSE;
72+
return false;
7373

7474
/* count the number of logical processors using RelationGroup, counting
7575
bits in affinity masks would not work on 32-bit systems */

src/library/tools/src/getfmts.c

Lines changed: 2 additions & 3 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--2013 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
@@ -52,7 +52,6 @@ SEXP getfmts(SEXP format)
5252
size_t n, cur, chunk, maxlen = 0;
5353

5454
int nthis, nstar;
55-
Rboolean use_UTF8;
5655
const void *vmax = vmaxget();
5756

5857
SEXP res = PROTECT(allocVector(STRSXP, MAXNARGS));
@@ -68,7 +67,7 @@ SEXP getfmts(SEXP format)
6867
if (nfmt != 1)
6968
error(_("'fmt' must be length 1"));
7069

71-
use_UTF8 = getCharCE(STRING_ELT(format, 0)) == CE_UTF8;
70+
bool use_UTF8 = getCharCE(STRING_ELT(format, 0)) == CE_UTF8;
7271
formatString = TRANSLATE_CHAR(format, 0);
7372
n = strlen(formatString);
7473
if (n > MAXLINE)

src/library/tools/src/gramLatex.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
/*
7272
* R : A Computer Language for Statistical Data Analysis
7373
* Copyright (C) 1995, 1996, 1997 Robert Gentleman and Ross Ihaka
74-
* Copyright (C) 1997--2024 The R Core Team
74+
* Copyright (C) 1997--2025 The R Core Team
7575
* Copyright (C) 2010--2025 Duncan Murdoch
7676
*
7777
* This program is free software; you can redistribute it and/or modify
@@ -206,7 +206,7 @@ struct ParseState {
206206
ParseState *prevState;
207207
};
208208

209-
static Rboolean busy = FALSE;
209+
static bool busy = false;
210210
static ParseState parseState;
211211
static char ParseErrorMsg[PARSE_ERROR_SIZE];
212212

@@ -221,7 +221,7 @@ static void xxsavevalue(SEXP, YYLTYPE *);
221221
static SEXP xxtag(SEXP, int, YYLTYPE *);
222222
static SEXP xxenv(SEXP, SEXP, SEXP, YYLTYPE *);
223223
static SEXP xxnewdef(SEXP, SEXP, YYLTYPE *);
224-
static SEXP xxmath(SEXP, YYLTYPE *, Rboolean);
224+
static SEXP xxmath(SEXP, YYLTYPE *, bool);
225225
static SEXP xxblock(SEXP, YYLTYPE *);
226226
static void xxSetInVerbEnv(SEXP);
227227
static SEXP xxpushMode(int, int);
@@ -1936,11 +1936,11 @@ yyparse (void)
19361936
break;
19371937

19381938
case 27: /* math: '$' nonMath '$' */
1939-
{ yyval = xxmath(yyvsp[-1], &(yyloc), FALSE); }
1939+
{ yyval = xxmath(yyvsp[-1], &(yyloc), false); }
19401940
break;
19411941

19421942
case 28: /* displaymath: TWO_DOLLARS nonMath TWO_DOLLARS */
1943-
{ yyval = xxmath(yyvsp[-1], &(yyloc), TRUE); }
1943+
{ yyval = xxmath(yyvsp[-1], &(yyloc), true); }
19441944
break;
19451945

19461946
case 29: /* block: '{' Items '}' */
@@ -2329,7 +2329,7 @@ static void xxArg(void) {
23292329
}
23302330
}
23312331

2332-
static SEXP xxmath(SEXP body, YYLTYPE *lloc, Rboolean display)
2332+
static SEXP xxmath(SEXP body, YYLTYPE *lloc, bool display)
23332333
{
23342334
SEXP ans;
23352335
#if DEBUGVALS
@@ -3022,7 +3022,7 @@ static void PushState(void) {
30223022
parseState.prevState = prev;
30233023
} else
30243024
parseState.prevState = NULL;
3025-
busy = TRUE;
3025+
busy = true;
30263026
}
30273027

30283028
static void PopState(void) {
@@ -3031,7 +3031,7 @@ static void PopState(void) {
30313031
UseState(prev);
30323032
free(prev);
30333033
} else
3034-
busy = FALSE;
3034+
busy = false;
30353035
}
30363036

30373037
/* "parseLatex"

src/library/tools/src/gramLatex.y

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/*
44
* R : A Computer Language for Statistical Data Analysis
55
* Copyright (C) 1995, 1996, 1997 Robert Gentleman and Ross Ihaka
6-
* Copyright (C) 1997--2024 The R Core Team
6+
* Copyright (C) 1997--2025 The R Core Team
77
* Copyright (C) 2010--2025 Duncan Murdoch
88
*
99
* This program is free software; you can redistribute it and/or modify
@@ -138,7 +138,7 @@ struct ParseState {
138138
ParseState *prevState;
139139
};
140140

141-
static Rboolean busy = FALSE;
141+
static bool busy = false;
142142
static ParseState parseState;
143143
static char ParseErrorMsg[PARSE_ERROR_SIZE];
144144

@@ -153,7 +153,7 @@ static void xxsavevalue(SEXP, YYLTYPE *);
153153
static SEXP xxtag(SEXP, int, YYLTYPE *);
154154
static SEXP xxenv(SEXP, SEXP, SEXP, YYLTYPE *);
155155
static SEXP xxnewdef(SEXP, SEXP, YYLTYPE *);
156-
static SEXP xxmath(SEXP, YYLTYPE *, Rboolean);
156+
static SEXP xxmath(SEXP, YYLTYPE *, bool);
157157
static SEXP xxblock(SEXP, YYLTYPE *);
158158
static void xxSetInVerbEnv(SEXP);
159159
static SEXP xxpushMode(int, int);
@@ -379,7 +379,7 @@ static void xxArg(void) {
379379
}
380380
}
381381

382-
static SEXP xxmath(SEXP body, YYLTYPE *lloc, Rboolean display)
382+
static SEXP xxmath(SEXP body, YYLTYPE *lloc, bool display)
383383
{
384384
SEXP ans;
385385
#if DEBUGVALS
@@ -1072,7 +1072,7 @@ static void PushState(void) {
10721072
parseState.prevState = prev;
10731073
} else
10741074
parseState.prevState = NULL;
1075-
busy = TRUE;
1075+
busy = true;
10761076
}
10771077

10781078
static void PopState(void) {
@@ -1081,7 +1081,7 @@ static void PopState(void) {
10811081
UseState(prev);
10821082
free(prev);
10831083
} else
1084-
busy = FALSE;
1084+
busy = false;
10851085
}
10861086

10871087
/* "parseLatex"

src/library/tools/src/gramRd.c

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,8 @@
120120
#define DEBUGVALS 0 /* 1 causes detailed internal state output to R console */
121121
#define DEBUGMODE 0 /* 1 causes Bison output of parse state, to stdout or stderr */
122122

123-
static Rboolean wCalls = TRUE;
124-
static Rboolean warnDups = FALSE;
123+
static bool wCalls = true;
124+
static bool warnDups = false;
125125

126126
#define YYERROR_VERBOSE 1
127127

@@ -208,7 +208,7 @@ struct ParseState {
208208
ParseState *prevState;
209209
};
210210

211-
static Rboolean busy = FALSE;
211+
static bool busy = false;
212212
static ParseState parseState;
213213

214214
#define PRESERVE_SV(x) R_PreserveInMSet((x), parseState.mset)
@@ -3141,7 +3141,7 @@ static SEXP xxnewcommand(SEXP cmd, SEXP name, SEXP defn, YYLTYPE *lloc)
31413141
#define START_MACRO -2
31423142
#define END_MACRO -3
31433143

3144-
static Rboolean isComment(SEXP elt)
3144+
static bool isComment(SEXP elt)
31453145
{
31463146
SEXP a = getAttrib(elt, R_RdTagSymbol);
31473147
return isString(a) && LENGTH(a) == 1 &&
@@ -3552,9 +3552,9 @@ static void InitSymbols(void)
35523552
R_MacroSymbol = install("macro");
35533553
}
35543554

3555-
static SEXP ParseRd(ParseStatus *status, SEXP srcfile, Rboolean fragment, SEXP macros)
3555+
static SEXP ParseRd(ParseStatus *status, SEXP srcfile, bool fragment, SEXP macros)
35563556
{
3557-
Rboolean keepmacros = !isLogical(macros) || asLogical(macros);
3557+
bool keepmacros = !isLogical(macros) || asLogical(macros);
35583558

35593559
InitSymbols();
35603560
R_ParseContextLast = 0;
@@ -3621,7 +3621,7 @@ static int con_getc(void)
36213621
}
36223622

36233623
static
3624-
SEXP R_ParseRd(Rconnection con, ParseStatus *status, SEXP srcfile, Rboolean fragment, SEXP macros)
3624+
SEXP R_ParseRd(Rconnection con, ParseStatus *status, SEXP srcfile, bool fragment, SEXP macros)
36253625
{
36263626
con_parse = con;
36273627
ptr_getc = con_getc;
@@ -4471,7 +4471,7 @@ static void PushState(void) {
44714471
parseState.prevState = prev;
44724472
} else
44734473
parseState.prevState = NULL;
4474-
busy = TRUE;
4474+
busy = true;
44754475
}
44764476

44774477
static void PopState(void) {
@@ -4480,7 +4480,7 @@ static void PopState(void) {
44804480
UseState(prev);
44814481
free(prev);
44824482
} else
4483-
busy = FALSE;
4483+
busy = false;
44844484
}
44854485

44864486
/* "do_parseRd"
@@ -4495,7 +4495,7 @@ SEXP parseRd(SEXP call, SEXP op, SEXP args, SEXP env)
44954495

44964496
SEXP s = R_NilValue, source;
44974497
Rconnection con;
4498-
Rboolean wasopen, fragment;
4498+
bool wasopen, fragment;
44994499
int ifile, wcall;
45004500
ParseStatus status;
45014501
RCNTXT cntxt;
@@ -4521,13 +4521,13 @@ SEXP parseRd(SEXP call, SEXP op, SEXP args, SEXP env)
45214521
error(_("invalid '%s' value"), "verbose");
45224522
parseState.xxDebugTokens = asInteger(CAR(args)); args = CDR(args);
45234523
parseState.xxBasename = CHAR(STRING_ELT(CAR(args), 0)); args = CDR(args);
4524-
fragment = asRboolean(CAR(args)); args = CDR(args);
4524+
fragment = asBool(CAR(args)); args = CDR(args);
45254525
wcall = asLogical(CAR(args)); args = CDR(args);
45264526
if (wcall == NA_LOGICAL)
45274527
error(_("invalid '%s' value"), "warningCalls");
4528-
wCalls = (Rboolean) wcall;
4528+
wCalls = (bool) wcall;
45294529
macros = CAR(args); args = CDR(args);
4530-
warnDups = asRboolean(CAR(args));
4530+
warnDups = asBool(CAR(args));
45314531

45324532
if (ifile >= 3) {/* file != "" */
45334533
if(!wasopen) {
@@ -4559,10 +4559,11 @@ SEXP parseRd(SEXP call, SEXP op, SEXP args, SEXP env)
45594559
SEXP deparseRd(SEXP e, SEXP state)
45604560
{
45614561
SEXP result;
4562-
int outlen, *statevals, quoteBraces, inRComment;
4562+
int outlen, *statevals, quoteBraces;
4563+
bool inRComment;
45634564
const char *c;
45644565
char *outbuf, *out, lookahead;
4565-
Rboolean escape;
4566+
bool escape;
45664567

45674568
if(!isString(e) || LENGTH(e) != 1)
45684569
error(_("'deparseRd' only supports deparsing character elements"));
@@ -4590,29 +4591,29 @@ SEXP deparseRd(SEXP e, SEXP state)
45904591
if (*c == '{' || *c == '}' || *c == '%' || *c == '\\') outlen++;
45914592
}
45924593
out = outbuf = R_chk_calloc(outlen+1, sizeof(char));
4593-
inRComment = FALSE;
4594+
inRComment = false;
45944595
for (c = CHAR(e); *c; c++) {
4595-
escape = FALSE;
4596+
escape = false;
45964597
if (parseState.xxmode != UNKNOWNMODE) {
45974598
switch (*c) {
45984599
case '\\':
45994600
if (parseState.xxmode == RLIKE && parseState.xxinRString) {
46004601
lookahead = *(c+1);
46014602
if (lookahead == '\\' || lookahead == parseState.xxinRString || lookahead == 'l')
4602-
escape = TRUE;
4603+
escape = true;
46034604
break;
46044605
} /* fall through to % case for non-strings... */
46054606
case '%':
46064607
if (parseState.xxmode != COMMENTMODE && !parseState.xxinEqn)
4607-
escape = TRUE;
4608+
escape = true;
46084609
break;
46094610
case LBRACE:
46104611
case RBRACE:
46114612
if (quoteBraces || parseState.xxmode == LATEXLIKE)
4612-
escape = TRUE;
4613+
escape = true;
46134614
else if (!parseState.xxinRString && !parseState.xxinEqn && (parseState.xxmode == RLIKE || parseState.xxmode == VERBATIM)) {
46144615
if (*c == LBRACE) parseState.xxbraceDepth++;
4615-
else if (parseState.xxbraceDepth <= 0) escape = TRUE;
4616+
else if (parseState.xxbraceDepth <= 0) escape = true;
46164617
else parseState.xxbraceDepth--;
46174618
}
46184619
break;
@@ -4627,10 +4628,10 @@ SEXP deparseRd(SEXP e, SEXP state)
46274628
break;
46284629
case '#':
46294630
if (parseState.xxmode == RLIKE && !parseState.xxinRString)
4630-
inRComment = TRUE;
4631+
inRComment = true;
46314632
break;
46324633
case '\n':
4633-
inRComment = FALSE;
4634+
inRComment = false;
46344635
break;
46354636
}
46364637
}

0 commit comments

Comments
 (0)