Skip to content

Commit 8ce382b

Browse files
committed
compiler warnings
1 parent 23f8af9 commit 8ce382b

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

inst/include/RcppParallel.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#include "RcppParallel/TinyThread.h"
77

88
// Use TBB only where it's known to compile and work correctly
9-
// (NOTE: Windows TBB is temporarily opt-in for packages for
9+
// (NOTE: Windows TBB is temporarily opt-in for packages for
1010
// compatibility with CRAN packages not previously configured
1111
// to link to TBB in Makevars.win)
1212
#ifndef RCPP_PARALLEL_USE_TBB
@@ -32,14 +32,14 @@
3232
namespace RcppParallel {
3333

3434
inline void parallelFor(std::size_t begin,
35-
std::size_t end,
35+
std::size_t end,
3636
Worker& worker,
3737
std::size_t grainSize = 1,
3838
int numThreads = -1)
3939
{
40-
grainSize = resolveValue("RCPP_PARALLEL_GRAIN_SIZE", grainSize, 1u);
40+
grainSize = resolveValue("RCPP_PARALLEL_GRAIN_SIZE", grainSize, std::size_t(1));
4141
numThreads = resolveValue("RCPP_PARALLEL_NUM_THREADS", numThreads, -1);
42-
42+
4343
#if RCPP_PARALLEL_USE_TBB
4444
if (internal::backend() == internal::BACKEND_TBB)
4545
tbbParallelFor(begin, end, worker, grainSize, numThreads);
@@ -52,14 +52,14 @@ inline void parallelFor(std::size_t begin,
5252

5353
template <typename Reducer>
5454
inline void parallelReduce(std::size_t begin,
55-
std::size_t end,
55+
std::size_t end,
5656
Reducer& reducer,
5757
std::size_t grainSize = 1,
5858
int numThreads = -1)
5959
{
60-
grainSize = resolveValue("RCPP_PARALLEL_GRAIN_SIZE", grainSize, 1);
60+
grainSize = resolveValue("RCPP_PARALLEL_GRAIN_SIZE", grainSize, std::size_t(1));
6161
numThreads = resolveValue("RCPP_PARALLEL_NUM_THREADS", numThreads, -1);
62-
62+
6363
#if RCPP_PARALLEL_USE_TBB
6464
if (internal::backend() == internal::BACKEND_TBB)
6565
tbbParallelReduce(begin, end, reducer, grainSize, numThreads);

inst/include/RcppParallel/Common.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ inline int resolveValue(const char* envvar,
1313
U defaultValue)
1414
{
1515
// if the requested value is non-zero and not the default, we can use it
16-
if (requestedValue != defaultValue && requestedValue > 0)
16+
if (requestedValue != static_cast<T>(defaultValue) && requestedValue > 0)
1717
return requestedValue;
1818

1919
// otherwise, try reading the default from associated envvar

0 commit comments

Comments
 (0)