diff --git a/ChangeLog b/ChangeLog index a6c13fe62..e46bdd3c9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2024-06-02 Dirk Eddelbuettel + + * inst/include/Rcpp/internal/export.h: More R_xlen_t switching + * inst/include/Rcpp/vector/SubMatrix.h: Idem + * inst/include/Rcpp/vector/Vector.h: Idem + +2024-06-01 Dirk Eddelbuettel + + * inst/include/Rcpp/internal/Proxy_Iterator.h (Proxy_Iterator): + Switch to R_xlen_t ('clang++-17 -Wconversion -Wno-sign-conversion') + * inst/include/Rcpp/DataFrame.h: Idem + * inst/include/Rcpp/Vector.h: Idem + 2024-05-28 Dirk Eddelbuettel * DESCRIPTION (Version, Date): Roll micro version diff --git a/inst/include/Rcpp/DataFrame.h b/inst/include/Rcpp/DataFrame.h index 053b159d3..0d03efcde 100644 --- a/inst/include/Rcpp/DataFrame.h +++ b/inst/include/Rcpp/DataFrame.h @@ -137,7 +137,7 @@ namespace Rcpp{ } void set_type_after_push(){ - int max_rows = 0; + R_xlen_t max_rows = 0; bool invalid_column_size = false; List::iterator it; // Get the maximum number of rows diff --git a/inst/include/Rcpp/Vector.h b/inst/include/Rcpp/Vector.h index e25be1d59..6c95ef8d9 100644 --- a/inst/include/Rcpp/Vector.h +++ b/inst/include/Rcpp/Vector.h @@ -1,5 +1,4 @@ -// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; tab-width: 8 -*- -// + // Vector.h: Rcpp R/C++ interface class library -- vectors // // Copyright (C) 2010 - 2013 Dirk Eddelbuettel and Romain Francois diff --git a/inst/include/Rcpp/internal/Proxy_Iterator.h b/inst/include/Rcpp/internal/Proxy_Iterator.h index bc94f112b..6ba891765 100644 --- a/inst/include/Rcpp/internal/Proxy_Iterator.h +++ b/inst/include/Rcpp/internal/Proxy_Iterator.h @@ -1,6 +1,4 @@ -// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; tab-width: 8 -*- -/* :tabSize=4:indentSize=4:noTabs=false:folding=explicit:collapseFolds=1: */ -// + // Proxy_Iterator.h: Rcpp R/C++ interface class library -- // // Copyright (C) 2010 - 2013 Dirk Eddelbuettel and Romain Francois @@ -31,7 +29,7 @@ class Proxy_Iterator { public: typedef PROXY& reference ; typedef PROXY* pointer ; - typedef int difference_type ; + typedef R_xlen_t difference_type ; typedef PROXY value_type; typedef std::random_access_iterator_tag iterator_category ; @@ -122,4 +120,3 @@ class Proxy_Iterator { } #endif - diff --git a/inst/include/Rcpp/internal/export.h b/inst/include/Rcpp/internal/export.h index e433127d7..46ce154c3 100644 --- a/inst/include/Rcpp/internal/export.h +++ b/inst/include/Rcpp/internal/export.h @@ -1,6 +1,4 @@ -// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; indent-tabs-mode: nil; -*- -/* :tabSize=4:indentSize=4:noTabs=false:folding=explicit:collapseFolds=1: */ -// + // export.h: Rcpp R/C++ interface class library -- // // Copyright (C) 2010 - 2013 Dirk Eddelbuettel and Romain Francois diff --git a/inst/include/Rcpp/vector/SubMatrix.h b/inst/include/Rcpp/vector/SubMatrix.h index 98b417291..0bda3ab57 100644 --- a/inst/include/Rcpp/vector/SubMatrix.h +++ b/inst/include/Rcpp/vector/SubMatrix.h @@ -1,5 +1,4 @@ -// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; tab-width: 8 -*- -// + // SubMatrix.h: Rcpp R/C++ interface class library -- sub matrices // // Copyright (C) 2010 - 2013 Dirk Eddelbuettel and Romain Francois @@ -40,8 +39,8 @@ class SubMatrix : public Rcpp::MatrixBase< RTYPE, true, SubMatrix > { {} inline R_xlen_t size() const { return ((R_xlen_t)ncol()) * nrow() ; } - inline int ncol() const { return nc ; } - inline int nrow() const { return nr ; } + inline R_xlen_t ncol() const { return nc ; } + inline R_xlen_t nrow() const { return nr ; } inline Proxy operator()(int i, int j) const { return iter[ i + j*m_nr ] ; @@ -52,16 +51,16 @@ class SubMatrix : public Rcpp::MatrixBase< RTYPE, true, SubMatrix > { private: MATRIX& m ; vec_iterator iter ; - int m_nr, nc, nr ; + R_xlen_t m_nr, nc, nr ; } ; template class StoragePolicy > -Matrix::Matrix( const SubMatrix& sub ) : VECTOR( Rf_allocMatrix( RTYPE, sub.nrow(), sub.ncol() )), nrows(sub.nrow()) { - int nc = sub.ncol() ; +Matrix::Matrix( const SubMatrix& sub ) : VECTOR( Rf_allocMatrix( RTYPE, (int)sub.nrow(), (int)sub.ncol() )), nrows((int)sub.nrow()) { + R_xlen_t nc = sub.ncol() ; iterator start = VECTOR::begin() ; iterator rhs_it ; - for( int j=0; j