]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
call.c (alloc_conversion): Use cast when converting from void *.
authorGabriel Dos Reis <gdr@integrable-solutions.net>
Sun, 29 Jan 2006 09:10:48 +0000 (09:10 +0000)
committerGabriel Dos Reis <gdr@gcc.gnu.org>
Sun, 29 Jan 2006 09:10:48 +0000 (09:10 +0000)
        * call.c (alloc_conversion): Use cast when converting from
void *.
        (alloc_conversions): Likewise.
        (add_candidate): Likewise.
        (print_z_candidates): Likewise.
        (add_warning): Likewise.
        * pt.c (retrieve_local_specialization): Likewise.
        (process_partial_specialization): Likewise.
        (mangle_class_name_for_template): Likewise.
        (tsubst_template_args): Likewise.
        * typeck2.c (pat_calc_hash): Likewise.
        (pat_compare): Likewise.
        (abstract_virtuals_error): Likewise.
        * class.c (method_name_cmp): Likewise.
        (resort_method_name_cmp): Likewise.
        (get_vfield_name): Likewise.
        * decl2.c (generate_ctor_and_dtor_functions_for_priority):
Likewise.
        * lex.c (init_reswords): Likewise.
        * rtti.c (create_pseudo_type_info): Likewise.
        * search.c (dfs_lookup_base): Likewise.
        (dfs_dcast_hint_pre): Likewise.
        (dfs_dcast_hint_post): Likewise.
        * tree.c (hash_tree_cons): Likewise.
        * repo.c (extract_string): Likewise.
        (afgets): Likewise.
        * cp-objcp-common.c (decl_shadowed_for_var_lookup): Likewise.
        * g++spec.c (lang_specific_driver): Likewise.

From-SVN: r110366

12 files changed:
gcc/cp/ChangeLog
gcc/cp/call.c
gcc/cp/class.c
gcc/cp/cp-objcp-common.c
gcc/cp/decl2.c
gcc/cp/g++spec.c
gcc/cp/lex.c
gcc/cp/pt.c
gcc/cp/rtti.c
gcc/cp/search.c
gcc/cp/tree.c
gcc/cp/typeck2.c

index b9e22d6b3465aba363cee28476659d36f733b888..05d7756d0579d7e96fee8cdb8a18350d3d287358 100644 (file)
@@ -1,3 +1,32 @@
+2006-01-29  Gabriel Dos Reis  <gdr@integrable-solutions.net>
+
+       * call.c (alloc_conversion): Use cast when converting from void *.
+       (alloc_conversions): Likewise.
+       (add_candidate): Likewise.
+       (print_z_candidates): Likewise.
+       (add_warning): Likewise.
+       * pt.c (retrieve_local_specialization): Likewise.
+       (process_partial_specialization): Likewise.
+       (mangle_class_name_for_template): Likewise.
+       (tsubst_template_args): Likewise.
+       * typeck2.c (pat_calc_hash): Likewise.
+       (pat_compare): Likewise.
+       (abstract_virtuals_error): Likewise.
+       * class.c (method_name_cmp): Likewise.
+       (resort_method_name_cmp): Likewise.
+       (get_vfield_name): Likewise.
+       * decl2.c (generate_ctor_and_dtor_functions_for_priority): Likewise.
+       * lex.c (init_reswords): Likewise.
+       * rtti.c (create_pseudo_type_info): Likewise.
+       * search.c (dfs_lookup_base): Likewise.
+       (dfs_dcast_hint_pre): Likewise.
+       (dfs_dcast_hint_post): Likewise.
+       * tree.c (hash_tree_cons): Likewise.
+       * repo.c (extract_string): Likewise.
+       (afgets): Likewise.
+       * cp-objcp-common.c (decl_shadowed_for_var_lookup): Likewise.
+       * g++spec.c (lang_specific_driver): Likewise.
+
 2006-01-28  Gabriel Dos Reis  <gdr@integrable-solutions.net>
 
        * class.c (check_bases): Likewise.
index 2fc5c5762917218ebe6186920be8d8431c653a11..b5998fa13e54e62c28fbc40bbb45c9e766501f2f 100644 (file)
@@ -468,7 +468,7 @@ static conversion *
 alloc_conversion (conversion_kind kind)
 {
   conversion *c;
-  c = conversion_obstack_alloc (sizeof (conversion));
+  c = (conversion *) conversion_obstack_alloc (sizeof (conversion));
   c->kind = kind;
   return c;
 }
