Index: ChangeLog =================================================================== --- ChangeLog 2004-06-27 23:09:20.000000000 +0530 +++ ChangeLog 2004-06-27 23:21:43.000000000 +0530 @@ -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 * parse.y (qualify_and_find): Pass type decl, not identifier, to Index: expr.c =================================================================== --- expr.c 2004-06-27 22:10:47.000000000 +0530 +++ expr.c 2004-06-27 22:57:57.000000000 +0530 @@ -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, #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 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); Index: parse-scan.y =================================================================== --- parse-scan.y 2004-06-27 22:10:56.000000000 +0530 +++ parse-scan.y 2004-06-27 22:36:02.000000000 +0530 @@ -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; Index: parse.y =================================================================== --- parse.y 2004-06-27 22:11:07.000000000 +0530 +++ parse.y 2004-06-27 22:24:29.000000000 +0530 @@ -5007,7 +5007,6 @@ method_declarator (tree id, tree list) static int unresolved_type_p (tree wfl, tree *returned) - { if (TREE_CODE (wfl) == EXPR_WITH_FILE_LOCATION) { @@ -12225,8 +12224,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; @@ -12255,7 +12254,6 @@ build_debugable_stmt (int location, tree static tree build_expr_block (tree body, tree decls) - { tree node = make_node (BLOCK); BLOCK_EXPR_DECLS (node) = decls; Index: verify.c =================================================================== --- verify.c 2004-06-27 22:11:13.000000000 +0530 +++ verify.c 2004-06-27 22:43:41.000000000 +0530 @@ -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) { Index: lang.c =================================================================== --- lang.c 2004-06-27 22:16:54.000000000 +0530 +++ lang.c 2004-06-27 22:17:46.000000000 +0530 @@ -687,7 +687,8 @@ java_print_error_function (diagnostic_co 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); } Index: class.c =================================================================== --- class.c 2004-06-27 22:46:17.000000000 +0530 +++ class.c 2004-06-27 22:47:45.000000000 +0530 @@ -349,7 +349,8 @@ unmangle_classname (const char *name, in } -/* 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 ty /* 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; Index: decl.c =================================================================== --- decl.c 2004-06-27 22:52:48.000000000 +0530 +++ decl.c 2004-06-27 22:53:13.000000000 +0530 @@ -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, st constructed. */ tree -java_add_stmt (stmt) - tree stmt; +java_add_stmt (tree stmt) { if (input_filename) annotate_with_locus (stmt, input_location); Index: constants.c =================================================================== --- constants.c 2004-06-27 22:50:05.000000000 +0530 +++ constants.c 2004-06-27 22:50:31.000000000 +0530 @@ -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. Index: typeck.c =================================================================== --- typeck.c 2004-06-27 23:05:56.000000000 +0530 +++ typeck.c 2004-06-27 23:22:51.000000000 +0530 @@ -771,8 +771,8 @@ shallow_find_method (tree searched_class 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 search 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 = Index: zextract.c =================================================================== --- zextract.c 2004-06-27 23:07:42.000000000 +0530 +++ zextract.c 2004-06-27 23:08:06.000000000 +0530 @@ -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