diff --git a/.codecov.yml b/.codecov.yml index 9ec352888..e10eb4a78 100644 --- a/.codecov.yml +++ b/.codecov.yml @@ -1,4 +1,5 @@ comment: false + coverage: status: project: @@ -9,6 +10,9 @@ coverage: default: target: 0% # the (on purpose low) required coverage value +ignore: + - 'R/inline.R' # function factory setup confuses codecov + # layout: "header, diff, tree, changes" # behavior: default # require_changes: false # if true: only post the comment if coverage changes diff --git a/ChangeLog b/ChangeLog index 062dc6860..e4f6e5458 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,28 @@ +2026-01-01 Dirk Eddelbuettel + + * R/Attributes.R: Additional or adjusted #nocov tags + * R/Rcpp.package.skeleton.R: Idem + * R/RcppLdpath.R: Idem + * R/asis.R: Idem + * R/inline.R: Idem + * inst/include/Rcpp/api/meat/Rcpp_eval.h: Idem + * inst/include/Rcpp/internal/caster.h: Idem + * inst/include/Rcpp/internal/export.h: Idem + * inst/include/Rcpp/proxy/NamesProxy.h: Idem + * inst/include/Rcpp/proxy/SlotProxy.h: Idem + * inst/include/Rcpp/vector/Vector.h: Idem + * inst/include/Rcpp/vector/proxy.h: Idem + * inst/include/Rcpp/vector/traits.h: Idem + * inst/include/Rcpp/Environment.h: Idem + * inst/include/Rcpp/Function.h: Idem + * inst/include/Rcpp/Module.h: Idem + * inst/include/Rcpp/S4.h: Idem + * inst/include/Rcpp/as.h: Idem + * inst/include/Rcpp/exceptions.h: Idem + * inst/include/Rcpp/r_cast.h: Idem + * src/attributes.cpp: Idem + * src/barrier.cpp: Idem + 2025-12-30 Dirk Eddelbuettel * tests/tinytest.R: Refine decision of when not to run all tests even diff --git a/R/Attributes.R b/R/Attributes.R index 1e84ab932..f34e83b17 100644 --- a/R/Attributes.R +++ b/R/Attributes.R @@ -1,6 +1,6 @@ # Copyright (C) 2012 - 2022 JJ Allaire, Dirk Eddelbuettel and Romain Francois -# Copyright (C) 2023 - 2024 JJ Allaire, Dirk Eddelbuettel, Romain Francois and Iñaki Ucar +# Copyright (C) 2023 - 2026 JJ Allaire, Dirk Eddelbuettel, Romain Francois and Iñaki Ucar # # This file is part of Rcpp. # @@ -571,7 +571,7 @@ compileAttributes <- function(pkgdir = ".", verbose = getOption("verbose")) { } .openmpPluginDefault <- function() { - list(env = list(PKG_CXXFLAGS = "-fopenmp", PKG_LIBS = "-fopenmp")) + list(env = list(PKG_CXXFLAGS = "-fopenmp", PKG_LIBS = "-fopenmp")) # #nocov start } .openmpPluginDarwin <- function() { @@ -629,7 +629,7 @@ compileAttributes <- function(pkgdir = ".", verbose = getOption("verbose")) { libs <- "-fopenmp" } - list(env = list(PKG_CXXFLAGS = cxxflags, PKG_LIBS = libs)) + list(env = list(PKG_CXXFLAGS = cxxflags, PKG_LIBS = libs)) # #nocov end } diff --git a/R/Module.R b/R/Module.R index e0268012f..10c3cadce 100644 --- a/R/Module.R +++ b/R/Module.R @@ -1,4 +1,4 @@ -# Copyright (C) 2010 - 2021 John Chambers, Dirk Eddelbuettel and Romain Francois +# Copyright (C) 2010 - 2026 John Chambers, Dirk Eddelbuettel and Romain Francois # # This file is part of Rcpp. # diff --git a/R/Rcpp.package.skeleton.R b/R/Rcpp.package.skeleton.R index 218761d2a..d8c989b50 100644 --- a/R/Rcpp.package.skeleton.R +++ b/R/Rcpp.package.skeleton.R @@ -1,4 +1,4 @@ -# Copyright (C) 2009 - 2025 Dirk Eddelbuettel and Romain Francois +# Copyright (C) 2009 - 2026 Dirk Eddelbuettel and Romain Francois # # This file is part of Rcpp. # @@ -93,7 +93,7 @@ Rcpp.package.skeleton <- function(name = "anRpackage", list = character(), email)) fields_written <- c("Package", "Type", "Title", "Version", "Date", "Authors@R", "Description", "License", "Imports", "LinkingTo") - if (!is.na(githubuser)) { + if (!is.na(githubuser)) { # #nocov start x <- cbind(x, matrix("", 1, 1, dimnames=list("", "URL"))) x[1, "URL"] <- paste0("https://github.com/", githubuser, "/", name) x <- cbind(x, matrix("", 1, 1, dimnames=list("", "BugReports"))) @@ -102,7 +102,7 @@ Rcpp.package.skeleton <- function(name = "anRpackage", list = character(), fields_written <- c("Package", "Type", "Title", "Version", "Date", "Authors@R", "Description", "URL", "BugReports", "License", "Imports", "LinkingTo") - } + } # #nocov end x[, "License"] <- license x[, "Title"] <- "Concise Summary of What the Package Does" @@ -136,7 +136,7 @@ Rcpp.package.skeleton <- function(name = "anRpackage", list = character(), ## update the package description help page if (havePkgKitten) { # if pkgKitten is available, use it - pkgKitten::playWithPerPackageHelpPage(name, path, maintainer, email) + pkgKitten::playWithPerPackageHelpPage(name, path, maintainer, email) # #nocov } else { .playWithPerPackageHelpPage(name, path, maintainer, email) # #nocov } diff --git a/R/RcppLdpath.R b/R/RcppLdpath.R index 73fa4a9af..d8acb323e 100644 --- a/R/RcppLdpath.R +++ b/R/RcppLdpath.R @@ -1,4 +1,4 @@ -# Copyright (C) 2010 - 2021 Dirk Eddelbuettel and Romain Francois +# Copyright (C) 2010 - 2026 Dirk Eddelbuettel and Romain Francois # # This file is part of Rcpp. # @@ -25,7 +25,7 @@ Rcpp.quoteNonStandard <- function(path) { ## On unix, check if path has only characters that do not need quoting noquote <- .Platform$OS.type == "unix" && grepl("^[[:alnum:]/._~+@%-]*$", path) ## If no quoting needed return unchanged else quote input - if (noquote) path else shQuote(path) + if (noquote) path else shQuote(path) # #nocov } ## Use R's internal knowledge of path settings to find the lib/ directory @@ -66,11 +66,11 @@ RcppCxxFlags <- function(cxx0x=FALSE) { ## Shorter names, and call cat() directly ## CxxFlags defaults to no using c++0x extensions are these are considered non-portable -CxxFlags <- function(cxx0x=FALSE) { +CxxFlags <- function(cxx0x=FALSE) { # #nocov start #.Deprecated(msg=paste("This function is now deprecated as R uses minimally", # "viable compilers om all platforme.")) message("'CxxFlags' has not been needed since 2013 (!!) and may get removed in 2027. Please update your 'Makevars'.") - cat(RcppCxxFlags(cxx0x=cxx0x)) # #nocov + cat(RcppCxxFlags(cxx0x=cxx0x)) # #nocov end } ## LdFlags defaults to static linking on the non-Linux platforms Windows and OS X @@ -84,11 +84,11 @@ RcppCapabilities <- capabilities <- function() .Call( rcpp_capabilities ) # compile, load and call the cxx0x.c script to identify whether # the compiler is GCC >= 4.3 -RcppCxx0xFlags <- function() { +RcppCxx0xFlags <- function() { # #nocov start #.Deprecated(msg=paste("This function is now deprecated as R uses minimally", # "viable compilers om all platforme.")) message("'RcppCxx0xFlags' has not been needed since 2013 (!!) and may get removed in 2027. Please update your 'Makevars'.") - script <- Rcpp.system.file( "discovery", "cxx0x.R" ) # #nocov start + script <- Rcpp.system.file( "discovery", "cxx0x.R" ) flag <- capture.output( source( script ) ) flag } diff --git a/R/asis.R b/R/asis.R index ab58d12c8..5fede4fc5 100644 --- a/R/asis.R +++ b/R/asis.R @@ -30,7 +30,7 @@ ##' # %\VignettePackage{Rcpp} ##' # %\VignetteEncoding{UTF-8} ##' # %\VignetteEngine{Rcpp::asis} -asisWeave <- function (file, ...) { +asisWeave <- function (file, ...) { # #nocov start output <- tools::file_path_sans_ext(basename(file)) if (!file.exists(output)) { outputS <- file.path("..", "inst", "doc", output) @@ -53,4 +53,4 @@ asisTangle <- function (file, ..., pattern = "(|[.][^.]*)[.]asis$") { filenameR <- sprintf("%s.R", fullname) cat(sprintf("### This is an R script tangled from '%s'\n", filename), file = filenameR) invisible(filenameR) -} +} # #nocov end diff --git a/R/inline.R b/R/inline.R index 8243e033f..165c615ed 100644 --- a/R/inline.R +++ b/R/inline.R @@ -1,4 +1,4 @@ -# Copyright (C) 2009 - 2017 Dirk Eddelbuettel and Romain Francois +# Copyright (C) 2009 - 2026 Dirk Eddelbuettel and Romain Francois # # This file is part of Rcpp. # @@ -38,12 +38,11 @@ Rcpp.plugin.maker <- function(include.before = "", #endif using namespace Rcpp;", include.before, include.after) - out <- list(env = list( PKG_LIBS = libs ), includes = includes, LinkingTo = LinkingTo , body = function( x ) { - sprintf( "BEGIN_RCPP\n%s\nEND_RCPP", x ) + sprintf( "BEGIN_RCPP\n%s\nEND_RCPP", x ) # #nocov }, Depends = Depends, Imports = Imports) @@ -54,4 +53,3 @@ using namespace Rcpp;", include.before, include.after) } inlineCxxPlugin <- Rcpp.plugin.maker() - diff --git a/R/loadModule.R b/R/loadModule.R index 77ac55139..82d2dcda1 100644 --- a/R/loadModule.R +++ b/R/loadModule.R @@ -1,4 +1,4 @@ -# Copyright (C) 2010 - 2015 John Chambers, Dirk Eddelbuettel and Romain Francois +# Copyright (C) 2010 - 2026 John Chambers, Dirk Eddelbuettel and Romain Francois # # This file is part of Rcpp. # @@ -54,12 +54,12 @@ loadModule <- function( module, what = character(), loadNow, if(exists(metaName, envir = env, inherits = FALSE)) loadM <- get(metaName, envir = env) } - else if(is(module, "Module")) { - loadM <- as.environment(module) # #nocov - module <- get(loadM, "moduleName") # #nocov + else if(is(module, "Module")) { # #nocov start + loadM <- as.environment(module) + module <- get(loadM, "moduleName") } else - stop(gettextf("Argument \"module\" should be a module or the name of a module: got an object of class \"%s\"", class(module))) + stop(gettextf("Argument \"module\" should be a module or the name of a module: got an object of class \"%s\"", class(module))) # #nocov end if(missing(loadNow)) { # test it if(is.null(loadM)) loadM <- tryCatch(Module( module, mustStart = TRUE, where = env ), @@ -104,7 +104,7 @@ loadModule <- function( module, what = character(), loadNow, assignAs <- .moduleNames(what) for( i in seq_along(what) ) { if(.botched) - assign(assignAs[[i]], NULL, envir = storage) + assign(assignAs[[i]], NULL, envir = storage) # #nocov else assign(assignAs[[i]], get(what[[i]], envir = storage), envir = env) } @@ -120,4 +120,3 @@ loadModule <- function( module, what = character(), loadNow, invisible(myCall) # #nocov } } - diff --git a/inst/include/Rcpp/Environment.h b/inst/include/Rcpp/Environment.h index 4072755f7..bc89a702f 100644 --- a/inst/include/Rcpp/Environment.h +++ b/inst/include/Rcpp/Environment.h @@ -106,7 +106,7 @@ namespace Rcpp{ /* We need to evaluate if it is a promise */ if( TYPEOF(res) == PROMSXP){ - res = internal::Rcpp_eval_impl( res, env ) ; + res = internal::Rcpp_eval_impl( res, env ) ; // #nocov } return res ; } diff --git a/inst/include/Rcpp/Function.h b/inst/include/Rcpp/Function.h index 3c1e21e99..783318b39 100644 --- a/inst/include/Rcpp/Function.h +++ b/inst/include/Rcpp/Function.h @@ -1,7 +1,7 @@ // Function.h: Rcpp R/C++ interface class library -- functions (also primitives and builtins) // -// Copyright (C) 2010 - 2025 Dirk Eddelbuettel and Romain Francois +// Copyright (C) 2010 - 2026 Dirk Eddelbuettel and Romain Francois // // This file is part of Rcpp. // @@ -42,12 +42,12 @@ namespace Rcpp{ case BUILTINSXP: Storage::set__(x); break; - default: + default: // #nocov start const char* fmt = "Cannot convert object to a function: " "[type=%s; target=CLOSXP, SPECIALSXP, or " "BUILTINSXP]."; throw not_compatible(fmt, Rf_type2char(TYPEOF(x))); - } + } // #nocov end } /** diff --git a/inst/include/Rcpp/Module.h b/inst/include/Rcpp/Module.h index e14d073ad..7556e9f3c 100644 --- a/inst/include/Rcpp/Module.h +++ b/inst/include/Rcpp/Module.h @@ -1,7 +1,7 @@ // Module.h: Rcpp R/C++ interface class library -- Rcpp modules // -// Copyright (C) 2010 - 2025 Dirk Eddelbuettel and Romain Francois +// Copyright (C) 2010 - 2026 Dirk Eddelbuettel and Romain Francois // // This file is part of Rcpp. // @@ -571,7 +571,7 @@ namespace Rcpp { public: typedef XPtr XP_Class ; typedef Rcpp::XPtr XP ; - CppClass( SEXP x) : S4(x){}; + CppClass( SEXP x) : S4(x){}; // #nocov CppClass( Module* p, class_Base* cl, std::string& buffer ) : S4("C++Class") { XP_Class clxp( cl, false, R_NilValue, R_NilValue ) ; diff --git a/inst/include/Rcpp/S4.h b/inst/include/Rcpp/S4.h index d5fa8746a..2ec8cdebf 100644 --- a/inst/include/Rcpp/S4.h +++ b/inst/include/Rcpp/S4.h @@ -1,8 +1,7 @@ -// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; indent-tabs-mode: nil; -*- -// + // S4.h: Rcpp R/C++ interface class library -- S4 objects // -// Copyright (C) 2010 - 2013 Dirk Eddelbuettel and Romain Francois +// Copyright (C) 2010 - 2026 Dirk Eddelbuettel and Romain Francois // // This file is part of Rcpp. // @@ -38,10 +37,10 @@ namespace Rcpp{ * * @param x must be an S4 object */ - S4_Impl(SEXP x) { + S4_Impl(SEXP x) { // #nocov start if( ! ::Rf_isS4(x) ) throw not_s4() ; Storage::set__(x) ; - } + } // #nocov end S4_Impl& operator=( SEXP other ){ Storage::set__( other ) ; @@ -57,7 +56,7 @@ namespace Rcpp{ S4_Impl( const std::string& klass ){ Shield x( R_do_new_object(R_do_MAKE_CLASS(klass.c_str())) ); if (!Rf_inherits(x, klass.c_str())) - throw S4_creation_error( klass ) ; + throw S4_creation_error( klass ) ; // #nocov Storage::set__(x) ; } diff --git a/inst/include/Rcpp/api/meat/Rcpp_eval.h b/inst/include/Rcpp/api/meat/Rcpp_eval.h index 8eb08e0f0..177668694 100644 --- a/inst/include/Rcpp/api/meat/Rcpp_eval.h +++ b/inst/include/Rcpp/api/meat/Rcpp_eval.h @@ -38,8 +38,8 @@ inline SEXP Rcpp_protected_eval(void* eval_data) { } // This is used internally instead of Rf_eval() to make evaluation safer -inline SEXP Rcpp_eval_impl(SEXP expr, SEXP env) { - return Rcpp_fast_eval(expr, env); +inline SEXP Rcpp_eval_impl(SEXP expr, SEXP env) { // #nocov + return Rcpp_fast_eval(expr, env); // #nocov } #else // R < 3.5.0 diff --git a/inst/include/Rcpp/as.h b/inst/include/Rcpp/as.h index 466761efb..e6990312c 100644 --- a/inst/include/Rcpp/as.h +++ b/inst/include/Rcpp/as.h @@ -1,8 +1,7 @@ -// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; indent-tabs-mode: nil; -*- -// + // as.h: Rcpp R/C++ interface class library -- convert SEXP to C++ objects // -// Copyright (C) 2009 - 2015 Dirk Eddelbuettel and Romain Francois +// Copyright (C) 2009 - 2026 Dirk Eddelbuettel and Romain Francois // // This file is part of Rcpp. // @@ -30,8 +29,8 @@ namespace Rcpp { template T primitive_as(SEXP x) { if (::Rf_length(x) != 1) { - const char* fmt = "Expecting a single value: [extent=%i]."; - throw ::Rcpp::not_compatible(fmt, ::Rf_length(x)); + const char* fmt = "Expecting a single value: [extent=%i]."; // #nocov + throw ::Rcpp::not_compatible(fmt, ::Rf_length(x)); // #nocov } const int RTYPE = ::Rcpp::traits::r_sexptype_traits::rtype; Shield y(r_cast(x)); @@ -45,14 +44,14 @@ namespace Rcpp { } inline const char* check_single_string(SEXP x) { - if (TYPEOF(x) == CHARSXP) return CHAR(x); + if (TYPEOF(x) == CHARSXP) return CHAR(x); // #nocov start if (! ::Rf_isString(x) || Rf_length(x) != 1) { const char* fmt = "Expecting a single string value: " "[type=%s; extent=%i]."; throw ::Rcpp::not_compatible(fmt, Rf_type2char(TYPEOF(x)), Rf_length(x)); - } + } // #nocov end return CHAR(STRING_ELT(::Rcpp::r_cast(x), 0)); } diff --git a/inst/include/Rcpp/exceptions.h b/inst/include/Rcpp/exceptions.h index 17dd28d01..2311442e3 100644 --- a/inst/include/Rcpp/exceptions.h +++ b/inst/include/Rcpp/exceptions.h @@ -3,7 +3,7 @@ // // Copyright (C) 2010 - 2020 Dirk Eddelbuettel and Romain Francois // Copyright (C) 2021 - 2024 Dirk Eddelbuettel, Romain Francois and Iñaki Ucar -// Copyright (C) 2025 Dirk Eddelbuettel, Romain Francois, Iñaki Ucar and James J Balamuta +// Copyright (C) 2025 - 2026 Dirk Eddelbuettel, Romain Francois, Iñaki Ucar and James J Balamuta // // This file is part of Rcpp. // @@ -153,7 +153,7 @@ inline void resumeJump(SEXP token) { ::R_ReleaseObject(token); ::R_ContinueUnwind(token); Rf_error("Internal error: Rcpp longjump failed to resume"); -} // #nocov end +} }} // namespace Rcpp::internal @@ -187,7 +187,7 @@ struct LongjumpException { template inline void warning(const char* fmt, Args&&... args ) { Rf_warning("%s", tfm::format(fmt, std::forward(args)... ).c_str()); - } + } // #nocov end template inline void NORET stop(const char* fmt, Args&&... args) { diff --git a/inst/include/Rcpp/internal/caster.h b/inst/include/Rcpp/internal/caster.h index afd63ed39..771e9f1d8 100644 --- a/inst/include/Rcpp/internal/caster.h +++ b/inst/include/Rcpp/internal/caster.h @@ -1,9 +1,7 @@ -// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; tab-width: 8 -*- -/* :tabSize=4:indentSize=4:noTabs=false:folding=explicit:collapseFolds=1: */ -// + // caster.h: Rcpp R/C++ interface class library -- // -// Copyright (C) 2010 - 2013 Dirk Eddelbuettel and Romain Francois +// Copyright (C) 2010 - 2026 Dirk Eddelbuettel and Romain Francois // // This file is part of Rcpp. // @@ -26,9 +24,9 @@ namespace Rcpp{ namespace internal{ -template TO caster(FROM from){ +template TO caster(FROM from){ // #nocov start return static_cast(from) ; -} +} // #nocov end template inline Rcomplex Rcomplex_caster( std::complex from ){ @@ -67,4 +65,3 @@ inline std::complex caster >( Rcomplex from } #endif - diff --git a/inst/include/Rcpp/internal/export.h b/inst/include/Rcpp/internal/export.h index 46ce154c3..04d899433 100644 --- a/inst/include/Rcpp/internal/export.h +++ b/inst/include/Rcpp/internal/export.h @@ -77,11 +77,11 @@ namespace Rcpp{ template void export_range__dispatch( SEXP x, InputIterator first, ::Rcpp::traits::r_type_string_tag ) { - if( ! ::Rf_isString( x) ) { + if( ! ::Rf_isString( x) ) { // #nocov start const char* fmt = "Expecting a string vector: " "[type=%s; required=STRSXP]."; throw ::Rcpp::not_compatible(fmt, Rf_type2char(TYPEOF(x)) ); - } + } // #nocov end R_xlen_t n = ::Rf_xlength(x) ; for( R_xlen_t i=0; i safe_x(x); /* check if we can use a fast version */ - if( TYPEOF(x) == STRSXP && parent.size() == Rf_length(x) ){ + if( TYPEOF(x) == STRSXP && parent.size() == Rf_length(x) ){ // #nocov start Rf_namesgets(parent, x); } else { /* use the slower and more flexible version (callback to R) */ SEXP namesSym = Rf_install( "names<-" ); Shield call(Rf_lang3(namesSym, parent, x)); Shield new_vec(Rcpp_fast_eval(call, R_GlobalEnv)); - parent.set__(new_vec); + parent.set__(new_vec); // #nocov end } } diff --git a/inst/include/Rcpp/proxy/SlotProxy.h b/inst/include/Rcpp/proxy/SlotProxy.h index 718a83054..c6d3f4f76 100644 --- a/inst/include/Rcpp/proxy/SlotProxy.h +++ b/inst/include/Rcpp/proxy/SlotProxy.h @@ -28,7 +28,7 @@ class SlotProxyPolicy { public: SlotProxy( CLASS& v, const std::string& name) : parent(v), slot_name(Rf_install(name.c_str())) { if( !R_has_slot( v, slot_name) ){ - throw no_such_slot(name); + throw no_such_slot(name); // #nocov } } diff --git a/inst/include/Rcpp/r_cast.h b/inst/include/Rcpp/r_cast.h index 7983f6284..7f26d8966 100644 --- a/inst/include/Rcpp/r_cast.h +++ b/inst/include/Rcpp/r_cast.h @@ -1,8 +1,7 @@ -// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; indent-tabs-mode: nil; -*- -// + // rcast.h: Rcpp R/C++ interface class library -- cast from one SEXP type to another // -// Copyright (C) 2010 - 2017 Dirk Eddelbuettel and Romain Francois +// Copyright (C) 2010 - 2026 Dirk Eddelbuettel and Romain Francois // // This file is part of Rcpp. // @@ -156,7 +155,7 @@ namespace Rcpp { } // namespace internal - template SEXP r_cast(SEXP x) { + template SEXP r_cast(SEXP x) { // #nocov start if (TYPEOF(x) == TARGET) { return x; } else { @@ -168,7 +167,7 @@ namespace Rcpp { ); return result; #else - return internal::r_true_cast(x); // #nocov + return internal::r_true_cast(x); // #nocov end #endif } } diff --git a/inst/include/Rcpp/vector/Vector.h b/inst/include/Rcpp/vector/Vector.h index e5440a5f1..76bc56020 100644 --- a/inst/include/Rcpp/vector/Vector.h +++ b/inst/include/Rcpp/vector/Vector.h @@ -1,6 +1,6 @@ // Vector.h: Rcpp R/C++ interface class library -- vectors // -// Copyright (C) 2010 - 2025 Dirk Eddelbuettel and Romain Francois +// Copyright (C) 2010 - 2026 Dirk Eddelbuettel and Romain Francois // // This file is part of Rcpp. // @@ -345,10 +345,10 @@ class Vector : return cache.ref( offset(i) ) ; } - inline Proxy at( const size_t& i) { + inline Proxy at( const size_t& i) { // #nocov start return cache.ref( offset(i) ) ; } - inline const_Proxy at( const size_t& i) const { // #nocov start + inline const_Proxy at( const size_t& i) const { return cache.ref( offset(i) ) ; } // #nocov end diff --git a/inst/include/Rcpp/vector/proxy.h b/inst/include/Rcpp/vector/proxy.h index 015b77756..296b93001 100644 --- a/inst/include/Rcpp/vector/proxy.h +++ b/inst/include/Rcpp/vector/proxy.h @@ -1,8 +1,7 @@ -// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; tab-width: 8 -*- -// + // proxy.h: Rcpp R/C++ interface class library -- proxies // -// Copyright (C) 2010 - 2018 Dirk Eddelbuettel and Romain Francois +// Copyright (C) 2010 - 2026 Dirk Eddelbuettel and Romain Francois // // This file is part of Rcpp. // @@ -182,7 +181,7 @@ namespace internal{ R_xlen_t index = 0 ; try{ index = parent.offset(name) ; - parent[ index ] = rhs ; + parent[ index ] = rhs ; // #nocov } catch( const index_out_of_bounds& ex ){ parent.push_back( rhs, name ); } diff --git a/inst/include/Rcpp/vector/traits.h b/inst/include/Rcpp/vector/traits.h index c6d76d694..3e1dcecec 100644 --- a/inst/include/Rcpp/vector/traits.h +++ b/inst/include/Rcpp/vector/traits.h @@ -1,8 +1,7 @@ -// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; tab-width: 8 -*- -// + // traits.h: Rcpp R/C++ interface class library -- support traits for vector // -// Copyright (C) 2010 - 2018 Dirk Eddelbuettel and Romain Francois +// Copyright (C) 2010 - 2026 Dirk Eddelbuettel and Romain Francois // // This file is part of Rcpp. // @@ -56,7 +55,7 @@ namespace traits{ void check_index(R_xlen_t i) const { #ifndef RCPP_NO_BOUNDS_CHECK if (i >= size) { - warning("subscript out of bounds (index %s >= vector size %s)", i, size); + warning("subscript out of bounds (index %s >= vector size %s)", i, size); // #nocov } #endif } @@ -94,7 +93,7 @@ namespace traits{ void check_index(R_xlen_t i) const { #ifndef RCPP_NO_BOUNDS_CHECK if (i >= p->size()) { - warning("subscript out of bounds (index %s >= vector size %s)", i, p->size()); + warning("subscript out of bounds (index %s >= vector size %s)", i, p->size()); // #nocov } #endif } diff --git a/src/attributes.cpp b/src/attributes.cpp index 5240e3627..641b13624 100644 --- a/src/attributes.cpp +++ b/src/attributes.cpp @@ -1,7 +1,7 @@ // attributes.cpp: Rcpp R/C++ interface class library -- Rcpp attributes // // Copyright (C) 2012 - 2020 JJ Allaire, Dirk Eddelbuettel and Romain Francois -// Copyright (C) 2021 - 2025 JJ Allaire, Dirk Eddelbuettel, Romain Francois, Iñaki Ucar and Travers Ching +// Copyright (C) 2021 - 2026 JJ Allaire, Dirk Eddelbuettel, Romain Francois, Iñaki Ucar and Travers Ching // // This file is part of Rcpp. // @@ -2485,8 +2485,8 @@ namespace attributes { if(attribute.hasParameter(kExportSignature)) { args = attribute.customRSignature(); if(!checkRSignature(function, args)) { - std::string rsig_err_msg = "Missing args in " + args; - throw Rcpp::exception(rsig_err_msg.c_str()); + std::string rsig_err_msg = "Missing args in " + args; // #nocov + throw Rcpp::exception(rsig_err_msg.c_str()); // #nocov } } // determine the function name diff --git a/src/barrier.cpp b/src/barrier.cpp index 019a246ab..aa0febb68 100644 --- a/src/barrier.cpp +++ b/src/barrier.cpp @@ -2,7 +2,7 @@ // barrier.cpp: Rcpp R/C++ interface class library -- write barrier // // Copyright (C) 2010 - 2020 Dirk Eddelbuettel and Romain Francois -// Copyright (C) 2021 - 2025 Dirk Eddelbuettel, Romain Francois and Iñaki Ucar +// Copyright (C) 2021 - 2026 Dirk Eddelbuettel, Romain Francois and Iñaki Ucar // // This file is part of Rcpp. // @@ -103,13 +103,13 @@ void Rcpp_precious_init() { R_PreserveObject(Rcpp_precious); // and protect } // [[Rcpp::register]] -void Rcpp_precious_teardown() { +void Rcpp_precious_teardown() { // #nocov start R_ReleaseObject(Rcpp_precious); // release resource -} +} // #nocov end // [[Rcpp::register]] SEXP Rcpp_precious_preserve(SEXP object) { if (object == R_NilValue) { - return R_NilValue; + return R_NilValue; // #nocov } PROTECT(object); SEXP cell = PROTECT(CONS(Rcpp_precious, CDR(Rcpp_precious)));