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.
This commit is contained in:
parent
374983f555
commit
d85a5daf25
3 changed files with 11 additions and 4 deletions
|
@ -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.
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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 */
|
||||
|
|
Loading…
Reference in a new issue