summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGreg Hudson <ghudson@mit.edu>2023-04-04 14:23:19 -0400
committerGreg Hudson <ghudson@mit.edu>2023-04-10 13:23:05 -0400
commit45cde9809cad49a8ed8eb949a543b54d6e589c77 (patch)
tree303604d44c348820aebeb5c5104bece3e782954d
parent7a05f6e01421d5b88391e45b6fb5c245e5844600 (diff)
downloadkrb5-45cde9809cad49a8ed8eb949a543b54d6e589c77.tar.gz
Squash a Berkeley DB warning
In __delpair(), the assignment to next_key is not used unless DEBUG is defined, and the debugging assert can never fail--next_realkey() will always return n + 1 as we just checked KEY_OFF(pagep, n + 1). Remove the variable, the assert, and the otherwise unused next_realkey() function. This change eliminates a warning issued by clang 14.
-rw-r--r--src/plugins/kdb/db2/libdb2/hash/hash_page.c28
1 files changed, 1 insertions, 27 deletions
diff --git a/src/plugins/kdb/db2/libdb2/hash/hash_page.c b/src/plugins/kdb/db2/libdb2/hash/hash_page.c
index 5624dfd7d..0da357108 100644
--- a/src/plugins/kdb/db2/libdb2/hash/hash_page.c
+++ b/src/plugins/kdb/db2/libdb2/hash/hash_page.c
@@ -72,7 +72,6 @@ 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));
-static indx_t next_realkey __P((PAGE16 *, indx_t));
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));
@@ -249,27 +248,6 @@ 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.
- */
-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;
-
- for (i = n + 1; i < NUM_ENT(pagep); i++)
- if (KEY_OFF(pagep, i) != BIGPAIR)
- return (i);
- return (-1);
-}
-
-/*
* Returns the index of the previous non-bigkey pair after n on the page.
* Returns n if there are no previous non-big things on the page.
*/
@@ -305,7 +283,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;
@@ -376,10 +354,6 @@ __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);
-#endif
KEY_OFF(pagep, n) = KEY_OFF(pagep, (n + 1)) + delta;
DATA_OFF(pagep, n) = DATA_OFF(pagep, (n + 1)) + delta;
} else {