tasn pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=72c623603830557b9582774e5e9575629036007d

commit 72c623603830557b9582774e5e9575629036007d
Author: Tom Hacohen <t...@stosb.com>
Date:   Fri Mar 11 12:28:51 2016 +0000

    Revert "cxx: Migrate C++ binding to the new eo_add syntax"
    
    This reverts commit 48f62ad686d11c97ec62b1ba528262edf39cafbf.
---
 src/bindings/eo_cxx/eo_inherit.hh                  |  3 +-
 src/bindings/eo_cxx/eo_ops.hh                      |  3 +-
 .../grammar/eo_class_constructors_generator.hh     |  7 ++-
 src/tests/eina_cxx/eina_cxx_test_accessor.cc       | 18 ++++----
 src/tests/eina_cxx/eina_cxx_test_ptrarray.cc       | 54 ++++++++++------------
 src/tests/eina_cxx/eina_cxx_test_ptrlist.cc        | 50 +++++++++-----------
 6 files changed, 59 insertions(+), 76 deletions(-)

diff --git a/src/bindings/eo_cxx/eo_inherit.hh 
b/src/bindings/eo_cxx/eo_inherit.hh
index 1d3d312..9639e33 100644
--- a/src/bindings/eo_cxx/eo_inherit.hh
+++ b/src/bindings/eo_cxx/eo_inherit.hh
@@ -83,10 +83,9 @@ struct inherit
    ///
    template<typename... Args>
    inherit(efl::eo::parent_type _p, Args&& ... args)
-     : _eo_cls(nullptr), _eo_raw(nullptr)
    {
       _eo_cls = detail::create_class<D, E...> 
(eina::make_index_sequence<sizeof...(E)>());
-      eo_add_ref(&_eo_raw, _eo_cls, _p._eo_raw, 
detail::inherit_constructor(_eo_raw, this), ::efl::eolian::call_ctors(_eo_raw, 
args...));
+      _eo_raw = eo_add_ref(_eo_cls, _p._eo_raw, 
detail::inherit_constructor(eoid, this), ::efl::eolian::call_ctors(eoid, 
args...));
       ::efl::eolian::register_ev_del_free_callback(_eo_raw, args...);
   }
 
diff --git a/src/bindings/eo_cxx/eo_ops.hh b/src/bindings/eo_cxx/eo_ops.hh
index 653dcf3..f2d5133 100644
--- a/src/bindings/eo_cxx/eo_ops.hh
+++ b/src/bindings/eo_cxx/eo_ops.hh
@@ -60,8 +60,7 @@ isa(const Eo *obj, const Eo_Class *klass)
 inline Eo*
 add(const Eo_Class *klass, Eo *parent = NULL)
 {
-   Eo *eo = nullptr;
-   eo_add_ref(&eo, klass, parent);
+   Eo *eo = eo_add_ref(klass, parent);
    return eo;
 }
 
diff --git a/src/lib/eolian_cxx/grammar/eo_class_constructors_generator.hh 
b/src/lib/eolian_cxx/grammar/eo_class_constructors_generator.hh
index 9fde23a..2a7091a 100644
--- a/src/lib/eolian_cxx/grammar/eo_class_constructors_generator.hh
+++ b/src/lib/eolian_cxx/grammar/eo_class_constructors_generator.hh
@@ -577,14 +577,13 @@ operator<<(std::ostream& out, 
function_call_constructor_methods const& x)
 
    out << ")" << endl
        << tab(1) << "{" << endl
-       << tab(2) << "Eo* _ret_eo = nullptr;" << endl
-       << tab(2) << "eo_add_ref(&_ret_eo, " << x._cls.eo_name << ", 
_p._eo_raw";
+       << tab(2) << "Eo* _ret_eo = eo_add_ref(" << x._cls.eo_name << ", 
_p._eo_raw";
    for (it = first; it != last; ++it)
      {
-        out << ", _c" << (it-first) << "(_ret_eo)";
+        out << ", _c" << (it-first) << "(eoid)";
      }
    if (!x._cls.optional_constructors.empty())
-     out << ", ::efl::eolian::call_ctors(_ret_eo, _opts...)";
+     out << ", ::efl::eolian::call_ctors(eoid, _opts...)";
    out << ");" << endl << endl;
 
    for (it = first; it != last; ++it)
diff --git a/src/tests/eina_cxx/eina_cxx_test_accessor.cc 
b/src/tests/eina_cxx/eina_cxx_test_accessor.cc
index 47cb62b..9737f0d 100644
--- a/src/tests/eina_cxx/eina_cxx_test_accessor.cc
+++ b/src/tests/eina_cxx/eina_cxx_test_accessor.cc
@@ -43,11 +43,10 @@ START_TEST(eina_cxx_eo_accessor_indexing)
 
   efl::eina::list<wrapper> list;
 
