Skip to content

Commit 2f8385d

Browse files
committed
Add #nocov tags to inst/include/Rcpp/* files
1 parent 2b28956 commit 2f8385d

File tree

17 files changed

+64
-57
lines changed

17 files changed

+64
-57
lines changed

ChangeLog

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,25 @@
11
2026-01-01 Dirk Eddelbuettel <[email protected]>
22

3-
* R/Attributes.R: Additional #nocov tags for new(er) code
3+
* R/Attributes.R: Additional or adjusted #nocov tags
44
* R/Rcpp.package.skeleton.R: Idem
55
* R/RcppLdpath.R: Idem
66
* R/asis.R: Idem
77
* R/inline.R: Idem
8+
* inst/include/Rcpp/api/meat/Rcpp_eval.h: Idem
9+
* inst/include/Rcpp/internal/caster.h: Idem
10+
* inst/include/Rcpp/internal/export.h: Idem
11+
* inst/include/Rcpp/proxy/NamesProxy.h: Idem
12+
* inst/include/Rcpp/proxy/SlotProxy.h: Idem
13+
* inst/include/Rcpp/vector/Vector.h: Idem
14+
* inst/include/Rcpp/vector/proxy.h: Idem
15+
* inst/include/Rcpp/vector/traits.h: Idem
16+
* inst/include/Rcpp/Environment.h: Idem
17+
* inst/include/Rcpp/Function.h: Idem
18+
* inst/include/Rcpp/Module.h: Idem
19+
* inst/include/Rcpp/S4.h: Idem
20+
* inst/include/Rcpp/as.h: Idem
21+
* inst/include/Rcpp/exceptions.h: Idem
22+
* inst/include/Rcpp/r_cast.h: Idem
823

924
2025-12-30 Dirk Eddelbuettel <[email protected]>
1025

