class.c (assume_compiled, [...]): Add static prototype.

* class.c (assume_compiled, assume_compiled_node): Add static
	prototype.
	(add_assume_compiled): Use xmalloc/xstrdup, not malloc/strdup.

	* jcf-dump.c (ARRAY_NEW_NUM): Cast long to int in switch.

	* jvgenmain.c (usage): Add static prototype with ATTRIBUTE_NORETURN.

	* parse.h (OBSOLETE_MODIFIER_WARNING): Rename parameter `modifier'
	to `__modifier' to avoid stringifying it.

	* parse.y (verify_constructor_circularity): Don't call a variadic
	function with a non-literal format string.
	(java_check_abstract_methods): Move unreachable code inside
	`continue' statement.
	(lookup_method_invoke): Call xstrdup, not strdup.

	* expr.c (expand_java_field_op): Avoid the use of ANSI string
	concatenation.

	* jcf-parse.c (yyparse): Likewise.

	* jv-scan.c (main): Likewise.

From-SVN: r31148
This commit is contained in:
Kaveh R. Ghazi 1999-12-31 03:30:22 +00:00 committed by Kaveh Ghazi
parent 6bafd8b6e9
commit c63b98cdad
10 changed files with 50 additions and 23 deletions

View File

@ -1,3 +1,29 @@
1999-12-30 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* class.c (assume_compiled, assume_compiled_node): Add static
prototype.
(add_assume_compiled): Use xmalloc/xstrdup, not malloc/strdup.
* jcf-dump.c (ARRAY_NEW_NUM): Cast long to int in switch.
* jvgenmain.c (usage): Add static prototype with ATTRIBUTE_NORETURN.
* parse.h (OBSOLETE_MODIFIER_WARNING): Rename parameter `modifier'
to `__modifier' to avoid stringifying it.
* parse.y (verify_constructor_circularity): Don't call a variadic
function with a non-literal format string.
(java_check_abstract_methods): Move unreachable code inside
`continue' statement.
(lookup_method_invoke): Call xstrdup, not strdup.
* expr.c (expand_java_field_op): Avoid the use of ANSI string
concatenation.
* jcf-parse.c (yyparse): Likewise.
* jv-scan.c (main): Likewise.
1999-12-30 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* parse.h (ABSTRACT_CHECK, JCONSTRUCTOR_CHECK,

View File

@ -47,6 +47,7 @@ static void append_gpp_mangled_type PROTO ((struct obstack *, tree));
static tree mangle_static_field PROTO ((tree));
static void add_interface_do PROTO ((tree, tree, int));
static tree maybe_layout_super_class PROTO ((tree, tree));
static int assume_compiled PROTO ((const char *));
static rtx registerClass_libfunc;
@ -75,6 +76,9 @@ typedef struct assume_compiled_node_struct
struct assume_compiled_node_struct *child;
} assume_compiled_node;
static assume_compiled_node *find_assume_compiled_node
PROTO ((assume_compiled_node *, const char *));
/* This is the root of the include/exclude tree. */
static assume_compiled_node *assume_compiled_tree;
@ -83,7 +87,7 @@ static assume_compiled_node *assume_compiled_tree;
is IDENT. Start the search from NODE. Return NULL if an
appropriate node does not exist. */
assume_compiled_node *
static assume_compiled_node *
find_assume_compiled_node (node, ident)
assume_compiled_node *node;
const char *ident;
@ -131,9 +135,9 @@ add_assume_compiled (ident, excludep)
{
assume_compiled_node *parent;
assume_compiled_node *node =
(assume_compiled_node *) malloc (sizeof (assume_compiled_node));
(assume_compiled_node *) xmalloc (sizeof (assume_compiled_node));
node->ident = strdup (ident);
node->ident = xstrdup (ident);
node->excludep = excludep;
node->child = NULL;
@ -142,7 +146,7 @@ add_assume_compiled (ident, excludep)
if (NULL == assume_compiled_tree)
{
assume_compiled_tree =
(assume_compiled_node *) malloc (sizeof (assume_compiled_node));
(assume_compiled_node *) xmalloc (sizeof (assume_compiled_node));
assume_compiled_tree->ident = "";
assume_compiled_tree->excludep = 0;
assume_compiled_tree->sibling = NULL;
@ -176,7 +180,7 @@ add_assume_compiled (ident, excludep)
/* Returns non-zero if IDENT is the name of a class that the compiler
should assume has been compiled to FIXME */
int
static int
assume_compiled (ident)
const char *ident;
{

View File

@ -1820,8 +1820,7 @@ expand_java_field_op (is_static, is_putting, field_ref_index)
tree cfndecl_name = DECL_NAME (current_function_decl);
if (! DECL_CONSTRUCTOR_P (current_function_decl)
&& (cfndecl_name != finit_identifier_node))
error_with_decl (field_decl, "assignment to final field `%s' "
"not in constructor");
error_with_decl (field_decl, "assignment to final field `%s' not in constructor");
}
}
expand_assignment (field_ref, new_value, 0, 0);

View File

@ -1018,7 +1018,7 @@ DEFUN(disassemble_method, (jcf, byte_ops, len),
#define ARRAY_NEW(TYPE) ARRAY_NEW_##TYPE
#define ARRAY_NEW_NUM \
INT_temp = IMMEDIATE_u1; \
{ switch (INT_temp) { \
{ switch ((int) INT_temp) { \
case 4: fputs (" boolean", out); break; \
case 5: fputs (" char", out); break; \
case 6: fputs (" float", out); break; \

View File

@ -825,8 +825,7 @@ yyparse ()
{
char *saved_input_filename = input_filename;
input_filename = value;
warning ("source file seen twice on command line and will be "
"compiled only once.");
warning ("source file seen twice on command line and will be compiled only once.");
input_filename = saved_input_filename;
}
else

View File

@ -99,8 +99,7 @@ DEFUN (main, (argc, argv),
/* Check on bad usage */
if (flag_find_main && flag_dump_class)
fatal ("Options `--print-main' and `--list-class' can't be turned on "
"at the same time");
fatal ("Options `--print-main' and `--list-class' can't be turned on at the same time");
if (output_file && !(out = fopen (output_file, "w")))
fatal ("Can't open output file `%s'", output_file);

View File

@ -79,6 +79,8 @@ gcc_obstack_init (obstack)
(void (*) PROTO((void *))) OBSTACK_CHUNK_FREE);
}
static void usage (const char *) ATTRIBUTE_NORETURN;
static void
usage (const char *name)
{

View File

@ -6252,7 +6252,7 @@ verify_constructor_circularity (meth, current)
for (liste = list; liste; liste = TREE_CHAIN (liste))
{
parse_error_context
(TREE_PURPOSE (TREE_PURPOSE (liste)),
(TREE_PURPOSE (TREE_PURPOSE (liste)), "%s",
constructor_circularity_msg
(TREE_VALUE (liste), TREE_VALUE (TREE_PURPOSE (liste))));
java_error_count--;
@ -7618,9 +7618,8 @@ java_check_abstract_methods (interface_decl)
IDENTIFIER_POINTER
(DECL_NAME (TYPE_NAME (DECL_CONTEXT (found)))));
free (t);
continue;
DECL_NAME (found) = saved_found_wfl;
continue;
}
}
@ -10224,7 +10223,7 @@ lookup_method_invoke (lc, cl, class, name, arg_list)
method = make_node (FUNCTION_TYPE);
TYPE_ARG_TYPES (method) = atl;
signature = build_java_argument_signature (method);
dup = strdup (lang_printable_name (class, 0));
dup = xstrdup (lang_printable_name (class, 0));
parse_error_context (cl, "Can't find %s `%s(%s)' in type `%s'%s",
(lc ? "constructor" : "method"),
(lc ? dup : IDENTIFIER_POINTER (name)),

View File

@ -138,12 +138,12 @@ extern tree stabilize_reference PROTO ((tree));
/* Pedantic warning on obsolete modifiers. Note: when cl is NULL,
flags was set artificially, such as for a interface method */
#define OBSOLETE_MODIFIER_WARNING(cl, flags, modifier, format, arg) \
#define OBSOLETE_MODIFIER_WARNING(cl, flags, __modifier, format, arg) \
{ \
if (flag_redundant && (cl) && ((flags) & (modifier))) \
if (flag_redundant && (cl) && ((flags) & (__modifier))) \
parse_warning_context (cl, \
"Discouraged redundant use of `%s' modifier in declaration of " format, \
java_accstring_lookup (modifier), arg); \
java_accstring_lookup (__modifier), arg); \
}
/* Quickly build a temporary pointer on hypothetical type NAME. */

View File

@ -3649,7 +3649,7 @@ verify_constructor_circularity (meth, current)
for (liste = list; liste; liste = TREE_CHAIN (liste))
{
parse_error_context
(TREE_PURPOSE (TREE_PURPOSE (liste)),
(TREE_PURPOSE (TREE_PURPOSE (liste)), "%s",
constructor_circularity_msg
(TREE_VALUE (liste), TREE_VALUE (TREE_PURPOSE (liste))));
java_error_count--;
@ -5015,9 +5015,8 @@ java_check_abstract_methods (interface_decl)
IDENTIFIER_POINTER
(DECL_NAME (TYPE_NAME (DECL_CONTEXT (found)))));
free (t);
continue;
DECL_NAME (found) = saved_found_wfl;
continue;
}
}
@ -7621,7 +7620,7 @@ lookup_method_invoke (lc, cl, class, name, arg_list)
method = make_node (FUNCTION_TYPE);
TYPE_ARG_TYPES (method) = atl;
signature = build_java_argument_signature (method);
dup = strdup (lang_printable_name (class, 0));
dup = xstrdup (lang_printable_name (class, 0));
parse_error_context (cl, "Can't find %s `%s(%s)' in type `%s'%s",
(lc ? "constructor" : "method"),
(lc ? dup : IDENTIFIER_POINTER (name)),