[glom/maemo5] Replace use of NULL with 0, because this is C++.



commit 6debb62d889ba29642c7dbe1b8435eea9c2aedd5
Author: Murray Cumming <murrayc murrayc com>
Date:   Tue Oct 13 16:52:12 2009 +0200

    Replace use of NULL with 0, because this is C++.
    Replace use of != NULL with nothing.

 ChangeLog                                          |    5 ++++
 glom/application.cc                                |   22 ++++++++++----------
 glom/bakery/app_withdoc_gtk.cc                     |    9 +++----
 glom/base_db.cc                                    |    2 +-
 glom/base_db_table_data.cc                         |    2 +-
 glom/dialog_existing_or_new.cc                     |    6 ++--
 glom/frame_glom.cc                                 |    6 ++--
 glom/glade_utils.h                                 |    2 +-
 glom/libglom/connectionpool.cc                     |   14 ++++++------
 glom/libglom/connectionpool_backends/sqlite.cc     |    2 +-
 glom/libglom/data_structure/field.cc               |    6 ++--
 glom/libglom/data_structure/translatable_item.cc   |    2 +-
 glom/libglom/document/bakery/document.cc           |   12 +++++-----
 glom/libglom/python_embed/py_glom_record.cc        |    8 +++---
 glom/libglom/python_embed/py_glom_related.cc       |    4 +-
 glom/libglom/python_embed/py_glom_relatedrecord.cc |   14 ++++++------
 glom/libglom/test_sync.cc                          |    2 +-
 glom/main.cc                                       |    4 +-
 glom/mode_data/box_data.cc                         |    2 +-
 glom/mode_data/box_data_calendar_related.cc        |    8 +++---
 glom/mode_data/box_data_details.cc                 |    2 +-
 glom/mode_data/box_data_list.cc                    |    2 +-
 glom/mode_data/box_data_list_related.cc            |    6 ++--
 glom/mode_design/layout/dialog_layout_export.cc    |    2 +-
 .../print_layouts/print_layout_toolbar_button.cc   |    2 +-
 .../print_layouts/window_print_layout_edit.cc      |    2 +-
 .../dialog_relationships_overview.cc               |    4 +-
 .../mode_design/translation/window_translations.cc |    8 +++---
 glom/mode_find/box_data_details_find.cc            |    2 +-
 glom/mode_find/box_data_list_find.cc               |    2 +-
 glom/print_layout/canvas_print_layout.cc           |    4 +-
 glom/python_embed/glom_python.cc                   |    6 ++--
 glom/python_embed/python_module/py_glom_module.cc  |    2 +-
 glom/utility_widgets/adddel/adddel.cc              |    6 ++--
 .../utility_widgets/canvas/test_canvas_editable.cc |    6 ++--
 glom/utility_widgets/db_adddel/db_adddel.cc        |    8 +++---
 glom/utility_widgets/dialog_image_progress.cc      |    2 +-
 glom/utility_widgets/imageglom.cc                  |    2 +-
 glom/utils_ui.cc                                   |   18 ++++++++--------
 glom/xsl_utils.cc                                  |    6 ++--
 40 files changed, 114 insertions(+), 110 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index e3d41e1..449e371 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2009-10-13  Murray Cumming  <murrayc murrayc com>
+
+	* *.cc: Replace use of NULL with 0, because this is C++.
+	Replace use of != NULL with nothing. 
+
 2009-10-12  Murray Cumming  <murrayc murrayc com>
 
 	* glom/utility_widgets/db_adddel/db_adddel.cc:
