java patch: fix class archive regression

Anthony Green green@redhat.com
Wed Nov 1 00:52:00 GMT 2000


Parsing class archives used to depend on the global variable `finput' being 
set.  I believe the recent iconv changes removed the code which set finput. 
 This patch changes jar file processing so it does not depend on this 
global variable anymore.

There's still one more problem with compiling jar/zip files directly which 
I will try to address in a different patch some time soon.


2000-11-01  Anthony Green  <green@redhat.com>

	* jcf-parse.c (process_zip_dir): Add finput parameter.
	(jcf_figure_file_type): Call process_zip_dir with appropriate
	argument.

Index: gcc/java/jcf-parse.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/java/jcf-parse.c,v
retrieving revision 1.60
diff -u -r1.60 jcf-parse.c
--- jcf-parse.c	2000/10/19 04:19:09	1.60
+++ jcf-parse.c	2000/11/01 08:10:42
@@ -82,7 +82,7 @@
 /* Declarations of some functions used here.  */
 static tree give_name_to_class PARAMS ((JCF *jcf, int index));
 static void parse_zip_file_entries PARAMS ((void));
-static void process_zip_dir PARAMS ((void));
+static void process_zip_dir PARAMS ((FILE *));
 static void parse_source_file PARAMS ((tree, FILE *));
 static void jcf_parse_source PARAMS ((void));
 static int jcf_figure_file_type PARAMS ((JCF *));
@@ -965,7 +965,8 @@
 /* Read all the entries of the zip file, creates a class and a JCF. Sets 
the
    jcf up for further processing and link it to the created class.  */

-static void process_zip_dir()
+static void
+process_zip_dir (FILE *finput)
 {
   int i;
   ZipDirectory *zdir;
@@ -1071,7 +1072,8 @@
       localToFile = ALLOC (sizeof (struct ZipFileCache));
       bcopy ((PTR) SeenZipFiles, (PTR) localToFile,
 	     sizeof (struct ZipFileCache));
-      process_zip_dir ();	/* Register all the class defined there */
+      /* Register all the class defined there.  */
+      process_zip_dir (jcf->read_state);
       return JCF_ZIP;
     }




More information about the Gcc-patches mailing list