From 15011e0b7065243d1122e4eef9e5ba823264725e Mon Sep 17 00:00:00 2001 From: Jacques Lucke Date: Sun, 21 Nov 2021 12:57:34 +0100 Subject: Functions: use static string for parameter names The idea behind this change is the same as in rB6ee2abde82ef121cd6e927995053ac33afdbb438. A `MultiFunction::debug_parameter_name` method could be added separately when necessary. --- .../functions/FN_multi_function_signature.hh | 34 +++++++++++----------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'source/blender/functions/FN_multi_function_signature.hh') diff --git a/source/blender/functions/FN_multi_function_signature.hh b/source/blender/functions/FN_multi_function_signature.hh index 2ccaa60fed6..3c991bc9c56 100644 --- a/source/blender/functions/FN_multi_function_signature.hh +++ b/source/blender/functions/FN_multi_function_signature.hh @@ -38,7 +38,7 @@ struct MFSignature { * actually needed. */ const char *function_name; - Vector param_names; + Vector param_names; Vector param_types; Vector param_data_indices; bool depends_on_context = false; @@ -70,23 +70,23 @@ class MFSignatureBuilder { /* Input Parameter Types */ - template void single_input(StringRef name) + template void single_input(const char *name) { this->single_input(name, CPPType::get()); } - void single_input(StringRef name, const CPPType &type) + void single_input(const char *name, const CPPType &type) { this->input(name, MFDataType::ForSingle(type)); } - template void vector_input(StringRef name) + template void vector_input(const char *name) { this->vector_input(name, CPPType::get()); } - void vector_input(StringRef name, const CPPType &base_type) + void vector_input(const char *name, const CPPType &base_type) { this->input(name, MFDataType::ForVector(base_type)); } - void input(StringRef name, MFDataType data_type) + void input(const char *name, MFDataType data_type) { signature_.param_names.append(name); signature_.param_types.append(MFParamType(MFParamType::Input, data_type)); @@ -103,23 +103,23 @@ class MFSignatureBuilder { /* Output Parameter Types */ - template void single_output(StringRef name) + template void single_output(const char *name) { this->single_output(name, CPPType::get()); } - void single_output(StringRef name, const CPPType &type) + void single_output(const char *name, const CPPType &type) { this->output(name, MFDataType::ForSingle(type)); } - template void vector_output(StringRef name) + template void vector_output(const char *name) { this->vector_output(name, CPPType::get()); } - void vector_output(StringRef name, const CPPType &base_type) + void vector_output(const char *name, const CPPType &base_type) { this->output(name, MFDataType::ForVector(base_type)); } - void output(StringRef name, MFDataType data_type) + void output(const char *name, MFDataType data_type) { signature_.param_names.append(name); signature_.param_types.append(MFParamType(MFParamType::Output, data_type)); @@ -136,23 +136,23 @@ class MFSignatureBuilder { /* Mutable Parameter Types */ - template void single_mutable(StringRef name) + template void single_mutable(const char *name) { this->single_mutable(name, CPPType::get()); } - void single_mutable(StringRef name, const CPPType &type) + void single_mutable(const char *name, const CPPType &type) { this->mutable_(name, MFDataType::ForSingle(type)); } - template void vector_mutable(StringRef name) + template void vector_mutable(const char *name) { this->vector_mutable(name, CPPType::get()); } - void vector_mutable(StringRef name, const CPPType &base_type) + void vector_mutable(const char *name, const CPPType &base_type) { this->mutable_(name, MFDataType::ForVector(base_type)); } - void mutable_(StringRef name, MFDataType data_type) + void mutable_(const char *name, MFDataType data_type) { signature_.param_names.append(name); signature_.param_types.append(MFParamType(MFParamType::Mutable, data_type)); @@ -167,7 +167,7 @@ class MFSignatureBuilder { } } - void add(StringRef name, const MFParamType ¶m_type) + void add(const char *name, const MFParamType ¶m_type) { switch (param_type.interface_type()) { case MFParamType::Input: -- cgit v1.2.3