diff options
author | delphij <delphij@FreeBSD.org> | 2007-05-25 09:57:48 +0000 |
---|---|---|
committer | delphij <delphij@FreeBSD.org> | 2007-05-25 09:57:48 +0000 |
commit | 16abe9b047ff84fb1d4b3d388563751e6b8be538 (patch) | |
tree | 6ace990a1ca88b1fb4da2aed5cdbd0e0e0e1d27e /lib/libc/db | |
parent | ddbd7cde72b0cb0f96600a76e0df5f3320258929 (diff) | |
download | FreeBSD-src-16abe9b047ff84fb1d4b3d388563751e6b8be538.zip FreeBSD-src-16abe9b047ff84fb1d4b3d388563751e6b8be538.tar.gz |
The usage of "info" in init_hash() is read-only, so constify
the internal interface instead of casting away the constant
constraint upon calling.
Diffstat (limited to 'lib/libc/db')
-rw-r--r-- | lib/libc/db/hash/hash.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/libc/db/hash/hash.c b/lib/libc/db/hash/hash.c index 6fb7567..6b71d4a 100644 --- a/lib/libc/db/hash/hash.c +++ b/lib/libc/db/hash/hash.c @@ -68,7 +68,7 @@ static void *hash_realloc(SEGMENT **, int, int); static int hash_seq(const DB *, DBT *, DBT *, u_int32_t); static int hash_sync(const DB *, u_int32_t); static int hdestroy(HTAB *); -static HTAB *init_hash(HTAB *, const char *, HASHINFO *); +static HTAB *init_hash(HTAB *, const char *, const HASHINFO *); static int init_htab(HTAB *, int); #if BYTE_ORDER == LITTLE_ENDIAN static void swap_header(HTAB *); @@ -140,7 +140,7 @@ __hash_open(file, flags, mode, info, dflags) (void)_fcntl(hashp->fp, F_SETFD, 1); } if (new_table) { - if (!(hashp = init_hash(hashp, file, (HASHINFO *)info))) + if (!(hashp = init_hash(hashp, file, info))) RETURN_ERROR(errno, error1); } else { /* Table already exists */ @@ -286,7 +286,7 @@ static HTAB * init_hash(hashp, file, info) HTAB *hashp; const char *file; - HASHINFO *info; + const HASHINFO *info; { struct stat statbuf; int nelem; |