This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH: eliminate warning from libc/search/hash.c


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;




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]