diff options
author | Neil Booth <neil@daikokuya.demon.co.uk> | 2001-09-28 09:40:22 +0000 |
---|---|---|
committer | Neil Booth <neil@gcc.gnu.org> | 2001-09-28 09:40:22 +0000 |
commit | ece54d544da404f5d0e9c5efd78ff53e9636ce36 (patch) | |
tree | 04de76def0a1a191465d81cb782799aeec34587f /gcc/cpphash.h | |
parent | 0c0d83a1b4414876e77011d606631aafe94a271d (diff) | |
download | gcc-ece54d544da404f5d0e9c5efd78ff53e9636ce36.zip gcc-ece54d544da404f5d0e9c5efd78ff53e9636ce36.tar.gz gcc-ece54d544da404f5d0e9c5efd78ff53e9636ce36.tar.bz2 |
cpphash.h (struct cpp_buff): Make unsigned.
* cpphash.h (struct cpp_buff): Make unsigned.
(_cpp_get_buff): Take length of size_t.
(_cpp_unaligned_alloc): New.
(BUFF_ROOM, BUFF_FRONT, BUFF_LIMIT): New.
(struct cpp_reader): Remove ident_pool. Add u_buff.
* cppinit.c (cpp_create_reader): Initialize u_buff, not ident_pool.
(cpp_destroy): Destroy u_buff, not ident_pool.
* cpplex.c (parse_number, parse_string, save_comment,
cpp_token_as_text): Update to use the unaligned buffer.
(new_buff): Make unsigned.
(_cpp_unaligned_alloc): New.
* cpplib.c (glue_header_name): Update to use the unaligned buffer.
* cppmacro.c (new_number_token, builtin_macro, stringify_arg):
Similarly.
(collect_args): Make unsigned.
From-SVN: r45858
Diffstat (limited to 'gcc/cpphash.h')
-rw-r--r-- | gcc/cpphash.h | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/gcc/cpphash.h b/gcc/cpphash.h index 5bb2ce5..874baf2 100644 --- a/gcc/cpphash.h +++ b/gcc/cpphash.h @@ -77,14 +77,18 @@ typedef struct _cpp_buff _cpp_buff; struct _cpp_buff { struct _cpp_buff *next; - char *base, *cur, *limit; + unsigned char *base, *cur, *limit; }; -extern _cpp_buff *_cpp_get_buff PARAMS ((cpp_reader *, unsigned int)); +extern _cpp_buff *_cpp_get_buff PARAMS ((cpp_reader *, size_t)); extern void _cpp_release_buff PARAMS ((cpp_reader *, _cpp_buff *)); extern _cpp_buff *_cpp_extend_buff PARAMS ((cpp_reader *, _cpp_buff *, - unsigned int)); + size_t)); extern void _cpp_free_buff PARAMS ((_cpp_buff *)); +extern unsigned char *_cpp_unaligned_alloc PARAMS ((cpp_reader *, size_t)); +#define BUFF_ROOM(BUFF) ((BUFF)->limit - (BUFF)->cur) +#define BUFF_FRONT(BUFF) ((BUFF)->cur) +#define BUFF_LIMIT(BUFF) ((BUFF)->limit) /* List of directories to look for include files in. */ struct search_path @@ -267,12 +271,11 @@ struct cpp_reader unsigned int directive_line; /* Memory pools. */ - cpp_pool ident_pool; /* For all identifiers, and permanent - numbers and strings. */ cpp_pool macro_pool; /* For macro definitions. Permanent. */ /* Memory buffers. */ - _cpp_buff *free_buffs; + _cpp_buff *u_buff; /* Unaligned permanent storage. */ + _cpp_buff *free_buffs; /* Free buffer chain. */ /* Context stack. */ struct cpp_context base_context; |