From 9f2e2f99c6669a96fc2d4488af9613e7498c80ae Mon Sep 17 00:00:00 2001 From: Daniel Kolesa Date: Fri, 16 Aug 2019 13:33:27 +0200 Subject: [PATCH 01/10] eolian: fix function pointer leak as reported by asan Ref T8140. --- src/lib/eolian/database_type.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib/eolian/database_type.c b/src/lib/eolian/database_type.c index b0d1ac1bee..70a8ad6354 100644 --- a/src/lib/eolian/database_type.c +++ b/src/lib/eolian/database_type.c @@ -27,7 +27,8 @@ database_typedecl_del(Eolian_Typedecl *tp) database_type_del(tp->base_type); if (tp->fields) eina_hash_free(tp->fields); if (tp->field_list) eina_list_free(tp->field_list); - if (tp->freefunc) eina_stringshare_del(tp->freefunc); + database_function_del(tp->function_pointer); + eina_stringshare_del(tp->freefunc); database_doc_del(tp->doc); free(tp); } From 491a9a5bf842d151b1e2138a4b2f1b9d17f7b085 Mon Sep 17 00:00:00 2001 From: Felipe Magno de Almeida Date: Thu, 15 Aug 2019 20:48:01 +0000 Subject: [PATCH 02/10] eolian-mono: Use correct allocator to free with free, and not delete T8137 Differential Revision: https://phab.enlightenment.org/D9576 --- src/lib/eolian_cxx/grammar/klass_def.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib/eolian_cxx/grammar/klass_def.hpp b/src/lib/eolian_cxx/grammar/klass_def.hpp index 4d6d4ea79f..f96595bdc3 100644 --- a/src/lib/eolian_cxx/grammar/klass_def.hpp +++ b/src/lib/eolian_cxx/grammar/klass_def.hpp @@ -260,7 +260,8 @@ struct documentation_def since = str; } - efl::eina::ptr_list l(eolian_documentation_string_split(description.c_str())); + efl::eina::ptr_list + l(eolian_documentation_string_split(description.c_str())); for (auto&& i : l) desc_paragraphs.push_back({&i}); } From 8a8a833837f7217aea0a33f4f7afbb6edfb103c4 Mon Sep 17 00:00:00 2001 From: Daniel Kolesa Date: Fri, 16 Aug 2019 16:27:00 +0200 Subject: [PATCH 03/10] eolian: rename @class on methods to @static Ref https://phab.enlightenment.org/T8118 Ref https://phab.enlightenment.org/T7675 --- src/lib/ecore/efl_app.eo | 2 +- src/lib/ecore/efl_core_proc_env.eo | 2 +- src/lib/ecore_con/efl_net_dialer_http.eo | 4 ++-- src/lib/ecore_con/efl_net_ip_address.eo | 8 ++++---- src/lib/ecore_con/efl_net_ssl_context.eo | 2 +- src/lib/efl/interfaces/efl_text_markup_util.eo | 4 ++-- src/lib/elementary/efl_access_object.eo | 8 ++++---- src/lib/elementary/efl_ui_action_connector.eo | 4 ++-- src/lib/elementary/efl_ui_focus_util.eo | 6 +++--- src/lib/elementary/efl_ui_spotlight_util.eo | 2 +- src/lib/elementary/efl_ui_theme.eo | 2 +- src/lib/elementary/efl_ui_win.eo | 2 +- src/lib/eo/efl_object.eo | 6 +++--- src/lib/eolian/database_function_api.c | 2 +- src/lib/eolian/eo_lexer.h | 4 ++-- src/lib/eolian/eo_parser.c | 8 ++++---- src/lib/eolian/eolian_database.h | 2 +- src/tests/efl_mono/dummy_inherit_helper.eo | 4 ++-- src/tests/efl_mono/dummy_test_object.eo | 6 +++--- src/tests/eolian/data/class_funcs.eo | 6 +++--- 20 files changed, 42 insertions(+), 42 deletions(-) diff --git a/src/lib/ecore/efl_app.eo b/src/lib/ecore/efl_app.eo index 7197c295bf..f38ec8312b 100644 --- a/src/lib/ecore/efl_app.eo +++ b/src/lib/ecore/efl_app.eo @@ -8,7 +8,7 @@ abstract Efl.App extends Efl.Loop implements Efl.Core.Command_Line ]] data: null; methods { - @property app_main @class { + @property app_main @static { [[ Returns the app object that is representing this process Note: This function call only works in the main loop thread of the process. diff --git a/src/lib/ecore/efl_core_proc_env.eo b/src/lib/ecore/efl_core_proc_env.eo index 2641105338..63260145e0 100644 --- a/src/lib/ecore/efl_core_proc_env.eo +++ b/src/lib/ecore/efl_core_proc_env.eo @@ -2,7 +2,7 @@ class @beta Efl.Core.Proc_Env extends Efl.Core.Env { c_prefix: efl_env; methods { - self @class { + self @static { [[Get a instance of this object The object will apply the environment operations onto this process. diff --git a/src/lib/ecore_con/efl_net_dialer_http.eo b/src/lib/ecore_con/efl_net_dialer_http.eo index 3b7c9b2965..a44b50a251 100644 --- a/src/lib/ecore_con/efl_net_dialer_http.eo +++ b/src/lib/ecore_con/efl_net_dialer_http.eo @@ -361,7 +361,7 @@ class @beta Efl.Net.Dialer_Http extends Efl.Loop_Consumer implements Efl.Net.Dia } } - date_parse @class { + date_parse @static { [[Parses the given string as time in seconds since 1/1/1970. This method is useful to parse header values such as @@ -373,7 +373,7 @@ class @beta Efl.Net.Dialer_Http extends Efl.Loop_Consumer implements Efl.Net.Dia return: int64; [[Seconds since 1/1/1970]] } - date_serialize @class { + date_serialize @static { [[Serializes the given GMT time in seconds since 1/1/1970. The timezone must be GMT (ie: gmtime()). diff --git a/src/lib/ecore_con/efl_net_ip_address.eo b/src/lib/ecore_con/efl_net_ip_address.eo index effdf47274..3d6eaba13b 100644 --- a/src/lib/ecore_con/efl_net_ip_address.eo +++ b/src/lib/ecore_con/efl_net_ip_address.eo @@ -37,7 +37,7 @@ class @beta Efl.Net.Ip_Address extends Efl.Object { ]] methods { - create @class { + create @static { [[Creates an object given family, port and address. This is a convenience to create an object in a single @@ -51,7 +51,7 @@ class @beta Efl.Net.Ip_Address extends Efl.Object { return: Efl.Net.Ip_Address @owned; [[Newly created object or $NULL if parameters were invalid.]] } - create_sockaddr @class { + create_sockaddr @static { [[Creates an object given sockaddr This is a convenient way to create an object in a single call. @@ -64,7 +64,7 @@ class @beta Efl.Net.Ip_Address extends Efl.Object { return: Efl.Net.Ip_Address @owned; [[Newly created object or $NULL if parameter was invalid.]] } - parse @class { + parse @static { [[Parses a numeric address and return an object representing it. This parses a numeric IPv4 or IPv6 address and optional @@ -88,7 +88,7 @@ class @beta Efl.Net.Ip_Address extends Efl.Object { return: Efl.Net.Ip_Address @owned; [[The new IP address object or NULL if it failed to parse]] } - resolve @class { + resolve @static { [[Asynchronously resolves host and port names. This will resolve the host and port names, returning the diff --git a/src/lib/ecore_con/efl_net_ssl_context.eo b/src/lib/ecore_con/efl_net_ssl_context.eo index 26fd68f1de..fb40620dfc 100644 --- a/src/lib/ecore_con/efl_net_ssl_context.eo +++ b/src/lib/ecore_con/efl_net_ssl_context.eo @@ -15,7 +15,7 @@ class @beta Efl.Net.Ssl.Context extends Efl.Object { ]] methods { - @property default_dialer @class { + @property default_dialer @static { [[The default context for dialers. It will start with: diff --git a/src/lib/efl/interfaces/efl_text_markup_util.eo b/src/lib/efl/interfaces/efl_text_markup_util.eo index 96237fc740..5b2bd589ee 100644 --- a/src/lib/efl/interfaces/efl_text_markup_util.eo +++ b/src/lib/efl/interfaces/efl_text_markup_util.eo @@ -3,7 +3,7 @@ class @beta Efl.Text_Markup_Util { ]] data: null; methods { - text_to_markup @class { + text_to_markup @static { [[Converts a given (UTF-8) text to a markup-compatible string. This is used mainly to set a plain text with the $.markup_set property. @@ -13,7 +13,7 @@ class @beta Efl.Text_Markup_Util { } return: mstring @owned; [[The markup representation of given text]] } - markup_to_text @class { + markup_to_text @static { [[Converts a given (UTF-8) text to a markup-compatible string. This is used mainly to set a plain text with the $.markup_set property. diff --git a/src/lib/elementary/efl_access_object.eo b/src/lib/elementary/efl_access_object.eo index 9e7dc5da0f..8f23a9d995 100644 --- a/src/lib/elementary/efl_access_object.eo +++ b/src/lib/elementary/efl_access_object.eo @@ -358,7 +358,7 @@ mixin @beta Efl.Access.Object requires Efl.Object states: Efl.Access.State_Set; [[Accessible state set]] } } - event_handler_add @class @protected @beta { + event_handler_add @static @protected @beta { [[Register accessibility event listener]] params { @in cb: Efl.Event_Cb; [[Callback]] @@ -366,13 +366,13 @@ mixin @beta Efl.Access.Object requires Efl.Object } return: ptr(Efl.Access.Event.Handler); [[Event handler]] } - event_handler_del @class @protected @beta { + event_handler_del @static @protected @beta { [[Deregister accessibility event listener]] params { @in handler: ptr(Efl.Access.Event.Handler); [[Event handler]] } } - event_emit @class @protected @beta { + event_emit @static @protected @beta { [[Emit event]] params { @in accessible: Efl.Access.Object; [[Accessibility object.]] @@ -445,7 +445,7 @@ mixin @beta Efl.Access.Object requires Efl.Object relationships_clear @beta { [[Removes all relationships in accessible object.]] } - @property access_root @class @beta { + @property access_root @static @beta { get { [[Get root object of accessible object hierarchy]] values { diff --git a/src/lib/elementary/efl_ui_action_connector.eo b/src/lib/elementary/efl_ui_action_connector.eo index 40fda6a6e6..1c3f4f7ee2 100644 --- a/src/lib/elementary/efl_ui_action_connector.eo +++ b/src/lib/elementary/efl_ui_action_connector.eo @@ -4,7 +4,7 @@ class @beta Efl.Ui.Action_Connector { For example, this simplifies creating widgets that implement the @Efl.Input.Clickable interface. ]] methods { - bind_clickable_to_theme @class { + bind_clickable_to_theme @static { [[This will listen to the standard "click" events on a theme and emit the appropriate events through the @Efl.Input.Clickable interface. @@ -19,7 +19,7 @@ class @beta Efl.Ui.Action_Connector { clickable : Efl.Input.Clickable; [[The object to call the clickable methods on.]] } } - bind_clickable_to_object @class { + bind_clickable_to_object @static { [[This will listen to the standard "click" events on an object, and emit the appropriate events through the @Efl.Input.Clickable interface. diff --git a/src/lib/elementary/efl_ui_focus_util.eo b/src/lib/elementary/efl_ui_focus_util.eo index c19c05cb18..40b38a540e 100644 --- a/src/lib/elementary/efl_ui_focus_util.eo +++ b/src/lib/elementary/efl_ui_focus_util.eo @@ -1,20 +1,20 @@ class @beta Efl.Ui.Focus.Util extends Efl.Object { [[EFL UI Focus Util class]] methods { - focus @class { + focus @static { [[Focus helper method]] params { focus_elem : Efl.Ui.Focus.Object; [[Focus element]] } } - active_manager @class { + active_manager @static { [[Get the highest manager in the redirect property]] params { manager : Efl.Ui.Focus.Manager; } return: Efl.Ui.Focus.Manager; } - direction_complement @class { + direction_complement @static { params { dir : Efl.Ui.Focus.Direction; } diff --git a/src/lib/elementary/efl_ui_spotlight_util.eo b/src/lib/elementary/efl_ui_spotlight_util.eo index 19d446ac61..0f1335bef0 100644 --- a/src/lib/elementary/efl_ui_spotlight_util.eo +++ b/src/lib/elementary/efl_ui_spotlight_util.eo @@ -1,6 +1,6 @@ class @beta Efl.Ui.Spotlight.Util { methods { - stack_gen @class { + stack_gen @static { [[Get a preconfigured stack obejct]] params { parent : Efl.Ui.Widget; diff --git a/src/lib/elementary/efl_ui_theme.eo b/src/lib/elementary/efl_ui_theme.eo index f167a23b47..a11381d2c3 100644 --- a/src/lib/elementary/efl_ui_theme.eo +++ b/src/lib/elementary/efl_ui_theme.eo @@ -4,7 +4,7 @@ class @beta Efl.Ui.Theme extends Efl.Object c_prefix: efl_ui_theme; data: Efl_Ui_Theme_Data; methods { - @property default @class { + @property default @static { [[This is the default theme. All widgets use the default theme implicitly unless a specific theme diff --git a/src/lib/elementary/efl_ui_win.eo b/src/lib/elementary/efl_ui_win.eo index 0148f4e214..bf0582d1c9 100644 --- a/src/lib/elementary/efl_ui_win.eo +++ b/src/lib/elementary/efl_ui_win.eo @@ -608,7 +608,7 @@ class Efl.Ui.Win extends Efl.Ui.Widget implements Efl.Canvas.Scene, Efl.Access.W This will try and delete all the windows in the stack that are above the window.]] } - @property exit_on_all_windows_closed @class { + @property exit_on_all_windows_closed @static { [[Enable quitting the main loop when all windows are closed. When set, the main loop will quit with the passed exit code once all windows have been closed. diff --git a/src/lib/eo/efl_object.eo b/src/lib/eo/efl_object.eo index 2548f9d6f3..02557351a6 100644 --- a/src/lib/eo/efl_object.eo +++ b/src/lib/eo/efl_object.eo @@ -143,7 +143,7 @@ abstract Efl.Object @in sb: strbuf; [[A string buffer, must not be $null.]] } } - @property event_global_freeze_count @class { + @property event_global_freeze_count @static { get { [[Return the global count of freeze events. @@ -288,7 +288,7 @@ abstract Efl.Object events again using @.event_thaw. Events marked $hot cannot be stopped. ]] } - event_global_thaw @class { + event_global_thaw @static { [[Gobally thaw events for ALL EFL OBJECTS. Allows event callbacks to be called for all EFL objects after they have @@ -296,7 +296,7 @@ abstract Efl.Object the amount of freezes for events to be re-enabled. ]] } - event_global_freeze @class { + event_global_freeze @static { [[Globally freeze events for ALL EFL OBJECTS. Prevents event callbacks from being called for all EFL objects. diff --git a/src/lib/eolian/database_function_api.c b/src/lib/eolian/database_function_api.c index 123b99b4c4..910f2b8462 100644 --- a/src/lib/eolian/database_function_api.c +++ b/src/lib/eolian/database_function_api.c @@ -120,7 +120,7 @@ EAPI Eina_Bool eolian_function_is_class(const Eolian_Function *fid) { EINA_SAFETY_ON_NULL_RETURN_VAL(fid, EINA_FALSE); - return fid->is_class; + return fid->is_static; } EAPI Eina_Bool diff --git a/src/lib/eolian/eo_lexer.h b/src/lib/eolian/eo_lexer.h index c70b1c9031..805589eddd 100644 --- a/src/lib/eolian/eo_lexer.h +++ b/src/lib/eolian/eo_lexer.h @@ -33,11 +33,11 @@ enum Tokens KW(keys), KW(legacy), KW(methods), KW(mixin), KW(params), \ KW(parse), KW(parts), KW(ptr), KW(set), KW(type), KW(values), KW(var), KW(requires), \ \ - KWAT(auto), KWAT(beta), KWAT(c_name), KWAT(class), KWAT(const), KWAT(cref), \ + KWAT(auto), KWAT(beta), KWAT(c_name), KWAT(const), KWAT(cref), \ KWAT(empty), KWAT(extern), KWAT(free), KWAT(hot), KWAT(in), KWAT(inout), \ KWAT(no_unused), KWAT(nullable), KWAT(optional), KWAT(out), KWAT(owned), \ KWAT(private), KWAT(property), KWAT(protected), KWAT(restart), \ - KWAT(pure_virtual), \ + KWAT(pure_virtual), KWAT(static), \ \ KWH(version), \ \ diff --git a/src/lib/eolian/eo_parser.c b/src/lib/eolian/eo_parser.c index da606f91ca..cf8a25bc8c 100644 --- a/src/lib/eolian/eo_parser.c +++ b/src/lib/eolian/eo_parser.c @@ -1318,9 +1318,9 @@ parse_property(Eo_Lexer *ls) prop->get_scope = prop->set_scope = EOLIAN_SCOPE_PROTECTED; eo_lexer_get(ls); break; - case KW_at_class: + case KW_at_static: CASE_LOCK(ls, class, "class qualifier"); - prop->is_class = EINA_TRUE; + prop->is_static = EINA_TRUE; eo_lexer_get(ls); break; case KW_at_beta: @@ -1514,9 +1514,9 @@ parse_method(Eo_Lexer *ls) meth->obj_is_const = EINA_TRUE; eo_lexer_get(ls); break; - case KW_at_class: + case KW_at_static: CASE_LOCK(ls, class, "class qualifier"); - meth->is_class = EINA_TRUE; + meth->is_static = EINA_TRUE; eo_lexer_get(ls); break; case KW_at_beta: diff --git a/src/lib/eolian/eolian_database.h b/src/lib/eolian/eolian_database.h index 4c08874ab8..1e26e24a38 100644 --- a/src/lib/eolian/eolian_database.h +++ b/src/lib/eolian/eolian_database.h @@ -230,7 +230,7 @@ struct _Eolian_Function Eina_Bool obj_is_const :1; /* True if the object has to be const. Useful for a few methods. */ Eina_Bool get_return_no_unused :1; /* also used for methods */ Eina_Bool set_return_no_unused :1; - Eina_Bool is_class :1; + Eina_Bool is_static :1; Eina_List *ctor_of; Eolian_Class *klass; }; diff --git a/src/tests/efl_mono/dummy_inherit_helper.eo b/src/tests/efl_mono/dummy_inherit_helper.eo index 101c759390..f0f9183ebb 100644 --- a/src/tests/efl_mono/dummy_inherit_helper.eo +++ b/src/tests/efl_mono/dummy_inherit_helper.eo @@ -1,13 +1,13 @@ class Dummy.Inherit_Helper extends Efl.Object { methods { - receive_dummy_and_call_int_out @class { + receive_dummy_and_call_int_out @static { params { @in x: Dummy.Test_Object; } return: int; } - receive_dummy_and_call_in_stringshare @class { + receive_dummy_and_call_in_stringshare @static { params { @in x: Dummy.Inherit_Iface; } diff --git a/src/tests/efl_mono/dummy_test_object.eo b/src/tests/efl_mono/dummy_test_object.eo index e25f7b29bb..b6841db788 100644 --- a/src/tests/efl_mono/dummy_test_object.eo +++ b/src/tests/efl_mono/dummy_test_object.eo @@ -1569,7 +1569,7 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface { return: Dummy.MyInt; } - @property klass_prop @class { + @property klass_prop @static { get {} set {} values { @@ -1577,10 +1577,10 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface { } } - create_cmp_array_objects @class { + create_cmp_array_objects @static { } - destroy_cmp_array_objects @class { + destroy_cmp_array_objects @static { } /* Futures */ diff --git a/src/tests/eolian/data/class_funcs.eo b/src/tests/eolian/data/class_funcs.eo index 300e110b89..087f380003 100644 --- a/src/tests/eolian/data/class_funcs.eo +++ b/src/tests/eolian/data/class_funcs.eo @@ -1,6 +1,6 @@ class Class_Funcs { methods { - @property a @class { + @property a @static { get { } } @@ -8,11 +8,11 @@ class Class_Funcs { get { } } - foo @class { + foo @static { } bar { } - baz @protected @class { + baz @protected @static { } bah @protected { } From 2f147f272596306dc230a5085c5a5b21aae6ba3c Mon Sep 17 00:00:00 2001 From: Daniel Kolesa Date: Fri, 16 Aug 2019 16:32:13 +0200 Subject: [PATCH 04/10] eolian: rename is_class api for functions to is_static Still needs restriction to classes only etc to be done later. Ref https://phab.enlightenment.org/T8118 Ref https://phab.enlightenment.org/T7675 --- src/bin/eolian/docs.c | 2 +- src/bin/eolian/headers.c | 4 ++-- src/bin/eolian/sources.c | 20 ++++++++++---------- src/bindings/luajit/eolian.lua | 6 +++--- src/lib/eolian/Eolian.h | 4 ++-- src/lib/eolian/database_function_api.c | 2 +- src/lib/eolian_cxx/grammar/klass_def.hpp | 2 +- src/scripts/pyolian/eolian.py | 4 ++-- src/scripts/pyolian/eolian_lib.py | 6 +++--- src/scripts/pyolian/test_eolian.py | 2 +- src/tests/eolian/eolian_parsing.c | 12 ++++++------ 11 files changed, 32 insertions(+), 32 deletions(-) diff --git a/src/bin/eolian/docs.c b/src/bin/eolian/docs.c index e497581e83..498278f0e1 100644 --- a/src/bin/eolian/docs.c +++ b/src/bin/eolian/docs.c @@ -570,7 +570,7 @@ eo_gen_docs_func_gen(const Eolian_State *state, const Eolian_Function *fid, } } - if (!eolian_function_is_class(fid)) + if (!eolian_function_is_static(fid)) { _indent_line(buf, indent); eina_strbuf_append(buf, " * @param[in] obj The object.\n"); diff --git a/src/bin/eolian/headers.c b/src/bin/eolian/headers.c index a4a20c495c..3e433b5f29 100644 --- a/src/bin/eolian/headers.c +++ b/src/bin/eolian/headers.c @@ -129,13 +129,13 @@ _gen_func(const Eolian_State *state, const Eolian_Function *fid, eina_stringshare_del(fcn); Eina_Strbuf *flagbuf = NULL; - int nidx = !eolian_function_is_class(fid); + int nidx = !eolian_function_is_static(fid); eina_strbuf_append_char(buf, '('); if (nidx) { if ((ftype == EOLIAN_PROP_GET) || eolian_function_object_is_const(fid) - || eolian_function_is_class(fid)) + || eolian_function_is_static(fid)) { eina_strbuf_append(buf, "const "); } diff --git a/src/bin/eolian/sources.c b/src/bin/eolian/sources.c index ccf5cc35e9..93d78ebbd7 100644 --- a/src/bin/eolian/sources.c +++ b/src/bin/eolian/sources.c @@ -570,7 +570,7 @@ _gen_func(const Eolian_Class *cl, const Eolian_Function *fid, eina_strbuf_append(params, ", "); eina_strbuf_append(params, prn); - if (eina_strbuf_length_get(params_full) || !eolian_function_is_class(fid)) + if (eina_strbuf_length_get(params_full) || !eolian_function_is_static(fid)) { eina_strbuf_append(params_full, ", "); eina_strbuf_append(params_full_imp, ", "); @@ -660,7 +660,7 @@ _gen_func(const Eolian_Class *cl, const Eolian_Function *fid, if (eina_strbuf_length_get(params)) eina_strbuf_append(params, ", "); - if (eina_strbuf_length_get(params_full_imp) || !eolian_function_is_class(fid)) + if (eina_strbuf_length_get(params_full_imp) || !eolian_function_is_static(fid)) eina_strbuf_append(params_full_imp, ", "); eina_strbuf_append(params_full_imp, ptn); if (!had_star) @@ -671,7 +671,7 @@ _gen_func(const Eolian_Class *cl, const Eolian_Function *fid, eina_strbuf_append(params_full_imp, " EINA_UNUSED"); eina_strbuf_append(params, prn); - if (eina_strbuf_length_get(params_full) || !eolian_function_is_class(fid)) + if (eina_strbuf_length_get(params_full) || !eolian_function_is_static(fid)) eina_strbuf_append(params_full, ", "); eina_strbuf_append(params_full, ptn); if (!had_star) @@ -729,7 +729,7 @@ _gen_func(const Eolian_Class *cl, const Eolian_Function *fid, { /* figure out the data type */ Eina_Stringshare *dt = NULL; - if (eolian_function_is_class(fid)) + if (eolian_function_is_static(fid)) dt = eina_stringshare_add("void"); else dt = eolian_class_c_data_type_get(cl); @@ -751,7 +751,7 @@ _gen_func(const Eolian_Class *cl, const Eolian_Function *fid, eina_strbuf_append(buf, func_suffix); /* ([const ]Eo *obj, Data_Type *pd, impl_full_params); */ eina_strbuf_append_char(buf, '('); - if (!eolian_function_is_class(fid)) + if (!eolian_function_is_static(fid)) { if ((ftype == EOLIAN_PROP_GET) || eolian_function_object_is_const(fid)) eina_strbuf_append(buf, "const "); @@ -760,7 +760,7 @@ _gen_func(const Eolian_Class *cl, const Eolian_Function *fid, eina_strbuf_append(buf, " *pd"); } eina_strbuf_append(buf, eina_strbuf_string_get(params_full_imp)); - if (eina_strbuf_length_get(params_full_imp) == 0 && eolian_function_is_class(fid)) + if (eina_strbuf_length_get(params_full_imp) == 0 && eolian_function_is_static(fid)) eina_strbuf_append(buf, "void"); eina_strbuf_append(buf, ");\n\n"); } @@ -832,7 +832,7 @@ _gen_func(const Eolian_Class *cl, const Eolian_Function *fid, eina_stringshare_del(dt); } - if (impl_same_class && !eolian_function_is_class(fid)) + if (impl_same_class && !eolian_function_is_static(fid)) { /* generate reflection implementation */ if (reflect_type) @@ -875,7 +875,7 @@ _gen_func(const Eolian_Class *cl, const Eolian_Function *fid, if (has_params) eina_strbuf_append_char(buf, 'V'); if ((ftype == EOLIAN_PROP_GET) || eolian_function_object_is_const(fid) - || eolian_function_is_class(fid)) + || eolian_function_is_static(fid)) { eina_strbuf_append(buf, "_CONST"); } @@ -909,7 +909,7 @@ _gen_func(const Eolian_Class *cl, const Eolian_Function *fid, eina_stringshare_del(eofn); } - if (impl_same_class && eolian_function_is_class(fid)) + if (impl_same_class && eolian_function_is_static(fid)) _emit_class_function(buf, fid, rtp, params_full, ocnamel, func_suffix, params, eolian_function_full_c_name_get(fid, ftype)); free(cname); @@ -1003,7 +1003,7 @@ _gen_initializer(const Eolian_Class *cl, Eina_Strbuf *buf, Eina_Hash *refh) Eolian_Function_Type ftype; const Eolian_Function *fid = eolian_implement_function_get(imp, &ftype); - if (eolian_function_is_class(fid)) continue; + if (eolian_function_is_static(fid)) continue; if (!eina_strbuf_length_get(ops)) eina_strbuf_append_printf(ops, " EFL_OPS_DEFINE(ops,\n"); diff --git a/src/bindings/luajit/eolian.lua b/src/bindings/luajit/eolian.lua index 55ae838cd6..352057c184 100644 --- a/src/bindings/luajit/eolian.lua +++ b/src/bindings/luajit/eolian.lua @@ -366,7 +366,7 @@ ffi.cdef [[ const char *eolian_function_full_c_name_get(const Eolian_Function *function_id, Eolian_Function_Type ftype); const Eolian_Function *eolian_class_function_by_name_get(const Eolian_Class *klass, const char *func_name, Eolian_Function_Type f_type); const Eolian_Implement *eolian_function_implement_get(const Eolian_Function *function_id); - Eina_Bool eolian_function_is_class(const Eolian_Function *function_id); + Eina_Bool eolian_function_is_static(const Eolian_Function *function_id); Eina_Bool eolian_function_is_constructor(const Eolian_Function *function_id, const Eolian_Class *klass); Eina_Bool eolian_function_is_function_pointer(const Eolian_Function *function_id); Eina_Iterator *eolian_property_keys_get(const Eolian_Function *foo_id, Eolian_Function_Type ftype); @@ -1201,8 +1201,8 @@ M.Function = ffi.metatype("Eolian_Function", { return v end, - is_class = function(self) - return eolian.eolian_function_is_class(self) ~= 0 + is_static = function(self) + return eolian.eolian_function_is_static(self) ~= 0 end, is_constructor = function(self, klass) diff --git a/src/lib/eolian/Eolian.h b/src/lib/eolian/Eolian.h index 2c23da328e..970cc4c728 100644 --- a/src/lib/eolian/Eolian.h +++ b/src/lib/eolian/Eolian.h @@ -1741,14 +1741,14 @@ EAPI const Eolian_Function *eolian_class_function_by_name_get(const Eolian_Class EAPI const Eolian_Implement *eolian_function_implement_get(const Eolian_Function *function_id); /* - * @brief Get whether a function is a class method/property. + * @brief Get whether a function is a static method/property. * * @param[in] function_id Id of the function * @return EINA_TRUE and EINA_FALSE respectively * * @ingroup Eolian */ -EAPI Eina_Bool eolian_function_is_class(const Eolian_Function *function_id); +EAPI Eina_Bool eolian_function_is_static(const Eolian_Function *function_id); /* * @brief Get whether a function is beta. diff --git a/src/lib/eolian/database_function_api.c b/src/lib/eolian/database_function_api.c index 910f2b8462..104ac6e829 100644 --- a/src/lib/eolian/database_function_api.c +++ b/src/lib/eolian/database_function_api.c @@ -117,7 +117,7 @@ eolian_function_implement_get(const Eolian_Function *fid) } EAPI Eina_Bool -eolian_function_is_class(const Eolian_Function *fid) +eolian_function_is_static(const Eolian_Function *fid) { EINA_SAFETY_ON_NULL_RETURN_VAL(fid, EINA_FALSE); return fid->is_static; diff --git a/src/lib/eolian_cxx/grammar/klass_def.hpp b/src/lib/eolian_cxx/grammar/klass_def.hpp index f96595bdc3..74375159a0 100644 --- a/src/lib/eolian_cxx/grammar/klass_def.hpp +++ b/src/lib/eolian_cxx/grammar/klass_def.hpp @@ -811,7 +811,7 @@ struct function_def } } is_protected = eolian_function_scope_get(function, type) == EOLIAN_SCOPE_PROTECTED; - is_static = eolian_function_is_class(function); + is_static = eolian_function_is_static(function); Eolian_Implement const* implement = eolian_function_implement_get(function); if (!implement) diff --git a/src/scripts/pyolian/eolian.py b/src/scripts/pyolian/eolian.py index c287b57c35..8ec4716a67 100644 --- a/src/scripts/pyolian/eolian.py +++ b/src/scripts/pyolian/eolian.py @@ -865,8 +865,8 @@ class Function(Object): return self.scope_get(Eolian_Function_Type.PROP_SET) @cached_property - def is_class(self): - return bool(lib.eolian_function_is_class(self)) + def is_static(self): + return bool(lib.eolian_function_is_static(self)) @cached_property def object_is_const(self): diff --git a/src/scripts/pyolian/eolian_lib.py b/src/scripts/pyolian/eolian_lib.py index b9ba5f27fa..b532e98197 100644 --- a/src/scripts/pyolian/eolian_lib.py +++ b/src/scripts/pyolian/eolian_lib.py @@ -332,9 +332,9 @@ lib.eolian_function_full_c_name_get.restype = c_void_p # Stringshare TO BE FREE lib.eolian_function_implement_get.argtypes = (c_void_p,) lib.eolian_function_implement_get.restype = c_void_p -# EAPI Eina_Bool eolian_function_is_class(const Eolian_Function *function_id); -lib.eolian_function_is_class.argtypes = (c_void_p,) -lib.eolian_function_is_class.restype = c_bool +# EAPI Eina_Bool eolian_function_is_static(const Eolian_Function *function_id); +lib.eolian_function_is_static.argtypes = (c_void_p,) +lib.eolian_function_is_static.restype = c_bool # EAPI Eina_Bool eolian_function_is_constructor(const Eolian_Function *function_id, const Eolian_Class *klass); lib.eolian_function_is_constructor.argtypes = (c_void_p,c_void_p,) diff --git a/src/scripts/pyolian/test_eolian.py b/src/scripts/pyolian/test_eolian.py index b597e812b7..5313e4cbba 100755 --- a/src/scripts/pyolian/test_eolian.py +++ b/src/scripts/pyolian/test_eolian.py @@ -374,7 +374,7 @@ class TestEolianFunction(unittest.TestCase): self.assertIsNone(f.method_return_type) # TODO correct ? self.assertIsNone(f.setter_return_type) # TODO correct ? self.assertIsNone(f.getter_return_type) # TODO correct ? - self.assertFalse(f.is_class) + self.assertFalse(f.is_static) self.assertFalse(f.is_beta) self.assertFalse(f.is_constructor(cls)) # # #assert f.is_function_pointer == False # TODO broken somehow diff --git a/src/tests/eolian/eolian_parsing.c b/src/tests/eolian/eolian_parsing.c index 7d680af4ec..9d6a219655 100644 --- a/src/tests/eolian/eolian_parsing.c +++ b/src/tests/eolian/eolian_parsing.c @@ -1005,22 +1005,22 @@ EFL_START_TEST(eolian_class_funcs) /* Class properties */ fail_if(eolian_class_function_by_name_get(class, "a", EOLIAN_PROPERTY)); fail_if(!(fid = eolian_class_function_by_name_get(class, "a", EOLIAN_PROP_GET))); - fail_if(!eolian_function_is_class(fid)); + fail_if(!eolian_function_is_static(fid)); fail_if(!(fid = eolian_class_function_by_name_get(class, "b", EOLIAN_PROP_GET))); - fail_if(eolian_function_is_class(fid)); + fail_if(eolian_function_is_static(fid)); /* Class methods */ fail_if(!(fid = eolian_class_function_by_name_get(class, "foo", EOLIAN_METHOD))); - fail_if(!eolian_function_is_class(fid)); + fail_if(!eolian_function_is_static(fid)); fail_if(eolian_function_scope_get(fid, EOLIAN_METHOD) != EOLIAN_SCOPE_PUBLIC); fail_if(!(fid = eolian_class_function_by_name_get(class, "bar", EOLIAN_METHOD))); - fail_if(eolian_function_is_class(fid)); + fail_if(eolian_function_is_static(fid)); fail_if(eolian_function_scope_get(fid, EOLIAN_METHOD) != EOLIAN_SCOPE_PUBLIC); fail_if(!(fid = eolian_class_function_by_name_get(class, "baz", EOLIAN_METHOD))); - fail_if(!eolian_function_is_class(fid)); + fail_if(!eolian_function_is_static(fid)); fail_if(eolian_function_scope_get(fid, EOLIAN_METHOD) != EOLIAN_SCOPE_PROTECTED); fail_if(!(fid = eolian_class_function_by_name_get(class, "bah", EOLIAN_METHOD))); - fail_if(eolian_function_is_class(fid)); + fail_if(eolian_function_is_static(fid)); fail_if(eolian_function_scope_get(fid, EOLIAN_METHOD) != EOLIAN_SCOPE_PROTECTED); eolian_state_free(eos); From 49602f7426f3b651b9b36987fe9ccea9d014387e Mon Sep 17 00:00:00 2001 From: "Carsten Haitzler (Rasterman)" Date: Sun, 18 Aug 2019 00:25:39 +0100 Subject: [PATCH 05/10] elm hoversel - avoid crash when items modified while popping down this fixes a crash i saw with asan on pop down if items change at that time. @fix --- src/lib/elementary/elc_hoversel.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/lib/elementary/elc_hoversel.c b/src/lib/elementary/elc_hoversel.c index baee718c15..b882b87833 100644 --- a/src/lib/elementary/elc_hoversel.c +++ b/src/lib/elementary/elc_hoversel.c @@ -604,6 +604,7 @@ _elm_hoversel_item_efl_object_destructor(Eo *eo_item, Elm_Hoversel_Item_Data *it { ELM_HOVERSEL_DATA_GET_OR_RETURN(WIDGET(item), sd); + evas_object_event_callback_del_full(sd->hover, EVAS_CALLBACK_DEL, _auto_update, eo_item); elm_hoversel_hover_end(WIDGET(item)); sd->items = eina_list_remove(sd->items, eo_item); eina_stringshare_del(item->label); @@ -658,6 +659,7 @@ _elm_hoversel_efl_canvas_group_group_del(Eo *obj, Elm_Hoversel_Data *sd) { Elm_Object_Item *eo_item; + evas_object_event_callback_del(sd->hover, EVAS_CALLBACK_DEL, _auto_update); EINA_LIST_FREE(sd->items, eo_item) { ELM_HOVERSEL_ITEM_DATA_GET(eo_item, it); @@ -808,9 +810,9 @@ EOLIAN static void _elm_hoversel_clear(Eo *obj EINA_UNUSED, Elm_Hoversel_Data *sd) { Elm_Object_Item *it; - Eina_List *l, *ll; - EINA_LIST_FOREACH_SAFE(sd->items, l, ll, it) + evas_object_event_callback_del(sd->hover, EVAS_CALLBACK_DEL, _auto_update); + EINA_LIST_FREE(sd->items, it) { efl_del(it); } From b2ab0a7788d90440a564ff342a7fd7e3cad0c153 Mon Sep 17 00:00:00 2001 From: "Carsten Haitzler (Rasterman)" Date: Sun, 18 Aug 2019 09:57:42 +0100 Subject: [PATCH 06/10] evas - loader - rsvg generic - install svg symlink svg loading broke as we didnt have the right symlink installed after a binary file name change. this fixes that. --- src/generic/evas/rsvg/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/generic/evas/rsvg/meson.build b/src/generic/evas/rsvg/meson.build index 4e39e74ee5..a0c5ea12ce 100644 --- a/src/generic/evas/rsvg/meson.build +++ b/src/generic/evas/rsvg/meson.build @@ -9,4 +9,4 @@ if rsvg.version() >= '2.36.0' endif generic_deps = [rsvg] -generic_support = ['svgz', 'svg.gz'] +generic_support = ['svg', 'svgz', 'svg.gz'] From ae5fbe49ef9257a75da3c23febe2afa88f0751e2 Mon Sep 17 00:00:00 2001 From: "Carsten Haitzler (Rasterman)" Date: Sun, 18 Aug 2019 10:28:51 +0100 Subject: [PATCH 07/10] elm slider - delete timers on destruction that should be deleted also use safe free to set to null --- src/lib/elementary/elm_slider.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/lib/elementary/elm_slider.c b/src/lib/elementary/elm_slider.c index 97b348bdb4..eab59c1c0d 100644 --- a/src/lib/elementary/elm_slider.c +++ b/src/lib/elementary/elm_slider.c @@ -62,6 +62,7 @@ _delay_change(void *data) { ELM_SLIDER_DATA_GET(data, sd); + if (!sd) return ECORE_CALLBACK_CANCEL; sd->delay = NULL; evas_object_smart_callback_call(data, SIG_DELAY_CHANGED, NULL); @@ -972,15 +973,16 @@ EOLIAN static void _elm_slider_efl_object_destructor(Eo *obj, Elm_Slider_Data *sd) { - ecore_timer_del(sd->wheel_indicator_timer); - evas_object_del(sd->popup); - evas_object_del(sd->popup2); + ELM_SAFE_FREE(sd->delay, ecore_timer_del); + ELM_SAFE_FREE(sd->wheel_indicator_timer, ecore_timer_del); + ELM_SAFE_FREE(sd->popup, evas_object_del); + ELM_SAFE_FREE(sd->popup2, evas_object_del); ELM_SAFE_FREE(sd->indi_template, eina_stringshare_del); - eina_strbuf_free(sd->indi_format_strbuf); + ELM_SAFE_FREE(sd->indi_format_strbuf, eina_strbuf_free); efl_ui_format_func_set(obj, NULL, NULL, NULL); - eina_strbuf_free(sd->format_strbuf); + ELM_SAFE_FREE(sd->format_strbuf, eina_strbuf_free); efl_destructor(efl_super(obj, MY_CLASS)); } From a6e679f830b85e0f6512bd8b3c102d07875e07f4 Mon Sep 17 00:00:00 2001 From: Felipe Magno de Almeida Date: Fri, 16 Aug 2019 18:16:50 +0000 Subject: [PATCH 08/10] eo-cxx: Add second NULL sentinel to avoid buffer overrun by efl_check.h efl_check.h assumes at least one element exists when checking parallelization and accesses the second element of the array without checking its size first. Adding a second NULL sentinel fixes the problem. T8141 Differential Revision: https://phab.enlightenment.org/D9588 --- src/tests/eo_cxx/eo_cxx_suite.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/tests/eo_cxx/eo_cxx_suite.cc b/src/tests/eo_cxx/eo_cxx_suite.cc index 11e014ffff..8fbc30aaeb 100644 --- a/src/tests/eo_cxx/eo_cxx_suite.cc +++ b/src/tests/eo_cxx/eo_cxx_suite.cc @@ -7,6 +7,7 @@ static const Efl_Test_Case etc[] = { { NULL, NULL } + , { NULL, NULL } }; int From 375f22931e66b3f5db51d303db09211ed3145d34 Mon Sep 17 00:00:00 2001 From: Marcel Hollerbach Date: Thu, 15 Aug 2019 18:49:51 +0200 Subject: [PATCH 09/10] meson: there is no need for checking ecore here fix T7768 Differential Revision: https://phab.enlightenment.org/D9574 --- src/examples/ecore/meson.build | 2 +- src/lib/ecore/meson.build | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/src/examples/ecore/meson.build b/src/examples/ecore/meson.build index 46a3e9ffc9..197d88f083 100644 --- a/src/examples/ecore/meson.build +++ b/src/examples/ecore/meson.build @@ -31,7 +31,7 @@ if get_option('gstreamer') == true examples = [ 'ecore_pipe_gstreamer_example', ] - + gstreamer = dependency('gstreamer-1.0') foreach example : examples executable(example, example + '.c', dependencies: [eina, ecore, gstreamer, ecore_file]) endforeach diff --git a/src/lib/ecore/meson.build b/src/lib/ecore/meson.build index b34276c3cc..c8859439b2 100644 --- a/src/lib/ecore/meson.build +++ b/src/lib/ecore/meson.build @@ -195,11 +195,6 @@ if get_option('g-mainloop') == true config_h.set('USE_G_MAIN_LOOP', '1') endif -if get_option('gstreamer') == true - gstreamer = dependency('gstreamer-1.0') - ecore_deps += gstreamer -endif - if get_option('systemd') == true ecore_deps += systemd endif From f10a3c9ee36cd270045f7e30fd3716ef15e3106d Mon Sep 17 00:00:00 2001 From: Hermet Park Date: Mon, 19 Aug 2019 18:04:38 +0900 Subject: [PATCH 10/10] edje: fix compatibility issue. Obviously previous edje object file set would try reload file even though the file is already loaded. This brings different result if the file data has been modified or changed. --- src/lib/edje/edje_smart.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib/edje/edje_smart.c b/src/lib/edje/edje_smart.c index 7b97bd303e..977832015f 100644 --- a/src/lib/edje/edje_smart.c +++ b/src/lib/edje/edje_smart.c @@ -443,6 +443,7 @@ edje_object_mmap_set(Edje_Object *obj, const Eina_File *file, const char *group) EAPI Eina_Bool edje_object_file_set(Edje_Object *obj, const char *file, const char *group) { + efl_file_unload(obj); return efl_file_simple_load(obj, file, group); }