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/21 17:09:19 UTC
svn commit: r767177 - in /commons/sandbox/runtime/trunk/src/main/native:
include/acr_private.h shared/string.c
Author: mturk
Date: Tue Apr 21 15:09:18 2009
New Revision: 767177
URL: http://svn.apache.org/viewvc?rev=767177&view=rev
Log:
Use more macros
Modified:
commons/sandbox/runtime/trunk/src/main/native/include/acr_private.h
commons/sandbox/runtime/trunk/src/main/native/shared/string.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=767177&r1=767176&r2=767177&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 Tue Apr 21 15:09:18 2009
@@ -403,6 +403,12 @@
(*_E)->CallVoidMethod(_E, (O), _m##I##n.i, (V), (X), (Y), NULL); \
} else (void)(0)
+#define CALL_METHOD0(T, I, O) \
+ (*_E)->Call##T##Method(_E, (O), _m##I##n.i)
+
+#define CALL_METHODN(T, I, O, ARGS) \
+ (*_E)->Call##T##Method(_E, (O), _m##I##n.i, ARGS)
+
#define ACR_CHECK_ALLOCATED(V) \
if ((V) == NULL) { \
ACR_ThrowMemoryException(_E, __FILE__, __LINE__, \
Modified: commons/sandbox/runtime/trunk/src/main/native/shared/string.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/shared/string.c?rev=767177&r1=767176&r2=767177&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/shared/string.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/shared/string.c Tue Apr 21 15:09:18 2009
@@ -300,7 +300,7 @@
/* JNI out of memory error */
return NULL;
}
- sb = (*_E)->CallObjectMethod(_E, str, J4MID(0001));
+ sb = CALL_METHOD0(Object, 0001, str);
ee = (*_E)->ExceptionOccurred(_E);
if (!ee) {
jint len = (*_E)->GetArrayLength(_E, sb);