[gtkmm/gtkmm-2-24] Gtk::MenuList::insert(): Use static_cast<bool>() instead of double negation



commit 1173a6e8c30087199040fda2013caf10d37017df
Author: Kjell Ahlstedt <kjell ahlstedt bredband net>
Date:   Sat Sep 3 11:56:08 2016 +0200

    Gtk::MenuList::insert(): Use static_cast<bool>() instead of double negation
    
    Use static_cast<bool>(item) instead of !!item to explicitly convert
    Glib::RefPtr<> to bool. It's more obvious. Bug #770682

 gtk/src/menushell.ccg |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/gtk/src/menushell.ccg b/gtk/src/menushell.ccg
index be22f0e..3b4e7ae 100644
--- a/gtk/src/menushell.ccg
+++ b/gtk/src/menushell.ccg
@@ -118,7 +118,7 @@ MenuList::iterator MenuList::insert(MenuList::iterator position, const Element&
 {
   const Glib::RefPtr<Gtk::MenuItem> item = element.get_child();
 
-  g_return_val_if_fail(!!item, position);
+  g_return_val_if_fail(static_cast<bool>(item), position);
   g_return_val_if_fail(gparent() != 0, position);
 
   int pos = -1;


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