glom r1922 - in trunk: . glom glom/libglom glom/libglom/connectionpool_backends glom/mode_design/print_layouts glom/python_embed glom/utility_widgets/db_adddel regression_tests



Author: murrayc
Date: Sun Feb 22 19:47:01 2009
New Revision: 1922
URL: http://svn.gnome.org/viewvc/glom?rev=1922&view=rev

Log:
2009-02-22  Murray Cumming  <murrayc murrayc com>

* Various minor fixes to avoid minor compiler warnings.

Modified:
   trunk/ChangeLog
   trunk/glom/base_db.cc
   trunk/glom/dialog_existing_or_new.cc
   trunk/glom/dialog_existing_or_new.h
   trunk/glom/dialog_import_csv.cc
   trunk/glom/dialog_import_csv_progress.cc
   trunk/glom/dialog_invalid_data.cc
   trunk/glom/libglom/connectionpool.cc
   trunk/glom/libglom/connectionpool_backends/postgres.cc
   trunk/glom/libglom/dialog_progress_creating.cc
   trunk/glom/libglom/spawn_with_feedback.cc
   trunk/glom/libglom/test_connectionpool.cc
   trunk/glom/libglom/test_sharedptr_layoutitem.cc
   trunk/glom/mode_design/print_layouts/window_print_layout_edit.cc
   trunk/glom/notebook_glom.cc
   trunk/glom/python_embed/glom_python.cc
   trunk/glom/utility_widgets/db_adddel/glom_db_treemodel.cc
   trunk/regression_tests/test_parsing_time.cc

Modified: trunk/glom/base_db.cc
==============================================================================
--- trunk/glom/base_db.cc	(original)
+++ trunk/glom/base_db.cc	Sun Feb 22 19:47:01 2009
@@ -1329,7 +1329,7 @@
   return true;
 }
 
-bool Base_DB::add_column(const Glib::ustring& table_name, const sharedptr<const Field>& field, Gtk::Window* parent_window) const
+bool Base_DB::add_column(const Glib::ustring& table_name, const sharedptr<const Field>& field, Gtk::Window* /* parent_window */) const
 {
   ConnectionPool* connection_pool = ConnectionPool::get_instance();
 
@@ -1356,7 +1356,7 @@
   return true;
 }
 
-bool Base_DB::drop_column(const Glib::ustring& table_name, const Glib::ustring& field_name, Gtk::Window* parent_window) const
+bool Base_DB::drop_column(const Glib::ustring& table_name, const Glib::ustring& field_name, Gtk::Window* /* parent_window */) const
 {
   ConnectionPool* connection_pool = ConnectionPool::get_instance();
 
@@ -1424,7 +1424,7 @@
   }
 }
 
-sharedptr<Field> Base_DB::change_column(const Glib::ustring& table_name, const sharedptr<const Field>& field_old, const sharedptr<const Field>& field, Gtk::Window* parent_window) const
+sharedptr<Field> Base_DB::change_column(const Glib::ustring& table_name, const sharedptr<const Field>& field_old, const sharedptr<const Field>& field, Gtk::Window* /* parent_window */) const
 {
   ConnectionPool* connection_pool = ConnectionPool::get_instance();
   sharedptr<Field> result = check_field_change_constraints(field_old, field);
@@ -1452,7 +1452,7 @@
   return result;
 }
 
-bool Base_DB::change_columns(const Glib::ustring& table_name, const type_vecConstFields& old_fields, type_vecFields& fields, Gtk::Window* parent_window) const
+bool Base_DB::change_columns(const Glib::ustring& table_name, const type_vecConstFields& old_fields, type_vecFields& fields, Gtk::Window* /* parent_window */) const
 {
   g_assert(old_fields.size() == fields.size());
 
@@ -2425,7 +2425,7 @@
   return set_field_value_in_database(field_in_record, Gtk::TreeModel::iterator(), field_value, use_current_calculations, parent_window);
 }
 
