[gnome-db]variable name "export" in libgda conflicts with GCC 3.0 (and the C++ language...)
- From: ernst molitor uni-bonn de
- To: gnome-db-list gnome org
- Subject: [gnome-db]variable name "export" in libgda conflicts with GCC 3.0 (and the C++ language...)
- Date: Wed, 20 Jun 2001 17:37:05 +0200
Dear GNOME-db gurus,
trying to compile libgda-0.2.10 with the new version of
GCC, 3.0, which includes still better support for C/C++
standards, I came across a minor problem with
libgda-0.2.10/lib/gda-client/gda_export.[hc]: At a few
spots in these files, a variable is called "export".
"export", however, is a C++ keyword (§ 9.2.3 & § 13.7, B. Stroustrup:
The C++ Programming Language, 3rd edition), so I have added an s to
the variable names "export", resulting in "exports". Included,
please find a diff to the effect.
Best regards,
Ernst
--- snip, snip ---
*** libgda-0.2.10/lib/gda-client/gda-export.c Thu Jun 14 01:14:12 2001
--- libgda-0.2.10.new/lib/gda-client/gda-export.c Wed Jun 20 10:25:43 2001
***************
*** 41,47 ****
static gint gda_export_signals[LAST_SIGNAL] = { 0, };
static void gda_export_class_init (GdaExportClass *klass);
! static void gda_export_init (GdaExport *export);
static void gda_export_destroy (GdaExport *destroy);
/*
--- 41,47 ----
static gint gda_export_signals[LAST_SIGNAL] = { 0, };
static void gda_export_class_init (GdaExportClass *klass);
! static void gda_export_init (GdaExport *exports);
static void gda_export_destroy (GdaExport *destroy);
/*
***************
*** 145,167 ****
}
static void
! gda_export_init (GdaExport *export)
{
! export->priv = g_new0 (GdaExportPrivate, 1);
}
static void
! gda_export_destroy (GdaExport *export)
{
GtkObjectClass *parent_class;
! destroy_hash_table (&export->priv->selected_tables);
! g_free (export->priv);
parent_class = gtk_type_class (gtk_object_get_type ());
if (parent_class && parent_class->destroy)
! parent_class->destroy (GTK_OBJECT (export));
}
/**
--- 145,167 ----
}
static void
! gda_export_init (GdaExport *exports)
{
! exports->priv = g_new0 (GdaExportPrivate, 1);
}
static void
! gda_export_destroy (GdaExport *exports)
{
GtkObjectClass *parent_class;
! destroy_hash_table (&exports->priv->selected_tables);
! g_free (exports->priv);
parent_class = gtk_type_class (gtk_object_get_type ());
if (parent_class && parent_class->destroy)
! parent_class->destroy (GTK_OBJECT (exports));
}
/**
***************
*** 185,208 ****
GdaExport *
gda_export_new (GdaConnection *cnc)
{
! GdaExport *export;
! export = GDA_EXPORT (gtk_type_new (gda_export_get_type ()));
if (IS_GDA_CONNECTION (cnc))
! gda_export_set_connection (export, cnc);
! return export;
}
void
! gda_export_free (GdaExport *export)
{
! g_return_if_fail (IS_GDA_EXPORT (export));
#ifdef HAVE_GOBJECT
! g_object_unref (export);
#else
! gtk_object_unref (GTK_OBJECT (export));
#endif
}
--- 185,208 ----
GdaExport *
gda_export_new (GdaConnection *cnc)
{
! GdaExport *exports;
! exports = GDA_EXPORT (gtk_type_new (gda_export_get_type ()));
if (IS_GDA_CONNECTION (cnc))
! gda_export_set_connection (exports, cnc);
! return exports;
}
void
! gda_export_free (GdaExport *exports)
{
! g_return_if_fail (IS_GDA_EXPORT (exports));
#ifdef HAVE_GOBJECT
! g_object_unref (exports);
#else
! gtk_object_unref (GTK_OBJECT (exports));
#endif
}
***************
*** 220,231 ****
* Returns: a GList containing the names of all the tables
*/
GList *
! gda_export_get_tables (GdaExport *export)
{
! g_return_val_if_fail (IS_GDA_EXPORT (export), NULL);
! g_return_val_if_fail (export->priv != NULL, NULL);
! return get_object_list (export->priv->cnc, GDA_Connection_GDCN_SCHEMA_TABLES);
}
/**
--- 220,231 ----
* Returns: a GList containing the names of all the tables
*/
GList *
! gda_export_get_tables (GdaExport *exports)
{
! g_return_val_if_fail (IS_GDA_EXPORT (exports), NULL);
! g_return_val_if_fail (exports->priv != NULL, NULL);
! return get_object_list (exports->priv->cnc, GDA_Connection_GDCN_SCHEMA_TABLES);
}
/**
***************
*** 240,251 ****
* Returns: a #GList containing the names of the selected tables
*/
GList *
! gda_export_get_selected_tables (GdaExport *export)
{
! g_return_val_if_fail (IS_GDA_EXPORT (export), NULL);
! g_return_val_if_fail (export->priv != NULL, NULL);
! return gda_util_hash_to_list (export->priv->selected_tables);
}
/**
--- 240,251 ----
* Returns: a #GList containing the names of the selected tables
*/
GList *
! gda_export_get_selected_tables (GdaExport *exports)
{
! g_return_val_if_fail (IS_GDA_EXPORT (exports), NULL);
! g_return_val_if_fail (exports->priv != NULL, NULL);
! return gda_util_hash_to_list (exports->priv->selected_tables);
}
/**
***************
*** 256,274 ****
* Add the given table to the list of selected tables
*/
void
! gda_export_select_table (GdaExport *export, const gchar *table)
{
gchar *data;
! g_return_if_fail (IS_GDA_EXPORT (export));
g_return_if_fail (table != NULL);
! data = g_hash_table_lookup (export->priv->selected_tables, (gconstpointer) table);
if (!data) {
data = (gpointer) g_strdup (table);
! g_hash_table_insert (export->priv->selected_tables, data, data);
! gtk_signal_emit (GTK_OBJECT (export),
gda_export_signals[OBJECT_SELECTED],
GDA_Connection_GDCN_SCHEMA_TABLES,
table);
--- 256,274 ----
* Add the given table to the list of selected tables
*/
void
! gda_export_select_table (GdaExport *exports, const gchar *table)
{
gchar *data;
! g_return_if_fail (IS_GDA_EXPORT (exports));
g_return_if_fail (table != NULL);
! data = g_hash_table_lookup (exports->priv->selected_tables, (gconstpointer) table);
if (!data) {
data = (gpointer) g_strdup (table);
! g_hash_table_insert (exports->priv->selected_tables, data, data);
! gtk_signal_emit (GTK_OBJECT (exports),
gda_export_signals[OBJECT_SELECTED],
GDA_Connection_GDCN_SCHEMA_TABLES,
table);
***************
*** 283,299 ****
* Remove the given table name from the list of selected tables
*/
void
! gda_export_unselect_table (GdaExport *export, const gchar *table)
{
gchar *data;
! g_return_if_fail (IS_GDA_EXPORT (export));
g_return_if_fail (table != NULL);
! data = g_hash_table_lookup (export->priv->selected_tables, (gconstpointer) table);
if (data) {
! g_hash_table_remove (export->priv->selected_tables, table);
! gtk_signal_emit (GTK_OBJECT (export),
gda_export_signals[OBJECT_UNSELECTED],
GDA_Connection_GDCN_SCHEMA_TABLES,
table);
--- 283,299 ----
* Remove the given table name from the list of selected tables
*/
void
! gda_export_unselect_table (GdaExport *exports, const gchar *table)
{
gchar *data;
! g_return_if_fail (IS_GDA_EXPORT (exports));
g_return_if_fail (table != NULL);
! data = g_hash_table_lookup (exports->priv->selected_tables, (gconstpointer) table);
if (data) {
! g_hash_table_remove (exports->priv->selected_tables, table);
! gtk_signal_emit (GTK_OBJECT (exports),
gda_export_signals[OBJECT_UNSELECTED],
GDA_Connection_GDCN_SCHEMA_TABLES,
table);
***************
*** 310,337 ****
* Returns: the #GdaConnection object being used
*/
GdaConnection *
! gda_export_get_connection (GdaExport *export)
{
! g_return_val_if_fail (IS_GDA_EXPORT (export), NULL);
! return export->priv->cnc;
}
/**
* gda_export_set_connection
*/
void
! gda_export_set_connection (GdaExport *export, GdaConnection *cnc)
{
! g_return_if_fail (IS_GDA_EXPORT (export));
/* unref the old GdaConnection */
! if (IS_GDA_CONNECTION (export->priv->cnc)) {
! gda_connection_free (export->priv->cnc);
! export->priv->cnc = NULL;
}
if (IS_GDA_CONNECTION (cnc)) {
! export->priv->cnc = cnc;
! gtk_object_ref (GTK_OBJECT (export->priv->cnc));
}
}
--- 310,337 ----
* Returns: the #GdaConnection object being used
*/
GdaConnection *
! gda_export_get_connection (GdaExport *exports)
{
! g_return_val_if_fail (IS_GDA_EXPORT (exports), NULL);
! return exports->priv->cnc;
}
/**
* gda_export_set_connection
*/
void
! gda_export_set_connection (GdaExport *exports, GdaConnection *cnc)
{
! g_return_if_fail (IS_GDA_EXPORT (exports));
/* unref the old GdaConnection */
! if (IS_GDA_CONNECTION (exports->priv->cnc)) {
! gda_connection_free (exports->priv->cnc);
! exports->priv->cnc = NULL;
}
if (IS_GDA_CONNECTION (cnc)) {
! exports->priv->cnc = cnc;
! gtk_object_ref (GTK_OBJECT (exports->priv->cnc));
}
}
--- snip, snip ---
--- snip, snip ---
*** libgda-0.2.10/lib/gda-client/gda-export.h Wed Jun 13 19:29:24 2001
--- libgda-0.2.10.new/lib/gda-client/gda-export.h Tue Jun 19 10:03:01 2001
***************
*** 67,74 ****
GtkObjectClass parent_class;
#endif
! void (*object_selected) (GdaExport *export, GDA_Connection_QType qtype, const gchar *name);
! void (*object_unselected) (GdaExport *export, GDA_Connection_QType qtype, const gchar *name);
};
#ifdef HAVE_GOBJECT
--- 67,74 ----
GtkObjectClass parent_class;
#endif
! void (*object_selected) (GdaExport *exports, GDA_Connection_QType qtype, const gchar *name);
! void (*object_unselected) (GdaExport *exports, GDA_Connection_QType qtype, const gchar *name);
};
#ifdef HAVE_GOBJECT
***************
*** 78,95 ****
#endif
GdaExport* gda_export_new (GdaConnection *cnc);
! void gda_export_free (GdaExport *export);
GList* gda_export_get_tables (GdaExport *);
! GList* gda_export_get_selected_tables (GdaExport *export);
! void gda_export_select_table (GdaExport *export, const gchar *table);
! void gda_export_unselect_table (GdaExport *export, const gchar *table);
! void gda_export_run (GdaExport *export);
! void gda_export_stop (GdaExport *export);
! GdaConnection* gda_export_get_connection (GdaExport *export);
! void gda_export_set_connection (GdaExport *export, GdaConnection *cnc);
#ifdef __cplusplus
}
--- 78,95 ----
#endif
GdaExport* gda_export_new (GdaConnection *cnc);
! void gda_export_free (GdaExport *exports);
GList* gda_export_get_tables (GdaExport *);
! GList* gda_export_get_selected_tables (GdaExport *exports);
! void gda_export_select_table (GdaExport *exports, const gchar *table);
! void gda_export_unselect_table (GdaExport *exports, const gchar *table);
! void gda_export_run (GdaExport *exports);
! void gda_export_stop (GdaExport *exports);
! GdaConnection* gda_export_get_connection (GdaExport *exports);
! void gda_export_set_connection (GdaExport *exports, GdaConnection *cnc);
#ifdef __cplusplus
}
--- snip, snip ---
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]