-  Eo* eoptr = nullptr;
-  wrapper const w1(eo_add(&eoptr, SIMPLE_CLASS, NULL));
-  wrapper const w2(eo_add(&eoptr, SIMPLE_CLASS, NULL));
-  wrapper const w3(eo_add(&eoptr, SIMPLE_CLASS, NULL));
-  wrapper const w4(eo_add(&eoptr, SIMPLE_CLASS, NULL));
+  wrapper const w1(eo_add(SIMPLE_CLASS, NULL));
+  wrapper const w2(eo_add(SIMPLE_CLASS, NULL));
+  wrapper const w3(eo_add(SIMPLE_CLASS, NULL));
+  wrapper const w4(eo_add(SIMPLE_CLASS, NULL));
 
   list.push_back(w1);
   list.push_back(w2);
@@ -98,11 +97,10 @@ START_TEST(eina_cxx_eo_accessor_iterator)
 
   efl::eina::list<wrapper> list;
 
-  Eo* eoptr = nullptr;
-  wrapper const w1(eo_add(&eoptr, SIMPLE_CLASS, NULL));
-  wrapper const w2(eo_add(&eoptr, SIMPLE_CLASS, NULL));
-  wrapper const w3(eo_add(&eoptr, SIMPLE_CLASS, NULL));
-  wrapper const w4(eo_add(&eoptr, SIMPLE_CLASS, NULL));
+  wrapper const w1(eo_add(SIMPLE_CLASS, NULL));
+  wrapper const w2(eo_add(SIMPLE_CLASS, NULL));
+  wrapper const w3(eo_add(SIMPLE_CLASS, NULL));
+  wrapper const w4(eo_add(SIMPLE_CLASS, NULL));
 
   list.push_back(w1);
   list.push_back(w2);
diff --git a/src/tests/eina_cxx/eina_cxx_test_ptrarray.cc 
b/src/tests/eina_cxx/eina_cxx_test_ptrarray.cc
index 4b7fce3..6b2f627 100644
--- a/src/tests/eina_cxx/eina_cxx_test_ptrarray.cc
+++ b/src/tests/eina_cxx/eina_cxx_test_ptrarray.cc
@@ -26,10 +26,9 @@ START_TEST(eina_cxx_ptrarray_push_back)
   int result[] = {5, 10, 15};
   int rresult[] = {15, 10, 5};
 
