Skip to content

Commit 2334645

Browse files
author
ripley
committed
tweaks for Rboolean in packages
git-svn-id: https://svn.r-project.org/R/trunk@87833 00db46b3-68df-0310-9c12-caf00c1e9a41
1 parent b44d420 commit 2334645

File tree

4 files changed

+21
-20
lines changed

4 files changed

+21
-20
lines changed

src/library/grDevices/src/devQuartz.c

Lines changed: 3 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) 2007-2022 The R Foundation
3+
* Copyright (C) 2007-2025 The R Foundation
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
@@ -2646,7 +2646,7 @@ static Rboolean RQuartz_Locator(double *x, double *y, DEVDESC)
26462646
ctx = NULL;
26472647
if (!xd->locatePoint)
26482648
return FALSE;
2649-
res = xd->locatePoint(xd, xd->userInfo, x, y);
2649+
res = (Rboolean) xd->locatePoint(xd, xd->userInfo, x, y);
26502650
*x/=xd->scalex;
26512651
*y/=xd->scaley;
26522652
return res;
@@ -3183,7 +3183,7 @@ SEXP Quartz(SEXP args)
31833183
height = ARG(asReal,args);
31843184
ps = ARG(asReal,args);
31853185
family = CHAR(STRING_ELT(CAR(args), 0)); args = CDR(args);
3186-
antialias = ARG(asLogical,args);
3186+
antialias = ARG(asRboolean,args);
31873187
title = CHAR(STRING_ELT(CAR(args), 0)); args = CDR(args);
31883188
bgs = CAR(args); args = CDR(args);
31893189
bg = RGBpar(bgs, 0);

src/library/grid/src/grid.c

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* R : A Computer Language for Statistical Data Analysis
33
* Copyright (C) 2001-3 Paul Murrell
4-
* 2003-2024 The R Core Team
4+
* 2003-2025 The R Core Team
55
*
66
* This program is free software; you can redistribute it and/or modify
77
* it under the terms of the GNU General Public License as published by
@@ -505,7 +505,7 @@ static Rboolean noChildren(SEXP children)
505505
children));
506506
PROTECT(result = eval(fcall, R_gridEvalEnv));
507507
UNPROTECT(2);
508-
return LOGICAL(result)[0];
508+
return asRboolean(result);
509509
}
510510

511511
static Rboolean childExists(SEXP name, SEXP children)
@@ -515,7 +515,7 @@ static Rboolean childExists(SEXP name, SEXP children)
515515
name, children));
516516
PROTECT(result = eval(fcall, R_gridEvalEnv));
517517
UNPROTECT(2);
518-
return LOGICAL(result)[0];
518+
return asRboolean(result);
519519
}
520520

521521
static SEXP childList(SEXP children)
@@ -714,7 +714,7 @@ static Rboolean pathMatch(SEXP path, SEXP pathsofar, SEXP strict)
714714
path, pathsofar, strict));
715715
PROTECT(result = eval(fcall, R_gridEvalEnv));
716716
UNPROTECT(2);
717-
return LOGICAL(result)[0];
717+
return asRboolean(result);
718718
}
719719

