< prev index next >

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

Print this page
*** 41,17 ***
  
       compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
     memory, Z_BUF_ERROR if there was not enough room in the output buffer,
     Z_STREAM_ERROR if the level parameter is invalid.
  */
! int ZEXPORT compress2(dest, destLen, source, sourceLen, level)
!     Bytef *dest;
-     uLongf *destLen;
-     const Bytef *source;
-     uLong sourceLen;
-     int level;
- {
      z_stream stream;
      int err;
      const uInt max = (uInt)-1;
      uLong left;
  
--- 41,12 ---
  
       compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
     memory, Z_BUF_ERROR if there was not enough room in the output buffer,
     Z_STREAM_ERROR if the level parameter is invalid.
  */
! int ZEXPORT compress2(Bytef *dest, uLongf *destLen, const Bytef *source,
!                       uLong sourceLen, int level) {
      z_stream stream;
      int err;
      const uInt max = (uInt)-1;
      uLong left;
  

*** 87,24 ***
      return err == Z_STREAM_END ? Z_OK : err;
  }
  
  /* ===========================================================================
   */
! int ZEXPORT compress(dest, destLen, source, sourceLen)
!     Bytef *dest;
-     uLongf *destLen;
-     const Bytef *source;
-     uLong sourceLen;
- {
      return compress2(dest, destLen, source, sourceLen, Z_DEFAULT_COMPRESSION);
  }
  
  /* ===========================================================================
       If the default memLevel or windowBits for deflateInit() is changed, then
     this function needs to be updated.
   */
! uLong ZEXPORT compressBound(sourceLen)
-     uLong sourceLen;
- {
      return sourceLen + (sourceLen >> 12) + (sourceLen >> 14) +
             (sourceLen >> 25) + 13;
  }
--- 82,18 ---
      return err == Z_STREAM_END ? Z_OK : err;
  }
  
  /* ===========================================================================
   */
! int ZEXPORT compress(Bytef *dest, uLongf *destLen, const Bytef *source,
!                      uLong sourceLen) {
      return compress2(dest, destLen, source, sourceLen, Z_DEFAULT_COMPRESSION);
  }
  
  /* ===========================================================================
       If the default memLevel or windowBits for deflateInit() is changed, then
     this function needs to be updated.
   */
! uLong ZEXPORT compressBound(uLong sourceLen) {
      return sourceLen + (sourceLen >> 12) + (sourceLen >> 14) +
             (sourceLen >> 25) + 13;
  }
< prev index next >