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:
Jim Blandy
2002-02-23 03:57:26 +00:00
parent 374983f555
commit d85a5daf25
3 changed files with 11 additions and 4 deletions

View File

@@ -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;