[libgda] Fixed some more compiler warnings



commit 82fee4d9591a743894b8294aa923bbb0c9bbcace
Author: Murray Cumming <murrayc murrayc com>
Date:   Sat Jul 2 15:26:14 2011 +0200

    Fixed some more compiler warnings

 libgda-ui/data-entries/gdaui-entry-common-time.c   |    2 --
 libgda-ui/data-entries/gdaui-entry-wrapper.c       |    5 -----
 libgda-ui/data-entries/gdaui-formatted-entry.c     |    2 ++
 libgda/sqlite/gda-sqlite-provider.c                |   10 +++++++---
 providers/postgres/gda-postgres-ddl.c              |    3 ---
 .../skel-implementation/capi/gda-capi-blob-op.c    |    3 ++-
 .../skel-implementation/capi/gda-capi-recordset.c  |    3 +++
 7 files changed, 14 insertions(+), 14 deletions(-)
---
diff --git a/libgda-ui/data-entries/gdaui-entry-common-time.c b/libgda-ui/data-entries/gdaui-entry-common-time.c
index 19683ea..1a14a17 100644
--- a/libgda-ui/data-entries/gdaui-entry-common-time.c
+++ b/libgda-ui/data-entries/gdaui-entry-common-time.c
@@ -833,10 +833,8 @@ date_calendar_choose_cb (GtkWidget *button, GdauiEntryCommonTime *mgtim)
 	GValue *value;
         guint year=0, month=0, day=0;
 	gboolean unset = TRUE;
-	GdaDataHandler *dh;
 
         /* setting the calendar to the latest displayed date */