diff --git a/glom/application.cc b/glom/application.cc
index c67076f..e616c63 100644
--- a/glom/application.cc
+++ b/glom/application.cc
@@ -65,10 +65,10 @@
 namespace Glom
 {
 
-static const int GLOM_RESPONSE_BROWSE_NETWORK = 1;
+//static const int GLOM_RESPONSE_BROWSE_NETWORK = 1;
 
 // Global application variable
-App_Glom* global_application = NULL;
+App_Glom* global_application = 0;
 
 App_Glom::App_Glom(BaseObjectType* cobject, const Glib::RefPtr<Gtk::Builder>& builder)
 : type_base(cobject, "Glom"),
@@ -702,7 +702,7 @@ void App_Glom::open_browsed_document(const EpcServiceInfo* server, const Glib::u
       epc_consumer_set_username(consumer, username.c_str());
       epc_consumer_set_password(consumer, password.c_str());
 
-      GError *error = NULL;
+      GError *error = 0;
       document_contents = (gchar*)epc_consumer_lookup(consumer, "document", &length, &error);
       if(error)
       {
@@ -731,7 +731,7 @@ void App_Glom::open_browsed_document(const EpcServiceInfo* server, const Glib::u
     }
 
     delete dialog_connection;
-    dialog_connection = NULL;
+    dialog_connection = 0;
 
   }
 
@@ -1544,7 +1544,7 @@ bool App_Glom::recreate_database(bool& user_cancelled)
     sharedptr<SharedConnection> sharedconnection = connection_pool->connect();
 #else
     sharedptr<SharedConnection> sharedconnection = connection_pool->connect(error);
-    if(error.get() == NULL)
+    if(!error.get())
     {
 #endif // GLIBMM_EXCEPTIONS_ENABLED
       g_warning("App_Glom::recreate_database(): Failed because database exists already.");
@@ -1558,7 +1558,7 @@ bool App_Glom::recreate_database(bool& user_cancelled)
   catch(const ExceptionConnection& ex)
   {
 #else
-  if(error.get() != NULL)
+  if(error.get())
   {
     const ExceptionConnection* exptr = dynamic_cast<ExceptionConnection*>(error.get());
     if(exptr)
@@ -1625,7 +1625,7 @@ bool App_Glom::recreate_database(bool& user_cancelled)
     sharedconnection = connection_pool->connect();
 #else
     sharedconnection = connection_pool->connect(error);
-    if(error.get() == NULL)
+    if(!error.get())
 #endif // GLIBMM_EXCEPTIONS_ENABLED
       connection_pool->set_database(db_name); //The database was successfully created, so specify it when connecting from now on.
   }
@@ -1633,7 +1633,7 @@ bool App_Glom::recreate_database(bool& user_cancelled)
   catch(const ExceptionConnection& ex)
   {
 #else
-  if(error.get() != NULL)
+  if(error.get())
   {
     const std::exception& ex = *error.get();
 #endif // GLIBMM_EXCEPTIONS_ENABLED
@@ -1821,7 +1821,7 @@ void App_Glom::fill_menu_tables()
   catch(const Glib::Error& ex)
   {
 #else
-  if(error.get() != NULL)
+  if(error.get())
   {
     const Glib::Error& ex = *error.get();
 #endif // GLIBMM_EXCEPTIONS_ENABLED
@@ -1920,7 +1920,7 @@ void App_Glom::fill_menu_reports(const Glib::ustring& table_name)
   catch(const Glib::Error& ex)
   {
 #else
-  if(error.get() != NULL)
+  if(error.get())
   {
     const Glib::Error& ex = *error.get();
 #endif // GLIBMM_EXCEPTIONS_ENABLED
@@ -2032,7 +2032,7 @@ void App_Glom::fill_menu_print_layouts(const Glib::ustring& table_name)
   catch(const Glib::Error& ex)
   {
 #else
-  if(error.get() != NULL)
+  if(error.get())
   {
     const Glib::Error& ex = *error.get();
 #endif // GLIBMM_EXCEPTIONS_ENABLED
diff --git a/glom/bakery/app_withdoc_gtk.cc b/glom/bakery/app_withdoc_gtk.cc
index 8a6ff9d..25bdba0 100644
--- a/glom/bakery/app_withdoc_gtk.cc
+++ b/glom/bakery/app_withdoc_gtk.cc
@@ -160,7 +160,7 @@ void App_WithDoc_Gtk::add_ui_from_string(const Glib::ustring& ui_description)
 #else
   std::auto_ptr<Glib::Error> error;
   m_refUIManager->add_ui_from_string(ui_description, error);
-  if(error.get() != NULL) std::cerr << "building menus failed: " << error->what();
+  if(error.get()) std::cerr << "building menus failed: " << error->what();
 #endif
 }
 
@@ -668,15 +668,14 @@ Glib::ustring App_WithDoc_Gtk::ui_file_select_save(const Glib::ustring& old_file
 
 void App_WithDoc_Gtk::ui_show_modification_status()
 {
-  bool modified = m_pDocument->get_modified();
+  const bool modified = m_pDocument->get_modified();
 
   //Enable Save and SaveAs menu items:
   if(m_action_save)
-    g_object_set(G_OBJECT(m_action_save->gobj()), "sensitive", modified, NULL); // TODO: Use a set_sensitive(modified)?
+    m_action_save->set_sensitive(modified);
 
   if(m_action_saveas)
-    g_object_set(G_OBJECT(m_action_saveas->gobj()), "sensitive", modified, NULL); // TODO: Use a set_sensitive(modified)?
-
+    m_action_saveas->set_sensitive(modified);
 }
 
 App_WithDoc_Gtk::enumSaveChanges App_WithDoc_Gtk::ui_offer_to_save_changes()
diff --git a/glom/base_db.cc b/glom/base_db.cc
index 798ae61..0f6e9a8 100644
--- a/glom/base_db.cc
+++ b/glom/base_db.cc
@@ -568,7 +568,7 @@ static bool meta_table_column_is_primary_key(GdaMetaTable* meta_table, const Gli
   if(!meta_table)
     return false;
     
-  for(GSList* item = meta_table->columns; item != NULL; item = item->next)
+  for(GSList* item = meta_table->columns; item != 0; item = item->next)
   {
     GdaMetaTableColumn* column = GDA_META_TABLE_COLUMN(item->data);
     if(!column)
diff --git a/glom/base_db_table_data.cc b/glom/base_db_table_data.cc
index c2d61b1..7a272c7 100644
--- a/glom/base_db_table_data.cc
+++ b/glom/base_db_table_data.cc
@@ -122,7 +122,7 @@ bool Base_DB_Table_Data::record_new(bool use_entered_data, const Gnome::Gda::Val
 #else
           std::auto_ptr<ExceptionConnection> error;
           sharedptr<SharedConnection> sharedconnection = connect_to_server(App_Glom::get_application(), error);
-          if(error.get() == NULL)
+          if(!error.get())
           {
             // Don't evaluate function on error
 #endif // GLIBMM_EXCEPTIONS_ENABLED
diff --git a/glom/dialog_existing_or_new.cc b/glom/dialog_existing_or_new.cc
index 348cd0f..992323d 100644
--- a/glom/dialog_existing_or_new.cc
+++ b/glom/dialog_existing_or_new.cc
@@ -174,7 +174,7 @@ Dialog_ExistingOrNew::Dialog_ExistingOrNew(BaseObjectType* cobject, const Glib::
   // Browse local network
 #ifndef G_OS_WIN32
   gchar* service_type = epc_service_type_new(EPC_PROTOCOL_HTTPS, "glom");
-  m_service_monitor = epc_service_monitor_new_for_types(NULL, service_type, NULL);
+  m_service_monitor = epc_service_monitor_new_for_types(0, service_type, 0);
   g_signal_connect(m_service_monitor, "service-found", G_CALLBACK(on_service_found_static), this);
   g_signal_connect(m_service_monitor, "service-removed", G_CALLBACK(on_service_removed_static), this);
   g_free(service_type);
@@ -288,7 +288,7 @@ Dialog_ExistingOrNew::~Dialog_ExistingOrNew()
   if(m_service_monitor)
   {
     g_object_unref(m_service_monitor);
-    m_service_monitor = NULL;
+    m_service_monitor = 0;
   }
 
   // Release the service infos in the treestore
@@ -876,7 +876,7 @@ void Dialog_ExistingOrNew::on_service_found(const Glib::ustring& name, EpcServic
   gchar* title = g_strdup_printf(_("%s on %s (via %s)"), name.c_str(), epc_service_info_get_host(info), epc_service_info_get_interface(info));
   Gtk::TreeModel::iterator iter = m_existing_model->prepend(m_iter_existing_network->children());
   (*iter)[m_existing_columns.m_col_title] = title;
-  (*iter)[m_existing_columns.m_col_time] = std::time(NULL); /* sort more recently discovered items above */
+  (*iter)[m_existing_columns.m_col_time] = std::time(0); /* sort more recently discovered items above */
   (*iter)[m_existing_columns.m_col_service_name] = name;
   (*iter)[m_existing_columns.m_col_service_info] = info;
 
diff --git a/glom/frame_glom.cc b/glom/frame_glom.cc
index 8d1555b..c2f36d8 100644
--- a/glom/frame_glom.cc
+++ b/glom/frame_glom.cc
@@ -2361,7 +2361,7 @@ bool Frame_Glom::connection_request_password_and_choose_new_database_name()
         {
           ConnectionPool::Backend* backend = connection_pool->get_backend();
           ConnectionPoolBackends::PostgresCentralHosted* central = dynamic_cast<ConnectionPoolBackends::PostgresCentralHosted*>(backend);
-          g_assert(central != NULL);
+          g_assert(central);
 
           document->set_connection_server(central->get_host());
           document->set_connection_port(central->get_port());
@@ -2378,7 +2378,7 @@ bool Frame_Glom::connection_request_password_and_choose_new_database_name()
         {
           ConnectionPool::Backend* backend = connection_pool->get_backend();
           ConnectionPoolBackends::PostgresSelfHosted* self = dynamic_cast<ConnectionPoolBackends::PostgresSelfHosted*>(backend);
-          g_assert(self != NULL);
+          g_assert(self);
 
           document->set_connection_port(self->get_port());
           document->set_connection_try_other_ports(false);
@@ -2740,7 +2740,7 @@ void Frame_Glom::on_menu_print_layout_selected(const Glib::ustring& print_layout
     Glib::KeyFile key_file;
     key_file.load_from_data(key_file_text);
     //TODO: Use this when gtkmm and GTK+ have been fixed: page_setup = Gtk::PageSetup::create(key_file);
-    page_setup = Glib::wrap(gtk_page_setup_new_from_key_file(key_file.gobj(), NULL, NULL));
+    page_setup = Glib::wrap(gtk_page_setup_new_from_key_file(key_file.gobj(), 0, 0));
   }
   
   print->set_default_page_setup(page_setup);
diff --git a/glom/glade_utils.h b/glom/glade_utils.h
index 9f0ae6e..660e004 100644
--- a/glom/glade_utils.h
+++ b/glom/glade_utils.h
@@ -34,7 +34,7 @@ namespace Utils
 inline std::string get_glade_file_path(const std::string& filename)
 {
 #ifdef G_OS_WIN32
-  gchar* directory = g_win32_get_package_installation_directory_of_module(NULL);
+  gchar* directory = g_win32_get_package_installation_directory_of_module(0);
   const std::string result = Glib::build_filename(directory, Glib::build_filename("share/glom/glade", filename));
   g_free(directory);
   return result;
diff --git a/glom/libglom/connectionpool.cc b/glom/libglom/connectionpool.cc
index b5bf139..bac64e8 100644
--- a/glom/libglom/connectionpool.cc
+++ b/glom/libglom/connectionpool.cc
@@ -52,7 +52,7 @@ pgwin32_get_dynamic_tokeninfo(HANDLE token, TOKEN_INFORMATION_CLASS class_,
 {
   DWORD    InfoBufferSize;
 
-  if(GetTokenInformation(token, class_, NULL, 0, &InfoBufferSize))
+  if(GetTokenInformation(token, class_, 0, 0, &InfoBufferSize))
   {
     snprintf(errbuf, errsize, "could not get token information: got zero size\n");
     return FALSE;
@@ -66,7 +66,7 @@ pgwin32_get_dynamic_tokeninfo(HANDLE token, TOKEN_INFORMATION_CLASS class_,
   }
 
   *InfoBuffer = static_cast<char*>(malloc(InfoBufferSize));
-  if(*InfoBuffer == NULL)
+  if(*InfoBuffer == 0)
   {
     snprintf(errbuf, errsize, "could not allocate %d bytes for token information\n",
          (int) InfoBufferSize);
@@ -88,7 +88,7 @@ int
 pgwin32_is_admin(void)
 {
   HANDLE    AccessToken;
-  char     *InfoBuffer = NULL;
+  char     *InfoBuffer = 0;
   char    errbuf[256];
   PTOKEN_GROUPS Groups;
   PSID    AdministratorsSid;
@@ -942,22 +942,22 @@ void ConnectionPool::avahi_start_publishing()
   if(!document)
     return;
 
-  m_epc_publisher = epc_publisher_new(document->get_database_title().c_str(), "glom", NULL);
+  m_epc_publisher = epc_publisher_new(document->get_database_title().c_str(), "glom", 0);
   epc_publisher_set_protocol(m_epc_publisher, publish_protocol);
   
-  epc_publisher_add_handler(m_epc_publisher, "document", on_publisher_document_requested, this /* user_data */, NULL);
+  epc_publisher_add_handler(m_epc_publisher, "document", on_publisher_document_requested, this /* user_data */, 0);
 
   //Password-protect the document,
   //because the document's structure could be considered as a business secret:
   epc_publisher_set_auth_flags(m_epc_publisher, EPC_AUTH_PASSWORD_TEXT_NEEDED);
-  epc_publisher_set_auth_handler(m_epc_publisher, "document", on_publisher_document_authentication, this /* user_data */, NULL);
+  epc_publisher_set_auth_handler(m_epc_publisher, "document", on_publisher_document_authentication, this /* user_data */, 0);
 
   //Install progress callback, so we can keep the UI responsive while libepc is generating certificates for the first time:
   EpcShellProgressHooks callbacks;
   callbacks.begin = &ConnectionPool::on_epc_progress_begin;
   callbacks.update = &ConnectionPool::on_epc_progress_update;
   callbacks.end = &ConnectionPool::on_epc_progress_end;
-  epc_shell_set_progress_hooks(&callbacks, this, NULL);
+  epc_shell_set_progress_hooks(&callbacks, this, 0);
       
   //Prevent the consumer from seeing duplicates,
   //if multiple client computers advertize the same document:
diff --git a/glom/libglom/connectionpool_backends/sqlite.cc b/glom/libglom/connectionpool_backends/sqlite.cc
index c72241d..ab28b57 100644
--- a/glom/libglom/connectionpool_backends/sqlite.cc
+++ b/glom/libglom/connectionpool_backends/sqlite.cc
@@ -196,7 +196,7 @@ bool Sqlite::recreate_table(const Glib::RefPtr<Gnome::Gda::Connection>& connecti
 
   Glib::ustring trans_fields;
 
-  for(GSList* item = table->columns; item != NULL; item = item->next)
+  for(GSList* item = table->columns; item != 0; item = item->next)
   {
     GdaMetaTableColumn* column = GDA_META_TABLE_COLUMN(item->data);
 
diff --git a/glom/libglom/data_structure/field.cc b/glom/libglom/data_structure/field.cc
index c1c5a1e..957ee66 100644
--- a/glom/libglom/data_structure/field.cc
+++ b/glom/libglom/data_structure/field.cc
@@ -145,7 +145,7 @@ void Field::set_field_info(const Glib::RefPtr<Gnome::Gda::Column>& fieldinfo)
   {
     cur_type = get_gda_type_for_glom_type(get_glom_type());
 
-    const FieldTypes* pFieldTypes = NULL;
+    const FieldTypes* pFieldTypes = 0;
 
     ConnectionPool* pConnectionPool = ConnectionPool::get_instance();
     if(pConnectionPool)
@@ -168,7 +168,7 @@ void Field::set_field_info(const Glib::RefPtr<Gnome::Gda::Column>& fieldinfo)
     // TODO: Basically copied from set_default_value(). Maybe this check should
     // be moved into an extra function.
     GType cur_type = get_gda_type_for_glom_type(get_glom_type());
-    const FieldTypes* pFieldTypes = NULL;
+    const FieldTypes* pFieldTypes = 0;
 
     ConnectionPool* pConnectionPool = ConnectionPool::get_instance();
     if(pConnectionPool)
@@ -477,7 +477,7 @@ void Field::set_default_value(const Gnome::Gda::Value& value)
 
   // Verify that the value matches the type of the field.
   GType cur_type = get_gda_type_for_glom_type(get_glom_type());
-  const FieldTypes* pFieldTypes = NULL;
+  const FieldTypes* pFieldTypes = 0;
 
   ConnectionPool* pConnectionPool = ConnectionPool::get_instance();
   if(pConnectionPool)
diff --git a/glom/libglom/data_structure/translatable_item.cc b/glom/libglom/data_structure/translatable_item.cc
index 780b5eb..1f82981 100644
--- a/glom/libglom/data_structure/translatable_item.cc
+++ b/glom/libglom/data_structure/translatable_item.cc
@@ -204,7 +204,7 @@ Glib::ustring TranslatableItem::get_current_locale()
 {
   if(m_current_locale.empty())
   {
-    const char* cLocale = setlocale(LC_ALL, NULL); //Passing NULL means query, instead of set.
+    const char* cLocale = setlocale(LC_ALL, 0); //Passing NULL means query, instead of set.
     if(cLocale)
     {
       //std::cout << "TranslatableItem::get_current_locale(): locale=" << cLocale << std::endl;
diff --git a/glom/libglom/document/bakery/document.cc b/glom/libglom/document/bakery/document.cc
index 748a908..f920f11 100644
--- a/glom/libglom/document/bakery/document.cc
+++ b/glom/libglom/document/bakery/document.cc
@@ -217,7 +217,7 @@ bool Document::read_from_disk()
 #else
   std::auto_ptr<Glib::Error> error;
   stream = file->read(error);
-  if(error.get() != NULL)
+  if(error.get())
     return false; //print_error(ex, input_uri_string);
 #endif
 
@@ -238,7 +238,7 @@ bool Document::read_from_disk()
 #else
       std::auto_ptr<Glib::Error> gerror;
       bytes_read = stream->read(buffer, BYTES_TO_PROCESS, gerror);
-      if(gerror.get() != NULL) break;
+      if(gerror.get()) break;
 #endif
 
       if(bytes_read == 0)
@@ -254,7 +254,7 @@ bool Document::read_from_disk()
   catch(const Gio::Error& ex)
   {
 #else
-  if(error.get() != NULL)
+  if(error.get())
   {
     std::cerr << "Error: " << error->what() << std::endl;
 #endif
@@ -297,7 +297,7 @@ bool Document::write_to_disk()
 #else
     std::auto_ptr<Glib::Error> error;
     stream = file->replace(std::string(), false, Gio::FILE_CREATE_NONE, error);
-    if(error.get() != NULL)
+    if(error.get())
     {
       std::cout << "Error: " << error->what() << std::endl;
 #endif
@@ -326,7 +326,7 @@ bool Document::write_to_disk()
 #else
     std::auto_ptr<Glib::Error> gerror;
     stream->write(m_strContents.data(), m_strContents.bytes(), gerror);
-    if(gerror.get() != NULL)
+    if(gerror.get())
     {
       std::cerr << "Error: "<< gerror.get() << std::endl;
 #endif
@@ -410,7 +410,7 @@ bool Document::get_read_only() const
 #else
       std::auto_ptr<Glib::Error> error;
       info = file->query_info(G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE, Gio::FILE_QUERY_INFO_NONE, error);
-      if(error.get() != NULL)
+      if(error.get())
         return false;
 #endif
 
diff --git a/glom/libglom/python_embed/py_glom_record.cc b/glom/libglom/python_embed/py_glom_record.cc
index e65804a..5293365 100644
--- a/glom/libglom/python_embed/py_glom_record.cc
+++ b/glom/libglom/python_embed/py_glom_record.cc
@@ -56,7 +56,7 @@ Record_init(PyObject *self, PyObject * /* args */, PyObject * /* kwds */)
 {
   PyGlomRecord *self_record = (PyGlomRecord*)self;
 
-  //static char *kwlist[] = {"test", NULL};
+  //static char *kwlist[] = {"test", 0};
 
   //if(!PyArg_ParseTupleAndKeywords(args, kwds, "|i", kwlist,
    //                                 &self->m_test))
@@ -175,7 +175,7 @@ static PyGetSetDef Record_getseters[] = {
     {(char*)"table_name",
      (getter)Record__get_table_name, (setter)0, 0, 0
     },
-    {NULL, 0, 0, 0, 0, }  // Sentinel
+    {0, 0, 0, 0, 0, }  // Sentinel
 };
 
 //Adapt to API changes in Python 2.5:
@@ -236,7 +236,7 @@ Record_tp_as_mapping_getitem(PyObject *self, PyObject *item)
 
   g_warning("Record_tp_as_mapping_getitem(): return null.");
   PyErr_SetString(PyExc_IndexError, "field not found");
-  return NULL;
+  return 0;
 }
 
 /*
@@ -256,7 +256,7 @@ static PyMappingMethods Record_tp_as_mapping = {
 
 
 static PyTypeObject pyglom_RecordType = {
-    PyObject_HEAD_INIT(NULL)
+    PyObject_HEAD_INIT(0)
     0,                         /*ob_size*/
     (char*)"glom.Record",             /*tp_name*/
     sizeof(PyGlomRecord), /*tp_basicsize*/
diff --git a/glom/libglom/python_embed/py_glom_related.cc b/glom/libglom/python_embed/py_glom_related.cc
index 3a12e3b..9d2a45c 100644
--- a/glom/libglom/python_embed/py_glom_related.cc
+++ b/glom/libglom/python_embed/py_glom_related.cc
@@ -192,7 +192,7 @@ Related_tp_as_mapping_getitem(PyObject *self, PyObject *item)
   }
 
   PyErr_SetString(PyExc_IndexError, "relationship not found");
-  return NULL;
+  return 0;
 }
 
 /*
@@ -212,7 +212,7 @@ static PyMappingMethods Related_tp_as_mapping = {
 
 
 static PyTypeObject pyglom_RelatedType = {
-    PyObject_HEAD_INIT(NULL)
+    PyObject_HEAD_INIT(0)
     0,                         /*ob_size*/
     (char*)"glom.Related",             /*tp_name*/
     sizeof(PyGlomRelated), /*tp_basicsize*/
diff --git a/glom/libglom/python_embed/py_glom_relatedrecord.cc b/glom/libglom/python_embed/py_glom_relatedrecord.cc
index b1eb0b5..44daa3a 100644
--- a/glom/libglom/python_embed/py_glom_relatedrecord.cc
+++ b/glom/libglom/python_embed/py_glom_relatedrecord.cc
@@ -62,7 +62,7 @@ RelatedRecord_new(PyTypeObject *type, PyObject * /* args */, PyObject * /* kwds
 static int
 RelatedRecord_init(PyGlomRelatedRecord *self, PyObject * /* args */, PyObject * /* kwds */)
 {
-  //static char *kwlist[] = {"test", NULL};
+  //static char *kwlist[] = {"test", 0};
 
   //if(!PyArg_ParseTupleAndKeywords(args, kwds, "|i", kwlist,
    //                                 &self->m_test))
@@ -136,7 +136,7 @@ static PyGetSetDef RelatedRecord_getseters[] = {
     {"fields",
      (getter)RelatedRecord__get_fields, (setter)0, 0, 0
     },
-    {NULL, 0, 0, 0, 0, }  // Sentinel
+    {0, 0, 0, 0, 0, }  // Sentinel
 };
 */
 
@@ -267,7 +267,7 @@ RelatedRecord_tp_as_mapping_getitem(PyObject *self, PyObject *item)
 
   g_warning("RelatedRecord_tp_as_mapping_getitem(): return null.");
   PyErr_SetString(PyExc_IndexError, "field not found");
-  return NULL;
+  return 0;
 }
 
 /*
@@ -293,10 +293,10 @@ RelatedRecord_generic_aggregate(PyGlomRelatedRecord* self, PyObject *args, PyObj
   PyObject* py_field_name = 0;
 
   if(!PyArg_ParseTupleAndKeywords(args, kwargs, (char*)"O:RelatedRecord.sum", (char**)kwlist, &py_field_name))
-    return NULL;
+    return 0;
 
   if(!(PyString_Check(py_field_name)))
-    return NULL;
+    return 0;
 
   const char* pchKey = PyString_AsString(py_field_name);
   if(pchKey)
@@ -416,14 +416,14 @@ static PyMethodDef RelatedRecord_methods[] = {
     {(char*)"max", (PyCFunction)RelatedRecord_max, METH_VARARGS | METH_KEYWORDS,
      (char*)"Maximum of all values of the field in the related records."
     },
-    {NULL, 0, 0, 0}  /* Sentinel */
+    {0, 0, 0, 0}  /* Sentinel */
 };
 
 
 
 
 static PyTypeObject pyglom_RelatedRecordType = {
-    PyObject_HEAD_INIT(NULL)
+    PyObject_HEAD_INIT(0)
     0,                         /*ob_size*/
     (char*)"glom.RelatedRecord",             /*tp_name*/
     sizeof(PyGlomRelatedRecord), /*tp_basicsize*/
diff --git a/glom/libglom/test_sync.cc b/glom/libglom/test_sync.cc
index 5fb102c..1acc9ff 100644
--- a/glom/libglom/test_sync.cc
+++ b/glom/libglom/test_sync.cc
@@ -33,7 +33,7 @@ main(int argc, char* argv[])
   {
     std::string stdout_output;
     int return_status = 0;
-    Glib::spawn_command_line_sync(command, &stdout_output, NULL, &return_status);
+    Glib::spawn_command_line_sync(command, &stdout_output, 0, &return_status);
     std::cout << " debug: output=" << stdout_output << std::endl;
   }
   catch(const Glib::Error& ex)
diff --git a/glom/main.cc b/glom/main.cc
index 010c873..d4d57e0 100644
--- a/glom/main.cc
+++ b/glom/main.cc
@@ -271,7 +271,7 @@ main(int argc, char* argv[])
     return -1;
   }
 
-  gchar* installation_dir_c = g_win32_get_package_installation_directory_of_module(NULL);
+  gchar* installation_dir_c = g_win32_get_package_installation_directory_of_module(0);
   const std::string installation_dir(installation_dir_c);
   g_free(installation_dir_c);
 #endif
@@ -362,7 +362,7 @@ main(int argc, char* argv[])
 #ifdef GLIBMM_EXCEPTIONS_ENABLED
   catch(const Glib::OptionError& ex)
 #else
-  if(error.get() != NULL)
+  if(error.get())
 #endif
   {
 #ifndef GLIBMM_EXCEPTIONS_ENABLED
diff --git a/glom/mode_data/box_data.cc b/glom/mode_data/box_data.cc
index a55be69..d9cdb73 100644
--- a/glom/mode_data/box_data.cc
+++ b/glom/mode_data/box_data.cc
@@ -360,7 +360,7 @@ void Box_Data::execute_button_script(const sharedptr<const LayoutItem_Button>& l
 #else
   std::auto_ptr<ExceptionConnection> error;
   sharedptr<SharedConnection> sharedconnection = connect_to_server(0 /* parent window */, error);
-  if(error.get() == NULL)
+  if(!error.get())
   {
 #endif // GLIBMM_EXCEPTIONS_ENABLED
 
diff --git a/glom/mode_data/box_data_calendar_related.cc b/glom/mode_data/box_data_calendar_related.cc
index 23e7644..27b485d 100644
--- a/glom/mode_data/box_data_calendar_related.cc
+++ b/glom/mode_data/box_data_calendar_related.cc
@@ -331,7 +331,7 @@ Box_Data_Calendar_Related::type_vecLayoutFields Box_Data_Calendar_Related::get_f
 void Box_Data_Calendar_Related::on_dialog_layout_hide()
 {
   Dialog_Layout_Calendar_Related* dialog_related = dynamic_cast<Dialog_Layout_Calendar_Related*>(m_pDialogLayout);
-  g_assert(dialog_related != NULL);
+  g_assert(dialog_related);
   m_portal = dialog_related->get_portal_layout();
 
 
@@ -366,13 +366,13 @@ Dialog_Layout* Box_Data_Calendar_Related::create_layout_dialog() const
     return dialog;
   }
 
-  return NULL;
+  return 0;
 }
 
 void Box_Data_Calendar_Related::prepare_layout_dialog(Dialog_Layout* dialog)
 {
   Dialog_Layout_Calendar_Related* related_dialog = dynamic_cast<Dialog_Layout_Calendar_Related*>(dialog);
-  g_assert(related_dialog != NULL);
+  g_assert(related_dialog);
   
   sharedptr<LayoutItem_CalendarPortal> derived_portal = sharedptr<LayoutItem_CalendarPortal>::cast_dynamic(m_portal);
   if(derived_portal && derived_portal->get_has_relationship_name())
@@ -541,7 +541,7 @@ void Box_Data_Calendar_Related::setup_menu()
 #else
   std::auto_ptr<Glib::Error> error;
   m_refUIManager->add_ui_from_string(ui_info, error);
-  if(error.get() != NULL)
+  if(error.get())
   {
     std::cerr << "building menus failed: " << error->what();
   }
diff --git a/glom/mode_data/box_data_details.cc b/glom/mode_data/box_data_details.cc
index 0f1bda2..0074fef 100644
--- a/glom/mode_data/box_data_details.cc
+++ b/glom/mode_data/box_data_details.cc
@@ -1049,7 +1049,7 @@ Dialog_Layout* Box_Data_Details::create_layout_dialog() const
     return dialog;
   }
 
-  return NULL;
+  return 0;
 }
 
 void Box_Data_Details::prepare_layout_dialog(Dialog_Layout* dialog)
diff --git a/glom/mode_data/box_data_list.cc b/glom/mode_data/box_data_list.cc
index 6b7fbd0..513a071 100644
--- a/glom/mode_data/box_data_list.cc
+++ b/glom/mode_data/box_data_list.cc
@@ -617,7 +617,7 @@ Dialog_Layout* Box_Data_List::create_layout_dialog() const
     return dialog;
   }
 
-  return NULL;
+  return 0;
 }
 
 void Box_Data_List::prepare_layout_dialog(Dialog_Layout* dialog)
diff --git a/glom/mode_data/box_data_list_related.cc b/glom/mode_data/box_data_list_related.cc
index c17ae75..cdd0263 100644
--- a/glom/mode_data/box_data_list_related.cc
+++ b/glom/mode_data/box_data_list_related.cc
@@ -317,7 +317,7 @@ void Box_Data_List_Related::on_adddel_record_added(const Gtk::TreeModel::iterato
 void Box_Data_List_Related::on_dialog_layout_hide()
 {
   Dialog_Layout_List_Related* dialog_related = dynamic_cast<Dialog_Layout_List_Related*>(m_pDialogLayout);
-  g_assert(dialog_related != NULL);
+  g_assert(dialog_related);
   m_portal = dialog_related->get_portal_layout();
 
 
@@ -346,13 +346,13 @@ Dialog_Layout* Box_Data_List_Related::create_layout_dialog() const
     return dialog;
   }
   
-  return NULL;
+  return 0;
 }
 
 void Box_Data_List_Related::prepare_layout_dialog(Dialog_Layout* dialog)
 {
   Dialog_Layout_List_Related* related_dialog = dynamic_cast<Dialog_Layout_List_Related*>(dialog);
-  g_assert(related_dialog != NULL);
+  g_assert(related_dialog);
 
   related_dialog->set_document(m_layout_name, m_layout_platform, get_document(), m_portal, m_parent_table);
 }
diff --git a/glom/mode_design/layout/dialog_layout_export.cc b/glom/mode_design/layout/dialog_layout_export.cc
index 8e7f5e8..e558351 100644
--- a/glom/mode_design/layout/dialog_layout_export.cc
+++ b/glom/mode_design/layout/dialog_layout_export.cc
@@ -319,7 +319,7 @@ void Dialog_Layout_Export::on_cell_data_name(Gtk::CellRenderer* renderer, const
       sharedptr<LayoutItem_Field> item = row[m_ColumnsFields.m_col_layout_item];
 
       //Names can never be edited.
-      g_object_set(renderer_text->gobj(), "markup", item->get_layout_display_name().c_str(), "editable", FALSE, (gpointer)NULL);
+      g_object_set(renderer_text->gobj(), "markup", item->get_layout_display_name().c_str(), "editable", FALSE, (gpointer)0);
     }
   }
 }
diff --git a/glom/mode_design/print_layouts/print_layout_toolbar_button.cc b/glom/mode_design/print_layouts/print_layout_toolbar_button.cc
index 8618920..fa1102f 100644
--- a/glom/mode_design/print_layouts/print_layout_toolbar_button.cc
+++ b/glom/mode_design/print_layouts/print_layout_toolbar_button.cc
@@ -28,7 +28,7 @@ namespace
 std::string get_icon_path(const std::string& filename)
 {
 #ifdef G_OS_WIN32
-  gchar* basepath = g_win32_get_package_installation_directory_of_module(NULL);
+  gchar* basepath = g_win32_get_package_installation_directory_of_module(0);
   const std::string result = Glib::build_filename(basepath,
       "share" G_DIR_SEPARATOR_S "glom" G_DIR_SEPARATOR_S "pixmaps", filename);
   g_free(basepath);
diff --git a/glom/mode_design/print_layouts/window_print_layout_edit.cc b/glom/mode_design/print_layouts/window_print_layout_edit.cc
index 3caf432..f229d63 100644
--- a/glom/mode_design/print_layouts/window_print_layout_edit.cc
+++ b/glom/mode_design/print_layouts/window_print_layout_edit.cc
@@ -640,7 +640,7 @@ void Window_PrintLayout_Edit::setup_context_menu()
   #else
   std::auto_ptr<Glib::Error> error;
   m_context_menu_uimanager->add_ui_from_string(ui_info, error);
-  if(error.get() != NULL)
+  if(error.get())
   {
     std::cerr << "building menus failed: " << error->what();
   }
diff --git a/glom/mode_design/relationships_overview/dialog_relationships_overview.cc b/glom/mode_design/relationships_overview/dialog_relationships_overview.cc
index 778d2a8..7879037 100644
--- a/glom/mode_design/relationships_overview/dialog_relationships_overview.cc
+++ b/glom/mode_design/relationships_overview/dialog_relationships_overview.cc
@@ -102,7 +102,7 @@ Dialog_RelationshipsOverview::Dialog_RelationshipsOverview(BaseObjectType* cobje
   #else
   std::auto_ptr<Glib::Error> error;
   m_refUIManager->add_ui_from_string(ui_info, error);
-  if(error.get() != NULL)
+  if(error.get())
   {
     std::cerr << "building menus failed: " << error->what();
   }
@@ -489,7 +489,7 @@ void Dialog_RelationshipsOverview::setup_context_menu()
   #else
   std::auto_ptr<Glib::Error> error;
   m_context_menu_uimanager->add_ui_from_string(ui_info, error);
-  if(error.get() != NULL)
+  if(error.get())
   {
     std::cerr << "building menus failed: " << error->what();
   }
diff --git a/glom/mode_design/translation/window_translations.cc b/glom/mode_design/translation/window_translations.cc
index c34ebff..29cee59 100644
--- a/glom/mode_design/translation/window_translations.cc
+++ b/glom/mode_design/translation/window_translations.cc
@@ -420,10 +420,10 @@ static jmp_buf jump;
 static void show_gettext_error(int severity, const char* filename, const gchar* message)
 {
   std::ostringstream msg_stream;
-  if(filename != NULL)
+  if(filename)
     msg_stream << filename << ": ";
 
-  if(message != NULL)
+  if(message)
    msg_stream << message;
 
   switch(severity)
@@ -537,7 +537,7 @@ void Window_Translations::on_button_export()
 
 
       po_file_t po_file = po_file_create();
-      po_message_iterator_t msg_iter = po_message_iterator(po_file, NULL);
+      po_message_iterator_t msg_iter = po_message_iterator(po_file, 0);
       
       for(Gtk::TreeModel::iterator iter = m_model->children().begin(); iter != m_model->children().end(); ++iter)
       {
@@ -624,7 +624,7 @@ void Window_Translations::on_button_import()
 
       //Look at each domain (could there be more than one?):
       const char* const* domains = po_file_domains(po_file);
-      for (int i = 0; domains[i] != NULL; i++)
+      for (int i = 0; domains[i] != 0; i++)
       {
         //Look at each message:
         po_message_iterator_t iter = po_message_iterator(po_file, domains[i]);
diff --git a/glom/mode_find/box_data_details_find.cc b/glom/mode_find/box_data_details_find.cc
index 65a7e8c..53954cc 100644
--- a/glom/mode_find/box_data_details_find.cc
+++ b/glom/mode_find/box_data_details_find.cc
@@ -34,7 +34,7 @@ Box_Data_Details_Find::Box_Data_Details_Find()
   m_hbox_buttons.pack_end(m_Button_Find, Gtk::PACK_SHRINK);
   #endif
 
-  g_object_set(m_Button_Find.gobj(), "can-default", TRUE, (gpointer)NULL); //TODO: Make this a real method in gtkmm?
+  g_object_set(m_Button_Find.gobj(), "can-default", TRUE, (gpointer)0); //TODO: Make this a real method in gtkmm?
 
 #ifndef GLOM_ENABLE_CLIENT_ONLY
   //Hide this because it is useless for Find mode:
diff --git a/glom/mode_find/box_data_list_find.cc b/glom/mode_find/box_data_list_find.cc
index ed29a6f..99f3582 100644
--- a/glom/mode_find/box_data_list_find.cc
+++ b/glom/mode_find/box_data_list_find.cc
@@ -33,7 +33,7 @@ Box_Data_List_Find::Box_Data_List_Find()
   m_HBox.pack_end(m_Button_Find, Gtk::PACK_SHRINK);
   pack_start(m_HBox, Gtk::PACK_SHRINK);
 
-  g_object_set(m_Button_Find.gobj(), "can-default", TRUE, (gpointer)NULL); //TODO: Make this a real method in gtkmm?
+  g_object_set(m_Button_Find.gobj(), "can-default", TRUE, (gpointer)0); //TODO: Make this a real method in gtkmm?
 
   //Prevent the widget from trying to add or change records:
   m_AddDel.set_find_mode();
diff --git a/glom/print_layout/canvas_print_layout.cc b/glom/print_layout/canvas_print_layout.cc
index ad301d4..ceeca6c 100644
--- a/glom/print_layout/canvas_print_layout.cc
+++ b/glom/print_layout/canvas_print_layout.cc
@@ -99,7 +99,7 @@ void Canvas_PrintLayout::set_print_layout(const Glib::ustring& table_name, const
     #endif
     
     //TODO: Use this when gtkmm and GTK+ have been fixed: page_setup = Gtk::PageSetup::create(key_file);
-    page_setup = Glib::wrap(gtk_page_setup_new_from_key_file(key_file.gobj(), NULL, NULL));
+    page_setup = Glib::wrap(gtk_page_setup_new_from_key_file(key_file.gobj(), 0, 0));
   }
 
   set_page_setup(page_setup);
@@ -290,7 +290,7 @@ void Canvas_PrintLayout::setup_context_menu()
   #else
   std::auto_ptr<Glib::Error> error;
   m_context_menu_uimanager->add_ui_from_string(ui_info, error);
-  if(error.get() != NULL)
+  if(error.get())
   {
     std::cerr << "building menus failed: " << error->what();
   }
diff --git a/glom/python_embed/glom_python.cc b/glom/python_embed/glom_python.cc
index e0f8dc5..88c9e14 100644
--- a/glom/python_embed/glom_python.cc
+++ b/glom/python_embed/glom_python.cc
@@ -90,15 +90,15 @@ void ShowTrace()
 
   PyObject *tracebackModule = PyImport_ImportModule((char*)"traceback");
   gchar* chrRetval = 0;
-  if(tracebackModule != NULL)
+  if(tracebackModule)
   {
       PyObject* tbList = PyObject_CallMethod(
           tracebackModule,
           (char*)"format_exception",
           (char*)"OOO",
           type,
-          value == NULL ? Py_None : value,
-          traceback == NULL ? Py_None : traceback);
+          value == 0 ? Py_None : value,
+          traceback == 0 ? Py_None : traceback);
       
       if(!tbList)
       {
diff --git a/glom/python_embed/python_module/py_glom_module.cc b/glom/python_embed/python_module/py_glom_module.cc
index 1b97623..332019c 100644
--- a/glom/python_embed/python_module/py_glom_module.cc
+++ b/glom/python_embed/python_module/py_glom_module.cc
@@ -30,7 +30,7 @@
 #include <libglom/python_embed/py_glom_relatedrecord.h>
 
 static PyMethodDef pyglom_methods[] = {
-    {NULL, 0, 0, 0}  /* Sentinel */
+    {0, 0, 0, 0}  /* Sentinel */
 };
 
 PyMODINIT_FUNC
diff --git a/glom/utility_widgets/adddel/adddel.cc b/glom/utility_widgets/adddel/adddel.cc
index fa06bd3..7ef3675 100644
--- a/glom/utility_widgets/adddel/adddel.cc
+++ b/glom/utility_widgets/adddel/adddel.cc
@@ -276,7 +276,7 @@ void AddDel::setup_menu()
 #else
   std::auto_ptr<Glib::Error> error;
   m_refUIManager->add_ui_from_string(ui_info, error);
-  if(error.get() != NULL)
+  if(error.get())
   {
     std::cerr << "building menus failed: " << error->what();
   }
@@ -699,7 +699,7 @@ void AddDel::construct_specified_columns()
           if(pCellRenderer)
           {
             //Make it editable:
-            g_object_set(pCellRenderer->gobj(), "editable", TRUE, (gpointer)NULL);
+            g_object_set(pCellRenderer->gobj(), "editable", TRUE, (gpointer)0);
 
             //Connect to its signal:
             pCellRenderer->signal_edited().connect(
@@ -711,7 +711,7 @@ void AddDel::construct_specified_columns()
            Gtk::CellRendererToggle* pCellRenderer = dynamic_cast<Gtk::CellRendererToggle*>(m_TreeView.get_column_cell_renderer(view_column_index));
            if(pCellRenderer)
            {
-             g_object_set(pCellRenderer->gobj(), "activatable", TRUE, (gpointer)NULL);
+             g_object_set(pCellRenderer->gobj(), "activatable", TRUE, (gpointer)0);
 
              //Connect to its signal:
              pCellRenderer->signal_toggled().connect(
diff --git a/glom/utility_widgets/canvas/test_canvas_editable.cc b/glom/utility_widgets/canvas/test_canvas_editable.cc
index 00977fc..e20fec3 100644
--- a/glom/utility_widgets/canvas/test_canvas_editable.cc
+++ b/glom/utility_widgets/canvas/test_canvas_editable.cc
@@ -114,7 +114,7 @@ public:
                                        "column", 0,
                                        "x-fill", TRUE, 
                                        "x-expand", TRUE, 
-                                       NULL);
+                                       0);
     Glib::RefPtr<Glom::CanvasRectMovable> innerrect2 = Glom::CanvasRectMovable::create();
     innerrect2->property_fill_color() = "white"; //This makes the whole area clickable, not just the outline stroke.
     innerrect2->property_line_width() = 1;
@@ -126,7 +126,7 @@ public:
                                        "column", 0,
                                        "x-fill", TRUE, 
                                        "x-expand", TRUE, 
-                                       NULL);
+                                       0);
     add_item(table, true);
 
   }
@@ -186,7 +186,7 @@ private:
     #else
     std::auto_ptr<Glib::Error> error;
     m_context_menu_uimanager->add_ui_from_string(ui_info, error);
-    if(error.get() != NULL)
+    if(error.get())
     {
       std::cerr << "building menus failed: " << error->what();
     }
diff --git a/glom/utility_widgets/db_adddel/db_adddel.cc b/glom/utility_widgets/db_adddel/db_adddel.cc
index d089649..cc14985 100644
--- a/glom/utility_widgets/db_adddel/db_adddel.cc
+++ b/glom/utility_widgets/db_adddel/db_adddel.cc
@@ -318,7 +318,7 @@ void DbAddDel::setup_menu()
 #else
   std::auto_ptr<Glib::Error> error;
   m_refUIManager->add_ui_from_string(ui_info, error);
-  if(error.get() != NULL)
+  if(error.get())
   {
     std::cerr << "building menus failed: " << error->what();
   }
@@ -766,7 +766,7 @@ Gtk::CellRenderer* DbAddDel::construct_specified_columns_cellrenderer(const shar
     //Use an ellipze to indicate excessive text, 
     //so that similar values do not look equal, 
     //and to avoid multi-line comments. TODO: Is there a better way to restrict the height? This doesn't actually truncate multilines anyway.
-    g_object_set(pCellRendererText->gobj(), "ellipsize", PANGO_ELLIPSIZE_END, (gpointer)NULL);
+    g_object_set(pCellRendererText->gobj(), "ellipsize", PANGO_ELLIPSIZE_END, (gpointer)0);
 
     //Restrict the height, to prevent multiline text cells,
     //and to allow TreeView performance optimisation:
@@ -2237,7 +2237,7 @@ void DbAddDel::treeviewcolumn_on_cell_data(Gtk::CellRenderer* renderer, const Gt
             if(pixbuf)
               pixbuf = ImageGlom::scale_keeping_ratio(pixbuf,  get_fixed_cell_height(), pixbuf->get_width());
 
-            g_object_set(pDerived->gobj(), "pixbuf", pixbuf ? pixbuf->gobj() : NULL, (gpointer)NULL);
+            g_object_set(pDerived->gobj(), "pixbuf", pixbuf ? pixbuf->gobj() : 0, (gpointer)0);
           }
           else
             g_warning("Field::sql(): glom_type is TYPE_IMAGE but gda type is not VALUE_TYPE_BINARY");
@@ -2253,7 +2253,7 @@ void DbAddDel::treeviewcolumn_on_cell_data(Gtk::CellRenderer* renderer, const Gt
             //std::cout << "  debug: DbAddDel::treeviewcolumn_on_cell_data(): field name=" << field->get_name() << ", glom type=" << field->get_glom_type() << std::endl;
             const Glib::ustring text = Conversions::get_text_for_gda_value(field->get_glom_type(), value, field->get_formatting_used().m_numeric_format);
             //g_assert(text != "NULL");
-            g_object_set(pDerived->gobj(), "text", text.c_str(), (gpointer)NULL);
+            g_object_set(pDerived->gobj(), "text", text.c_str(), (gpointer)0);
           }
 
           break;
diff --git a/glom/utility_widgets/dialog_image_progress.cc b/glom/utility_widgets/dialog_image_progress.cc
index c5f3bc0..221b811 100644
--- a/glom/utility_widgets/dialog_image_progress.cc
+++ b/glom/utility_widgets/dialog_image_progress.cc
@@ -78,7 +78,7 @@ void Dialog_Image_Progress::load(const Glib::ustring& uri)
 
   m_loader = Gdk::PixbufLoader::create();
   m_data.reset(new GdaBinary);
-  m_data->data = NULL;
+  m_data->data = 0;
   m_data->binary_length = 0;
 
   m_file = Gio::File::create_for_uri(uri);
diff --git a/glom/utility_widgets/imageglom.cc b/glom/utility_widgets/imageglom.cc
index 6c8c7ee..85e057b 100644
--- a/glom/utility_widgets/imageglom.cc
+++ b/glom/utility_widgets/imageglom.cc
@@ -600,7 +600,7 @@ void ImageGlom::setup_menu_usermode()
   catch(const Glib::Error& ex)
   {
 #else
-  if(error.get() != NULL)
+  if(error.get())
   {
     const Glib::Error& ex = *error.get();
 #endif
diff --git a/glom/utils_ui.cc b/glom/utils_ui.cc
index 0c93a84..c97a8c5 100644
--- a/glom/utils_ui.cc
+++ b/glom/utils_ui.cc
@@ -62,18 +62,18 @@ std::string locate_help_file(const std::string& path, const std::string& doc_nam
   // g_get_language_names seems not to be wrapped by glibmm
   const char* const* lang_list = g_get_language_names ();
 
-  for(unsigned int j = 0; lang_list[j] != NULL; ++j)
+  for(unsigned int j = 0; lang_list[j] != 0; ++j)
   {
     const char* lang = lang_list[j];
 
-    /* This has to be a valid language AND a language with
+    /* This must be a valid language AND a language with
      * no encoding postfix.  The language will come up without
      * encoding next. */
-    if(lang == NULL || strchr(lang, '.') != NULL)
+    if(lang == 0 || strchr(lang, '.') != 0)
       continue;
 
-    const char* exts[] = { "", ".xml", ".docbook", ".sgml", ".html", NULL };
-    for(unsigned i = 0; exts[i] != NULL; ++i)
+    const char* exts[] = { "", ".xml", ".docbook", ".sgml", ".html", 0 };
+    for(unsigned i = 0; exts[i] != 0; ++i)
     {
       std::string name = doc_name + exts[i];
       std::string full = Glib::build_filename(path, Glib::build_filename(lang, name));
@@ -148,7 +148,7 @@ void Utils::show_help(const Glib::ustring& id)
       if(pId) { uri += "?"; uri += pId; }
 
       // g_app_info_launch_default_for_uri seems not to be wrapped by giomm
-      if(!g_app_info_launch_default_for_uri(uri.c_str(), NULL, &err))
+      if(!g_app_info_launch_default_for_uri(uri.c_str(), 0, &err))
       {
         std::string message(err->message);
         g_error_free(err);
@@ -243,7 +243,7 @@ Glib::RefPtr<Gdk::Pixbuf> Utils::get_pixbuf_for_gda_value(const Gnome::Gda::Valu
       else
       {
         buffer_binary_length = 0;
-        buffer_binary = NULL;
+        buffer_binary = 0;
         g_warning("Conversions::get_pixbuf_for_gda_value(): Failed to read BLOB data");
       }
     }
@@ -295,7 +295,7 @@ Glib::RefPtr<Gdk::Pixbuf> Utils::get_pixbuf_for_gda_value(const Gnome::Gda::Valu
 #else
         std::auto_ptr<Glib::Error> error;
         refPixbufLoader->write(puiData, (glong)buffer_binary_length, error);
-        if(error.get() == NULL)
+        if(!error.get())
         {
           result = refPixbufLoader->get_pixbuf();
           refPixbufLoader->close(error);
@@ -306,7 +306,7 @@ Glib::RefPtr<Gdk::Pixbuf> Utils::get_pixbuf_for_gda_value(const Gnome::Gda::Valu
         catch(const Glib::Exception& ex)
         {
 #else
-        if(error.get() != NULL)
+        if(error.get())
         {
           const Glib::Exception& ex = *error.get();        
 #endif
diff --git a/glom/xsl_utils.cc b/glom/xsl_utils.cc
index ae231e9..c33dac3 100644
--- a/glom/xsl_utils.cc
+++ b/glom/xsl_utils.cc
@@ -107,7 +107,7 @@ void GlomXslUtils::transform_and_open(const xmlpp::Document& xml_document, const
   {
     stream = file->create_file(Gio::FILE_CREATE_NONE, error);
   }
-  if(error.get() != NULL)
+  if(error.get())
   {
 #endif
     // If the operation was not successful, print the error and abort
@@ -126,7 +126,7 @@ void GlomXslUtils::transform_and_open(const xmlpp::Document& xml_document, const
   {
 #else
   bytes_written = stream->write(result.data(), result_bytes, error);
-  if(error.get() != NULL)
+  if(error.get())
   {
 #endif
     // If the operation was not successful, print the error and abort
@@ -145,7 +145,7 @@ void GlomXslUtils::transform_and_open(const xmlpp::Document& xml_document, const
   // gtk_show_uri doesn't seem to work on Win32, at least not for local files
   // We use Windows API instead.
   // TODO: Check it again and file a bug if necessary.
-  ShellExecute(NULL, "open", file->get_path().c_str(), NULL, NULL, SW_SHOW);
+  ShellExecute(0, "open", file->get_path().c_str(), 0, 0, SW_SHOW);
 #else
   //Use the GNOME browser:
   GError* gerror = 0;



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