[glom/glom-1-20] Fixed some simple warnings found by scan-build.



commit d97717191001158e20f89c4c1de5ade60dfd61f7
Author: Murray Cumming <murrayc murrayc com>
Date:   Thu Mar 29 17:21:26 2012 +0200

    Fixed some simple warnings found by scan-build.
    
    * glom/libglom/report_builder.cc:
    * glom/mode_data/box_data_list_related.cc:
    * glom/mode_design/fields/box_db_table_definition.cc:
    * glom/python_embed/glom_python.cc: Mostly variables that were
    set but then not used.
    
    Conflicts:
    
    	ChangeLog

 ChangeLog                                          |   10 ++++++++++
 glom/libglom/report_builder.cc                     |    1 -
 glom/mode_data/box_data_list_related.cc            |    8 ++++++++
 glom/mode_design/fields/box_db_table_definition.cc |    5 +++++
 glom/python_embed/glom_python.cc                   |    7 ++++++-
 5 files changed, 29 insertions(+), 2 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 2a98e21..aae13f3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2012-03-29  Murray Cumming  <murrayc murrayc com>
+
+	Fixed some simple warnings found by scan-build.
+
+	* glom/libglom/report_builder.cc:
+	* glom/mode_data/box_data_list_related.cc:
+	* glom/mode_design/fields/box_db_table_definition.cc:
+	* glom/python_embed/glom_python.cc: Mostly variables that were
+	set but then not used.
+
 2012-03-26  Murray Cumming  <murrayc murrayc com>
 
 	Dialog_Import_CSV_Progress: Fix a typo.
diff --git a/glom/libglom/report_builder.cc b/glom/libglom/report_builder.cc
index 78fc108..7368433 100644
--- a/glom/libglom/report_builder.cc
+++ b/glom/libglom/report_builder.cc
@@ -495,7 +495,6 @@ bool ReportBuilder::report_build_records_field(const FoundSet& found_set, xmlpp:
 
     value = datamodel->get_value_at(colField, row); //TODO: Catch exceptions.
     colField = 0;
-    row = 0;
   }
   else
   {
diff --git a/glom/mode_data/box_data_list_related.cc b/glom/mode_data/box_data_list_related.cc
index bde1f9c..8adb048 100644
--- a/glom/mode_data/box_data_list_related.cc
+++ b/glom/mode_data/box_data_list_related.cc
@@ -134,12 +134,20 @@ bool Box_Data_List_Related::fill_from_database()
   {
     //No Foreign Key value, so just show the field names:
     result = Base_DB_Table_Data::fill_from_database();
+    if(!result)
+    {
+      std::cerr << G_STRFUNC << ": Base_DB_Table_Data::fill_from_database() failed." << std::endl;
+    }
 
     //create_layout();
   }
   else
   {
     result = Box_Data_Portal::fill_from_database();
+    if(!result)
+    {
+      std::cerr << G_STRFUNC << ": Box_Data_Portal::fill_from_database() failed." << std::endl;
+    }
 
 
     //Is there already one record here?
diff --git a/glom/mode_design/fields/box_db_table_definition.cc b/glom/mode_design/fields/box_db_table_definition.cc
index 2d472e0..409ab36 100644
--- a/glom/mode_design/fields/box_db_table_definition.cc
+++ b/glom/mode_design/fields/box_db_table_definition.cc
@@ -125,6 +125,11 @@ void Box_DB_Table_Definition::fill_field_row(const Gtk::TreeModel::iterator& ite
 bool Box_DB_Table_Definition::fill_from_database()
 {
   bool result = Box_DB_Table::fill_from_database();
+  if(!result)
+  {
+    std::cerr << G_STRFUNC << ":  Box_DB_Table::fill_from_database() failed." << std::endl;
+    return false;
+  }
 
   if(!(ConnectionPool::get_instance()->get_ready_to_connect()))
     return false;
diff --git a/glom/python_embed/glom_python.cc b/glom/python_embed/glom_python.cc
index 5c58351..db9cbf6 100644
--- a/glom/python_embed/glom_python.cc
+++ b/glom/python_embed/glom_python.cc
@@ -114,7 +114,12 @@ static Glib::ustring get_traceback()
         chrRetval = g_strdup(PyString_AsString(strRetval));
 
       Py_DECREF(tbList);
-      Py_DECREF(strRetval);
+
+      if(strRetval)
+      {
+        Py_DECREF(strRetval);
+      }
+
       Py_DECREF(tracebackModule);
     }
     else



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