You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by mt...@apache.org on 2009/04/18 08:43:54 UTC

svn commit: r766250 - in /commons/sandbox/runtime/trunk/src/main/native: include/acr_private.h shared/dbb.c shared/descriptor.c shared/tables.c

Author: mturk
Date: Sat Apr 18 06:43:53 2009
New Revision: 766250

URL: http://svn.apache.org/viewvc?rev=766250&view=rev
Log:
Do some pointer castings@

Modified:
    commons/sandbox/runtime/trunk/src/main/native/include/acr_private.h
    commons/sandbox/runtime/trunk/src/main/native/shared/dbb.c
    commons/sandbox/runtime/trunk/src/main/native/shared/descriptor.c
    commons/sandbox/runtime/trunk/src/main/native/shared/tables.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=766250&r1=766249&r2=766250&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 Sat Apr 18 06:43:53 2009
@@ -315,7 +315,7 @@
     _f##I##n.i ? (*_E)->GetLongField(_E, (O), _f##I##n.i) : 0
 
 #define GET_IFIELD_I(I, O)  \
-    _f##I##n.i ? (*_E)->GetLongField(_E, (O), _f##I##n.i) : 0
+    _f##I##n.i ? (*_E)->GetIntField(_E, (O), _f##I##n.i) : 0
 
 #define SET_IFIELD_J(I, O, V)  \
     if (_f##I##n.i) {                                                       \

Modified: commons/sandbox/runtime/trunk/src/main/native/shared/dbb.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/shared/dbb.c?rev=766250&r1=766249&r2=766250&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/shared/dbb.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/shared/dbb.c Sat Apr 18 06:43:53 2009
@@ -126,7 +126,7 @@
         size_t offset = 0;
         for (i = 0; i < len; i++) {
             size_t n = ACR_ALIGN_DEFAULT(ia[i + off]);
-            jobject bb = (*_E)->NewDirectByteBuffer(_E, mem + offset,
+            jobject bb = (*_E)->NewDirectByteBuffer(_E, (char *)mem + offset,
                                                     (jlong)ia[i + off]);
             if (bb == NULL) {
                 /* One of the constructors failed.
@@ -207,7 +207,7 @@
         size_t offset = 0;
         for (i = 0; i < len; i++) {
             size_t n = ACR_ALIGN_DEFAULT(ia[i + off]);
-            jobject bb = (*_E)->NewDirectByteBuffer(_E, mem + offset,
+            jobject bb = (*_E)->NewDirectByteBuffer(_E, (char *)mem + offset,
                                                     (jlong)ia[i + off]);
             if (bb == NULL) {
                 /* One of the constructors failed.

Modified: commons/sandbox/runtime/trunk/src/main/native/shared/descriptor.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/shared/descriptor.c?rev=766250&r1=766249&r2=766250&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/shared/descriptor.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/shared/descriptor.c Sat Apr 18 06:43:53 2009
@@ -134,8 +134,8 @@
             SET_IFIELD_J(0001, _O, 0);
         }
 #else
-        jlong p = GET_IFIELD_I(0001, _O);
-        jlong c = GET_IFIELD_I(0002, _O);
+        jint p  = GET_IFIELD_I(0001, _O);
+        jint c  = GET_IFIELD_I(0002, _O);
 
         if (p) {
             SET_IFIELD_I(0001, _O, 0);
@@ -168,8 +168,8 @@
         jlong c = GET_IFIELD_J(0002, _O);
 
 #else
-        jlong p = GET_IFIELD_I(0001, _O);
-        jlong c = GET_IFIELD_I(0002, _O);
+        jint  p = GET_IFIELD_I(0001, _O);
+        jint  c = GET_IFIELD_I(0002, _O);
 
 #endif
         callback = (acr_descriptor_callback_fn_t *)((acr_ptr_t)c);
@@ -216,8 +216,8 @@
             SET_IFIELD_J(0002, _O, 0);
         }
 #else
-        jlong p = GET_IFIELD_I(0001, _O);
-        jlong c = GET_IFIELD_I(0002, _O);
+        jint  p = GET_IFIELD_I(0001, _O);
+        jint  c = GET_IFIELD_I(0002, _O);
 
         if (p) {
             SET_IFIELD_I(0001, _O, 0);

Modified: commons/sandbox/runtime/trunk/src/main/native/shared/tables.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/shared/tables.c?rev=766250&r1=766249&r2=766250&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/shared/tables.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/shared/tables.c Sat Apr 18 06:43:53 2009
@@ -275,7 +275,7 @@
 {
     table_entry_t *e = NULL;
 
-    if (idx >= t->a.nelts) {
+    if ((acr_size_t)idx >= t->a.nelts) {
         return ACR_EOF;
     }
     e = (table_entry_t *)t->a.elts;