Permalink
Browse files

Made R_ext/Altrep.h more C++ friendly. Suggested by Michael Sannella.

git-svn-id: https://svn.r-project.org/R/trunk@75414 00db46b3-68df-0310-9c12-caf00c1e9a41
  • Loading branch information...
luke
luke committed Oct 9, 2018
1 parent ff36007 commit 14365e4419d08ced8e987d5d49b26843d1324297
Showing with 11 additions and 3 deletions.
  1. +9 −1 src/include/R_ext/Altrep.h
  2. +2 −2 src/main/altrep.c
@@ -20,6 +20,10 @@
#ifndef R_EXT_ALTREP_H_
#define R_EXT_ALTREP_H_
#ifdef __cplusplus
extern "C" {
#endif
#define STRUCT_SUBTYPES
#ifdef STRUCT_SUBTYPES
# define R_SEXP(x) (x).ptr
@@ -32,7 +36,7 @@
#endif
SEXP
R_new_altrep(R_altrep_class_t class, SEXP data1, SEXP data2);
R_new_altrep(R_altrep_class_t aclass, SEXP data1, SEXP data2);
R_altrep_class_t
R_make_altstring_class(const char *cname, const char *pname, DllInfo *info);
@@ -118,4 +122,8 @@ DECLARE_METHOD_SETTER(altstring, Set_elt)
DECLARE_METHOD_SETTER(altstring, Is_sorted)
DECLARE_METHOD_SETTER(altstring, No_NA)
#ifdef __cplusplus
}
#endif
#endif /* R_EXT_ALTREP_H_ */
@@ -824,9 +824,9 @@ DEFINE_METHOD_SETTER(altstring, No_NA)
** ALTREP Object Constructor and Utility Functions
**/
SEXP R_new_altrep(R_altrep_class_t class, SEXP data1, SEXP data2)
SEXP R_new_altrep(R_altrep_class_t aclass, SEXP data1, SEXP data2)
{
SEXP sclass = R_SEXP(class);
SEXP sclass = R_SEXP(aclass);
int type = ALTREP_CLASS_BASE_TYPE(sclass);
SEXP ans = CONS(data1, data2);
SET_TYPEOF(ans, type);

0 comments on commit 14365e4

Please sign in to comment.