natInflater.cc (inflate): Cast `len' to unsigned.
* java/util/zip/natInflater.cc (inflate): Cast `len' to unsigned. Include <stdlib.h>. * java/util/zip/natDeflater.cc (deflate): Cast `len' to unsigned. Include <stdlib.h>. (update): Fail in default case. Always initialize `strat'. From-SVN: r27028
This commit is contained in:
parent
6bdb8141ec
commit
6ada3468d8
3 changed files with 13 additions and 3 deletions
|
@ -13,6 +13,7 @@ details. */
|
|||
#include <config.h>
|
||||
|
||||
#include <zlib.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <cni.h>
|
||||
#include <jvm.h>
|
||||
|
@ -47,7 +48,7 @@ java::util::zip::Deflater::deflate (jbyteArray buf, jint off, jint len)
|
|||
{
|
||||
case Z_STREAM_END:
|
||||
is_finished = true;
|
||||
if (s->avail_out == len)
|
||||
if (s->avail_out == (unsigned int) len)
|
||||
return -1;
|
||||
break;
|
||||
|
||||
|
@ -160,7 +161,7 @@ java::util::zip::Deflater::update ()
|
|||
JvSynchronize sync (this);
|
||||
z_streamp s = (z_streamp) zstream;
|
||||
|
||||
int strat;
|
||||
int strat = Z_DEFAULT_STRATEGY;
|
||||
switch (strategy)
|
||||
{
|
||||
case DEFAULT_STRATEGY:
|
||||
|
@ -172,6 +173,8 @@ java::util::zip::Deflater::update ()
|
|||
case HUFFMAN_ONLY:
|
||||
strat = Z_HUFFMAN_ONLY;
|
||||
break;
|
||||
default:
|
||||
JvFail ("unexpected strategy");
|
||||
}
|
||||
|
||||
// Ignore errors.
|
||||
|
|
|
@ -13,6 +13,7 @@ details. */
|
|||
#include <config.h>
|
||||
|
||||
#include <zlib.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <cni.h>
|
||||
#include <jvm.h>
|
||||
|
@ -104,7 +105,7 @@ java::util::zip::Inflater::inflate (jbyteArray buf, jint off, jint len)
|
|||
{
|
||||
case Z_STREAM_END:
|
||||
is_finished = true;
|
||||
if (s->avail_out == len)
|
||||
if (s->avail_out == (unsigned int) len)
|
||||
return -1;
|
||||
break;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue