harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hinde...@apache.org
Subject svn commit: r454712 - in /incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/native: gl/shared/gifdecoder.c gl/shared/pngdecoder.c jpegdecoder/shared/JpegDecoder.c lcmm/shared/NativeCMM.c
Date Tue, 10 Oct 2006 11:52:36 GMT
Author: hindessm
Date: Tue Oct 10 04:52:36 2006
New Revision: 454712

URL: http://svn.apache.org/viewvc?view=rev&rev=454712
Log:
Fixing some linux C compiler warnings.

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/native/gl/shared/gifdecoder.c
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/native/gl/shared/pngdecoder.c
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/native/jpegdecoder/shared/JpegDecoder.c
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/native/lcmm/shared/NativeCMM.c

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/native/gl/shared/gifdecoder.c
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/native/gl/shared/gifdecoder.c?view=diff&rev=454712&r1=454711&r2=454712
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/native/gl/shared/gifdecoder.c
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/native/gl/shared/gifdecoder.c
Tue Oct 10 04:52:36 2006
@@ -21,6 +21,7 @@
  */
 
 #include "gifdecoder.h"
+#include "hycomp.h"
 
 /*
  * Class:     org_apache_harmony_awt_gl_image_GifDecoder
@@ -78,7 +79,7 @@
 (JNIEnv *env, jclass cls, jlong hDecoder) {
   // Cleanup if image was truncated
   if(hDecoder)
-    free((GifDecoder *) hDecoder);
+    free((GifDecoder *) ((IDATA)hDecoder));
 }
 
 /*
@@ -96,7 +97,7 @@
  jobject currBlock) {
 
   GIF_RETVAL retval = STATUS_OK;
-  GifDecoder *decoder = getDecoder(env, obj, dataStream, (GifDecoder*) hDecoder);
+  GifDecoder *decoder = getDecoder(env, obj, dataStream, (GifDecoder*) ((IDATA)hDecoder));
   int scanlinesDecoded;    
 
   decoder->input = decoder->inputPtr = 
@@ -210,7 +211,7 @@
     decoder = NULL;    
   }
 
-  (*env)->SetLongField(env, obj, img_GIF_hNativeDecoderID, (jlong) decoder);
+  (*env)->SetLongField(env, obj, img_GIF_hNativeDecoderID, (jlong) ((IDATA)decoder));
 
   return scanlinesDecoded;
 }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/native/gl/shared/pngdecoder.c
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/native/gl/shared/pngdecoder.c?view=diff&rev=454712&r1=454711&r2=454712
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/native/gl/shared/pngdecoder.c
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/native/gl/shared/pngdecoder.c
Tue Oct 10 04:52:36 2006
@@ -49,7 +49,7 @@
  */
 JNIEXPORT jlong JNICALL Java_org_apache_harmony_awt_gl_image_PngDecoder_decode
 (JNIEnv *env, jobject obj, jbyteArray jInput, jint bytesInBuffer, jlong hDecoder) {  
-  png_decoder_info_ptr decoderInfo = (png_decoder_info_ptr) hDecoder;
+  png_decoder_info_ptr decoderInfo = (png_decoder_info_ptr) ((IDATA)hDecoder);
   
   // Init decoder if needed
   if(!decoderInfo) {
@@ -92,7 +92,7 @@
   if(decoderInfo->doneDecoding)
     destroyPng(&decoderInfo);
 
-  return (jlong) decoderInfo;
+  return (jlong) ((IDATA)decoderInfo);
 }
 
 /*
@@ -102,7 +102,7 @@
  */
 JNIEXPORT void JNICALL Java_org_apache_harmony_awt_gl_image_PngDecoder_releaseNativeDecoder
 (JNIEnv *env, jclass cls, jlong hDecoder) {
-  png_decoder_info_ptr decoderInfo = (png_decoder_info_ptr) hDecoder;
+  png_decoder_info_ptr decoderInfo = (png_decoder_info_ptr) ((IDATA)hDecoder);
 }
 
 void releaseArrays(png_decoder_info_ptr decoderInfo) {

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/native/jpegdecoder/shared/JpegDecoder.c
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/native/jpegdecoder/shared/JpegDecoder.c?view=diff&rev=454712&r1=454711&r2=454712
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/native/jpegdecoder/shared/JpegDecoder.c
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/native/jpegdecoder/shared/JpegDecoder.c
Tue Oct 10 04:52:36 2006
@@ -284,7 +284,7 @@
 JNIEXPORT void JNICALL Java_org_apache_harmony_awt_gl_image_JpegDecoder_releaseNativeDecoder
 (JNIEnv *env, jclass cls, jlong hglDecompress) {
   // Cleanup if image was truncated
-  gl_decompress_struct *glDecompress = (gl_decompress_struct*) hglDecompress;
+  gl_decompress_struct *glDecompress = (gl_decompress_struct*) ((IDATA)hglDecompress);
   if(glDecompress) {
     gl_decompress_struct_destroy(glDecompress);
     free(glDecompress);
@@ -310,7 +310,9 @@
   jbyteArray byteOut = NULL;
   jintArray intOut = NULL;
 
-  gl_decompress_struct *glDecompress = (gl_decompress_struct*) hglDecompress;
+  gl_decompress_struct *glDecompress =
+    (gl_decompress_struct*) ((IDATA)hglDecompress);
+
   if(glDecompress == NULL) {
     gl_decompress_struct_init(&glDecompress);
     if(glDecompress == NULL) { // Out of memory
@@ -322,7 +324,7 @@
   // Silently skip data if EOF already encountered
   if(glDecompress->srcMgr.at_eof) {
     (*env)->SetIntField(env, obj, img_JPEG_bytesConsumedID, bytesInBuffer);
-        (*env)->SetLongField(env, obj, img_JPEG_hNativeDecoderID, (jlong) glDecompress);
+    (*env)->SetLongField(env, obj, img_JPEG_hNativeDecoderID, (jlong) ((IDATA)glDecompress));
     RETURN_JAVA_ARRAY;
     }
 
@@ -383,7 +385,7 @@
         assert(0); // This is illegal
 
       (*env)->SetIntField(env, obj, img_JPEG_bytesConsumedID, consumed);
-            (*env)->SetLongField(env, obj, img_JPEG_hNativeDecoderID, (jlong) glDecompress);
+      (*env)->SetLongField(env, obj, img_JPEG_hNativeDecoderID, (jlong) ((IDATA)glDecompress));
       RETURN_JAVA_ARRAY;
         }
     } // if(glDecompress->srcMgr.skip_input_bytes)
@@ -503,7 +505,7 @@
 
         if(glDecompress->srcMgr.decoding_done) { // Decoding done, just keep eating input
data
       (*env)->SetIntField(env, obj, img_JPEG_bytesConsumedID, consumed);
-        (*env)->SetLongField(env, obj, img_JPEG_hNativeDecoderID, (jlong) glDecompress);
+      (*env)->SetLongField(env, obj, img_JPEG_hNativeDecoderID, (jlong) ((IDATA)glDecompress));
       RETURN_JAVA_ARRAY;
         }
 
@@ -594,6 +596,6 @@
     glDecompress->srcMgr.valid_buffer_length = (int) glDecompress->srcMgr.base.bytes_in_buffer;
  
   (*env)->SetIntField(env, obj, img_JPEG_bytesConsumedID, consumed);
-    (*env)->SetLongField(env, obj, img_JPEG_hNativeDecoderID, (jlong) glDecompress);
+  (*env)->SetLongField(env, obj, img_JPEG_hNativeDecoderID, (jlong) ((IDATA)glDecompress));
   RETURN_JAVA_ARRAY;
 }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/native/lcmm/shared/NativeCMM.c
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/native/lcmm/shared/NativeCMM.c?view=diff&rev=454712&r1=454711&r2=454712
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/native/lcmm/shared/NativeCMM.c
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/native/lcmm/shared/NativeCMM.c
Tue Oct 10 04:52:36 2006
@@ -59,8 +59,8 @@
     if(hProfile == NULL)
         newCMMException(env, errMsg); // Throw java exception if error occured
 
-    // Return obtained handle
-  return (jlong) hProfile;
+  // Return obtained handle
+  return (jlong) ((IDATA)hProfile);
 }
 
 /*
@@ -71,7 +71,7 @@
 JNIEXPORT void JNICALL 
     Java_org_apache_harmony_awt_gl_color_NativeCMM_cmmCloseProfile(JNIEnv *env, jclass cls,
jlong profileID)
 {
-    cmsHPROFILE hProfile = (cmsHPROFILE) profileID;
+  cmsHPROFILE hProfile = (cmsHPROFILE) ((IDATA)profileID);
 
     if(!cmsCloseProfile(hProfile))
         newCMMException(env, errMsg); // Throw java exception if error occured
@@ -85,7 +85,7 @@
 JNIEXPORT jint JNICALL 
     Java_org_apache_harmony_awt_gl_color_NativeCMM_cmmGetProfileSize(JNIEnv *env, jclass
cls, jlong profileID)
 {
-    cmsHPROFILE hProfile = (cmsHPROFILE) profileID;
+  cmsHPROFILE hProfile = (cmsHPROFILE) ((IDATA)profileID);
   return (jint) cmmGetProfileSize(hProfile);
 }
 
@@ -100,7 +100,7 @@
     jlong profileID,
     jbyteArray data)
 {
-    cmsHPROFILE hProfile = (cmsHPROFILE) profileID;
+    cmsHPROFILE hProfile = (cmsHPROFILE) ((IDATA)profileID);
     unsigned profileSize = (unsigned) (*env)->GetArrayLength (env, data);
     jbyte *byteData = (*env)->GetByteArrayElements(env, data, 0);
 
@@ -119,7 +119,7 @@
 {
   size_t dataSize = (*env)->GetArrayLength(env, data);
     icTagSignature ts = tagSignature;
-  cmsHPROFILE hProfile = (cmsHPROFILE) profileID;
+    cmsHPROFILE hProfile = (cmsHPROFILE) ((IDATA)profileID);
     jbyte *byteData = (*env)->GetByteArrayElements (env, data, 0);
 
 
@@ -146,7 +146,7 @@
 
     long size;
     icTagSignature ts = tagSignature;
-    cmsHPROFILE hProfile = (cmsHPROFILE) profileID;
+    cmsHPROFILE hProfile = (cmsHPROFILE) ((IDATA)profileID);
 
     if (ts == HEADER_TAG_ID) {
         size = HEADER_SIZE;
@@ -168,7 +168,7 @@
 JNIEXPORT void JNICALL Java_org_apache_harmony_awt_gl_color_NativeCMM_cmmSetProfileElement
   (JNIEnv *env, jclass cls, jlong profileID, jint tagSignature, jbyteArray data)
 {
-    cmsHPROFILE hProfile = (cmsHPROFILE) profileID;
+    cmsHPROFILE hProfile = (cmsHPROFILE) ((IDATA)profileID);
     jbyte *byteData = (*env)->GetByteArrayElements (env, data, 0);
     size_t dataSize = (*env)->GetArrayLength(env, data);
     icTagSignature ts = tagSignature;
@@ -206,7 +206,7 @@
     // Convert to appropriate size
     cmsHPROFILE *profileHandles = malloc(sizeof(cmsHPROFILE)*nProfiles);
     for(i=0; i<nProfiles; i++) {
-        profileHandles[i] = (cmsHPROFILE) profileHandlesData[i];
+      profileHandles[i] = (cmsHPROFILE) ((IDATA)profileHandlesData[i]);
     }
 
   // XXX - Todo - consider getting all rendering intents
@@ -223,7 +223,7 @@
   if(xform == NULL) 
     newCMMException(env, "Can't create ICC transform"); // Throw java exception
 
-  return (jlong) xform;
+  return (jlong) ((IDATA)xform);
 }
 
 /*
@@ -234,7 +234,7 @@
 JNIEXPORT void JNICALL Java_org_apache_harmony_awt_gl_color_NativeCMM_cmmDeleteTransform
   (JNIEnv *env, jclass cls, jlong transformHandle)
 {
-    cmsHTRANSFORM xform = (cmsHTRANSFORM) transformHandle;
+    cmsHTRANSFORM xform = (cmsHTRANSFORM) ((IDATA)transformHandle);
 
     if(xform != NULL) {
         cmsDeleteTransform(xform);
@@ -344,7 +344,7 @@
   BOOL copyAlpha = FALSE;
   BOOL fillAlpha = FALSE;
 
-    cmsHTRANSFORM xform = (cmsHTRANSFORM) transformHandle;
+    cmsHTRANSFORM xform = (cmsHTRANSFORM) ((IDATA)transformHandle);
 
 
     srcFormat = getImageFormat(env, src);



Mime
View raw message