[glibmm/vector] Removed ownership parameter from methods converting from C++ to C.
- From: Krzesimir Nowak <krnowak src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glibmm/vector] Removed ownership parameter from methods converting from C++ to C.
- Date: Thu, 20 Jan 2011 20:35:10 +0000 (UTC)
commit 4b494a1858aee47e1330f3e2a0fa9e8a470dc337
Author: Krzesimir Nowak <qdlacz gmail com>
Date: Wed Jan 19 21:20:37 2011 +0100
Removed ownership parameter from methods converting from C++ to C.
Ownership in such cases is always shallow.
glib/glibmm/vectorutils.h | 18 +++++++++---------
tests/glibmm_vector/main.cc | 6 +++---
2 files changed, 12 insertions(+), 12 deletions(-)
---
diff --git a/glib/glibmm/vectorutils.h b/glib/glibmm/vectorutils.h
index cafeb9d..75a46d8 100644
--- a/glib/glibmm/vectorutils.h
+++ b/glib/glibmm/vectorutils.h
@@ -324,9 +324,9 @@ public:
static VectorType array_to_vector (const CType* array, Glib::OwnershipType ownership);
static VectorType list_to_vector (GList* glist, Glib::OwnershipType ownership);
static VectorType slist_to_vector (GSList* gslist, Glib::OwnershipType ownership);
- static ArrayKeeperType vector_to_array (const VectorType& vector, Glib::OwnershipType ownership);
- static GListKeeperType vector_to_list (const VectorType& vector, Glib::OwnershipType ownership);
- static GSListKeeperType vector_to_slist (const VectorType& vector, Glib::OwnershipType ownership);
+ static ArrayKeeperType vector_to_array (const VectorType& vector);
+ static GListKeeperType vector_to_list (const VectorType& vector);
+ static GSListKeeperType vector_to_slist (const VectorType& vector);
};
/***************************************************************************/
@@ -717,23 +717,23 @@ VectorHandler<T, Tr>::slist_to_vector (GSList* gslist, Glib::OwnershipType owner
template <typename T, class Tr>
typename VectorHandler<T, Tr>::ArrayKeeperType
-VectorHandler<T, Tr>::vector_to_array (const VectorType& vector, Glib::OwnershipType ownership)
+VectorHandler<T, Tr>::vector_to_array (const VectorType& vector)
{
- return ArrayKeeperType (Glib::Container_Helpers::create_array2<Tr> (vector.begin (), vector.size ()), vector.size(), ownership);
+ return ArrayKeeperType (Glib::Container_Helpers::create_array2<Tr> (vector.begin (), vector.size ()), vector.size(), Glib::OWNERSHIP_SHALLOW);
}
template <typename T, class Tr>
typename VectorHandler<T, Tr>::GListKeeperType
-VectorHandler<T, Tr>::vector_to_list (const VectorType& vector, Glib::OwnershipType ownership)
+VectorHandler<T, Tr>::vector_to_list (const VectorType& vector)
{
- return GListKeeperType (Glib::Container_Helpers::create_glist2<Tr> (vector.begin(), vector.end()), ownership);
+ return GListKeeperType (Glib::Container_Helpers::create_glist2<Tr> (vector.begin(), vector.end()), Glib::OWNERSHIP_SHALLOW);
}
template <typename T, class Tr>
typename VectorHandler<T, Tr>::GSListKeeperType
-VectorHandler<T, Tr>::vector_to_slist (const VectorType& vector, Glib::OwnershipType ownership)
+VectorHandler<T, Tr>::vector_to_slist (const VectorType& vector)
{
- return GSListKeeperType (Glib::Container_Helpers::create_gslist2<Tr> (vector.begin (), vector.end ()), ownership);
+ return GSListKeeperType (Glib::Container_Helpers::create_gslist2<Tr> (vector.begin (), vector.end ()), Glib::OWNERSHIP_SHALLOW);
}
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
diff --git a/tests/glibmm_vector/main.cc b/tests/glibmm_vector/main.cc
index 474bfe3..8f41afc 100644
--- a/tests/glibmm_vector/main.cc
+++ b/tests/glibmm_vector/main.cc
@@ -490,7 +490,7 @@ cxx_list_take_members (const std::vector<Glib::RefPtr<Gio::Credentials> >& v)
void
cxx_list_take_nothing (const std::vector<Glib::RefPtr<Gio::Credentials> >& v)
{
- take_list_nothing (Glib::VectorHandler<Glib::RefPtr<Gio::Credentials> >::vector_to_list (v, Glib::OWNERSHIP_SHALLOW));
+ take_list_nothing (Glib::VectorHandler<Glib::RefPtr<Gio::Credentials> >::vector_to_list (v));
}
/* they are probably buggy by design...
@@ -510,7 +510,7 @@ cxx_slist_take_members (const std::vector<Glib::RefPtr<Gio::Credentials> >& v)
void
cxx_slist_take_nothing (const std::vector<Glib::RefPtr<Gio::Credentials> >& v)
{
- take_slist_nothing (Glib::VectorHandler<Glib::RefPtr<Gio::Credentials> >::vector_to_slist (v, Glib::OWNERSHIP_SHALLOW));
+ take_slist_nothing (Glib::VectorHandler<Glib::RefPtr<Gio::Credentials> >::vector_to_slist (v));
}
/* they are probably buggy by design...
@@ -530,7 +530,7 @@ cxx_array_take_members (const std::vector<Glib::RefPtr<Gio::Credentials> >& v)
void
cxx_array_take_nothing (const std::vector<Glib::RefPtr<Gio::Credentials> >& v)
{
- take_array_nothing (Glib::VectorHandler<Glib::RefPtr<Gio::Credentials> >::vector_to_array (v, Glib::OWNERSHIP_SHALLOW));
+ take_array_nothing (Glib::VectorHandler<Glib::RefPtr<Gio::Credentials> >::vector_to_array (v));
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]