Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions inst/include/Rcpp/internal/wrap.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,9 @@ namespace Rcpp {
Shield<SEXP> x(Rf_allocVector(RTYPE, size));

typedef typename ::Rcpp::traits::storage_type<RTYPE>::type STORAGE;
int __trip_count = size >> 2;
R_xlen_t __trip_count = size >> 2;
STORAGE* start = r_vector_start<RTYPE>(x);
int i = 0;
R_xlen_t i = 0;
for (; __trip_count > 0; --__trip_count) {
start[i] = first[i]; i++;
start[i] = first[i]; i++;
Expand Down
30 changes: 15 additions & 15 deletions inst/include/Rcpp/macros/unroll.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// unroll.h: Rcpp R/C++ interface class library -- loop unrolling macro
//
// Copyright (C) 2010 - 2011 Dirk Eddelbuettel and Romain Francois
// Copyright (C) 2010 - 2017 Dirk Eddelbuettel and Romain Francois
//
// This file is part of Rcpp.
//
Expand All @@ -23,8 +23,8 @@
#define Rcpp__macros_unroll_h

#define RCPP_LOOP_UNROLL_PTR(TARGET,SOURCE) \
int __trip_count = n >> 2 ; \
int i = 0 ; \
R_xlen_t __trip_count = n >> 2 ; \
R_xlen_t i = 0 ; \
for ( ; __trip_count > 0 ; --__trip_count) { \
*TARGET++ = SOURCE[i++] ; \
*TARGET++ = SOURCE[i++] ; \
Expand All @@ -45,8 +45,8 @@ switch (n - i){ \


#define RCPP_LOOP_UNROLL(TARGET,SOURCE) \
int __trip_count = n >> 2 ; \
int i = 0 ; \
R_xlen_t __trip_count = n >> 2 ; \
R_xlen_t i = 0 ; \
for ( ; __trip_count > 0 ; --__trip_count) { \
TARGET[i] = SOURCE[i] ; i++ ; \
TARGET[i] = SOURCE[i] ; i++ ; \
Expand All @@ -65,22 +65,22 @@ switch (n - i){ \
{} \
}

#define RCPP_LOOP_UNROLL_LHSFUN(TARGET,FUN,SOURCE) \
int __trip_count = n >> 2 ; \
int i = 0 ; \
#define RCPP_LOOP_UNROLL_LHSFUN(TARGET,FUN,SOURCE) \
R_xlen_t __trip_count = n >> 2 ; \
R_xlen_t i = 0 ; \
for ( ; __trip_count > 0 ; --__trip_count) { \
TARGET[FUN(i)] = SOURCE[i] ; i++ ; \
TARGET[FUN(i)] = SOURCE[i] ; i++ ; \
TARGET[FUN(i)] = SOURCE[i] ; i++ ; \
TARGET[FUN(i)] = SOURCE[i] ; i++ ; \
TARGET[FUN(i)] = SOURCE[i] ; i++ ; \
TARGET[FUN(i)] = SOURCE[i] ; i++ ; \
TARGET[FUN(i)] = SOURCE[i] ; i++ ; \
TARGET[FUN(i)] = SOURCE[i] ; i++ ; \
} \
switch (n - i){ \
case 3: \
TARGET[FUN(i)] = SOURCE[i] ; i++ ; \
TARGET[FUN(i)] = SOURCE[i] ; i++ ; \
case 2: \
TARGET[FUN(i)] = SOURCE[i] ; i++ ; \
TARGET[FUN(i)] = SOURCE[i] ; i++ ; \
case 1: \
TARGET[FUN(i)] = SOURCE[i] ; i++ ; \
TARGET[FUN(i)] = SOURCE[i] ; i++ ; \
case 0: \
default: \
{} \
Expand Down
4 changes: 2 additions & 2 deletions inst/include/Rcpp/vector/Vector.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// Vector.h: Rcpp R/C++ interface class library -- vectors
//
// Copyright (C) 2010 - 2013 Dirk Eddelbuettel and Romain Francois
// Copyright (C) 2010 - 2017 Dirk Eddelbuettel and Romain Francois
//
// This file is part of Rcpp.
//
Expand Down Expand Up @@ -1075,7 +1075,7 @@ class Vector :


template <typename T>
inline void import_expression( const T& other, int n ) {
inline void import_expression( const T& other, R_xlen_t n ) {
iterator start = begin() ;
RCPP_LOOP_UNROLL(start,other)
}
Expand Down