Skip to content

Commit fc31518

Browse files
authored
Fix usage of C level format token (#1897)
* Use the correct format string for `R_xlen_t` * NEWS bullet
1 parent 19f1635 commit fc31518

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

NEWS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# vctrs (development version)
22

3+
* Internal changes requested by CRAN around C level format strings (#1896).
4+
35
* Fixed tests related to changes to `dim<-()` in R-devel (#1889).
46

57
# vctrs 0.6.4

src/altrep-rle.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ Rboolean altrep_rle_Inspect(SEXP x,
5959
int deep,
6060
int pvec,
6161
void (*inspect_subtree)(SEXP, int, int, int)) {
62-
Rprintf("vctrs_altrep_rle (len=%d, materialized=%s)\n",
62+
Rprintf("vctrs_altrep_rle (len=%" R_PRIdXLEN_T ", materialized=%s)\n",
6363
altrep_rle_Length(x),
6464
R_altrep_data2(x) != R_NilValue ? "T" : "F");
6565
return TRUE;

src/vctrs-core.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,5 +108,15 @@ enum vctrs_dbl dbl_classify(double x);
108108

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

111+
// Likely supplied in R 4.4.0
112+
// https://github.com/wch/r-source/commit/38403c9c347dd5426da6009573b087188ec6be04
113+
#ifndef R_PRIdXLEN_T
114+
# ifdef LONG_VECTOR_SUPPORT
115+
# define R_PRIdXLEN_T "td"
116+
# else
117+
# define R_PRIdXLEN_T "d"
118+
# endif
119+
#endif
120+
111121

112122
#endif

0 commit comments

Comments
 (0)