From: rmathew Date: Sun, 27 Jun 2004 18:16:49 +0000 (+0000) Subject: Formatting fixes. X-Git-Url: http://git.sourceforge.jp/view?p=pf3gnuchains%2Fgcc-fork.git;a=commitdiff_plain;h=83a070d097f99d06eb00fd6d3ea33d4aa4336afd Formatting fixes. * expr.c (class_has_finalize_method): Fix method name indentation. (expand_java_call): Remove K&R style parameter declaration. (expand_invoke): Fix statement indentation. (expand_java_field_op): Likewise. * parse-scan.y: Fix typo. (reset_report): Fix method name indentation. * parse.y (unresolved_type_p, build_expr_block): Remove extra blank line. Fix typos. * verify.c (verify_jvm_instructions): Document parameters, insert page break. * lang.c (lang_init_source): Fix method name indentation. * class.c (common_enclosing_context_p): Likewise. (emit_symbol_table): Fix parameter list indentation. * decl.c (add_stmt_to_compound, java_add_stmt): Remove K&R style parameter declaration. * constants.c: Fix copyright notice indentation. * typeck.c (find_method_in_superclasses): Fix parameter list indentation. (find_method_in_interfaces): Likewise. * zextract.c (makelong): Fix method name indentation. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@83738 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index e7594069ea7..8a7a05d3331 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -1,3 +1,27 @@ +2004-06-27 Ranjit Mathew + + Formatting fixes. + * expr.c (class_has_finalize_method): Fix method name indentation. + (expand_java_call): Remove K&R style parameter declaration. + (expand_invoke): Fix statement indentation. + (expand_java_field_op): Likewise. + * parse-scan.y: Fix typo. + (reset_report): Fix method name indentation. + * parse.y (unresolved_type_p, build_expr_block): Remove extra blank + line. Fix typos. + * verify.c (verify_jvm_instructions): Document parameters, insert + page break. + * lang.c (lang_init_source): Fix method name indentation. + * class.c (common_enclosing_context_p): Likewise. + (emit_symbol_table): Fix parameter list indentation. + * decl.c (add_stmt_to_compound, java_add_stmt): Remove K&R style + parameter declaration. + * constants.c: Fix copyright notice indentation. + * typeck.c (find_method_in_superclasses): Fix parameter list + indentation. + (find_method_in_interfaces): Likewise. + * zextract.c (makelong): Fix method name indentation. + 2004-06-26 Bryce McKinlay PR java/15715. @@ -14697,7 +14721,7 @@ java.lang.Object. (register_fields): Field initialization is now a MODIFY_EXPR node. Chain initialization code to the matching lists (according - the the field declaration modifiers). + to the field declaration modifiers). (maybe_generate_clinit): New function. (method_header): Don't set method's DECL_NAME to a WFL when adding methods to java.lang.Object. diff --git a/gcc/java/class.c b/gcc/java/class.c index ca9d62721c7..a9852d5d85e 100644 --- a/gcc/java/class.c +++ b/gcc/java/class.c @@ -349,7 +349,8 @@ unmangle_classname (const char *name, int name_length) } -/* Given a class, create the DECLs for all its associated indirect dispatch tables. */ +/* Given a class, create the DECLs for all its associated indirect + dispatch tables. */ void gen_indirect_dispatch_tables (tree type) { @@ -588,7 +589,8 @@ enclosing_context_p (tree type1, tree type2) /* Return 1 iff there exists a common enclosing context between TYPE1 and TYPE2. */ -int common_enclosing_context_p (tree type1, tree type2) +int +common_enclosing_context_p (tree type1, tree type2) { if (!PURE_INNER_CLASS_TYPE_P (type1) || !PURE_INNER_CLASS_TYPE_P (type2)) return 0; @@ -2358,8 +2360,8 @@ build_symbol_entry (tree decl) /* Emit a symbol table: used by -findirect-dispatch. */ tree -emit_symbol_table (tree name, tree the_table, tree decl_list, tree the_syms_decl, - tree the_array_element_type) +emit_symbol_table (tree name, tree the_table, tree decl_list, + tree the_syms_decl, tree the_array_element_type) { tree method_list, method, table, list, null_symbol; tree table_size, the_array_type; diff --git a/gcc/java/constants.c b/gcc/java/constants.c index 98127f590db..fc4a7a30335 100644 --- a/gcc/java/constants.c +++ b/gcc/java/constants.c @@ -1,5 +1,6 @@ /* Handle the constant pool of the Java(TM) Virtual Machine. - Copyright (C) 1997, 1998, 1999, 2000, 2001, 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 1997, 1998, 1999, 2000, 2001, 2003, 2004 + Free Software Foundation, Inc. This file is part of GCC. diff --git a/gcc/java/decl.c b/gcc/java/decl.c index db851aa1c30..682c8b3e3fd 100644 --- a/gcc/java/decl.c +++ b/gcc/java/decl.c @@ -1877,8 +1877,7 @@ java_mark_class_local (tree class) /* Add a statement to a compound_expr. */ tree -add_stmt_to_compound (existing, type, stmt) - tree existing, type, stmt; +add_stmt_to_compound (tree existing, tree type, tree stmt) { if (!stmt) return existing; @@ -1897,8 +1896,7 @@ add_stmt_to_compound (existing, type, stmt) constructed. */ tree -java_add_stmt (stmt) - tree stmt; +java_add_stmt (tree stmt) { if (input_filename) annotate_with_locus (stmt, input_location); diff --git a/gcc/java/expr.c b/gcc/java/expr.c index d4f25f89d66..c998a68cbd0 100644 --- a/gcc/java/expr.c +++ b/gcc/java/expr.c @@ -112,7 +112,7 @@ int always_initialize_class_p = 1; If a variable is on the quick stack, it means the value of variable when the quick stack was last flushed. Conceptually, flush_quick_stack - saves all the the quick_stack elements in parallel. However, that is + saves all the quick_stack elements in parallel. However, that is complicated, so it actually saves them (i.e. copies each stack value to is home virtual register) from low indexes. This allows a quick_stack element at index i (counting from the bottom of stack the) to references @@ -1141,7 +1141,8 @@ build_address_of (tree value) return build1 (ADDR_EXPR, build_pointer_type (TREE_TYPE (value)), value); } -bool class_has_finalize_method (tree type) +bool +class_has_finalize_method (tree type) { tree super = CLASSTYPE_SUPER (type); @@ -1697,7 +1698,6 @@ expand_java_add_case (tree switch_expr, int match, int target_pc) #if 0 static void expand_java_call (int target_pc, int return_address) - int target_pc, return_address; { tree target_label = lookup_label (target_pc); tree value = build_int_2 (return_address, return_address < 0 ? -1 : 0); @@ -2041,10 +2041,13 @@ build_invokeinterface (tree dtable, tree method) static void expand_invoke (int opcode, int method_ref_index, int nargs ATTRIBUTE_UNUSED) { - tree method_signature = COMPONENT_REF_SIGNATURE(¤t_jcf->cpool, method_ref_index); + tree method_signature + = COMPONENT_REF_SIGNATURE(¤t_jcf->cpool, method_ref_index); tree method_name = COMPONENT_REF_NAME (¤t_jcf->cpool, method_ref_index); - tree self_type = get_class_constant - (current_jcf, COMPONENT_REF_CLASS_INDEX(¤t_jcf->cpool, method_ref_index)); + tree self_type + = get_class_constant (current_jcf, + COMPONENT_REF_CLASS_INDEX(¤t_jcf->cpool, + method_ref_index)); const char *const self_name = IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (self_type))); tree call, func, method, arg_list, method_type; @@ -2363,11 +2366,12 @@ build_jni_stub (tree method) static void expand_java_field_op (int is_static, int is_putting, int field_ref_index) { - tree self_type = - get_class_constant (current_jcf, - COMPONENT_REF_CLASS_INDEX (¤t_jcf->cpool, - field_ref_index)); - const char *self_name = IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (self_type))); + tree self_type + = get_class_constant (current_jcf, + COMPONENT_REF_CLASS_INDEX (¤t_jcf->cpool, + field_ref_index)); + const char *self_name + = IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (self_type))); tree field_name = COMPONENT_REF_NAME (¤t_jcf->cpool, field_ref_index); tree field_signature = COMPONENT_REF_SIGNATURE (¤t_jcf->cpool, field_ref_index); diff --git a/gcc/java/lang.c b/gcc/java/lang.c index 20f13e5adb2..2656d45f2bf 100644 --- a/gcc/java/lang.c +++ b/gcc/java/lang.c @@ -687,7 +687,8 @@ java_print_error_function (diagnostic_context *context ATTRIBUTE_UNUSED, 2, function prototypes are fully resolved and can be printed when reporting errors. */ -void lang_init_source (int level) +void +lang_init_source (int level) { inhibit_error_function_printing = (level == 1); } diff --git a/gcc/java/parse-scan.y b/gcc/java/parse-scan.y index 8c622a42019..06409b244c5 100644 --- a/gcc/java/parse-scan.y +++ b/gcc/java/parse-scan.y @@ -1,5 +1,6 @@ /* Parser grammar for quick source code scan of Java(TM) language programs. - Copyright (C) 1998, 1999, 2000, 2002, 2003 Free Software Foundation, Inc. + Copyright (C) 1998, 1999, 2000, 2002, 2003, 2004 + Free Software Foundation, Inc. Contributed by Alexandre Petit-Bianco (apbianco@cygnus.com) This file is part of GCC. @@ -553,8 +554,8 @@ static: /* Test lval.sub_token here */ /* 19.8.5 Productions from 8.6: Constructor Declarations */ /* NOTE FOR FURTHER WORK ON CONSTRUCTORS: - - If a forbidded modifier is found, the the error is either the use of - a forbidded modifier for a constructor OR bogus attempt to declare a + - If a forbidden modifier is found, the error is either the use of + a forbidden modifier for a constructor OR bogus attempt to declare a method without having specified the return type. FIXME */ constructor_declaration: constructor_declarator throws constructor_body @@ -1344,7 +1345,8 @@ report (void) /* Reset global status used by the report functions. */ -void reset_report (void) +void +reset_report (void) { previous_output = 0; package_name = NULL; diff --git a/gcc/java/parse.y b/gcc/java/parse.y index 4d7f2186542..7f886707736 100644 --- a/gcc/java/parse.y +++ b/gcc/java/parse.y @@ -5014,7 +5014,6 @@ method_declarator (tree id, tree list) static int unresolved_type_p (tree wfl, tree *returned) - { if (TREE_CODE (wfl) == EXPR_WITH_FILE_LOCATION) { @@ -12229,8 +12228,8 @@ complete_function_arguments (tree node) flag = 1; continue; } - /* If have a string literal that we haven't transformed yet or a - crafted string buffer, as a result of use of the the String + /* If we have a string literal that we haven't transformed yet or a + crafted string buffer, as a result of the use of the String `+' operator. Build `parm.toString()' and expand it. */ if ((temp = patch_string (parm))) parm = temp; @@ -12259,7 +12258,6 @@ build_debugable_stmt (int location, tree stmt) static tree build_expr_block (tree body, tree decls) - { tree node = make_node (BLOCK); BLOCK_EXPR_DECLS (node) = decls; diff --git a/gcc/java/typeck.c b/gcc/java/typeck.c index 64f00e8f780..cf916674ccc 100644 --- a/gcc/java/typeck.c +++ b/gcc/java/typeck.c @@ -771,8 +771,8 @@ shallow_find_method (tree searched_class, int flags, tree method_name, lookup_do. */ static tree find_method_in_superclasses (tree searched_class, int flags, - tree method_name, - tree signature, tree (*signature_builder) (tree)) + tree method_name, tree signature, + tree (*signature_builder) (tree)) { tree klass; for (klass = CLASSTYPE_SUPER (searched_class); klass != NULL_TREE; @@ -792,8 +792,8 @@ find_method_in_superclasses (tree searched_class, int flags, for a method matching METHOD_NAME and signature SIGNATURE. A private helper for lookup_do. */ static tree -find_method_in_interfaces (tree searched_class, int flags, tree method_name, - tree signature, tree (*signature_builder) (tree)) +find_method_in_interfaces (tree searched_class, int flags, tree method_name, + tree signature, tree (*signature_builder) (tree)) { int i; int interface_len = diff --git a/gcc/java/verify.c b/gcc/java/verify.c index abcdac8c4d8..ed3f9452a2e 100644 --- a/gcc/java/verify.c +++ b/gcc/java/verify.c @@ -1,6 +1,6 @@ /* Handle verification of bytecoded methods for the GNU compiler for the Java(TM) language. - Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003 + Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. This file is part of GCC. @@ -238,7 +238,7 @@ merge_types (tree type1, tree type2) } /* Merge the current type state with that at LABEL. - Return -1 the the states are incompatible (i.e. on error), + Return -1 if the states are incompatible (i.e. on error), 0 if there was no change, and 1 if there was a change. */ int @@ -408,8 +408,11 @@ pop_argument_types (tree arg_types) #define BCODE byte_ops -/* Verify the bytecodes of the current method. - Return 1 on success, 0 on failure. */ + +/* Verify the bytecodes of the current method, with the instructions + starting at BYTE_OPS and LENGTH in number, from the class file pointed to + by JCF. + Return 1 on success, 0 on failure. */ int verify_jvm_instructions (JCF* jcf, const unsigned char *byte_ops, long length) { diff --git a/gcc/java/zextract.c b/gcc/java/zextract.c index 8800bd4ecfc..ee464124d22 100644 --- a/gcc/java/zextract.c +++ b/gcc/java/zextract.c @@ -1,7 +1,7 @@ /* Handle a .class file embedded in a .zip archive. This extracts a member from a .zip file, but does not handle uncompression (since that is not needed for classes.zip). - Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003 + Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004 Free Software Foundation, Inc. This file is part of GCC. @@ -236,7 +236,8 @@ static ush makeword(const uch *b) /* Function makelong() */ /***********************/ -static ulg makelong(const uch *sig) +static ulg +makelong (const uch *sig) { /* * Convert intel style 'long' variable to non-Intel non-16-bit