@@ -493,7 +493,7 @@ validate_conversion_obstack (void)
 static conversion **
 alloc_conversions (size_t n)
 {
-  return conversion_obstack_alloc (n * sizeof (conversion *));
+  return (conversion **) conversion_obstack_alloc (n * sizeof (conversion *));
 }
 
 static conversion *
@@ -1269,8 +1269,8 @@ add_candidate (struct z_candidate **candidates,
               tree access_path, tree conversion_path,
               int viable)
 {
-  struct z_candidate *cand
-    conversion_obstack_alloc (sizeof (struct z_candidate));
+  struct z_candidate *cand = (struct z_candidate *)
+    conversion_obstack_alloc (sizeof (struct z_candidate));
 
   cand->fn = fn;
   cand->args = args;
@@ -2442,7 +2442,7 @@ print_z_candidates (struct z_candidate *candidates)
       /* Indent successive candidates by the width of the translation
         of the above string.  */
       size_t len = gcc_gettext_width (str) + 1;
-      char *spaces = alloca (len);
+      char *spaces = (char *) alloca (len);
       memset (spaces, ' ', len-1);
       spaces[len - 1] = '\0';
 
@@ -5931,9 +5931,8 @@ source_type (conversion *t)
 static void
 add_warning (struct z_candidate *winner, struct z_candidate *loser)
 {
-  candidate_warning *cw;
-
-  cw = conversion_obstack_alloc (sizeof (candidate_warning));
+  candidate_warning *cw = (candidate_warning *)
+    conversion_obstack_alloc (sizeof (candidate_warning));
   cw->loser = loser;
   cw->next = winner->warnings;
   winner->warnings = cw;
index 275cbced9c9d3726dfe343c245630e01301b758c..fd50f1733f69f265da3c4034ffb22785aca9e15c 100644 (file)
@@ -1617,8 +1617,8 @@ static struct {
 static int
 method_name_cmp (const void* m1_p, const void* m2_p)
 {
-  const tree *const m1 = m1_p;
-  const tree *const m2 = m2_p;
+  const tree *const m1 = (const tree *) m1_p;
+  const tree *const m2 = (const tree *) m2_p;
 
   if (*m1 == NULL_TREE && *m2 == NULL_TREE)
     return 0;
@@ -1637,8 +1637,8 @@ method_name_cmp (const void* m1_p, const void* m2_p)
 static int
 resort_method_name_cmp (const void* m1_p, const void* m2_p)
 {
-  const tree *const m1 = m1_p;
-  const tree *const m2 = m2_p;
+  const tree *const m1 = (const tree *) m1_p;
+  const tree *const m2 = (const tree *) m2_p;
   if (*m1 == NULL_TREE && *m2 == NULL_TREE)
     return 0;
   if (*m1 == NULL_TREE)
@@ -6194,7 +6194,8 @@ get_vfield_name (tree type)
     }
 
   type = BINFO_TYPE (binfo);
-  buf = alloca (sizeof (VFIELD_NAME_FORMAT) + TYPE_NAME_LENGTH (type) + 2);
+  buf = (char *) alloca (sizeof (VFIELD_NAME_FORMAT)
+                         + TYPE_NAME_LENGTH (type) + 2);
   sprintf (buf, VFIELD_NAME_FORMAT,
           IDENTIFIER_POINTER (constructor_name (type)));
   return get_identifier (buf);
index 7a4d862336c82a1b03e15cbf1c507376c3fd5184..8dae00f742a88ce5d0dacd0aba40ca506bda1098 100644 (file)
@@ -214,8 +214,8 @@ decl_shadowed_for_var_lookup (tree from)
   struct tree_map *h, in;
   in.from = from;
 
-  h = htab_find_with_hash (shadowed_var_for_decl, &in, 
-                          htab_hash_pointer (from));
+  h = (struct tree_map *) htab_find_with_hash (shadowed_var_for_decl, &in, 
+                                               htab_hash_pointer (from));
   if (h)
     return h->to;
   return NULL_TREE;
index 637ac8c9de70ea81f003197184f0d863ee2f37e3..be9f326b156035a7df87b197a8253e29786129f0 100644 (file)
@@ -2683,7 +2683,7 @@ generate_ctor_or_dtor_function (bool constructor_p, int priority,
 static int
 generate_ctor_and_dtor_functions_for_priority (splay_tree_node n, void * data)
 {
-  location_t *locus = data;
+  location_t *locus = (location_t *) data;
   int priority = (int) n->key;
   priority_info pi = (priority_info) n->value;
 
index 43f429f8f8b3026de8fba32936f0dff47e7b1ac3..7e10bc9996f99dcb7d81926bac5daaa8a719b983 100644 (file)
@@ -113,7 +113,7 @@ lang_specific_driver (int *in_argc, const char *const **in_argv,
   argv = *in_argv;
   added_libraries = *in_added_libraries;
 
-  args = xcalloc (argc, sizeof (int));
+  args = XCNEWVEC (int, argc);
 
   for (i = 1; i < argc; i++)
     {
index a8004326564a8b39d02c2564d3453b9acc0e03b8..b3d8b608f75867463f3d7b03b15b2ee2a9bade29 100644 (file)
@@ -316,7 +316,7 @@ init_reswords (void)
              | D_OBJC
              | (flag_no_gnu_keywords ? D_EXT : 0));
 
-  ridpointers = ggc_calloc ((int) RID_MAX, sizeof (tree));
+  ridpointers = GGC_CNEWVEC (tree, (int) RID_MAX);
   for (i = 0; i < ARRAY_SIZE (reswords); i++)
     {
       id = get_identifier (reswords[i].word);
index e02cca47dc062025e61492c9a2081388f65e4f6a..c8c470e901849e2808a4cac89aaab51b91e02371 100644 (file)
@@ -899,8 +899,8 @@ retrieve_specialization (tree tmpl, tree args,
 static tree
 retrieve_local_specialization (tree tmpl)
 {
-  tree spec = htab_find_with_hash (local_specializations, tmpl,
-                                  htab_hash_pointer (tmpl));
+  tree spec = (tree) htab_find_with_hash (local_specializations, tmpl,
+                                          htab_hash_pointer (tmpl));
   return spec ? TREE_PURPOSE (spec) : NULL_TREE;
 }
 
@@ -2635,10 +2635,10 @@ process_partial_specialization (tree decl)
 
      or some such would have been OK.  */
   tpd.level = TMPL_PARMS_DEPTH (current_template_parms);
-  tpd.parms = alloca (sizeof (int) * ntparms);
+  tpd.parms = (int *) alloca (sizeof (int) * ntparms);
   memset (tpd.parms, 0, sizeof (int) * ntparms);
 
-  tpd.arg_uses_template_parms = alloca (sizeof (int) * nargs);
+  tpd.arg_uses_template_parms = (int *) alloca (sizeof (int) * nargs);
   memset (tpd.arg_uses_template_parms, 0, sizeof (int) * nargs);
   for (i = 0; i < nargs; ++i)
     {
@@ -2709,11 +2709,11 @@ process_partial_specialization (tree decl)
                {
                  /* We haven't yet initialized TPD2.  Do so now.  */
                  tpd2.arg_uses_template_parms
-                   = alloca (sizeof (int) * nargs);
+                   = (int *) alloca (sizeof (int) * nargs);
                  /* The number of parameters here is the number in the
                     main template, which, as checked in the assertion
                     above, is NARGS.  */
-                 tpd2.parms = alloca (sizeof (int) * nargs);
+                 tpd2.parms = (int *) alloca (sizeof (int) * nargs);
                  tpd2.level =
                    TMPL_PARMS_DEPTH (DECL_TEMPLATE_PARMS (maintmpl));
                }
@@ -4123,7 +4123,7 @@ mangle_class_name_for_template (const char* name, tree parms, tree arglist)
     gcc_obstack_init (&scratch_obstack);
   else
     obstack_free (&scratch_obstack, scratch_firstobj);
-  scratch_firstobj = obstack_alloc (&scratch_obstack, 1);
+  scratch_firstobj = (char *) obstack_alloc (&scratch_obstack, 1);
 
 #define ccat(C)        obstack_1grow (&scratch_obstack, (C));
 #define cat(S) obstack_grow (&scratch_obstack, (S), strlen (S))
@@ -5981,7 +5981,7 @@ tsubst_template_args (tree t, tree args, tsubst_flags_t complain, tree in_decl)
 {
   int len = TREE_VEC_LENGTH (t);
   int need_new = 0, i;
-  tree *elts = alloca (len * sizeof (tree));
+  tree *elts = (tree *) alloca (len * sizeof (tree));
 
   for (i = 0; i < len; i++)
     {
index 5a1b44b69445404253e405fb3c9bc9a2ac1fda2c..54d82c7165ebb9bd7cba2d5adaf5a759b654ef74 100644 (file)
@@ -1124,7 +1124,7 @@ create_pseudo_type_info (int tk, const char *real_name, ...)
   va_start (ap, real_name);
 
   /* Generate the pseudo type name.  */
-  pseudo_name = alloca (strlen (real_name) + 30);
+  pseudo_name = (char *) alloca (strlen (real_name) + 30);
   strcpy (pseudo_name, real_name);
   strcat (pseudo_name, "_pseudo");
   if (tk >= TK_FIXED)
index 90e88d6865e811df1ab795adc9b4b18135a2df78..ec572d0b6df67c1c410c767024514b85a318cd9a 100644 (file)
@@ -97,7 +97,7 @@ struct lookup_base_data_s
 static tree
 dfs_lookup_base (tree binfo, void *data_)
 {
-  struct lookup_base_data_s *data = data_;
+  struct lookup_base_data_s *data = (struct lookup_base_data_s *) data_;
 
   if (SAME_BINFO_TYPE_P (BINFO_TYPE (binfo), data->base))
     {
@@ -306,7 +306,7 @@ struct dcast_data_s
 static tree
 dfs_dcast_hint_pre (tree binfo, void *data_)
 {
-  struct dcast_data_s *data = data_;
+  struct dcast_data_s *data = (struct dcast_data_s *) data_;
 
   if (BINFO_VIRTUAL_P (binfo))
     data->virt_depth++;
@@ -334,7 +334,7 @@ dfs_dcast_hint_pre (tree binfo, void *data_)
 static tree
 dfs_dcast_hint_post (tree binfo, void *data_)
 {
-  struct dcast_data_s *data = data_;
+  struct dcast_data_s *data = (struct dcast_data_s *) data_;
 
   if (BINFO_VIRTUAL_P (binfo))
     data->virt_depth--;
index 9d1a6195a7922807b7e4eacdd1fab2645709b9a7..16e87ec2d63e0e9df9ff2e719412381faa9e49c3 100644 (file)
@@ -756,7 +756,7 @@ hash_tree_cons (tree purpose, tree value, tree chain)
   /* If not, create a new node.  */
   if (!*slot)
     *slot = tree_cons (purpose, value, chain);
-  return *slot;
+  return (tree) *slot;
 }
 
 /* Constructor for hashed lists.  */
index 755535f0371ac4b571180d611057227b7766df8f..fe5b3dff78e84939bbd5ab8c821fd78a20b3c84f 100644 (file)
@@ -145,7 +145,8 @@ struct pending_abstract_type GTY((chain_next ("%h.next")))
 static hashval_t
 pat_calc_hash (const void* val)
 {
-  const struct pending_abstract_type* pat = val;
+  const struct pending_abstract_type *pat =
+     (const struct pending_abstract_type *) val;
   return (hashval_t) TYPE_UID (pat->type);
 }
 
@@ -156,7 +157,8 @@ pat_calc_hash (const void* val)
 static int
 pat_compare (const void* val1, const void* val2)
 {
-  const struct pending_abstract_type* pat1 = val1;
+  const struct pending_abstract_type *pat1 =
+     (const struct pending_abstract_type *) val1;
   tree type2 = (tree)val2;
 
   return (pat1->type == type2);
@@ -270,7 +272,7 @@ abstract_virtuals_error (tree decl, tree type)
                    ? DECL_SOURCE_LOCATION (decl)
                    : input_location);
 
-      pat->next = *slot;
+      pat->next = (struct pending_abstract_type *) *slot;
       *slot = pat;
 
       return 0;