This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
PATCH: tweak bcache declarations
- From: Jim Blandy <jimb at redhat dot com>
- To: gdb-patches at sources dot redhat dot com
- Date: Fri, 22 Feb 2002 22:58:16 -0500 (EST)
- Subject: PATCH: tweak bcache declarations
I've committed the following. I'm sure you're thrilled.
2002-02-22 Jim Blandy <jimb@redhat.com>
Indicate that the bcache functions don't change the strings
they're passed.
* bcache.h (bcache, hash): Add `const' keywords to declarations.
* bcache.c (bcache, hash): Add `const' keywords to definitions.
Index: gdb/bcache.c
===================================================================
RCS file: /cvs/src/src/gdb/bcache.c,v
retrieving revision 1.6
diff -c -r1.6 bcache.c
*** gdb/bcache.c 2001/03/06 08:21:05 1.6
--- gdb/bcache.c 2002/02/23 03:55:08
***************
*** 33,39 ****
*/
unsigned long
! hash(void *addr, int length)
{
const unsigned char *k, *e;
unsigned long h;
--- 33,39 ----
*/
unsigned long
! hash(const void *addr, int length)
{
const unsigned char *k, *e;
unsigned long h;
***************
*** 127,133 ****
never seen those bytes before, add a copy of them to BCACHE. In
either case, return a pointer to BCACHE's copy of that string. */
void *
! bcache (void *addr, int length, struct bcache *bcache)
{
int hash_index;
struct bstring *s;
--- 127,133 ----
never seen those bytes before, add a copy of them to BCACHE. In
either case, return a pointer to BCACHE's copy of that string. */
void *
! bcache (const void *addr, int length, struct bcache *bcache)
{
int hash_index;
struct bstring *s;
Index: gdb/bcache.h
===================================================================
RCS file: /cvs/src/src/gdb/bcache.h,v
retrieving revision 1.4
diff -c -r1.4 bcache.h
*** gdb/bcache.h 2001/03/06 08:21:05 1.4
--- gdb/bcache.h 2002/02/23 03:55:08
***************
*** 113,119 ****
/* Find a copy of the LENGTH bytes at ADDR in BCACHE. If BCACHE has
never seen those bytes before, add a copy of them to BCACHE. In
either case, return a pointer to BCACHE's copy of that string. */
! extern void *bcache (void *addr, int length, struct bcache *bcache);
/* Free all the storage that BCACHE refers to. The result is a valid,
but empty, bcache. This does not free BCACHE itself, since that
--- 113,119 ----
/* Find a copy of the LENGTH bytes at ADDR in BCACHE. If BCACHE has
never seen those bytes before, add a copy of them to BCACHE. In
either case, return a pointer to BCACHE's copy of that string. */
! extern void *bcache (const void *addr, int length, struct bcache *bcache);
/* Free all the storage that BCACHE refers to. The result is a valid,
but empty, bcache. This does not free BCACHE itself, since that
***************
*** 126,130 ****
`printf_filtered' and its ilk. */
extern void print_bcache_statistics (struct bcache *bcache, char *type);
/* The hash function */
! extern unsigned long hash(void *addr, int length);
#endif /* BCACHE_H */
--- 126,130 ----
`printf_filtered' and its ilk. */
extern void print_bcache_statistics (struct bcache *bcache, char *type);
/* The hash function */
! extern unsigned long hash(const void *addr, int length);
#endif /* BCACHE_H */