[gnome-keyring/gnome-3-0] Fix more gcc 4.6 warnings.



commit 17d6b046561220bc80f9d6cf0306f70b2f8c6fa7
Author: Marc Plano-Lesay <marc planolesay gmail com>
Date:   Sat Apr 23 10:17:12 2011 +0200

    Fix more gcc 4.6 warnings.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=647315

 daemon/gkd-main.c                        |    2 --
 daemon/ssh-agent/gkd-ssh-agent-ops.c     |    2 --
 pkcs11/gkm/tests/test-data-der.c         |    3 ---
 pkcs11/gnome2-store/gkm-gnome2-file.c    |    3 ---
 pkcs11/roots-store/gkm-roots-module.c    |    3 +--
 pkcs11/rpc-layer/gkm-rpc-module.c        |   10 +++++++---
 pkcs11/secret-store/gkm-secret-textual.c |    4 ----
 pkcs11/ssh-store/gkm-ssh-module.c        |    3 ---
 8 files changed, 8 insertions(+), 22 deletions(-)
---
diff --git a/daemon/gkd-main.c b/daemon/gkd-main.c
index 602d87a..8a38783 100644
--- a/daemon/gkd-main.c
+++ b/daemon/gkd-main.c
@@ -775,7 +775,6 @@ on_login_timeout (gpointer data)
 int
 main (int argc, char *argv[])
 {
-	GMainContext *ctx;
 	GMainLoop *loop;
 
 	/*
@@ -868,7 +867,6 @@ main (int argc, char *argv[])
 
 	/* Initialize our daemon main loop and threading */
 	loop = g_main_loop_new (NULL, FALSE);
-	ctx = g_main_loop_get_context (loop);
 
 	/* Initialize our control socket */
 	if (!gkd_control_listen ())
diff --git a/daemon/ssh-agent/gkd-ssh-agent-ops.c b/daemon/ssh-agent/gkd-ssh-agent-ops.c
index 7c2620f..7e2e9fe 100644
--- a/daemon/ssh-agent/gkd-ssh-agent-ops.c
+++ b/daemon/ssh-agent/gkd-ssh-agent-ops.c
@@ -1100,11 +1100,9 @@ op_v1_challenge (GkdSshAgentCall *call)
 	GckObject *key = NULL;
 	guint32 resp_type;
 	GError *error = NULL;
-	gboolean ret;
 	guint i;
 	guchar b;
 
-	ret = FALSE;
 	offset = 5;
 
 	attrs = gck_attributes_new ();
diff --git a/pkcs11/gkm/tests/test-data-der.c b/pkcs11/gkm/tests/test-data-der.c
index f3b7ab1..6be10c6 100644
--- a/pkcs11/gkm/tests/test-data-der.c
+++ b/pkcs11/gkm/tests/test-data-der.c
@@ -344,9 +344,6 @@ find_extension (GNode *asn, gconstpointer data, gsize n_data, const gchar *oid,
 	GNode *node = NULL;
 	gchar *exoid;
 	guint index;
-	int len;
-
-	len = strlen (oid);
 
 	for (index = 1; TRUE; ++index) {
 
diff --git a/pkcs11/gnome2-store/gkm-gnome2-file.c b/pkcs11/gnome2-store/gkm-gnome2-file.c
index 35482dd..5677205 100644
--- a/pkcs11/gnome2-store/gkm-gnome2-file.c
+++ b/pkcs11/gnome2-store/gkm-gnome2-file.c
@@ -643,8 +643,6 @@ update_from_private_block (GkmGnome2File *self, EggBuffer *buffer, GkmSecret *lo
 {
 	EggBuffer custom;
 	GkmDataResult res;
-	const gchar *password;
-	gsize n_password;
 	gsize offset;
 
 	g_assert (GKM_IS_GNOME2_FILE (self));
@@ -664,7 +662,6 @@ update_from_private_block (GkmGnome2File *self, EggBuffer *buffer, GkmSecret *lo
 	egg_buffer_init_full (&custom, 1024, egg_secure_realloc);
 
 	/* Decrypt the buffer */
-	password = gkm_secret_get_password (login, &n_password);
 	if (!decrypt_buffer (buffer, &offset, login, &custom)) {
 		egg_buffer_uninit (&custom);
 		return GKM_DATA_FAILURE;
diff --git a/pkcs11/roots-store/gkm-roots-module.c b/pkcs11/roots-store/gkm-roots-module.c
index 2b56e9d..8f97895 100644
--- a/pkcs11/roots-store/gkm-roots-module.c
+++ b/pkcs11/roots-store/gkm-roots-module.c
@@ -181,7 +181,6 @@ file_load (GkmFileTracker *tracker, const gchar *path, GkmRootsModule *self)
 	GList *objects, *l;
 	GError *error = NULL;
 	gsize n_data;
-	guint num;
 
 	manager = gkm_module_get_manager (GKM_MODULE (self));
 	g_return_if_fail (manager);
@@ -206,7 +205,7 @@ file_load (GkmFileTracker *tracker, const gchar *path, GkmRootsModule *self)
 	g_list_free (objects);
 
 	/* Try and parse the PEM */
-	num = egg_openssl_pem_parse (data, n_data, parsed_pem_block, &ctx);
+	egg_openssl_pem_parse (data, n_data, parsed_pem_block, &ctx);
 
 	/* If no PEM data, try to parse directly as DER  */
 	if (ctx.count == 0) {
diff --git a/pkcs11/rpc-layer/gkm-rpc-module.c b/pkcs11/rpc-layer/gkm-rpc-module.c
index 5172988..4c235f6 100644
--- a/pkcs11/rpc-layer/gkm-rpc-module.c
+++ b/pkcs11/rpc-layer/gkm-rpc-module.c
@@ -1600,11 +1600,14 @@ static CK_RV
 rpc_C_FindObjects (CK_SESSION_HANDLE session, CK_OBJECT_HANDLE_PTR objects,
                    CK_ULONG max_count, CK_ULONG_PTR count)
 {
+	/* HACK: To fix a stupid gcc warning */
+	CK_ULONG_PTR address_of_max_count = &max_count;
+
 	return_val_if_fail (count, CKR_ARGUMENTS_BAD);
 
 	BEGIN_CALL (C_FindObjects);
 		IN_ULONG (session);
-		IN_ULONG_BUFFER (objects, &max_count);
+		IN_ULONG_BUFFER (objects, address_of_max_count);
 	PROCESS_CALL;
 		*count = max_count;
 		OUT_ULONG_ARRAY (objects, count);
@@ -2105,9 +2108,10 @@ rpc_C_GenerateRandom (CK_SESSION_HANDLE session, CK_BYTE_PTR random_data,
 {
 	BEGIN_CALL (C_GenerateRandom);
 		IN_ULONG (session);
-		IN_BYTE_BUFFER (random_data, &random_len);
+    CK_ULONG_PTR address = &random_len;
+		IN_BYTE_BUFFER (random_data, address);
 	PROCESS_CALL;
-		OUT_BYTE_ARRAY (random_data, &random_len);
+		OUT_BYTE_ARRAY (random_data, address);
 	END_CALL;
 }
 
diff --git a/pkcs11/secret-store/gkm-secret-textual.c b/pkcs11/secret-store/gkm-secret-textual.c
index c0168f4..8d67117 100644
--- a/pkcs11/secret-store/gkm-secret-textual.c
+++ b/pkcs11/secret-store/gkm-secret-textual.c
@@ -265,7 +265,6 @@ static void
 generate_item (GKeyFile *file, GkmSecretItem *item, GkmSecretData *sdata)
 {
 	GkmSecretObject *obj;
-	GHashTable *attributes;
 	const gchar *value;
 	const gchar *identifier;
 	const guchar *secret;
@@ -278,7 +277,6 @@ generate_item (GKeyFile *file, GkmSecretItem *item, GkmSecretData *sdata)
 
 	obj = GKM_SECRET_OBJECT (item);
 	identifier = gkm_secret_object_get_identifier (obj);
-	attributes = gkm_secret_item_get_fields (item);
 
 	value = gkm_secret_item_get_schema (item);
 	g_key_file_set_integer (file, identifier, "item-type",
@@ -314,7 +312,6 @@ parse_item (GKeyFile *file, GkmSecretItem *item, GkmSecretData *sdata,
             const gchar **groups)
 {
 	GkmSecretObject *obj;
-	GHashTable *attributes;
 	const gchar *identifier;
 	GError *err = NULL;
 	GkmSecret *secret;
@@ -328,7 +325,6 @@ parse_item (GKeyFile *file, GkmSecretItem *item, GkmSecretData *sdata,
 
 	obj = GKM_SECRET_OBJECT (item);
 	identifier = gkm_secret_object_get_identifier (obj);
-	attributes = gkm_secret_item_get_fields (item);
 
 	type = g_key_file_get_integer (file, identifier, "item-type", &err);
 	if (err) {
diff --git a/pkcs11/ssh-store/gkm-ssh-module.c b/pkcs11/ssh-store/gkm-ssh-module.c
index 0bbe3e1..737564c 100644
--- a/pkcs11/ssh-store/gkm-ssh-module.c
+++ b/pkcs11/ssh-store/gkm-ssh-module.c
@@ -103,15 +103,12 @@ file_load (GkmFileTracker *tracker, const gchar *path, GkmSshModule *self)
 {
 	GkmSshPrivateKey *key;
 	gchar *private_path;
-	GkmManager *manager;
 	GError *error = NULL;
 	gchar *unique;
 
 	g_return_if_fail (path);
 	g_return_if_fail (GKM_IS_SSH_MODULE (self));
 
-	manager = gkm_module_get_manager (GKM_MODULE (self));
-
 	private_path = private_path_for_public (path);
 	if (!private_path || !g_file_test (private_path, G_FILE_TEST_IS_REGULAR)) {
 		g_message ("no private key present for public key: %s", path);



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