Commit 5d9839eb authored by David King's avatar David King
Browse files

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.
parent eec89f3b
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
......
......@@ -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)
......
......@@ -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);
......
......@@ -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,
......
......@@ -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 {
......
......@@ -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.
......
......@@ -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);
......
......@@ -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
{
......
......@@ -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
{
......
......@@ -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);
......
......@@ -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())
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment