cxx: Avoid pedantic warning with -Wold-style-cast

This affects the generated headers.
This commit is contained in:
Jean-Philippe Andre 2017-11-22 20:50:11 +09:00
parent 03af836332
commit b4e3d4d8a4
2 changed files with 10 additions and 8 deletions

View File

@ -64,10 +64,11 @@ struct base_class_definition_generator
return false;
if(!as_generator(";\n" << scope_tab << "}\n").generate(sink, attributes::unused, context)) return false;
if(!as_generator
(
scope_tab << "Eo* _eo_ptr() const { return *(Eo**)this; }\n"
).generate(sink, attributes::unused, context)) return false;
if(!as_generator(
scope_tab << "Eo* _eo_ptr() const { return *(reinterpret_cast<Eo **>"
<< "(const_cast<" << string << " *>(this))); }\n"
).generate(sink, cls.cxx_name, context))
return false;
// operator ::ns::Class_Name() const;
// operator ::ns::Class_Name&();

View File

@ -128,10 +128,11 @@ struct class_definition_generator
return false;
if(!as_generator(";\n" << scope_tab << "}\n").generate(sink, attributes::unused, context)) return false;
if(!as_generator
(
scope_tab << "Eo* _eo_ptr() const { return *(Eo**)this; }\n"
).generate(sink, attributes::unused, context)) return false;
if(!as_generator(
scope_tab << "Eo* _eo_ptr() const { return *(reinterpret_cast<Eo **>"
<< "(const_cast<" << string << " *>(this))); }\n"
).generate(sink, cls.cxx_name, context))
return false;
for (auto&& e : cls.events)
{