[gnome-keyring/gnome-3-0] fix unused-but-set-variable warnings
- From: Stefan Walter <stefw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-keyring/gnome-3-0] fix unused-but-set-variable warnings
- Date: Wed, 20 Apr 2011 05:16:22 +0000 (UTC)
commit 33c2185da08e665eb949b155f9edaa8c4618d0f0
Author: Marc Plano-Lesay <marc planolesay gmail com>
Date: Sat Apr 9 22:58:06 2011 +0200
fix unused-but-set-variable warnings
https://bugzilla.gnome.org/show_bug.cgi?id=647315
egg/egg-hkdf.c | 4 ++--
gck/gck-slot.c | 3 ---
gcr/tests/test-parser.c | 2 ++
pkcs11/gkm/gkm-attributes.c | 3 ---
pkcs11/gkm/gkm-null-mechanism.c | 4 ----
5 files changed, 4 insertions(+), 12 deletions(-)
---
diff --git a/egg/egg-hkdf.c b/egg/egg-hkdf.c
index eaa90fc..a55ee5d 100644
--- a/egg/egg-hkdf.c
+++ b/egg/egg-hkdf.c
@@ -71,14 +71,14 @@ egg_hkdf_perform (const gchar *hash_algo, gconstpointer input, gsize n_input,
}
/* Step 1: Extract */
- gcry = gcry_md_open (&md1, algo, GCRY_MD_FLAG_HMAC);
+ gcry = gcry_md_open (&md1, algo, GCRY_MD_FLAG_HMAC | flags);
g_return_val_if_fail (gcry == 0, FALSE);
gcry = gcry_md_setkey (md1, salt, n_salt);
g_return_val_if_fail (gcry == 0, FALSE);
gcry_md_write (md1, input, n_input);
/* Step 2: Expand */
- gcry = gcry_md_open (&md2, algo, GCRY_MD_FLAG_HMAC);
+ gcry = gcry_md_open (&md2, algo, GCRY_MD_FLAG_HMAC | flags);
g_return_val_if_fail (gcry == 0, FALSE);
gcry = gcry_md_setkey (md2, gcry_md_read (md1, algo), hash_len);
g_return_val_if_fail (gcry == 0, FALSE);
diff --git a/gck/gck-slot.c b/gck/gck-slot.c
index 96e9db1..f86119d 100644
--- a/gck/gck-slot.c
+++ b/gck/gck-slot.c
@@ -922,13 +922,10 @@ gck_slot_open_session_full (GckSlot *self, guint options, gulong pkcs11_flags, g
OpenSession args = { GCK_ARGUMENTS_INIT, 0, };
GckSession *session = NULL;
GckModule *module = NULL;
- CK_SLOT_ID slot_id;
g_object_ref (self);
- /* Try to use a cached session */
module = gck_slot_get_module (self);
- slot_id = gck_slot_get_handle (self);
/* Open a new session */
args.slot = self;
diff --git a/gcr/tests/test-parser.c b/gcr/tests/test-parser.c
index 7bde12a..e8c5e30 100644
--- a/gcr/tests/test-parser.c
+++ b/gcr/tests/test-parser.c
@@ -69,6 +69,8 @@ parsed_item (GcrParser *par, gpointer user_data)
g_assert (par == test->parser);
attrs = gcr_parser_get_parsed_attributes (test->parser);
+ g_assert (attrs);
+
description = gcr_parser_get_parsed_description (test->parser);
label = gcr_parser_get_parsed_label (test->parser);
diff --git a/pkcs11/gkm/gkm-attributes.c b/pkcs11/gkm/gkm-attributes.c
index 6243876..cb4b03c 100644
--- a/pkcs11/gkm/gkm-attributes.c
+++ b/pkcs11/gkm/gkm-attributes.c
@@ -600,7 +600,6 @@ gkm_template_new (CK_ATTRIBUTE_PTR attrs, CK_ULONG n_attrs)
void
gkm_template_set (GArray *template, CK_ATTRIBUTE_PTR attr)
{
- CK_ATTRIBUTE_PTR pat;
CK_ATTRIBUTE at;
guint i;
@@ -608,8 +607,6 @@ gkm_template_set (GArray *template, CK_ATTRIBUTE_PTR attr)
g_return_if_fail (attr);
g_return_if_fail (attr->ulValueLen != (CK_ULONG)-1);
- pat = gkm_attributes_find ((CK_ATTRIBUTE_PTR)template->data, template->len, attr->type);
-
/* Remove any previous value */
for (i = 0; i < template->len; ++i) {
if (g_array_index (template, CK_ATTRIBUTE, i).type == attr->type) {
diff --git a/pkcs11/gkm/gkm-null-mechanism.c b/pkcs11/gkm/gkm-null-mechanism.c
index 8eeb42a..d1016bf 100644
--- a/pkcs11/gkm/gkm-null-mechanism.c
+++ b/pkcs11/gkm/gkm-null-mechanism.c
@@ -75,7 +75,6 @@ gkm_null_mechanism_wrap (GkmSession *session, CK_MECHANISM_PTR mech,
GkmObject *wrapper, GkmObject *wrapped,
CK_BYTE_PTR output, CK_ULONG_PTR n_output)
{
- GkmNullKey *key;
gpointer value;
gsize n_value;
CK_RV rv;
@@ -88,7 +87,6 @@ gkm_null_mechanism_wrap (GkmSession *session, CK_MECHANISM_PTR mech,
if (!GKM_IS_NULL_KEY (wrapper))
return CKR_WRAPPING_KEY_TYPE_INCONSISTENT;
- key = GKM_NULL_KEY (wrapper);
/* They just want the length */
if (!output) {
@@ -118,7 +116,6 @@ gkm_null_mechanism_unwrap (GkmSession *session, CK_MECHANISM_PTR mech,
{
CK_ATTRIBUTE attr;
GArray *array;
- GkmNullKey *key;
GkmTransaction *transaction;
g_return_val_if_fail (GKM_IS_SESSION (session), CKR_GENERAL_ERROR);
@@ -128,7 +125,6 @@ gkm_null_mechanism_unwrap (GkmSession *session, CK_MECHANISM_PTR mech,
if (!GKM_IS_NULL_KEY (wrapper))
return CKR_WRAPPING_KEY_TYPE_INCONSISTENT;
- key = GKM_NULL_KEY (wrapper);
if (mech->ulParameterLen)
return CKR_MECHANISM_PARAM_INVALID;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]