720720
static SEXP growPath(SEXP pathsofar, SEXP name)
@@ -1260,8 +1260,8 @@ SEXP L_newpage(void)
12601260
/*
12611261
* Has the device been drawn on BY GRID yet?
12621262
*/
1263-
Rboolean deviceGridDirty = LOGICAL(gridStateElement(dd,
1264-
GSS_GRIDDEVICE))[0];
1263+
Rboolean deviceGridDirty = asRboolean(gridStateElement(dd,
1264+
GSS_GRIDDEVICE));
12651265
/*
12661266
* Initialise grid on device
12671267
* If no drawing on device yet, does a new page
@@ -2468,7 +2468,8 @@ SEXP gridXspline(SEXP x, SEXP y, SEXP s, SEXP o, SEXP a, SEXP rep, SEXP index,
24682468
}
24692469
}
24702470
PROTECT(points = GEXspline(nx, xx, yy, ss,
2471-
LOGICAL(o)[0], LOGICAL(rep)[0],
2471+
(Rboolean)LOGICAL(o)[0],
2472+
(Rboolean)LOGICAL(rep)[0],
24722473
draw, &gc, dd));
24732474
{
24742475
/*
@@ -3438,7 +3439,7 @@ SEXP L_path(SEXP x, SEXP y, SEXP index, SEXP rule)
34383439
}
34393440
}
34403441
updateGContext(currentgp, h, &gc, dd, gpIsScalar, &gcCache);
3441-
GEPath(xx, yy, npoly, nper, INTEGER(rule)[0], &gc, dd);
3442+
GEPath(xx, yy, npoly, nper, asRboolean(rule), &gc, dd);
34423443
vmaxset(vmax);
34433444
}
34443445
GEMode(0, dd);
@@ -3535,7 +3536,7 @@ SEXP L_raster(SEXP raster, SEXP x, SEXP y, SEXP w, SEXP h,
35353536
R_FINITE(ww) && R_FINITE(hh))
35363537
GERaster(image, INTEGER(dim)[1], INTEGER(dim)[0],
35373538
xx, yy, ww, hh, rotationAngle,
3538-
LOGICAL(interpolate)[i % LENGTH(interpolate)],
3539+
(Rboolean) LOGICAL(interpolate)[i % LENGTH(interpolate)],
35393540
&gc, dd);
35403541
} else {
35413542
/* We have to do a little bit of work to figure out where the
@@ -3567,7 +3568,7 @@ SEXP L_raster(SEXP raster, SEXP x, SEXP y, SEXP w, SEXP h,
35673568
*/
35683569
GERaster(image, INTEGER(dim)[1], INTEGER(dim)[0],
35693570
xbl, ybl, ww, hh, rotationAngle,
3570-
LOGICAL(interpolate)[i % LENGTH(interpolate)],
3571+
(Rboolean) LOGICAL(interpolate)[i % LENGTH(interpolate)],
35713572
&gc, dd);
35723573
}
35733574
UNPROTECT(2);

src/library/stats/src/filter.c

Lines changed: 3 additions & 3 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) 1999-2022 The R Core Team
4+
* Copyright (C) 1999-2025 The R Core Team
55
*
66
* This program is free software; you can redistribute it and/or modify
77
* it under the terms of the GNU General Public License as published by
@@ -143,8 +143,8 @@ acf0(double *x, int n, int ns, int nl, Rboolean correlation, double *acf)
143143

144144
SEXP acf(SEXP x, SEXP lmax, SEXP sCor)
145145
{
146-
int nx = nrows(x), ns = ncols(x), lagmax = asInteger(lmax),
147-
cor = asLogical(sCor);
146+
int nx = nrows(x), ns = ncols(x), lagmax = asInteger(lmax);
147+
Rboolean cor = asRboolean(sCor);
148148
x = PROTECT(coerceVector(x, REALSXP));
149149
SEXP ans = PROTECT(allocVector(REALSXP, (lagmax + 1)*ns*ns));
150150
acf0(REAL(x), nx, ns, lagmax, cor, REAL(ans));

src/library/tools/src/gramRd.y

Lines changed: 4 additions & 4 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
*
88
* This program is free software; you can redistribute it and/or modify
99
* it under the terms of the GNU General Public License as published by
@@ -1983,13 +1983,13 @@ SEXP parseRd(SEXP call, SEXP op, SEXP args, SEXP env)
19831983
error(_("invalid '%s' value"), "verbose");
19841984
parseState.xxDebugTokens = asInteger(CAR(args)); args = CDR(args);
19851985
parseState.xxBasename = CHAR(STRING_ELT(CAR(args), 0)); args = CDR(args);
1986-
fragment = asLogical(CAR(args)); args = CDR(args);
1986+
fragment = asRboolean(CAR(args)); args = CDR(args);
19871987
wcall = asLogical(CAR(args)); args = CDR(args);
19881988
if (wcall == NA_LOGICAL)
19891989
error(_("invalid '%s' value"), "warningCalls");
1990-
wCalls = wcall;
1990+
wCalls = (Rboolean) wcall;
19911991
macros = CAR(args); args = CDR(args);
1992-
warnDups = asLogical(CAR(args));
1992+
warnDups = asRboolean(CAR(args));
19931993

19941994
if (ifile >= 3) {/* file != "" */
19951995
if(!wasopen) {

0 commit comments

Comments
 (0)