[glom] Use array notation where appropriate



commit 5d9839ebcf4f8339db0677299297a2c89dec6bc0
Author: David King <davidk openismus com>
Date:   Mon Oct 11 12:05:16 2010 +0200

    Use array notation where appropriate
    
    * glom/dialog_connection.[cc|h]:
    * glom/dialog_existing_or_new.[cc|h]:
    * glom/dialog_invalid_data.[cc|h]:
    * glom/libglom/connectionpool_backends/postgres.cc:
    * glom/libglom/connectionpool_backends/postgres_self.cc:
    * glom/libglom/connectionpool_backends/sqlite.cc:
    * glom/utils_ui.cc: Use array notation when initializing constant
    character arrays.

 ChangeLog                                          |   13 +++++++++++++
 glom/dialog_connection.cc                          |    2 +-
 glom/dialog_connection.h                           |    2 +-
 glom/dialog_existing_or_new.cc                     |   10 +++++-----
 glom/dialog_existing_or_new.h                      |    2 +-
 glom/dialog_invalid_data.cc                        |    2 +-
 glom/dialog_invalid_data.h                         |    2 +-
 glom/libglom/connectionpool_backends/postgres.cc   |    4 ++--
 .../connectionpool_backends/postgres_self.cc       |    4 ++--
 glom/libglom/connectionpool_backends/sqlite.cc     |    4 ++--
 glom/utils_ui.cc                                   |    6 +++---
 11 files changed, 32 insertions(+), 19 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 3cd27cb..8e5acfb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,18 @@
 2010-10-11  David King  <davidk openismus com>
 
+	Use array notation where appropriate
+
+	* glom/dialog_connection.[cc|h]:
+	* glom/dialog_existing_or_new.[cc|h]:
+	* glom/dialog_invalid_data.[cc|h]:
+	* glom/libglom/connectionpool_backends/postgres.cc:
+	* glom/libglom/connectionpool_backends/postgres_self.cc:
+	* glom/libglom/connectionpool_backends/sqlite.cc:
+	* glom/utils_ui.cc: Use array notation when initializing constant
+	character arrays.
+
+2010-10-11  David King  <davidk openismus com>
+
 	Use unsigned integers where appropriate
 
 	* glom/libglom/connectionpool_backends/postgres.[cc|h]:
