< prev index next >

src/java.base/share/native/libzip/zlib/zutil.c

Print this page
*** 46,17 ***
      (z_const char *)"incompatible version",/* Z_VERSION_ERROR (-6) */
      (z_const char *)""
  };
  
  
! const char * ZEXPORT zlibVersion()
- {
      return ZLIB_VERSION;
  }
  
! uLong ZEXPORT zlibCompileFlags()
- {
      uLong flags;
  
      flags = 0;
      switch ((int)(sizeof(uInt))) {
      case 2:     break;
--- 46,15 ---
      (z_const char *)"incompatible version",/* Z_VERSION_ERROR (-6) */
      (z_const char *)""
  };
  
  
! const char * ZEXPORT zlibVersion(void) {
      return ZLIB_VERSION;
  }
  
! uLong ZEXPORT zlibCompileFlags(void) {
      uLong flags;
  
      flags = 0;
      switch ((int)(sizeof(uInt))) {
      case 2:     break;

*** 143,24 ***
  #  ifndef verbose
  #    define verbose 0
  #  endif
  int ZLIB_INTERNAL z_verbose = verbose;
  
! void ZLIB_INTERNAL z_error(m)
-     char *m;
- {
      fprintf(stderr, "%s\n", m);
      exit(1);
  }
  #endif
  
  /* exported to allow conversion of error code to string for compress() and
   * uncompress()
   */
! const char * ZEXPORT zError(err)
-     int err;
- {
      return ERR_MSG(err);
  }
  
  #if defined(_WIN32_WCE) && _WIN32_WCE < 0x800
      /* The older Microsoft C Run-Time Library for Windows CE doesn't have
--- 141,20 ---
  #  ifndef verbose
  #    define verbose 0
  #  endif
  int ZLIB_INTERNAL z_verbose = verbose;
  
! void ZLIB_INTERNAL z_error(char *m) {
      fprintf(stderr, "%s\n", m);
      exit(1);
  }
  #endif
  
  /* exported to allow conversion of error code to string for compress() and
   * uncompress()
   */
! const char * ZEXPORT zError(int err) {
      return ERR_MSG(err);
  }
  
  #if defined(_WIN32_WCE) && _WIN32_WCE < 0x800
      /* The older Microsoft C Run-Time Library for Windows CE doesn't have

*** 170,38 ***
      int errno = 0;
  #endif
  
  #ifndef HAVE_MEMCPY
  
! void ZLIB_INTERNAL zmemcpy(dest, source, len)
-     Bytef* dest;
-     const Bytef* source;
-     uInt  len;
- {
      if (len == 0) return;
      do {
          *dest++ = *source++; /* ??? to be unrolled */
      } while (--len != 0);
  }
  
! int ZLIB_INTERNAL zmemcmp(s1, s2, len)
-     const Bytef* s1;
-     const Bytef* s2;
-     uInt  len;
- {
      uInt j;
  
      for (j = 0; j < len; j++) {
          if (s1[j] != s2[j]) return 2*(s1[j] > s2[j])-1;
      }
      return 0;
  }
  
! void ZLIB_INTERNAL zmemzero(dest, len)
-     Bytef* dest;
-     uInt  len;
- {
      if (len == 0) return;
      do {
          *dest++ = 0;  /* ??? to be unrolled */
      } while (--len != 0);
  }
--- 164,27 ---
      int errno = 0;
  #endif
  
  #ifndef HAVE_MEMCPY
  
! void ZLIB_INTERNAL zmemcpy(Bytef* dest, const Bytef* source, uInt len) {
      if (len == 0) return;
      do {
          *dest++ = *source++; /* ??? to be unrolled */
      } while (--len != 0);
  }
  
! int ZLIB_INTERNAL zmemcmp(const Bytef* s1, const Bytef* s2, uInt len) {
      uInt j;
  
      for (j = 0; j < len; j++) {
          if (s1[j] != s2[j]) return 2*(s1[j] > s2[j])-1;
      }
      return 0;
  }
  
! void ZLIB_INTERNAL zmemzero(Bytef* dest, uInt len) {
      if (len == 0) return;
      do {
          *dest++ = 0;  /* ??? to be unrolled */
      } while (--len != 0);
  }

*** 238,12 ***
   * Since MSDOS is not a preemptive multitasking OS, this table is not
   * protected from concurrent access. This hack doesn't work anyway on
   * a protected system like OS/2. Use Microsoft C instead.
   */
  
! voidpf ZLIB_INTERNAL zcalloc(voidpf opaque, unsigned items, unsigned size)
- {
      voidpf buf;
      ulg bsize = (ulg)items*size;
  
      (void)opaque;
  
--- 221,11 ---
   * Since MSDOS is not a preemptive multitasking OS, this table is not
   * protected from concurrent access. This hack doesn't work anyway on
   * a protected system like OS/2. Use Microsoft C instead.
   */
  
! voidpf ZLIB_INTERNAL zcalloc(voidpf opaque, unsigned items, unsigned size) {
      voidpf buf;
      ulg bsize = (ulg)items*size;
  
      (void)opaque;
  

*** 264,12 ***
      *(ush*)&buf = 0;
      table[next_ptr++].new_ptr = buf;
      return buf;
  }
  
! void ZLIB_INTERNAL zcfree(voidpf opaque, voidpf ptr)
- {
      int n;
  
      (void)opaque;
  
      if (*(ush*)&ptr != 0) { /* object < 64K */
--- 246,11 ---
      *(ush*)&buf = 0;
      table[next_ptr++].new_ptr = buf;
      return buf;
  }
  
! void ZLIB_INTERNAL zcfree(voidpf opaque, voidpf ptr) {
      int n;
  
      (void)opaque;
  
      if (*(ush*)&ptr != 0) { /* object < 64K */

*** 301,18 ***
  #if (!defined(_MSC_VER) || (_MSC_VER <= 600))
  #  define _halloc  halloc
  #  define _hfree   hfree
  #endif
  
! voidpf ZLIB_INTERNAL zcalloc(voidpf opaque, uInt items, uInt size)
- {
      (void)opaque;
      return _halloc((long)items, size);
  }
  
! void ZLIB_INTERNAL zcfree(voidpf opaque, voidpf ptr)
- {
      (void)opaque;
      _hfree(ptr);
  }
  
  #endif /* M_I86 */
--- 282,16 ---
  #if (!defined(_MSC_VER) || (_MSC_VER <= 600))
  #  define _halloc  halloc
  #  define _hfree   hfree
  #endif
  
! voidpf ZLIB_INTERNAL zcalloc(voidpf opaque, uInt items, uInt size) {
      (void)opaque;
      return _halloc((long)items, size);
  }
  
! void ZLIB_INTERNAL zcfree(voidpf opaque, voidpf ptr) {
      (void)opaque;
      _hfree(ptr);
  }
  
  #endif /* M_I86 */

*** 321,29 ***
  
  
  #ifndef MY_ZCALLOC /* Any system without a special alloc function */
  
  #ifndef STDC
! extern voidp  malloc OF((uInt size));
! extern voidp  calloc OF((uInt items, uInt size));
! extern void   free   OF((voidpf ptr));
  #endif
  
! voidpf ZLIB_INTERNAL zcalloc(opaque, items, size)
-     voidpf opaque;
-     unsigned items;
-     unsigned size;
- {
      (void)opaque;
      return sizeof(uInt) > 2 ? (voidpf)malloc(items * size) :
                                (voidpf)calloc(items, size);
  }
  
! void ZLIB_INTERNAL zcfree(opaque, ptr)
-     voidpf opaque;
-     voidpf ptr;
- {
      (void)opaque;
      free(ptr);
  }
  
  #endif /* MY_ZCALLOC */
--- 300,22 ---
  
  
  #ifndef MY_ZCALLOC /* Any system without a special alloc function */
  
  #ifndef STDC
! extern voidp malloc(uInt size);
! extern voidp calloc(uInt items, uInt size);
! extern void free(voidpf ptr);
  #endif
  
! voidpf ZLIB_INTERNAL zcalloc(voidpf opaque, unsigned items, unsigned size) {
      (void)opaque;
      return sizeof(uInt) > 2 ? (voidpf)malloc(items * size) :
                                (voidpf)calloc(items, size);
  }
  
! void ZLIB_INTERNAL zcfree(voidpf opaque, voidpf ptr) {
      (void)opaque;
      free(ptr);
  }
  
  #endif /* MY_ZCALLOC */
< prev index next >