From c4db7438a284a2976b860cd9457776120aaf3545 Mon Sep 17 00:00:00 2001 From: Alexander Gaenko Date: Thu, 3 Dec 2020 16:19:40 -0500 Subject: [PATCH 1/2] Allow constructing RMatrix from a non-const buffer --- inst/include/RcppParallel/RMatrix.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inst/include/RcppParallel/RMatrix.h b/inst/include/RcppParallel/RMatrix.h index ca391b79..218845b8 100644 --- a/inst/include/RcppParallel/RMatrix.h +++ b/inst/include/RcppParallel/RMatrix.h @@ -204,7 +204,7 @@ class RMatrix { { } - inline RMatrix(const T* data, std::size_t nrow, std::size_t ncol) + inline RMatrix(T* data, std::size_t nrow, std::size_t ncol) : data_(data), nrow_(nrow), ncol_(ncol) { } From d8fc41474d42c3261c2cc5f008dc24b340597e2d Mon Sep 17 00:00:00 2001 From: Alexander Gaenko Date: Thu, 3 Dec 2020 16:43:33 -0500 Subject: [PATCH 2/2] Corrected a signed-unsigned comparison warning --- inst/include/RcppParallel.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inst/include/RcppParallel.h b/inst/include/RcppParallel.h index 7a5ce66d..f78a5db4 100644 --- a/inst/include/RcppParallel.h +++ b/inst/include/RcppParallel.h @@ -34,7 +34,7 @@ inline void parallelFor(std::size_t begin, std::size_t grainSize = 1, int numThreads = -1) { - grainSize = resolveValue("RCPP_PARALLEL_GRAIN_SIZE", grainSize, 1); + grainSize = resolveValue("RCPP_PARALLEL_GRAIN_SIZE", grainSize, 1u); numThreads = resolveValue("RCPP_PARALLEL_NUM_THREADS", numThreads, -1); #if RCPP_PARALLEL_USE_TBB