[glom] Avoid compiler warnings.



commit 1dbba0b43c58fa10d5d78d707a9f93765421e176
Author: Murray Cumming <murrayc murrayc com>
Date:   Fri Sep 4 23:00:01 2009 +0200

    Avoid compiler warnings.
    
    * configure.ac: Add a comment about using the PYTHON environment
    variable to specify the python version.
    * glom/dialog_existing_or_new.cc:
    * glom/dialog_import_csv_progress.cc:
    * glom/utility_widgets/canvas/canvas_group_resizable.cc: Avoid some
    compiler warnings, mostly about missing returns in unlikely
    situations.

 ChangeLog                                          |   12 ++++++++++++
 configure.ac                                       |    5 ++++-
 glom/dialog_existing_or_new.cc                     |   10 ++++++++--
 glom/dialog_import_csv_progress.cc                 |    2 ++
 .../canvas/canvas_group_resizable.cc               |   16 +++++++++-------
 5 files changed, 35 insertions(+), 10 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 638c5dd..d08ef32 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -8,6 +8,18 @@
 
 2009-09-04  Murray Cumming  <murrayc murrayc com>
 
+	Avoid compiler warnings.
+
+	* configure.ac: Add a comment about using the PYTHON environment 
+	variable to specify the python version.
+	* glom/dialog_existing_or_new.cc:
+	* glom/dialog_import_csv_progress.cc:
+	* glom/utility_widgets/canvas/canvas_group_resizable.cc: Avoid some 
+	compiler warnings, mostly about missing returns in unlikely 
+	situations.
+
+2009-09-04  Murray Cumming  <murrayc murrayc com>
+
 	Mention the failed python module name on stdcerr.
 
 	* glom/python_embed/glom_python.cc: glom_python_module_is_available(), 
diff --git a/configure.ac b/configure.ac
index fedc433..f8eae56 100644
--- a/configure.ac
+++ b/configure.ac
@@ -182,7 +182,10 @@ DK_ARG_ENABLE_WARNINGS([GLOM_WXXFLAGS],
 		       [-Wall], [-Wall -Wextra -Wno-missing-field-initializers],
                        [G GDK GDK_PIXBUF GTK GLIBMM GTKMM])
 AC_CHECK_FUNCS([strptime])
-# Get the compiler and linker flags for embedding Python
+
+# Get the compiler and linker flags for embedding Python.
+# To specify a particular python version set an environment variable.
+# For instance: PYTHON=python2.5
 MM_CHECK_MODULE_PYTHON
 
 AC_ARG_ENABLE([update-mime-database],
diff --git a/glom/dialog_existing_or_new.cc b/glom/dialog_existing_or_new.cc
index f95ca66..743f4fd 100644
--- a/glom/dialog_existing_or_new.cc
+++ b/glom/dialog_existing_or_new.cc
@@ -368,6 +368,8 @@ Glib::ustring Dialog_ExistingOrNew::get_uri() const
     throw std::logic_error("Dialog_ExistingOrNew::get_uri: action is neither NEW_FROM_TEMPLATE nor OPEN_URI");
 #endif    
   }
+
+  return Glib::ustring();
 }
 
 #ifndef G_OS_WIN32
@@ -381,7 +383,9 @@ EpcServiceInfo* Dialog_ExistingOrNew::get_service_info() const
 #ifdef GLIBMM_EXCEPTIONS_ENABLED    
   else
     throw std::logic_error("Dialog_ExistingOrNew::get_service_info: action is not OPEN_REMOTE");
-#endif    
+#endif
+
+  return 0;
 }
 
 Glib::ustring Dialog_ExistingOrNew::get_service_name() const
@@ -394,7 +398,9 @@ Glib::ustring Dialog_ExistingOrNew::get_service_name() const
 #ifdef GLIBMM_EXCEPTIONS_ENABLED    
   else
     throw std::logic_error("Dialog_ExistingOrNew::get_service_name: action is not OPEN_REMOTE");
-#endif    
+#endif
+
+  return Glib::ustring();
 }
 #endif
 
diff --git a/glom/dialog_import_csv_progress.cc b/glom/dialog_import_csv_progress.cc
index 16dffee..ed26c34 100644
--- a/glom/dialog_import_csv_progress.cc
+++ b/glom/dialog_import_csv_progress.cc
@@ -264,6 +264,8 @@ Gnome::Gda::Value Dialog_Import_CSV_Progress::get_primary_key_value(const Gtk::T
 #ifdef GLIBMM_EXCEPTIONS_ENABLED
   throw std::logic_error("Dialog_Import_CSV_Progress::get_primary_key_value() called");
 #endif
+
+  return Gnome::Gda::Value();
 }
 
 } //namespace Glom
diff --git a/glom/utility_widgets/canvas/canvas_group_resizable.cc b/glom/utility_widgets/canvas/canvas_group_resizable.cc
index a7258f1..95ade73 100644
--- a/glom/utility_widgets/canvas/canvas_group_resizable.cc
+++ b/glom/utility_widgets/canvas/canvas_group_resizable.cc
@@ -439,14 +439,16 @@ void CanvasGroupResizable::on_manipulator_corner_moved(Manipulators manipulator_
   double child_height = 0;
   get_width_height(child_width, child_height);
 
-  switch(manipulator_id)
-  {
 #ifndef GLIBMM_PROPERTIES_ENABLED
-    // The compiler probably already does exactly this...
-    int x, y;
-    manipulator->get_property("x", x);
-    manipulator->get_property("y", y);
-#endif       
+  // The compiler probably already does exactly this...
+  int x = 0;
+  int y = 0;
+  manipulator->get_property("x", x);
+  manipulator->get_property("y", y);
+#endif  
+
+  switch(manipulator_id)
+  {     
     case(MANIPULATOR_CORNER_TOP_LEFT):
     {
       const double new_x = std::min(manipulator_x, child_x + child_width);



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