[glom] Fix some simple warnings found by clang++



commit 5a07537f3153941c693e69707edcf5b622f88a9e
Author: Murray Cumming <murrayc murrayc com>
Date:   Wed Mar 14 11:06:52 2012 +0100

    Fix some simple warnings found by clang++
    
    	* glom/appwindow.cc:
    	* glom/dialog_existing_or_new.cc:
    	* glom/frame_glom.cc:
    	* glom/glom_import_po_all.cc:
    	* glom/libglom/data_structure/layout/layoutitem_field.cc:
    	* glom/mode_data/db_adddel/db_adddel.cc:
    	* glom/mode_design/fields/box_db_table_definition.cc:
    	* glom/mode_design/layout/layout_item_dialogs/box_formatting.cc:
    	* glom/utility_widgets/adddel/adddel.cc:
    	I just did export CXX=clang++ before running autogen.sh.

 ChangeLog                                          |   15 +++++++++++++++
 glom/appwindow.cc                                  |    2 +-
 glom/dialog_existing_or_new.cc                     |    2 +-
 glom/frame_glom.cc                                 |    2 +-
 glom/glom_import_po_all.cc                         |    2 +-
 .../data_structure/layout/layoutitem_field.cc      |    4 ++--
 glom/mode_data/db_adddel/db_adddel.cc              |    2 +-
 glom/mode_design/fields/box_db_table_definition.cc |    4 ++--
 .../layout/layout_item_dialogs/box_formatting.cc   |    4 ++--
 glom/utility_widgets/adddel/adddel.cc              |    2 +-
 10 files changed, 27 insertions(+), 12 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 9515a63..7d128e6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+2012-03-14  Murray Cumming  <murrayc murrayc com>
+
+	Fix some simple warnings found by clang++
+
+	* glom/appwindow.cc:
+	* glom/dialog_existing_or_new.cc:
+	* glom/frame_glom.cc:
+	* glom/glom_import_po_all.cc:
+	* glom/libglom/data_structure/layout/layoutitem_field.cc:
+	* glom/mode_data/db_adddel/db_adddel.cc:
+	* glom/mode_design/fields/box_db_table_definition.cc:
+	* glom/mode_design/layout/layout_item_dialogs/box_formatting.cc:
+	* glom/utility_widgets/adddel/adddel.cc:
+	I just did export CXX=clang++ before running autogen.sh.
+
 2012-03-12  Murray Cumming  <murrayc murrayc com>
 
 	Simplify code that just re-emits signals.
