* 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
+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.
/* These fields are used by bb-reorder pass. */
int visited;
-} *reorder_block_def;
+} *reorder_block_def_p;
#define BB_FREQ_MAX 10000
int len = strlen (name) + 3; /* Two for '"'s. One for NULL. */
cpp_string cstr = { 0, 0 }, strname;
- namep = xmalloc (len);
+ namep = XNEWVEC (char, len);
snprintf (namep, len, "\"%s\"", name);
strname.text = (unsigned char *) namep;
strname.len = len - 1;
if (tlist_firstobj == 0)
{
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);
}
else
{
- if (op == SIZEOF_EXPR)
+ if (op == (enum tree_code) SIZEOF_EXPR)
/* Convert in case a char is more than one unit. */
value = size_binop (CEIL_DIV_EXPR, TYPE_SIZE_UNIT (type),
size_int (TYPE_PRECISION (char_type_node)
match_case_to_enum (splay_tree_node node, void *data)
{
tree label = (tree) node->value;
- tree type = data;
+ tree type = (tree) data;
/* Skip default case. */
if (!CASE_LOW (label))
if (len > 4 && p[0] == '_' && p[1] == '_'
&& p[len - 1] == '_' && p[len - 2] == '_')
{
- char *newp = alloca (len - 1);
+ char *newp = (char *) alloca (len - 1);
strcpy (newp, &p[2]);
newp[len - 4] = '\0';
int
field_decl_cmp (const void *x_p, const void *y_p)
{
- const tree *const x = x_p;
- const tree *const y = y_p;
+ const tree *const x = (const tree *const) x_p;
+ const tree *const y = (const tree *const) y_p;
+
if (DECL_NAME (*x) == DECL_NAME (*y))
/* A nontype is "greater" than a type. */
return (TREE_CODE (*y) == TYPE_DECL) - (TREE_CODE (*x) == TYPE_DECL);
static int
resort_field_decl_cmp (const void *x_p, const void *y_p)
{
- const tree *const x = x_p;
- const tree *const y = y_p;
+ const tree *const x = (const tree *const) x_p;
+ const tree *const y = (const tree *const) y_p;
if (DECL_NAME (*x) == DECL_NAME (*y))
/* A nontype is "greater" than a type. */
{
/* ASMSPEC is given, and not the name of a register. Mark the
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] = '*';
strcpy (starred + 1, asmspec);
if (dollar_arguments_pointer_p)
free (dollar_arguments_pointer_p);
dollar_arguments_alloc = dollar_arguments_count;
- dollar_arguments_used = xmalloc (dollar_arguments_alloc);
- dollar_arguments_pointer_p = xmalloc (dollar_arguments_alloc);
+ dollar_arguments_used = XNEWVEC (char, dollar_arguments_alloc);
+ dollar_arguments_pointer_p = XNEWVEC (char, dollar_arguments_alloc);
}
if (dollar_arguments_alloc)
{
{
int nalloc;
nalloc = 2 * dollar_arguments_alloc + 16;
- dollar_arguments_used = xrealloc (dollar_arguments_used, nalloc);
- dollar_arguments_pointer_p = xrealloc (dollar_arguments_pointer_p,
- nalloc);
+ dollar_arguments_used = XRESIZEVEC (char, dollar_arguments_used,
+ nalloc);
+ dollar_arguments_pointer_p = XRESIZEVEC (char, dollar_arguments_pointer_p,
+ nalloc);
memset (dollar_arguments_used + dollar_arguments_alloc, 0,
nalloc - dollar_arguments_alloc);
dollar_arguments_alloc = nalloc;
check_format_arg (void *ctx, tree format_tree,
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;
function_format_info *info = format_ctx->info;
tree params = format_ctx->params;
abort ();
/* 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));
init_dynamic_diag_info (void)
{
static tree t, loc, hwi;
-
+
if (!loc || !t || !hwi)
{
static format_char_info *diag_fci, *cdiag_fci, *cxxdiag_fci;
dynamic_format_types[gcc_diag_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 =
- 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));
if (hwi)
/* Handle the __gcc_diag__ format specifics. */
if (! diag_fci)
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));
if (loc)
/* Handle the __gcc_cdiag__ format specifics. */
if (! cdiag_fci)
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));
if (loc)
/* Handle the __gcc_cxxdiag__ format specifics. */
if (! cxxdiag_fci)
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));
if (loc)
/* Our first time through, we have to make sure that our
format_type data is allocated dynamically and is modifiable. */
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),
sizeof (format_types_orig));
/* I or J suffix. */
copylen--;
- copy = alloca (copylen + 1);
+ copy = (char *) alloca (copylen + 1);
memcpy (copy, token->val.str.text, copylen);
copy[copylen] = '\0';
}
}
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. */
const char *id = IDENTIFIER_POINTER (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 + plen, id, ilen + 1);
{
/* Function name is known; supply it. */
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);
sprintf (new_opname, argstring,
IDENTIFIER_POINTER (function));
{
/* Function name unknown (call through ptr). */
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);
}
}
{
/* Function name is known; supply it. */
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);
sprintf (new_opname, argstring, argnum,
IDENTIFIER_POINTER (function));
{
/* Function name unknown (call through ptr); just give arg number. */
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);
}
opname = new_opname;
char *ofwhat;
error ("%s", _(msgid));
- ofwhat = print_spelling (alloca (spelling_length () + 1));
+ ofwhat = print_spelling ((char *) alloca (spelling_length () + 1));
if (*ofwhat)
error ("(near initialization for `%s')", ofwhat);
}
char *ofwhat;
pedwarn ("%s", _(msgid));
- ofwhat = print_spelling (alloca (spelling_length () + 1));
+ ofwhat = print_spelling ((char *) alloca (spelling_length () + 1));
if (*ofwhat)
pedwarn ("(near initialization for `%s')", ofwhat);
}
char *ofwhat;
warning ("%s", _(msgid));
- ofwhat = print_spelling (alloca (spelling_length () + 1));
+ ofwhat = print_spelling ((char *) alloca (spelling_length () + 1));
if (*ofwhat)
warning ("(near initialization for `%s')", ofwhat);
}
#ifndef ASM_FORMAT_PRIVATE_NAME
# define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
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)); \
} while (0)
#endif
static int
print_md_constant (void **slot, void *info)
{
- struct md_constant *def = *slot;
- FILE *file = info;
+ struct md_constant *def = (struct md_constant *) *slot;
+ FILE *file = (FILE *) info;
fprintf (file, "#define %s %s\n", def->name, def->value);
return 1;
is_pointer = 1;
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)
t = create_pointer (t);
- namestart = xmemdup (namestart, namelen, namelen+1);
+ namestart = (char *) xmemdup (namestart, namelen, namelen+1);
#ifdef USE_MAPPED_LOCATION
/* temporary kludge - gentype doesn't handle cpp conditionals */
if (strcmp (namestart, "location_t") != 0
ISSPACE(*typestart);
typestart++)
;
- for (typelen = namestart - typestart;
- ISSPACE(typestart[typelen-1]);
+ for (typelen = namestart - typestart;
+ ISSPACE (typestart[typelen-1]);
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);
}
namestart -= namelen - 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);
}
namestart -= namelen - 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);
}
namestart -= namelen - 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);
}
namestart -= namelen - 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);
}
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);
update_lineno (yytext, yyleng);
return typedef_p ? ENT_TYPEDEF_STRUCT : ENT_STRUCT;
push_macro_expansion (macro, macro_len, arg, arg_len);
/* 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);
ptr[4 + arg_len] = 0;
t = find_structure (ptr, 0);
"ptr_alias"/[^[:alnum:]_] { return ALIAS; }
"nested_ptr"/[^[:alnum:]_] { return NESTED_PTR; }
[0-9]+ { return NUM; }
-"param"[0-9]*"_is"/[^[:alnum:]_] {
- yylval.s = xmemdup (yytext, yyleng, yyleng+1);
+"param"[0-9]*"_is"/[^[:alnum:]_] {
+ yylval.s = (const char *) xmemdup (yytext, yyleng, yyleng+1);
return PARAM_IS;
}
while (*ptr != ')' && !ISSPACE (*ptr))
ptr++;
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] = '_';
memcpy (&ptr[macro_len+1], arg, arg_len);
yylval.s = ptr;
}
{ID}/[^[:alnum:]_] {
- yylval.s = xmemdup (yytext, yyleng, yyleng+1);
+ yylval.s = (const char *) xmemdup (yytext, yyleng, yyleng+1);
return ID;
}
\"([^"\\]|\\.)*\" {
- yylval.s = xmemdup (yytext+1, yyleng-2, yyleng-1);
+ yylval.s = (const char *) xmemdup (yytext+1, yyleng-2, yyleng-1);
return STRING;
}
"["[^\[\]]*"]" {
- yylval.s = xmemdup (yytext+1, yyleng-2, yyleng-1);
+ yylval.s = (const char *) xmemdup (yytext+1, yyleng-2, yyleng-1);
return ARRAY;
}
^"%"{ID} {
- yylval.s = xmemdup (yytext+1, yyleng-1, yyleng);
+ yylval.s = (const char *) xmemdup (yytext+1, yyleng-1, yyleng);
return PERCENT_ID;
}
"'"("\\".|[^\\])"'" {
- yylval.s = xmemdup (yytext+1, yyleng-2, yyleng);
+ yylval.s = (const char *) xmemdup (yytext+1, yyleng-2, yyleng);
return CHAR;
}
/* Allocate max_n_modes + 1 entries to leave room for the extra null
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++)
{
struct md_constant tmp_def;
tmp_def.name = p;
- def = htab_find (md_constants, &tmp_def);
+ def = (struct md_constant *) htab_find (md_constants, &tmp_def);
if (def)
p = def->value;
} while (def);
}
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
}
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
}
else
{
- def = *entry_ptr;
+ def = (struct md_constant *) *entry_ptr;
if (strcmp (def->value, tmp_char))
fatal_with_file_and_line (infile,
"redefinition of %s, was %s, now %s",
{
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
is one int, but we don't want to assume that and it isn't very
{
rtx copy;
- copy = ggc_alloc_typed_stat (gt_ggc_e_7rtx_def, RTX_SIZE (GET_CODE (orig))
- PASS_MEM_STAT);
+ copy = (rtx) ggc_alloc_typed_stat (gt_ggc_e_7rtx_def,
+ RTX_SIZE (GET_CODE (orig)) PASS_MEM_STAT);
memcpy (copy, orig, RTX_SIZE (GET_CODE (orig)));
return copy;
}