diff options
author | bernie <bernie@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-07-24 18:04:42 +0000 |
---|---|---|
committer | bernie <bernie@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-07-24 18:04:42 +0000 |
commit | 3b29876427e76f4cf4054a55c5cd6ad403ba61eb (patch) | |
tree | 30cd686465d5c32ae3feab21b35a78240675f666 /libcpp | |
parent | 001ad2d459f7dd38d03ff0fe356139595cc6c7b6 (diff) | |
download | gcc-3b29876427e76f4cf4054a55c5cd6ad403ba61eb.tar.gz |
* internal.h (xnew, xcnew, xnewvec, xcnewvec, xobnew): Remove.
* directives.c: Use XNEW-family macros from libiberty.
* lex.c: Likewise.
* macro.c: Likewise.
* cpplib.h (cpp_deps_style): Export enum with name.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@85121 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libcpp')
-rw-r--r-- | libcpp/ChangeLog | 10 | ||||
-rw-r--r-- | libcpp/directives.c | 10 | ||||
-rw-r--r-- | libcpp/include/cpplib.h | 5 | ||||
-rw-r--r-- | libcpp/internal.h | 5 | ||||
-rw-r--r-- | libcpp/lex.c | 4 | ||||
-rw-r--r-- | libcpp/macro.c | 2 |
6 files changed, 21 insertions, 15 deletions
diff --git a/libcpp/ChangeLog b/libcpp/ChangeLog index 5c225a3eb8f..2c568b0473d 100644 --- a/libcpp/ChangeLog +++ b/libcpp/ChangeLog @@ -1,5 +1,13 @@ +2004-07-24 Bernardo Innocenti <bernie@develer.com> + + * internal.h (xnew, xcnew, xnewvec, xcnewvec, xobnew): Remove. + * directives.c: Use XNEW-family macros from libiberty. + * lex.c: Likewise. + * macro.c: Likewise. + * cpplib.h (cpp_deps_style): Export enum with name. + 2004-07-23 Matthias Klose <doko@debian.org> - + init.c (init_library): Use PACKAGE for the text domain. 2004-07-16 Andris Pavenis <pavenis@latnet.lv> diff --git a/libcpp/directives.c b/libcpp/directives.c index 16873dadecf..76055a6fc3a 100644 --- a/libcpp/directives.c +++ b/libcpp/directives.c @@ -1077,7 +1077,7 @@ char ** _cpp_save_pragma_names (cpp_reader *pfile) { int ct = count_registered_pragmas (pfile->pragmas); - char **result = xnewvec (char *, ct); + char **result = XNEWVEC (char *, ct); (void) save_registered_pragmas (pfile->pragmas, result); return result; } @@ -1318,11 +1318,11 @@ destringize_and_run (cpp_reader *pfile, const cpp_string *in) cpp_token *saved_cur_token = pfile->cur_token; tokenrun *saved_cur_run = pfile->cur_run; - pfile->context = xnew (cpp_context); + pfile->context = XNEW (cpp_context); pfile->context->macro = 0; pfile->context->prev = 0; run_directive (pfile, T_PRAGMA, result, dest - result); - free (pfile->context); + XDELETE (pfile->context); pfile->context = saved_context; pfile->cur_token = saved_cur_token; pfile->cur_run = saved_cur_run; @@ -1532,7 +1532,7 @@ push_conditional (cpp_reader *pfile, int skip, int type, struct if_stack *ifs; cpp_buffer *buffer = pfile->buffer; - ifs = xobnew (&pfile->buffer_ob, struct if_stack); + ifs = XOBNEW (&pfile->buffer_ob, struct if_stack); ifs->line = pfile->directive_line; ifs->next = buffer->if_stack; ifs->skip_elses = pfile->state.skipping || !skip; @@ -1922,7 +1922,7 @@ cpp_buffer * cpp_push_buffer (cpp_reader *pfile, const uchar *buffer, size_t len, int from_stage3) { - cpp_buffer *new = xobnew (&pfile->buffer_ob, cpp_buffer); + cpp_buffer *new = XOBNEW (&pfile->buffer_ob, cpp_buffer); /* Clears, amongst other things, if_stack and mi_cmacro. */ memset (new, 0, sizeof (cpp_buffer)); diff --git a/libcpp/include/cpplib.h b/libcpp/include/cpplib.h index dab315714df..547364112f6 100644 --- a/libcpp/include/cpplib.h +++ b/libcpp/include/cpplib.h @@ -231,6 +231,9 @@ extern enum cpp_token_fld_kind cpp_token_val_index (cpp_token *tok); typedef unsigned CPPCHAR_SIGNED_T cppchar_t; typedef CPPCHAR_SIGNED_T cppchar_signed_t; +/* Style of header dependencies to generate. */ +enum cpp_deps_style { DEPS_NONE = 0, DEPS_USER, DEPS_SYSTEM }; + /* This structure is nested inside struct cpp_reader, and carries all the options visible to the command line. */ struct cpp_options @@ -378,7 +381,7 @@ struct cpp_options struct { /* Style of header dependencies to generate. */ - enum {DEPS_NONE = 0, DEPS_USER, DEPS_SYSTEM } style; + enum cpp_deps_style style; /* Assume missing files are generated files. */ bool missing_files; diff --git a/libcpp/internal.h b/libcpp/internal.h index 0a7eb109187..53b02f8c94c 100644 --- a/libcpp/internal.h +++ b/libcpp/internal.h @@ -560,11 +560,6 @@ extern const char *_cpp_default_encoding (void); /* Utility routines and macros. */ #define DSC(str) (const uchar *)str, sizeof str - 1 -#define xnew(T) (T *) xmalloc (sizeof(T)) -#define xcnew(T) (T *) xcalloc (1, sizeof(T)) -#define xnewvec(T, N) (T *) xmalloc (sizeof(T) * (N)) -#define xcnewvec(T, N) (T *) xcalloc (N, sizeof(T)) -#define xobnew(O, T) (T *) obstack_alloc (O, sizeof(T)) /* These are inline functions instead of macros so we can get type checking. */ diff --git a/libcpp/lex.c b/libcpp/lex.c index 7eafb13d3b4..914703fde2f 100644 --- a/libcpp/lex.c +++ b/libcpp/lex.c @@ -662,7 +662,7 @@ save_comment (cpp_reader *pfile, cpp_token *token, const unsigned char *from, void _cpp_init_tokenrun (tokenrun *run, unsigned int count) { - run->base = xnewvec (cpp_token, count); + run->base = XNEWVEC (cpp_token, count); run->limit = run->base + count; run->next = NULL; } @@ -673,7 +673,7 @@ next_tokenrun (tokenrun *run) { if (run->next == NULL) { - run->next = xnew (tokenrun); + run->next = XNEW (tokenrun); run->next->prev = run; _cpp_init_tokenrun (run->next, 250); } diff --git a/libcpp/macro.c b/libcpp/macro.c index dc58b3180f1..729ea061b8b 100644 --- a/libcpp/macro.c +++ b/libcpp/macro.c @@ -919,7 +919,7 @@ next_context (cpp_reader *pfile) if (result == 0) { - result = xnew (cpp_context); + result = XNEW (cpp_context); result->prev = pfile->context; result->next = 0; pfile->context->next = result; |