harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hinde...@apache.org
Subject svn commit: r583768 - in /harmony/enhanced/classlib/trunk/modules/luni/src/main/native: include/shared/ include/unix/ include/windows/ luni/shared/ luni/unix/ luni/windows/
Date Thu, 11 Oct 2007 10:13:25 GMT
Author: hindessm
Date: Thu Oct 11 03:13:14 2007
New Revision: 583768

URL: http://svn.apache.org/viewvc?rev=583768&view=rev
Log:
Remove duplicate functions:
  setJavaIoFileDescriptorContentsAsPointer is a duplicate of
    setJavaIoFileDescriptorContents
  getJavaIoFileDescriptorContentsAsPointer is a duplicate of
    getJavaIoFileDescriptorContentsAsAPointer

Modified:
    harmony/enhanced/classlib/trunk/modules/luni/src/main/native/include/shared/iohelp.h
    harmony/enhanced/classlib/trunk/modules/luni/src/main/native/include/unix/jclprots.h
    harmony/enhanced/classlib/trunk/modules/luni/src/main/native/include/windows/jclprots.h
    harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/filedesc.c
    harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/nethelp.c
    harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/process.c
    harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/socket.c
    harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/unix/OSFileSystemLinux32.c
    harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/windows/OSFileSystemWin32.c
    harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/windows/OSNetworkSystemWin32.c

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/native/include/shared/iohelp.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/include/shared/iohelp.h?rev=583768&r1=583767&r2=583768&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/native/include/shared/iohelp.h (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/native/include/shared/iohelp.h Thu
Oct 11 03:13:14 2007
@@ -23,10 +23,7 @@
 
 /* DIR_SEPARATOR is defined in hycomp.h */
 #define jclSeparator DIR_SEPARATOR
-void *getJavaIoFileDescriptorContentsAsPointer (JNIEnv * env, jobject fd);
 void ioh_convertToPlatform (char *path);
-void setJavaIoFileDescriptorContentsAsPointer (JNIEnv * env, jobject fd,
-                                               void *value);
 void ioh_writebytesImpl (JNIEnv * env, jobject recv, jbyteArray buffer,
                          jint offset, jint count, IDATA descriptor);
 char *ioLookupErrorString (JNIEnv * env, I_32 anErrorNum);

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/native/include/unix/jclprots.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/include/unix/jclprots.h?rev=583768&r1=583767&r2=583768&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/native/include/unix/jclprots.h (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/native/include/unix/jclprots.h Thu
Oct 11 03:13:14 2007
@@ -307,7 +307,6 @@
 I_32 netGetSockAddr PROTOTYPE((JNIEnv *env, jobject fileDescriptor, hysockaddr_t sockaddrP,
jboolean preferIPv6Addresses));
 
 /* NativesCommonIoHelpers*/
-void* getJavaIoFileDescriptorContentsAsPointer PROTOTYPE((JNIEnv *env, jobject fd));
 void throwNewExceptionByName PROTOTYPE((JNIEnv* env,
                                         const char* name, const char* message));
 void throwNewOutOfMemoryError PROTOTYPE((JNIEnv* env, const char* message));
@@ -315,7 +314,6 @@
 void throwJavaIoIOExceptionClosed PROTOTYPE((JNIEnv* env));
 void ioh_convertToPlatform PROTOTYPE((char *path));
 void throwNPException PROTOTYPE((JNIEnv* env, const char* message));
-void setJavaIoFileDescriptorContentsAsPointer PROTOTYPE((JNIEnv * env, jobject fd, void *value));
 void ioh_writebytesImpl PROTOTYPE((JNIEnv * env, jobject recv, jbyteArray buffer, jint offset,
jint count, IDATA descriptor));
 char* ioLookupErrorString PROTOTYPE((JNIEnv* env, I_32 anErrorNum));
 jint ioh_readbytesImpl PROTOTYPE((JNIEnv * env, jobject recv, jbyteArray buffer, jint offset,
jint count, IDATA descriptor));

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/native/include/windows/jclprots.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/include/windows/jclprots.h?rev=583768&r1=583767&r2=583768&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/native/include/windows/jclprots.h
(original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/native/include/windows/jclprots.h
Thu Oct 11 03:13:14 2007
@@ -551,8 +551,6 @@
                 jboolean preferIPv6Addresses));
                 
   /* NativesCommonIoHelpers*/
-  void *getJavaIoFileDescriptorContentsAsPointer
-    PROTOTYPE ((JNIEnv * env, jobject fd));
   void throwNewExceptionByName PROTOTYPE((JNIEnv* env,
                                           const char* name,
                                           const char* message));
@@ -561,8 +559,6 @@
   void throwJavaIoIOExceptionClosed PROTOTYPE ((JNIEnv* env));
   void ioh_convertToPlatform PROTOTYPE ((char *path));
   void throwNPException PROTOTYPE ((JNIEnv* env, const char* message));
-  void setJavaIoFileDescriptorContentsAsPointer
-    PROTOTYPE ((JNIEnv * env, jobject fd, void *value));
   void ioh_writebytesImpl
     PROTOTYPE ((JNIEnv * env, jobject recv, jbyteArray buffer, jint offset,
                 jint count, IDATA descriptor));

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/filedesc.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/filedesc.c?rev=583768&r1=583767&r2=583768&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/filedesc.c (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/filedesc.c Thu
Oct 11 03:13:14 2007
@@ -16,6 +16,7 @@
  */
 
 #include "iohelp.h"
+#include "nethelp.h"
 #include "exceptions.h"
 #include "harmonyglob.h"
 
@@ -26,7 +27,7 @@
     * Currently only answer false if the descriptor is -1.  Possibly there 
     * could be an OS check to see if the handle has been invalidated 
     */
-  void *descriptor = getJavaIoFileDescriptorContentsAsPointer (env, recv);
+  void *descriptor = getJavaIoFileDescriptorContentsAsAPointer (env, recv);
   return (IDATA) descriptor != -1;
 }
 
@@ -38,7 +39,7 @@
   I_32 syncfailed = 0;
   PORT_ACCESS_FROM_ENV (env);
 
-  descriptor = (IDATA) getJavaIoFileDescriptorContentsAsPointer (env, recv);
+  descriptor = (IDATA) getJavaIoFileDescriptorContentsAsAPointer (env, recv);
   if (descriptor == -1)
     {
       syncfailed = 1;

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/nethelp.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/nethelp.c?rev=583768&r1=583767&r2=583768&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/nethelp.c (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/nethelp.c Thu
Oct 11 03:13:14 2007
@@ -1613,7 +1613,7 @@
   fd = (*env)->GetObjectField (env, recv, fdFID);
 
   /* dereference the C pointer from the wrapper object */
-  descriptor = (IDATA) getJavaIoFileDescriptorContentsAsPointer (env, fd);
+  descriptor = (IDATA) getJavaIoFileDescriptorContentsAsAPointer (env, fd);
 
   /* Check for closed file, in, out, and err */
   if (descriptor >= -1 && descriptor <= 2)
@@ -1622,37 +1622,8 @@
     }
 
   hyfile_close (descriptor);
-  setJavaIoFileDescriptorContentsAsPointer (env, fd, (void *) -1);
+  setJavaIoFileDescriptorContents (env, fd, (void *) -1);
   return;
-}
-
-/**
-  * This will retrieve the 'descriptor' field value from a java.io.FileDescriptor
-  */
-void *
-getJavaIoFileDescriptorContentsAsPointer (JNIEnv * env, jobject fd)
-{
-  jfieldID descriptorFID = getJavaIoFileDescriptorDescriptorFID (env);
-  if (NULL == descriptorFID)
-    {
-      return (void *) -1;
-    }
-  return (void *)(IDATA) ((*env)->GetLongField (env, fd, descriptorFID));
-}
-
-/**
-  * This will set the 'descriptor' field value in the java.io.FileDescriptor
-  * @fd to the value @desc 
-  */
-void
-setJavaIoFileDescriptorContentsAsPointer (JNIEnv * env, jobject fd,
-                                          void *value)
-{
-  jfieldID fid = getJavaIoFileDescriptorDescriptorFID (env);
-  if (NULL != fid)
-    {
-      (*env)->SetLongField (env, fd, fid, (IDATA)value);
-    }
 }
 
 /**

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/process.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/process.c?rev=583768&r1=583767&r2=583768&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/process.c (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/process.c Thu
Oct 11 03:13:14 2007
@@ -16,6 +16,7 @@
  */
 
 #include "iohelp.h"
+#include "nethelp.h"
 #include "exceptions.h"
 #include "procimpl.h"
 
@@ -255,7 +256,7 @@
                 jobject recv,
                 jobject arg1, jlong arg2)
 {
-  setJavaIoFileDescriptorContentsAsPointer (env, arg1, (void *) ((IDATA) arg2));
+  setJavaIoFileDescriptorContents (env, arg1, (void *) ((IDATA) arg2));
 }
 
 JNIEXPORT void JNICALL
@@ -263,7 +264,7 @@
                  jobject recv,
                  jobject arg1, jlong arg2)
 {
-  setJavaIoFileDescriptorContentsAsPointer (env, arg1, (void *) ((IDATA) arg2));
+  setJavaIoFileDescriptorContents (env, arg1, (void *) ((IDATA) arg2));
 }
 
 /* Wait for the receiver to finish then return the exit value */

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/socket.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/socket.c?rev=583768&r1=583767&r2=583768&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/socket.c (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/socket.c Thu
Oct 11 03:13:14 2007
@@ -106,7 +106,7 @@
 
   if (0 == result)
     {
-      setJavaIoFileDescriptorContentsAsPointer (env, thisObjFD, sockdesc);
+      setJavaIoFileDescriptorContents (env, thisObjFD, sockdesc);
     }
 }
 
@@ -817,7 +817,7 @@
 
 #if defined(WIN32)
   PORT_ACCESS_FROM_ENV (env);
-  hysocketP = getJavaIoFileDescriptorContentsAsPointer (env, fileDescriptor);
+  hysocketP = getJavaIoFileDescriptorContentsAsAPointer (env, fileDescriptor);
   if (!hysock_socketIsValid (hysocketP))
     {
       throwJavaNetSocketException (env, HYPORT_ERROR_SOCKET_BADSOCKET);
@@ -857,7 +857,7 @@
     
         SELECT_NOPOLL:
               
-        hysocketP = getJavaIoFileDescriptorContentsAsPointer (env, fileDescriptor);
+        hysocketP = getJavaIoFileDescriptorContentsAsAPointer (env, fileDescriptor);
       
         if (!hysock_socketIsValid (hysocketP)) {
             throwJavaNetSocketException (env, HYPORT_ERROR_SOCKET_BADSOCKET);
@@ -913,7 +913,7 @@
        */
        
       hysocketP =
-        getJavaIoFileDescriptorContentsAsPointer (env, fileDescriptor);
+        getJavaIoFileDescriptorContentsAsAPointer (env, fileDescriptor);
       
       if (!hysock_socketIsValid (hysocketP))
         {

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/unix/OSFileSystemLinux32.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/unix/OSFileSystemLinux32.c?rev=583768&r1=583767&r2=583768&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/unix/OSFileSystemLinux32.c
(original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/unix/OSFileSystemLinux32.c
Thu Oct 11 03:13:14 2007
@@ -31,12 +31,11 @@
 #endif
 #include "vmi.h"
 #include "iohelp.h"
+#include "nethelp.h"
 
 #include "IFileSystem.h"
 #include "OSFileSystem.h"
 
-void *getJavaIoFileDescriptorContentsAsPointer (JNIEnv * env, jobject fd);
-
 typedef int OSSOCKET;   
 typedef struct hysocket_struct
 {
@@ -241,7 +240,7 @@
   OSSOCKET socket;
   //TODO IPV6
   hysocket_t hysocketP =
-    (hysocket_t)getJavaIoFileDescriptorContentsAsPointer (env,sd);
+    (hysocket_t)getJavaIoFileDescriptorContentsAsAPointer (env,sd);
   if(hysocketP == NULL)
     return -1;
   socket = hysocketP->sock;

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/windows/OSFileSystemWin32.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/windows/OSFileSystemWin32.c?rev=583768&r1=583767&r2=583768&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/windows/OSFileSystemWin32.c
(original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/windows/OSFileSystemWin32.c
Thu Oct 11 03:13:14 2007
@@ -236,7 +236,7 @@
         count = 0x7FFFFFFF;
     }
 
-	hysocketP = getJavaIoFileDescriptorContentsAsPointer(env,sd);	
+	hysocketP = getJavaIoFileDescriptorContentsAsAPointer(env,sd);	
 	socket = (SOCKET)hysocketP->ipv4;	
     
 	pos_low  = SetFilePointer(hfile,0,&pos_high,FILE_CURRENT);

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/windows/OSNetworkSystemWin32.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/windows/OSNetworkSystemWin32.c?rev=583768&r1=583767&r2=583768&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/windows/OSNetworkSystemWin32.c
(original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/windows/OSNetworkSystemWin32.c
Thu Oct 11 03:13:14 2007
@@ -58,7 +58,7 @@
   FD_ZERO (&fdset_write->handle);
   for (val = 0; val<countReadC; val++){
 	  gotFD	= (*env)->GetObjectArrayElement(env,readFDArray,val);
-	  hysocketP = getJavaIoFileDescriptorContentsAsPointer (env, gotFD);
+	  hysocketP = getJavaIoFileDescriptorContentsAsAPointer (env, gotFD);
       (*env)->DeleteLocalRef(env, gotFD);
 
 	  if (!hysock_socketIsValid (hysocketP)){
@@ -79,7 +79,7 @@
 	}
   for (val = 0; val<countWriteC; val++){
 	  gotFD	= (*env)->GetObjectArrayElement(env,writeFDArray,val);
-	  hysocketP = getJavaIoFileDescriptorContentsAsPointer (env, gotFD);
+	  hysocketP = getJavaIoFileDescriptorContentsAsAPointer (env, gotFD);
       (*env)->DeleteLocalRef(env, gotFD);
 
 	  if (!hysock_socketIsValid (hysocketP)){
@@ -122,7 +122,7 @@
 	  flagArray = (*env)->GetIntArrayElements(env,outFlags,	&isCopy);
 	  for (val=0;val<countReadC;val++){
 		gotFD =	(*env)->GetObjectArrayElement(env,readFDArray,val);
-		hysocketP = getJavaIoFileDescriptorContentsAsPointer (env, gotFD);
+		hysocketP = getJavaIoFileDescriptorContentsAsAPointer (env, gotFD);
         (*env)->DeleteLocalRef(env, gotFD);
 
 		if (!hysock_socketIsValid (hysocketP)){
@@ -146,7 +146,7 @@
 		
 	  for (val=0;val<countWriteC;val++){
 		gotFD =	(*env)->GetObjectArrayElement(env,writeFDArray,val);
-		hysocketP = getJavaIoFileDescriptorContentsAsPointer (env, gotFD);
+		hysocketP = getJavaIoFileDescriptorContentsAsAPointer (env, gotFD);
         (*env)->DeleteLocalRef(env, gotFD);
 
 		if (!hysock_socketIsValid (hysocketP)){



Mime
View raw message