-  Eo* eoptr = nullptr;
-  wrapper const w1(eo_add(&eoptr, SIMPLE_CLASS, NULL));
-  wrapper const w2(eo_add(&eoptr, SIMPLE_CLASS, NULL));
-  wrapper const w3(eo_add(&eoptr, SIMPLE_CLASS, NULL));
+  wrapper const w1(eo_add(SIMPLE_CLASS, NULL));
+  wrapper const w2(eo_add(SIMPLE_CLASS, NULL));
+  wrapper const w3(eo_add(SIMPLE_CLASS, NULL));
 
   {
     efl::eina::ptr_array<int> array;
@@ -103,10 +102,9 @@ START_TEST(eina_cxx_ptrarray_pop_back)
     ck_assert(std::equal(array.rbegin(), array.rend(), rresult));
   }
   {
-    Eo* eoptr = nullptr;
-    wrapper const w1(eo_add(&eoptr, SIMPLE_CLASS, NULL));
-    wrapper const w2(eo_add(&eoptr, SIMPLE_CLASS, NULL));
-    wrapper const w3(eo_add(&eoptr, SIMPLE_CLASS, NULL));
+    wrapper const w1(eo_add(SIMPLE_CLASS, NULL));
+    wrapper const w2(eo_add(SIMPLE_CLASS, NULL));
+    wrapper const w3(eo_add(SIMPLE_CLASS, NULL));
 
     efl::eina::array<wrapper> array;
 
@@ -199,12 +197,11 @@ START_TEST(eina_cxx_ptrarray_insert)
     ck_assert(std::equal(array.begin(), array.end(), array4.begin()));
   }
   {
-    Eo* eoptr = nullptr;
-    wrapper const w0(eo_add(&eoptr, SIMPLE_CLASS, NULL));
-    wrapper const w1(eo_add(&eoptr, SIMPLE_CLASS, NULL));
-    wrapper const w2(eo_add(&eoptr, SIMPLE_CLASS, NULL));
-    wrapper const w3(eo_add(&eoptr, SIMPLE_CLASS, NULL));
-    wrapper const w4(eo_add(&eoptr, SIMPLE_CLASS, NULL));
+    wrapper const w0(eo_add(SIMPLE_CLASS, NULL));
+    wrapper const w1(eo_add(SIMPLE_CLASS, NULL));
+    wrapper const w2(eo_add(SIMPLE_CLASS, NULL));
+    wrapper const w3(eo_add(SIMPLE_CLASS, NULL));
+    wrapper const w4(eo_add(SIMPLE_CLASS, NULL));
 
     efl::eina::array<wrapper> array;
     ck_assert(std::distance(array.begin(), array.end()) == 0u);
@@ -280,8 +277,7 @@ START_TEST(eina_cxx_ptrarray_constructors)
   efl::eina::eina_init eina_init;
   efl::eo::eo_init eo_init;
 
-  Eo* eoptr = nullptr;
-  wrapper const w1(eo_add(&eoptr, SIMPLE_CLASS, NULL));
+  wrapper const w1(eo_add(SIMPLE_CLASS, NULL));
 
   {
     efl::eina::ptr_array<int> array1;
@@ -360,13 +356,12 @@ START_TEST(eina_cxx_ptrarray_erase)
     ck_assert(array1.back() == 25);
   }
   {
-    Eo* eoptr = nullptr;
-    wrapper const w1(eo_add(&eoptr, SIMPLE_CLASS, NULL));
-    wrapper const w2(eo_add(&eoptr, SIMPLE_CLASS, NULL));
-    wrapper const w3(eo_add(&eoptr, SIMPLE_CLASS, NULL));
-    wrapper const w4(eo_add(&eoptr, SIMPLE_CLASS, NULL));
-    wrapper const w5(eo_add(&eoptr, SIMPLE_CLASS, NULL));
-    wrapper const w6(eo_add(&eoptr, SIMPLE_CLASS, NULL));
+    wrapper const w1(eo_add(SIMPLE_CLASS, NULL));
+    wrapper const w2(eo_add(SIMPLE_CLASS, NULL));
+    wrapper const w3(eo_add(SIMPLE_CLASS, NULL));
+    wrapper const w4(eo_add(SIMPLE_CLASS, NULL));
+    wrapper const w5(eo_add(SIMPLE_CLASS, NULL));
+    wrapper const w6(eo_add(SIMPLE_CLASS, NULL));
 
     efl::eina::array<wrapper> array1;
 
@@ -442,13 +437,12 @@ START_TEST(eina_cxx_ptrarray_range)
   }
 
   {
-    Eo* eoptr = nullptr;
-    wrapper const w1(eo_add(&eoptr, SIMPLE_CLASS, NULL));
-    wrapper const w2(eo_add(&eoptr, SIMPLE_CLASS, NULL));
-    wrapper const w3(eo_add(&eoptr, SIMPLE_CLASS, NULL));
-    wrapper const w4(eo_add(&eoptr, SIMPLE_CLASS, NULL));
-    wrapper const w5(eo_add(&eoptr, SIMPLE_CLASS, NULL));
-    wrapper const w6(eo_add(&eoptr, SIMPLE_CLASS, NULL));
+    wrapper const w1(eo_add(SIMPLE_CLASS, NULL));
+    wrapper const w2(eo_add(SIMPLE_CLASS, NULL));
+    wrapper const w3(eo_add(SIMPLE_CLASS, NULL));
+    wrapper const w4(eo_add(SIMPLE_CLASS, NULL));
+    wrapper const w5(eo_add(SIMPLE_CLASS, NULL));
+    wrapper const w6(eo_add(SIMPLE_CLASS, NULL));
 
     efl::eina::array<wrapper> array;
     array.push_back(w1);
diff --git a/src/tests/eina_cxx/eina_cxx_test_ptrlist.cc 
b/src/tests/eina_cxx/eina_cxx_test_ptrlist.cc
index 2c10263..039ef97 100644
--- a/src/tests/eina_cxx/eina_cxx_test_ptrlist.cc
+++ b/src/tests/eina_cxx/eina_cxx_test_ptrlist.cc
@@ -28,10 +28,9 @@ START_TEST(eina_cxx_ptrlist_push_back)
   int result[] = {5, 10, 15};
   int rresult[] = {15, 10, 5};
 
-  Eo* eoptr = nullptr;
-  wrapper const w1(eo_add(&eoptr, SIMPLE_CLASS, NULL));
-  wrapper const w2(eo_add(&eoptr, SIMPLE_CLASS, NULL));
-  wrapper const w3(eo_add(&eoptr, SIMPLE_CLASS, NULL));
+  wrapper const w1(eo_add(SIMPLE_CLASS, NULL));
+  wrapper const w2(eo_add(SIMPLE_CLASS, NULL));
+  wrapper const w3(eo_add(SIMPLE_CLASS, NULL));
 
   {
     efl::eina::ptr_list<int> list;
@@ -78,10 +77,9 @@ START_TEST(eina_cxx_ptrlist_pop_back)
   int result[] = {5, 10};
   int rresult[] = {10, 5};
 
-  Eo* eoptr = nullptr;
-  wrapper const w1(eo_add(&eoptr, SIMPLE_CLASS, NULL));
-  wrapper const w2(eo_add(&eoptr, SIMPLE_CLASS, NULL));
-  wrapper const w3(eo_add(&eoptr, SIMPLE_CLASS, NULL));
+  wrapper const w1(eo_add(SIMPLE_CLASS, NULL));
+  wrapper const w2(eo_add(SIMPLE_CLASS, NULL));
+  wrapper const w3(eo_add(SIMPLE_CLASS, NULL));
 
   {
     efl::eina::ptr_list<int> list;
@@ -145,10 +143,9 @@ START_TEST(eina_cxx_ptrlist_push_front)
     ck_assert(std::equal(list.rbegin(), list.rend(), rresult));
   }
   {
-    Eo* eoptr = nullptr;
-    wrapper const w1(eo_add(&eoptr, SIMPLE_CLASS, NULL));
-    wrapper const w2(eo_add(&eoptr, SIMPLE_CLASS, NULL));
-    wrapper const w3(eo_add(&eoptr, SIMPLE_CLASS, NULL));
+    wrapper const w1(eo_add(SIMPLE_CLASS, NULL));
+    wrapper const w2(eo_add(SIMPLE_CLASS, NULL));
+    wrapper const w3(eo_add(SIMPLE_CLASS, NULL));
 
     efl::eina::list<wrapper> list;
 
@@ -174,10 +171,9 @@ START_TEST(eina_cxx_ptrlist_pop_front)
   int result[] = {10, 5};
   int rresult[] = {5, 10};
 
-  Eo* eoptr = nullptr;
-  wrapper const w1(eo_add(&eoptr, SIMPLE_CLASS, NULL));
-  wrapper const w2(eo_add(&eoptr, SIMPLE_CLASS, NULL));
-  wrapper const w3(eo_add(&eoptr, SIMPLE_CLASS, NULL));
+  wrapper const w1(eo_add(SIMPLE_CLASS, NULL));
+  wrapper const w2(eo_add(SIMPLE_CLASS, NULL));
+  wrapper const w3(eo_add(SIMPLE_CLASS, NULL));
 
   {
     efl::eina::ptr_list<int> list;
@@ -277,12 +273,11 @@ START_TEST(eina_cxx_ptrlist_insert)
     ck_assert(std::equal(list.begin(), list.end(), list4.begin()));
   }
   {
-    Eo* eoptr = nullptr;
-    wrapper const w0(eo_add(&eoptr, SIMPLE_CLASS, NULL));
-    wrapper const w1(eo_add(&eoptr, SIMPLE_CLASS, NULL));
-    wrapper const w2(eo_add(&eoptr, SIMPLE_CLASS, NULL));
-    wrapper const w3(eo_add(&eoptr, SIMPLE_CLASS, NULL));
-    wrapper const w4(eo_add(&eoptr, SIMPLE_CLASS, NULL));
+    wrapper const w0(eo_add(SIMPLE_CLASS, NULL));
+    wrapper const w1(eo_add(SIMPLE_CLASS, NULL));
+    wrapper const w2(eo_add(SIMPLE_CLASS, NULL));
+    wrapper const w3(eo_add(SIMPLE_CLASS, NULL));
+    wrapper const w4(eo_add(SIMPLE_CLASS, NULL));
 
     efl::eina::list<wrapper> list;
 
@@ -371,12 +366,11 @@ START_TEST(eina_cxx_ptrlist_constructors)
     ck_assert(list2 == list4);
   }
   {
-    Eo* eoptr = nullptr;
-    wrapper const w0(eo_add(&eoptr, SIMPLE_CLASS, NULL));
-    wrapper const w1(eo_add(&eoptr, SIMPLE_CLASS, NULL));
-    wrapper const w2(eo_add(&eoptr, SIMPLE_CLASS, NULL));
-    wrapper const w3(eo_add(&eoptr, SIMPLE_CLASS, NULL));
-    wrapper const w4(eo_add(&eoptr, SIMPLE_CLASS, NULL));
+    wrapper const w0(eo_add(SIMPLE_CLASS, NULL));
+    wrapper const w1(eo_add(SIMPLE_CLASS, NULL));
+    wrapper const w2(eo_add(SIMPLE_CLASS, NULL));
+    wrapper const w3(eo_add(SIMPLE_CLASS, NULL));
+    wrapper const w4(eo_add(SIMPLE_CLASS, NULL));
 
     efl::eina::list<wrapper> list1;
     ck_assert(list1.empty());

-- 


Reply via email to