Skip to content

Commit 42ad3d5

Browse files
author
ripley
committed
more consistent use of Rboolean
git-svn-id: https://svn.r-project.org/R/trunk@87837 00db46b3-68df-0310-9c12-caf00c1e9a41
1 parent 5846955 commit 42ad3d5

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

src/main/eval.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1425,7 +1425,7 @@ static void loadCompilerNamespace(void)
14251425

14261426
static void checkCompilerOptions(int jitEnabled)
14271427
{
1428-
int old_visible = R_Visible;
1428+
Rboolean old_visible = R_Visible;
14291429
SEXP packsym, funsym, call, fcall, arg;
14301430

14311431
packsym = install("compiler");
@@ -1825,7 +1825,7 @@ static R_INLINE Rboolean jit_srcref_match(SEXP cmpsrcref, SEXP srcref)
18251825

18261826
attribute_hidden SEXP R_cmpfun1(SEXP fun)
18271827
{
1828-
int old_visible = R_Visible;
1828+
Rboolean old_visible = R_Visible;
18291829
SEXP packsym, funsym, call, fcall, val;
18301830

18311831
packsym = install("compiler");
@@ -1911,7 +1911,7 @@ static void R_cmpfun(SEXP fun)
19111911

19121912
static SEXP R_compileExpr(SEXP expr, SEXP rho)
19131913
{
1914-
int old_visible = R_Visible;
1914+
Rboolean old_visible = R_Visible;
19151915
SEXP packsym, funsym, quotesym;
19161916
SEXP qexpr, call, fcall, val;
19171917

@@ -2677,7 +2677,7 @@ static R_INLINE Rboolean asLogicalNoNA(SEXP s, SEXP call)
26772677
_("argument is of length zero");
26782678
errorcall(call, "%s", msg);
26792679
}
2680-
return cond;
2680+
return (Rboolean) cond;
26812681
}
26822682

26832683

@@ -4332,7 +4332,7 @@ static Rboolean R_chooseOpsMethod(SEXP x, SEXP y, SEXP mx, SEXP my,
43324332
#endif
43334333
UNPROTECT(1); /* newrho */
43344334

4335-
return ans == R_NilValue ? FALSE : asLogical(ans);
4335+
return ans == R_NilValue ? FALSE : asRbool(ans, call);
43364336
}
43374337

43384338
attribute_hidden
@@ -6904,7 +6904,7 @@ static R_INLINE Rboolean GETSTACK_LOGICAL_NO_NA_PTR(R_bcstack_t *s, int callidx,
69046904
SEXP rho)
69056905
{
69066906
if (s->tag == LGLSXP && s->u.ival != NA_LOGICAL)
6907-
return s->u.ival;
6907+
return (Rboolean) s->u.ival;
69086908

69096909
SEXP value = GETSTACK_PTR(s);
69106910
if (IS_SCALAR(value, LGLSXP)) {
@@ -6924,7 +6924,7 @@ static R_INLINE int GETSTACK_LOGICAL_PTR(R_bcstack_t *s)
69246924
{
69256925
if (s->tag == LGLSXP) return s->u.ival;
69266926
SEXP value = GETSTACK_PTR(s);
6927-
return SCALAR_LVAL(value); //what about NA_LOGICAL?
6927+
return SCALAR_LVAL(value);
69286928
}
69296929

69306930
/* Find locations table in the constant pool */

src/main/util.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) 1997--2024 The R Core Team
3+
* Copyright (C) 1997--2025 The R Core Team
44
* Copyright (C) 1995, 1996 Robert Gentleman and Ross Ihaka
55
*
66
* This program is free software; you can redistribute it and/or modify
@@ -2841,10 +2841,10 @@ attribute_hidden SEXP do_findinterval(SEXP call, SEXP op, SEXP args, SEXP rho)
28412841
Rboolean sr = asRbool(right, call),
28422842
si = asRbool(inside, call),
28432843
lO = asRbool(leftOp, call);
2844-
if (sr == NA_INTEGER)
2844+
/* if (sr == NA_INTEGER)
28452845
error(_("invalid '%s' argument"), "rightmost.closed");
28462846
if (si == NA_INTEGER)
2847-
error(_("invalid '%s' argument"), "all.inside");
2847+
error(_("invalid '%s' argument"), "all.inside"); */
28482848
SEXP ans = allocVector(INTSXP, nx);
28492849
double *rxt = REAL(xt), *rx = REAL(x);
28502850
int ii = 1, mfl;

0 commit comments

Comments
 (0)