From 495ee6847d0d3e288f47ba026d98a830e51cbc06 Mon Sep 17 00:00:00 2001 From: Toomas Soome Date: Tue, 8 Aug 2017 16:56:52 +0300 Subject: [PATCH] 8777 krb5/plugins/kdb: variable set but not used Reviewed by: Hans Rosenfeld Reviewed by: Robert Mustacchi Approved by: Richard Lowe --- .../lib/krb5/plugins/kdb/db2/libdb2/hash/hash.c | 11 ++--------- .../krb5/plugins/kdb/db2/libdb2/hash/hash_bigkey.c | 10 +--------- .../krb5/plugins/kdb/db2/libdb2/hash/hash_page.c | 23 +++++++--------------- 3 files changed, 10 insertions(+), 34 deletions(-) diff --git a/usr/src/lib/krb5/plugins/kdb/db2/libdb2/hash/hash.c b/usr/src/lib/krb5/plugins/kdb/db2/libdb2/hash/hash.c index 7df1c536e9..ac6ca031df 100644 --- a/usr/src/lib/krb5/plugins/kdb/db2/libdb2/hash/hash.c +++ b/usr/src/lib/krb5/plugins/kdb/db2/libdb2/hash/hash.c @@ -1,4 +1,4 @@ -/*- +/* * Copyright (c) 1990, 1993, 1994 * The Regents of the University of California. All rights reserved. * @@ -34,10 +34,6 @@ * SUCH DAMAGE. */ -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)hash.c 8.12 (Berkeley) 11/7/95"; -#endif /* LIBC_SCCS and not lint */ - #undef _TS_ERRNO_ #include #include @@ -329,9 +325,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; @@ -436,11 +430,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; diff --git a/usr/src/lib/krb5/plugins/kdb/db2/libdb2/hash/hash_bigkey.c b/usr/src/lib/krb5/plugins/kdb/db2/libdb2/hash/hash_bigkey.c index a96b8aa985..f71ac2c3d8 100644 --- a/usr/src/lib/krb5/plugins/kdb/db2/libdb2/hash/hash_bigkey.c +++ b/usr/src/lib/krb5/plugins/kdb/db2/libdb2/hash/hash_bigkey.c @@ -1,6 +1,4 @@ -#pragma ident "%Z%%M% %I% %E% SMI" - -/*- +/* * Copyright (c) 1990, 1993, 1994 * The Regents of the University of California. All rights reserved. * @@ -36,10 +34,6 @@ * SUCH DAMAGE. */ -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)hash_bigkey.c 8.5 (Berkeley) 11/2/95"; -#endif /* LIBC_SCCS and not lint */ - /* * PACKAGE: hash * DESCRIPTION: @@ -196,12 +190,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/usr/src/lib/krb5/plugins/kdb/db2/libdb2/hash/hash_page.c b/usr/src/lib/krb5/plugins/kdb/db2/libdb2/hash/hash_page.c index b95090def2..23f8d7745c 100644 --- a/usr/src/lib/krb5/plugins/kdb/db2/libdb2/hash/hash_page.c +++ b/usr/src/lib/krb5/plugins/kdb/db2/libdb2/hash/hash_page.c @@ -1,6 +1,4 @@ -#pragma ident "%Z%%M% %I% %E% SMI" - -/*- +/* * Copyright (c) 1990, 1993, 1994 * The Regents of the University of California. All rights reserved. * @@ -36,10 +34,6 @@ * SUCH DAMAGE. */ -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)hash_page.c 8.11 (Berkeley) 11/7/95"; -#endif /* LIBC_SCCS and not lint */ - /* * PACKAGE: hashing * @@ -74,7 +68,9 @@ static char sccsid[] = "@(#)hash_page.c 8.11 (Berkeley) 11/7/95"; static int32_t add_bigptr __P((HTAB *, ITEM_INFO *, indx_t)); static u_int32_t *fetch_bitmap __P((HTAB *, int32_t)); static u_int32_t first_free __P((u_int32_t)); +#ifdef DEBUG static indx_t next_realkey __P((PAGE16 *, indx_t)); +#endif static u_int16_t overflow_page __P((HTAB *)); static void page_init __P((HTAB *, PAGE16 *, db_pgno_t, u_int8_t)); static indx_t prev_realkey __P((PAGE16 *, indx_t)); @@ -254,14 +250,9 @@ putpair(p, key, val) * Returns the index of the next non-bigkey pair after n on the page. * Returns -1 if there are no more non-big things on the page. */ +#ifdef DEBUG static indx_t -#ifdef __STDC__ next_realkey(PAGE16 * pagep, indx_t n) -#else -next_realkey(pagep, n) - PAGE16 *pagep; - u_int32_t n; -#endif { indx_t i; @@ -270,6 +261,7 @@ next_realkey(pagep, n) return (i); return (-1); } +#endif /* * Returns the index of the previous non-bigkey pair after n on the page. @@ -307,7 +299,7 @@ __delpair(hashp, cursorp, item_info) PAGE16 *pagep; indx_t ndx; short check_ndx; - int16_t delta, len, next_key; + int16_t delta, len; int32_t n; u_int8_t *src, *dest; @@ -378,9 +370,8 @@ __delpair(hashp, cursorp, item_info) /* Adjust the offsets. */ for (n = ndx; n < NUM_ENT(pagep) - 1; n++) if (KEY_OFF(pagep, (n + 1)) != BIGPAIR) { - next_key = next_realkey(pagep, n); #ifdef DEBUG - assert(next_key != -1); + assert(next_realkey(pagep, n) != -1); #endif KEY_OFF(pagep, n) = KEY_OFF(pagep, (n + 1)) + delta; DATA_OFF(pagep, n) = DATA_OFF(pagep, (n + 1)) + delta; -- 2.11.4.GIT