Skip to content

Commit dccd4f6

Browse files
committed
Do some obvious cleanup
1 parent 6548717 commit dccd4f6

File tree

6 files changed

+24
-30
lines changed

6 files changed

+24
-30
lines changed

inst/include/cpp11/doubles.hpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,8 @@ inline typename r_vector<double>::underlying_type* r_vector<double>::get_p(bool
4444
}
4545

4646
template <>
47-
inline void r_vector<double>::get_region(
48-
SEXP x, R_xlen_t i, R_xlen_t n,
49-
typename traits::get_underlying_type<double>::type* buf) {
47+
inline void r_vector<double>::get_region(SEXP x, R_xlen_t i, R_xlen_t n,
48+
typename r_vector::underlying_type* buf) {
5049
// NOPROTECT: likely too costly to unwind protect here
5150
REAL_GET_REGION(x, i, n, buf);
5251
};
@@ -66,8 +65,8 @@ inline SEXPTYPE r_vector<double>::get_sexptype() {
6665
}
6766

6867
template <>
69-
inline void r_vector<double>::set_elt(
70-
SEXP x, R_xlen_t i, typename traits::get_underlying_type<double>::type value) {
68+
inline void r_vector<double>::set_elt(SEXP x, R_xlen_t i,
69+
typename r_vector::underlying_type value) {
7170
SET_REAL_ELT(x, i, value);
7271
}
7372

inst/include/cpp11/integers.hpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,8 @@ inline typename r_vector<int>::underlying_type* r_vector<int>::get_p(bool is_alt
4545
}
4646

4747
template <>
48-
inline void r_vector<int>::get_region(
49-
SEXP x, R_xlen_t i, R_xlen_t n,
50-
typename traits::get_underlying_type<int>::type* buf) {
48+
inline void r_vector<int>::get_region(SEXP x, R_xlen_t i, R_xlen_t n,
49+
typename r_vector::underlying_type* buf) {
5150
// NOPROTECT: likely too costly to unwind protect here
5251
INTEGER_GET_REGION(x, i, n, buf);
5352
};
@@ -67,8 +66,8 @@ inline SEXPTYPE r_vector<int>::get_sexptype() {
6766
}
6867

6968
template <>
70-
inline void r_vector<int>::set_elt(
71-
SEXP x, R_xlen_t i, typename traits::get_underlying_type<int>::type value) {
69+
inline void r_vector<int>::set_elt(SEXP x, R_xlen_t i,
70+
typename r_vector::underlying_type value) {
7271
SET_INTEGER_ELT(x, i, value);
7372
}
7473

inst/include/cpp11/list.hpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,8 @@ inline typename r_vector<SEXP>::underlying_type* r_vector<SEXP>::get_p(bool, SEX
5050
}
5151

5252
template <>
53-
inline void r_vector<SEXP>::get_region(
54-
SEXP x, R_xlen_t i, R_xlen_t n,
55-
typename traits::get_underlying_type<SEXP>::type* buf) {
53+
inline void r_vector<SEXP>::get_region(SEXP x, R_xlen_t i, R_xlen_t n,
54+
typename r_vector::underlying_type* buf) {
5655
cpp11::stop("Unreachable!");
5756
};
5857

@@ -76,8 +75,8 @@ inline SEXPTYPE r_vector<SEXP>::get_sexptype() {
7675
}
7776

7877
template <>
79-
inline void r_vector<SEXP>::set_elt(
80-
SEXP x, R_xlen_t i, typename traits::get_underlying_type<SEXP>::type value) {
78+
inline void r_vector<SEXP>::set_elt(SEXP x, R_xlen_t i,
79+
typename r_vector::underlying_type value) {
8180
SET_VECTOR_ELT(x, i, value);
8281
}
8382

inst/include/cpp11/logicals.hpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,8 @@ inline typename r_vector<r_bool>::underlying_type* r_vector<r_bool>::get_p(bool
4343
}
4444

4545
template <>
46-
inline void r_vector<r_bool>::get_region(
47-
SEXP x, R_xlen_t i, R_xlen_t n,
48-
typename traits::get_underlying_type<r_bool>::type* buf) {
46+
inline void r_vector<r_bool>::get_region(SEXP x, R_xlen_t i, R_xlen_t n,
47+
typename r_vector::underlying_type* buf) {
4948
// NOPROTECT: likely too costly to unwind protect here
5049
LOGICAL_GET_REGION(x, i, n, buf);
5150
};
@@ -65,8 +64,8 @@ inline SEXPTYPE r_vector<r_bool>::get_sexptype() {
6564
}
6665

6766
template <>
68-
inline void r_vector<r_bool>::set_elt(
69-
SEXP x, R_xlen_t i, typename traits::get_underlying_type<r_bool>::type value) {
67+
inline void r_vector<r_bool>::set_elt(SEXP x, R_xlen_t i,
68+
typename r_vector::underlying_type value) {
7069
SET_LOGICAL_ELT(x, i, value);
7170
}
7271

inst/include/cpp11/raws.hpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,8 @@ inline typename r_vector<uint8_t>::underlying_type* r_vector<uint8_t>::get_p(
5252
}
5353

5454
template <>
55-
inline void r_vector<uint8_t>::get_region(
56-
SEXP x, R_xlen_t i, R_xlen_t n,
57-
typename traits::get_underlying_type<uint8_t>::type* buf) {
55+
inline void r_vector<uint8_t>::get_region(SEXP x, R_xlen_t i, R_xlen_t n,
56+
typename r_vector::underlying_type* buf) {
5857
// NOPROTECT: likely too costly to unwind protect here
5958
RAW_GET_REGION(x, i, n, buf);
6059
};
@@ -74,8 +73,8 @@ inline SEXPTYPE r_vector<uint8_t>::get_sexptype() {
7473
}
7574

7675
template <>
77-
inline void r_vector<uint8_t>::set_elt(
78-
SEXP x, R_xlen_t i, typename traits::get_underlying_type<uint8_t>::type value) {
76+
inline void r_vector<uint8_t>::set_elt(SEXP x, R_xlen_t i,
77+
typename r_vector::underlying_type value) {
7978
#if R_VERSION >= R_Version(4, 2, 0)
8079
SET_RAW_ELT(x, i, value);
8180
#else

inst/include/cpp11/strings.hpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,8 @@ inline typename r_vector<r_string>::underlying_type* r_vector<r_string>::get_p(b
4040
}
4141

4242
template <>
43-
inline void r_vector<r_string>::get_region(
44-
SEXP x, R_xlen_t i, R_xlen_t n,
45-
typename traits::get_underlying_type<r_string>::type* buf) {
43+
inline void r_vector<r_string>::get_region(SEXP x, R_xlen_t i, R_xlen_t n,
44+
typename r_vector::underlying_type* buf) {
4645
cpp11::stop("Unreachable!");
4746
};
4847

@@ -66,8 +65,8 @@ inline SEXPTYPE r_vector<r_string>::get_sexptype() {
6665
}
6766

6867
template <>
69-
inline void r_vector<r_string>::set_elt(
70-
SEXP x, R_xlen_t i, typename traits::get_underlying_type<r_string>::type value) {
68+
inline void r_vector<r_string>::set_elt(SEXP x, R_xlen_t i,
69+
typename r_vector::underlying_type value) {
7170
SET_STRING_ELT(x, i, value);
7271
}
7372

0 commit comments

Comments
 (0)