krb5 commit: Remove unused variables
Greg Hudson
ghudson at MIT.EDU
Sat Jul 12 15:19:25 EDT 2014
https://github.com/krb5/krb5/commit/43a26c6d8ea9e2a82f780171cd34365911d71228
commit 43a26c6d8ea9e2a82f780171cd34365911d71228
Author: Lukas Slebodnik <lslebodn at redhat.com>
Date: Sat Jun 21 22:41:08 2014 +0200
Remove unused variables
[ghudson at mit.edu: squashed with similar commits]
src/kadmin/server/server_stubs.c | 4 ++--
src/lib/gssapi/krb5/util_crypt.c | 2 --
src/lib/kadm5/srv/server_acl.c | 5 ++---
src/lib/krb5/os/sendto_kdc.c | 4 ----
src/lib/krb5/unicode/ure/ure.c | 4 ++--
src/plugins/kdb/db2/libdb2/hash/hash.c | 9 +++------
src/plugins/kdb/db2/libdb2/hash/hash_bigkey.c | 2 --
src/plugins/kdb/ldap/ldap_util/kdb5_ldap_policy.c | 6 +-----
src/util/support/errors.c | 2 +-
9 files changed, 11 insertions(+), 27 deletions(-)
diff --git a/src/kadmin/server/server_stubs.c b/src/kadmin/server/server_stubs.c
index 5312792..1879dc6 100644
--- a/src/kadmin/server/server_stubs.c
+++ b/src/kadmin/server/server_stubs.c
@@ -39,10 +39,10 @@ gss_name_t rqst2name(struct svc_req *rqstp);
static int cmp_gss_names(gss_name_t n1, gss_name_t n2)
{
- OM_uint32 emaj, emin;
+ OM_uint32 emin;
int equal;
- if (GSS_ERROR(emaj = gss_compare_name(&emin, n1, n2, &equal)))
+ if (GSS_ERROR(gss_compare_name(&emin, n1, n2, &equal)))
return(0);
return(equal);
diff --git a/src/lib/gssapi/krb5/util_crypt.c b/src/lib/gssapi/krb5/util_crypt.c
index 055093c..0cebde1 100644
--- a/src/lib/gssapi/krb5/util_crypt.c
+++ b/src/lib/gssapi/krb5/util_crypt.c
@@ -54,8 +54,6 @@
#include <memory.h>
#endif
-static const char kg_arcfour_l40[] = "fortybits";
-
static krb5_error_code
kg_copy_keys(krb5_context context, krb5_gss_ctx_id_rec *ctx, krb5_key subkey)
{
diff --git a/src/lib/kadm5/srv/server_acl.c b/src/lib/kadm5/srv/server_acl.c
index 044b0e9..a35d795 100644
--- a/src/lib/kadm5/srv/server_acl.c
+++ b/src/lib/kadm5/srv/server_acl.c
@@ -793,12 +793,11 @@ kadm5int_acl_check(kcontext, caller, opmask, principal, restrictions)
krb5_boolean retval;
gss_buffer_desc caller_buf;
gss_OID caller_oid;
- OM_uint32 emaj, emin;
+ OM_uint32 emin;
krb5_error_code code;
krb5_principal caller_princ;
- if (GSS_ERROR(emaj = gss_display_name(&emin, caller, &caller_buf,
- &caller_oid)))
+ if (GSS_ERROR(gss_display_name(&emin, caller, &caller_buf, &caller_oid)))
return FALSE;
code = krb5_parse_name(kcontext, (char *) caller_buf.value,
diff --git a/src/lib/krb5/os/sendto_kdc.c b/src/lib/krb5/os/sendto_kdc.c
index 4555321..a572831 100644
--- a/src/lib/krb5/os/sendto_kdc.c
+++ b/src/lib/krb5/os/sendto_kdc.c
@@ -105,10 +105,6 @@ struct select_state {
int nfds;
};
-static const char *const state_strings[] = {
- "INITIALIZING", "CONNECTING", "WRITING", "READING", "FAILED"
-};
-
/* connection states */
enum conn_states { INITIALIZING, CONNECTING, WRITING, READING, FAILED };
struct incoming_message {
diff --git a/src/lib/krb5/unicode/ure/ure.c b/src/lib/krb5/unicode/ure/ure.c
index b3fa986..d1cfd8a 100644
--- a/src/lib/krb5/unicode/ure/ure.c
+++ b/src/lib/krb5/unicode/ure/ure.c
@@ -1957,7 +1957,7 @@ int
ure_exec(ure_dfa_t dfa, int flags, ucs2_t *text, unsigned long textlen,
unsigned long *match_start, unsigned long *match_end)
{
- int i, j, matched, found, skip;
+ int i, j, matched, found;
unsigned long ms, me;
ucs4_t c;
ucs2_t *sp, *ep, *lp;
@@ -1983,7 +1983,7 @@ ure_exec(ure_dfa_t dfa, int flags, ucs2_t *text, unsigned long textlen,
stp = dfa->states;
- for (found = skip = 0; found == 0 && sp < ep; ) {
+ for (found = 0; found == 0 && sp < ep; ) {
lp = sp;
c = *sp++;
diff --git a/src/plugins/kdb/db2/libdb2/hash/hash.c b/src/plugins/kdb/db2/libdb2/hash/hash.c
index 2343d22..2a5b4f8 100644
--- a/src/plugins/kdb/db2/libdb2/hash/hash.c
+++ b/src/plugins/kdb/db2/libdb2/hash/hash.c
@@ -311,9 +311,7 @@ init_hash(hashp, file, info)
const HASHINFO *info;
{
struct stat statbuf;
- int32_t nelem;
- nelem = 1;
hashp->hdr.nkeys = 0;
hashp->hdr.lorder = DB_BYTE_ORDER;
hashp->hdr.bsize = DEF_BUCKET_SIZE;
@@ -420,11 +418,10 @@ hget_header(hashp, page_size)
HTAB *hashp;
u_int32_t page_size;
{
- u_int32_t num_copied, i;
+ u_int32_t num_copied;
u_int8_t *hdr_dest;
num_copied = 0;
- i = 0;
hdr_dest = (u_int8_t *)&hashp->hdr;
@@ -452,9 +449,9 @@ hput_header(hashp)
#if DB_BYTE_ORDER == DB_LITTLE_ENDIAN
HASHHDR whdr;
#endif
- u_int32_t num_copied, i;
+ u_int32_t num_copied;
- num_copied = i = 0;
+ num_copied = 0;
whdrp = &hashp->hdr;
#if DB_BYTE_ORDER == DB_LITTLE_ENDIAN
diff --git a/src/plugins/kdb/db2/libdb2/hash/hash_bigkey.c b/src/plugins/kdb/db2/libdb2/hash/hash_bigkey.c
index 497939d..4b95278 100644
--- a/src/plugins/kdb/db2/libdb2/hash/hash_bigkey.c
+++ b/src/plugins/kdb/db2/libdb2/hash/hash_bigkey.c
@@ -194,12 +194,10 @@ __find_bigpair(hashp, cursorp, key, size)
PAGE16 *pagep, *hold_pagep;
db_pgno_t next_pgno;
int32_t ksize;
- u_int16_t bytes;
int8_t *kkey;
ksize = size;
kkey = key;
- bytes = 0;
hold_pagep = NULL;
/* Chances are, hashp->cpage is the base page. */
diff --git a/src/plugins/kdb/ldap/ldap_util/kdb5_ldap_policy.c b/src/plugins/kdb/ldap/ldap_util/kdb5_ldap_policy.c
index 5de0494..02cb059 100644
--- a/src/plugins/kdb/ldap/ldap_util/kdb5_ldap_policy.c
+++ b/src/plugins/kdb/ldap/ldap_util/kdb5_ldap_policy.c
@@ -797,7 +797,6 @@ kdb5_ldap_list_policies(int argc, char *argv[])
char *me = progname;
krb5_error_code retval = 0;
krb5_boolean print_usage = FALSE;
- char *basedn = NULL;
char **list = NULL;
char **plist = NULL;
@@ -809,7 +808,7 @@ kdb5_ldap_list_policies(int argc, char *argv[])
if ((retval = init_ldap_realm (argc, argv)))
goto cleanup;
- retval = krb5_ldap_list_policy(util_context, basedn, &list);
+ retval = krb5_ldap_list_policy(util_context, NULL, &list);
if ((retval != 0) || (list == NULL))
goto cleanup;
@@ -828,9 +827,6 @@ cleanup:
free (list);
}
- if (basedn)
- free (basedn);
-
if (print_usage) {
db_usage(LIST_POLICY);
}
diff --git a/src/util/support/errors.c b/src/util/support/errors.c
index 6c4d8bd..70e1d59 100644
--- a/src/util/support/errors.c
+++ b/src/util/support/errors.c
@@ -48,7 +48,7 @@ k5_set_error(struct errinfo *ep, long code, const char *fmt, ...)
void
k5_vset_error(struct errinfo *ep, long code, const char *fmt, va_list args)
{
- char *str, *slash;
+ char *str;
k5_clear_error(ep);
ep->code = code;
More information about the cvs-krb5
mailing list