diff options
author | David Carlton <carlton@bactrian.org> | 2002-10-17 21:16:12 +0000 |
---|---|---|
committer | David Carlton <carlton@bactrian.org> | 2002-10-17 21:16:12 +0000 |
commit | 63ca651f75ebaa245c6277dbf6a7398b70b05806 (patch) | |
tree | a43c99baed2dedea621c6b3580cfb914a0315264 /gdb | |
parent | abe1a5d0efb706925b171e04e3b11398c01ad3e0 (diff) | |
download | gdb-63ca651f75ebaa245c6277dbf6a7398b70b05806.zip gdb-63ca651f75ebaa245c6277dbf6a7398b70b05806.tar.gz gdb-63ca651f75ebaa245c6277dbf6a7398b70b05806.tar.bz2 |
2002-10-09 David Carlton <carlton@math.stanford.edu>
* symfile.h: Add opaque declaration for struct obstack.
Declare obsavestring to take a const char *.
* symfile.c (obsavestring): Make first argument a const char *.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 6 | ||||
-rw-r--r-- | gdb/symfile.c | 6 | ||||
-rw-r--r-- | gdb/symfile.h | 6 |
3 files changed, 14 insertions, 4 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index b36401b..792c17b 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2002-10-09 David Carlton <carlton@math.stanford.edu> + + * symfile.h: Add opaque declaration for struct obstack. + Declare obsavestring to take a const char *. + * symfile.c (obsavestring): Make first argument a const char *. + 2002-10-16 Adam Fedor <fedor@gnu.org> * breakpoint.c (parse_breakpoint_sals): Ignore ObjC method diff --git a/gdb/symfile.c b/gdb/symfile.c index 6b702a3..28c84f9 100644 --- a/gdb/symfile.c +++ b/gdb/symfile.c @@ -299,16 +299,16 @@ sort_symtab_syms (register struct symtab *s) may be part of a larger string and we are only saving a substring. */ char * -obsavestring (char *ptr, int size, struct obstack *obstackp) +obsavestring (const char *ptr, int size, struct obstack *obstackp) { register char *p = (char *) obstack_alloc (obstackp, size + 1); /* Open-coded memcpy--saves function call time. These strings are usually short. FIXME: Is this really still true with a compiler that can inline memcpy? */ { - register char *p1 = ptr; + register const char *p1 = ptr; register char *p2 = p; - char *end = ptr + size; + const char *end = ptr + size; while (p1 != end) *p2++ = *p1++; } diff --git a/gdb/symfile.h b/gdb/symfile.h index 39eb308..62dfcef 100644 --- a/gdb/symfile.h +++ b/gdb/symfile.h @@ -25,6 +25,10 @@ /* This file requires that you first include "bfd.h". */ +/* Opaque declarations. */ + +struct obstack; + /* Partial symbols are stored in the psymbol_cache and pointers to them are kept in a dynamically grown array that is obtained from malloc and grown as necessary via realloc. Each objfile typically has two of these, @@ -208,7 +212,7 @@ extern void sort_symtab_syms (struct symtab *); (and add a null character at the end in the copy). Returns the address of the copy. */ -extern char *obsavestring (char *, int, struct obstack *); +extern char *obsavestring (const char *, int, struct obstack *); /* Concatenate strings S1, S2 and S3; return the new string. Space is found in the symbol_obstack. */ |