[glibmm] Rearrange some multiline comments.



commit 25b4a8d167555bd080160f0b1169cd54e5aaef37
Author: Murray Cumming <murrayc murrayc com>
Date:   Sat Feb 27 11:04:46 2016 +0100

    Rearrange some multiline comments.
    
    Putting the comment before the code, instead of to the right,
    because clang-format can not (and could not) know which comments
    are meant to be aligned. I prefer this anyway.

 examples/options/main.cc                  |    3 ++-
 glib/glibmm/main.cc                       |    3 ++-
 glib/glibmm/objectbase.h                  |    3 ++-
 glib/glibmm/signalproxy_connectionnode.cc |   12 ++++++------
 4 files changed, 12 insertions(+), 9 deletions(-)
---
diff --git a/examples/options/main.cc b/examples/options/main.cc
index 8da855e..4f8e5e3 100644
--- a/examples/options/main.cc
+++ b/examples/options/main.cc
@@ -69,8 +69,9 @@ ExampleOptionGroup::ExampleOptionGroup()
   entry3.set_long_name("goo");
   entry3.set_short_name('g');
   entry3.set_description("The Goo");
-  m_arg_goo = "default-goo-value"; // We can choose a default to be used if the user doesn't specify
+  // We can choose a default to be used if the user doesn't specify
   // this option.
+  m_arg_goo = "default-goo-value";
   add_entry(entry3, m_arg_goo);
 
   Glib::OptionEntry entry4;
diff --git a/glib/glibmm/main.cc b/glib/glibmm/main.cc
index 8b0ab1b..d726eba 100644
--- a/glib/glibmm/main.cc
+++ b/glib/glibmm/main.cc
@@ -855,9 +855,10 @@ wrap(GMainLoop* gobject, bool take_copy)
 // static
 const GSourceFuncs Source::vfunc_table_ = {
   &Source::prepare_vfunc, &Source::check_vfunc, &Source::dispatch_vfunc,
-  nullptr, // finalize_vfunc // We can't use finalize_vfunc because there is no way
+  // We can't use finalize_vfunc because there is no way
   // to store a pointer to our wrapper anywhere in GSource so
   // that it persists until finalize_vfunc would be called from here.
+  nullptr, // finalize_vfunc
   nullptr, // closure_callback
   nullptr, // closure_marshal
 };
diff --git a/glib/glibmm/objectbase.h b/glib/glibmm/objectbase.h
index 68e1b22..7d34bea 100644
--- a/glib/glibmm/objectbase.h
+++ b/glib/glibmm/objectbase.h
@@ -235,7 +235,8 @@ protected:
   // Accesses to extra_object_base_data must be thread-safe.
   static std::mutex extra_object_base_data_mutex;
 
-public: //  is_derived_() must be public, so that overridden vfuncs and signal handlers can call it
+public:
+  //  is_derived_() must be public, so that overridden vfuncs and signal handlers can call it
   //  via ObjectBase.
   /// This is for use by gtkmm wrappers only, and not by applications.
   bool is_derived_() const; // We keep this non-inline version, to preserve ABI.
diff --git a/glib/glibmm/signalproxy_connectionnode.cc b/glib/glibmm/signalproxy_connectionnode.cc
index ba67486..d4d0855 100644
--- a/glib/glibmm/signalproxy_connectionnode.cc
+++ b/glib/glibmm/signalproxy_connectionnode.cc
@@ -54,10 +54,9 @@ SignalProxyConnectionNode::notify(void* data)
     GObject* o = conn->object_;
     conn->object_ = nullptr;
 
-    if (g_signal_handler_is_connected(o, conn->connection_id_)) // We check first, because during
-    // destruction, GTK+ sometimes seems
-    // to disconnect them for us, before
-    // we expect it to.  See bug #87912
+    // We check first, because during destruction, GTK+ sometimes seems to
+    // disconnect them for us, before we expect it to. See bug #87912
+    if (g_signal_handler_is_connected(o, conn->connection_id_))
     {
       // Disconnecting triggers execution of destroy_notify_handler(), eiter immediately or later:
       //   When the signal handler is currently running. (for instance, if the callback disconnects
@@ -93,8 +92,9 @@ SignalProxyConnectionNode::destroy_notify_handler(gpointer data, GClosure*)
     // the object has already lost track of this object.
     conn->object_ = nullptr;
 
-    delete conn; // if there are connection objects referring to slot_ they are notified during
-    // destruction of slot_
+    // If there are connection objects referring to slot_ they are notified during
+    // destruction of slot_.
+    delete conn;
   }
 }
 


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