diff --git a/glom/dialog_connection.cc b/glom/dialog_connection.cc
index 0d65ab0..73c64e6 100644
--- a/glom/dialog_connection.cc
+++ b/glom/dialog_connection.cc
@@ -32,7 +32,7 @@
 namespace Glom
 {
 
-const char* Dialog_Connection::glade_id("dialog_connection");
+const char Dialog_Connection::glade_id[] = "dialog_connection";
 const bool Dialog_Connection::glade_developer(false);
 
 Dialog_Connection::Dialog_Connection(BaseObjectType* cobject, const Glib::RefPtr<Gtk::Builder>& builder)
diff --git a/glom/dialog_connection.h b/glom/dialog_connection.h
index 800862e..9df297c 100644
--- a/glom/dialog_connection.h
+++ b/glom/dialog_connection.h
@@ -36,7 +36,7 @@ class Dialog_Connection
     public Base_DB
 {
 public:
-  static const char* glade_id;
+  static const char glade_id[];
   static const bool glade_developer;
 
   Dialog_Connection(BaseObjectType* cobject, const Glib::RefPtr<Gtk::Builder>& builder);
diff --git a/glom/dialog_existing_or_new.cc b/glom/dialog_existing_or_new.cc
index 341ecab..ae65c3e 100644
--- a/glom/dialog_existing_or_new.cc
+++ b/glom/dialog_existing_or_new.cc
@@ -49,11 +49,11 @@ static const int NEW_PAGE = 1;
 namespace
 {
 
-const char* RECENT_DUMMY_TEXT = N_("No recently used documents available.");
-const char* NETWORK_DUMMY_TEXT = N_("No sessions found on the local network.");
+const char RECENT_DUMMY_TEXT[] = N_("No recently used documents available.");
+const char NETWORK_DUMMY_TEXT[] = N_("No sessions found on the local network.");
 
 #ifndef GLOM_ENABLE_CLIENT_ONLY
-const char* TEMPLATE_DUMMY_TEXT = N_("No templates available.");
+const char TEMPLATE_DUMMY_TEXT[] = N_("No templates available.");
 #endif
 
 //TODO_Performance: A DomParser or XmlReader might be faster, or even a regex.
@@ -101,7 +101,7 @@ private:
 namespace Glom
 {
 
-const char* Dialog_ExistingOrNew::glade_id("dialog_existing_or_new");
+const char Dialog_ExistingOrNew::glade_id[] = "dialog_existing_or_new";
 const bool Dialog_ExistingOrNew::glade_developer(false);
 
 Dialog_ExistingOrNew::Dialog_ExistingOrNew(BaseObjectType* cobject, const Glib::RefPtr<Gtk::Builder>& builder)
@@ -250,7 +250,7 @@ Dialog_ExistingOrNew::Dialog_ExistingOrNew(BaseObjectType* cobject, const Glib::
   if(!Glib::file_test(path, Glib::FILE_TEST_EXISTS))
     path = GLOM_DOCDIR_EXAMPLES;
 #else
-  const char *const path = GLOM_DOCDIR_EXAMPLES;
+  const char path[] = GLOM_DOCDIR_EXAMPLES;
 #endif //G_OS_WIN32
 
   //Show the installed example files,
diff --git a/glom/dialog_existing_or_new.h b/glom/dialog_existing_or_new.h
index afd0b38..b3862a5 100644
--- a/glom/dialog_existing_or_new.h
+++ b/glom/dialog_existing_or_new.h
@@ -46,7 +46,7 @@ class Dialog_ExistingOrNew
   : public Gtk::Dialog
 {
 public:
-  static const char* glade_id;
+  static const char glade_id[];
   static const bool glade_developer;
 
   enum Action {
diff --git a/glom/dialog_invalid_data.cc b/glom/dialog_invalid_data.cc
index 136f42c..5a075a1 100644
--- a/glom/dialog_invalid_data.cc
+++ b/glom/dialog_invalid_data.cc
@@ -26,7 +26,7 @@
 namespace Glom
 {
 
-const char* Dialog_InvalidData::glade_id("dialog_data_invalid_format");
+const char Dialog_InvalidData::glade_id[] = "dialog_data_invalid_format";
 const bool Dialog_InvalidData::glade_developer(false);
 
 /** Show the dialog.
diff --git a/glom/dialog_invalid_data.h b/glom/dialog_invalid_data.h
index 093281d..dfb5c7e 100644
--- a/glom/dialog_invalid_data.h
+++ b/glom/dialog_invalid_data.h
@@ -37,7 +37,7 @@ bool glom_show_dialog_invalid_data(Field::glom_field_type glom_type);
 class Dialog_InvalidData : public Gtk::Dialog
 {
 public:
-  static const char* glade_id;
+  static const char glade_id[];
   static const bool glade_developer;
 
   Dialog_InvalidData(BaseObjectType* cobject, const Glib::RefPtr<Gtk::Builder>& builder);
diff --git a/glom/libglom/connectionpool_backends/postgres.cc b/glom/libglom/connectionpool_backends/postgres.cc
index f1ececd..cdc8a9f 100644
--- a/glom/libglom/connectionpool_backends/postgres.cc
+++ b/glom/libglom/connectionpool_backends/postgres.cc
@@ -148,8 +148,8 @@ Glib::RefPtr<Gnome::Gda::Connection> Postgres::attempt_connect(const Glib::ustri
 
 bool Postgres::change_columns(const Glib::RefPtr<Gnome::Gda::Connection>& connection, const Glib::ustring& table_name, const type_vec_const_fields& old_fields, const type_vec_const_fields& new_fields) throw()
 {
-  static const char* TRANSACTION_NAME = "glom_change_columns_transaction";
-  static const gchar* TEMP_COLUMN_NAME = "glom_temp_column"; // TODO: Find a unique name.
+  static const char TRANSACTION_NAME[] = "glom_change_columns_transaction";
+  static const char TEMP_COLUMN_NAME[] = "glom_temp_column"; // TODO: Find a unique name.
 
   try
   {
diff --git a/glom/libglom/connectionpool_backends/postgres_self.cc b/glom/libglom/connectionpool_backends/postgres_self.cc
index 7212c3f..c90592d 100644
--- a/glom/libglom/connectionpool_backends/postgres_self.cc
+++ b/glom/libglom/connectionpool_backends/postgres_self.cc
@@ -262,7 +262,7 @@ Glib::ustring PostgresSelfHosted::get_postgresql_utils_version(const SlotProgres
   Glib::RefPtr<Glib::Regex> regex;
 
   //We want the characters at the end:
-  const gchar* VERSION_REGEX = "pg_ctl \\(PostgreSQL\\) (.*)";
+  const gchar VERSION_REGEX[] = "pg_ctl \\(PostgreSQL\\) (.*)";
 
   try
   {
@@ -304,7 +304,7 @@ float PostgresSelfHosted::get_postgresql_utils_version_as_number(const SlotProgr
   Glib::RefPtr<Glib::Regex> regex;
 
   //We want the characters at the end:
-  const gchar* VERSION_REGEX = "^(\\d*)\\.(\\d*)";
+  const gchar VERSION_REGEX[] = "^(\\d*)\\.(\\d*)";
 
   try
   {
diff --git a/glom/libglom/connectionpool_backends/sqlite.cc b/glom/libglom/connectionpool_backends/sqlite.cc
index 1e61dae..e2ee9a0 100644
--- a/glom/libglom/connectionpool_backends/sqlite.cc
+++ b/glom/libglom/connectionpool_backends/sqlite.cc
@@ -135,8 +135,8 @@ bool Sqlite::add_column_to_server_operation(const Glib::RefPtr<Gnome::Gda::Serve
 
 bool Sqlite::recreate_table(const Glib::RefPtr<Gnome::Gda::Connection>& connection, const Glib::ustring& table_name, const type_vec_strings& fields_removed, const type_vec_const_fields& fields_added, const type_mapFieldChanges& fields_changed) throw()
 {
-  static const gchar* TEMPORARY_TABLE_NAME = "GLOM_TEMP_TABLE"; // TODO: Make sure this is unique.
-  static const gchar* TRANSACTION_NAME = "GLOM_RECREATE_TABLE_TRANSACTION";
+  static const gchar TEMPORARY_TABLE_NAME[] = "GLOM_TEMP_TABLE"; // TODO: Make sure this is unique.
+  static const gchar TRANSACTION_NAME[] = "GLOM_RECREATE_TABLE_TRANSACTION";
 
   Glib::RefPtr<Gnome::Gda::MetaStore> store = connection->get_meta_store();
   Glib::RefPtr<Gnome::Gda::MetaStruct> metastruct = Gnome::Gda::MetaStruct::create(store, Gnome::Gda::META_STRUCT_FEATURE_NONE);
diff --git a/glom/utils_ui.cc b/glom/utils_ui.cc
index 7c4e3f3..b711044 100644
--- a/glom/utils_ui.cc
+++ b/glom/utils_ui.cc
@@ -135,9 +135,9 @@ void Utils::show_help(const Glib::ustring& id)
 
   try
   {
-    const char *const path = GLOM_DATADIR G_DIR_SEPARATOR_S "gnome"
-                                          G_DIR_SEPARATOR_S "help"
-                                          G_DIR_SEPARATOR_S "glom";
+    const char path[] = GLOM_DATADIR G_DIR_SEPARATOR_S "gnome"
+                                     G_DIR_SEPARATOR_S "help"
+                                     G_DIR_SEPARATOR_S "glom";
     std::string help_file = locate_help_file(path, "glom.xml");
     if(help_file.empty())
     {



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