]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Indicate that the bcache functions don't change the strings
authorJim Blandy <jimb@codesourcery.com>
Sat, 23 Feb 2002 03:57:26 +0000 (03:57 +0000)
committerJim Blandy <jimb@codesourcery.com>
Sat, 23 Feb 2002 03:57:26 +0000 (03:57 +0000)
they're passed.
* bcache.h (bcache, hash): Add `const' keywords to declarations.
* bcache.c (bcache, hash): Add `const' keywords to definitions.

gdb/ChangeLog
gdb/bcache.c
gdb/bcache.h

index cdca5139f0a9523b7114c8b3b3c13a5c45b56bd5..f70f65a99ae7a80d1b3284fa97284473ad990f60 100644 (file)
@@ -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.
index 0f9c2a25ccc95f42cfe39e21916777510a807d66..753a916d2e89ade70e8e89424e12e16f1ac45e0c 100644 (file)
@@ -33,7 +33,7 @@
  */
 \f
 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;
index 6b32c577d4f6348ea53e12ef601b38fee68dbdfe..2b03ead5a34916011d62a3cd416387c720acbcdc 100644 (file)
@@ -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 */