Skip to content

Commit

Permalink
Fix usage of C level format token (#1897)
Browse files Browse the repository at this point in the history
* Use the correct format string for `R_xlen_t`

* NEWS bullet
  • Loading branch information
DavisVaughan authored Dec 1, 2023
1 parent 19f1635 commit fc31518
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# vctrs (development version)

* Internal changes requested by CRAN around C level format strings (#1896).

* Fixed tests related to changes to `dim<-()` in R-devel (#1889).

# vctrs 0.6.4
Expand Down
2 changes: 1 addition & 1 deletion src/altrep-rle.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ Rboolean altrep_rle_Inspect(SEXP x,
int deep,
int pvec,
void (*inspect_subtree)(SEXP, int, int, int)) {
Rprintf("vctrs_altrep_rle (len=%d, materialized=%s)\n",
Rprintf("vctrs_altrep_rle (len=%" R_PRIdXLEN_T ", materialized=%s)\n",
altrep_rle_Length(x),
R_altrep_data2(x) != R_NilValue ? "T" : "F");
return TRUE;
Expand Down
10 changes: 10 additions & 0 deletions src/vctrs-core.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,5 +108,15 @@ enum vctrs_dbl dbl_classify(double x);

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

// Likely supplied in R 4.4.0
// https://github.com/wch/r-source/commit/38403c9c347dd5426da6009573b087188ec6be04
#ifndef R_PRIdXLEN_T
# ifdef LONG_VECTOR_SUPPORT
# define R_PRIdXLEN_T "td"
# else
# define R_PRIdXLEN_T "d"
# endif
#endif


#endif

0 comments on commit fc31518

Please sign in to comment.