[Rcpp-commits] r3592 - in pkg/Rcpp: inst/include/Rcpp src

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu May 3 05:52:57 CEST 2012


Author: edd
Date: 2012-05-03 05:52:57 +0200 (Thu, 03 May 2012)
New Revision: 3592

Modified:
   pkg/Rcpp/inst/include/Rcpp/Environment.h
   pkg/Rcpp/inst/include/Rcpp/Function.h
   pkg/Rcpp/src/Environment.cpp
   pkg/Rcpp/src/Function.cpp
Log:
moved a default argument for SEXP in the ctor for Environment and Function
classes from the cpp file to the h where it belongs -- spotted by clang++ and
reported by Anirban Mukherjee


Modified: pkg/Rcpp/inst/include/Rcpp/Environment.h
===================================================================
--- pkg/Rcpp/inst/include/Rcpp/Environment.h	2012-04-29 15:43:04 UTC (rev 3591)
+++ pkg/Rcpp/inst/include/Rcpp/Environment.h	2012-05-03 03:52:57 UTC (rev 3592)
@@ -2,7 +2,7 @@
 //
 // Environment.h: Rcpp R/C++ interface class library -- access R environments
 //
-// Copyright (C) 2009 - 2011    Dirk Eddelbuettel and Romain Francois
+// Copyright (C) 2009 - 2012    Dirk Eddelbuettel and Romain Francois
 //
 // This file is part of Rcpp.
 //
@@ -174,7 +174,7 @@
          *
          * if the SEXP is not an environment, and exception is thrown
          */
-        Environment(SEXP x);
+        Environment(SEXP x = R_GlobalEnv);
     
         /**
          * copy constructor

Modified: pkg/Rcpp/inst/include/Rcpp/Function.h
===================================================================
--- pkg/Rcpp/inst/include/Rcpp/Function.h	2012-04-29 15:43:04 UTC (rev 3591)
+++ pkg/Rcpp/inst/include/Rcpp/Function.h	2012-05-03 03:52:57 UTC (rev 3592)
@@ -2,7 +2,7 @@
 //
 // Function.h: Rcpp R/C++ interface class library -- functions (also primitives and builtins)
 //
-// Copyright (C) 2010 - 2011 Dirk Eddelbuettel and Romain Francois
+// Copyright (C) 2010 - 2012  Dirk Eddelbuettel and Romain Francois
 //
 // This file is part of Rcpp.
 //
@@ -41,7 +41,7 @@
          * @throw not_compatible if the SEXP could not be converted
          * to a pair list using as.pairlist
          */
-        Function(SEXP lang) ;
+        Function(SEXP lang = R_NilValue) ;
         
         /**
          * Finds a function, searching from the global environment

Modified: pkg/Rcpp/src/Environment.cpp
===================================================================
--- pkg/Rcpp/src/Environment.cpp	2012-04-29 15:43:04 UTC (rev 3591)
+++ pkg/Rcpp/src/Environment.cpp	2012-05-03 03:52:57 UTC (rev 3592)
@@ -2,7 +2,7 @@
 //
 // Environment.cpp: Rcpp R/C++ interface class library -- Environments
 //
-// Copyright (C) 2009 - 2011 Dirk Eddelbuettel and Romain Francois
+// Copyright (C) 2009 - 2012  Dirk Eddelbuettel and Romain Francois
 //
 // This file is part of Rcpp.
 //
@@ -25,7 +25,7 @@
 
     Environment::Environment() : RObject(R_NilValue){}
 
-    Environment::Environment( SEXP x = R_GlobalEnv) : RObject(x){
+    Environment::Environment(SEXP x) : RObject(x){
         if( ! Rf_isEnvironment(x) ) {
             /* not an environment, but maybe convertible to one using as.environment, try that */
             SEXP res ;

Modified: pkg/Rcpp/src/Function.cpp
===================================================================
--- pkg/Rcpp/src/Function.cpp	2012-04-29 15:43:04 UTC (rev 3591)
+++ pkg/Rcpp/src/Function.cpp	2012-05-03 03:52:57 UTC (rev 3592)
@@ -2,7 +2,7 @@
 //
 // Function.cpp: Rcpp R/C++ interface class library -- functions
 //
-// Copyright (C) 2010 - 2011 Dirk Eddelbuettel and Romain Francois
+// Copyright (C) 2010 - 2012  Dirk Eddelbuettel and Romain Francois
 //
 // This file is part of Rcpp.
 //
@@ -23,7 +23,7 @@
 
 namespace Rcpp {
 	
-    Function::Function( SEXP x = R_NilValue ) : RObject( ){
+    Function::Function(SEXP x) : RObject( ){
         switch( TYPEOF(x) ){
         case CLOSXP:
         case SPECIALSXP:



More information about the Rcpp-commits mailing list