A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/wch/r-source/commit/85ee9ad34cff164ce3e7038f51ce0eee5db90469 below:

Add VECTOR_PTR_RO for consistency with STRING_PTR_RO. · wch/r-source@85ee9ad · GitHub

File tree Expand file treeCollapse file tree 3 files changed

+10

-0

lines changed

Filter options

Expand file treeCollapse file tree 3 files changed

+10

-0

lines changed Original file line number Diff line number Diff line change

@@ -425,6 +425,7 @@ typedef union { VECTOR_SEXPREC s; double align; } SEXPREC_ALIGN;

425 425

#define COMPLEX_RO(x) ((const Rcomplex *) DATAPTR_RO(x))

426 426

#define REAL_RO(x) ((const double *) DATAPTR_RO(x))

427 427

#define STRING_PTR_RO(x)((const SEXP *) DATAPTR_RO(x))

428 +

#define VECTOR_PTR_RO(x)((const SEXP *) DATAPTR_RO(x))

428 429 429 430

/* List Access Macros */

430 431

/* These also work for ... objects */

Original file line number Diff line number Diff line change

@@ -292,6 +292,7 @@ void SET_STRING_ELT(SEXP x, R_xlen_t i, SEXP v);

292 292

SEXP SET_VECTOR_ELT(SEXP x, R_xlen_t i, SEXP v);

293 293

SEXP *(STRING_PTR)(SEXP x);

294 294

const SEXP *(STRING_PTR_RO)(SEXP x);

295 +

const SEXP *(VECTOR_PTR_RO)(SEXP x);

295 296

NORET SEXP * (VECTOR_PTR)(SEXP x);

296 297 297 298

R_xlen_t INTEGER_GET_REGION(SEXP sx, R_xlen_t i, R_xlen_t n, int *buf);

Original file line number Diff line number Diff line change

@@ -4216,6 +4216,14 @@ NORET SEXP * (VECTOR_PTR)(SEXP x)

4216 4216

error(_("not safe to return vector pointer"));

4217 4217

}

4218 4218 4219 +

const SEXP *(VECTOR_PTR_RO)(SEXP x) {

4220 +

if(TYPEOF(x) != VECSXP)

4221 +

error("%s() can only be applied to a '%s', not a '%s'",

4222 +

"STRING_PTR_RO", "list", R_typeToChar(x));

4223 +

CHKZLN(x);

4224 +

return VECTOR_PTR_RO(x);

4225 +

}

4226 + 4219 4227

void (SET_STRING_ELT)(SEXP x, R_xlen_t i, SEXP v) {

4220 4228

if(TYPEOF(CHK(x)) != STRSXP)

4221 4229

error("%s() can only be applied to a '%s', not a '%s'",

You can’t perform that action at this time.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4