Skip to content

Commit

Permalink
Merge branch 'master' into bugfix/user-defined-database-drop-support
Browse files Browse the repository at this point in the history
  • Loading branch information
eddelbuettel authored Jul 22, 2024
2 parents ccfdc2e + 19328ad commit f084a6a
Show file tree
Hide file tree
Showing 23 changed files with 87 additions and 20 deletions.
21 changes: 20 additions & 1 deletion ChangeLog
Original file line number Diff line number Diff line change
@@ -1,6 +1,25 @@
2024-07-11 Dirk Eddelbuettel <edd@debian.org>

* DESCRIPTION (Date, Version): Release 1.0.13

* inst/include/Rcpp/config.h: Idem
* inst/NEWS.Rd: Idem
* vignettes/rmd/Rcpp.bib: Idem
* inst/bib/Rcpp.bib: Idem
* vignettes/pdf/*: Rebuilt

2024-07-07 Kevin Ushey <kevinushey@gmail.com>

* inst/include/Rcpp/internal/SEXP_Iterator.h: Avoid using VECTOR_PTR
* inst/include/Rcpp/vector/Subsetter.h: Avoid using STRING_PTR
* inst/include/RcppCommon.h: Include compatibility defines
* src/barrier.cpp: Avoid using {STRING/VECTOR}_PTR
* inst/include/Rcpp/r/compat.h: Include compatibility defines

2024-07-05 Kevin Ushey <kevinushey@gmail.com>

* inst/include/Rcpp/Environment.h: Drop support for UserDefinedDatabase.
* inst/include/Rcpp/Environment.h: Drop support for UserDefinedDatabase
[ merged 2024-07-22 after release of Rcpp 1.0.13 ]

2024-06-22 Dirk Eddelbuettel <edd@debian.org>

Expand Down
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: Rcpp
Title: Seamless R and C++ Integration
Version: 1.0.12.4
Date: 2024-06-22
Version: 1.0.13
Date: 2024-07-11
Author: Dirk Eddelbuettel, Romain Francois, JJ Allaire, Kevin Ushey, Qiang Kou,
Nathan Russell, Inaki Ucar, Douglas Bates and John Chambers
Maintainer: Dirk Eddelbuettel <edd@debian.org>
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
[![Dependencies](https://tinyverse.netlify.app/badge/Rcpp)](https://cran.r-project.org/package=Rcpp)
[![Coverage Status](https://codecov.io/gh/RcppCore/Rcpp/graph/badge.svg)](https://app.codecov.io/github/RcppCore/Rcpp?branch=master)
[![Debian package](https://img.shields.io/debian/v/r-cran-rcpp/sid?color=brightgreen)](https://packages.debian.org/sid/r-cran-rcpp)
[![r-universe](https://rcppcore.r-universe.dev/badges/Rcpp)](https://rcppcore.r-universe.dev/rcpp)
[![r-universe](https://rcppcore.r-universe.dev/badges/Rcpp)](https://rcppcore.r-universe.dev/Rcpp)
[![Last Commit](https://img.shields.io/github/last-commit/RcppCore/Rcpp)](https://github.com/RcppCore/Rcpp)
[![Downloads (monthly)](https://cranlogs.r-pkg.org/badges/Rcpp?color=brightgreen)](https://www.r-pkg.org/pkg/Rcpp)
[![Downloads (total)](https://cranlogs.r-pkg.org/badges/grand-total/Rcpp?color=brightgreen)](https://www.r-pkg.org/pkg/Rcpp)
Expand Down
4 changes: 3 additions & 1 deletion inst/NEWS.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
\newcommand{\ghpr}{\href{https://github.com/RcppCore/Rcpp/pull/#1}{##1}}
\newcommand{\ghit}{\href{https://github.com/RcppCore/Rcpp/issues/#1}{##1}}

\section{Changes in Rcpp release version 1.0.13 (2024-xx-yy)}{
\section{Changes in Rcpp release version 1.0.13 (2024-07-11)}{
\itemize{
\item Changes in Rcpp API:
\itemize{
Expand All @@ -17,6 +17,8 @@
\ghpr{1310})
\item Rcpp now emits an R warning on out-of-bounds Vector accesses. This
may become an error in a future Rcpp release. (Kevin in \ghpr{1310})
\item Switch \code{VECTOR_PTR} and \code{STRING_PTR} to new API-compliant
\code{RO} variants (Kevin in \ghpr{1317} fixing \ghit{1316})
}
\item Changes in Rcpp Deployment:
\itemize{
Expand Down
2 changes: 1 addition & 1 deletion inst/bib/Rcpp.bib
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ @Manual{CRAN:Rcpp
Allaire and Kevin Ushey and Qiang Kou and
Nathan Russel and John Chambers and Douglas Bates},
year = 2024,
note = {R package version 1.0.12},
note = {R package version 1.0.13},
url = CRAN # "package=Rcpp"
}

Expand Down
8 changes: 4 additions & 4 deletions inst/include/Rcpp/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@
#define RcppDevVersion(maj, min, rev, dev) (((maj)*1000000) + ((min)*10000) + ((rev)*100) + (dev))

// the currently released version
#define RCPP_VERSION Rcpp_Version(1,0,12)
#define RCPP_VERSION_STRING "1.0.12"
#define RCPP_VERSION Rcpp_Version(1,0,13)
#define RCPP_VERSION_STRING "1.0.13"

// the current source snapshot (using four components, if a fifth is used in DESCRIPTION we ignore it)
#define RCPP_DEV_VERSION RcppDevVersion(1,0,12,4)
#define RCPP_DEV_VERSION_STRING "1.0.12.4"
#define RCPP_DEV_VERSION RcppDevVersion(1,0,13,0)
#define RCPP_DEV_VERSION_STRING "1.0.13.0"

#endif
2 changes: 1 addition & 1 deletion inst/include/Rcpp/internal/SEXP_Iterator.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class SEXP_Iterator {

SEXP_Iterator( ): ptr(){} ;
SEXP_Iterator( const SEXP_Iterator& other) : ptr(other.ptr){} ;
SEXP_Iterator( const VECTOR& vec ) : ptr( get_vector_ptr(vec) ){} ;
SEXP_Iterator( const VECTOR& vec ) : ptr( RCPP_VECTOR_PTR(vec) ){} ;

SEXP_Iterator& operator=(const SEXP_Iterator& other){ ptr = other.ptr ; return *this ;}

Expand Down
39 changes: 39 additions & 0 deletions inst/include/Rcpp/r/compat.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@

//
// compat.h: Rcpp R/C++ interface class library -- compatibility defines
//
// Copyright (C) 2024 Dirk Eddelbuettel, Kevin Ushey
//
// This file is part of Rcpp.
//
// Rcpp is free software: you can redistribute it and/or modify it
// under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 2 of the License, or
// (at your option) any later version.
//
// Rcpp is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Rcpp. If not, see <http://www.gnu.org/licenses/>.

#ifndef RCPP_R_COMPAT_H
#define RCPP_R_COMPAT_H

#include <Rversion.h>

#if R_VERSION >= R_Version(4, 4, 2)
# define RCPP_STRING_PTR STRING_PTR_RO
#else
# define RCPP_STRING_PTR STRING_PTR
#endif

#if R_VERSION >= R_Version(4, 4, 2)
# define RCPP_VECTOR_PTR VECTOR_PTR_RO
#else
# define RCPP_VECTOR_PTR VECTOR_PTR
#endif

#endif /* RCPP_R_COMPAT_H */
6 changes: 3 additions & 3 deletions inst/include/Rcpp/vector/Subsetter.h
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,10 @@ class SubsetProxy {
indices.reserve(rhs_n);
SEXP names = Rf_getAttrib(lhs, R_NamesSymbol);
if (Rf_isNull(names)) stop("names is null");
SEXP* namesPtr = STRING_PTR(names);
SEXP* rhsPtr = STRING_PTR(rhs);
const SEXP* namesPtr = RCPP_STRING_PTR(names);
const SEXP* rhsPtr = RCPP_STRING_PTR(rhs);
for (R_xlen_t i = 0; i < rhs_n; ++i) {
SEXP* match = std::find(namesPtr, namesPtr + lhs_n, *(rhsPtr + i));
const SEXP* match = std::find(namesPtr, namesPtr + lhs_n, *(rhsPtr + i));
if (match == namesPtr + lhs_n)
stop("not found");
indices.push_back(match - namesPtr);
Expand Down
1 change: 1 addition & 0 deletions inst/include/RcppCommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
// #define RCPP_DEBUG_MODULE_LEVEL 1

#include <Rcpp/r/headers.h>
#include <Rcpp/r/compat.h>

/**
* \brief Rcpp API
Expand Down
2 changes: 1 addition & 1 deletion src/api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ namespace Rcpp {
case BCODESXP: return "BCODESXP";
case EXTPTRSXP: return "EXTPTRSXP";
case WEAKREFSXP: return "WEAKREFSXP";
#if R_Version >= R_Version(4,4,0) // replaces S4SXP in R 4.4.0
#if R_VERSION >= R_Version(4,4,0) // replaces S4SXP in R 4.4.0
case OBJSXP: return Rf_isS4(x) ? "S4SXP" : "OBJSXP"; // cf src/main/inspect.c
#else
case S4SXP: return "S4SXP";
Expand Down
14 changes: 10 additions & 4 deletions src/barrier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,15 @@
#define COMPILING_RCPP

#define USE_RINTERNALS

#include <algorithm>
#include <Rinternals.h>

#include <Rcpp/barrier.h>
#include "internal.h"
#include <algorithm>
#include <Rcpp/protection/Shield.h>
#include <Rcpp/r/compat.h>

#include "internal.h"

// [[Rcpp::register]]
SEXP get_string_elt(SEXP x, R_xlen_t i) { // #nocov start
Expand All @@ -50,7 +54,8 @@ void char_set_string_elt(SEXP x, R_xlen_t i, const char* value) {

// [[Rcpp::register]]
SEXP* get_string_ptr(SEXP x) {
return STRING_PTR(x);
// TODO: should we deprecate this?
return const_cast<SEXP*>(RCPP_STRING_PTR(x));
}

// [[Rcpp::register]]
Expand All @@ -65,7 +70,8 @@ void set_vector_elt(SEXP x, R_xlen_t i, SEXP value) {

// [[Rcpp::register]]
SEXP* get_vector_ptr(SEXP x) {
return VECTOR_PTR(x); // #nocov end
// TODO: should we deprecate this?
return const_cast<SEXP*>(RCPP_VECTOR_PTR(x)); // #nocov end
}

// [[Rcpp::register]]
Expand Down
Binary file added vignettes/Rcpp-FAQ.pdf
Binary file not shown.
Binary file added vignettes/Rcpp-attributes.pdf
Binary file not shown.
Binary file added vignettes/Rcpp-extending.pdf
Binary file not shown.
Binary file added vignettes/Rcpp-introduction.pdf
Binary file not shown.
Binary file added vignettes/Rcpp-jss-2011.pdf
Binary file not shown.
Binary file added vignettes/Rcpp-libraries.pdf
Binary file not shown.
Binary file added vignettes/Rcpp-modules.pdf
Binary file not shown.
Binary file added vignettes/Rcpp-package.pdf
Binary file not shown.
Binary file added vignettes/Rcpp-quickref.pdf
Binary file not shown.
Binary file added vignettes/Rcpp-sugar.pdf
Binary file not shown.
2 changes: 1 addition & 1 deletion vignettes/rmd/Rcpp.bib
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ @Manual{CRAN:Rcpp
Allaire and Kevin Ushey and Qiang Kou and
Nathan Russel and John Chambers and Douglas Bates},
year = 2024,
note = {R package version 1.0.12},
note = {R package version 1.0.13},
url = CRAN # "package=Rcpp"
}

Expand Down

0 comments on commit f084a6a

Please sign in to comment.