This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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 */


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]