[niepce] build: need to static_cast<bool> the Glib::RefPtr<>



commit ebbe196f9eef12c48beb1f6c062ab43373de2e6c
Author: Hubert Figuière <hub figuiere net>
Date:   Sun Oct 23 20:40:08 2016 -0400

    build: need to static_cast<bool> the Glib::RefPtr<>

 src/fwk/toolkit/frame.cpp             |    4 ++--
 src/fwk/toolkit/mimetype.cpp          |    4 ++--
 src/niepce/ui/filmstripcontroller.cpp |    2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/src/fwk/toolkit/frame.cpp b/src/fwk/toolkit/frame.cpp
index 3546ace..92e0112 100644
--- a/src/fwk/toolkit/frame.cpp
+++ b/src/fwk/toolkit/frame.cpp
@@ -126,7 +126,7 @@ void Frame::toggle_tools_visible()
 
 void Frame::undo_state()
 {
-    DBG_ASSERT(m_undo_action, "undo action is NULL");
+    DBG_ASSERT(static_cast<bool>(m_undo_action), "undo action is NULL");
     fwk::UndoHistory & history(Application::app()->undo_history());
     m_undo_action->set_enabled(history.has_undo());
     std::string s = history.next_undo();
@@ -136,7 +136,7 @@ void Frame::undo_state()
 
 void Frame::redo_state()
 {
-    DBG_ASSERT(m_redo_action, "redo action is NULL");
+    DBG_ASSERT(static_cast<bool>(m_redo_action), "redo action is NULL");
     fwk::UndoHistory & history(Application::app()->undo_history());
     m_redo_action->set_enabled(history.has_redo());
     std::string s = history.next_redo();
diff --git a/src/fwk/toolkit/mimetype.cpp b/src/fwk/toolkit/mimetype.cpp
index 6e072be..84d1fe3 100644
--- a/src/fwk/toolkit/mimetype.cpp
+++ b/src/fwk/toolkit/mimetype.cpp
@@ -41,14 +41,14 @@ MimeType::MimeType(const std::string & filename)
         gchar *content_type = g_content_type_guess(filename.c_str(),
                                                          nullptr, 0, &uncertainty);
         m_type = content_type;
-        
+
         g_free(content_type);
     }
 }
 
 MimeType::MimeType(const Glib::RefPtr<Gio::File> & file)
 {
-    DBG_ASSERT(file, "file can't be NULL");
+    DBG_ASSERT(static_cast<bool>(file), "file can't be NULL");
     m_fileinfo = file->query_info();
     m_name = m_fileinfo->get_name();
                m_type = m_fileinfo->get_content_type();
diff --git a/src/niepce/ui/filmstripcontroller.cpp b/src/niepce/ui/filmstripcontroller.cpp
index a91cd7f..fea5efe 100644
--- a/src/niepce/ui/filmstripcontroller.cpp
+++ b/src/niepce/ui/filmstripcontroller.cpp
@@ -41,7 +41,7 @@ Gtk::Widget * FilmStripController::buildWidget()
     if(m_widget) {
         return m_widget;
     }
-    DBG_ASSERT(m_store, "m_store NULL");
+    DBG_ASSERT(static_cast<bool>(m_store), "m_store NULL");
     m_thumbview = manage(new ThumbStripView(m_store));
     GtkWidget *thn = eog_thumb_nav_new(m_thumbview,
                                        EogThumbNavMode::ONE_ROW, true);


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