-bool Base_DB::set_field_value_in_database(const LayoutFieldInRecord& layoutfield_in_record, const Gtk::TreeModel::iterator& row, const Gnome::Gda::Value& field_value, bool use_current_calculations, Gtk::Window* parent_window)
+bool Base_DB::set_field_value_in_database(const LayoutFieldInRecord& layoutfield_in_record, const Gtk::TreeModel::iterator& row, const Gnome::Gda::Value& field_value, bool use_current_calculations, Gtk::Window* /* parent_window */)
 {
   Document_Glom* document = get_document();
   g_assert(document);
@@ -2541,7 +2541,7 @@
   return result;
 }
 
-Gnome::Gda::Value Base_DB::get_field_value_in_database(const sharedptr<Field>& field, const FoundSet& found_set, Gtk::Window* parent_window)
+Gnome::Gda::Value Base_DB::get_field_value_in_database(const sharedptr<Field>& field, const FoundSet& found_set, Gtk::Window* /* parent_window */)
 {
   Gnome::Gda::Value result;  //TODO: Return suitable empty value for the field when failing?
 

Modified: trunk/glom/dialog_existing_or_new.cc
==============================================================================
--- trunk/glom/dialog_existing_or_new.cc	(original)
+++ trunk/glom/dialog_existing_or_new.cc	Sun Feb 22 19:47:01 2009
@@ -298,7 +298,7 @@
   }
 }
 
-bool Dialog_ExistingOrNew::on_existing_select_func(const Glib::RefPtr<Gtk::TreeModel>& model, const Gtk::TreeModel::Path& path, bool path_currently_selected)
+bool Dialog_ExistingOrNew::on_existing_select_func(const Glib::RefPtr<Gtk::TreeModel>& model, const Gtk::TreeModel::Path& path, bool /* path_currently_selected */)
 {
   Gtk::TreeModel::iterator iter = model->get_iter(path);
 #ifndef G_OS_WIN32
@@ -311,7 +311,7 @@
   return true;
 }
 
-bool Dialog_ExistingOrNew::on_new_select_func(const Glib::RefPtr<Gtk::TreeModel>& model, const Gtk::TreeModel::Path& path, bool path_currently_selected)
+bool Dialog_ExistingOrNew::on_new_select_func(const Glib::RefPtr<Gtk::TreeModel>& model, const Gtk::TreeModel::Path& path, bool /* path_currently_selected */)
 {
   Gtk::TreeModel::iterator iter = model->get_iter(path);
   if(iter == m_iter_new_template)
@@ -536,7 +536,7 @@
   }
 }
 
-void Dialog_ExistingOrNew::on_switch_page(GtkNotebookPage* page, guint page_num)
+void Dialog_ExistingOrNew::on_switch_page(GtkNotebookPage* /* page */, guint /* page_num */)
 {
   update_ui_sensitivity();
 }
@@ -723,6 +723,16 @@
 #endif /* !GLOM_ENABLE_CLIENT_ONLY */
 
 #ifndef G_OS_WIN32
+void Dialog_ExistingOrNew::on_service_found_static(EpcServiceMonitor* /* monitor */, gchar* name, EpcServiceInfo* info, gpointer user_data)
+{
+  static_cast<Dialog_ExistingOrNew*>(user_data)->on_service_found(name, info);
+}
+
+void Dialog_ExistingOrNew::on_service_removed_static(EpcServiceMonitor* /* monitor */, gchar* name, gchar* type, gpointer user_data)
+{
+  static_cast<Dialog_ExistingOrNew*>(user_data)->on_service_removed(name, type);
+}
+
 void Dialog_ExistingOrNew::on_service_found(const Glib::ustring& name, EpcServiceInfo* info)
 {
   //Translator hint: This is <Service Name> on <Host> (via Network Interface such as eth0).
@@ -744,7 +754,7 @@
   }
 }
 
-void Dialog_ExistingOrNew::on_service_removed(const Glib::ustring& name, const Glib::ustring& type)
+void Dialog_ExistingOrNew::on_service_removed(const Glib::ustring& name, const Glib::ustring& /* type */)
 {
   // Find the entry with the given name
   const Gtk::TreeNodeChildren& children = m_iter_existing_network->children();
@@ -766,7 +776,7 @@
 }
 #endif // !G_OS_WIN32
 
