diff options
author | Hans Goudey <h.goudey@me.com> | 2022-10-04 01:37:25 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2022-10-04 01:38:16 +0300 |
commit | 97746129d5870beedc40e3c035c7982ce8a6bebc (patch) | |
tree | b819b8e7875e6684aad7ea1f6bb7922d4fa1c8fc /source/blender/functions | |
parent | ed7f5713f8f9d605e3cd4cce42e40fb5c6bf4bf5 (diff) |
Cleanup: replace UNUSED macro with commented args in C++ code
This is the conventional way of dealing with unused arguments in C++,
since it works on all compilers.
Regex find and replace: `UNUSED\((\w+)\)` -> `/*$1*/`
Diffstat (limited to 'source/blender/functions')
11 files changed, 29 insertions, 31 deletions
diff --git a/source/blender/functions/FN_field.hh b/source/blender/functions/FN_field.hh index bf2fbfa3f3c..bff9c77ef7d 100644 --- a/source/blender/functions/FN_field.hh +++ b/source/blender/functions/FN_field.hh @@ -412,7 +412,7 @@ class FieldEvaluator : NonMovable, NonCopyable { const int field_index = fields_to_evaluate_.append_and_get_index(std::move(field)); dst_varrays_.append({}); output_pointer_infos_.append(OutputPointerInfo{ - varray_ptr, [](void *dst, const GVArray &varray, ResourceScope &UNUSED(scope)) { + varray_ptr, [](void *dst, const GVArray &varray, ResourceScope & /*scope*/) { *(VArray<T> *)dst = varray.typed<T>(); }}); return field_index; diff --git a/source/blender/functions/FN_multi_function.hh b/source/blender/functions/FN_multi_function.hh index accbaf899be..7089f6895a7 100644 --- a/source/blender/functions/FN_multi_function.hh +++ b/source/blender/functions/FN_multi_function.hh @@ -60,7 +60,7 @@ class MultiFunction { return get_default_hash(this); } - virtual bool equals(const MultiFunction &UNUSED(other)) const + virtual bool equals(const MultiFunction & /*other*/) const { return false; } diff --git a/source/blender/functions/FN_multi_function_builder.hh b/source/blender/functions/FN_multi_function_builder.hh index 75a2414801d..eeadb1938bb 100644 --- a/source/blender/functions/FN_multi_function_builder.hh +++ b/source/blender/functions/FN_multi_function_builder.hh @@ -413,7 +413,7 @@ template<typename... ParamTags> class CustomMF : public MultiFunction { ...); } - void call(IndexMask mask, MFParams params, MFContext UNUSED(context)) const override + void call(IndexMask mask, MFParams params, MFContext /*context*/) const override { fn_(mask, params); } @@ -571,7 +571,7 @@ template<typename Mut1> class CustomMF_SM : public MultiFunction { }; } - void call(IndexMask mask, MFParams params, MFContext UNUSED(context)) const override + void call(IndexMask mask, MFParams params, MFContext /*context*/) const override { MutableSpan<Mut1> mut1 = params.single_mutable<Mut1>(0); function_(mask, mut1); @@ -631,7 +631,7 @@ template<typename T> class CustomMF_Constant : public MultiFunction { this->set_signature(&signature_); } - void call(IndexMask mask, MFParams params, MFContext UNUSED(context)) const override + void call(IndexMask mask, MFParams params, MFContext /*context*/) const override { MutableSpan<T> output = params.uninitialized_single_output<T>(0); mask.to_best_mask_type([&](const auto &mask) { diff --git a/source/blender/functions/intern/field.cc b/source/blender/functions/intern/field.cc index dca12859b72..d2205864945 100644 --- a/source/blender/functions/intern/field.cc +++ b/source/blender/functions/intern/field.cc @@ -552,9 +552,9 @@ GVArray IndexFieldInput::get_index_varray(IndexMask mask) return VArray<int>::ForFunc(mask.min_array_size(), index_func); } -GVArray IndexFieldInput::get_varray_for_context(const fn::FieldContext &UNUSED(context), +GVArray IndexFieldInput::get_varray_for_context(const fn::FieldContext & /*context*/, IndexMask mask, - ResourceScope &UNUSED(scope)) const + ResourceScope & /*scope*/) const { /* TODO: Investigate a similar method to IndexRange::as_span() */ return get_index_varray(mask); @@ -743,7 +743,7 @@ int FieldEvaluator::add(GField field, GVArray *varray_ptr) const int field_index = fields_to_evaluate_.append_and_get_index(std::move(field)); dst_varrays_.append(nullptr); output_pointer_infos_.append(OutputPointerInfo{ - varray_ptr, [](void *dst, const GVArray &varray, ResourceScope &UNUSED(scope)) { + varray_ptr, [](void *dst, const GVArray &varray, ResourceScope & /*scope*/) { *static_cast<GVArray *>(dst) = varray; }}); return field_index; diff --git a/source/blender/functions/intern/lazy_function.cc b/source/blender/functions/intern/lazy_function.cc index 2d69af84f85..f1c53a04b3f 100644 --- a/source/blender/functions/intern/lazy_function.cc +++ b/source/blender/functions/intern/lazy_function.cc @@ -25,7 +25,7 @@ std::string LazyFunction::output_name(int index) const return outputs_[index].debug_name; } -void *LazyFunction::init_storage(LinearAllocator<> &UNUSED(allocator)) const +void *LazyFunction::init_storage(LinearAllocator<> & /*allocator*/) const { return nullptr; } diff --git a/source/blender/functions/intern/multi_function_builder.cc b/source/blender/functions/intern/multi_function_builder.cc index 8a09ed37e19..32a41f99c48 100644 --- a/source/blender/functions/intern/multi_function_builder.cc +++ b/source/blender/functions/intern/multi_function_builder.cc @@ -32,9 +32,7 @@ CustomMF_GenericConstant::~CustomMF_GenericConstant() } } -void CustomMF_GenericConstant::call(IndexMask mask, - MFParams params, - MFContext UNUSED(context)) const +void CustomMF_GenericConstant::call(IndexMask mask, MFParams params, MFContext /*context*/) const { GMutableSpan output = params.uninitialized_single_output(0); type_.fill_construct_indices(value_, output.data(), mask); @@ -68,7 +66,7 @@ CustomMF_GenericConstantArray::CustomMF_GenericConstantArray(GSpan array) : arra void CustomMF_GenericConstantArray::call(IndexMask mask, MFParams params, - MFContext UNUSED(context)) const + MFContext /*context*/) const { GVectorArray &vectors = params.vector_output(0); for (int64_t i : mask) { @@ -90,7 +88,7 @@ CustomMF_DefaultOutput::CustomMF_DefaultOutput(Span<MFDataType> input_types, signature_ = signature.build(); this->set_signature(&signature_); } -void CustomMF_DefaultOutput::call(IndexMask mask, MFParams params, MFContext UNUSED(context)) const +void CustomMF_DefaultOutput::call(IndexMask mask, MFParams params, MFContext /*context*/) const { for (int param_index : this->param_indices()) { MFParamType param_type = this->param_type(param_index); @@ -115,7 +113,7 @@ CustomMF_GenericCopy::CustomMF_GenericCopy(MFDataType data_type) this->set_signature(&signature_); } -void CustomMF_GenericCopy::call(IndexMask mask, MFParams params, MFContext UNUSED(context)) const +void CustomMF_GenericCopy::call(IndexMask mask, MFParams params, MFContext /*context*/) const { const MFDataType data_type = this->param_type(0).data_type(); switch (data_type.category()) { diff --git a/source/blender/functions/intern/multi_function_procedure.cc b/source/blender/functions/intern/multi_function_procedure.cc index 7ad324a9574..b78787de57c 100644 --- a/source/blender/functions/intern/multi_function_procedure.cc +++ b/source/blender/functions/intern/multi_function_procedure.cc @@ -801,12 +801,12 @@ class MFProcedureDotExport { variable_to_string(instruction.variable(), ss); } - void instruction_to_string(const MFDummyInstruction &UNUSED(instruction), std::stringstream &ss) + void instruction_to_string(const MFDummyInstruction & /*instruction*/, std::stringstream &ss) { instruction_name_format("Dummy ", ss); } - void instruction_to_string(const MFReturnInstruction &UNUSED(instruction), std::stringstream &ss) + void instruction_to_string(const MFReturnInstruction & /*instruction*/, std::stringstream &ss) { instruction_name_format("Return ", ss); diff --git a/source/blender/functions/tests/FN_field_test.cc b/source/blender/functions/tests/FN_field_test.cc index ea3c0471411..8c5cc817174 100644 --- a/source/blender/functions/tests/FN_field_test.cc +++ b/source/blender/functions/tests/FN_field_test.cc @@ -34,9 +34,9 @@ class IndexFieldInput final : public FieldInput { { } - GVArray get_varray_for_context(const FieldContext &UNUSED(context), + GVArray get_varray_for_context(const FieldContext & /*context*/, IndexMask mask, - ResourceScope &UNUSED(scope)) const final + ResourceScope & /*scope*/) const final { auto index_func = [](int i) { return i; }; return VArray<int>::ForFunc(mask.min_array_size(), index_func); @@ -171,7 +171,7 @@ class TwoOutputFunction : public MultiFunction { this->set_signature(&signature_); } - void call(IndexMask mask, MFParams params, MFContext UNUSED(context)) const override + void call(IndexMask mask, MFParams params, MFContext /*context*/) const override { const VArray<int> &in1 = params.readonly_single_input<int>(0, "In1"); const VArray<int> &in2 = params.readonly_single_input<int>(1, "In2"); diff --git a/source/blender/functions/tests/FN_lazy_function_test.cc b/source/blender/functions/tests/FN_lazy_function_test.cc index 8df064cd8a6..dc1c698598d 100644 --- a/source/blender/functions/tests/FN_lazy_function_test.cc +++ b/source/blender/functions/tests/FN_lazy_function_test.cc @@ -21,7 +21,7 @@ class AddLazyFunction : public LazyFunction { outputs_.append({"Result", CPPType::get<int>()}); } - void execute_impl(Params ¶ms, const Context &UNUSED(context)) const override + void execute_impl(Params ¶ms, const Context & /*context*/) const override { const int a = params.get_input<int>(0); const int b = params.get_input<int>(1); @@ -42,7 +42,7 @@ class StoreValueFunction : public LazyFunction { inputs_.append({"B", CPPType::get<int>(), ValueUsage::Maybe}); } - void execute_impl(Params ¶ms, const Context &UNUSED(context)) const override + void execute_impl(Params ¶ms, const Context & /*context*/) const override { *dst1_ = params.get_input<int>(0); if (int *value = params.try_get_input_data_ptr_or_request<int>(1)) { @@ -62,7 +62,7 @@ class SimpleSideEffectProvider : public GraphExecutor::SideEffectProvider { } Vector<const FunctionNode *> get_nodes_with_side_effects( - const Context &UNUSED(context)) const override + const Context & /*context*/) const override { return side_effect_nodes_; } diff --git a/source/blender/functions/tests/FN_multi_function_test.cc b/source/blender/functions/tests/FN_multi_function_test.cc index c82cde2abce..ca788b0a6ee 100644 --- a/source/blender/functions/tests/FN_multi_function_test.cc +++ b/source/blender/functions/tests/FN_multi_function_test.cc @@ -26,7 +26,7 @@ class AddFunction : public MultiFunction { return signature.build(); } - void call(IndexMask mask, MFParams params, MFContext UNUSED(context)) const override + void call(IndexMask mask, MFParams params, MFContext /*context*/) const override { const VArray<int> &a = params.readonly_single_input<int>(0, "A"); const VArray<int> &b = params.readonly_single_input<int>(1, "B"); diff --git a/source/blender/functions/tests/FN_multi_function_test_common.hh b/source/blender/functions/tests/FN_multi_function_test_common.hh index a01a3fa27c6..15e8baf2001 100644 --- a/source/blender/functions/tests/FN_multi_function_test_common.hh +++ b/source/blender/functions/tests/FN_multi_function_test_common.hh @@ -20,7 +20,7 @@ class AddPrefixFunction : public MultiFunction { return signature.build(); } - void call(IndexMask mask, MFParams params, MFContext UNUSED(context)) const override + void call(IndexMask mask, MFParams params, MFContext /*context*/) const override { const VArray<std::string> &prefixes = params.readonly_single_input<std::string>(0, "Prefix"); MutableSpan<std::string> strings = params.single_mutable<std::string>(1, "Strings"); @@ -47,7 +47,7 @@ class CreateRangeFunction : public MultiFunction { return signature.build(); } - void call(IndexMask mask, MFParams params, MFContext UNUSED(context)) const override + void call(IndexMask mask, MFParams params, MFContext /*context*/) const override { const VArray<int> &sizes = params.readonly_single_input<int>(0, "Size"); GVectorArray &ranges = params.vector_output(1, "Range"); @@ -75,7 +75,7 @@ class GenericAppendFunction : public MultiFunction { this->set_signature(&signature_); } - void call(IndexMask mask, MFParams params, MFContext UNUSED(context)) const override + void call(IndexMask mask, MFParams params, MFContext /*context*/) const override { GVectorArray &vectors = params.vector_mutable(0, "Vector"); const GVArray &values = params.readonly_single_input(1, "Value"); @@ -105,7 +105,7 @@ class ConcatVectorsFunction : public MultiFunction { return signature.build(); } - void call(IndexMask mask, MFParams params, MFContext UNUSED(context)) const override + void call(IndexMask mask, MFParams params, MFContext /*context*/) const override { GVectorArray &a = params.vector_mutable(0); const GVVectorArray &b = params.readonly_vector_input(1); @@ -129,7 +129,7 @@ class AppendFunction : public MultiFunction { return signature.build(); } - void call(IndexMask mask, MFParams params, MFContext UNUSED(context)) const override + void call(IndexMask mask, MFParams params, MFContext /*context*/) const override { GVectorArray_TypedMutableRef<int> vectors = params.vector_mutable<int>(0); const VArray<int> &values = params.readonly_single_input<int>(1); @@ -156,7 +156,7 @@ class SumVectorFunction : public MultiFunction { return signature.build(); } - void call(IndexMask mask, MFParams params, MFContext UNUSED(context)) const override + void call(IndexMask mask, MFParams params, MFContext /*context*/) const override { const VVectorArray<int> &vectors = params.readonly_vector_input<int>(0); MutableSpan<int> sums = params.uninitialized_single_output<int>(1); @@ -187,7 +187,7 @@ class OptionalOutputsFunction : public MultiFunction { return signature.build(); } - void call(IndexMask mask, MFParams params, MFContext UNUSED(context)) const override + void call(IndexMask mask, MFParams params, MFContext /*context*/) const override { if (params.single_output_is_required(0, "Out 1")) { MutableSpan<int> values = params.uninitialized_single_output<int>(0, "Out 1"); |