From b1a1cdc701add170f1e6adf68573828bf13bf496 Mon Sep 17 00:00:00 2001 From: Lauro Moura Date: Sat, 12 Oct 2019 18:05:17 -0300 Subject: [PATCH] eolian-cxx: Rename fields to standard naming Summary: bool fields were missing the `is_` prefix. Reviewers: felipealmeida, brunobelo, segfaultxavi, woohyun Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D10380 --- src/bin/eolian_mono/eolian/mono/blacklist.hh | 2 +- src/lib/eolian_cxx/grammar/class_definition.hpp | 8 ++++---- src/lib/eolian_cxx/grammar/klass_def.hpp | 14 +++++++------- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/bin/eolian_mono/eolian/mono/blacklist.hh b/src/bin/eolian_mono/eolian/mono/blacklist.hh index ff8080b28a..49cded5fc0 100644 --- a/src/bin/eolian_mono/eolian/mono/blacklist.hh +++ b/src/bin/eolian_mono/eolian/mono/blacklist.hh @@ -178,7 +178,7 @@ inline bool is_event_blacklisted(attributes::event_def const& evt, Context const { auto options = efl::eolian::grammar::context_find_tag(context); - return evt.beta && !options.want_beta; + return evt.is_beta && !options.want_beta; } } diff --git a/src/lib/eolian_cxx/grammar/class_definition.hpp b/src/lib/eolian_cxx/grammar/class_definition.hpp index 89455eda16..569a62f586 100644 --- a/src/lib/eolian_cxx/grammar/class_definition.hpp +++ b/src/lib/eolian_cxx/grammar/class_definition.hpp @@ -137,7 +137,7 @@ struct class_definition_generator for (auto&& e : cls.events) { - if (e.beta) + if (e.is_beta) { suffix = "BETA"; if(!as_generator @@ -145,7 +145,7 @@ struct class_definition_generator .generate(sink, std::make_tuple(cls.namespaces, cls.eolian_name, suffix), add_upper_case_context(context))) return false; } - if (e.protect) + if (e.is_protected) { suffix = "PROTECTED"; if(!as_generator @@ -193,9 +193,9 @@ struct class_definition_generator if (!as_generator("#endif\n").generate(sink, attributes::unused, context)) return false; - if (e.beta && !as_generator("#endif\n").generate(sink, attributes::unused, context)) + if (e.is_beta && !as_generator("#endif\n").generate(sink, attributes::unused, context)) return false; - if (e.protect && !as_generator("#endif\n").generate(sink, attributes::unused, context)) + if (e.is_protected && !as_generator("#endif\n").generate(sink, attributes::unused, context)) return false; } diff --git a/src/lib/eolian_cxx/grammar/klass_def.hpp b/src/lib/eolian_cxx/grammar/klass_def.hpp index f38ebeba6c..5b977a6c57 100644 --- a/src/lib/eolian_cxx/grammar/klass_def.hpp +++ b/src/lib/eolian_cxx/grammar/klass_def.hpp @@ -1155,7 +1155,7 @@ struct event_def klass_name klass; eina::optional type; std::string name, c_name; - bool beta, protect; + bool is_beta, is_protected; documentation_def documentation; friend inline bool operator==(event_def const& lhs, event_def const& rhs) @@ -1164,8 +1164,8 @@ struct event_def && lhs.type == rhs.type && lhs.name == rhs.name && lhs.c_name == rhs.c_name - && lhs.beta == rhs.beta - && lhs.protect == rhs.protect + && lhs.is_beta == rhs.is_beta + && lhs.is_protected == rhs.is_protected && lhs.documentation == rhs.documentation; } friend inline bool operator!=(event_def const& lhs, event_def const& rhs) @@ -1174,8 +1174,8 @@ struct event_def } event_def(klass_name _klass, type_def type, std::string name, std::string c_name, - bool beta, bool protect, documentation_def documentation) - : klass(_klass), type(type), name(name), c_name(c_name), beta(beta), protect(protect) + bool is_beta, bool is_protected, documentation_def documentation) + : klass(_klass), type(type), name(name), c_name(c_name), is_beta(is_beta), is_protected(is_protected) , documentation(documentation) {} event_def(Eolian_Event const* event, Eolian_Class const* cls, Eolian_Unit const* unit) @@ -1188,8 +1188,8 @@ struct event_def } : eina::optional{}) , name( ::eolian_event_name_get(event)) , c_name( ::eolian_event_c_macro_get(event)) - , beta( ::eolian_event_is_beta(event)) - , protect( ::eolian_event_scope_get(event) == EOLIAN_SCOPE_PROTECTED) + , is_beta( ::eolian_event_is_beta(event)) + , is_protected( ::eolian_event_scope_get(event) == EOLIAN_SCOPE_PROTECTED) , documentation( ::eolian_event_documentation_get(event)) {} };