/* C preprocessor macro tables for GDB.
- Copyright (C) 2002-2015 Free Software Foundation, Inc.
+ Copyright (C) 2002-2016 Free Software Foundation, Inc.
Contributed by Red Hat, Inc.
This file is part of GDB.
static const char *
macro_bcache_str (struct macro_table *t, const char *s)
{
- return macro_bcache (t, s, strlen (s) + 1);
+ return (const char *) macro_bcache (t, s, strlen (s) + 1);
}
struct macro_source_file *file,
int line)
{
- struct macro_key *k = macro_alloc (sizeof (*k), t);
+ struct macro_key *k = (struct macro_key *) macro_alloc (sizeof (*k), t);
memset (k, 0, sizeof (*k));
k->table = t;
const char *filename)
{
/* Get space for the source file structure itself. */
- struct macro_source_file *f = macro_alloc (sizeof (*f), t);
+ struct macro_source_file *f
+ = (struct macro_source_file *) macro_alloc (sizeof (*f), t);
memset (f, 0, sizeof (*f));
f->table = t;
int line,
const char *included)
{
- struct macro_source_file *new;
+ struct macro_source_file *newobj;
struct macro_source_file **link;
/* Find the right position in SOURCE's `includes' list for the new
/* At this point, we know that LINE is an unused line number, and
*LINK points to the entry an #inclusion at that line should
precede. */
- new = new_source_file (source->table, included);
- new->included_by = source;
- new->included_at_line = line;
- new->next_included = *link;
- *link = new;
+ newobj = new_source_file (source->table, included);
+ newobj->included_by = source;
+ newobj->included_at_line = line;
+ newobj->next_included = *link;
+ *link = newobj;
- return new;
+ return newobj;
}
int argc, const char **argv,
const char *replacement)
{
- struct macro_definition *d = macro_alloc (sizeof (*d), t);
+ struct macro_definition *d
+ = (struct macro_definition *) macro_alloc (sizeof (*d), t);
memset (d, 0, sizeof (*d));
d->table = t;
int cached_argv_size = argc * sizeof (*cached_argv);
/* Bcache all the arguments. */
- cached_argv = alloca (cached_argv_size);
+ cached_argv = (const char **) alloca (cached_argv_size);
for (i = 0; i < argc; i++)
cached_argv[i] = macro_bcache_str (t, argv[i]);
/* Now bcache the array of argument pointers itself. */
- d->argv = macro_bcache (t, cached_argv, cached_argv_size);
+ d->argv = ((const char * const *)
+ macro_bcache (t, cached_argv, cached_argv_size));
}
/* We don't bcache the entire definition structure because it's got
/* First, get storage for the `struct macro_table' itself. */
if (obstack)
- t = obstack_alloc (obstack, sizeof (*t));
+ t = XOBNEW (obstack, struct macro_table);
else
- t = xmalloc (sizeof (*t));
+ t = XNEW (struct macro_table);
memset (t, 0, sizeof (*t));
t->obstack = obstack;