harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hinde...@apache.org
Subject svn commit: r448164 - in /incubator/harmony/enhanced/classlib/trunk/modules: awt/src/main/native/linuxfont/linux/ luni/src/main/native/luni/linux/ luni/src/main/native/luni/shared/ luni/src/main/native/vmls/shared/ nio/src/main/native/nio/shared/ text/...
Date Wed, 20 Sep 2006 11:19:52 GMT
Author: hindessm
Date: Wed Sep 20 04:19:51 2006
New Revision: 448164

URL: http://svn.apache.org/viewvc?view=rev&rev=448164
Log:
Fixing some C/C++ compiler warnings on Linux.

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/native/linuxfont/linux/LinuxNativeFont.c
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/linux/OSFileSystemLinux32.c
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/linux/OSMemoryLinux32.c
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/linux/hyenv.c
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/OSFileSystem.c
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/OSNetworkSystem.c
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/nethelp.c
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/vmls/shared/vmls.c
    incubator/harmony/enhanced/classlib/trunk/modules/nio/src/main/native/nio/shared/AddressUtil.c
    incubator/harmony/enhanced/classlib/trunk/modules/text/src/main/native/text/shared/BidiWrapper.c

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/native/linuxfont/linux/LinuxNativeFont.c
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/native/linuxfont/linux/LinuxNativeFont.c?view=diff&rev=448164&r1=448163&r2=448164
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/native/linuxfont/linux/LinuxNativeFont.c
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/native/linuxfont/linux/LinuxNativeFont.c
Wed Sep 20 04:19:51 2006
@@ -676,7 +676,6 @@
     FT_Face face;
     const int BUF_SIZE = 64;
     char name[BUF_SIZE];
-    char fStr[6] = "%s %s";
 
     if(!xftFnt){
         return 0;
@@ -686,7 +685,7 @@
     if(!face)
         return 0;
     
-    snprintf(name, BUF_SIZE, &fStr, face->family_name, face->style_name);
+    snprintf(name, BUF_SIZE, "%s %s", face->family_name, face->style_name);
 
 #ifdef DEBUG
         printf("Face name = %s\n", name);

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/linux/OSFileSystemLinux32.c
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/linux/OSFileSystemLinux32.c?view=diff&rev=448164&r1=448163&r2=448164
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/linux/OSFileSystemLinux32.c
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/linux/OSFileSystemLinux32.c
Wed Sep 20 04:19:51 2006
@@ -157,7 +157,7 @@
   offsets = (*env)->GetIntArrayElements(env, joffsets, &offsetsCopied);
   lengths = (*env)->GetIntArrayElements(env, jlengths, &lengthsCopied);
   while(i < size){
-    vectors[i].iov_base = (void *)(bufs[i]+offsets[i]);
+    vectors[i].iov_base = (void *)((IDATA)(bufs[i]+offsets[i]));
     vectors[i].iov_len = lengths[i];
     i++;
   }
@@ -199,7 +199,7 @@
   offsets = (*env)->GetIntArrayElements(env, joffsets, &offsetsCopied);
   lengths = (*env)->GetIntArrayElements(env, jlengths, &lengthsCopied);
   while(i < size){
-    vectors[i].iov_base = (void *)(bufs[i]+offsets[i]);
+    vectors[i].iov_base = (void *)((IDATA)(bufs[i]+offsets[i]));
     vectors[i].iov_len = lengths[i];
     i++;
   }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/linux/OSMemoryLinux32.c
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/linux/OSMemoryLinux32.c?view=diff&rev=448164&r1=448163&r2=448164
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/linux/OSMemoryLinux32.c
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/linux/OSMemoryLinux32.c
Wed Sep 20 04:19:51 2006
@@ -60,9 +60,9 @@
 
 JNIEXPORT jint JNICALL Java_org_apache_harmony_luni_platform_OSMemory_loadImpl
   (JNIEnv * env, jobject thiz, jlong addr, jlong size){
-   if(mlock((void *)addr, size)!=-1)
+   if(mlock((void *)((IDATA)addr), size)!=-1)
    {
-      if(munlock((void *)addr,size)!=-1)
+      if(munlock((void *)((IDATA)addr),size)!=-1)
 	      return 0;  /*normally*/
    }
    else{
@@ -100,7 +100,7 @@
 
 JNIEXPORT jint JNICALL Java_org_apache_harmony_luni_platform_OSMemory_flushImpl
   (JNIEnv * env, jobject thiz, jlong addr, jlong size){
-  return msync((void *)addr, size, MS_SYNC);
+  return msync((void *)((IDATA)addr), size, MS_SYNC);
 };
 
 /*
@@ -111,7 +111,7 @@
 JNIEXPORT void JNICALL Java_org_apache_harmony_luni_platform_OSMemory_unmapImpl
   (JNIEnv * env, jobject thiz, jlong addr, jlong size)
 {
-    munmap((void *)addr, (size_t)size); 
+    munmap((void *)((IDATA)addr), (size_t)size); 
 }
 
 /*
@@ -150,6 +150,6 @@
     {
       return -1;
     }
-  return (jlong) mapAddress;
+  return (jlong) ((IDATA)mapAddress);
 }
 

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/linux/hyenv.c
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/linux/hyenv.c?view=diff&rev=448164&r1=448163&r2=448164
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/linux/hyenv.c
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/linux/hyenv.c
Wed Sep 20 04:19:51 2006
@@ -15,6 +15,7 @@
 #include <string.h>
 #include <vmi.h>
 #include "hyenv.h"
+#include <stdlib.h>
 
 JNIEXPORT jbyteArray JNICALL Java_org_apache_harmony_luni_platform_Environment_getEnvBytes
   (JNIEnv *env, jclass obj){

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/OSFileSystem.c
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/OSFileSystem.c?view=diff&rev=448164&r1=448163&r2=448164
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/OSFileSystem.c
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/OSFileSystem.c
Wed Sep 20 04:19:51 2006
@@ -33,7 +33,9 @@
   (JNIEnv * env, jobject thiz, jlong fd, jlong buf, jint offset, jint nbytes)
 {
   PORT_ACCESS_FROM_ENV (env);
-  return (jlong) hyfile_read ((IDATA) fd, (void *) (buf+offset), (IDATA) nbytes);
+  return (jlong) hyfile_read ((IDATA) fd,
+                              (void *) ((IDATA)(buf+offset)),
+                              (IDATA) nbytes);
 }
 
 /*
@@ -45,7 +47,8 @@
   (JNIEnv * env, jobject thiz, jlong fd, jlong buf, jint offset, jint nbytes)
 {
   PORT_ACCESS_FROM_ENV (env);
-  return (jlong) hyfile_write ((IDATA) fd, (const void *) (buf+offset),
+  return (jlong) hyfile_write ((IDATA) fd,
+                               (const void *) ((IDATA)(buf+offset)),
                                (IDATA) nbytes);
 }
 

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/OSNetworkSystem.c
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/OSNetworkSystem.c?view=diff&rev=448164&r1=448163&r2=448164
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/OSNetworkSystem.c
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/OSNetworkSystem.c
Wed Sep 20 04:19:51 2006
@@ -186,7 +186,7 @@
   jfieldID descriptorFID;
   descriptorCLS	= (*env)->FindClass (env, "java/lang/Long");
   descriptorFID	= (*env)->GetFieldID (env, descriptorCLS, "value","J");	
-  (*env)->SetLongField(env,  longclass,	descriptorFID,(jlong)context);
+  (*env)->SetLongField(env,  longclass,	descriptorFID,(jlong)((IDATA)context));
 };
 
 /**
@@ -201,7 +201,7 @@
   jfieldID descriptorFID;
   descriptorCLS	= (*env)->FindClass (env, "java/lang/Long");
   descriptorFID	= (*env)->GetFieldID (env, descriptorCLS, "value", "J");
-  return  (void	*) ((*env)->GetLongField (env, longclass, descriptorFID));
+  return (void*) ((IDATA)((*env)->GetLongField(env, longclass, descriptorFID)));
 };
 
 /**

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/nethelp.c
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/nethelp.c?view=diff&rev=448164&r1=448163&r2=448164
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/nethelp.c
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/nethelp.c
Wed Sep 20 04:19:51 2006
@@ -1747,7 +1747,7 @@
   jfieldID fid = getJavaIoFileDescriptorDescriptor (env);
   if (NULL != fid)
     {
-      (*env)->SetLongField (env, fd, fid, (jlong) value);
+      (*env)->SetLongField (env, fd, fid, (jlong) ((IDATA)value));
     }
 }
 
@@ -1759,7 +1759,7 @@
     {
       return (void *) -1;
     }
-  return (void *) ((*env)->GetLongField (env, fd, descriptorFID));
+  return (void *) ((IDATA)((*env)->GetLongField (env, fd, descriptorFID)));
 }
 
 jobject getJavaNioChannelsSocketChannelImplObj(JNIEnv * env, jclass channel_class){

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/vmls/shared/vmls.c
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/vmls/shared/vmls.c?view=diff&rev=448164&r1=448163&r2=448164
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/vmls/shared/vmls.c
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/vmls/shared/vmls.c
Wed Sep 20 04:19:51 2006
@@ -35,6 +35,7 @@
 #include "hythread.h"		/* for synchronization */
 #include "hyport.h"			/* for port library */
 #include "vmi.h"			/* for VMI functions */
+#include <string.h>			/* for memset */
 
 /* A constant that bounds the number of keys available. */
 #define VMLS_MAX_KEYS 256

Modified: incubator/harmony/enhanced/classlib/trunk/modules/nio/src/main/native/nio/shared/AddressUtil.c
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/nio/src/main/native/nio/shared/AddressUtil.c?view=diff&rev=448164&r1=448163&r2=448164
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/nio/src/main/native/nio/shared/AddressUtil.c
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/nio/src/main/native/nio/shared/AddressUtil.c
Wed Sep 20 04:19:51 2006
@@ -35,7 +35,7 @@
 	if (NULL == descriptorFID){
 		return 0;
 	}
-	hysocketP = (hysocket_t) ((*env)->GetLongField (env, fd, descriptorFID));
+	hysocketP = (hysocket_t) ((IDATA)((*env)->GetLongField (env, fd, descriptorFID)));
 	return SOCKET_CAST(hysocketP);
 }
 

Modified: incubator/harmony/enhanced/classlib/trunk/modules/text/src/main/native/text/shared/BidiWrapper.c
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/text/src/main/native/text/shared/BidiWrapper.c?view=diff&rev=448164&r1=448163&r2=448164
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/text/src/main/native/text/shared/BidiWrapper.c
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/text/src/main/native/text/shared/BidiWrapper.c
Wed Sep 20 04:19:51 2006
@@ -145,10 +145,10 @@
   
   runs = (*env)->NewObjectArray(env, runCount,run_clazz, NULL);  
   for (i = 0; i < runCount; i++) {
-      ubidi_getLogicalRun ((const UBiDi *)pBiDi, start, &limit, &level);
-	  run = (*env)->NewObject (env, run_clazz, initID, start, limit, level);
+      ubidi_getLogicalRun((const UBiDi *)((IDATA)pBiDi), start, &limit, &level);
+      run = (*env)->NewObject (env, run_clazz, initID, start, limit, level);
       (*env)->SetObjectArrayElement(env, runs, i, run);
-	  start = limit;	  
+      start = limit;	  
   }
   return runs;
 }



Mime
View raw message