[libgda] Avoid some set-but-not-used compiler warnings.
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgda] Avoid some set-but-not-used compiler warnings.
- Date: Fri, 17 Jun 2011 21:27:29 +0000 (UTC)
commit 97e247fd63d7b33bb2375dc31105795eeba65a36
Author: Murray Cumming <murrayc murrayc com>
Date: Fri Jun 17 23:16:45 2011 +0200
Avoid some set-but-not-used compiler warnings.
libgda-ui/data-entries/common-bin.c | 3 +--
libgda/gda-data-model.c | 3 +--
libgda/gda-meta-store.c | 8 --------
libgda/gda-tree-node.c | 3 +--
libgda/gda-util.c | 5 +----
libgda/sqlite/virtual/gda-vconnection-data-model.c | 4 +---
providers/postgres/gda-postgres-blob-op.c | 2 --
tests/providers/prov-test-util.c | 2 --
tools/browser/schema-browser/table-info.c | 4 ----
9 files changed, 5 insertions(+), 29 deletions(-)
---
diff --git a/libgda-ui/data-entries/common-bin.c b/libgda-ui/data-entries/common-bin.c
index 122c7dd..e53733c 100644
--- a/libgda-ui/data-entries/common-bin.c
+++ b/libgda-ui/data-entries/common-bin.c
@@ -289,9 +289,8 @@ common_bin_adjust_menu (BinMenu *binmenu, gboolean editable, const GValue *value
g_free (size);
#ifdef HAVE_GIO
GdaBlob *blob2;
- glong read;
blob2 = (GdaBlob*) gda_blob_copy ((gpointer) blob);
- read = gda_blob_op_read (blob2->op, blob2, 0, 1024);
+ gda_blob_op_read (blob2->op, blob2, 0, 1024);
bin = (GdaBinary *) blob2;
ctype = g_content_type_guess (NULL, bin->data,
(gsize) bin->binary_length, NULL);
diff --git a/libgda/gda-data-model.c b/libgda/gda-data-model.c
index 72a9404..f09cd24 100644
--- a/libgda/gda-data-model.c
+++ b/libgda/gda-data-model.c
@@ -2240,9 +2240,8 @@ real_gda_data_model_dump_as_string (GdaDataModel *model, gboolean dump_attribute
#ifdef HAVE_LOCALE_H
#ifndef G_OS_WIN32
- char *current_locale;
int utf8_mode;
- current_locale = setlocale (LC_ALL, NULL);
+ setlocale (LC_ALL, NULL);
utf8_mode = (strcmp (nl_langinfo (CODESET), "UTF-8") == 0);
if (utf8_mode) {
sep_col = " â ";
diff --git a/libgda/gda-meta-store.c b/libgda/gda-meta-store.c
index 00704ed..c0b6452 100644
--- a/libgda/gda-meta-store.c
+++ b/libgda/gda-meta-store.c
@@ -3382,7 +3382,6 @@ gda_meta_store_change_free (GdaMetaStoreChange *change) {
GdaDataModel *
gda_meta_store_create_modify_data_model (GdaMetaStore *store, const gchar *table_name)
{
- GdaMetaStoreClass *klass;
DbObject *dbobj;
TableInfo *tinfo;
GdaDataModel *model;
@@ -3394,7 +3393,6 @@ gda_meta_store_create_modify_data_model (GdaMetaStore *store, const gchar *table
gda_mutex_lock (store->priv->mutex);
- klass = (GdaMetaStoreClass *) G_OBJECT_GET_CLASS (store);
dbobj = g_hash_table_lookup (store->priv->p_db_objects_hash, table_name);
if (!dbobj) {
g_warning ("Table '%s' is not known by the GdaMetaStore", table_name);
@@ -3476,14 +3474,11 @@ GSList *
gda_meta_store_schema_get_depend_tables (GdaMetaStore *store, const gchar *table_name)
{
GSList *list, *ret;
- GdaMetaStoreClass *klass;
DbObject *dbo;
g_return_val_if_fail (GDA_IS_META_STORE (store), NULL);
g_return_val_if_fail (table_name && *table_name, NULL);
- klass = (GdaMetaStoreClass *) G_OBJECT_GET_CLASS (store);
-
gda_mutex_lock (store->priv->mutex);
dbo = g_hash_table_lookup (store->priv->p_db_objects_hash, table_name);
if (!dbo) {
@@ -4644,7 +4639,6 @@ gda_meta_store_undeclare_foreign_key (GdaMetaStore *store, GdaMetaStruct *mstruc
gboolean retval = FALSE;
GdaSet *params = NULL;
GdaMetaStoreClass *klass;
- GdaMetaTable *mtable = NULL, *ref_mtable = NULL;
GdaMetaDbObject *dbo = NULL, *ref_dbo = NULL;
GdaMetaStruct *u_mstruct = NULL;
@@ -4689,7 +4683,6 @@ gda_meta_store_undeclare_foreign_key (GdaMetaStore *store, GdaMetaStruct *mstruc
gda_value_free (v3);
if (! dbo)
goto out;
- mtable = GDA_META_TABLE (dbo);
v1 = NULL;
v2 = NULL;
@@ -4719,7 +4712,6 @@ gda_meta_store_undeclare_foreign_key (GdaMetaStore *store, GdaMetaStruct *mstruc
gda_value_free (v3);
if (! ref_dbo)
goto out;
- ref_mtable = GDA_META_TABLE (ref_dbo);
/* set statement's variables */
if (! gda_statement_get_parameters (klass->cpriv->prep_stmts[STMT_DEL_DECLARE_FK],
diff --git a/libgda/gda-tree-node.c b/libgda/gda-tree-node.c
index 030a751..dbb614d 100644
--- a/libgda/gda-tree-node.c
+++ b/libgda/gda-tree-node.c
@@ -620,12 +620,11 @@ _gda_tree_node_add_children (GdaTreeNode *node, GdaTreeManager *mgr, const GSLis
const GSList *
_gda_tree_node_get_children_for_manager (GdaTreeNode *node, GdaTreeManager *mgr)
{
- GdaTreeNodesList *etn;
GSList *list;
g_return_val_if_fail (GDA_IS_TREE_NODE (node), NULL);
g_return_val_if_fail (GDA_IS_TREE_MANAGER (mgr), NULL);
- for (etn = NULL, list = node->priv->children; list; list = list->next) {
+ for (list = node->priv->children; list; list = list->next) {
if (GDA_TREE_NODES_LIST (list->data)->mgr == mgr)
return GDA_TREE_NODES_LIST (list->data)->nodes;
}
diff --git a/libgda/gda-util.c b/libgda/gda-util.c
index 544be33..d2dadfb 100644
--- a/libgda/gda-util.c
+++ b/libgda/gda-util.c
@@ -696,9 +696,7 @@ gda_utility_holder_load_attributes (GdaHolder *holder, xmlNodePtr node, GSList *
if (vnode) {
xmlChar *this_lang, *isnull;
const gchar *lang = gda_lang_locale;
- GType gdatype;
- gdatype = gda_holder_get_g_type (holder);
while (vnode) {
if (xmlNodeIsText (vnode)) {
vnode = vnode->next;
@@ -2371,7 +2369,6 @@ gboolean
gda_rfc1738_decode (gchar *string)
{
gchar *wptr, *rptr;
- gboolean retval = TRUE;
if (!string || !*string)
return TRUE;
@@ -2408,7 +2405,7 @@ gda_rfc1738_decode (gchar *string)
}
else {
/* error */
- retval = FALSE;
+ /* TODO: Actually return this? retval = FALSE; murrayc */
rptr--;
}
}
diff --git a/libgda/sqlite/virtual/gda-vconnection-data-model.c b/libgda/sqlite/virtual/gda-vconnection-data-model.c
index 533b8f3..fcb0c9a 100644
--- a/libgda/sqlite/virtual/gda-vconnection-data-model.c
+++ b/libgda/sqlite/virtual/gda-vconnection-data-model.c
@@ -352,7 +352,6 @@ gda_vconnection_data_model_remove (GdaVconnectionDataModel *cnc, const gchar *ta
{
GdaVConnectionTableData *td;
- GdaVirtualProvider *prov;
gchar *str;
int rc;
char *zErrMsg = NULL;
@@ -372,8 +371,7 @@ gda_vconnection_data_model_remove (GdaVconnectionDataModel *cnc, const gchar *ta
_("Table to remove not found"));
return FALSE;
}
-
- prov = (GdaVirtualProvider *) gda_connection_get_provider (GDA_CONNECTION (cnc));
+
str = g_strdup_printf ("DROP TABLE %s", td->table_name);
rc = SQLITE3_CALL (sqlite3_exec) (scnc->connection, str, NULL, 0, &zErrMsg);
g_free (str);
diff --git a/providers/postgres/gda-postgres-blob-op.c b/providers/postgres/gda-postgres-blob-op.c
index 70d2b5f..c59fad6 100644
--- a/providers/postgres/gda-postgres-blob-op.c
+++ b/providers/postgres/gda-postgres-blob-op.c
@@ -178,13 +178,11 @@ GdaBlobOp *
gda_postgres_blob_op_new_with_id (GdaConnection *cnc, const gchar *sql_id)
{
GdaPostgresBlobOp *pgop;
- PGconn *pconn;
g_return_val_if_fail (GDA_IS_CONNECTION (cnc), NULL);
pgop = g_object_new (GDA_TYPE_POSTGRES_BLOB_OP, NULL);
- pconn = get_pconn (cnc);
pgop->priv->blobid = atoi (sql_id);
pgop->priv->cnc = cnc;
diff --git a/tests/providers/prov-test-util.c b/tests/providers/prov-test-util.c
index ee90f91..1f8c86a 100644
--- a/tests/providers/prov-test-util.c
+++ b/tests/providers/prov-test-util.c
@@ -149,12 +149,10 @@ prov_test_check_types_schema (GdaConnection *cnc)
return FALSE;
}
- GdaServerProvider *prov;
GdaDataModel *schema_m;
GError *error = NULL;
gchar *str;
- prov = gda_connection_get_provider (cnc);
schema_m = gda_connection_get_meta_store_data (cnc, GDA_CONNECTION_META_TYPES, &error, 0);
if (!schema_m) {
#ifdef CHECK_EXTRA_INFO
diff --git a/tools/browser/schema-browser/table-info.c b/tools/browser/schema-browser/table-info.c
index 2ee0ed2..7d7a5db 100644
--- a/tools/browser/schema-browser/table-info.c
+++ b/tools/browser/schema-browser/table-info.c
@@ -179,8 +179,6 @@ table_info_set_property (GObject *object,
G_GNUC_UNUSED const GValue *value,
GParamSpec *pspec)
{
- TableInfo *tinfo;
- tinfo = TABLE_INFO (object);
switch (param_id) {
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
@@ -194,8 +192,6 @@ table_info_get_property (GObject *object,
G_GNUC_UNUSED GValue *value,
GParamSpec *pspec)
{
- TableInfo *tinfo;
- tinfo = TABLE_INFO (object);
switch (param_id) {
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]