Skip to content

Instantly share code, notes, and snippets.

@nathan-russell
Created April 13, 2017 11:25
Show Gist options
  • Save nathan-russell/3f72a0a0969acc21e467130a4b2628c2 to your computer and use it in GitHub Desktop.
Save nathan-russell/3f72a0a0969acc21e467130a4b2628c2 to your computer and use it in GitHub Desktop.
diff --git a/inst/include/dplyr/Collecter.h b/inst/include/dplyr/Collecter.h
index a5ecd45..cd45d97 100644
--- a/inst/include/dplyr/Collecter.h
+++ b/inst/include/dplyr/Collecter.h
@@ -93,7 +93,7 @@ public:
return RTYPE == TYPEOF(x) || all_logical_na(x, TYPEOF(x));
}
- bool can_promote(SEXP x) const {
+ bool can_promote(SEXP /*x*/) const {
return false;
}
@@ -152,7 +152,7 @@ public:
all_logical_na(x, RTYPE);
}
- bool can_promote(SEXP x) const {
+ bool can_promote(SEXP /*x*/) const {
return false;
}
@@ -192,7 +192,7 @@ public:
return (STRSXP == TYPEOF(x)) || Rf_inherits(x, "factor") || all_logical_na(x, TYPEOF(x));
}
- bool can_promote(SEXP x) const {
+ bool can_promote(SEXP /*x*/) const {
return false;
}
@@ -205,7 +205,7 @@ protected:
private:
- void collect_logicalNA(const SlicingIndex& index, LogicalVector source) {
+ void collect_logicalNA(const SlicingIndex& index, LogicalVector /*source*/) {
SEXP* p_data = Rcpp::internal::r_vector_start<STRSXP>(data);
int n = index.size();
for (int i = 0; i < n; i++) {
@@ -291,7 +291,7 @@ public:
return Rf_inherits(x, type.get_cstring()) || all_logical_na(x, TYPEOF(x));
}
- inline bool can_promote(SEXP x) const {
+ inline bool can_promote(SEXP /*x*/) const {
return false;
}
@@ -331,7 +331,7 @@ public:
return Rf_inherits(x, "POSIXct") || all_logical_na(x, TYPEOF(x));
}
- inline bool can_promote(SEXP x) const {
+ inline bool can_promote(SEXP /*x*/) const {
return false;
}
@@ -386,7 +386,7 @@ public:
return Rf_inherits(x, "difftime") || all_logical_na(x, TYPEOF(x));
}
- inline bool can_promote(SEXP x) const {
+ inline bool can_promote(SEXP /*x*/) const {
return false;
}
@@ -508,7 +508,7 @@ public:
return true;
}
- void collect(const SlicingIndex& index, SEXP v, int offset = 0) {
+ void collect(const SlicingIndex& index, SEXP v, int /*offset = 0*/) {
if (Rf_inherits(v, "factor") && has_same_levels_as(v)) {
collect_factor(index, v);
} else if (all_logical_na(v, TYPEOF(v))) {
diff --git a/inst/include/dplyr/DataFrameColumnVisitor.h b/inst/include/dplyr/DataFrameColumnVisitor.h
index 4955cd2..479ccf6 100644
--- a/inst/include/dplyr/DataFrameColumnVisitor.h
+++ b/inst/include/dplyr/DataFrameColumnVisitor.h
@@ -37,7 +37,7 @@ public:
return "data.frame";
}
- bool is_na(int i) const {
+ bool is_na(int /*i*/) const {
return false;
}
diff --git a/inst/include/dplyr/MatrixColumnSubsetVectorVisitor.h b/inst/include/dplyr/MatrixColumnSubsetVectorVisitor.h
index 50d171e..add24bb 100644
--- a/inst/include/dplyr/MatrixColumnSubsetVectorVisitor.h
+++ b/inst/include/dplyr/MatrixColumnSubsetVectorVisitor.h
@@ -40,7 +40,7 @@ public:
return res;
}
- inline SEXP subset(EmptySubset index) const {
+ inline SEXP subset(EmptySubset /*index*/) const {
return Matrix<RTYPE>(0, data.ncol());
}
diff --git a/inst/include/dplyr/MatrixColumnVisitor.h b/inst/include/dplyr/MatrixColumnVisitor.h
index 0a2f8d1..a0adcf2 100644
--- a/inst/include/dplyr/MatrixColumnVisitor.h
+++ b/inst/include/dplyr/MatrixColumnVisitor.h
@@ -106,7 +106,7 @@ public:
return "matrix";
}
- bool is_na(int i) const {
+ bool is_na(int /*i*/) const {
return false;
}
diff --git a/inst/include/dplyr/OrderVisitorImpl.h b/inst/include/dplyr/OrderVisitorImpl.h
index 7fd5948..f2316fa 100644
--- a/inst/include/dplyr/OrderVisitorImpl.h
+++ b/inst/include/dplyr/OrderVisitorImpl.h
@@ -250,7 +250,7 @@ inline OrderVisitor* order_visitor_asc_matrix(SEXP vec) {
}
template <bool ascending>
-inline OrderVisitor* order_visitor_asc_vector(SEXP vec, const SymbolString& name) {
+inline OrderVisitor* order_visitor_asc_vector(SEXP vec, const SymbolString& /*name*/) {
switch (TYPEOF(vec)) {
case INTSXP:
return new OrderVectorVisitorImpl<INTSXP, ascending, Vector<INTSXP > >(vec);
diff --git a/inst/include/dplyr/Result/CallbackProcessor.h b/inst/include/dplyr/Result/CallbackProcessor.h
index 7213298..8109cce 100644
--- a/inst/include/dplyr/Result/CallbackProcessor.h
+++ b/inst/include/dplyr/Result/CallbackProcessor.h
@@ -45,7 +45,7 @@ public:
return obj()->process_chunk(df.get_index());
}
- virtual SEXP process(const SlicingIndex& index) {
+ virtual SEXP process(const SlicingIndex& /*index*/) {
return R_NilValue;
}
diff --git a/inst/include/dplyr/Result/ConstantResult.h b/inst/include/dplyr/Result/ConstantResult.h
index d518a06..de4f386 100644
--- a/inst/include/dplyr/Result/ConstantResult.h
+++ b/inst/include/dplyr/Result/ConstantResult.h
@@ -20,11 +20,11 @@ public:
return Vector<RTYPE>(gdf.ngroups(), value);
}
- virtual SEXP process(const FullDataFrame& df) {
+ virtual SEXP process(const FullDataFrame& /*df*/) {
return Vector<RTYPE>::create(value);
}
- virtual SEXP process(const SlicingIndex& index) {
+ virtual SEXP process(const SlicingIndex& /*index*/) {
return Vector<RTYPE>::create(value);
}
@@ -47,11 +47,11 @@ public:
return get(gdf.ngroups());
}
- virtual SEXP process(const FullDataFrame& df) {
+ virtual SEXP process(const FullDataFrame& /*df*/) {
return get(1);
}
- virtual SEXP process(const SlicingIndex& index) {
+ virtual SEXP process(const SlicingIndex& /*index*/) {
return get(1);
}
@@ -85,11 +85,11 @@ public:
return get(gdf.ngroups());
}
- virtual SEXP process(const FullDataFrame& df) {
+ virtual SEXP process(const FullDataFrame& /*df*/) {
return get(1);
}
- virtual SEXP process(const SlicingIndex& index) {
+ virtual SEXP process(const SlicingIndex& /*index*/) {
return get(1);
}
diff --git a/inst/include/dplyr/Result/DelayedProcessor.h b/inst/include/dplyr/Result/DelayedProcessor.h
index 3a444ed..400523e 100644
--- a/inst/include/dplyr/Result/DelayedProcessor.h
+++ b/inst/include/dplyr/Result/DelayedProcessor.h
@@ -181,7 +181,7 @@ public:
return true;
}
- virtual IDelayedProcessor* promote(const RObject& chunk) {
+ virtual IDelayedProcessor* promote(const RObject& /*chunk*/) {
return 0;
}
@@ -240,7 +240,7 @@ public:
return false;
}
- virtual IDelayedProcessor* promote(const RObject& chunk) {
+ virtual IDelayedProcessor* promote(const RObject& /*chunk*/) {
return 0;
}
diff --git a/inst/include/dplyr/Result/Rank.h b/inst/include/dplyr/Result/Rank.h
index 3bb9f61..b47f3d0 100644
--- a/inst/include/dplyr/Result/Rank.h
+++ b/inst/include/dplyr/Result/Rank.h
@@ -26,7 +26,7 @@ struct min_rank_increment {
}
template <typename Container>
- inline int pre_increment(const Container& x, int) const {
+ inline int pre_increment(const Container& /*x*/, int) const {
return 0;
}
@@ -66,7 +66,7 @@ struct percent_rank_increment {
}
template <typename Container>
- inline double pre_increment(const Container& x, int m) const {
+ inline double pre_increment(const Container& /*x*/, int /*m*/) const {
return 0.0;
}
@@ -82,7 +82,7 @@ struct cume_dist_increment {
typedef double scalar_type;
template <typename Container>
- inline double post_increment(const Container& x, int m) const {
+ inline double post_increment(const Container& /*x*/, int /*m*/) const {
return 0.0;
}
diff --git a/inst/include/dplyr/Result/Result.h b/inst/include/dplyr/Result/Result.h
index 8da9991..b09f122 100644
--- a/inst/include/dplyr/Result/Result.h
+++ b/inst/include/dplyr/Result/Result.h
@@ -20,7 +20,7 @@ public:
virtual SEXP process(const FullDataFrame& df) = 0;
- virtual SEXP process(const SlicingIndex& index) {
+ virtual SEXP process(const SlicingIndex& /*index*/) {
return R_NilValue;
}
diff --git a/inst/include/dplyr/RowwiseDataFrame.h b/inst/include/dplyr/RowwiseDataFrame.h
index d2d6025..9db114d 100644
--- a/inst/include/dplyr/RowwiseDataFrame.h
+++ b/inst/include/dplyr/RowwiseDataFrame.h
@@ -58,11 +58,11 @@ public:
return 0;
}
- inline SymbolString symbol(int i) {
+ inline SymbolString symbol(int /*i*/) {
stop("Rowwise data frames don't have grouping variables");
}
- inline SEXP label(int i) {
+ inline SEXP label(int /*i*/) {
return R_NilValue;
}
diff --git a/inst/include/tools/SlicingIndex.h b/inst/include/tools/SlicingIndex.h
index 7b18018..e5d77cc 100644
--- a/inst/include/tools/SlicingIndex.h
+++ b/inst/include/tools/SlicingIndex.h
@@ -9,7 +9,7 @@ public:
virtual int size() const = 0;
virtual int operator[](int i) const = 0;
virtual int group() const = 0;
- virtual bool is_identity(SEXP x) const {
+ virtual bool is_identity(SEXP /*x*/) const {
return FALSE;
};
};
diff --git a/inst/include/tools/SymbolString.h b/inst/include/tools/SymbolString.h
index 76a6d92..3582ecd 100644
--- a/inst/include/tools/SymbolString.h
+++ b/inst/include/tools/SymbolString.h
@@ -36,7 +36,7 @@ public:
return CHAR(STRING_ELT(utf8_string, 0));
}
- const bool is_empty() const {
+ /*const*/ bool is_empty() const {
return s == "";
}
diff --git a/src/hybrid_debug.cpp b/src/hybrid_debug.cpp
index 6580980..820b46c 100644
--- a/src/hybrid_debug.cpp
+++ b/src/hybrid_debug.cpp
@@ -36,7 +36,7 @@ private:
RObject x;
};
-Result* verify_hybrid_prototype(SEXP call, const ILazySubsets& subsets, int nargs) {
+Result* verify_hybrid_prototype(SEXP call, const ILazySubsets& /*subsets*/, int nargs) {
// if not exactly one arg, let R handle it
if (nargs != 1)
return 0;
@@ -74,7 +74,7 @@ private:
RObject x;
};
-Result* verify_not_hybrid_prototype(SEXP call, const ILazySubsets& subsets, int nargs) {
+Result* verify_not_hybrid_prototype(SEXP call, const ILazySubsets& /*subsets*/, int nargs) {
// if not exactly one arg, let R handle it
if (nargs != 1)
return 0;
diff --git a/src/mutate.cpp b/src/mutate.cpp
index 86d96e9..c3f5ec1 100644
--- a/src/mutate.cpp
+++ b/src/mutate.cpp
@@ -42,7 +42,7 @@ SEXP structure_mutate(const NamedListAccumulator<Data>& accumulator,
return res;
}
-void check_not_groups(const QuosureList& quosures, const RowwiseDataFrame& gdf) {}
+void check_not_groups(const QuosureList& /*quosures*/, const RowwiseDataFrame& /*gdf*/) {}
void check_not_groups(const QuosureList& quosures, const GroupedDataFrame& gdf) {
int n = quosures.size();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment