]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
* alloc-pool.c (create_alloc_pool): Fix -Wc++-compat warnings.
authorghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 29 Jun 2008 04:39:16 +0000 (04:39 +0000)
committerghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 29 Jun 2008 04:39:16 +0000 (04:39 +0000)
* 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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@137245 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/alloc-pool.c
gcc/df-scan.c
gcc/ggc-page.c
gcc/intl.c
gcc/varasm.c

index c91e67f9032a390f79ecd55ca6ade8e6107cdbb1..1b0727bea14d9a9a1349222e44c8cf04a724daf9 100644 (file)
@@ -1,3 +1,12 @@
+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>
 
        * regrename.c (build_def_use): Don't copy RTX.
index d5d1fab79afc38a57f7bf7bbbf36452283d18a33..b22869fe787e8a5bd205fd1920659da83572bd84 100644 (file)
@@ -119,7 +119,7 @@ alloc_pool
 create_alloc_pool (const char *name, size_t size, size_t num)
 {
   alloc_pool pool;
-  size_t pool_size, header_size;
+  size_t header_size;
 #ifdef GATHER_STATISTICS
   struct alloc_pool_descriptor *desc;
 #endif
@@ -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.  */
   gcc_assert (num);
 
-  /* Find the size of the pool structure, and the name.  */
-  pool_size = sizeof (struct alloc_pool_def);
-
-  /* and allocate that much memory.  */
-  pool = xmalloc (pool_size);
+  /* Allocate memory for the pool structure.  */
+  pool = XNEW (struct alloc_pool_def);
 
   /* Now init the various pieces of our pool structure.  */
   pool->name = /*xstrdup (name)*/name;
index 87dda3a7b2c90ab24b0820218b11209800e4a7fa..092273faa3bfefea510b24ef35171868a32f7813 100644 (file)
@@ -2082,9 +2082,9 @@ df_notes_rescan (rtx insn)
              if (collection_rec.next_mw > num_deleted)
                {
                  insn_info->mw_hardregs = 
-                   xrealloc (insn_info->mw_hardregs, 
-                             (count + 1 + collection_rec.next_mw) 
-                             * sizeof (struct df_ref*));
+                   XRESIZEVEC (struct df_mw_hardreg *,
+                               insn_info->mw_hardregs, 
+                               count + 1 + collection_rec.next_mw);
                }
              memcpy (&insn_info->mw_hardregs[count], collection_rec.mw_vec, 
                      (collection_rec.next_mw + 1) * sizeof (struct df_mw_hardreg *));
index 14e0776a1a649004be240309fb40392cf919754e..4ac73d4af4f314a46e80c75dfe743c695ac60fb4 100644 (file)
@@ -610,7 +610,7 @@ set_page_table_entry (void *p, page_entry *entry)
       goto found;
 
   /* Not found -- allocate a new table.  */
-  table = xcalloc (1, sizeof(*table));
+  table = XCNEW (struct page_table_chain);
   table->next = G.lookup;
   table->high_bits = high_bits;
   G.lookup = table;
index f76dbada97b45517737f5fd9432941cffa005b56..dfc015d2123e9e9b5a5d94345f4b6b926a7bcfe8 100644 (file)
@@ -91,7 +91,7 @@ size_t
 gcc_gettext_width (const char *msgstr)
 {
   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);
   return wcswidth (wmsgstr, nwcs);
index f8390a43bc878c839976f248cf1188c00cc1069c..d8c611444d350c1a5f74a9c8650ebf91277d938a 100644 (file)
@@ -518,7 +518,7 @@ get_unnamed_section (unsigned int flags, void (*callback) (const void *),
 {
   section *sect;
 
-  sect = ggc_alloc (sizeof (struct unnamed_section));
+  sect = GGC_NEW (section);
   sect->unnamed.common.flags = flags | SECTION_UNNAMED;
   sect->unnamed.callback = callback;
   sect->unnamed.data = data;
@@ -535,7 +535,7 @@ get_noswitch_section (unsigned int flags, noswitch_section_callback callback)
 {
   section *sect;
 
-  sect = ggc_alloc (sizeof (struct unnamed_section));
+  sect = GGC_NEW (section);
   sect->noswitch.common.flags = flags | SECTION_NOSWITCH;
   sect->noswitch.callback = callback;
 
@@ -556,7 +556,7 @@ get_section (const char *name, unsigned int flags, tree decl)
   flags |= SECTION_NAMED;
   if (*slot == NULL)
     {
-      sect = ggc_alloc (sizeof (struct named_section));
+      sect = GGC_NEW (section);
       sect->named.common.flags = flags;
       sect->named.name = ggc_strdup (name);
       sect->named.decl = decl;