Skip to content

Commit 3886231

Browse files
author
murrell
committed
stop confusing Rboolean with logical
git-svn-id: https://svn.r-project.org/R/trunk@87827 00db46b3-68df-0310-9c12-caf00c1e9a41
1 parent 5997c10 commit 3886231

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/library/grid/R/coords.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -613,8 +613,8 @@ grobPoints.text <- function(x, closed=TRUE, ...) {
613613

614614
grobPoints.points <- function(x, closed=TRUE, ...) {
615615
closed <- as.logical(closed)
616-
if (is.na(closed))
617-
stop("Closed must not be a missing value")
616+
if (length(closed) != 1 || is.na(closed))
617+
stop("Closed must be length 1 and must not be a missing value")
618618
pts <- grid.Call(C_pointsPoints, x$x, x$y, x$pch, x$size, closed)
619619
if (is.null(pts) ||
620620
all(sapply(pts, is.null))) {

src/library/grid/src/grid.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5119,12 +5119,13 @@ static SEXP gridPoints(SEXP x, SEXP y, SEXP pch, SEXP size,
51195119

51205120
SEXP L_points(SEXP x, SEXP y, SEXP pch, SEXP size)
51215121
{
5122-
return gridPoints(x, y, pch, size, TRUE, NA_LOGICAL);
5122+
return gridPoints(x, y, pch, size, TRUE, FALSE);
51235123
}
51245124

51255125
SEXP L_pointsPoints(SEXP x, SEXP y, SEXP pch, SEXP size, SEXP closed)
51265126
{
5127-
return gridPoints(x, y, pch, size, FALSE, LOGICAL(closed)[0]);
5127+
/* 'closed' type checked in R code */
5128+
return gridPoints(x, y, pch, size, FALSE, asRboolean(closed));
51285129
}
51295130

51305131
SEXP L_clip(SEXP x, SEXP y, SEXP w, SEXP h, SEXP hjust, SEXP vjust)

0 commit comments

Comments
 (0)