-	dh = gdaui_data_entry_get_handler (GDAUI_DATA_ENTRY (mgtim));
 	value = gdaui_data_entry_get_value (GDAUI_DATA_ENTRY (mgtim));
 	
         if (value && !gda_value_is_null (value)) {
diff --git a/libgda-ui/data-entries/gdaui-entry-wrapper.c b/libgda-ui/data-entries/gdaui-entry-wrapper.c
index 7b55bb9..3effcfa 100644
--- a/libgda-ui/data-entries/gdaui-entry-wrapper.c
+++ b/libgda-ui/data-entries/gdaui-entry-wrapper.c
@@ -424,7 +424,6 @@ gdaui_entry_wrapper_set_value_type (GdauiDataEntry *iface, GType type)
 
 	if (mgwrap->priv->type != type) {
 		GValue *value;
-		GdaDataHandler *dh;
 
 		if (mgwrap->priv->value_ref) {
 			gda_value_free (mgwrap->priv->value_ref);
@@ -439,7 +438,6 @@ gdaui_entry_wrapper_set_value_type (GdauiDataEntry *iface, GType type)
 		mgwrap->priv->value_default = gda_value_new_null ();
 
 		/* Set original value */
-		dh = gdaui_data_entry_get_handler (GDAUI_DATA_ENTRY (mgwrap));
 		value = gda_value_new_null ();
 		gdaui_entry_wrapper_set_ref_value (GDAUI_DATA_ENTRY (mgwrap), value);
  		gda_value_free (value);
@@ -495,13 +493,10 @@ gdaui_entry_wrapper_get_value (GdauiDataEntry *iface)
 {
 	GValue *value = NULL;
 	GdauiEntryWrapper *mgwrap;
-	GdaDataHandler *dh;
 
 	g_return_val_if_fail (GDAUI_IS_ENTRY_WRAPPER (iface), NULL);
 	mgwrap = (GdauiEntryWrapper*) iface;
 
-	dh = gdaui_entry_wrapper_get_handler (GDAUI_DATA_ENTRY (mgwrap));
-
 	if (mgwrap->priv->null_forced)
 		value = gda_value_new_null ();
 	else {
diff --git a/libgda-ui/data-entries/gdaui-formatted-entry.c b/libgda-ui/data-entries/gdaui-formatted-entry.c
index 61616af..7adb9e8 100644
--- a/libgda-ui/data-entries/gdaui-formatted-entry.c
+++ b/libgda-ui/data-entries/gdaui-formatted-entry.c
@@ -251,9 +251,11 @@ is_writable (GdauiFormattedEntry *fentry, gint pos, const gchar *ptr)
 static gboolean
 is_allowed (G_GNUC_UNUSED GdauiFormattedEntry *fentry, const gchar *ptr, const gunichar wc, gunichar *out_wc)
 {
+/* TODO: Use this?
 	gunichar fwc;
 
 	fwc = g_utf8_get_char (ptr);
+*/
 	*out_wc = wc;
 	if (*ptr == '0')
 		return g_unichar_isdigit (wc);
diff --git a/libgda/sqlite/gda-sqlite-provider.c b/libgda/sqlite/gda-sqlite-provider.c
index 19d3caa..b6222fa 100644
--- a/libgda/sqlite/gda-sqlite-provider.c
+++ b/libgda/sqlite/gda-sqlite-provider.c
@@ -717,7 +717,7 @@ remove_diacritics_and_change_case (const gchar *str, gssize len, CaseModif cmod)
  */
 static gboolean
 gda_sqlite_provider_open_connection (GdaServerProvider *provider, GdaConnection *cnc,
-				     GdaQuarkList *params, GdaQuarkList *auth,
+				     GdaQuarkList *params, G_GNUC_UNUSED GdaQuarkList *auth,
 				     G_GNUC_UNUSED guint *task_id, GdaServerProviderAsyncCallback async_cb, G_GNUC_UNUSED gpointer cb_data)
 {
 	gchar *filename = NULL;
@@ -727,7 +727,9 @@ gda_sqlite_provider_open_connection (GdaServerProvider *provider, GdaConnection
 	gint errmsg;
 	SqliteConnectionData *cdata;
 	gchar *dup = NULL;
+#ifdef SQLITE_HAS_CODEC
 	const gchar *passphrase = NULL;
+#endif
 
 	g_return_val_if_fail (GDA_IS_SQLITE_PROVIDER (provider), FALSE);
 	g_return_val_if_fail (GDA_IS_CONNECTION (cnc), FALSE);
@@ -752,8 +754,6 @@ gda_sqlite_provider_open_connection (GdaServerProvider *provider, GdaConnection
 
 	regexp = gda_quark_list_find (params, "REGEXP");
 	locale_collate = gda_quark_list_find (params, "EXTRA_COLLATIONS");
-	if (auth)
-		passphrase = gda_quark_list_find (auth, "PASSWORD");
 
 	if (! is_virtual) {
 		if (!dbname) {
@@ -852,6 +852,10 @@ gda_sqlite_provider_open_connection (GdaServerProvider *provider, GdaConnection
 
 #ifdef SQLITE_HAS_CODEC
   /* TODO Fix this compiler warning: the address of 'sqlite3_key' will always evaluate as 'true' */
+
+	if (auth)
+		passphrase = gda_quark_list_find (auth, "PASSWORD");
+
 	if (passphrase && *passphrase && SQLITE3_CALL (sqlite3_key)) {
 		errmsg = SQLITE3_CALL (sqlite3_key) (cdata->connection, (void*) passphrase, strlen (passphrase));
 		if (errmsg != SQLITE_OK) {
diff --git a/providers/postgres/gda-postgres-ddl.c b/providers/postgres/gda-postgres-ddl.c
index 919792e..d1d0cf1 100644
--- a/providers/postgres/gda-postgres-ddl.c
+++ b/providers/postgres/gda-postgres-ddl.c
@@ -934,9 +934,6 @@ gda_postgres_render_CREATE_USER (GdaServerProvider *provider, GdaConnection *cnc
 	
 	value = gda_server_operation_get_value_at (op, "/USER_DEF_P/VALIDITY");
 	if (value && G_VALUE_HOLDS (value, GDA_TYPE_TIMESTAMP)) {
-		const GdaTimestamp *ts;
-
-		ts = gda_value_get_timestamp (value);
 		if (value) {
 			GdaDataHandler *dh;
 			if (!with) {
diff --git a/providers/skel-implementation/capi/gda-capi-blob-op.c b/providers/skel-implementation/capi/gda-capi-blob-op.c
index 97de853..af278cf 100644
--- a/providers/skel-implementation/capi/gda-capi-blob-op.c
+++ b/providers/skel-implementation/capi/gda-capi-blob-op.c
@@ -181,7 +181,7 @@ static glong
 gda_capi_blob_op_write (GdaBlobOp *op, GdaBlob *blob, G_GNUC_UNUSED glong offset)
 {
 	GdaCapiBlobOp *bop;
-	GdaBinary *bin;
+	GdaBinary *bin = NULL;
 	glong nbwritten = -1;
 
 	g_return_val_if_fail (GDA_IS_CAPI_BLOB_OP (op), -1);
@@ -221,6 +221,7 @@ gda_capi_blob_op_write (GdaBlobOp *op, GdaBlob *blob, G_GNUC_UNUSED glong offset
 	else {
 		/* write blob using bin->data and bin->binary_length */
 		bin = (GdaBinary *) blob;
+    		g_warning("bin not used. length=%ld", bin->binary_length); /* Avoids a compiler warning. */        
 		nbwritten = -1; TO_IMPLEMENT;
 	}
 
diff --git a/providers/skel-implementation/capi/gda-capi-recordset.c b/providers/skel-implementation/capi/gda-capi-recordset.c
index 7fa42b4..2334b2b 100644
--- a/providers/skel-implementation/capi/gda-capi-recordset.c
+++ b/providers/skel-implementation/capi/gda-capi-recordset.c
@@ -199,6 +199,7 @@ gda_capi_recordset_new (GdaConnection *cnc, GdaCapiPStmt *ps, GdaSet *exec_param
 			column = GDA_COLUMN (list->data);
 
 			/* use C API to set columns' information using gda_column_set_*() */
+			g_warning("column not used: %p", column); /* Avoids a compiler warning. */
 			TO_IMPLEMENT;
 		}
         }
@@ -237,6 +238,7 @@ gda_capi_recordset_fetch_nb_rows (GdaDataSelect *model)
 		return model->advertized_nrows;
 
 	/* use C API to determine number of rows,if possible */
+	g_warning("imodel not used: %p", imodel); /* Avoids a compiler warning. */
 	TO_IMPLEMENT;
 
 	return model->advertized_nrows;
@@ -265,6 +267,7 @@ gda_capi_recordset_fetch_random (GdaDataSelect *model, G_GNUC_UNUSED GdaRow **pr
 
 	imodel = GDA_CAPI_RECORDSET (model);
 
+	g_warning("imodel not used: %p", imodel); /* Avoids a compiler warning. */
 	TO_IMPLEMENT;
 
 	return TRUE;



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