R/inline.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ Rcpp.plugin.maker <- function(include.before = "",
2323
libs = "",
2424
Makevars = NULL ,
2525
Makevars.win = NULL,
26-
package = "Rcpp") {
27-
function(...) { # #nocov
26+
package = "Rcpp") { # #nocov start
27+
function(...) {
2828
includes <- sprintf("%s
2929
#include <Rcpp.h>
3030
%s
@@ -37,7 +37,7 @@ Rcpp.plugin.maker <- function(include.before = "",
3737
#define END_RCPP
3838
#endif
3939
40-
using namespace Rcpp;", include.before, include.after)
40+
using namespace Rcpp;", include.before, include.after) # #nocov end
4141

4242
out <- list(env = list( PKG_LIBS = libs ),
4343
includes = includes,

inst/include/Rcpp/Environment.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ namespace Rcpp{
106106

107107
/* We need to evaluate if it is a promise */
108108
if( TYPEOF(res) == PROMSXP){
109-
res = internal::Rcpp_eval_impl( res, env ) ;
109+
res = internal::Rcpp_eval_impl( res, env ) ; // #nocov
110110
}
111111
return res ;
112112
}

inst/include/Rcpp/Function.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
// Function.h: Rcpp R/C++ interface class library -- functions (also primitives and builtins)
33
//
4-
// Copyright (C) 2010 - 2025 Dirk Eddelbuettel and Romain Francois
4+
// Copyright (C) 2010 - 2026 Dirk Eddelbuettel and Romain Francois
55
//
66
// This file is part of Rcpp.
77
//
@@ -42,12 +42,12 @@ namespace Rcpp{
4242
case BUILTINSXP:
4343
Storage::set__(x);
4444
break;
45-
default:
45+
default: // #nocov start
4646
const char* fmt = "Cannot convert object to a function: "
4747
"[type=%s; target=CLOSXP, SPECIALSXP, or "
4848
"BUILTINSXP].";
4949
throw not_compatible(fmt, Rf_type2char(TYPEOF(x)));
50-
}
50+
} // #nocov end
5151
}
5252

5353
/**

inst/include/Rcpp/Module.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
// Module.h: Rcpp R/C++ interface class library -- Rcpp modules
33
//
4-
// Copyright (C) 2010 - 2025 Dirk Eddelbuettel and Romain Francois
4+
// Copyright (C) 2010 - 2026 Dirk Eddelbuettel and Romain Francois
55
//
66
// This file is part of Rcpp.
77
//
@@ -571,7 +571,7 @@ namespace Rcpp {
571571
public:
572572
typedef XPtr<class_Base> XP_Class ;
573573
typedef Rcpp::XPtr<Rcpp::Module> XP ;
574-
CppClass( SEXP x) : S4(x){};
574+
CppClass( SEXP x) : S4(x){}; // #nocov
575575

576576
CppClass( Module* p, class_Base* cl, std::string& buffer ) : S4("C++Class") {
577577
XP_Class clxp( cl, false, R_NilValue, R_NilValue ) ;

inst/include/Rcpp/S4.h

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; indent-tabs-mode: nil; -*-
2-
//
1+
32
// S4.h: Rcpp R/C++ interface class library -- S4 objects
43
//
5-
// Copyright (C) 2010 - 2013 Dirk Eddelbuettel and Romain Francois
4+
// Copyright (C) 2010 - 2026 Dirk Eddelbuettel and Romain Francois
65
//
76
// This file is part of Rcpp.
87
//
@@ -38,10 +37,10 @@ namespace Rcpp{
3837
*
3938
* @param x must be an S4 object
4039
*/
41-
S4_Impl(SEXP x) {
40+
S4_Impl(SEXP x) { // #nocov start
4241
if( ! ::Rf_isS4(x) ) throw not_s4() ;
4342
Storage::set__(x) ;
44-
}
43+
} // #nocov end
4544

4645
S4_Impl& operator=( SEXP other ){
4746
Storage::set__( other ) ;
@@ -57,7 +56,7 @@ namespace Rcpp{
5756
S4_Impl( const std::string& klass ){
5857
Shield<SEXP> x( R_do_new_object(R_do_MAKE_CLASS(klass.c_str())) );
5958
if (!Rf_inherits(x, klass.c_str()))
60-
throw S4_creation_error( klass ) ;
59+
throw S4_creation_error( klass ) ; // #nocov
6160
Storage::set__(x) ;
6261
}
6362

inst/include/Rcpp/api/meat/Rcpp_eval.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ inline SEXP Rcpp_protected_eval(void* eval_data) {
3838
}
3939

4040
// This is used internally instead of Rf_eval() to make evaluation safer
41-
inline SEXP Rcpp_eval_impl(SEXP expr, SEXP env) {
42-
return Rcpp_fast_eval(expr, env);
41+
inline SEXP Rcpp_eval_impl(SEXP expr, SEXP env) { // #nocov
42+
return Rcpp_fast_eval(expr, env); // #nocov
4343
}
4444

4545
#else // R < 3.5.0

inst/include/Rcpp/as.h

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; indent-tabs-mode: nil; -*-
2-
//
1+
32
// as.h: Rcpp R/C++ interface class library -- convert SEXP to C++ objects
43
//
5-
// Copyright (C) 2009 - 2015 Dirk Eddelbuettel and Romain Francois
4+
// Copyright (C) 2009 - 2026 Dirk Eddelbuettel and Romain Francois
65
//
76
// This file is part of Rcpp.
87
//
@@ -30,8 +29,8 @@ namespace Rcpp {
3029

3130
template <typename T> T primitive_as(SEXP x) {
3231
if (::Rf_length(x) != 1) {
33-
const char* fmt = "Expecting a single value: [extent=%i].";
34-
throw ::Rcpp::not_compatible(fmt, ::Rf_length(x));
32+
const char* fmt = "Expecting a single value: [extent=%i]."; // #nocov
33+
throw ::Rcpp::not_compatible(fmt, ::Rf_length(x)); // #nocov
3534
}
3635
const int RTYPE = ::Rcpp::traits::r_sexptype_traits<T>::rtype;
3736
Shield<SEXP> y(r_cast<RTYPE>(x));
@@ -45,14 +44,14 @@ namespace Rcpp {
4544
}
4645

4746
inline const char* check_single_string(SEXP x) {
48-
if (TYPEOF(x) == CHARSXP) return CHAR(x);
47+
if (TYPEOF(x) == CHARSXP) return CHAR(x); // #nocov start
4948
if (! ::Rf_isString(x) || Rf_length(x) != 1) {
5049
const char* fmt = "Expecting a single string value: "
5150
"[type=%s; extent=%i].";
5251
throw ::Rcpp::not_compatible(fmt,
5352
Rf_type2char(TYPEOF(x)),
5453
Rf_length(x));
55-
}
54+
} // #nocov end
5655

5756
return CHAR(STRING_ELT(::Rcpp::r_cast<STRSXP>(x), 0));
5857
}

inst/include/Rcpp/exceptions.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//
44
// Copyright (C) 2010 - 2020 Dirk Eddelbuettel and Romain Francois
55
// Copyright (C) 2021 - 2024 Dirk Eddelbuettel, Romain Francois and Iñaki Ucar
6-
// Copyright (C) 2025 Dirk Eddelbuettel, Romain Francois, Iñaki Ucar and James J Balamuta
6+
// Copyright (C) 2025 - 2026 Dirk Eddelbuettel, Romain Francois, Iñaki Ucar and James J Balamuta
77
//
88
// This file is part of Rcpp.
99
//
@@ -153,7 +153,7 @@ inline void resumeJump(SEXP token) {
153153
::R_ReleaseObject(token);
154154
::R_ContinueUnwind(token);
155155
Rf_error("Internal error: Rcpp longjump failed to resume");
156-
} // #nocov end
156+
}
157157

158158
}} // namespace Rcpp::internal
159159

@@ -187,7 +187,7 @@ struct LongjumpException {
187187
template <typename... Args>
188188
inline void warning(const char* fmt, Args&&... args ) {
189189
Rf_warning("%s", tfm::format(fmt, std::forward<Args>(args)... ).c_str());
190-
}
190+
} // #nocov end
191191

192192
template <typename... Args>
193193
inline void NORET stop(const char* fmt, Args&&... args) {

inst/include/Rcpp/internal/caster.h

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; tab-width: 8 -*-
2-
/* :tabSize=4:indentSize=4:noTabs=false:folding=explicit:collapseFolds=1: */
3-
//
1+
42
// caster.h: Rcpp R/C++ interface class library --
53
//
6-
// Copyright (C) 2010 - 2013 Dirk Eddelbuettel and Romain Francois
4+
// Copyright (C) 2010 - 2026 Dirk Eddelbuettel and Romain Francois
75
//
86
// This file is part of Rcpp.
97
//
@@ -26,9 +24,9 @@
2624
namespace Rcpp{
2725
namespace internal{
2826

29-
template <typename FROM, typename TO> TO caster(FROM from){
27+
template <typename FROM, typename TO> TO caster(FROM from){ // #nocov start
3028
return static_cast<TO>(from) ;
31-
}
29+
} // #nocov end
3230

3331
template <typename T>
3432
inline Rcomplex Rcomplex_caster( std::complex<T> from ){
@@ -67,4 +65,3 @@ inline std::complex<float> caster<Rcomplex,std::complex<float> >( Rcomplex from
6765
}
6866

6967
#endif
70-

0 commit comments

Comments
 (0)