diff options
-rw-r--r-- | gdb/ChangeLog | 7 | ||||
-rw-r--r-- | gdb/bcache.c | 4 | ||||
-rw-r--r-- | gdb/bcache.h | 4 |
3 files changed, 11 insertions, 4 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index cdca513..f70f65a 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,10 @@ +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. + 2002-02-22 Pierre Muller <muller@ics.u-strasbg.fr> * win32-nat.c (child_create_inferior): Fix create flags setting bug. diff --git a/gdb/bcache.c b/gdb/bcache.c index 0f9c2a2..753a916 100644 --- a/gdb/bcache.c +++ b/gdb/bcache.c @@ -33,7 +33,7 @@ */ unsigned long -hash(void *addr, int length) +hash(const void *addr, int length) { const unsigned char *k, *e; unsigned long h; @@ -127,7 +127,7 @@ expand_hash_table (struct bcache *bcache) 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) +bcache (const void *addr, int length, struct bcache *bcache) { int hash_index; struct bstring *s; diff --git a/gdb/bcache.h b/gdb/bcache.h index 6b32c57..2b03ead 100644 --- a/gdb/bcache.h +++ b/gdb/bcache.h @@ -113,7 +113,7 @@ struct bcache { /* 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); +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,5 +126,5 @@ extern void free_bcache (struct bcache *bcache); `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); +extern unsigned long hash(const void *addr, int length); #endif /* BCACHE_H */ |