Commit 28dab132 by Bernardo Innocenti Committed by Bernardo Innocenti

basic-block.h (reorder_block_def): Rename to reorder_block_def_p.

	* basic-block.h (reorder_block_def): Rename to reorder_block_def_p.
	* c-common.c: Add missing casts from void * to other types.
	* c-decl.c: Likewise.
	* c-format.c: Likewise.
	* c-lex.c: Likewise.
	* c-pragma.c: Likewise.
	* c-typeck.c: Likewise.
	* defaults.h: Likewise.
	* genconstants.c: Likewise.
	* gengtype-lex.l: Likewise.
	* genmodes.c: Likewise.
	* read-rtl.c: Likewise.
	* rtl.c: Likewise.

From-SVN: r85166
parent 4f3d87d6
2004-07-25 Bernardo Innocenti <bernie@develer.com> 2004-07-25 Bernardo Innocenti <bernie@develer.com>
* basic-block.h (reorder_block_def): Rename to reorder_block_def_p.
* c-common.c: Add missing casts from void * to other types.
* c-decl.c: Likewise.
* c-format.c: Likewise.
* c-lex.c: Likewise.
* c-pragma.c: Likewise.
* c-typeck.c: Likewise.
* defaults.h: Likewise.
* genconstants.c: Likewise.
* gengtype-lex.l: Likewise.
* genmodes.c: Likewise.
* read-rtl.c: Likewise.
* rtl.c: Likewise.
2004-07-25 Bernardo Innocenti <bernie@develer.com>
* bitmap.c: Use type-safe memory allocation macros from libiberty. * bitmap.c: Use type-safe memory allocation macros from libiberty.
* c-common.c: Likewise. * c-common.c: Likewise.
* c-decl.c: Likewise. * c-decl.c: Likewise.
......
...@@ -300,7 +300,7 @@ typedef struct reorder_block_def ...@@ -300,7 +300,7 @@ typedef struct reorder_block_def
/* These fields are used by bb-reorder pass. */ /* These fields are used by bb-reorder pass. */
int visited; int visited;
} *reorder_block_def; } *reorder_block_def_p;
#define BB_FREQ_MAX 10000 #define BB_FREQ_MAX 10000
......
...@@ -740,7 +740,7 @@ fname_as_string (int pretty_p) ...@@ -740,7 +740,7 @@ fname_as_string (int pretty_p)
int len = strlen (name) + 3; /* Two for '"'s. One for NULL. */ int len = strlen (name) + 3; /* Two for '"'s. One for NULL. */
cpp_string cstr = { 0, 0 }, strname; cpp_string cstr = { 0, 0 }, strname;
namep = xmalloc (len); namep = XNEWVEC (char, len);
snprintf (namep, len, "\"%s\"", name); snprintf (namep, len, "\"%s\"", name);
strname.text = (unsigned char *) namep; strname.text = (unsigned char *) namep;
strname.len = len - 1; strname.len = len - 1;
...@@ -1394,7 +1394,7 @@ verify_sequence_points (tree expr) ...@@ -1394,7 +1394,7 @@ verify_sequence_points (tree expr)
if (tlist_firstobj == 0) if (tlist_firstobj == 0)
{ {
gcc_obstack_init (&tlist_obstack); gcc_obstack_init (&tlist_obstack);
tlist_firstobj = obstack_alloc (&tlist_obstack, 0); tlist_firstobj = (char *) obstack_alloc (&tlist_obstack, 0);
} }
verify_tree (expr, &before_sp, &after_sp, 0); verify_tree (expr, &before_sp, &after_sp, 0);
...@@ -2762,7 +2762,7 @@ c_sizeof_or_alignof_type (tree type, enum tree_code op, int complain) ...@@ -2762,7 +2762,7 @@ c_sizeof_or_alignof_type (tree type, enum tree_code op, int complain)
} }
else else
{ {
if (op == SIZEOF_EXPR) if (op == (enum tree_code) SIZEOF_EXPR)
/* Convert in case a char is more than one unit. */ /* Convert in case a char is more than one unit. */
value = size_binop (CEIL_DIV_EXPR, TYPE_SIZE_UNIT (type), value = size_binop (CEIL_DIV_EXPR, TYPE_SIZE_UNIT (type),
size_int (TYPE_PRECISION (char_type_node) size_int (TYPE_PRECISION (char_type_node)
...@@ -3658,7 +3658,7 @@ static int ...@@ -3658,7 +3658,7 @@ static int
match_case_to_enum (splay_tree_node node, void *data) match_case_to_enum (splay_tree_node node, void *data)
{ {
tree label = (tree) node->value; tree label = (tree) node->value;
tree type = data; tree type = (tree) data;
/* Skip default case. */ /* Skip default case. */
if (!CASE_LOW (label)) if (!CASE_LOW (label))
...@@ -4280,7 +4280,7 @@ handle_mode_attribute (tree *node, tree name, tree args, ...@@ -4280,7 +4280,7 @@ handle_mode_attribute (tree *node, tree name, tree args,
if (len > 4 && p[0] == '_' && p[1] == '_' if (len > 4 && p[0] == '_' && p[1] == '_'
&& p[len - 1] == '_' && p[len - 2] == '_') && p[len - 1] == '_' && p[len - 2] == '_')
{ {
char *newp = alloca (len - 1); char *newp = (char *) alloca (len - 1);
strcpy (newp, &p[2]); strcpy (newp, &p[2]);
newp[len - 4] = '\0'; newp[len - 4] = '\0';
...@@ -5199,8 +5199,9 @@ check_function_arguments_recurse (void (*callback) ...@@ -5199,8 +5199,9 @@ check_function_arguments_recurse (void (*callback)
int int
field_decl_cmp (const void *x_p, const void *y_p) field_decl_cmp (const void *x_p, const void *y_p)
{ {
const tree *const x = x_p; const tree *const x = (const tree *const) x_p;
const tree *const y = y_p; const tree *const y = (const tree *const) y_p;
if (DECL_NAME (*x) == DECL_NAME (*y)) if (DECL_NAME (*x) == DECL_NAME (*y))
/* A nontype is "greater" than a type. */ /* A nontype is "greater" than a type. */
return (TREE_CODE (*y) == TYPE_DECL) - (TREE_CODE (*x) == TYPE_DECL); return (TREE_CODE (*y) == TYPE_DECL) - (TREE_CODE (*x) == TYPE_DECL);
...@@ -5224,8 +5225,8 @@ pointer operator in resort_data. */ ...@@ -5224,8 +5225,8 @@ pointer operator in resort_data. */
static int static int
resort_field_decl_cmp (const void *x_p, const void *y_p) resort_field_decl_cmp (const void *x_p, const void *y_p)
{ {
const tree *const x = x_p; const tree *const x = (const tree *const) x_p;
const tree *const y = y_p; const tree *const y = (const tree *const) y_p;
if (DECL_NAME (*x) == DECL_NAME (*y)) if (DECL_NAME (*x) == DECL_NAME (*y))
/* A nontype is "greater" than a type. */ /* A nontype is "greater" than a type. */
......
...@@ -2963,7 +2963,7 @@ finish_decl (tree decl, tree init, tree asmspec_tree) ...@@ -2963,7 +2963,7 @@ finish_decl (tree decl, tree init, tree asmspec_tree)
{ {
/* ASMSPEC is given, and not the name of a register. Mark the /* ASMSPEC is given, and not the name of a register. Mark the
name with a star so assemble_name won't munge it. */ name with a star so assemble_name won't munge it. */
char *starred = alloca (strlen (asmspec) + 2); char *starred = (char *) alloca (strlen (asmspec) + 2);
starred[0] = '*'; starred[0] = '*';
strcpy (starred + 1, asmspec); strcpy (starred + 1, asmspec);
......
...@@ -889,8 +889,8 @@ init_dollar_format_checking (int first_arg_num, tree params) ...@@ -889,8 +889,8 @@ init_dollar_format_checking (int first_arg_num, tree params)
if (dollar_arguments_pointer_p) if (dollar_arguments_pointer_p)
free (dollar_arguments_pointer_p); free (dollar_arguments_pointer_p);
dollar_arguments_alloc = dollar_arguments_count; dollar_arguments_alloc = dollar_arguments_count;
dollar_arguments_used = xmalloc (dollar_arguments_alloc); dollar_arguments_used = XNEWVEC (char, dollar_arguments_alloc);
dollar_arguments_pointer_p = xmalloc (dollar_arguments_alloc); dollar_arguments_pointer_p = XNEWVEC (char, dollar_arguments_alloc);
} }
if (dollar_arguments_alloc) if (dollar_arguments_alloc)
{ {
...@@ -980,9 +980,10 @@ maybe_read_dollar_number (const char **format, ...@@ -980,9 +980,10 @@ maybe_read_dollar_number (const char **format,
{ {
int nalloc; int nalloc;
nalloc = 2 * dollar_arguments_alloc + 16; nalloc = 2 * dollar_arguments_alloc + 16;
dollar_arguments_used = xrealloc (dollar_arguments_used, nalloc); dollar_arguments_used = XRESIZEVEC (char, dollar_arguments_used,
dollar_arguments_pointer_p = xrealloc (dollar_arguments_pointer_p, nalloc);
nalloc); dollar_arguments_pointer_p = XRESIZEVEC (char, dollar_arguments_pointer_p,
nalloc);
memset (dollar_arguments_used + dollar_arguments_alloc, 0, memset (dollar_arguments_used + dollar_arguments_alloc, 0,
nalloc - dollar_arguments_alloc); nalloc - dollar_arguments_alloc);
dollar_arguments_alloc = nalloc; dollar_arguments_alloc = nalloc;
...@@ -1207,7 +1208,7 @@ static void ...@@ -1207,7 +1208,7 @@ static void
check_format_arg (void *ctx, tree format_tree, check_format_arg (void *ctx, tree format_tree,
unsigned HOST_WIDE_INT arg_num) unsigned HOST_WIDE_INT arg_num)
{ {
format_check_context *format_ctx = ctx; format_check_context *format_ctx = (format_check_context *) ctx;
format_check_results *res = format_ctx->res; format_check_results *res = format_ctx->res;
function_format_info *info = format_ctx->info; function_format_info *info = format_ctx->info;
tree params = format_ctx->params; tree params = format_ctx->params;
...@@ -2307,7 +2308,8 @@ init_dynamic_asm_fprintf_info (void) ...@@ -2307,7 +2308,8 @@ init_dynamic_asm_fprintf_info (void)
abort (); abort ();
/* Create a new (writable) copy of asm_fprintf_length_specs. */ /* Create a new (writable) copy of asm_fprintf_length_specs. */
new_asm_fprintf_length_specs = xmemdup (asm_fprintf_length_specs, new_asm_fprintf_length_specs = (format_length_info *)
xmemdup (asm_fprintf_length_specs,
sizeof (asm_fprintf_length_specs), sizeof (asm_fprintf_length_specs),
sizeof (asm_fprintf_length_specs)); sizeof (asm_fprintf_length_specs));
...@@ -2333,7 +2335,7 @@ static void ...@@ -2333,7 +2335,7 @@ static void
init_dynamic_diag_info (void) init_dynamic_diag_info (void)
{ {
static tree t, loc, hwi; static tree t, loc, hwi;
if (!loc || !t || !hwi) if (!loc || !t || !hwi)
{ {
static format_char_info *diag_fci, *cdiag_fci, *cxxdiag_fci; static format_char_info *diag_fci, *cdiag_fci, *cxxdiag_fci;
...@@ -2368,7 +2370,8 @@ init_dynamic_diag_info (void) ...@@ -2368,7 +2370,8 @@ init_dynamic_diag_info (void)
dynamic_format_types[gcc_diag_format_type].length_char_specs = dynamic_format_types[gcc_diag_format_type].length_char_specs =
dynamic_format_types[gcc_cdiag_format_type].length_char_specs = dynamic_format_types[gcc_cdiag_format_type].length_char_specs =
dynamic_format_types[gcc_cxxdiag_format_type].length_char_specs = dynamic_format_types[gcc_cxxdiag_format_type].length_char_specs =
diag_ls = xmemdup (gcc_diag_length_specs, diag_ls = (format_length_info *)
xmemdup (gcc_diag_length_specs,
sizeof (gcc_diag_length_specs), sizeof (gcc_diag_length_specs),
sizeof (gcc_diag_length_specs)); sizeof (gcc_diag_length_specs));
if (hwi) if (hwi)
...@@ -2386,7 +2389,8 @@ init_dynamic_diag_info (void) ...@@ -2386,7 +2389,8 @@ init_dynamic_diag_info (void)
/* Handle the __gcc_diag__ format specifics. */ /* Handle the __gcc_diag__ format specifics. */
if (! diag_fci) if (! diag_fci)
dynamic_format_types[gcc_diag_format_type].conversion_specs = dynamic_format_types[gcc_diag_format_type].conversion_specs =
diag_fci = xmemdup (gcc_diag_char_table, diag_fci = (format_char_info *)
xmemdup (gcc_diag_char_table,
sizeof(gcc_diag_char_table), sizeof(gcc_diag_char_table),
sizeof(gcc_diag_char_table)); sizeof(gcc_diag_char_table));
if (loc) if (loc)
...@@ -2405,7 +2409,8 @@ init_dynamic_diag_info (void) ...@@ -2405,7 +2409,8 @@ init_dynamic_diag_info (void)
/* Handle the __gcc_cdiag__ format specifics. */ /* Handle the __gcc_cdiag__ format specifics. */
if (! cdiag_fci) if (! cdiag_fci)
dynamic_format_types[gcc_cdiag_format_type].conversion_specs = dynamic_format_types[gcc_cdiag_format_type].conversion_specs =
cdiag_fci = xmemdup (gcc_cdiag_char_table, cdiag_fci = (format_char_info *)
xmemdup (gcc_cdiag_char_table,
sizeof(gcc_cdiag_char_table), sizeof(gcc_cdiag_char_table),
sizeof(gcc_cdiag_char_table)); sizeof(gcc_cdiag_char_table));
if (loc) if (loc)
...@@ -2428,7 +2433,8 @@ init_dynamic_diag_info (void) ...@@ -2428,7 +2433,8 @@ init_dynamic_diag_info (void)
/* Handle the __gcc_cxxdiag__ format specifics. */ /* Handle the __gcc_cxxdiag__ format specifics. */
if (! cxxdiag_fci) if (! cxxdiag_fci)
dynamic_format_types[gcc_cxxdiag_format_type].conversion_specs = dynamic_format_types[gcc_cxxdiag_format_type].conversion_specs =
cxxdiag_fci = xmemdup (gcc_cxxdiag_char_table, cxxdiag_fci = (format_char_info *)
xmemdup (gcc_cxxdiag_char_table,
sizeof(gcc_cxxdiag_char_table), sizeof(gcc_cxxdiag_char_table),
sizeof(gcc_cxxdiag_char_table)); sizeof(gcc_cxxdiag_char_table));
if (loc) if (loc)
...@@ -2530,7 +2536,7 @@ handle_format_attribute (tree *node, tree ARG_UNUSED (name), tree args, ...@@ -2530,7 +2536,7 @@ handle_format_attribute (tree *node, tree ARG_UNUSED (name), tree args,
/* Our first time through, we have to make sure that our /* Our first time through, we have to make sure that our
format_type data is allocated dynamically and is modifiable. */ format_type data is allocated dynamically and is modifiable. */
if (!dynamic_format_types) if (!dynamic_format_types)
format_types = dynamic_format_types = format_types = dynamic_format_types = (format_kind_info *)
xmemdup (format_types_orig, sizeof (format_types_orig), xmemdup (format_types_orig, sizeof (format_types_orig),
sizeof (format_types_orig)); sizeof (format_types_orig));
......
...@@ -628,7 +628,7 @@ interpret_float (const cpp_token *token, unsigned int flags) ...@@ -628,7 +628,7 @@ interpret_float (const cpp_token *token, unsigned int flags)
/* I or J suffix. */ /* I or J suffix. */
copylen--; copylen--;
copy = alloca (copylen + 1); copy = (char *) alloca (copylen + 1);
memcpy (copy, token->val.str.text, copylen); memcpy (copy, token->val.str.text, copylen);
copy[copylen] = '\0'; copy[copylen] = '\0';
...@@ -710,7 +710,7 @@ lex_string (const cpp_token *tok, tree *valp, bool objc_string) ...@@ -710,7 +710,7 @@ lex_string (const cpp_token *tok, tree *valp, bool objc_string)
} }
} }
while (tok->type == CPP_STRING || tok->type == CPP_WSTRING); while (tok->type == CPP_STRING || tok->type == CPP_WSTRING);
strs = obstack_finish (&str_ob); strs = (cpp_string *) obstack_finish (&str_ob);
} }
/* We have read one more token than we want. */ /* We have read one more token than we want. */
......
...@@ -554,7 +554,7 @@ maybe_apply_renaming_pragma (tree decl, tree asmname) ...@@ -554,7 +554,7 @@ maybe_apply_renaming_pragma (tree decl, tree asmname)
const char *id = IDENTIFIER_POINTER (DECL_NAME (decl)); const char *id = IDENTIFIER_POINTER (DECL_NAME (decl));
size_t ilen = IDENTIFIER_LENGTH (DECL_NAME (decl)); size_t ilen = IDENTIFIER_LENGTH (DECL_NAME (decl));
char *newname = alloca (plen + ilen + 1); char *newname = (char *) alloca (plen + ilen + 1);
memcpy (newname, prefix, plen); memcpy (newname, prefix, plen);
memcpy (newname + plen, id, ilen + 1); memcpy (newname + plen, id, ilen + 1);
......
...@@ -3598,7 +3598,7 @@ warn_for_assignment (const char *msgid, const char *opname, tree function, ...@@ -3598,7 +3598,7 @@ warn_for_assignment (const char *msgid, const char *opname, tree function,
{ {
/* Function name is known; supply it. */ /* Function name is known; supply it. */
const char *const argstring = _("passing arg of `%s'"); const char *const argstring = _("passing arg of `%s'");
new_opname = alloca (IDENTIFIER_LENGTH (function) new_opname = (char *) alloca (IDENTIFIER_LENGTH (function)
+ strlen (argstring) + 1 + 1); + strlen (argstring) + 1 + 1);
sprintf (new_opname, argstring, sprintf (new_opname, argstring,
IDENTIFIER_POINTER (function)); IDENTIFIER_POINTER (function));
...@@ -3607,7 +3607,7 @@ warn_for_assignment (const char *msgid, const char *opname, tree function, ...@@ -3607,7 +3607,7 @@ warn_for_assignment (const char *msgid, const char *opname, tree function,
{ {
/* Function name unknown (call through ptr). */ /* Function name unknown (call through ptr). */
const char *const argnofun = _("passing arg of pointer to function"); const char *const argnofun = _("passing arg of pointer to function");
new_opname = alloca (strlen (argnofun) + 1 + 1); new_opname = (char *) alloca (strlen (argnofun) + 1 + 1);
sprintf (new_opname, argnofun); sprintf (new_opname, argnofun);
} }
} }
...@@ -3615,7 +3615,7 @@ warn_for_assignment (const char *msgid, const char *opname, tree function, ...@@ -3615,7 +3615,7 @@ warn_for_assignment (const char *msgid, const char *opname, tree function,
{ {
/* Function name is known; supply it. */ /* Function name is known; supply it. */
const char *const argstring = _("passing arg %d of `%s'"); const char *const argstring = _("passing arg %d of `%s'");
new_opname = alloca (IDENTIFIER_LENGTH (function) new_opname = (char *) alloca (IDENTIFIER_LENGTH (function)
+ strlen (argstring) + 1 + 25 /*%d*/ + 1); + strlen (argstring) + 1 + 25 /*%d*/ + 1);
sprintf (new_opname, argstring, argnum, sprintf (new_opname, argstring, argnum,
IDENTIFIER_POINTER (function)); IDENTIFIER_POINTER (function));
...@@ -3624,7 +3624,7 @@ warn_for_assignment (const char *msgid, const char *opname, tree function, ...@@ -3624,7 +3624,7 @@ warn_for_assignment (const char *msgid, const char *opname, tree function,
{ {
/* Function name unknown (call through ptr); just give arg number. */ /* Function name unknown (call through ptr); just give arg number. */
const char *const argnofun = _("passing arg %d of pointer to function"); const char *const argnofun = _("passing arg %d of pointer to function");
new_opname = alloca (strlen (argnofun) + 1 + 25 /*%d*/ + 1); new_opname = (char *) alloca (strlen (argnofun) + 1 + 25 /*%d*/ + 1);
sprintf (new_opname, argnofun, argnum); sprintf (new_opname, argnofun, argnum);
} }
opname = new_opname; opname = new_opname;
...@@ -3849,7 +3849,7 @@ error_init (const char *msgid) ...@@ -3849,7 +3849,7 @@ error_init (const char *msgid)
char *ofwhat; char *ofwhat;
error ("%s", _(msgid)); error ("%s", _(msgid));
ofwhat = print_spelling (alloca (spelling_length () + 1)); ofwhat = print_spelling ((char *) alloca (spelling_length () + 1));
if (*ofwhat) if (*ofwhat)
error ("(near initialization for `%s')", ofwhat); error ("(near initialization for `%s')", ofwhat);
} }
...@@ -3864,7 +3864,7 @@ pedwarn_init (const char *msgid) ...@@ -3864,7 +3864,7 @@ pedwarn_init (const char *msgid)
char *ofwhat; char *ofwhat;
pedwarn ("%s", _(msgid)); pedwarn ("%s", _(msgid));
ofwhat = print_spelling (alloca (spelling_length () + 1)); ofwhat = print_spelling ((char *) alloca (spelling_length () + 1));
if (*ofwhat) if (*ofwhat)
pedwarn ("(near initialization for `%s')", ofwhat); pedwarn ("(near initialization for `%s')", ofwhat);
} }
...@@ -3879,7 +3879,7 @@ warning_init (const char *msgid) ...@@ -3879,7 +3879,7 @@ warning_init (const char *msgid)
char *ofwhat; char *ofwhat;
warning ("%s", _(msgid)); warning ("%s", _(msgid));
ofwhat = print_spelling (alloca (spelling_length () + 1)); ofwhat = print_spelling ((char *) alloca (spelling_length () + 1));
if (*ofwhat) if (*ofwhat)
warning ("(near initialization for `%s')", ofwhat); warning ("(near initialization for `%s')", ofwhat);
} }
......
...@@ -67,7 +67,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA ...@@ -67,7 +67,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#ifndef ASM_FORMAT_PRIVATE_NAME #ifndef ASM_FORMAT_PRIVATE_NAME
# define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \ # define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
do { const char *const name_ = (NAME); \ do { const char *const name_ = (NAME); \
char *const output_ = (OUTPUT) = alloca (strlen (name_) + 32);\ char *const output_ = (OUTPUT) = \
(char *) alloca (strlen (name_) + 32); \
sprintf (output_, ASM_PN_FORMAT, name_, (unsigned long)(LABELNO)); \ sprintf (output_, ASM_PN_FORMAT, name_, (unsigned long)(LABELNO)); \
} while (0) } while (0)
#endif #endif
......
...@@ -42,8 +42,8 @@ static int print_md_constant (void **, void *); ...@@ -42,8 +42,8 @@ static int print_md_constant (void **, void *);
static int static int
print_md_constant (void **slot, void *info) print_md_constant (void **slot, void *info)
{ {
struct md_constant *def = *slot; struct md_constant *def = (struct md_constant *) *slot;
FILE *file = info; FILE *file = (FILE *) info;
fprintf (file, "#define %s %s\n", def->name, def->value); fprintf (file, "#define %s %s\n", def->name, def->value);
return 1; return 1;
......
...@@ -85,10 +85,11 @@ ITYPE {IWORD}({WS}{IWORD})* ...@@ -85,10 +85,11 @@ ITYPE {IWORD}({WS}{IWORD})*
is_pointer = 1; is_pointer = 1;
for (namelen = 1; ISIDNUM (namestart[namelen]); namelen++) for (namelen = 1; ISIDNUM (namestart[namelen]); namelen++)
; ;
t = find_structure (xmemdup (tagstart, taglen, taglen+1), union_p); t = find_structure ((const char *) xmemdup (tagstart, taglen, taglen+1),
union_p);
if (is_pointer) if (is_pointer)
t = create_pointer (t); t = create_pointer (t);
namestart = xmemdup (namestart, namelen, namelen+1); namestart = (char *) xmemdup (namestart, namelen, namelen+1);
#ifdef USE_MAPPED_LOCATION #ifdef USE_MAPPED_LOCATION
/* temporary kludge - gentype doesn't handle cpp conditionals */ /* temporary kludge - gentype doesn't handle cpp conditionals */
if (strcmp (namestart, "location_t") != 0 if (strcmp (namestart, "location_t") != 0
...@@ -115,13 +116,14 @@ ITYPE {IWORD}({WS}{IWORD})* ...@@ -115,13 +116,14 @@ ITYPE {IWORD}({WS}{IWORD})*
ISSPACE(*typestart); ISSPACE(*typestart);
typestart++) typestart++)
; ;
for (typelen = namestart - typestart; for (typelen = namestart - typestart;
ISSPACE(typestart[typelen-1]); ISSPACE (typestart[typelen-1]);
typelen--) typelen--)
; ;
t = create_scalar_type (typestart, typelen); t = create_scalar_type (typestart, typelen);
do_typedef (xmemdup (namestart, namelen, namelen+1), t, &lexer_line); do_typedef ((const char *) xmemdup (namestart, namelen, namelen+1), t,
&lexer_line);
update_lineno (yytext, yyleng); update_lineno (yytext, yyleng);
} }
...@@ -137,7 +139,8 @@ ITYPE {IWORD}({WS}{IWORD})* ...@@ -137,7 +139,8 @@ ITYPE {IWORD}({WS}{IWORD})*
namestart -= namelen - 1; namestart -= namelen - 1;
t = create_scalar_type ("function type", sizeof ("function type")-1); t = create_scalar_type ("function type", sizeof ("function type")-1);
do_typedef (xmemdup (namestart, namelen, namelen+1), t, &lexer_line); do_typedef ((const char *) xmemdup (namestart, namelen, namelen+1), t,
&lexer_line);
update_lineno (yytext, yyleng); update_lineno (yytext, yyleng);
} }
...@@ -153,7 +156,8 @@ ITYPE {IWORD}({WS}{IWORD})* ...@@ -153,7 +156,8 @@ ITYPE {IWORD}({WS}{IWORD})*
namestart -= namelen - 1; namestart -= namelen - 1;
t = create_scalar_type ("function type", sizeof ("function type")-1); t = create_scalar_type ("function type", sizeof ("function type")-1);
do_typedef (xmemdup (namestart, namelen, namelen+1), t, &lexer_line); do_typedef ((const char *) xmemdup (namestart, namelen, namelen+1), t,
&lexer_line);
update_lineno (yytext, yyleng); update_lineno (yytext, yyleng);
} }
...@@ -169,7 +173,8 @@ ITYPE {IWORD}({WS}{IWORD})* ...@@ -169,7 +173,8 @@ ITYPE {IWORD}({WS}{IWORD})*
namestart -= namelen - 1; namestart -= namelen - 1;
t = create_scalar_type ("function type", sizeof ("function type")-1); t = create_scalar_type ("function type", sizeof ("function type")-1);
do_typedef (xmemdup (namestart, namelen, namelen+1), t, &lexer_line); do_typedef ((const char *) xmemdup (namestart, namelen, namelen+1), t,
&lexer_line);
update_lineno (yytext, yyleng); update_lineno (yytext, yyleng);
} }
...@@ -185,7 +190,8 @@ ITYPE {IWORD}({WS}{IWORD})* ...@@ -185,7 +190,8 @@ ITYPE {IWORD}({WS}{IWORD})*
namestart -= namelen - 1; namestart -= namelen - 1;
t = create_scalar_type ("function type", sizeof ("function type")-1); t = create_scalar_type ("function type", sizeof ("function type")-1);
do_typedef (xmemdup (namestart, namelen, namelen+1), t, &lexer_line); do_typedef ((const char *) xmemdup (namestart, namelen, namelen+1), t,
&lexer_line);
update_lineno (yytext, yyleng); update_lineno (yytext, yyleng);
} }
...@@ -211,7 +217,9 @@ ITYPE {IWORD}({WS}{IWORD})* ...@@ -211,7 +217,9 @@ ITYPE {IWORD}({WS}{IWORD})*
for (taglen = 1; ISIDNUM (tagstart[taglen]); taglen++) for (taglen = 1; ISIDNUM (tagstart[taglen]); taglen++)
; ;
yylval.t = find_structure (xmemdup (tagstart, taglen, taglen + 1), union_p); yylval.t = find_structure ((const char *) xmemdup (tagstart, taglen,
taglen + 1),
union_p);
BEGIN(in_struct); BEGIN(in_struct);
update_lineno (yytext, yyleng); update_lineno (yytext, yyleng);
return typedef_p ? ENT_TYPEDEF_STRUCT : ENT_STRUCT; return typedef_p ? ENT_TYPEDEF_STRUCT : ENT_STRUCT;
...@@ -251,7 +259,7 @@ ITYPE {IWORD}({WS}{IWORD})* ...@@ -251,7 +259,7 @@ ITYPE {IWORD}({WS}{IWORD})*
push_macro_expansion (macro, macro_len, arg, arg_len); push_macro_expansion (macro, macro_len, arg, arg_len);
/* Create the struct and typedef. */ /* Create the struct and typedef. */
ptr = xmemdup ("VEC_", 4, 4 + arg_len + 1); ptr = (char *) xmemdup ("VEC_", 4, 4 + arg_len + 1);
memcpy (&ptr[4], arg, arg_len); memcpy (&ptr[4], arg, arg_len);
ptr[4 + arg_len] = 0; ptr[4 + arg_len] = 0;
t = find_structure (ptr, 0); t = find_structure (ptr, 0);
...@@ -276,8 +284,8 @@ ITYPE {IWORD}({WS}{IWORD})* ...@@ -276,8 +284,8 @@ ITYPE {IWORD}({WS}{IWORD})*
"ptr_alias"/[^[:alnum:]_] { return ALIAS; } "ptr_alias"/[^[:alnum:]_] { return ALIAS; }
"nested_ptr"/[^[:alnum:]_] { return NESTED_PTR; } "nested_ptr"/[^[:alnum:]_] { return NESTED_PTR; }
[0-9]+ { return NUM; } [0-9]+ { return NUM; }
"param"[0-9]*"_is"/[^[:alnum:]_] { "param"[0-9]*"_is"/[^[:alnum:]_] {
yylval.s = xmemdup (yytext, yyleng, yyleng+1); yylval.s = (const char *) xmemdup (yytext, yyleng, yyleng+1);
return PARAM_IS; return PARAM_IS;
} }
...@@ -308,7 +316,7 @@ ITYPE {IWORD}({WS}{IWORD})* ...@@ -308,7 +316,7 @@ ITYPE {IWORD}({WS}{IWORD})*
while (*ptr != ')' && !ISSPACE (*ptr)) while (*ptr != ')' && !ISSPACE (*ptr))
ptr++; ptr++;
arg_len = ptr - arg; arg_len = ptr - arg;
ptr = xmemdup (macro, macro_len, macro_len + arg_len + 2); ptr = (char *) xmemdup (macro, macro_len, macro_len + arg_len + 2);
ptr[macro_len] = '_'; ptr[macro_len] = '_';
memcpy (&ptr[macro_len+1], arg, arg_len); memcpy (&ptr[macro_len+1], arg, arg_len);
yylval.s = ptr; yylval.s = ptr;
...@@ -316,24 +324,24 @@ ITYPE {IWORD}({WS}{IWORD})* ...@@ -316,24 +324,24 @@ ITYPE {IWORD}({WS}{IWORD})*
} }
{ID}/[^[:alnum:]_] { {ID}/[^[:alnum:]_] {
yylval.s = xmemdup (yytext, yyleng, yyleng+1); yylval.s = (const char *) xmemdup (yytext, yyleng, yyleng+1);
return ID; return ID;
} }
\"([^"\\]|\\.)*\" { \"([^"\\]|\\.)*\" {
yylval.s = xmemdup (yytext+1, yyleng-2, yyleng-1); yylval.s = (const char *) xmemdup (yytext+1, yyleng-2, yyleng-1);
return STRING; return STRING;
} }
"["[^\[\]]*"]" { "["[^\[\]]*"]" {
yylval.s = xmemdup (yytext+1, yyleng-2, yyleng-1); yylval.s = (const char *) xmemdup (yytext+1, yyleng-2, yyleng-1);
return ARRAY; return ARRAY;
} }
^"%"{ID} { ^"%"{ID} {
yylval.s = xmemdup (yytext+1, yyleng-1, yyleng); yylval.s = (const char *) xmemdup (yytext+1, yyleng-1, yyleng);
return PERCENT_ID; return PERCENT_ID;
} }
"'"("\\".|[^\\])"'" { "'"("\\".|[^\\])"'" {
yylval.s = xmemdup (yytext+1, yyleng-2, yyleng); yylval.s = (const char *) xmemdup (yytext+1, yyleng-2, yyleng);
return CHAR; return CHAR;
} }
......
...@@ -703,7 +703,7 @@ calc_wider_mode (void) ...@@ -703,7 +703,7 @@ calc_wider_mode (void)
/* Allocate max_n_modes + 1 entries to leave room for the extra null /* Allocate max_n_modes + 1 entries to leave room for the extra null
pointer assigned after the qsort call below. */ pointer assigned after the qsort call below. */
sortbuf = alloca ((max_n_modes + 1) * sizeof (struct mode_data *)); sortbuf = (struct mode_data **) alloca ((max_n_modes + 1) * sizeof (struct mode_data *));
for (c = 0; c < MAX_MODE_CLASS; c++) for (c = 0; c < MAX_MODE_CLASS; c++)
{ {
......
...@@ -191,7 +191,7 @@ read_name (char *str, FILE *infile) ...@@ -191,7 +191,7 @@ read_name (char *str, FILE *infile)
struct md_constant tmp_def; struct md_constant tmp_def;
tmp_def.name = p; tmp_def.name = p;
def = htab_find (md_constants, &tmp_def); def = (struct md_constant *) htab_find (md_constants, &tmp_def);
if (def) if (def)
p = def->value; p = def->value;
} while (def); } while (def);
...@@ -277,7 +277,7 @@ read_quoted_string (struct obstack *ob, FILE *infile) ...@@ -277,7 +277,7 @@ read_quoted_string (struct obstack *ob, FILE *infile)
} }
obstack_1grow (ob, 0); obstack_1grow (ob, 0);
return obstack_finish (ob); return (char *) obstack_finish (ob);
} }
/* Read a braced string (a la Tcl) onto the obstack. Caller has /* Read a braced string (a la Tcl) onto the obstack. Caller has
...@@ -315,7 +315,7 @@ read_braced_string (struct obstack *ob, FILE *infile) ...@@ -315,7 +315,7 @@ read_braced_string (struct obstack *ob, FILE *infile)
} }
obstack_1grow (ob, 0); obstack_1grow (ob, 0);
return obstack_finish (ob); return (char *) obstack_finish (ob);
} }
/* Read some kind of string constant. This is the high-level routine /* Read some kind of string constant. This is the high-level routine
...@@ -455,7 +455,7 @@ read_constants (FILE *infile, char *tmp_char) ...@@ -455,7 +455,7 @@ read_constants (FILE *infile, char *tmp_char)
} }
else else
{ {
def = *entry_ptr; def = (struct md_constant *) *entry_ptr;
if (strcmp (def->value, tmp_char)) if (strcmp (def->value, tmp_char))
fatal_with_file_and_line (infile, fatal_with_file_and_line (infile,
"redefinition of %s, was %s, now %s", "redefinition of %s, was %s, now %s",
......
...@@ -177,7 +177,8 @@ rtx_alloc_stat (RTX_CODE code MEM_STAT_DECL) ...@@ -177,7 +177,8 @@ rtx_alloc_stat (RTX_CODE code MEM_STAT_DECL)
{ {
rtx rt; rtx rt;
rt = ggc_alloc_typed_stat (gt_ggc_e_7rtx_def, RTX_SIZE (code) PASS_MEM_STAT); rt = (rtx) ggc_alloc_typed_stat (gt_ggc_e_7rtx_def,
RTX_SIZE (code) PASS_MEM_STAT);
/* We want to clear everything up to the FLD array. Normally, this /* We want to clear everything up to the FLD array. Normally, this
is one int, but we don't want to assume that and it isn't very is one int, but we don't want to assume that and it isn't very
...@@ -311,8 +312,8 @@ shallow_copy_rtx_stat (rtx orig MEM_STAT_DECL) ...@@ -311,8 +312,8 @@ shallow_copy_rtx_stat (rtx orig MEM_STAT_DECL)
{ {
rtx copy; rtx copy;
copy = ggc_alloc_typed_stat (gt_ggc_e_7rtx_def, RTX_SIZE (GET_CODE (orig)) copy = (rtx) ggc_alloc_typed_stat (gt_ggc_e_7rtx_def,
PASS_MEM_STAT); RTX_SIZE (GET_CODE (orig)) PASS_MEM_STAT);
memcpy (copy, orig, RTX_SIZE (GET_CODE (orig))); memcpy (copy, orig, RTX_SIZE (GET_CODE (orig)));
return copy; return copy;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment