PATCH: eliminate warning from libc/search/hash.c
Jeff Johnston
jjohnstn@redhat.com
Mon Jan 29 19:22:00 GMT 2007
Ben Elliston wrote:
> The __hash_open function has a const HASHINFO * parameter ("info") which
> it passes through to init_hash, a static function also in hash.c.
> init_hash does not modify any of the fields of info, so it is possible
> to connst-qualify the parameter in init_hash and eliminate a warning.
>
> Okay to commit?
>
Yes.
> 2007-01-29 Ben Elliston <bje@au.ibm.com>
>
> * libc/search/hash.c (init_hash): Make `info' parameter const.
>
> Index: hash.c
> ===================================================================
> RCS file: /cvs/src/src/newlib/libc/search/hash.c,v
> retrieving revision 1.7
> diff -u -r1.7 hash.c
> --- hash.c 26 May 2004 17:57:10 -0000 1.7
> +++ hash.c 29 Jan 2007 05:19:28 -0000
> @@ -70,7 +70,7 @@
> static int hash_seq(const DB *, DBT *, DBT *, __uint32_t);
> static int hash_sync(const DB *, __uint32_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 *);
> @@ -307,7 +307,7 @@
> init_hash(hashp, file, info)
> HTAB *hashp;
> const char *file;
> - HASHINFO *info;
> + const HASHINFO *info;
> {
> struct stat statbuf;
> int nelem;
>
>
More information about the Newlib
mailing list