OSDN Git Service

* boehm.c (set_bit): Improve type safety wrt unsignedness.
[pf3gnuchains/gcc-fork.git] / gcc / java / jcf-io.c
index cb56c09..0b21092 100644 (file)
@@ -120,7 +120,6 @@ opendir_in_zip (const char *zipfile, int is_system)
   zipf->next = SeenZipFiles;
   zipf->name = (char*)(zipf+1);
   strcpy (zipf->name, zipfile);
-  SeenZipFiles = zipf;
   fd = open (zipfile, O_RDONLY | O_BINARY);
   zipf->fd = fd;
   if (fd < 0)
@@ -140,6 +139,8 @@ opendir_in_zip (const char *zipfile, int is_system)
       if (read_zip_archive (zipf) != 0)
        return NULL;
     }
+
+  SeenZipFiles = zipf;  
   return zipf;
 }
 
@@ -214,7 +215,7 @@ read_zip_member (JCF *jcf,  ZipDirectory *zipd, ZipFile *zipf)
       jcf->read_ptr = jcf->buffer;
       jcf->read_end = jcf->buffer_end;
       buffer = ALLOC (zipd->size);
-      d_stream.next_in = buffer;
+      d_stream.next_in = (unsigned char *) buffer;
       d_stream.avail_in = zipd->size;
       if (lseek (zipf->fd, zipd->filestart, 0) < 0
          || read (zipf->fd, buffer, zipd->size) != (long) zipd->size)
@@ -336,7 +337,7 @@ caching_stat (char *filename, struct stat *buf)
 {
 #if JCF_USE_SCANDIR
   char *sep;
-  char origsep;
+  char origsep = 0;
   char *base;
   memoized_dirlist_entry *dent;
   void **slot;
@@ -514,7 +515,8 @@ find_class (const char *classname, int classname_length, JCF *jcf,
          strcpy (java_buffer, path_name);
          l = strlen (java_buffer);
          for (m = 0; m < classname_length; ++m)
-           java_buffer[m + l] = (classname[m] == '.' ? '/' : classname[m]);
+           java_buffer[m + l] = (classname[m] == '.'
+                                 ? DIR_SEPARATOR : classname[m]);
          strcpy (java_buffer + m + l, ".java");
          java = caching_stat (java_buffer, &java_buf);
          if (java == 0)
@@ -544,7 +546,7 @@ find_class (const char *classname, int classname_length, JCF *jcf,
                              classname+classname_length-
                              (classname_length <= 30 ? 
                               classname_length : 30)));
-      fd = open (buffer, O_RDONLY | O_BINARY);
+      fd = JCF_OPEN_EXACT_CASE (buffer, O_RDONLY | O_BINARY);
       if (fd >= 0)
        goto found;
     }
@@ -556,7 +558,7 @@ find_class (const char *classname, int classname_length, JCF *jcf,
                              classname+classname_length-
                              (classname_length <= 30 ? 
                               classname_length : 30)));
-      fd = open (buffer, O_RDONLY);
+      fd = JCF_OPEN_EXACT_CASE (buffer, O_RDONLY);
       if (fd >= 0)
        {
          jcf->java_source = 1;
@@ -618,7 +620,7 @@ jcf_print_char (FILE *stream, int ch)
 /* Print UTF8 string at STR of length LENGTH bytes to STREAM. */
 
 void
-jcf_print_utf8 (FILE *stream, register const unsigned char *str, int length)
+jcf_print_utf8 (FILE *stream, const unsigned char *str, int length)
 {
   const unsigned char * limit = str + length;
   while (str < limit)
@@ -712,7 +714,7 @@ format_uint (char *buffer, uint64 value, int base)
 {
 #define WRITE_BUF_SIZE (4 + sizeof(uint64) * 8)
   char buf[WRITE_BUF_SIZE];
-  register char *buf_ptr = buf+WRITE_BUF_SIZE; /* End of buf. */
+  char *buf_ptr = buf+WRITE_BUF_SIZE; /* End of buf. */
   int chars_written;
   int i;