Skip to content

Commit 05b4729

Browse files
committed
Just don't use function from cpp11
After the 0.4.5 release, the old spelling appears available but does not appear in the source code so far as I can see. This just avoids it.
1 parent 9ce4054 commit 05b4729

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

DESCRIPTION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ Language: en-GB
2626
Requires: R (>= 4.0.0)
2727
Imports:
2828
R6,
29-
cpp11 (>= 0.4.5),
29+
cpp11 (>= 0.4.0),
3030
glue,
3131
pkgbuild (>= 1.2.0),
3232
pkgload,
3333
withr
3434
LinkingTo:
35-
cpp11 (>= 0.4.5)
35+
cpp11 (>= 0.4.0)
3636
Suggests:
3737
bench,
3838
brio,

inst/include/dust/r/helpers.hpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@
1616
namespace dust {
1717
namespace r {
1818

19+
inline bool is_integer_like(double x) {
20+
double int_part;
21+
return std::modf(x, &int_part) == 0.0;
22+
}
23+
1924
inline
2025
cpp11::integers as_integer(cpp11::sexp x, const char * name) {
2126
if (TYPEOF(x) == INTSXP) {
@@ -26,7 +31,7 @@ cpp11::integers as_integer(cpp11::sexp x, const char * name) {
2631
cpp11::writable::integers ret = cpp11::writable::integers(len);
2732
for (size_t i = 0; i < len; ++i) {
2833
double el = xn[i];
29-
if (!cpp11::is_convertable_without_loss_to_integer(el)) {
34+
if (!is_integer_like(el)) {
3035
cpp11::stop("All elements of '%s' must be integer-like",
3136
name, i + 1);
3237
}

inst/include/dust/random/version.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
#define DUST_VERSION_MAJOR 0
66
#define DUST_VERSION_MINOR 14
7-
#define DUST_VERSION_PATCH 9
8-
#define DUST_VERSION_STRING "0.14.9"
9-
#define DUST_VERSION_CODE 1409
7+
#define DUST_VERSION_PATCH 10
8+
#define DUST_VERSION_STRING "0.14.10"
9+
#define DUST_VERSION_CODE 1410
1010

1111
#endif

0 commit comments

Comments
 (0)