Commit 4dc6c528 by Kaveh R. Ghazi Committed by Kaveh Ghazi

alloc-pool.c (create_alloc_pool): Fix -Wc++-compat warnings.

	* alloc-pool.c (create_alloc_pool): Fix -Wc++-compat warnings.
	* df-scan.c (df_notes_rescan): Likewise.
	* ggc-page.c (set_page_table_entry): Likewise.
	* intl.c (gcc_gettext_width): Likewise.
	* varasm.c (get_unnamed_section, get_noswitch_section,
	get_section): Likewise.

From-SVN: r137245
parent 4152a484
2008-06-29 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* alloc-pool.c (create_alloc_pool): Fix -Wc++-compat warnings.
* df-scan.c (df_notes_rescan): Likewise.
* ggc-page.c (set_page_table_entry): Likewise.
* intl.c (gcc_gettext_width): Likewise.
* varasm.c (get_unnamed_section, get_noswitch_section,
get_section): Likewise.
2008-06-28 Andrew Jenner <andrew@codesourcery.com> 2008-06-28 Andrew Jenner <andrew@codesourcery.com>
* regrename.c (build_def_use): Don't copy RTX. * regrename.c (build_def_use): Don't copy RTX.
......
...@@ -119,7 +119,7 @@ alloc_pool ...@@ -119,7 +119,7 @@ alloc_pool
create_alloc_pool (const char *name, size_t size, size_t num) create_alloc_pool (const char *name, size_t size, size_t num)
{ {
alloc_pool pool; alloc_pool pool;
size_t pool_size, header_size; size_t header_size;
#ifdef GATHER_STATISTICS #ifdef GATHER_STATISTICS
struct alloc_pool_descriptor *desc; struct alloc_pool_descriptor *desc;
#endif #endif
...@@ -141,11 +141,8 @@ create_alloc_pool (const char *name, size_t size, size_t num) ...@@ -141,11 +141,8 @@ create_alloc_pool (const char *name, size_t size, size_t num)
/* Um, we can't really allocate 0 elements per block. */ /* Um, we can't really allocate 0 elements per block. */
gcc_assert (num); gcc_assert (num);
/* Find the size of the pool structure, and the name. */ /* Allocate memory for the pool structure. */
pool_size = sizeof (struct alloc_pool_def); pool = XNEW (struct alloc_pool_def);
/* and allocate that much memory. */
pool = xmalloc (pool_size);
/* Now init the various pieces of our pool structure. */ /* Now init the various pieces of our pool structure. */
pool->name = /*xstrdup (name)*/name; pool->name = /*xstrdup (name)*/name;
......
...@@ -2082,9 +2082,9 @@ df_notes_rescan (rtx insn) ...@@ -2082,9 +2082,9 @@ df_notes_rescan (rtx insn)
if (collection_rec.next_mw > num_deleted) if (collection_rec.next_mw > num_deleted)
{ {
insn_info->mw_hardregs = insn_info->mw_hardregs =
xrealloc (insn_info->mw_hardregs, XRESIZEVEC (struct df_mw_hardreg *,
(count + 1 + collection_rec.next_mw) insn_info->mw_hardregs,
* sizeof (struct df_ref*)); count + 1 + collection_rec.next_mw);
} }
memcpy (&insn_info->mw_hardregs[count], collection_rec.mw_vec, memcpy (&insn_info->mw_hardregs[count], collection_rec.mw_vec,
(collection_rec.next_mw + 1) * sizeof (struct df_mw_hardreg *)); (collection_rec.next_mw + 1) * sizeof (struct df_mw_hardreg *));
......
...@@ -610,7 +610,7 @@ set_page_table_entry (void *p, page_entry *entry) ...@@ -610,7 +610,7 @@ set_page_table_entry (void *p, page_entry *entry)
goto found; goto found;
/* Not found -- allocate a new table. */ /* Not found -- allocate a new table. */
table = xcalloc (1, sizeof(*table)); table = XCNEW (struct page_table_chain);
table->next = G.lookup; table->next = G.lookup;
table->high_bits = high_bits; table->high_bits = high_bits;
G.lookup = table; G.lookup = table;
......
...@@ -91,7 +91,7 @@ size_t ...@@ -91,7 +91,7 @@ size_t
gcc_gettext_width (const char *msgstr) gcc_gettext_width (const char *msgstr)
{ {
size_t nwcs = mbstowcs (0, msgstr, 0); size_t nwcs = mbstowcs (0, msgstr, 0);
wchar_t *wmsgstr = alloca ((nwcs + 1) * sizeof (wchar_t)); wchar_t *wmsgstr = XALLOCAVEC (wchar_t, nwcs + 1);
mbstowcs (wmsgstr, msgstr, nwcs + 1); mbstowcs (wmsgstr, msgstr, nwcs + 1);
return wcswidth (wmsgstr, nwcs); return wcswidth (wmsgstr, nwcs);
......
...@@ -518,7 +518,7 @@ get_unnamed_section (unsigned int flags, void (*callback) (const void *), ...@@ -518,7 +518,7 @@ get_unnamed_section (unsigned int flags, void (*callback) (const void *),
{ {
section *sect; section *sect;
sect = ggc_alloc (sizeof (struct unnamed_section)); sect = GGC_NEW (section);
sect->unnamed.common.flags = flags | SECTION_UNNAMED; sect->unnamed.common.flags = flags | SECTION_UNNAMED;
sect->unnamed.callback = callback; sect->unnamed.callback = callback;
sect->unnamed.data = data; sect->unnamed.data = data;
...@@ -535,7 +535,7 @@ get_noswitch_section (unsigned int flags, noswitch_section_callback callback) ...@@ -535,7 +535,7 @@ get_noswitch_section (unsigned int flags, noswitch_section_callback callback)
{ {
section *sect; section *sect;
sect = ggc_alloc (sizeof (struct unnamed_section)); sect = GGC_NEW (section);
sect->noswitch.common.flags = flags | SECTION_NOSWITCH; sect->noswitch.common.flags = flags | SECTION_NOSWITCH;
sect->noswitch.callback = callback; sect->noswitch.callback = callback;
...@@ -556,7 +556,7 @@ get_section (const char *name, unsigned int flags, tree decl) ...@@ -556,7 +556,7 @@ get_section (const char *name, unsigned int flags, tree decl)
flags |= SECTION_NAMED; flags |= SECTION_NAMED;
if (*slot == NULL) if (*slot == NULL)
{ {
sect = ggc_alloc (sizeof (struct named_section)); sect = GGC_NEW (section);
sect->named.common.flags = flags; sect->named.common.flags = flags;
sect->named.name = ggc_strdup (name); sect->named.name = ggc_strdup (name);
sect->named.decl = decl; sect->named.decl = decl;
......
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