-void Dialog_ExistingOrNew::on_existing_row_activated(const Gtk::TreeModel::Path& path, Gtk::TreeViewColumn* column)
+void Dialog_ExistingOrNew::on_existing_row_activated(const Gtk::TreeModel::Path& /* path */, Gtk::TreeViewColumn* /* column */)
 {
   if(m_select_button->is_sensitive())
     on_select_clicked();
@@ -780,7 +790,7 @@
     on_select_clicked();
 }
 
-void Dialog_ExistingOrNew::on_new_row_activated(const Gtk::TreeModel::Path& path, Gtk::TreeViewColumn* column)
+void Dialog_ExistingOrNew::on_new_row_activated(const Gtk::TreeModel::Path& /* path */, Gtk::TreeViewColumn* /* column */)
 {
   if(m_select_button->is_sensitive())
     on_select_clicked();
@@ -823,4 +833,5 @@
   }
 }
 
+
 } //namespace Glom

Modified: trunk/glom/dialog_existing_or_new.h
==============================================================================
--- trunk/glom/dialog_existing_or_new.h	(original)
+++ trunk/glom/dialog_existing_or_new.h	Sun Feb 22 19:47:01 2009
@@ -93,8 +93,8 @@
 #endif /* !GLOM_ENABLE_CLIENT_ONLY */
     
 #ifndef G_OS_WIN32
-  static void on_service_found_static(EpcServiceMonitor* monitor, gchar* name, EpcServiceInfo* info, gpointer user_data) { static_cast<Dialog_ExistingOrNew*>(user_data)->on_service_found(name, info); }
-  static void on_service_removed_static(EpcServiceMonitor* monitor, gchar* name, gchar* type, gpointer user_data) { static_cast<Dialog_ExistingOrNew*>(user_data)->on_service_removed(name, type); }
+  static void on_service_found_static(EpcServiceMonitor* monitor, gchar* name, EpcServiceInfo* info, gpointer user_data);
+  static void on_service_removed_static(EpcServiceMonitor* monitor, gchar* name, gchar* type, gpointer user_data);
 
   void on_service_found(const Glib::ustring& name, EpcServiceInfo* info);
   void on_service_removed(const Glib::ustring& name, const Glib::ustring& type);

Modified: trunk/glom/dialog_import_csv.cc
==============================================================================
--- trunk/glom/dialog_import_csv.cc	(original)
+++ trunk/glom/dialog_import_csv.cc	Sun Feb 22 19:47:01 2009
@@ -425,7 +425,7 @@
   renderer.set_property("text", encoding_display(name, charset));
 }
 
-bool Dialog_Import_CSV::row_separator_func(const Glib::RefPtr<Gtk::TreeModel>& model, const Gtk::TreeModel::iterator& iter) const
+bool Dialog_Import_CSV::row_separator_func(const Glib::RefPtr<Gtk::TreeModel>& /* model */, const Gtk::TreeModel::iterator& iter) const
 {
   return (*iter)[m_encoding_columns.m_col_name] == "";
 }

Modified: trunk/glom/dialog_import_csv_progress.cc
==============================================================================
--- trunk/glom/dialog_import_csv_progress.cc	(original)
+++ trunk/glom/dialog_import_csv_progress.cc	Sun Feb 22 19:47:01 2009
@@ -211,7 +211,7 @@
   return true;
 }
 
