Style: Remove redundant DEBUG_METHODS_ENABLED

• Replaced with functionally identical and far more ubiquitous `DEBUG_ENABLED`
This commit is contained in:
Thaddeus Crews 2025-05-15 13:09:41 -05:00
parent 5e27318b6c
commit d237e31a89
No known key found for this signature in database
GPG key ID: 8C6E5FEB5FC03CCC
25 changed files with 328 additions and 337 deletions

View file

@ -166,7 +166,7 @@ struct VariantObjectClassChecker<const Ref<T> &> {
}
};
#ifdef DEBUG_METHODS_ENABLED
#ifdef DEBUG_ENABLED
template <typename T>
struct VariantCasterAndValidate {
@ -213,17 +213,17 @@ struct VariantCasterAndValidate<const T &> {
}
};
#endif // DEBUG_METHODS_ENABLED
#endif // DEBUG_ENABLED
template <typename T, typename... P, size_t... Is>
void call_with_variant_args_helper(T *p_instance, void (T::*p_method)(P...), const Variant **p_args, Callable::CallError &r_error, IndexSequence<Is...>) {
r_error.error = Callable::CallError::CALL_OK;
#ifdef DEBUG_METHODS_ENABLED
#ifdef DEBUG_ENABLED
(p_instance->*p_method)(VariantCasterAndValidate<P>::cast(p_args, Is, r_error)...);
#else
(p_instance->*p_method)(VariantCaster<P>::cast(*p_args[Is])...);
#endif
#endif // DEBUG_ENABLED
(void)(p_args); //avoid warning
}
@ -231,11 +231,11 @@ template <typename T, typename... P, size_t... Is>
void call_with_variant_argsc_helper(T *p_instance, void (T::*p_method)(P...) const, const Variant **p_args, Callable::CallError &r_error, IndexSequence<Is...>) {
r_error.error = Callable::CallError::CALL_OK;
#ifdef DEBUG_METHODS_ENABLED
#ifdef DEBUG_ENABLED
(p_instance->*p_method)(VariantCasterAndValidate<P>::cast(p_args, Is, r_error)...);
#else
(p_instance->*p_method)(VariantCaster<P>::cast(*p_args[Is])...);
#endif
#endif // DEBUG_ENABLED
(void)(p_args); //avoid warning
}
@ -321,7 +321,7 @@ void call_with_validated_variant_args_static_method_helper(void (*p_method)(P...
template <typename T, typename... P>
void call_with_variant_args(T *p_instance, void (T::*p_method)(P...), const Variant **p_args, int p_argcount, Callable::CallError &r_error) {
#ifdef DEBUG_METHODS_ENABLED
#ifdef DEBUG_ENABLED
if ((size_t)p_argcount > sizeof...(P)) {
r_error.error = Callable::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS;
r_error.expected = sizeof...(P);
@ -333,7 +333,7 @@ void call_with_variant_args(T *p_instance, void (T::*p_method)(P...), const Vari
r_error.expected = sizeof...(P);
return;
}
#endif
#endif // DEBUG_ENABLED
call_with_variant_args_helper<T, P...>(p_instance, p_method, p_args, r_error, BuildIndexSequence<sizeof...(P)>{});
}
@ -345,7 +345,7 @@ void call_with_variant_args_dv(T *p_instance, void (T::*p_method)(P...), const V
r_error.expected = sizeof...(P);
return;
}
#endif
#endif // DEBUG_ENABLED
int32_t missing = (int32_t)sizeof...(P) - (int32_t)p_argcount;
@ -356,7 +356,7 @@ void call_with_variant_args_dv(T *p_instance, void (T::*p_method)(P...), const V
r_error.expected = sizeof...(P);
return;
}
#endif
#endif // DEBUG_ENABLED
const Variant *args[sizeof...(P) == 0 ? 1 : sizeof...(P)]; //avoid zero sized array
for (int32_t i = 0; i < (int32_t)sizeof...(P); i++) {
@ -372,7 +372,7 @@ void call_with_variant_args_dv(T *p_instance, void (T::*p_method)(P...), const V
template <typename T, typename... P>
void call_with_variant_argsc(T *p_instance, void (T::*p_method)(P...) const, const Variant **p_args, int p_argcount, Callable::CallError &r_error) {
#ifdef DEBUG_METHODS_ENABLED
#ifdef DEBUG_ENABLED
if ((size_t)p_argcount > sizeof...(P)) {
r_error.error = Callable::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS;
r_error.expected = sizeof...(P);
@ -384,7 +384,7 @@ void call_with_variant_argsc(T *p_instance, void (T::*p_method)(P...) const, con
r_error.expected = sizeof...(P);
return;
}
#endif
#endif // DEBUG_ENABLED
call_with_variant_argsc_helper<T, P...>(p_instance, p_method, p_args, r_error, BuildIndexSequence<sizeof...(P)>{});
}
@ -396,7 +396,7 @@ void call_with_variant_argsc_dv(T *p_instance, void (T::*p_method)(P...) const,
r_error.expected = sizeof...(P);
return;
}
#endif
#endif // DEBUG_ENABLED
int32_t missing = (int32_t)sizeof...(P) - (int32_t)p_argcount;
@ -407,7 +407,7 @@ void call_with_variant_argsc_dv(T *p_instance, void (T::*p_method)(P...) const,
r_error.expected = sizeof...(P);
return;
}
#endif
#endif // DEBUG_ENABLED
const Variant *args[sizeof...(P) == 0 ? 1 : sizeof...(P)]; //avoid zero sized array
for (int32_t i = 0; i < (int32_t)sizeof...(P); i++) {
@ -429,7 +429,7 @@ void call_with_variant_args_ret_dv(T *p_instance, R (T::*p_method)(P...), const
r_error.expected = sizeof...(P);
return;
}
#endif
#endif // DEBUG_ENABLED
int32_t missing = (int32_t)sizeof...(P) - (int32_t)p_argcount;
@ -440,7 +440,7 @@ void call_with_variant_args_ret_dv(T *p_instance, R (T::*p_method)(P...), const
r_error.expected = sizeof...(P);
return;
}
#endif
#endif // DEBUG_ENABLED
const Variant *args[sizeof...(P) == 0 ? 1 : sizeof...(P)]; //avoid zero sized array
for (int32_t i = 0; i < (int32_t)sizeof...(P); i++) {
@ -462,7 +462,7 @@ void call_with_variant_args_retc_dv(T *p_instance, R (T::*p_method)(P...) const,
r_error.expected = sizeof...(P);
return;
}
#endif
#endif // DEBUG_ENABLED
int32_t missing = (int32_t)sizeof...(P) - (int32_t)p_argcount;
@ -473,7 +473,7 @@ void call_with_variant_args_retc_dv(T *p_instance, R (T::*p_method)(P...) const,
r_error.expected = sizeof...(P);
return;
}
#endif
#endif // DEBUG_ENABLED
const Variant *args[sizeof...(P) == 0 ? 1 : sizeof...(P)]; //avoid zero sized array
for (int32_t i = 0; i < (int32_t)sizeof...(P); i++) {
@ -638,7 +638,7 @@ void call_get_argument_type_info(int p_arg, PropertyInfo &info) {
(void)index; // Suppress GCC warning.
}
#ifdef DEBUG_METHODS_ENABLED
#ifdef DEBUG_ENABLED
template <typename Q>
void call_get_argument_metadata_helper(int p_arg, int &index, GodotTypeInfo::Metadata &md) {
if (p_arg == index) {
@ -660,7 +660,7 @@ GodotTypeInfo::Metadata call_get_argument_metadata(int p_arg) {
return md;
}
#endif // DEBUG_METHODS_ENABLED
#endif // DEBUG_ENABLED
//////////////////////
@ -668,7 +668,7 @@ template <typename T, typename R, typename... P, size_t... Is>
void call_with_variant_args_ret_helper(T *p_instance, R (T::*p_method)(P...), const Variant **p_args, Variant &r_ret, Callable::CallError &r_error, IndexSequence<Is...>) {
r_error.error = Callable::CallError::CALL_OK;
#ifdef DEBUG_METHODS_ENABLED
#ifdef DEBUG_ENABLED
r_ret = (p_instance->*p_method)(VariantCasterAndValidate<P>::cast(p_args, Is, r_error)...);
#else
r_ret = (p_instance->*p_method)(VariantCaster<P>::cast(*p_args[Is])...);
@ -679,27 +679,27 @@ template <typename R, typename... P, size_t... Is>
void call_with_variant_args_static_ret(R (*p_method)(P...), const Variant **p_args, Variant &r_ret, Callable::CallError &r_error, IndexSequence<Is...>) {
r_error.error = Callable::CallError::CALL_OK;
#ifdef DEBUG_METHODS_ENABLED
#ifdef DEBUG_ENABLED
r_ret = (p_method)(VariantCasterAndValidate<P>::cast(p_args, Is, r_error)...);
#else
r_ret = (p_method)(VariantCaster<P>::cast(*p_args[Is])...);
#endif
#endif // DEBUG_ENABLED
}
template <typename... P, size_t... Is>
void call_with_variant_args_static(void (*p_method)(P...), const Variant **p_args, Callable::CallError &r_error, IndexSequence<Is...>) {
r_error.error = Callable::CallError::CALL_OK;
#ifdef DEBUG_METHODS_ENABLED
#ifdef DEBUG_ENABLED
(p_method)(VariantCasterAndValidate<P>::cast(p_args, Is, r_error)...);
#else
(p_method)(VariantCaster<P>::cast(*p_args[Is])...);
#endif
#endif // DEBUG_ENABLED
}
template <typename T, typename R, typename... P>
void call_with_variant_args_ret(T *p_instance, R (T::*p_method)(P...), const Variant **p_args, int p_argcount, Variant &r_ret, Callable::CallError &r_error) {
#ifdef DEBUG_METHODS_ENABLED
#ifdef DEBUG_ENABLED
if ((size_t)p_argcount > sizeof...(P)) {
r_error.error = Callable::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS;
r_error.expected = sizeof...(P);
@ -711,7 +711,7 @@ void call_with_variant_args_ret(T *p_instance, R (T::*p_method)(P...), const Var
r_error.expected = sizeof...(P);
return;
}
#endif
#endif // DEBUG_ENABLED
call_with_variant_args_ret_helper<T, R, P...>(p_instance, p_method, p_args, r_ret, r_error, BuildIndexSequence<sizeof...(P)>{});
}
@ -719,17 +719,17 @@ template <typename T, typename R, typename... P, size_t... Is>
void call_with_variant_args_retc_helper(T *p_instance, R (T::*p_method)(P...) const, const Variant **p_args, Variant &r_ret, Callable::CallError &r_error, IndexSequence<Is...>) {
r_error.error = Callable::CallError::CALL_OK;
#ifdef DEBUG_METHODS_ENABLED
#ifdef DEBUG_ENABLED
r_ret = (p_instance->*p_method)(VariantCasterAndValidate<P>::cast(p_args, Is, r_error)...);
#else
r_ret = (p_instance->*p_method)(VariantCaster<P>::cast(*p_args[Is])...);
#endif
#endif // DEBUG_ENABLED
(void)p_args;
}
template <typename R, typename... P>
void call_with_variant_args_static_ret(R (*p_method)(P...), const Variant **p_args, int p_argcount, Variant &r_ret, Callable::CallError &r_error) {
#ifdef DEBUG_METHODS_ENABLED
#ifdef DEBUG_ENABLED
if ((size_t)p_argcount > sizeof...(P)) {
r_error.error = Callable::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS;
r_error.expected = sizeof...(P);
@ -741,13 +741,13 @@ void call_with_variant_args_static_ret(R (*p_method)(P...), const Variant **p_ar
r_error.expected = sizeof...(P);
return;
}
#endif
#endif // DEBUG_ENABLED
call_with_variant_args_static_ret<R, P...>(p_method, p_args, r_ret, r_error, BuildIndexSequence<sizeof...(P)>{});
}
template <typename... P>
void call_with_variant_args_static(void (*p_method)(P...), const Variant **p_args, int p_argcount, Callable::CallError &r_error) {
#ifdef DEBUG_METHODS_ENABLED
#ifdef DEBUG_ENABLED
if ((size_t)p_argcount > sizeof...(P)) {
r_error.error = Callable::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS;
r_error.expected = sizeof...(P);
@ -759,13 +759,13 @@ void call_with_variant_args_static(void (*p_method)(P...), const Variant **p_arg
r_error.expected = sizeof...(P);
return;
}
#endif
#endif // DEBUG_ENABLED
call_with_variant_args_static<P...>(p_method, p_args, r_error, BuildIndexSequence<sizeof...(P)>{});
}
template <typename T, typename R, typename... P>
void call_with_variant_args_retc(T *p_instance, R (T::*p_method)(P...) const, const Variant **p_args, int p_argcount, Variant &r_ret, Callable::CallError &r_error) {
#ifdef DEBUG_METHODS_ENABLED
#ifdef DEBUG_ENABLED
if ((size_t)p_argcount > sizeof...(P)) {
r_error.error = Callable::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS;
r_error.expected = sizeof...(P);
@ -777,7 +777,7 @@ void call_with_variant_args_retc(T *p_instance, R (T::*p_method)(P...) const, co
r_error.expected = sizeof...(P);
return;
}
#endif
#endif // DEBUG_ENABLED
call_with_variant_args_retc_helper<T, R, P...>(p_instance, p_method, p_args, r_ret, r_error, BuildIndexSequence<sizeof...(P)>{});
}
@ -785,11 +785,11 @@ template <typename T, typename R, typename... P, size_t... Is>
void call_with_variant_args_retc_static_helper(T *p_instance, R (*p_method)(T *, P...), const Variant **p_args, Variant &r_ret, Callable::CallError &r_error, IndexSequence<Is...>) {
r_error.error = Callable::CallError::CALL_OK;
#ifdef DEBUG_METHODS_ENABLED
#ifdef DEBUG_ENABLED
r_ret = (p_method)(p_instance, VariantCasterAndValidate<P>::cast(p_args, Is, r_error)...);
#else
r_ret = (p_method)(p_instance, VariantCaster<P>::cast(*p_args[Is])...);
#endif
#endif // DEBUG_ENABLED
(void)p_args;
}
@ -802,7 +802,7 @@ void call_with_variant_args_retc_static_helper_dv(T *p_instance, R (*p_method)(T
r_error.expected = sizeof...(P);
return;
}
#endif
#endif // DEBUG_ENABLED
int32_t missing = (int32_t)sizeof...(P) - (int32_t)p_argcount;
@ -813,7 +813,7 @@ void call_with_variant_args_retc_static_helper_dv(T *p_instance, R (*p_method)(T
r_error.expected = sizeof...(P);
return;
}
#endif
#endif // DEBUG_ENABLED
const Variant *args[sizeof...(P) == 0 ? 1 : sizeof...(P)]; //avoid zero sized array
for (int32_t i = 0; i < (int32_t)sizeof...(P); i++) {
@ -831,11 +831,11 @@ template <typename T, typename... P, size_t... Is>
void call_with_variant_args_static_helper(T *p_instance, void (*p_method)(T *, P...), const Variant **p_args, Callable::CallError &r_error, IndexSequence<Is...>) {
r_error.error = Callable::CallError::CALL_OK;
#ifdef DEBUG_METHODS_ENABLED
#ifdef DEBUG_ENABLED
(p_method)(p_instance, VariantCasterAndValidate<P>::cast(p_args, Is, r_error)...);
#else
(p_method)(p_instance, VariantCaster<P>::cast(*p_args[Is])...);
#endif
#endif // DEBUG_ENABLED
(void)p_args;
}
@ -848,7 +848,7 @@ void call_with_variant_args_static_helper_dv(T *p_instance, void (*p_method)(T *
r_error.expected = sizeof...(P);
return;
}
#endif
#endif // DEBUG_ENABLED
int32_t missing = (int32_t)sizeof...(P) - (int32_t)p_argcount;
@ -859,7 +859,7 @@ void call_with_variant_args_static_helper_dv(T *p_instance, void (*p_method)(T *
r_error.expected = sizeof...(P);
return;
}
#endif
#endif // DEBUG_ENABLED
const Variant *args[sizeof...(P) == 0 ? 1 : sizeof...(P)]; //avoid zero sized array
for (int32_t i = 0; i < (int32_t)sizeof...(P); i++) {
@ -881,7 +881,7 @@ void call_with_variant_args_static_ret_dv(R (*p_method)(P...), const Variant **p
r_error.expected = sizeof...(P);
return;
}
#endif
#endif // DEBUG_ENABLED
int32_t missing = (int32_t)sizeof...(P) - (int32_t)p_argcount;
@ -892,7 +892,7 @@ void call_with_variant_args_static_ret_dv(R (*p_method)(P...), const Variant **p
r_error.expected = sizeof...(P);
return;
}
#endif
#endif // DEBUG_ENABLED
const Variant *args[sizeof...(P) == 0 ? 1 : sizeof...(P)]; //avoid zero sized array
for (int32_t i = 0; i < (int32_t)sizeof...(P); i++) {
@ -914,7 +914,7 @@ void call_with_variant_args_static_dv(void (*p_method)(P...), const Variant **p_
r_error.expected = sizeof...(P);
return;
}
#endif
#endif // DEBUG_ENABLED
int32_t missing = (int32_t)sizeof...(P) - (int32_t)p_argcount;
@ -925,7 +925,7 @@ void call_with_variant_args_static_dv(void (*p_method)(P...), const Variant **p_
r_error.expected = sizeof...(P);
return;
}
#endif
#endif // DEBUG_ENABLED
const Variant *args[sizeof...(P) == 0 ? 1 : sizeof...(P)]; //avoid zero sized array
for (int32_t i = 0; i < (int32_t)sizeof...(P); i++) {

View file

@ -1158,11 +1158,11 @@ struct _VariantCall {
HashMap<StringName, int64_t> value;
#ifdef DEBUG_ENABLED
List<StringName> value_ordered;
#endif
#endif // DEBUG_ENABLED
HashMap<StringName, Variant> variant_value;
#ifdef DEBUG_ENABLED
List<StringName> variant_value_ordered;
#endif
#endif // DEBUG_ENABLED
};
static ConstantData *constant_data;
@ -1172,18 +1172,18 @@ struct _VariantCall {
ERR_FAIL_COND(constant_data[p_type].value.has(p_constant_name));
ERR_FAIL_COND(enum_data[p_type].value.has(p_constant_name));
ERR_FAIL_COND(enum_data[p_type].value_to_enum.has(p_constant_name));
#endif
#endif // DEBUG_ENABLED
constant_data[p_type].value[p_constant_name] = p_constant_value;
#ifdef DEBUG_ENABLED
constant_data[p_type].value_ordered.push_back(p_constant_name);
#endif
#endif // DEBUG_ENABLED
}
static void add_variant_constant(int p_type, const StringName &p_constant_name, const Variant &p_constant_value) {
constant_data[p_type].variant_value[p_constant_name] = p_constant_value;
#ifdef DEBUG_ENABLED
constant_data[p_type].variant_value_ordered.push_back(p_constant_name);
#endif
#endif // DEBUG_ENABLED
}
struct EnumData {
@ -1198,7 +1198,7 @@ struct _VariantCall {
ERR_FAIL_COND(constant_data[p_type].value.has(p_enumeration_name));
ERR_FAIL_COND(enum_data[p_type].value.has(p_enumeration_name));
ERR_FAIL_COND(enum_data[p_type].value_to_enum.has(p_enumeration_name));
#endif
#endif // DEBUG_ENABLED
enum_data[p_type].value[p_enum_type_name][p_enumeration_name] = p_enum_value;
enum_data[p_type].value_to_enum[p_enumeration_name] = p_enum_type_name;
}
@ -1246,11 +1246,11 @@ struct VariantBuiltInMethodInfo {
for (int i = 0; i < argument_count; i++) {
PropertyInfo pi;
#ifdef DEBUG_METHODS_ENABLED
#ifdef DEBUG_ENABLED
pi.name = argument_names[i];
#else
pi.name = "arg" + itos(i + 1);
#endif
#endif // DEBUG_ENABLED
pi.type = (*get_argument_type)(i);
if (pi.type == Variant::NIL) {
pi.usage |= PROPERTY_USAGE_NIL_IS_VARIANT;
@ -1290,9 +1290,9 @@ static void register_builtin_method(const Vector<String> &p_argnames, const Vect
imi.return_type = T::get_return_type();
imi.argument_count = T::get_argument_count();
imi.get_argument_type = T::get_argument_type;
#ifdef DEBUG_METHODS_ENABLED
#ifdef DEBUG_ENABLED
ERR_FAIL_COND(!imi.is_vararg && imi.argument_count != imi.argument_names.size());
#endif
#endif // DEBUG_ENABLED
builtin_method_info[T::get_base_type()].insert(name, imi);
builtin_method_names[T::get_base_type()].push_back(name);
@ -1312,7 +1312,7 @@ void Variant::callp(const StringName &p_method, const Variant **p_args, int p_ar
return;
}
#endif
#endif // DEBUG_ENABLED
r_ret = _get_obj().obj->callp(p_method, p_args, p_argcount, r_error);
} else {
@ -1343,7 +1343,7 @@ void Variant::call_const(const StringName &p_method, const Variant **p_args, int
return;
}
#endif
#endif // DEBUG_ENABLED
r_ret = _get_obj().obj->call_const(p_method, p_args, p_argcount, r_error);
//else if (type==Variant::METHOD) {
@ -1442,12 +1442,12 @@ String Variant::get_builtin_method_argument_name(Variant::Type p_type, const Str
ERR_FAIL_INDEX_V(p_type, Variant::VARIANT_MAX, String());
const VariantBuiltInMethodInfo *method = builtin_method_info[p_type].lookup_ptr(p_method);
ERR_FAIL_NULL_V(method, String());
#ifdef DEBUG_METHODS_ENABLED
#ifdef DEBUG_ENABLED
ERR_FAIL_INDEX_V(p_argument, method->argument_count, String());
return method->argument_names[p_argument];
#else
return "arg" + itos(p_argument + 1);
#endif
#endif // DEBUG_ENABLED
}
Vector<Variant> Variant::get_builtin_method_default_arguments(Variant::Type p_type, const StringName &p_method) {
@ -1549,7 +1549,7 @@ void Variant::get_constants_for_type(Variant::Type p_type, List<StringName> *p_c
#else
for (const KeyValue<StringName, int64_t> &E : cd.value) {
p_constants->push_back(E.key);
#endif
#endif // DEBUG_ENABLED
}
#ifdef DEBUG_ENABLED
@ -1558,7 +1558,7 @@ void Variant::get_constants_for_type(Variant::Type p_type, List<StringName> *p_c
#else
for (const KeyValue<StringName, Variant> &E : cd.variant_value) {
p_constants->push_back(E.key);
#endif
#endif // DEBUG_ENABLED
}
}
@ -1667,7 +1667,7 @@ StringName Variant::get_enum_for_enumeration(Variant::Type p_type, const StringN
return (enum_name == nullptr) ? StringName() : *enum_name;
}
#ifdef DEBUG_METHODS_ENABLED
#ifdef DEBUG_ENABLED
#define bind_method(m_type, m_method, m_arg_names, m_default_args) \
METHOD_CLASS(m_type, m_method, &m_type::m_method); \
register_builtin_method<Method_##m_type##_##m_method>(m_arg_names, m_default_args);
@ -1675,9 +1675,9 @@ StringName Variant::get_enum_for_enumeration(Variant::Type p_type, const StringN
#define bind_method(m_type, m_method, m_arg_names, m_default_args) \
METHOD_CLASS(m_type, m_method, &m_type ::m_method); \
register_builtin_method<Method_##m_type##_##m_method>(sarray(), m_default_args);
#endif
#endif // DEBUG_ENABLED
#ifdef DEBUG_METHODS_ENABLED
#ifdef DEBUG_ENABLED
#define bind_convert_method(m_type_from, m_type_to, m_method, m_arg_names, m_default_args) \
CONVERT_METHOD_CLASS(m_type_from, m_method, &m_type_to::m_method); \
register_builtin_method<Method_##m_type_from##_##m_method>(m_arg_names, m_default_args);
@ -1685,9 +1685,9 @@ StringName Variant::get_enum_for_enumeration(Variant::Type p_type, const StringN
#define bind_convert_method(m_type_from, m_type_to, m_method, m_arg_names, m_default_args) \
CONVERT_METHOD_CLASS(m_type_from, m_method, &m_type_to ::m_method); \
register_builtin_method<Method_##m_type_from##_##m_method>(sarray(), m_default_args);
#endif
#endif // DEBUG_ENABLED
#ifdef DEBUG_METHODS_ENABLED
#ifdef DEBUG_ENABLED
#define bind_static_method(m_type, m_method, m_arg_names, m_default_args) \
STATIC_METHOD_CLASS(m_type, m_method, m_type::m_method); \
register_builtin_method<Method_##m_type##_##m_method>(m_arg_names, m_default_args);
@ -1695,9 +1695,9 @@ StringName Variant::get_enum_for_enumeration(Variant::Type p_type, const StringN
#define bind_static_method(m_type, m_method, m_arg_names, m_default_args) \
STATIC_METHOD_CLASS(m_type, m_method, m_type ::m_method); \
register_builtin_method<Method_##m_type##_##m_method>(sarray(), m_default_args);
#endif
#endif // DEBUG_ENABLED
#ifdef DEBUG_METHODS_ENABLED
#ifdef DEBUG_ENABLED
#define bind_methodv(m_type, m_name, m_method, m_arg_names, m_default_args) \
METHOD_CLASS(m_type, m_name, m_method); \
register_builtin_method<Method_##m_type##_##m_name>(m_arg_names, m_default_args);
@ -1705,9 +1705,9 @@ StringName Variant::get_enum_for_enumeration(Variant::Type p_type, const StringN
#define bind_methodv(m_type, m_name, m_method, m_arg_names, m_default_args) \
METHOD_CLASS(m_type, m_name, m_method); \
register_builtin_method<Method_##m_type##_##m_name>(sarray(), m_default_args);
#endif
#endif // DEBUG_ENABLED
#ifdef DEBUG_METHODS_ENABLED
#ifdef DEBUG_ENABLED
#define bind_convert_methodv(m_type_from, m_type_to, m_name, m_method, m_arg_names, m_default_args) \
CONVERT_METHOD_CLASS(m_type_from, m_name, m_method); \
register_builtin_method<Method_##m_type_from##_##m_name>(m_arg_names, m_default_args);
@ -1715,9 +1715,9 @@ StringName Variant::get_enum_for_enumeration(Variant::Type p_type, const StringN
#define bind_convert_methodv(m_type_from, m_type_to, m_name, m_method, m_arg_names, m_default_args) \
CONVERT_METHOD_CLASS(m_type_from, m_name, m_method); \
register_builtin_method<Method_##m_type_from##_##m_name>(sarray(), m_default_args);
#endif
#endif // DEBUG_ENABLED
#ifdef DEBUG_METHODS_ENABLED
#ifdef DEBUG_ENABLED
#define bind_function(m_type, m_name, m_method, m_arg_names, m_default_args) \
FUNCTION_CLASS(m_type, m_name, m_method, true); \
register_builtin_method<Method_##m_type##_##m_name>(m_arg_names, m_default_args);
@ -1725,9 +1725,9 @@ StringName Variant::get_enum_for_enumeration(Variant::Type p_type, const StringN
#define bind_function(m_type, m_name, m_method, m_arg_names, m_default_args) \
FUNCTION_CLASS(m_type, m_name, m_method, true); \
register_builtin_method<Method_##m_type##_##m_name>(sarray(), m_default_args);
#endif
#endif // DEBUG_ENABLED
#ifdef DEBUG_METHODS_ENABLED
#ifdef DEBUG_ENABLED
#define bind_functionnc(m_type, m_name, m_method, m_arg_names, m_default_args) \
FUNCTION_CLASS(m_type, m_name, m_method, false); \
register_builtin_method<Method_##m_type##_##m_name>(m_arg_names, m_default_args);
@ -1735,7 +1735,7 @@ StringName Variant::get_enum_for_enumeration(Variant::Type p_type, const StringN
#define bind_functionnc(m_type, m_name, m_method, m_arg_names, m_default_args) \
FUNCTION_CLASS(m_type, m_name, m_method, false); \
register_builtin_method<Method_##m_type##_##m_name>(sarray(), m_default_args);
#endif
#endif // DEBUG_ENABLED
#define bind_string_method(m_method, m_arg_names, m_default_args) \
bind_method(String, m_method, m_arg_names, m_default_args); \

View file

@ -104,11 +104,11 @@ class VariantConstructor {
static _FORCE_INLINE_ void construct_helper(T &base, const Variant **p_args, Callable::CallError &r_error, IndexSequence<Is...>) {
r_error.error = Callable::CallError::CALL_OK;
#ifdef DEBUG_METHODS_ENABLED
#ifdef DEBUG_ENABLED
base = T(VariantCasterAndValidate<P>::cast(p_args, Is, r_error)...);
#else
base = T(VariantCaster<P>::cast(*p_args[Is])...);
#endif
#endif // DEBUG_ENABLED
}
template <size_t... Is>

View file

@ -1159,13 +1159,13 @@ String VariantUtilityFunctions::join_string(const Variant **p_args, int p_arg_co
return s;
}
#ifdef DEBUG_METHODS_ENABLED
#ifdef DEBUG_ENABLED
#define VCALLR *ret = p_func(VariantCasterAndValidate<P>::cast(p_args, Is, r_error)...)
#define VCALL p_func(VariantCasterAndValidate<P>::cast(p_args, Is, r_error)...)
#else
#define VCALLR *ret = p_func(VariantCaster<P>::cast(*p_args[Is])...)
#define VCALL p_func(VariantCaster<P>::cast(*p_args[Is])...)
#endif
#endif // DEBUG_ENABLED
template <typename R, typename... P, size_t... Is>
static _FORCE_INLINE_ void call_helperpr(R (*p_func)(P...), Variant *ret, const Variant **p_args, Callable::CallError &r_error, IndexSequence<Is...>) {