diff --git a/glom/appwindow.cc b/glom/appwindow.cc
index 5b62703..fa831a8 100644
--- a/glom/appwindow.cc
+++ b/glom/appwindow.cc
@@ -79,7 +79,7 @@ AppWindow::AppWindow(BaseObjectType* cobject, const Glib::RefPtr<Gtk::Builder>&
   m_pBoxTop(0),
   m_pFrame(0),
   m_bAboutShown(false),
-  m_pAbout(false),
+  m_pAbout(0),
 #ifndef GLOM_ENABLE_CLIENT_ONLY
   m_window_translations(0),
 #endif // !GLOM_ENABLE_CLIENT_ONLY
diff --git a/glom/dialog_existing_or_new.cc b/glom/dialog_existing_or_new.cc
index a34bf28..dc8e43d 100644
--- a/glom/dialog_existing_or_new.cc
+++ b/glom/dialog_existing_or_new.cc
@@ -277,7 +277,7 @@ bool Dialog_ExistingOrNew::list_examples_at_path(const std::string& path)
   {
     Glib::RefPtr<Gio::FileEnumerator> examples = examples_dir->enumerate_children(G_FILE_ATTRIBUTE_STANDARD_FAST_CONTENT_TYPE","G_FILE_ATTRIBUTE_STANDARD_NAME);
     bool example_found = false;
-    while(info = examples->next_file())
+    while( (info = examples->next_file()) )
     {
       const Glib::ustring title = get_title_from_example(info, examples_dir);
       if(!title.empty())
diff --git a/glom/frame_glom.cc b/glom/frame_glom.cc
index 22bf876..a4be6ea 100644
--- a/glom/frame_glom.cc
+++ b/glom/frame_glom.cc
@@ -1415,7 +1415,7 @@ void Frame_Glom::update_table_in_document_from_database()
       " Falling back to the field details in the document." << std::endl;
   }
 
-  Document* pDoc = dynamic_cast<const Document*>(get_document());
+  Document* pDoc = dynamic_cast<Document*>(get_document());
   if(pDoc)
   {
     bool document_must_be_updated = false;
diff --git a/glom/glom_import_po_all.cc b/glom/glom_import_po_all.cc
index 16a02c9..413ee97 100644
--- a/glom/glom_import_po_all.cc
+++ b/glom/glom_import_po_all.cc
@@ -192,7 +192,7 @@ int main(int argc, char* argv[])
   //Import all .po files from the directory:
   Glib::RefPtr<Gio::FileEnumerator> enumerator = file_output->enumerate_children();
   Glib::RefPtr<Gio::FileInfo> info;
-  while(info = enumerator->next_file())
+  while( (info = enumerator->next_file()) )
   {
     Glib::RefPtr<Gio::File> child = file_output->get_child(info->get_name());
     if(child->query_file_type() == Gio::FILE_TYPE_DIRECTORY)
diff --git a/glom/libglom/data_structure/layout/layoutitem_field.cc b/glom/libglom/data_structure/layout/layoutitem_field.cc
index 00a57a0..2260b0d 100644
--- a/glom/libglom/data_structure/layout/layoutitem_field.cc
+++ b/glom/libglom/data_structure/layout/layoutitem_field.cc
@@ -69,12 +69,12 @@ bool LayoutItem_Field::operator==(const LayoutItem_Field& src) const
     (m_field_cache_valid == src.m_field_cache_valid);
 
   if(m_field && src.m_field)
-    result == result && (*m_field == *(src.m_field));
+    result = result && (*m_field == *(src.m_field));
   else
     result = result && (m_field == src.m_field);
 
   if(m_title_custom && src.m_title_custom)
-    result == result && (*m_title_custom == *(src.m_title_custom));
+    result = result && (*m_title_custom == *(src.m_title_custom));
   else
     result = result && (m_title_custom == src.m_title_custom);
 
diff --git a/glom/mode_data/db_adddel/db_adddel.cc b/glom/mode_data/db_adddel/db_adddel.cc
index f5f6b87..dbaff53 100644
--- a/glom/mode_data/db_adddel/db_adddel.cc
+++ b/glom/mode_data/db_adddel/db_adddel.cc
@@ -1232,7 +1232,7 @@ DbAddDel::InnerIgnore::~InnerIgnore()
     m_pOuter->set_ignore_treeview_signals(m_bIgnoreTreeViewSignals);
   }
 
-  m_pOuter = false;
+  m_pOuter = 0;
 }
 
 Gnome::Gda::Value DbAddDel::treeview_get_key(const Gtk::TreeModel::iterator& row) const
diff --git a/glom/mode_design/fields/box_db_table_definition.cc b/glom/mode_design/fields/box_db_table_definition.cc
index e70c4ec..6229289 100644
--- a/glom/mode_design/fields/box_db_table_definition.cc
+++ b/glom/mode_design/fields/box_db_table_definition.cc
@@ -144,8 +144,8 @@ bool Box_DB_Table_Definition::fill_from_database()
       const sharedptr<const Field>& field = *iter;
 
       //Name:
-      Gtk::TreeModel::iterator iter= m_AddDel.add_item(field->get_name());
-      fill_field_row(iter, field);
+      Gtk::TreeModel::iterator tree_iter= m_AddDel.add_item(field->get_name());
+      fill_field_row(tree_iter, field);
     }
 
     result = true;
diff --git a/glom/mode_design/layout/layout_item_dialogs/box_formatting.cc b/glom/mode_design/layout/layout_item_dialogs/box_formatting.cc
index 31a2ca4..0303edd 100644
--- a/glom/mode_design/layout/layout_item_dialogs/box_formatting.cc
+++ b/glom/mode_design/layout/layout_item_dialogs/box_formatting.cc
@@ -336,8 +336,8 @@ void Box_Formatting::set_formatting_for_non_field(const FieldFormatting& format,
 
       //Display the value in the choices list as it would be displayed in the format:
       const Glib::ustring value_text = Conversions::get_text_for_gda_value(m_field->get_glom_type(), value, format.m_numeric_format);
-      Gtk::TreeModel::iterator iter = m_adddel_choices_custom->add_item(value_text);
-      m_adddel_choices_custom->set_value(iter, m_col_index_custom_choices, value_text);
+      Gtk::TreeModel::iterator tree_iter = m_adddel_choices_custom->add_item(value_text);
+      m_adddel_choices_custom->set_value(tree_iter, m_col_index_custom_choices, value_text);
     }
 
     m_radiobutton_choices_custom->set_active(format.get_has_custom_choices());
diff --git a/glom/utility_widgets/adddel/adddel.cc b/glom/utility_widgets/adddel/adddel.cc
index 9baf215..a532784 100644
--- a/glom/utility_widgets/adddel/adddel.cc
+++ b/glom/utility_widgets/adddel/adddel.cc
@@ -1070,7 +1070,7 @@ AddDel::InnerIgnore::~InnerIgnore()
     m_pOuter->set_ignore_treeview_signals(m_bIgnoreSheetSignals);
   }
 
-  m_pOuter = false;
+  m_pOuter = 0;
 }
 
 Glib::ustring AddDel::treeview_get_key(const Gtk::TreeModel::iterator& row)



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