diff options
author | ghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-07-19 16:09:51 +0000 |
---|---|---|
committer | ghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-07-19 16:09:51 +0000 |
commit | 6edf18a6cb88793eb51776264f367e8880b77bd2 (patch) | |
tree | d243de95567f278205efde59b3ca0adf508e6084 /gcc/cp | |
parent | 12ef3745cdaccd74b4bd63acbca64f61908771ba (diff) | |
download | linaro-gcc-6edf18a6cb88793eb51776264f367e8880b77bd2.tar.gz linaro-gcc-6edf18a6cb88793eb51776264f367e8880b77bd2.tar.bz2 linaro-gcc-6edf18a6cb88793eb51776264f367e8880b77bd2.zip |
gcc:
* fixinc/fixfixes.c fixinc/fixincl.c fixinc/fixlib.c
fixinc/server.c objc/objc-act.c: Remove unnecessary casts.
f:
* com.c data.c expr.c fini.c g77spec.c global.c lab.c lex.c name.c
sta.c stc.c std.c storag.c stt.c stw.c symbol.c target.c type.c:
Remove unnecessary casts.
cp:
* call.c class.c decl.c decl2.c g++spec.c lex.c parser.c pt.c rtti.c
semantics.c typeck.c: Remove unnecessary casts.
java:
* class.c java-tree.h jcf-write.c jvspec.c: Remove unnecessary
casts.
treelang:
* treetree.c: Remove unnecessary casts.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@69593 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/call.c | 3 | ||||
-rw-r--r-- | gcc/cp/class.c | 12 | ||||
-rw-r--r-- | gcc/cp/decl.c | 17 | ||||
-rw-r--r-- | gcc/cp/decl2.c | 2 | ||||
-rw-r--r-- | gcc/cp/g++spec.c | 8 | ||||
-rw-r--r-- | gcc/cp/lex.c | 13 | ||||
-rw-r--r-- | gcc/cp/parser.c | 32 | ||||
-rw-r--r-- | gcc/cp/pt.c | 13 | ||||
-rw-r--r-- | gcc/cp/rtti.c | 2 | ||||
-rw-r--r-- | gcc/cp/semantics.c | 2 | ||||
-rw-r--r-- | gcc/cp/typeck.c | 2 |
12 files changed, 51 insertions, 60 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 4bcad833e2c..ef5694f531b 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2003-07-19 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> + + * call.c class.c decl.c decl2.c g++spec.c lex.c parser.c pt.c rtti.c + semantics.c typeck.c: Remove unnecessary casts. + 2003-07-18 Nathan Sidwell <nathan@codesourcery.com> * cp-tree.h (finish_non_static_data_member): Add object param. diff --git a/gcc/cp/call.c b/gcc/cp/call.c index 6f677a5243b..013d60059a0 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -1207,8 +1207,7 @@ add_candidate (struct z_candidate **candidates, tree fn, tree args, tree convs, tree access_path, tree conversion_path, int viable) { - struct z_candidate *cand - = (struct z_candidate *) ggc_alloc_cleared (sizeof (struct z_candidate)); + struct z_candidate *cand = ggc_alloc_cleared (sizeof (struct z_candidate)); cand->fn = fn; cand->args = args; diff --git a/gcc/cp/class.c b/gcc/cp/class.c index ca22d82d7aa..b9f139fc645 100644 --- a/gcc/cp/class.c +++ b/gcc/cp/class.c @@ -5380,8 +5380,7 @@ init_class_processing (void) current_class_depth = 0; current_class_stack_size = 10; current_class_stack - = (class_stack_node_t) xmalloc (current_class_stack_size - * sizeof (struct class_stack_node)); + = xmalloc (current_class_stack_size * sizeof (struct class_stack_node)); VARRAY_TREE_INIT (local_classes, 8, "local_classes"); ridpointers[(int) RID_PUBLIC] = access_public_node; @@ -5426,9 +5425,9 @@ pushclass (tree type, bool modify) { current_class_stack_size *= 2; current_class_stack - = (class_stack_node_t) xrealloc (current_class_stack, - current_class_stack_size - * sizeof (struct class_stack_node)); + = xrealloc (current_class_stack, + current_class_stack_size + * sizeof (struct class_stack_node)); } /* Insert a new entry on the class stack. */ @@ -6205,8 +6204,7 @@ get_vfield_name (tree type) binfo = BINFO_BASETYPE (binfo, 0); type = BINFO_TYPE (binfo); - buf = (char *) alloca (sizeof (VFIELD_NAME_FORMAT) - + TYPE_NAME_LENGTH (type) + 2); + buf = alloca (sizeof (VFIELD_NAME_FORMAT) + TYPE_NAME_LENGTH (type) + 2); sprintf (buf, VFIELD_NAME_FORMAT, IDENTIFIER_POINTER (constructor_name (type))); return get_identifier (buf); diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 62ecbc487b4..eb0902d23ba 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -2220,7 +2220,7 @@ maybe_push_to_top_level (int pseudo) int need_pop; timevar_push (TV_NAME_LOOKUP); - s = (struct saved_scope *) ggc_alloc_cleared (sizeof (struct saved_scope)); + s = ggc_alloc_cleared (sizeof (struct saved_scope)); b = scope_chain ? current_binding_level : 0; @@ -4669,8 +4669,7 @@ use_label (tree decl) || named_label_uses->label_decl != decl) { struct named_label_use_list *new_ent; - new_ent = ((struct named_label_use_list *) - ggc_alloc (sizeof (struct named_label_use_list))); + new_ent = ggc_alloc (sizeof (struct named_label_use_list)); new_ent->label_decl = decl; new_ent->names_in_scope = current_binding_level->names; new_ent->binding_level = current_binding_level; @@ -4707,8 +4706,7 @@ lookup_label (tree id) /* Record this label on the list of labels used in this function. We do this before calling make_label_decl so that we get the IDENTIFIER_LABEL_VALUE before the new label is declared. */ - ent = ((struct named_label_list *) - ggc_alloc_cleared (sizeof (struct named_label_list))); + ent = ggc_alloc_cleared (sizeof (struct named_label_list)); ent->old_value = IDENTIFIER_LABEL_VALUE (id); ent->next = named_labels; named_labels = ent; @@ -5003,8 +5001,7 @@ static struct cp_switch *switch_stack; void push_switch (tree switch_stmt) { - struct cp_switch *p - = (struct cp_switch *) xmalloc (sizeof (struct cp_switch)); + struct cp_switch *p = xmalloc (sizeof (struct cp_switch)); p->level = current_binding_level; p->next = switch_stack; p->switch_stmt = switch_stmt; @@ -13772,8 +13769,7 @@ save_function_data (tree decl) 19990908); /* Make a copy. */ - f = ((struct language_function *) - ggc_alloc (sizeof (struct language_function))); + f = ggc_alloc (sizeof (struct language_function)); memcpy (f, cp_function_chain, sizeof (struct language_function)); DECL_SAVED_FUNCTION_DATA (decl) = f; @@ -14442,8 +14438,7 @@ void cxx_push_function_context (struct function * f) { struct language_function *p - = ((struct language_function *) - ggc_alloc_cleared (sizeof (struct language_function))); + = ggc_alloc_cleared (sizeof (struct language_function)); f->language = p; /* It takes an explicit call to expand_body to generate RTL for a diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c index 9a0185bd75e..f03603dc0e5 100644 --- a/gcc/cp/decl2.c +++ b/gcc/cp/decl2.c @@ -2220,7 +2220,7 @@ get_priority_info (int priority) { /* Create a new priority information structure, and insert it into the map. */ - pi = (priority_info) xmalloc (sizeof (struct priority_info_s)); + pi = xmalloc (sizeof (struct priority_info_s)); pi->initializations_p = 0; pi->destructions_p = 0; splay_tree_insert (priority_info_map, diff --git a/gcc/cp/g++spec.c b/gcc/cp/g++spec.c index 26bc383799d..d3407a31604 100644 --- a/gcc/cp/g++spec.c +++ b/gcc/cp/g++spec.c @@ -113,7 +113,7 @@ lang_specific_driver (int *in_argc, const char *const **in_argv, argv = *in_argv; added_libraries = *in_added_libraries; - args = (int *) xcalloc (argc, sizeof (int)); + args = xcalloc (argc, sizeof (int)); for (i = 1; i < argc; i++) { @@ -168,12 +168,12 @@ lang_specific_driver (int *in_argc, const char *const **in_argv, saw_speclang = 1; } else if (((argv[i][2] == '\0' - && (char *)strchr ("bBVDUoeTuIYmLiA", argv[i][1]) != NULL) + && strchr ("bBVDUoeTuIYmLiA", argv[i][1]) != NULL) || strcmp (argv[i], "-Xlinker") == 0 || strcmp (argv[i], "-Tdata") == 0)) quote = argv[i]; else if ((argv[i][2] == '\0' - && (char *) strchr ("cSEM", argv[i][1]) != NULL) + && strchr ("cSEM", argv[i][1]) != NULL) || strcmp (argv[i], "-MM") == 0 || strcmp (argv[i], "-fsyntax-only") == 0) { @@ -243,7 +243,7 @@ lang_specific_driver (int *in_argc, const char *const **in_argv, /* Make sure to have room for the trailing NULL argument. */ num_args = argc + added + need_math + shared_libgcc + (library > 0) + 1; - arglist = (const char **) xmalloc (num_args * sizeof (char *)); + arglist = xmalloc (num_args * sizeof (char *)); i = 0; j = 0; diff --git a/gcc/cp/lex.c b/gcc/cp/lex.c index 2266f04080e..e3979775426 100644 --- a/gcc/cp/lex.c +++ b/gcc/cp/lex.c @@ -354,7 +354,7 @@ init_reswords (void) int mask = ((flag_no_asm ? D_ASM : 0) | (flag_no_gnu_keywords ? D_EXT : 0)); - ridpointers = (tree *) ggc_calloc ((int) RID_MAX, sizeof (tree)); + ridpointers = ggc_calloc ((int) RID_MAX, sizeof (tree)); for (i = 0; i < ARRAY_SIZE (reswords); i++) { id = get_identifier (reswords[i].word); @@ -643,7 +643,7 @@ handle_pragma_implementation (cpp_reader* dfile ATTRIBUTE_UNUSED ) } if (ifiles == 0) { - ifiles = (struct impl_files*) xmalloc (sizeof (struct impl_files)); + ifiles = xmalloc (sizeof (struct impl_files)); ifiles->filename = main_filename; ifiles->next = impl_file_chain; impl_file_chain = ifiles; @@ -756,7 +756,7 @@ retrofit_lang_decl (tree t) else size = sizeof (struct lang_decl_flags); - ld = (struct lang_decl *) ggc_alloc_cleared (size); + ld = ggc_alloc_cleared (size); ld->decl_flags.can_be_full = CAN_HAVE_FULL_LANG_DECL_P (t) ? 1 : 0; ld->decl_flags.u1sel = TREE_CODE (t) == NAMESPACE_DECL ? 1 : 0; @@ -792,7 +792,7 @@ cxx_dup_lang_specific_decl (tree node) size = sizeof (struct lang_decl_flags); else size = sizeof (struct lang_decl); - ld = (struct lang_decl *) ggc_alloc (size); + ld = ggc_alloc (size); memcpy (ld, DECL_LANG_SPECIFIC (node), size); DECL_LANG_SPECIFIC (node) = ld; @@ -829,7 +829,7 @@ copy_lang_type (tree node) size = sizeof (struct lang_type); else size = sizeof (struct lang_type_ptrmem); - lt = (struct lang_type *) ggc_alloc (size); + lt = ggc_alloc (size); memcpy (lt, TYPE_LANG_SPECIFIC (node), size); TYPE_LANG_SPECIFIC (node) = lt; @@ -862,8 +862,7 @@ cxx_make_type (enum tree_code code) { struct lang_type *pi; - pi = ((struct lang_type *) - ggc_alloc_cleared (sizeof (struct lang_type))); + pi = ggc_alloc_cleared (sizeof (struct lang_type)); TYPE_LANG_SPECIFIC (t) = pi; pi->u.c.h.is_lang_type_class = 1; diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index 8af9f46d7f1..df45bb60b57 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -127,7 +127,7 @@ static void cp_token_cache_push_token static cp_token_cache * cp_token_cache_new () { - return (cp_token_cache *) ggc_alloc_cleared (sizeof (cp_token_cache)); + return ggc_alloc_cleared (sizeof (cp_token_cache)); } /* Add *TOKEN to *CACHE. */ @@ -141,7 +141,7 @@ cp_token_cache_push_token (cp_token_cache *cache, /* See if we need to allocate a new token block. */ if (!b || b->num_tokens == CP_TOKEN_BLOCK_NUM_TOKENS) { - b = ((cp_token_block *) ggc_alloc_cleared (sizeof (cp_token_block))); + b = ggc_alloc_cleared (sizeof (cp_token_block)); b->prev = cache->last; if (cache->last) { @@ -305,11 +305,10 @@ cp_lexer_new_main (void) cpp_get_callbacks (parse_in)->valid_pch = NULL; /* Allocate the memory. */ - lexer = (cp_lexer *) ggc_alloc_cleared (sizeof (cp_lexer)); + lexer = ggc_alloc_cleared (sizeof (cp_lexer)); /* Create the circular buffer. */ - lexer->buffer = ((cp_token *) - ggc_calloc (CP_TOKEN_BUFFER_SIZE, sizeof (cp_token))); + lexer->buffer = ggc_calloc (CP_TOKEN_BUFFER_SIZE, sizeof (cp_token)); lexer->buffer_end = lexer->buffer + CP_TOKEN_BUFFER_SIZE; /* There is one token in the buffer. */ @@ -345,13 +344,13 @@ cp_lexer_new_from_tokens (cp_token_cache *tokens) ptrdiff_t num_tokens; /* Allocate the memory. */ - lexer = (cp_lexer *) ggc_alloc_cleared (sizeof (cp_lexer)); + lexer = ggc_alloc_cleared (sizeof (cp_lexer)); /* Create a new buffer, appropriately sized. */ num_tokens = 0; for (block = tokens->first; block != NULL; block = block->next) num_tokens += block->num_tokens; - lexer->buffer = ((cp_token *) ggc_alloc (num_tokens * sizeof (cp_token))); + lexer->buffer = ggc_alloc (num_tokens * sizeof (cp_token)); lexer->buffer_end = lexer->buffer + num_tokens; /* Install the tokens. */ @@ -521,9 +520,8 @@ cp_lexer_maybe_grow_buffer (cp_lexer* lexer) /* Compute the current buffer size. */ buffer_length = lexer->buffer_end - lexer->buffer; /* Allocate a buffer twice as big. */ - new_buffer = ((cp_token *) - ggc_realloc (lexer->buffer, - 2 * buffer_length * sizeof (cp_token))); + new_buffer = ggc_realloc (lexer->buffer, + 2 * buffer_length * sizeof (cp_token)); /* Because the buffer is circular, logically consecutive tokens are not necessarily placed consecutively in memory. @@ -1130,11 +1128,10 @@ cp_parser_context_new (cp_parser_context* next) /* Pull the first entry from the free list. */ context = cp_parser_context_free_list; cp_parser_context_free_list = context->next; - memset ((char *)context, 0, sizeof (*context)); + memset (context, 0, sizeof (*context)); } else - context = ((cp_parser_context *) - ggc_alloc_cleared (sizeof (cp_parser_context))); + context = ggc_alloc_cleared (sizeof (cp_parser_context)); /* No errors have occurred yet in this context. */ context->status = CP_PARSER_STATUS_KIND_NO_ERROR; /* If this is not the bottomost context, copy information that we @@ -2067,7 +2064,7 @@ cp_parser_new (void) cp_lexer_new_main might load a PCH file. */ lexer = cp_lexer_new_main (); - parser = (cp_parser *) ggc_alloc_cleared (sizeof (cp_parser)); + parser = ggc_alloc_cleared (sizeof (cp_parser)); parser->lexer = lexer; parser->context = cp_parser_context_new (NULL); @@ -13796,10 +13793,9 @@ cp_parser_sizeof_operand (cp_parser* parser, enum rid keyword) saved_message = parser->type_definition_forbidden_message; /* And create the new one. */ parser->type_definition_forbidden_message - = ((const char *) - xmalloc (strlen (format) - + strlen (IDENTIFIER_POINTER (ridpointers[keyword])) - + 1 /* `\0' */)); + = xmalloc (strlen (format) + + strlen (IDENTIFIER_POINTER (ridpointers[keyword])) + + 1 /* `\0' */); sprintf ((char *) parser->type_definition_forbidden_message, format, IDENTIFIER_POINTER (ridpointers[keyword])); diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 9d66c3c0add..774d6d9150a 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -840,9 +840,8 @@ retrieve_specialization (tree tmpl, tree args) static tree retrieve_local_specialization (tree tmpl) { - tree spec = - (tree) htab_find_with_hash (local_specializations, tmpl, - htab_hash_pointer (tmpl)); + tree spec = htab_find_with_hash (local_specializations, tmpl, + htab_hash_pointer (tmpl)); return spec ? TREE_PURPOSE (spec) : NULL_TREE; } @@ -2409,11 +2408,11 @@ process_partial_specialization (tree decl) { /* We haven't yet initialized TPD2. Do so now. */ tpd2.arg_uses_template_parms - = (int*) alloca (sizeof (int) * nargs); + = 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 = (int*) alloca (sizeof (int) * nargs); + tpd2.parms = alloca (sizeof (int) * nargs); tpd2.level = TMPL_PARMS_DEPTH (DECL_TEMPLATE_PARMS (maintmpl)); } @@ -5541,9 +5540,9 @@ static tree tsubst_template_arg_vector (tree t, tree args, tsubst_flags_t complain) { int len = TREE_VEC_LENGTH (t), need_new = 0, i; - tree *elts = (tree *) alloca (len * sizeof (tree)); + tree *elts = alloca (len * sizeof (tree)); - memset ((char *) elts, 0, len * sizeof (tree)); + memset (elts, 0, len * sizeof (tree)); for (i = 0; i < len; i++) { diff --git a/gcc/cp/rtti.c b/gcc/cp/rtti.c index b28fea6212a..067ddee1773 100644 --- a/gcc/cp/rtti.c +++ b/gcc/cp/rtti.c @@ -1125,7 +1125,7 @@ create_pseudo_type_info (const char *real_name, int ident, ...) va_start (ap, ident); /* Generate the pseudo type name. */ - pseudo_name = (char *)alloca (strlen (real_name) + 30); + pseudo_name = alloca (strlen (real_name) + 30); strcpy (pseudo_name, real_name); strcat (pseudo_name, "_pseudo"); if (ident) diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index 812ef6df2dc..a34cc4618d0 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -155,7 +155,7 @@ void push_deferring_access_checks (deferring_kind deferring) deferred_access_free_list = d->next; } else - d = (deferred_access *) ggc_alloc (sizeof (deferred_access)); + d = ggc_alloc (sizeof (deferred_access)); d->next = deferred_access_stack; d->deferred_access_checks = NULL_TREE; diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index 9498dee4d94..0f1011e76b9 100644 --- a/gcc/cp/typeck.c +++ b/gcc/cp/typeck.c @@ -5969,7 +5969,7 @@ c_expand_asm_operands (tree string, tree outputs, tree inputs, tree clobbers, int noutputs = list_length (outputs); register int i; /* o[I] is the place that output number I should be written. */ - register tree *o = (tree *) alloca (noutputs * sizeof (tree)); + register tree *o = alloca (noutputs * sizeof (tree)); register tree tail; /* Record the contents of OUTPUTS before it is modified. */ |