-void Dialog_Import_CSV_Progress::on_response(int response_id)
+void Dialog_Import_CSV_Progress::on_response(int /* response_id */)
 {
   // Don't continue importing when the user already cancelled, or closed the
   // window via delete event.
@@ -249,13 +249,13 @@
 // These don't make sense in Dialog_Import_CSV_Progress, and thus should not
 // be called. We need to implement them though, because they are pure abstract
 // in Base_DB_Table_Data.
-void Dialog_Import_CSV_Progress::set_primary_key_value(const Gtk::TreeModel::iterator& row, const Gnome::Gda::Value& value)
+void Dialog_Import_CSV_Progress::set_primary_key_value(const Gtk::TreeModel::iterator& /* row */, const Gnome::Gda::Value& /* value */)
 {
   // This is actually called by Base_DB_Table_Data::record_new(), but we can safely ignore it.
   //throw std::logic_error("Dialog_Import_CSV_Progress::set_primary_key_value() called");
 }
 
-Gnome::Gda::Value Dialog_Import_CSV_Progress::get_primary_key_value(const Gtk::TreeModel::iterator& row) const
+Gnome::Gda::Value Dialog_Import_CSV_Progress::get_primary_key_value(const Gtk::TreeModel::iterator& /* row */) const
 {
   throw std::logic_error("Dialog_Import_CSV_Progress::get_primary_key_value() called");
 }

Modified: trunk/glom/dialog_invalid_data.cc
==============================================================================
--- trunk/glom/dialog_invalid_data.cc	(original)
+++ trunk/glom/dialog_invalid_data.cc	Sun Feb 22 19:47:01 2009
@@ -78,7 +78,7 @@
     }
     case(Field::TYPE_TIME):
     {
-      Gnome::Gda::Time time = {0, 0, 0, 0};
+      Gnome::Gda::Time time = {0, 0, 0, 0, 0};
       time.hour = 13;
       time.minute = 02;
       time.second = 03;

Modified: trunk/glom/libglom/connectionpool.cc
==============================================================================
--- trunk/glom/libglom/connectionpool.cc	(original)
+++ trunk/glom/libglom/connectionpool.cc	Sun Feb 22 19:47:01 2009
@@ -852,7 +852,7 @@
 
   //If we crash while running (unlikely, hopefully), then try to cleanup.
   //Comment this out if you want to see the backtrace in a debugger.
-  //previous_sig_handler = signal(SIGSEGV, &on_linux_signal);
+  previous_sig_handler = signal(SIGSEGV, &on_linux_signal);
 
   return true;
 }
@@ -1072,7 +1072,7 @@
 #ifndef GLOM_ENABLE_CLIENT_ONLY
 #ifndef G_OS_WIN32
 //static
-EpcContents* ConnectionPool::on_publisher_document_requested(EpcPublisher* publisher, const gchar* key, gpointer user_data)
+EpcContents* ConnectionPool::on_publisher_document_requested(EpcPublisher* /* publisher */, const gchar* /* key */, gpointer user_data)
 {
   Glom::ConnectionPool* connection_pool = static_cast<Glom::ConnectionPool*>(user_data);
   if(!connection_pool)
@@ -1143,7 +1143,7 @@
   connection_pool->m_dialog_epc_progress = message_dialog; 
 }
 
-void ConnectionPool::on_epc_progress_update(gdouble /* progress */, const gchar* /* message */, gpointer user_data)
+void ConnectionPool::on_epc_progress_update(gdouble /* progress */, const gchar* /* message */, gpointer /* user_data */)
 {
   //We ignore the title parameter because there is no way that libepc could know what Glom wants to say.
   //TODO: Show the progress in a ProgressBar.

Modified: trunk/glom/libglom/connectionpool_backends/postgres.cc
==============================================================================
--- trunk/glom/libglom/connectionpool_backends/postgres.cc	(original)
+++ trunk/glom/libglom/connectionpool_backends/postgres.cc	Sun Feb 22 19:47:01 2009
@@ -274,13 +274,18 @@
         // The conversion is not possible, so drop data in that column
       }
 
-      if(!drop_column(connection, table_name, old_fields[i]->get_name(), error));
-      if(!query_execute(connection, "ALTER TABLE \"" + table_name + "\" RENAME COLUMN \"" + TEMP_COLUMN_NAME + "\" TO \"" + new_fields[i]->get_name() + "\"", error)) break;
+      if(!drop_column(connection, table_name, old_fields[i]->get_name(), error))
+        break;
+
+      if(!query_execute(connection, "ALTER TABLE \"" + table_name + "\" RENAME COLUMN \"" + TEMP_COLUMN_NAME + "\" TO \"" + new_fields[i]->get_name() + "\"", error))
+        break;
 
       // Readd primary key constraint
       if(new_fields[i]->get_primary_key())
