[Rcpp-devel] Couple of minor fixes to Rcpp

Karl Millar kmillar at google.com
Wed Oct 20 23:36:04 CEST 2010


This was using clang (http://clang.llvm.org)

On Wed, Oct 20, 2010 at 2:31 PM, Dirk Eddelbuettel <edd at debian.org> wrote:

>
> Hi Karl,
>
> Thanks for spotting and fixing those. Out of curiousity, which non-gcc
> compiler was that?  icc ?
>
> On 20 October 2010 at 14:22, Karl Millar wrote:
> | This patch fixes a couple of minor issues.  Both are cases of illegal C++
> | code caught by using a non-gcc complier.  The first is a bug in
> | Vector::fill_dispatch, which would be serious except that the function
> | appears to be unused at the moment.  The second is just a syntactic
> issue.
> |
> | The patch is against the current svn repository.
>
> Super. We will apply those shortly; I also found another thinko of ours so
> maybe we'll just toss out 0.8.8 in due course.
>
> Thanks,  Dirk
>
> | Thanks,
> |
> | Karl Millar
> |
> | ----------------------------------------------------------------------
> | Index: Rcpp/inst/include/Rcpp/vector/Vector.h
> | ===================================================================
> | --- Rcpp/inst/include/Rcpp/vector/Vector.h    (revision 2347)
> | +++ Rcpp/inst/include/Rcpp/vector/Vector.h    (working copy)
> | @@ -311,7 +311,7 @@
> |               // when this is not trivial, this is SEXP
> |               SEXP elem = PROTECT( converter_type::get( u ) );
> |               iterator it(begin());
> | -             for( int i=0; i<size ; i++, ++it){
> | +             for( int i=0; i<size() ; i++, ++it){
> |                       *it = ::Rf_duplicate( elem ) ;
> |               }
> |               UNPROTECT(1) ; /* elem */
> | Index: Rcpp/inst/include/Rcpp/XPtr.h
> | ===================================================================
> | --- Rcpp/inst/include/Rcpp/XPtr.h     (revision 2347)
> | +++ Rcpp/inst/include/Rcpp/XPtr.h     (working copy)
> | @@ -59,7 +59,8 @@
> |       *        so you need to make sure the pointer can be "delete" d
> |       *        this way (has to be a C++ object)
> |       */
> | -    explicit XPtr(T* p, bool set_delete_finalizer, SEXP tag, SEXP prot);
> | +    explicit XPtr(T* p, bool set_delete_finalizer = true, SEXP tag =
> R_NilValue,
> | +                  SEXP prot = R_NilValue);
> |
> |      XPtr( const XPtr& other ) : RObject( other.asSexp() ) {}
> |
> | @@ -168,7 +169,7 @@
> |  };
> |
> |  template<typename T>
> | -XPtr<T>::XPtr(T* p, bool set_delete_finalizer = true, SEXP tag =
> R_NilValue, SEXP prot = R_NilValue) : RObject() {
> | +XPtr<T>::XPtr(T* p, bool set_delete_finalizer, SEXP tag, SEXP prot) :
> RObject() {
> |      setSEXP( R_MakeExternalPtr( (void*)p , tag, prot) ) ;
> |      if( set_delete_finalizer ){
> |       setDeleteFinalizer() ;
> |
> | ----------------------------------------------------------------------
> | _______________________________________________
> | Rcpp-devel mailing list
> | Rcpp-devel at lists.r-forge.r-project.org
> | https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel
>
> --
> Dirk Eddelbuettel | edd at debian.org | http://dirk.eddelbuettel.com
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20101020/758b05ea/attachment.htm>


More information about the Rcpp-devel mailing list