commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mt...@apache.org
Subject svn commit: r887939 - in /commons/sandbox/runtime/trunk/src/main/native: include/acr_private.h shared/pointer.c
Date Mon, 07 Dec 2009 14:52:54 GMT
Author: mturk
Date: Mon Dec  7 14:52:54 2009
New Revision: 887939

URL: http://svn.apache.org/viewvc?rev=887939&view=rev
Log:
Fix get long macro

Modified:
    commons/sandbox/runtime/trunk/src/main/native/include/acr_private.h
    commons/sandbox/runtime/trunk/src/main/native/shared/pointer.c

Modified: commons/sandbox/runtime/trunk/src/main/native/include/acr_private.h
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/include/acr_private.h?rev=887939&r1=887938&r2=887939&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/include/acr_private.h (original)
+++ commons/sandbox/runtime/trunk/src/main/native/include/acr_private.h Mon Dec  7 14:52:54
2009
@@ -427,8 +427,9 @@
         else     (*_E)->SetStaticBooleanField(_E, _clazzn.i, _f##I##n.i, JNI_FALSE); 
  \
     } else (void)(0)
 
-#define GET_IFIELD_P(I, O)  \
-    (_f##I##n.i && (O)) ? (*_E)->GetLongField(_E, (O), _f##I##n.i) : 0
+#define GET_IFIELD_P(I, O, T)  \
+    (_f##I##n.i && (O)) ? (T)(*_E)->GetLongField(_E, (O), _f##I##n.i) : 0
+
 #define GET_IFIELD_V(I, O, T)  \
     (_f##I##n.i && (O)) ? (T)((acr_ssize_t)(*_E)->GetLongField(_E, (O),      \
                               _f##I##n.i)) : NULL

Modified: commons/sandbox/runtime/trunk/src/main/native/shared/pointer.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/shared/pointer.c?rev=887939&r1=887938&r2=887939&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/shared/pointer.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/shared/pointer.c Mon Dec  7 14:52:54 2009
@@ -122,7 +122,7 @@
         }
         if (cleanup) {
             int rc;
-            size_t plength = (size_t)GET_IFIELD_P(0002, _O);
+            size_t plength = GET_IFIELD_P(0002, _O, size_t);
             if ((rc = (*cleanup)(pointer, plength))) {
                 /* Throw RuntimeException with errno message */
                 ACR_ThrowException(_E, THROW_FMARK, ACR_EX_ERUNTIME, rc);
@@ -146,7 +146,7 @@
             SET_IFIELD_P(0000, _O, NULL);
         }
         if (cleanup) {
-            size_t plength = (size_t)GET_IFIELD_P(0002, _O);
+            size_t plength = GET_IFIELD_P(0002, _O, size_t);
             (*cleanup)(pointer, plength);
         }
     }
@@ -204,7 +204,7 @@
         }
         (*_E)->MonitorExit(_E, _O);
         if (cleanup) {
-            size_t plength = (size_t)GET_IFIELD_P(0002, _O);
+            size_t plength = GET_IFIELD_P(0002, _O, size_t);
             return (*cleanup)(pointer, plength);
         }
         else {
@@ -221,7 +221,7 @@
     if (_clazzn.i && J4MID(0000) && _O) {
         void *pointer = GET_IFIELD_V(0000, _O, void *);
         if (len) {
-            *len = (size_t)GET_IFIELD_P(0002, _O);
+            *len = GET_IFIELD_P(0002, _O, size_t);
         }
         return pointer;
     }



Mime
View raw message