+      {
         if(!query_execute(connection, "ALTER TABLE \"" + table_name + "\" ADD PRIMARY KEY (\"" + new_fields[i]->get_name() + "\")", error))
           break;
+      }
     }
     else
     {

Modified: trunk/glom/libglom/dialog_progress_creating.cc
==============================================================================
--- trunk/glom/libglom/dialog_progress_creating.cc	(original)
+++ trunk/glom/libglom/dialog_progress_creating.cc	Sun Feb 22 19:47:01 2009
@@ -67,7 +67,8 @@
 
 void Dialog_ProgressCreating::response(int response_id)
 {
-  if(!m_running) return;
+  if(!m_running)
+   return;
 
   m_response_id = response_id;
   Gtk::Main::quit();
@@ -77,7 +78,8 @@
 int Dialog_ProgressCreating::run()
 {
   // Cannot nest
-  if(m_running) return Gtk::RESPONSE_CANCEL;
+  if(m_running)
+    return Gtk::RESPONSE_CANCEL;
 
   show();
   m_running = true;
@@ -85,9 +87,11 @@
   return m_response_id;
 }
 
-bool Dialog_ProgressCreating::on_delete_event(GdkEventAny* event)
+bool Dialog_ProgressCreating::on_delete_event(GdkEventAny* /* event */)
 {
-  if(m_running) response(Gtk::RESPONSE_DELETE_EVENT);
+  if(m_running)
+    response(Gtk::RESPONSE_DELETE_EVENT);
+
   return true;
 }
 

Modified: trunk/glom/libglom/spawn_with_feedback.cc
==============================================================================
--- trunk/glom/libglom/spawn_with_feedback.cc	(original)
+++ trunk/glom/libglom/spawn_with_feedback.cc	Sun Feb 22 19:47:01 2009
@@ -285,7 +285,7 @@
   SignalFinished signal_finished() const { return m_signal_finished; }
 
 private:
-  void on_child_watch(Glib::Pid pid, int returned)
+  void on_child_watch(Glib::Pid /* pid */, int returned)
   {
     running = false;
     return_status = returned;

Modified: trunk/glom/libglom/test_connectionpool.cc
==============================================================================
--- trunk/glom/libglom/test_connectionpool.cc	(original)
+++ trunk/glom/libglom/test_connectionpool.cc	Sun Feb 22 19:47:01 2009
@@ -24,7 +24,7 @@
 
 
 int
-main(int argc, char* argv[])
+main()
 {
   Gnome::Gda::init();
 

Modified: trunk/glom/libglom/test_sharedptr_layoutitem.cc
==============================================================================
--- trunk/glom/libglom/test_sharedptr_layoutitem.cc	(original)
+++ trunk/glom/libglom/test_sharedptr_layoutitem.cc	Sun Feb 22 19:47:01 2009
@@ -23,7 +23,7 @@
 
 
 int
-main(int argc, char* argv[])
+main()
 {
   Glom::sharedptr<Glom::LayoutItem_Field> field_copy;
   {

Modified: trunk/glom/mode_design/print_layouts/window_print_layout_edit.cc
==============================================================================
--- trunk/glom/mode_design/print_layouts/window_print_layout_edit.cc	(original)
+++ trunk/glom/mode_design/print_layouts/window_print_layout_edit.cc	Sun Feb 22 19:47:01 2009
@@ -315,7 +315,7 @@
 //TODO: I don't know what this really means. murrayc.
 const int DRAG_DATA_FORMAT = 8; // 8 bits format
 
-void Window_PrintLayout_Edit::on_toolbar_item_drag_data_get(const Glib::RefPtr<Gdk::DragContext>& drag_context, Gtk::SelectionData& selection_data, guint info, guint time)
+void Window_PrintLayout_Edit::on_toolbar_item_drag_data_get(const Glib::RefPtr<Gdk::DragContext>& drag_context, Gtk::SelectionData& selection_data, guint /* info */, guint /* time */)
 {
   PrintLayoutToolbarButton::enumItems type = PrintLayoutToolbarButton::get_item_type_from_selection_data(drag_context, selection_data);
 
@@ -325,7 +325,7 @@
 }
 
 
-bool Window_PrintLayout_Edit::on_canvas_drag_drop(const Glib::RefPtr<Gdk::DragContext>& drag_context, int x, int y, guint timestamp)
+bool Window_PrintLayout_Edit::on_canvas_drag_drop(const Glib::RefPtr<Gdk::DragContext>& drag_context, int /* x */, int /* y */, guint timestamp)
 {
   const Glib::ustring target = m_canvas.drag_dest_find_target(drag_context);
   if(target.empty())
@@ -424,7 +424,7 @@
   return layout_item;
 }
 
-void Window_PrintLayout_Edit::on_canvas_drag_data_received(const Glib::RefPtr<Gdk::DragContext>& drag_context, int x, int y, const Gtk::SelectionData& selection_data, guint info, guint timestamp)
+void Window_PrintLayout_Edit::on_canvas_drag_data_received(const Glib::RefPtr<Gdk::DragContext>& drag_context, int x, int y, const Gtk::SelectionData& selection_data, guint /* info */, guint timestamp)
 {
   //This is called when an item is dropped on the canvas,
   //or after our drag_motion handler has called drag_get_data()): 

Modified: trunk/glom/notebook_glom.cc
==============================================================================
--- trunk/glom/notebook_glom.cc	(original)
+++ trunk/glom/notebook_glom.cc	Sun Feb 22 19:47:01 2009
@@ -57,7 +57,7 @@
 }
 */
 
-void Notebook_Glom::on_switch_page_handler(GtkNotebookPage* pPage, guint uiPageNumber)
+void Notebook_Glom::on_switch_page_handler(GtkNotebookPage* /* pPage */, guint uiPageNumber)
 {
   //Remove the help hint for the previous page:
   Gtk::Window* pApp = get_app_window();

Modified: trunk/glom/python_embed/glom_python.cc
==============================================================================
--- trunk/glom/python_embed/glom_python.cc	(original)
+++ trunk/glom/python_embed/glom_python.cc	Sun Feb 22 19:47:01 2009
@@ -296,7 +296,8 @@
         //Deal with the various possible return types:
         bool object_is_gda_value = false;
 
-        GValue value = { 0 };
+        GValue value;
+        memset(&value, 0, sizeof(GValue));
         const int test = pygda_value_from_pyobject(&value, pyResult);
 
         if(test == 0) //-1 means error.

Modified: trunk/glom/utility_widgets/db_adddel/glom_db_treemodel.cc
==============================================================================
--- trunk/glom/utility_widgets/db_adddel/glom_db_treemodel.cc	(original)
+++ trunk/glom/utility_widgets/db_adddel/glom_db_treemodel.cc	Sun Feb 22 19:47:01 2009
@@ -276,8 +276,10 @@
           if(holder)
             m_db_values[i] = holder->get_value(); //TODO_gda: Why not just use get_value_at()?
           else
-            // This is quite possible for example for unset dates, jhs 
-            ;//std::cerr << "DbTreeModelRow::fill_values_if_necessary(): NULL Gnome::Gda::Holder for field=" << i << std::endl;
+          {
+            // This is quite possible, for example for unset dates. jhs 
+            //std::cerr << "DbTreeModelRow::fill_values_if_necessary(): NULL Gnome::Gda::Holder for field=" << i << std::endl;
+          }
 
           //std::cout << "  debug: col=" << i << ", GType=" << m_db_values[i].get_value_type() << ", string=" << m_db_values[i].to_string() << std::endl;
         }

Modified: trunk/regression_tests/test_parsing_time.cc
==============================================================================
--- trunk/regression_tests/test_parsing_time.cc	(original)
+++ trunk/regression_tests/test_parsing_time.cc	Sun Feb 22 19:47:01 2009
@@ -1,6 +1,6 @@
 #include <glom/libglom/data_structure/glomconversions.h>
 
-int main(int argc, char* argv[])
+int main()
 {
   Gnome::Gda::init();
 



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