[glibmm] Gio::UnixFDList: peek_fds(): Made return const for emphasis.



commit 657bb688c9c1aacbfadec417fc58c0dfa226127e
Author: José Alburquerque <jaalburqu svn gnome org>
Date:   Tue Jul 27 17:46:39 2010 -0400

    	Gio::UnixFDList: peek_fds(): Made return const for emphasis.
    
    	* gio/src/unixfdlist.ccg:
    	* gio/src/unixfdlist.hg: Remove redundant paragraph in class docs.
    	(peek_fds): Made return const to emphasize that the file descriptors
    	should not be modified.
    	(steal_fds): Remove unnecessary const_cast<>.

 ChangeLog              |   10 ++++++++++
 gio/src/unixfdlist.ccg |    5 ++---
 gio/src/unixfdlist.hg  |    6 +-----
 3 files changed, 13 insertions(+), 8 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index e8c60b9..b3dc1c7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2010-07-27  José Alburquerque  <jaalburqu svn gnome org>
+
+	Gio::UnixFDList: peek_fds(): Made return const for emphasis.
+
+	* gio/src/unixfdlist.ccg:
+	* gio/src/unixfdlist.hg: Remove redundant paragraph in class docs.
+	(peek_fds): Made return const to emphasize that the file descriptors
+	should not be modified.  
+	(steal_fds): Remove unnecessary const_cast<>.
+
 2010-07-26  José Alburquerque  <jaalburqu svn gnome org>
 
 	Gio::UnixFDList: Add params and returns in create() method docs.
diff --git a/gio/src/unixfdlist.ccg b/gio/src/unixfdlist.ccg
index 9b69c15..26cfe99 100644
--- a/gio/src/unixfdlist.ccg
+++ b/gio/src/unixfdlist.ccg
@@ -26,7 +26,7 @@ UnixFDList::UnixFDList(const Glib::ArrayHandle<int>& fds)
 : _CONSTRUCT("fds", fds.data(), "n_fds", fds.size())
 {}
 
-Glib::ArrayHandle<int> UnixFDList::peek_fds() const
+const Glib::ArrayHandle<int> UnixFDList::peek_fds() const
 {
   int length = 0;
   const int* fds = g_unix_fd_list_peek_fds(const_cast<GUnixFDList*>(gobj()),
@@ -38,8 +38,7 @@ Glib::ArrayHandle<int> UnixFDList::peek_fds() const
 Glib::ArrayHandle<int> UnixFDList::steal_fds()
 {
   int length = 0;
-  const int* fds = g_unix_fd_list_steal_fds(const_cast<GUnixFDList*>(gobj()),
-    &length);
+  const int* fds = g_unix_fd_list_steal_fds(gobj(), &length);
   // (length - 1) is used because the array is terminated with a -1.
   return Glib::ArrayHandle<int>(fds, length - 1, Glib::OWNERSHIP_DEEP);
 }
diff --git a/gio/src/unixfdlist.hg b/gio/src/unixfdlist.hg
index 9a673ef..4870c4e 100644
--- a/gio/src/unixfdlist.hg
+++ b/gio/src/unixfdlist.hg
@@ -34,10 +34,6 @@ namespace Gio
  * G_SOCKET_ADDRESS_UNIX family by using Gio::Socket::send() and received
  * using Gio::Socket::receive().
  *
- * Note that <tt><gio/gunixfdlist.h></tt> belongs to the UNIX-specific GIO
- * interfaces, thus you have to use the <tt>gio-unix-2.0.pc</tt> pkg-config
- * file when using it.
- *
  * @newin{2,24}
  */
 class UnixFDList : public Glib::Object
@@ -80,7 +76,7 @@ public:
    * in any way.
    * @return The list of file descriptors.
    */
-  Glib::ArrayHandle<int> peek_fds() const;
+  const Glib::ArrayHandle<int> peek_fds() const;
 
   /** Returns the array of file descriptors that is contained in this object.
    *



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]