From e6ab539b1d927452ad2ace3bc31cbe30ae70e01a Mon Sep 17 00:00:00 2001 From: DRC Date: Wed, 2 Mar 2011 01:30:38 +0000 Subject: [PATCH] Fix compiler warnings in Visual C++ git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@485 632fc199-4ca6-4c93-a231-07263d6284db --- turbojpeg-jni.c | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/turbojpeg-jni.c b/turbojpeg-jni.c index 234e8d8..b190f04 100644 --- a/turbojpeg-jni.c +++ b/turbojpeg-jni.c @@ -98,7 +98,7 @@ JNIEXPORT jint JNICALL Java_org_libjpegturbo_turbojpeg_TJCompressor_compress___3 jint flags) { tjhandle handle=0; int pixelsize; - unsigned long size=0, arraysize=0; + unsigned long size=0; jsize arraysize=0; unsigned char *srcbuf=NULL, *dstbuf=NULL; gethandle(); @@ -112,7 +112,7 @@ JNIEXPORT jint JNICALL Java_org_libjpegturbo_turbojpeg_TJCompressor_compress___3 arraysize=(pitch==0)? width*pixelsize*height:pitch*height; if((*env)->GetArrayLength(env, src)GetArrayLength(env, dst)GetArrayLength(env, dst)<(jsize)TJBUFSIZE(width, height)) _throw("Destination buffer is not large enough"); bailif0(srcbuf=(*env)->GetPrimitiveArrayCritical(env, src, 0)); @@ -138,7 +138,7 @@ JNIEXPORT jint JNICALL Java_org_libjpegturbo_turbojpeg_TJCompressor_compress___3 jint flags) { tjhandle handle=0; - unsigned long size=0, arraysize=0; + unsigned long size=0; jsize arraysize=0; unsigned char *srcbuf=NULL, *dstbuf=NULL; gethandle(); @@ -153,7 +153,7 @@ JNIEXPORT jint JNICALL Java_org_libjpegturbo_turbojpeg_TJCompressor_compress___3 arraysize=(pitch==0)? width*height:pitch*height; if((*env)->GetArrayLength(env, src)GetArrayLength(env, dst)GetArrayLength(env, dst)<(jsize)TJBUFSIZE(width, height)) _throw("Destination buffer is not large enough"); bailif0(srcbuf=(*env)->GetPrimitiveArrayCritical(env, src, 0)); @@ -178,7 +178,7 @@ JNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJCompressor_encodeYUV___ jint height, jint pf, jbyteArray dst, jint subsamp, jint flags) { tjhandle handle=0; int pixelsize; - unsigned long arraysize=0; + jsize arraysize=0; unsigned char *srcbuf=NULL, *dstbuf=NULL; gethandle(); @@ -192,7 +192,8 @@ JNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJCompressor_encodeYUV___ arraysize=(pitch==0)? width*pixelsize*height:pitch*height; if((*env)->GetArrayLength(env, src)GetArrayLength(env, dst)GetArrayLength(env, dst) + <(jsize)TJBUFSIZEYUV(width, height, subsamp)) _throw("Destination buffer is not large enough"); bailif0(srcbuf=(*env)->GetPrimitiveArrayCritical(env, src, 0)); @@ -217,7 +218,7 @@ JNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJCompressor_encodeYUV___ jint height, jint pf, jbyteArray dst, jint subsamp, jint flags) { tjhandle handle=0; - unsigned long arraysize=0; + jsize arraysize=0; unsigned char *srcbuf=NULL, *dstbuf=NULL; gethandle(); @@ -232,7 +233,8 @@ JNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJCompressor_encodeYUV___ arraysize=(pitch==0)? width*height:pitch*height; if((*env)->GetArrayLength(env, src)GetArrayLength(env, dst)GetArrayLength(env, dst) + <(jsize)TJBUFSIZEYUV(width, height, subsamp)) _throw("Destination buffer is not large enough"); bailif0(srcbuf=(*env)->GetPrimitiveArrayCritical(env, src, 0)); @@ -349,7 +351,7 @@ JNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompress jint width, jint pitch, jint height, jint pf, jint flags) { tjhandle handle=0; int pixelsize; - unsigned long arraysize=0; + jsize arraysize=0; unsigned char *srcbuf=NULL, *dstbuf=NULL; gethandle(); @@ -387,7 +389,7 @@ JNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompress jint width, jint pitch, jint height, jint pf, jint flags) { tjhandle handle=0; - unsigned long arraysize=0; + jsize arraysize=0; unsigned char *srcbuf=NULL, *dstbuf=NULL; gethandle(); @@ -440,7 +442,7 @@ JNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompress bailif0(_fid=(*env)->GetFieldID(env, _cls, "jpegHeight", "I")); jpegHeight=(int)(*env)->GetIntField(env, obj, _fid); if((*env)->GetArrayLength(env, dst) - GetPrimitiveArrayCritical(env, src, 0)); -- 2.40.0