[gnome-db] More warning cleanup (libgda)



	Hi!

	Here's is another warning clenup. There are a few really bad,
	but the rest, as usually, are just casts or #includes.

	Apply?

Index: libgda/gda-data-model.c
===================================================================
RCS file: /cvs/gnome/libgda/libgda/gda-data-model.c,v
retrieving revision 1.12
diff -u -r1.12 gda-data-model.c
--- libgda/gda-data-model.c	22 Mar 2002 02:41:56 -0000	1.12
+++ libgda/gda-data-model.c	30 Mar 2002 00:38:34 -0000
@@ -343,7 +343,7 @@
 			str = g_string_append_c (str, '\n');
 
 		for (c = 0; c < cols; c++) {
-			GdaValue *value;
+			const GdaValue *value;
 			gchar *txt;
 
 			value = gda_data_model_get_value_at (model, c, r);
Index: libgda/gda-init.c
===================================================================
RCS file: /cvs/gnome/libgda/libgda/gda-init.c,v
retrieving revision 1.10
diff -u -r1.10 gda-init.c
--- libgda/gda-init.c	18 Mar 2002 02:01:55 -0000	1.10
+++ libgda/gda-init.c	30 Mar 2002 00:38:34 -0000
@@ -24,6 +24,7 @@
 #include <bonobo/bonobo-i18n.h>
 #include <bonobo/bonobo-main.h>
 #include <libgda/libgda.h>
+#include <libgnomevfs/gnome-vfs.h>
 
 /* Include the marshalers here */
 #include "gda-marshal.h"
Index: libgda/gda-server-connection.c
===================================================================
RCS file: /cvs/gnome/libgda/libgda/gda-server-connection.c,v
retrieving revision 1.23
diff -u -r1.23 gda-server-connection.c
--- libgda/gda-server-connection.c	26 Mar 2002 02:06:40 -0000	1.23
+++ libgda/gda-server-connection.c	30 Mar 2002 00:38:34 -0000
@@ -24,6 +24,7 @@
 #include <libgda/gda-server-connection.h>
 #include <libgda/gda-server-provider.h>
 #include <libgda/gda-server-recordset.h>
+#include <libgda/gda-server-recordset-model.h>
 #include <bonobo/bonobo-i18n.h>
 #include <bonobo/bonobo-exception.h>
 
Index: libgda/gda-table.c
===================================================================
RCS file: /cvs/gnome/libgda/libgda/gda-table.c,v
retrieving revision 1.2
diff -u -r1.2 gda-table.c
--- libgda/gda-table.c	6 Mar 2002 19:35:00 -0000	1.2
+++ libgda/gda-table.c	30 Mar 2002 00:38:34 -0000
@@ -86,11 +86,12 @@
 	table->priv->fields = g_hash_table_new (g_str_hash, g_str_equal);
 }
 
-static void
+static gboolean
 remove_field_hash (gpointer key, gpointer value, gpointer user_data)
 {
 	g_free (key);
 	gda_field_attributes_free (value);
+	return TRUE;
 }
 
 static void
@@ -220,7 +221,7 @@
 	g_return_if_fail (GDA_IS_TABLE (table));
 	g_return_if_fail (fa != NULL);
 
-	name = gda_field_attributes_get_name (fa);
+	name = gda_field_attributes_get_name ((GdaFieldAttributes *) fa);
 	if (!name || !*name)
 		return;
 
@@ -232,11 +233,11 @@
 
 	/* add the new field to the table */
 	new_fa = gda_field_attributes_new ();
-	gda_field_attributes_set_defined_size (new_fa, gda_field_attributes_get_defined_size (fa));
+	gda_field_attributes_set_defined_size (new_fa, gda_field_attributes_get_defined_size ((GdaFieldAttributes *) fa));
 	gda_field_attributes_set_name (new_fa, name);
-	gda_field_attributes_set_scale (new_fa, gda_field_attributes_get_scale (fa));
-	gda_field_attributes_set_gdatype (new_fa, gda_field_attributes_get_gdatype (fa));
-	gda_field_attributes_set_allow_null (new_fa, gda_field_attributes_get_allow_null (fa));
+	gda_field_attributes_set_scale (new_fa, gda_field_attributes_get_scale ((GdaFieldAttributes *) fa));
+	gda_field_attributes_set_gdatype (new_fa, gda_field_attributes_get_gdatype ((GdaFieldAttributes *) fa));
+	gda_field_attributes_set_allow_null (new_fa, gda_field_attributes_get_allow_null ((GdaFieldAttributes *) fa));
 
 	g_hash_table_insert (table->priv->fields, g_strdup (name), new_fa);
 	gda_data_model_array_set_n_columns (GDA_DATA_MODEL_ARRAY (table),
Index: libgda/gda-util.c
===================================================================
RCS file: /cvs/gnome/libgda/libgda/gda-util.c,v
retrieving revision 1.7
diff -u -r1.7 gda-util.c
--- libgda/gda-util.c	26 Mar 2002 02:06:40 -0000	1.7
+++ libgda/gda-util.c	30 Mar 2002 00:38:34 -0000
@@ -51,6 +51,7 @@
 	case GDA_TYPE_TIME : return "time";
 	case GDA_TYPE_TIMESTAMP : return "timestamp";
 	case GDA_TYPE_TINYINT : return "tinyint";
+	default:
 	}
 
 	return "string";
@@ -109,7 +110,7 @@
 	gchar *retval = NULL;
 	gchar buffer[8193];
 
-	g_return_val_if_fail (uri != NULL, NULL);
+	g_return_val_if_fail (uristr != NULL, NULL);
 
 	uri = gnome_vfs_uri_new (uristr);
 	if (!uri)
Index: libgda/gda-xml-database.c
===================================================================
RCS file: /cvs/gnome/libgda/libgda/gda-xml-database.c,v
retrieving revision 1.12
diff -u -r1.12 gda-xml-database.c
--- libgda/gda-xml-database.c	26 Mar 2002 02:06:40 -0000	1.12
+++ libgda/gda-xml-database.c	30 Mar 2002 00:38:35 -0000
@@ -128,11 +128,12 @@
 	xmldb->priv->queries = g_hash_table_new (g_str_hash, g_str_equal);
 }
 
-static void
+static gboolean
 remove_table_hash (gpointer key, gpointer value, gpointer user_data)
 {
 	g_free (key);
 	g_object_unref (G_OBJECT (value));
+	return TRUE;
 }
 
 static void
Index: providers/default/gda-default-provider.c
===================================================================
RCS file: /cvs/gnome/libgda/providers/default/gda-default-provider.c,v
retrieving revision 1.13
diff -u -r1.13 gda-default-provider.c
--- providers/default/gda-default-provider.c	26 Mar 2002 02:06:40 -0000	1.13
+++ providers/default/gda-default-provider.c	30 Mar 2002 00:38:35 -0000
@@ -25,6 +25,7 @@
 #include <libgda/gda-row.h>
 #include <libgda/gda-server-recordset.h>
 #include <libgda/gda-server-recordset-model.h>
+#include <libgda/gda-util.h>
 #include "gda-default.h"
 #include "gda-default-recordset.h"
 
@@ -365,7 +366,7 @@
 	}
 
 	/* fill in the recordset to be returned */
-	recset = gda_server_recordset_model_new (cnc, 8);
+	recset = GDA_SERVER_RECORDSET_MODEL (gda_server_recordset_model_new (cnc, 8));
 	for (i = 0; i < sizeof (fields_desc) / sizeof (fields_desc[0]); i++) {
 		gint defined_size =  (fields_desc[i].type == GDA_TYPE_STRING) ? 64 : 
 			(fields_desc[i].type == GDA_TYPE_INTEGER) ? sizeof (gint) : 1;
@@ -401,6 +402,8 @@
 
 		gda_field_attributes_free (fa);
 	}
+
+	return GDA_SERVER_RECORDSET (recset);
 }
 
 static GdaServerRecordset *
Index: providers/default/gda-default-recordset.c
===================================================================
RCS file: /cvs/gnome/libgda/providers/default/gda-default-recordset.c,v
retrieving revision 1.3
diff -u -r1.3 gda-default-recordset.c
--- providers/default/gda-default-recordset.c	6 Mar 2002 19:35:05 -0000	1.3
+++ providers/default/gda-default-recordset.c	30 Mar 2002 00:38:35 -0000
@@ -49,8 +49,6 @@
 GdaServerRecordset *
 gda_default_recordset_new (GdaServerConnection *cnc, DEFAULT_Recordset *drecset)
 {
-	GdaServerRecordset *recset;
-
 	g_return_val_if_fail (GDA_IS_SERVER_CONNECTION (cnc), NULL);
 	g_return_val_if_fail (drecset != NULL, NULL);
 
Index: providers/postgres/utils.c
===================================================================
RCS file: /cvs/gnome/libgda/providers/postgres/utils.c,v
retrieving revision 1.17
diff -u -r1.17 utils.c
--- providers/postgres/utils.c	29 Mar 2002 17:27:44 -0000	1.17
+++ providers/postgres/utils.c	30 Mar 2002 00:38:35 -0000
@@ -36,12 +36,11 @@
 		gchar *message;
 		
 		if (pg_res != NULL)
-			message = g_strdup (PQresultErrorMessage (pg_res));
+			message = PQresultErrorMessage (pg_res);
 		else
-			message = g_strdup (PQerrorMessage (pconn));
+			message = PQerrorMessage (pconn);
 
 		gda_error_set_description (error, message);
-		g_free (message);
 	} else {
 		gda_error_set_description (error, _("NO DESCRIPTION"));
 	}


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