When compiling ospfd I get following warning:
/usr/include/sys/hash.h: In function 'hash32_stre':
/usr/include/sys/hash.h:104: warning: cast discards qualifiers from
pointer target type
The following diff seems to fix this. OK?
--
:wq Claudio
Index: sys/hash.h
===================================================================
RCS file: /cvs/src/sys/sys/hash.h,v
retrieving revision 1.4
diff -u -p -r1.4 hash.h
--- sys/hash.h 25 May 2004 18:37:23 -0000 1.4
+++ sys/hash.h 24 Sep 2010 12:22:37 -0000
@@ -93,7 +93,7 @@ hash32_strn(const void *buf, size_t len,
* namei() hashing of path name parts.
*/
static __inline uint32_t
-hash32_stre(const void *buf, int end, char **ep, uint32_t hash)
+hash32_stre(const void *buf, int end, const char **ep, uint32_t hash)
{
const unsigned char *p = buf;
@@ -101,7 +101,7 @@ hash32_stre(const void *buf, int end, ch
hash = HASHSTEP(hash, *p++);
if (ep)
- *ep = (char *)p;
+ *ep = p;
return hash;
}
@@ -112,7 +112,8 @@ hash32_stre(const void *buf, int end, ch
* as a helper for the namei() hashing of path name parts.
*/
static __inline uint32_t
-hash32_strne(const void *buf, size_t len, int end, char **ep, uint32_t hash)
+hash32_strne(const void *buf, size_t len, int end, const char **ep,
+ uint32_t hash)
{
const unsigned char *p = buf;
@@ -120,7 +121,7 @@ hash32_strne(const void *buf, size_t len
hash = HASHSTEP(hash, *p++);
if (ep)
- *ep = (char *)p;
+ *ep = p;
return hash;
}