forked from enlightenment/efl
eolian-cxx: Fix some C++ quirks that makes clang warn about
This commit is contained in:
parent
f683efd2c1
commit
343b88a735
|
@ -323,12 +323,12 @@ T* convert_to_c_impl(std::unique_ptr<U, Deleter>& v, tag<T*, std::unique_ptr<U,
|
|||
}
|
||||
|
||||
template <typename T>
|
||||
Eina_Array** convert_to_c_impl(efl::eina::array<T>& c, tag<Eina_Array **, efl::eina::array<T>&>)
|
||||
Eina_Array** convert_to_c_impl(efl::eina::array<T>& /*c*/, tag<Eina_Array **, efl::eina::array<T>&>)
|
||||
{
|
||||
std::abort();
|
||||
}
|
||||
template <typename T>
|
||||
Eina_Array** convert_to_c_impl(efl::eina::range_array<T>& c, tag<Eina_Array **, efl::eina::range_array<T>&>)
|
||||
Eina_Array** convert_to_c_impl(efl::eina::range_array<T>& /*c*/, tag<Eina_Array **, efl::eina::range_array<T>&>)
|
||||
{
|
||||
std::abort();
|
||||
}
|
||||
|
|
|
@ -110,18 +110,6 @@ struct class_definition_generator
|
|||
scope_tab << "Eo* _eo_ptr() const { return *(Eo**)this; }\n"
|
||||
).generate(sink, attributes::unused, context)) return false;
|
||||
|
||||
// operator ::ns::Class_Name() const;
|
||||
// operator ::ns::Class_Name&();
|
||||
// operator ::ns::Class_Name const&() const;
|
||||
if(!as_generator
|
||||
(
|
||||
scope_tab << "operator " << *("::" << lower_case[string]) << "::" << string << "() const;\n"
|
||||
<< scope_tab << "operator " << *("::" << lower_case[string]) << "::" << string << "&();\n"
|
||||
<< scope_tab << "operator " << *("::" << lower_case[string]) << "::" << string << " const&() const;\n"
|
||||
).generate(sink, std::make_tuple(cpp_namespaces, cls.cxx_name, cpp_namespaces, cls.cxx_name
|
||||
, cpp_namespaces, cls.cxx_name), context))
|
||||
return false;
|
||||
|
||||
if(!as_generator
|
||||
(
|
||||
*attribute_reorder<1, 2, 0, 1>
|
||||
|
|
|
@ -279,11 +279,11 @@ inline void type_def::set(Eolian_Type const* eolian_type)
|
|||
case EOLIAN_TYPE_POINTER:
|
||||
{
|
||||
std::vector<pointer_indirection> pointers
|
||||
{{ {qualifiers(eolian_type)}, false }};
|
||||
{{ {qualifiers(eolian_type), {}}, false }};
|
||||
Eolian_Type const* base_type = eolian_type_base_type_get(eolian_type);
|
||||
while(eolian_type_type_get(base_type) == EOLIAN_TYPE_POINTER)
|
||||
{
|
||||
pointers.push_back({qualifiers(base_type)});
|
||||
pointers.push_back({{qualifiers(base_type), {}}});
|
||||
base_type = eolian_type_base_type_get(base_type);
|
||||
}
|
||||
|
||||
|
@ -295,7 +295,7 @@ inline void type_def::set(Eolian_Type const* eolian_type)
|
|||
case EOLIAN_TYPE_CLASS:
|
||||
{
|
||||
Eolian_Class const* klass = eolian_type_class_get(eolian_type);
|
||||
original_type = klass_name(klass, {qualifiers(eolian_type)}, {});
|
||||
original_type = klass_name(klass, {qualifiers(eolian_type), {}}, {});
|
||||
}
|
||||
break;
|
||||
case EOLIAN_TYPE_COMPLEX:
|
||||
|
@ -636,7 +636,7 @@ struct klass_def
|
|||
, inherit_last; inherit_iterator != inherit_last; ++inherit_iterator)
|
||||
{
|
||||
Eolian_Class const* inherit = ::eolian_class_get_by_name(&*inherit_iterator);
|
||||
inherits.insert({inherit, {qualifier_info::is_none}, {}});
|
||||
inherits.insert({inherit, {}, {}});
|
||||
inherit_algo(inherit);
|
||||
}
|
||||
};
|
||||
|
|
|
@ -13,7 +13,7 @@ struct add_reference_visitor
|
|||
template <typename T>
|
||||
void operator()(T& object) const
|
||||
{
|
||||
object.pointers.insert(object.pointers.begin(), {{attributes::qualifier_info::is_none}, true});
|
||||
object.pointers.insert(object.pointers.begin(), {{}, true});
|
||||
}
|
||||
void operator()(attributes::complex_type_def& complex) const
|
||||
{
|
||||
|
|
|
@ -78,6 +78,10 @@ struct qualifier_def
|
|||
{
|
||||
qualifier_info qualifier;
|
||||
std::string free_function;
|
||||
|
||||
qualifier_def() : qualifier(qualifier_info::is_none) {}
|
||||
qualifier_def(qualifier_info info, std::string free_function)
|
||||
: qualifier(info), free_function(std::move(free_function)) {}
|
||||
};
|
||||
|
||||
inline bool operator<(qualifier_def const& lhs, qualifier_def const& rhs)
|
||||
|
|
|
@ -105,12 +105,12 @@ struct visitor_generate
|
|||
}
|
||||
const match_table[] =
|
||||
{
|
||||
"void_ptr", nullptr, [&]
|
||||
{
|
||||
std::vector<attributes::pointer_indirection> pointers = regular.pointers;
|
||||
pointers.insert(pointers.begin(), {{attributes::qualifier_info::is_none, {}}, false});
|
||||
return attributes::regular_type_def{"void", regular.base_qualifier, pointers, {}};
|
||||
}
|
||||
{"void_ptr", nullptr, [&]
|
||||
{
|
||||
std::vector<attributes::pointer_indirection> pointers = regular.pointers;
|
||||
pointers.insert(pointers.begin(), {{}, false});
|
||||
return attributes::regular_type_def{"void", regular.base_qualifier, pointers, {}};
|
||||
}}
|
||||
// signed primitives
|
||||
, {"byte", nullptr, [&] { return replace_base_type(regular, " char"); }}
|
||||
, {"llong", nullptr, [&] { return replace_base_type(regular, " long long"); }}
|
||||
|
@ -166,7 +166,7 @@ struct visitor_generate
|
|||
if(regular.pointers.empty() || (regular.pointers.size() == 1 && regular.pointers[0].reference == true))
|
||||
{
|
||||
attributes::complex_type_def def
|
||||
{attributes::regular_type_def{" ::efl::eina::optional", attributes::qualifier_info::is_none, {}}};
|
||||
{attributes::regular_type_def{" ::efl::eina::optional", {}}};
|
||||
attributes::regular_type_def no_optional_regular = regular;
|
||||
attributes::remove_optional(no_optional_regular.base_qualifier);
|
||||
|
||||
|
|
Loading…
Reference in New Issue