commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mt...@apache.org
Subject svn commit: r1091194 - in /commons/sandbox/runtime/trunk/src/main/native: include/acr/ os/unix/ shared/
Date Mon, 11 Apr 2011 20:20:53 GMT
Author: mturk
Date: Mon Apr 11 20:20:52 2011
New Revision: 1091194

URL: http://svn.apache.org/viewvc?rev=1091194&view=rev
Log:
Replace _E with env. Underscores are reserved for statics and macros

Modified:
    commons/sandbox/runtime/trunk/src/main/native/include/acr/error.h
    commons/sandbox/runtime/trunk/src/main/native/include/acr/jnidefs.h
    commons/sandbox/runtime/trunk/src/main/native/include/acr/jnimacros.h
    commons/sandbox/runtime/trunk/src/main/native/include/acr/memory.h
    commons/sandbox/runtime/trunk/src/main/native/include/acr/string.h
    commons/sandbox/runtime/trunk/src/main/native/include/acr/unsafe.h
    commons/sandbox/runtime/trunk/src/main/native/os/unix/platform.c
    commons/sandbox/runtime/trunk/src/main/native/shared/callback.c
    commons/sandbox/runtime/trunk/src/main/native/shared/clazz.c
    commons/sandbox/runtime/trunk/src/main/native/shared/error.c
    commons/sandbox/runtime/trunk/src/main/native/shared/iofd.c
    commons/sandbox/runtime/trunk/src/main/native/shared/memory.c
    commons/sandbox/runtime/trunk/src/main/native/shared/native.c
    commons/sandbox/runtime/trunk/src/main/native/shared/object.c
    commons/sandbox/runtime/trunk/src/main/native/shared/observer.c
    commons/sandbox/runtime/trunk/src/main/native/shared/reflect.c
    commons/sandbox/runtime/trunk/src/main/native/shared/string.c
    commons/sandbox/runtime/trunk/src/main/native/shared/system.c
    commons/sandbox/runtime/trunk/src/main/native/shared/unsafe.c
    commons/sandbox/runtime/trunk/src/main/native/shared/uuid.c

Modified: commons/sandbox/runtime/trunk/src/main/native/include/acr/error.h
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/include/acr/error.h?rev=1091194&r1=1091193&r2=1091194&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/include/acr/error.h (original)
+++ commons/sandbox/runtime/trunk/src/main/native/include/acr/error.h Mon Apr 11 20:20:52 2011
@@ -1601,13 +1601,13 @@ ACR_INLINE(DWORD) AcrNetOsError()
 #endif /* !defined(_WINDOWS) */
 
 #if defined(DEBUG) || defined(_DEBUG)
-#define ACR_THROW(CL, ER)       AcrDebugThrowException(_E, __FILE_FUNC_LINE__, (CL), (ER))
-#define ACR_THROW_OS_ERROR(CL)  AcrDebugThrowException(_E, __FILE_FUNC_LINE__, (CL), ACR_GET_OS_ERROR())
+#define ACR_THROW(CL, ER)       AcrDebugThrowException(env, __FILE_FUNC_LINE__, (CL), (ER))
+#define ACR_THROW_OS_ERROR(CL)  AcrDebugThrowException(env, __FILE_FUNC_LINE__, (CL), ACR_GET_OS_ERROR())
 #else
-#define ACR_THROW(CL, ER)       AcrThrowException(_E, (CL), (ER))
-#define ACR_THROW_OS_ERROR(CL)  AcrThrowException(_E, (CL), ACR_GET_OS_ERROR())
+#define ACR_THROW(CL, ER)       AcrThrowException(env, (CL), (ER))
+#define ACR_THROW_OS_ERROR(CL)  AcrThrowException(env, (CL), ACR_GET_OS_ERROR())
 #endif
-#define ACR_THROW_MSG(CL, MS)   AcrThrow(_E, (CL), MS)
+#define ACR_THROW_MSG(CL, MS)   AcrThrow(env, (CL), MS)
 
 #ifdef __cplusplus
 extern "C" {

Modified: commons/sandbox/runtime/trunk/src/main/native/include/acr/jnidefs.h
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/include/acr/jnidefs.h?rev=1091194&r1=1091193&r2=1091194&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/include/acr/jnidefs.h (original)
+++ commons/sandbox/runtime/trunk/src/main/native/include/acr/jnidefs.h Mon Apr 11 20:20:52 2011
@@ -45,10 +45,10 @@
 #define ACR_UTIL_EXPORT(RT, CL, MN)  \
     ACR_JNIEXPORT RT JNICALL Java_org_apache_commons_runtime_net_##CL##_##MN
 
-#define JNI_STDARGS             JNIEnv *_E, jobject _O
-#define JNI_STDENV              JNIEnv *_E
-#define UNREFERENCED_STDARGS    _E = _E; _O = _O
-#define UNREFERENCED_OBJECT     _O = _O
+#define JNI_STDARGS             JNIEnv *env, jobject obj
+#define JNI_STDENV              JNIEnv *env
+#define UNREFERENCED_STDARGS    env = env; obj = obj
+#define UNREFERENCED_OBJECT     obj = obj
 
 #define LLT(X)                  ((acr_intptr_t)(X))
 #if CC_SIZEOF_VOIDP == 8
@@ -78,14 +78,14 @@
     extern int acr_class_##CL##_unload(JNIEnv *)
 
 #define ACR_CLASS_LOAD(CL)                          \
-    if (acr_class_##CL##_load(_E)) return 1
+    if (acr_class_##CL##_load(env)) return 1
 
 #define ACR_CLASS_LOPT(CL)                          \
-    if (acr_class_##CL##_load(_E))                  \
-        (*_E)->ExceptionClear(_E)
+    if (acr_class_##CL##_load(env))                 \
+        (*env)->ExceptionClear(env)
 
 #define ACR_CLASS_UNLOAD(CL)                        \
-    acr_class_##CL##_unload(_E)
+    acr_class_##CL##_unload(env)
 
 #define J_DECLARE_CLAZZ         static JAVA_C_ID _clazzn
 #define J_DECLARE_F_ID(I)       static JAVA_F_ID _f##I##n

Modified: commons/sandbox/runtime/trunk/src/main/native/include/acr/jnimacros.h
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/include/acr/jnimacros.h?rev=1091194&r1=1091193&r2=1091194&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/include/acr/jnimacros.h (original)
+++ commons/sandbox/runtime/trunk/src/main/native/include/acr/jnimacros.h Mon Apr 11 20:20:52 2011
@@ -32,7 +32,7 @@
 
 #define J_LOAD_METHOD(I)    \
     if (_m##I##n.i == 0) {                                                  \
-        _m##I##n.i = (*_E)->GetMethodID(_E, _clazzn.i, _m##I##n.n,          \
+        _m##I##n.i = (*env)->GetMethodID(env, _clazzn.i, _m##I##n.n,        \
                                         _m##I##n.s);                        \
         if (_m##I##n.i == 0)                                                \
             return ACR_ESYMNOTFOUND;                                        \
@@ -40,15 +40,15 @@
 
 #define J_LOPT_METHOD(I)    \
     if (_m##I##n.i == 0) {                                                  \
-        _m##I##n.i = (*_E)->GetMethodID(_E, _clazzn.i, _m##I##n.n,          \
+        _m##I##n.i = (*env)->GetMethodID(env, _clazzn.i, _m##I##n.n,        \
                                         _m##I##n.s);                        \
         if (_m##I##n.i == 0)                                                \
-            (*_E)->ExceptionClear(_E);                                      \
+            (*env)->ExceptionClear(env);                                    \
     } else (void)(0)
 
 #define J_LOAD_MLOCAL(I)    \
     if (_m##I##n.i == 0) {                                                  \
-        _m##I##n.i = (*_E)->GetStaticMethodID(_E, _clazzn.i, _m##I##n.n,    \
+        _m##I##n.i = (*env)->GetStaticMethodID(env, _clazzn.i, _m##I##n.n,  \
                                              _m##I##n.s);                   \
         if (_m##I##n.i == 0)                                                \
             return ACR_ESYMNOTFOUND;                                        \
@@ -56,7 +56,7 @@
 
 #define J_LOAD_IFIELD(I)   \
     if (_f##I##n.i == 0) {                                                  \
-        _f##I##n.i = (*_E)->GetFieldID(_E, _clazzn.i, _f##I##n.n,           \
+        _f##I##n.i = (*env)->GetFieldID(env, _clazzn.i, _f##I##n.n,         \
                                        _f##I##n.s);                         \
         if (_f##I##n.i == 0)                                                \
             return ACR_ESYMNOTFOUND;                                        \
@@ -64,7 +64,7 @@
 
 #define J_LOAD_SFIELD(I)   \
     if (_f##I##n.i == 0) {                                                  \
-        _f##I##n.i = (*_E)->GetStaticFieldID(_E, _clazzn.i, _f##I##n.n,     \
+        _f##I##n.i = (*env)->GetStaticFieldID(env, _clazzn.i, _f##I##n.n,   \
                                             _f##I##n.s);                    \
         if (_f##I##n.i == 0)                                                \
             return ACR_ESYMNOTFOUND;                                        \
@@ -72,123 +72,123 @@
 
 
 #define GET_IFIELD_J(I, O)  \
-    (*_E)->GetLongField(_E, (O), _f##I##n.i)
+    (*env)->GetLongField(env, (O), _f##I##n.i)
 
 #define GET_IFIELD_I(I, O)  \
-    (*_E)->GetIntField(_E, (O), _f##I##n.i)
+    (*env)->GetIntField(env, (O), _f##I##n.i)
 
 #define GET_IFIELD_O(I, O)  \
-    (*_E)->GetObjectField(_E, (O), _f##I##n.i)
+    (*env)->GetObjectField(env, (O), _f##I##n.i)
 
 #define GET_SFIELD_O(I, C)  \
-    (*_E)->GetStaticObjectField(_E, (C), _f##I##n.i)
+    (*env)->GetStaticObjectField(env, (C), _f##I##n.i)
 
 #define SET_IFIELD_J(I, O, V) \
-    (*_E)->SetLongField(_E, (O), _f##I##n.i, (jlong)(V))
+    (*env)->SetLongField(env, (O), _f##I##n.i, (jlong)(V))
 
 #define SET_IFIELD_I(I, O, V) \
-    (*_E)->SetIntField(_E, (O), _f##I##n.i, (jint)(V))
+    (*env)->SetIntField(env, (O), _f##I##n.i, (jint)(V))
 
 #define SET_IFIELD_D(I, O, V) \
-    (*_E)->SetDoubleField(_E, (O), _f##I##n.i, (jdouble)(V))
+    (*env)->SetDoubleField(env, (O), _f##I##n.i, (jdouble)(V))
 
 #define SET_IFIELD_Z(I, O, V)  \
-    (*_E)->SetBooleanField(_E, (O), _f##I##n.i, (V) ? JNI_TRUE : JNI_FALSE)
+    (*env)->SetBooleanField(env, (O), _f##I##n.i, (V) ? JNI_TRUE : JNI_FALSE)
 
 #define SET_IFIELD_S(I, O, V)  \
     if ((V)) {                                                              \
-        jstring _str = ACR_NewJavaStringA(_E, (V));                         \
-        (*_E)->SetObjectField(_E, (O), _f##I##n.i, _str);                   \
-        (*_E)->DeleteLocalRef(_E, _str);                                    \
+        jstring _str = ACR_NewJavaStringA(env, (V));                        \
+        (*env)->SetObjectField(env, (O), _f##I##n.i, _str);                 \
+        (*env)->DeleteLocalRef(env, _str);                                  \
     } else (void)(0)
 
 #define SET_IFIELD_N(I, O, V)  \
     if ((V) && *(V)) {                                                      \
-        jstring _str = ACR_NewJavaStringA(_E, (V));                         \
-        (*_E)->SetObjectField(_E, (O), _f##I##n.i, _str);                   \
-        (*_E)->DeleteLocalRef(_E, _str);                                    \
+        jstring _str = ACR_NewJavaStringA(env, (V));                        \
+        (*env)->SetObjectField(env, (O), _f##I##n.i, _str);                 \
+        (*env)->DeleteLocalRef(env, _str);                                  \
     } else (void)(0)
 
 #define SET_IFIELD_W(I, O, V)  \
     if ((V)) {                                                              \
-        jstring _str = ACR_NewJavaStringW(_E, (V));                         \
-        (*_E)->SetObjectField(_E, (O), _f##I##n.i, _str);                   \
-        (*_E)->DeleteLocalRef(_E, _str);                                    \
+        jstring _str = ACR_NewJavaStringW(env, (V));                        \
+        (*env)->SetObjectField(env, (O), _f##I##n.i, _str);                 \
+        (*env)->DeleteLocalRef(env, _str);                                  \
     } else (void)(0)
 
 #define SET_IFIELD_C(I, O, V)  \
     if ((V) && *(V)) {                                                      \
-        jstring _str = ACR_NewJavaStringW(_E, (V));                         \
-        (*_E)->SetObjectField(_E, (O), _f##I##n.i, _str);                   \
-        (*_E)->DeleteLocalRef(_E, _str);                                    \
+        jstring _str = ACR_NewJavaStringW(env, (V));                        \
+        (*env)->SetObjectField(env, (O), _f##I##n.i, _str);                 \
+        (*env)->DeleteLocalRef(env, _str);                                  \
     } else (void)(0)
 
 #define SET_IFIELD_O(I, O, V)  \
-    (*_E)->SetObjectField(_E, (O), _f##I##n.i, (jobject)(V))
+    (*env)->SetObjectField(env, (O), _f##I##n.i, (jobject)(V))
 
 #define SET_SFIELD_Z(I, V)  \
-    (*_E)->SetStaticBooleanField(_E, _clazzn.i, _f##I##n.i, (V) ? JNI_TRUE : JNI_FALSE)
+    (*env)->SetStaticBooleanField(env, _clazzn.i, _f##I##n.i, (V) ? JNI_TRUE : JNI_FALSE)
 
 #define GET_IFIELD_P(I, O, T)  \
-    (T)((ptrdiff_t)(*_E)->GetLongField(_E, (O), _f##I##n.i))
+    (T)((ptrdiff_t)(*env)->GetLongField(env, (O), _f##I##n.i))
 
 #define SET_IFIELD_P(I, O, V)  \
-    (*_E)->SetLongField(_E, (O), _f##I##n.i, P2J(V))
+    (*env)->SetLongField(env, (O), _f##I##n.i, P2J(V))
 
 #define CALL_VMETHOD0(I, O)  \
-    (*_E)->CallVoidMethod(_E, (O), _m##I##n.i)
+    (*env)->CallVoidMethod(env, (O), _m##I##n.i)
 
 #define CALL_VMETHOD1(I, O, A)  \
-    (*_E)->CallVoidMethod(_E, (O), _m##I##n.i, (A))
+    (*env)->CallVoidMethod(env, (O), _m##I##n.i, (A))
 
 #define CALL_VMETHOD2(I, O, A1, A2)  \
-    (*_E)->CallVoidMethod(_E, (O), _m##I##n.i, (A1), (A2))
+    (*env)->CallVoidMethod(env, (O), _m##I##n.i, (A1), (A2))
 
 #define CALL_VMETHOD3(I, O, A1, A2, A3)  \
-    (*_E)->CallVoidMethod(_E, (O), _m##I##n.i, (A1), (A2), (A3))
+    (*env)->CallVoidMethod(env, (O), _m##I##n.i, (A1), (A2), (A3))
 
 #define CALL_METHOD0(T, I, O)  \
-    (*_E)->Call##T##Method(_E, (O), _m##I##n.i)
+    (*env)->Call##T##Method(env, (O), _m##I##n.i)
 
 #define CALL_METHOD1(T, I, O, A)  \
-    (*_E)->Call##T##Method(_E, (O), _m##I##n.i, (A))
+    (*env)->Call##T##Method(env, (O), _m##I##n.i, (A))
 
 #define CALL_METHOD2(T, I, O, A1, A2)  \
-    (*_E)->Call##T##Method(_E, (O), _m##I##n.i, (A1), (A2))
+    (*env)->Call##T##Method(env, (O), _m##I##n.i, (A1), (A2))
 
 #define CALL_METHOD3(T, I, O, A1, A2, A3)  \
-    (*_E)->Call##T##Method(_E, (O), _m##I##n.i, (A1), (A2), (A3))
+    (*env)->Call##T##Method(env, (O), _m##I##n.i, (A1), (A2), (A3))
 
 #define CALL_MLOCAL0(T, I)  \
-    (*_E)->CallStatic##T##Method(_E, _clazzn.i, _m##I##n.i)
+    (*env)->CallStatic##T##Method(env, _clazzn.i, _m##I##n.i)
 
 #define CALL_MLOCAL1(T, I, A)  \
-    (*_E)->CallStatic##T##Method(_E, _clazzn.i, _m##I##n.i, (A))
+    (*env)->CallStatic##T##Method(env, _clazzn.i, _m##I##n.i, (A))
 
 #define CALL_MLOCAL2(T, I, A1, A2)  \
-    (*_E)->CallStatic##T##Method(_E, _clazzn.i, _m##I##n.i, (A1), (A2))
+    (*env)->CallStatic##T##Method(env, _clazzn.i, _m##I##n.i, (A1), (A2))
 
 #define CALL_VMLOCAL0(I)  \
-    (*_E)->CallStaticVoidMethod(_E, _clazzn.i, _m##I##n.i)
+    (*env)->CallStaticVoidMethod(env, _clazzn.i, _m##I##n.i)
 
 #define CALL_VMLOCAL1(I, A)  \
-    (*_E)->CallStaticVoidMethod(_E, _clazzn.i, _m##I##n.i, (A))
+    (*env)->CallStaticVoidMethod(env, _clazzn.i, _m##I##n.i, (A))
 
 #define CALL_VMLOCAL2(I, A1, A2)  \
-    (*_E)->CallStaticVoidMethod(_E, _clazzn.i, _m##I##n.i, (A1), (A2))
+    (*env)->CallStaticVoidMethod(env, _clazzn.i, _m##I##n.i, (A1), (A2))
 
 #define SET_SARRAY_A(A, I, V)                               \
     if ((A) && (V)) {                                       \
-        jstring _str = ACR_NewJavaStringA(_E, (V));         \
-        (*_E)->SetObjectArrayElement(_E, (A), (I), _str);   \
-        (*_E)->DeleteLocalRef(_E, _str);                    \
+        jstring _str = ACR_NewJavaStringA(env, (V));        \
+        (*env)->SetObjectArrayElement(env, (A), (I), _str); \
+        (*env)->DeleteLocalRef(env, _str);                  \
     } else (void)(0)
 
 #define SET_SARRAY_W(A, I, V)                               \
     if ((A) && (V)) {                                       \
-        jstring _str = ACR_NewJavaStringW(_E, (V));         \
-        (*_E)->SetObjectArrayElement(_E, (A), (I), _str);   \
-        (*_E)->DeleteLocalRef(_E, _str);                    \
+        jstring _str = ACR_NewJavaStringW(env, (V));        \
+        (*env)->SetObjectArrayElement(env, (A), (I), _str); \
+        (*env)->DeleteLocalRef(env, _str);                  \
     } else (void)(0)
 
 #endif /* _ACR_JNIDEFS_H_ */

Modified: commons/sandbox/runtime/trunk/src/main/native/include/acr/memory.h
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/include/acr/memory.h?rev=1091194&r1=1091193&r2=1091194&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/include/acr/memory.h (original)
+++ commons/sandbox/runtime/trunk/src/main/native/include/acr/memory.h Mon Apr 11 20:20:52 2011
@@ -30,26 +30,26 @@
 
 #if defined(DEBUG) || defined(_DEBUG)
 #define ACR_MALLOC(Type, Size)      \
-                ((Type *)AcrDebugMalloc(_E, sizeof(Type) * (size_t)(Size), __FILE_FUNC_LINE__))
+                ((Type *)AcrDebugMalloc(env, sizeof(Type) * (size_t)(Size), __FILE_FUNC_LINE__))
 #define ACR_CALLOC(Type, Size)      \
-                ((Type *)AcrDebugCalloc(_E, sizeof(Type) * (size_t)(Size), __FILE_FUNC_LINE__))
+                ((Type *)AcrDebugCalloc(env, sizeof(Type) * (size_t)(Size), __FILE_FUNC_LINE__))
 #define ACR_EALLOC(Type, Size)      \
-                ((Type *)AcrDebugCalloc(_E, sizeof(Type) + (size_t)(Size), __FILE_FUNC_LINE__))
+                ((Type *)AcrDebugCalloc(env, sizeof(Type) + (size_t)(Size), __FILE_FUNC_LINE__))
 #define ACR_TALLOC(Type)            \
-                ((Type *)AcrDebugCalloc(_E, sizeof(Type), __FILE_FUNC_LINE__))
+                ((Type *)AcrDebugCalloc(env, sizeof(Type), __FILE_FUNC_LINE__))
 #define ACR_REALLOC(Type, Mem, Size)\
-                ((Type *)AcrDebugRealloc(_E, (Mem), sizeof(Type) * (size_t)(Size), __FILE_FUNC_LINE__))
+                ((Type *)AcrDebugRealloc(env, (Mem), sizeof(Type) * (size_t)(Size), __FILE_FUNC_LINE__))
 #else
 #define ACR_MALLOC(Type, Size)      \
-                ((Type *)AcrMalloc(_E, sizeof(Type) * (size_t)(Size)))
+                ((Type *)AcrMalloc(env, sizeof(Type) * (size_t)(Size)))
 #define ACR_CALLOC(Type, Size)      \
-                ((Type *)AcrCalloc(_E, sizeof(Type) * (size_t)(Size)))
+                ((Type *)AcrCalloc(env, sizeof(Type) * (size_t)(Size)))
 #define ACR_EALLOC(Type, Size)      \
-                ((Type *)AcrCalloc(_E, sizeof(Type) + (size_t)(Size)))
+                ((Type *)AcrCalloc(env, sizeof(Type) + (size_t)(Size)))
 #define ACR_TALLOC(Type)            \
-                ((Type *)AcrCalloc(_E, sizeof(Type)))
+                ((Type *)AcrCalloc(env, sizeof(Type)))
 #define ACR_REALLOC(Type, Mem, Size)\
-                ((Type *)AcrRealloc(_E, (Mem), sizeof(Type) * (size_t)(Size)))
+                ((Type *)AcrRealloc(env, (Mem), sizeof(Type) * (size_t)(Size)))
 #endif
 
 #define ACR_FFREE(Mem) _pr_free((void *)(Mem))

Modified: commons/sandbox/runtime/trunk/src/main/native/include/acr/string.h
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/include/acr/string.h?rev=1091194&r1=1091193&r2=1091194&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/include/acr/string.h (original)
+++ commons/sandbox/runtime/trunk/src/main/native/include/acr/string.h Mon Apr 11 20:20:52 2011
@@ -25,14 +25,14 @@
 #define ACR_CP_UTF_8        2
 #define ACR_CP_1252         3
 
-#define UTF8_TO_JSTRING(V)  AcrNewJavaStringU(_E, (const char *)(V))
-#define CSTR_TO_JSTRING(V)  AcrNewJavaStringA(_E, (const char *)(V))
-#define WSTR_TO_JSTRING(V)  AcrNewJavaStringW(_E, (const wchar_t *)(V))
+#define UTF8_TO_JSTRING(V)  AcrNewJavaStringU(env, (const char *)(V))
+#define CSTR_TO_JSTRING(V)  AcrNewJavaStringA(env, (const char *)(V))
+#define WSTR_TO_JSTRING(V)  AcrNewJavaStringW(env, (const wchar_t *)(V))
 #if defined(_WINDOWS)
-#define PSTR_TO_JSTRING(V)  AcrNewJavaStringW(_E, (const wchar_t *)(V))
+#define PSTR_TO_JSTRING(V)  AcrNewJavaStringW(env, (const wchar_t *)(V))
 #define _PTEXT(X)           L ## X
 #else
-#define PSTR_TO_JSTRING(V)  AcrNewJavaStringU(_E, (const char *)(V))
+#define PSTR_TO_JSTRING(V)  AcrNewJavaStringU(env, (const char *)(V))
 #define _PTEXT(X)           X
 #endif
 #define J2S(V)              _s##V
@@ -40,19 +40,19 @@
 #define WITH_WSTR(V)                                                        \
     do {                                                                    \
     wchar_t  _b##V[ACR_MBUFF_SIZ];                                          \
-    wchar_t *_s##V = AcrGetJavaStringW(_E, V, _b##V);                       \
+    wchar_t *_s##V = AcrGetJavaStringW(env, V, _b##V);                      \
     if (_s##V == 0 && V != 0) goto _e##V;
 
 #define WITH_CSTR(V)                                                        \
     do {                                                                    \
     char  _b##V[ACR_PBUFF_SIZ];                                             \
-    char *_s##V = AcrGetJavaStringA(_E, V, _b##V);                          \
+    char *_s##V = AcrGetJavaStringA(env, V, _b##V);                         \
     if (_s##V == 0 && V != 0) goto _e##V;
 
 #define WITH_USTR(V)                                                        \
     do {                                                                    \
     char  _b##V[ACR_PBUFF_SIZ];                                             \
-    char *_s##V = AcrGetJavaStringU(_E, V, _b##V);                          \
+    char *_s##V = AcrGetJavaStringU(env, V, _b##V);                         \
     if (_s##V == 0 && V != 0) goto _e##V;
 
 #define DONE_WITH_STR(V)                                                    \
@@ -66,10 +66,10 @@
 #define WITH_JCHR(V)                                                        \
     do {                                                                    \
     wchar_t *_s##V = 0;                                                     \
-    if (V != 0) _s##V = (wchar_t *)(*_E)->GetStringChars(_E, V, 0);         \
+    if (V != 0) _s##V = (wchar_t *)(*env)->GetStringChars(env, V, 0);       \
 
 #define DONE_WITH_CHR(V)                                                    \
-        if (_s##V != 0) (*_E)->ReleaseStringChars(_E, V, (jchar *)_s##V);   \
+        if (_s##V != 0) (*env)->ReleaseStringChars(env, V, (jchar *)_s##V); \
     } while(0)
 
 

Modified: commons/sandbox/runtime/trunk/src/main/native/include/acr/unsafe.h
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/include/acr/unsafe.h?rev=1091194&r1=1091193&r2=1091194&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/include/acr/unsafe.h (original)
+++ commons/sandbox/runtime/trunk/src/main/native/include/acr/unsafe.h Mon Apr 11 20:20:52 2011
@@ -30,7 +30,7 @@
 
 #define UNSAFE_IFIELD(I)                                                      \
     if (_f##I##n.i != 0) {                                                    \
-        _f##I##n.o = AcrUnsafeObjectFieldIdOffset(_E, _clazzn.i, _f##I##n.i); \
+        _f##I##n.o = AcrUnsafeObjectFieldIdOffset(env, _clazzn.i, _f##I##n.i); \
     } else (void)(0)
 
 #ifdef __cplusplus

Modified: commons/sandbox/runtime/trunk/src/main/native/os/unix/platform.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/os/unix/platform.c?rev=1091194&r1=1091193&r2=1091194&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/os/unix/platform.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/os/unix/platform.c Mon Apr 11 20:20:52 2011
@@ -36,7 +36,7 @@ ACR_JNI_EXPORT(void, Platform, init1)(JN
     jint ia[16];
 
     UNREFERENCED_OBJECT;
-    (*_E)->GetIntArrayRegion(_E, p, 0, 16, ia);
+    (*env)->GetIntArrayRegion(env, p, 0, 16, ia);
 
     ia[0]  = sizeof(int);
     ia[1]  = sizeof(long);
@@ -53,7 +53,7 @@ ACR_JNI_EXPORT(void, Platform, init1)(JN
     ia[8]  = (jint)getpagesize();
     ia[9]  = ia[8];
 
-    (*_E)->SetIntArrayRegion(_E, p, 0, 16, ia);
+    (*env)->SetIntArrayRegion(env, p, 0, 16, ia);
 }
 
 ACR_JNI_EXPORT(jboolean, Platform, supported0)(JNI_STDARGS)

Modified: commons/sandbox/runtime/trunk/src/main/native/shared/callback.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/shared/callback.c?rev=1091194&r1=1091193&r2=1091194&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/shared/callback.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/shared/callback.c Mon Apr 11 20:20:52 2011
@@ -41,7 +41,7 @@ ACR_CLASS_CTOR(Callback)
 {
     int rv;
 
-    if ((rv = AcrLoadClass(_E, &_clazzn, 0)) != ACR_SUCCESS)
+    if ((rv = AcrLoadClass(env, &_clazzn, 0)) != ACR_SUCCESS)
         return rv;
     J_LOAD_METHOD(0000);
 
@@ -51,7 +51,7 @@ ACR_CLASS_CTOR(Callback)
 
 ACR_CLASS_DTOR(Callback)
 {
-    AcrUnloadClass(_E, &_clazzn);
+    AcrUnloadClass(env, &_clazzn);
 }
 
 acr_callback_t *
@@ -80,12 +80,12 @@ AcrCallbackAttach(JNI_STDARGS, jobject r
     acr_callback_t *cb = ACR_EALLOC(acr_callback_t, size);
     if (cb == 0)
         return 0;
-    if (IS_VALID_HANDLE(_E) && IS_VALID_HANDLE(_O)) {
-        cb->thiz = (*_E)->NewWeakGlobalRef(_E, _O);
+    if (IS_VALID_HANDLE(env) && IS_VALID_HANDLE(obj)) {
+        cb->thiz = (*env)->NewWeakGlobalRef(env, obj);
         if (cb->thiz == 0)
             goto cleanup;
         if (IS_VALID_HANDLE(refd)) {
-            cb->data = (*_E)->NewWeakGlobalRef(_E, refd);
+            cb->data = (*env)->NewWeakGlobalRef(env, refd);
             if (cb->data == 0)
                 goto cleanup;
         }
@@ -98,8 +98,8 @@ AcrCallbackAttach(JNI_STDARGS, jobject r
     return cb;
 
 cleanup:
-    if (IS_VALID_HANDLE(_E) && cb->thiz)
-        (*_E)->DeleteWeakGlobalRef(_E, cb->thiz);
+    if (IS_VALID_HANDLE(env) && cb->thiz)
+        (*env)->DeleteWeakGlobalRef(env, cb->thiz);
     AcrFree(cb);
     return NULL;
 }
@@ -110,11 +110,11 @@ AcrCallbackFree(JNI_STDENV, acr_callback
 
     if (cb == 0)
         return ACR_EISNULL;
-    if (_E == 0 && cb->thiz)
-        _E = AcrGetJNIEnv();
-    if (IS_VALID_HANDLE(_E)) {
+    if (env == 0 && cb->thiz)
+        env = AcrGetJNIEnv();
+    if (IS_VALID_HANDLE(env)) {
         if (cb->thiz)
-            (*_E)->DeleteWeakGlobalRef(_E, cb->thiz);
+            (*env)->DeleteWeakGlobalRef(env, cb->thiz);
     }
     AcrFree(cb);
     return 0;
@@ -128,11 +128,11 @@ AcrCallbackRun(JNI_STDENV, acr_callback_
     if (cb == 0) {
         return ACR_EINVAL;
     }
-    if (_E == 0 && cb->thiz) {
+    if (env == 0 && cb->thiz) {
         /* Get JNIEnv only if needed
          */
-        _E = AcrGetJNIEnv();
-        if (IS_INVALID_HANDLE(_E))
+        env = AcrGetJNIEnv();
+        if (IS_INVALID_HANDLE(env))
             return ACR_ENOJNIENV;
     }
     if (cb->handler) {
@@ -146,7 +146,7 @@ AcrCallbackRun(JNI_STDENV, acr_callback_
         }
         /* Execute the handler
          */
-        *rv = (*cb->handler)(_E, cb, &ctx, val);
+        *rv = (*cb->handler)(env, cb, &ctx, val);
         if (cb->type == ACR_CALLBACK_SYNC) {
         }
         rc = 0;
@@ -157,7 +157,7 @@ AcrCallbackRun(JNI_STDENV, acr_callback_
     }
     else {
         jobject d = 0;
-        jobject o = (*_E)->NewLocalRef(_E, cb->thiz);
+        jobject o = (*env)->NewLocalRef(env, cb->thiz);
         if (o == 0) {
             /* Object was garbage collected.
              * TODO: Check for appropriate errno.
@@ -165,13 +165,13 @@ AcrCallbackRun(JNI_STDENV, acr_callback_
             return ACR_DETACH;
         }
         if (ctx == 0 && cb->data)
-            d = (*_E)->NewLocalRef(_E, cb->data);
+            d = (*env)->NewLocalRef(env, cb->data);
         else
             d = (jobject)ctx;
         if (cb->type == ACR_CALLBACK_SYNC) {
             /* Syncronize the access to the callback object
              */
-            if ((*_E)->MonitorEnter(_E, o)) {
+            if ((*env)->MonitorEnter(env, o)) {
                 /* Object locking failed */
                 return ACR_ENOLOCK;
             }
@@ -181,11 +181,11 @@ AcrCallbackRun(JNI_STDENV, acr_callback_
         *rv = CALL_METHOD2(Int, 0000, o, d, val);
         if (cb->type == ACR_CALLBACK_SYNC) {
             /* Unlock */
-            (*_E)->MonitorExit(_E, o);
+            (*env)->MonitorExit(env, o);
         }
         if (ctx == 0 && d)
-            (*_E)->DeleteLocalRef(_E, d);
-        (*_E)->DeleteLocalRef(_E, o);
+            (*env)->DeleteLocalRef(env, d);
+        (*env)->DeleteLocalRef(env, o);
 
         return 0;
     }

Modified: commons/sandbox/runtime/trunk/src/main/native/shared/clazz.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/shared/clazz.c?rev=1091194&r1=1091193&r2=1091194&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/shared/clazz.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/shared/clazz.c Mon Apr 11 20:20:52 2011
@@ -155,7 +155,7 @@ ACR_CLASS_CTOR(Class)
 {
     int rv;
 
-    if ((rv = AcrLoadClass(_E, &_clazzn, 0)) != ACR_SUCCESS)
+    if ((rv = AcrLoadClass(env, &_clazzn, 0)) != ACR_SUCCESS)
         return rv;
     J_LOAD_METHOD(0000);
     J_LOAD_METHOD(0001);
@@ -180,7 +180,7 @@ ACR_CLASS_CTOR(Class)
 static
 ACR_CLASS_DTOR(Class)
 {
-    AcrUnloadClass(_E, &_clazzn);
+    AcrUnloadClass(env, &_clazzn);
 }
 
 int
@@ -191,10 +191,10 @@ AcrInitCoreClasses(JNI_STDENV)
     if (core_classes[0].clazz)
         return 0;
     while (core_classes[i].name) {
-        jobject o = (jobject)(*_E)->FindClass(_E, core_classes[i].name);
+        jobject o = (jobject)(*env)->FindClass(env, core_classes[i].name);
         if (o != 0) {
-            core_classes[i].clazz = (jclass)(*_E)->NewGlobalRef(_E, o);
-            (*_E)->DeleteLocalRef(_E, o);
+            core_classes[i].clazz = (jclass)(*env)->NewGlobalRef(env, o);
+            (*env)->DeleteLocalRef(env, o);
             if (core_classes[i].clazz == 0) {
                 /* Reference failed */
                 return ACR_ENOMEM;
@@ -243,7 +243,7 @@ AcrUnloadRuntimeClasses(JNI_STDENV)
 #ifdef WIN32
 
 #endif
-    AcrReleaseExceptionClasses(_E);
+    AcrReleaseExceptionClasses(env);
 }
 
 jclass
@@ -260,7 +260,7 @@ AcrNewCoreObjectArray(JNI_STDENV, int cl
 {
     jclass cc = AcrGetCoreClass(clazz);
     if (cc)
-        return (*_E)->NewObjectArray(_E, len, cc, 0);
+        return (*env)->NewObjectArray(env, len, cc, 0);
     else
         return 0;
 }
@@ -274,32 +274,32 @@ AcrLoadClass(JNI_STDENV, JAVA_C_ID *claz
         /* Already inited */
         return 0;
     }
-    if ((*_E)->EnsureLocalCapacity(_E, 3) < 0) {
+    if ((*env)->EnsureLocalCapacity(env, 3) < 0) {
         goto failed;
     }
     /* Init class */
-    c = (jobject)(*_E)->FindClass(_E, clazz->n);
+    c = (jobject)(*env)->FindClass(env, clazz->n);
     if (c == 0) {
         /* Exception has been thrown
          * We could clear the exception here.
          */
         goto failed;
     }
-    clazz->i = (jclass)(*_E)->NewGlobalRef(_E, c);
+    clazz->i = (jclass)(*env)->NewGlobalRef(env, c);
     if (clazz->i == 0) {
         goto failed;
     }
-    (*_E)->DeleteLocalRef(_E, c);
+    (*env)->DeleteLocalRef(env, c);
 
     if (init_array != 0) {
         char an[ACR_SBUFF_SIZ];
         /* Init class array */
         snprintf(an, ACR_SBUFF_SIZ, "[L%s;", clazz->n);
-        c = (jobject)(*_E)->FindClass(_E, an);
+        c = (jobject)(*env)->FindClass(env, an);
         if (c == 0) {
             goto failed;
         }
-        clazz->a = (jclass)(*_E)->NewGlobalRef(_E, c);
+        clazz->a = (jclass)(*env)->NewGlobalRef(env, c);
         if (clazz->a == 0) {
             goto failed;
         }
@@ -313,7 +313,7 @@ AcrLoadClass(JNI_STDENV, JAVA_C_ID *claz
 
 failed:
     if (clazz->i != 0) {
-        (*_E)->DeleteGlobalRef(_E, clazz->i);
+        (*env)->DeleteGlobalRef(env, clazz->i);
         clazz->i = 0;
     }
     return ACR_NOTFOUND;
@@ -323,11 +323,11 @@ void
 AcrUnloadClass(JNI_STDENV, JAVA_C_ID *clazz)
 {
     if (clazz->i != 0) {
-        (*_E)->DeleteGlobalRef(_E, clazz->i);
+        (*env)->DeleteGlobalRef(env, clazz->i);
         clazz->i = 0;
     }
     if (clazz->a != 0) {
-        (*_E)->DeleteGlobalRef(_E, clazz->a);
+        (*env)->DeleteGlobalRef(env, clazz->a);
         clazz->a = 0;
     }
 }
@@ -336,27 +336,27 @@ int
 AcrClassGetFlags(JNI_STDARGS)
 {
     int flags = 0;
-    if (IS_JOBJECT_NULL(_E, _O))
+    if (IS_JOBJECT_NULL(env, obj))
         return 0;
 
     if (CLAZZ_LOADED) {
-        if (CALL_METHOD0(Boolean, 0006, _O) == JNI_TRUE)
+        if (CALL_METHOD0(Boolean, 0006, obj) == JNI_TRUE)
             flags |= ACR_CLASS_ANNOTATION;
-        if (CALL_METHOD0(Boolean, 0007, _O) == JNI_TRUE)
+        if (CALL_METHOD0(Boolean, 0007, obj) == JNI_TRUE)
             flags |= ACR_CLASS_ANONYMOUS;
-        if (CALL_METHOD0(Boolean, 0008, _O) == JNI_TRUE)
+        if (CALL_METHOD0(Boolean, 0008, obj) == JNI_TRUE)
             flags |= ACR_CLASS_ARRAY;
-        if (CALL_METHOD0(Boolean, 0009, _O) == JNI_TRUE)
+        if (CALL_METHOD0(Boolean, 0009, obj) == JNI_TRUE)
             flags |= ACR_CLASS_ENUM;
-        if (CALL_METHOD0(Boolean, 0010, _O) == JNI_TRUE)
+        if (CALL_METHOD0(Boolean, 0010, obj) == JNI_TRUE)
             flags |= ACR_CLASS_INTERFACE;
-        if (CALL_METHOD0(Boolean, 0011, _O) == JNI_TRUE)
+        if (CALL_METHOD0(Boolean, 0011, obj) == JNI_TRUE)
             flags |= ACR_CLASS_LOCAL;
-        if (CALL_METHOD0(Boolean, 0012, _O) == JNI_TRUE)
+        if (CALL_METHOD0(Boolean, 0012, obj) == JNI_TRUE)
             flags |= ACR_CLASS_MEMBER;
-        if (CALL_METHOD0(Boolean, 0013, _O) == JNI_TRUE)
+        if (CALL_METHOD0(Boolean, 0013, obj) == JNI_TRUE)
             flags |= ACR_CLASS_PRIMITIVE;
-        if (CALL_METHOD0(Boolean, 0014, _O) == JNI_TRUE)
+        if (CALL_METHOD0(Boolean, 0014, obj) == JNI_TRUE)
             flags |= ACR_CLASS_SYNTHETIC;
     }
     return flags;
@@ -366,17 +366,17 @@ char *
 AcrClassGetName(JNI_STDARGS, int simple)
 {
     char *name = 0;
-    if (IS_JOBJECT_NULL(_E, _O))
+    if (IS_JOBJECT_NULL(env, obj))
         return 0;
 
     if (CLAZZ_LOADED) {
         jstring sn;
         if (simple)
-             sn = CALL_METHOD0(Object, 0001, _O);
+             sn = CALL_METHOD0(Object, 0001, obj);
         else
-             sn = CALL_METHOD0(Object, 0000, _O);
+             sn = CALL_METHOD0(Object, 0000, obj);
         if (sn)
-            name = AcrGetJavaStringA(_E, sn, 0);
+            name = AcrGetJavaStringA(env, sn, 0);
     }
     return name;
 }

Modified: commons/sandbox/runtime/trunk/src/main/native/shared/error.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/shared/error.c?rev=1091194&r1=1091193&r2=1091194&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/shared/error.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/shared/error.c Mon Apr 11 20:20:52 2011
@@ -526,8 +526,8 @@ AcrFatalError(JNI_STDENV,
         vsnprintf(buf, sizeof(buf), msg, ap);
         va_end(ap);
     }
-    if (IS_VALID_HANDLE(_E)) {
-        (*_E)->FatalError(_E, buf);
+    if (IS_VALID_HANDLE(env)) {
+        (*env)->FatalError(env, buf);
         return;
     }
     fputs(buf, stderr);
@@ -556,9 +556,9 @@ AcrThrowClass(JNI_STDENV, const char *cl
 {
     jclass ec;
 
-    if (_E == 0)
-        _E = AcrGetJNIEnv();
-    if (IS_INVALID_HANDLE(_E)) {
+    if (env == 0)
+        env = AcrGetJNIEnv();
+    if (IS_INVALID_HANDLE(env)) {
         ACR_DEBUG_TRACE("JNI Environment is invalid or unavailable (%d).", ACR_GET_OS_ERROR());
         ACR_DEBUG_TRACE("Throwing class '%s'", clazz);
         if (msg) {
@@ -566,7 +566,7 @@ AcrThrowClass(JNI_STDENV, const char *cl
         }
         return;
     }
-    if ((*_E)->ExceptionCheck(_E)) {
+    if ((*env)->ExceptionCheck(env)) {
         /* We already have a pending exception. */
         ACR_DEBUG_TRACE("Exception is already in the queue. Throwing '%s'", clazz);
         if (msg) {
@@ -574,7 +574,7 @@ AcrThrowClass(JNI_STDENV, const char *cl
         }
         return;
     }
-    ec = (*_E)->FindClass(_E, clazz);
+    ec = (*env)->FindClass(env, clazz);
     if (ec == 0) {
         /* If the class cannot be found,
          * the Exception has already been thrown.
@@ -586,7 +586,7 @@ AcrThrowClass(JNI_STDENV, const char *cl
         }
         return;
     }
-    (*_E)->ThrowNew(_E, ec, msg);
+    (*env)->ThrowNew(env, ec, msg);
 }
 
 void
@@ -594,18 +594,18 @@ AcrThrowByName(JNI_STDENV, const char *c
 {
     jclass ec;
 
-    if (_E == 0)
-        _E = AcrGetJNIEnv();
+    if (env == 0)
+        env = AcrGetJNIEnv();
     if (cls == 0)
         cls = "java/lang/Exception";
-    if (IS_INVALID_HANDLE(_E)) {
+    if (IS_INVALID_HANDLE(env)) {
         ACR_DEBUG_TRACE("JNI Environment is invalid or unavailable. Throwing '%s'", cls);
         if (msg) {
             ACR_DEBUG_TRACE("%s", msg);
         }
         return;
     }
-    if ((*_E)->ExceptionCheck(_E)) {
+    if ((*env)->ExceptionCheck(env)) {
         /* We already have a pending exception. */
         ACR_DEBUG_TRACE("Exception is already in the queue. Throwing '%s'", cls);
         if (msg) {
@@ -613,7 +613,7 @@ AcrThrowByName(JNI_STDENV, const char *c
         }
         return;
     }
-    if ((ec = (*_E)->FindClass(_E, cls)) == 0) {
+    if ((ec = (*env)->FindClass(env, cls)) == 0) {
         /* If the class cannot be found,
          * the Exception has already been thrown.
          * See JNI Find Class for the Exceptions thrown.
@@ -624,7 +624,7 @@ AcrThrowByName(JNI_STDENV, const char *c
         }
         return;
     }
-    (*_E)->ThrowNew(_E, ec, msg);
+    (*env)->ThrowNew(env, ec, msg);
 }
 
 void
@@ -632,18 +632,18 @@ AcrThrow(JNI_STDENV, int cls, const char
 {
     jclass ec = 0;
 
-    if (_E == 0)
-        _E = AcrGetJNIEnv();
+    if (env == 0)
+        env = AcrGetJNIEnv();
     if (cls < 0 && cls >= ACR_EX_LEN)
         cls = 0;
-    if (IS_INVALID_HANDLE(_E)) {
+    if (IS_INVALID_HANDLE(env)) {
         ACR_DEBUG_TRACE("JNI Environment is invalid or unavailable. Throwing '%s'", _throw_classes[cls].name);
         if (msg) {
             ACR_DEBUG_TRACE("%s", msg);
         }
         return;
     }
-    if ((*_E)->ExceptionCheck(_E)) {
+    if ((*env)->ExceptionCheck(env)) {
         /* We already have a pending exception. */
         ACR_DEBUG_TRACE("Exception is already in the queue. Throwing '%s'",
                         _throw_classes[cls].name);
@@ -653,7 +653,7 @@ AcrThrow(JNI_STDENV, int cls, const char
         return;
     }
     if (_throw_classes[cls].clazz == 0) {
-        ec = (*_E)->FindClass(_E, _throw_classes[cls].name);
+        ec = (*env)->FindClass(env, _throw_classes[cls].name);
         if (ec == 0) {
             /* If the class cannot be found,
              * the Exception has already been thrown.
@@ -670,16 +670,16 @@ AcrThrow(JNI_STDENV, int cls, const char
         if (_throw_classes[cls].clazz == 0) {
             /* Create a global reference to the class.
              */
-            _throw_classes[cls].clazz = (jclass)(*_E)->NewGlobalRef(_E, ec);
+            _throw_classes[cls].clazz = (jclass)(*env)->NewGlobalRef(env, ec);
         }
         AcrLibLockRelease();
         if (_throw_classes[cls].clazz == 0)
             return;
-        (*_E)->DeleteLocalRef(_E, ec);
+        (*env)->DeleteLocalRef(env, ec);
         ec = _throw_classes[cls].clazz;
 #endif
     }
-    (*_E)->ThrowNew(_E, ec, msg);
+    (*env)->ThrowNew(env, ec, msg);
 }
 
 void
@@ -714,7 +714,7 @@ AcrDebugThrowException(JNI_STDENV,
         }
         _cr_strerror_r(err, ptr, ACR_MBUFF_SIZ);
     }
-    AcrThrow(_E, cls, msg);
+    AcrThrow(env, cls, msg);
 }
 
 void
@@ -730,7 +730,7 @@ AcrThrowException(JNI_STDENV, int cls, i
         msg = buffer;
         _cr_strerror_r(err, buffer, ACR_MBUFF_SIZ);
     }
-    AcrThrow(_E, cls, msg);
+    AcrThrow(env, cls, msg);
 }
 
 void
@@ -739,7 +739,7 @@ AcrReleaseExceptionClasses(JNI_STDENV)
     int i;
     for (i = 0; i < ACR_EX_LEN; i++) {
         if (_throw_classes[i].clazz != 0) {
-            (*_E)->DeleteGlobalRef(_E,_throw_classes[i].clazz);
+            (*env)->DeleteGlobalRef(env,_throw_classes[i].clazz);
             _throw_classes[i].clazz = 0;
         }
     }
@@ -750,7 +750,7 @@ ACR_IO_EXPORT(jstring, Status, describe)
     char buf[ACR_MBUFF_SIZ] = "";
 
     _cr_strerror_r(err, buf, ACR_MBUFF_SIZ);
-    return AcrNewJavaStringA(_E, buf);
+    return AcrNewJavaStringA(env, buf);
 }
 
 ACR_IO_EXPORT(jboolean, Status, is0)(JNI_STDARGS, jint what, jint err)

Modified: commons/sandbox/runtime/trunk/src/main/native/shared/iofd.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/shared/iofd.c?rev=1091194&r1=1091193&r2=1091194&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/shared/iofd.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/shared/iofd.c Mon Apr 11 20:20:52 2011
@@ -66,7 +66,7 @@ ACR_CLASS_CTOR(FileDescriptor)
 {
     int rv;
 
-    if ((rv = AcrLoadClass(_E, &_clazzn, 0)) != 0)
+    if ((rv = AcrLoadClass(env, &_clazzn, 0)) != 0)
         return rv;
     J_LOAD_METHOD(0000);
     J_LOAD_METHOD(0001);
@@ -84,7 +84,7 @@ ACR_CLASS_CTOR(FileDescriptor)
 
 ACR_CLASS_DTOR(FileDescriptor)
 {
-    AcrUnloadClass(_E, &_clazzn);
+    AcrUnloadClass(env, &_clazzn);
 }
 
 int
@@ -93,14 +93,14 @@ AcrGetFileDescriptorFd(JNI_STDARGS)
     int fd = -1;
 
     if (J4FLD_OFF(0000) != INVALID_FIELD_OFFSET) {
-        char *oa = *(char **)_O;
+        char *oa = *(char **)obj;
         if (oa != 0) {
             char *fa = (oa + (ptrdiff_t)J4FLD_OFF(0000));
             fd = *((int *)fa);
         }
     }
     else if (CLAZZ_LOADED) {
-        fd = GET_IFIELD_I(0000, _O);
+        fd = GET_IFIELD_I(0000, obj);
     }
     return fd;
 }
@@ -111,7 +111,7 @@ AcrSetFileDescriptorFd(JNI_STDARGS, int 
     int rc = ACR_EBADF;
 
     if (J4FLD_OFF(0000) != INVALID_FIELD_OFFSET) {
-        char *oa = *(char **)_O;
+        char *oa = *(char **)obj;
         if (oa != 0) {
             char *fa = (oa + (ptrdiff_t)J4FLD_OFF(0000));
             *((int *)fa) = fd;
@@ -119,7 +119,7 @@ AcrSetFileDescriptorFd(JNI_STDARGS, int 
         }
     }
     else if (CLAZZ_LOADED) {
-        SET_IFIELD_I(0000, _O, fd);
+        SET_IFIELD_I(0000, obj, fd);
         rc = 0;
     }
     return rc;
@@ -132,14 +132,14 @@ AcrGetFileDescriptorHandle(JNI_STDARGS)
     HANDLE fh = INVALID_HANDLE_VALUE;
 
     if (J4FLD_OFF(0001) != INVALID_FIELD_OFFSET) {
-        char *oa = *(char **)_O;
+        char *oa = *(char **)obj;
         if (oa != 0) {
             char *fa = (oa + (ptrdiff_t)J4FLD_OFF(0001));
             fh = J2P(*((jlong *)fa), HANDLE);
         }
     }
     else if (CLAZZ_LOADED) {
-        fh = GET_IFIELD_P(0001, _O, HANDLE);
+        fh = GET_IFIELD_P(0001, obj, HANDLE);
     }
     return fh;
 }
@@ -150,7 +150,7 @@ AcrSetFileDescriptorHandle(JNI_STDARGS, 
     int rc = ACR_EBADF;
 
     if (J4FLD_OFF(0001) != INVALID_FIELD_OFFSET) {
-        char *oa = *(char **)_O;
+        char *oa = *(char **)obj;
         if (oa != 0) {
             char *fa = (oa + (ptrdiff_t)J4FLD_OFF(0001));
             *((jlong *)fa) = P2J(fh);
@@ -158,7 +158,7 @@ AcrSetFileDescriptorHandle(JNI_STDARGS, 
         }
     }
     else if (CLAZZ_LOADED) {
-        SET_IFIELD_P(0001, _O, fh);
+        SET_IFIELD_P(0001, obj, fh);
         rc = 0;
     }
     return rc;
@@ -174,11 +174,11 @@ AcrNewFileDescriptor(JNI_STDENV, int fd,
         ACR_THROW_MSG(ACR_EX_EINSTANCE, "FileDescriptor not initialized");
         return 0;
     }
-    fo = (*_E)->NewObject(_E, _clazzn.i, J4MID(0001), fd);
+    fo = (*env)->NewObject(env, _clazzn.i, J4MID(0001), fd);
 #if defined (WINDOWS)
     if (fo != 0) {
-        if (AcrFileDescriptorSetHandle(_E, fo, fh) != 0) {
-            (*_E)->DeleteLocalRef(_E, fo);
+        if (AcrFileDescriptorSetHandle(env, fo, fh) != 0) {
+            (*env)->DeleteLocalRef(env, fo);
             fo = 0;
         }
     }
@@ -190,5 +190,5 @@ AcrNewFileDescriptor(JNI_STDENV, int fd,
 
 ACR_IO_EXPORT(jobject, FileDescriptorFactory, new0)(JNI_STDARGS, jint fd, jlong fh)
 {
-    return AcrNewFileDescriptor(_E, fd, (acr_osd_t)LLT(fh));
+    return AcrNewFileDescriptor(env, fd, (acr_osd_t)LLT(fh));
 }

Modified: commons/sandbox/runtime/trunk/src/main/native/shared/memory.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/shared/memory.c?rev=1091194&r1=1091193&r2=1091194&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/shared/memory.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/shared/memory.c Mon Apr 11 20:20:52 2011
@@ -42,10 +42,10 @@ void
 AcrMemoryAbort(JNI_STDENV, int retcode, size_t required, const char *filename,
                const char *funcname, int lineno)
 {
-    AcrDebugThrowException(_E, filename, funcname, lineno, ACR_EX_ENOMEM, retcode);
+    AcrDebugThrowException(env, filename, funcname, lineno, ACR_EX_ENOMEM, retcode);
     if ((retcode = (*_memory_abort_fn)(retcode, required,
                                        filename, funcname, lineno))) {
-        AcrFatalError(_E, filename, funcname, lineno, retcode,
+        AcrFatalError(env, filename, funcname, lineno, retcode,
                       "Failed allocating %" ACR_SIZE_T_FMT " bytes", required);
     }
 }
@@ -69,11 +69,11 @@ AcrDebugMalloc(JNI_STDENV, size_t size,
     if (size > 0 && size < SIZE_T_MAX) {
         void *rv = malloc(size);
         if (rv == 0)
-            AcrMemoryAbort(_E, ACR_ENOMEM, size, filename, funcname, lineno);
+            AcrMemoryAbort(env, ACR_ENOMEM, size, filename, funcname, lineno);
         return rv;
     }
     else {
-        AcrMemoryAbort(_E, ACR_ERANGE, size, filename, funcname, lineno);
+        AcrMemoryAbort(env, ACR_ERANGE, size, filename, funcname, lineno);
         return 0;
     }
 }
@@ -85,11 +85,11 @@ AcrDebugCalloc(JNI_STDENV, size_t size,
     if (size > 0 && size < SIZE_T_MAX) {
         void *rv = calloc(1, size);
         if (rv == 0)
-            AcrMemoryAbort(_E, ACR_ENOMEM, size, filename, funcname, lineno);
+            AcrMemoryAbort(env, ACR_ENOMEM, size, filename, funcname, lineno);
         return rv;
     }
     else {
-        AcrMemoryAbort(_E, ACR_ERANGE, size, filename, funcname, lineno);
+        AcrMemoryAbort(env, ACR_ERANGE, size, filename, funcname, lineno);
         return 0;
     }
 }
@@ -100,18 +100,18 @@ AcrDebugRealloc(JNI_STDENV, void *ptr, s
 {
     if (ptr == acr_zero_string_ptr) {
         /* Call malloc if reallocating zero string */
-        return AcrMalloc(_E, size);
+        return AcrMalloc(env, size);
     }
     else if (size > 0 && size < SIZE_T_MAX) {
         void *rv = realloc(ptr, size);
         if (rv == 0)
-            AcrMemoryAbort(_E, ACR_ENOMEM, size, filename, funcname, lineno);
+            AcrMemoryAbort(env, ACR_ENOMEM, size, filename, funcname, lineno);
         return rv;
     }
     else if (size == 0)
         AcrFree(ptr);
     else
-        AcrMemoryAbort(_E, ACR_ERANGE, size, filename, funcname, lineno);
+        AcrMemoryAbort(env, ACR_ERANGE, size, filename, funcname, lineno);
     return 0;
 }
 
@@ -121,11 +121,11 @@ AcrMalloc(JNI_STDENV, size_t size)
     if (size > 0 && size < SIZE_T_MAX) {
         void *rv = malloc(size);
         if (rv == 0)
-            AcrMemoryAbort(_E, ACR_ENOMEM, size, 0, 0, 0);
+            AcrMemoryAbort(env, ACR_ENOMEM, size, 0, 0, 0);
         return rv;
     }
     else {
-        AcrMemoryAbort(_E, ACR_ERANGE, size, 0, 0, 0);
+        AcrMemoryAbort(env, ACR_ERANGE, size, 0, 0, 0);
         return 0;
     }
 }
@@ -136,11 +136,11 @@ AcrCalloc(JNI_STDENV, size_t size)
     if (size > 0 && size < SIZE_T_MAX) {
         void *rv = calloc(1, size);
         if (rv == 0)
-            AcrMemoryAbort(_E, ACR_ENOMEM, size, 0, 0, 0);
+            AcrMemoryAbort(env, ACR_ENOMEM, size, 0, 0, 0);
         return rv;
     }
     else {
-        AcrMemoryAbort(_E, ACR_ERANGE, size, 0, 0, 0);
+        AcrMemoryAbort(env, ACR_ERANGE, size, 0, 0, 0);
         return 0;
     }
 }
@@ -150,18 +150,18 @@ AcrRealloc(JNI_STDENV, void *ptr, size_t
 {
     if (ptr == acr_zero_string_ptr) {
         /* Call malloc if reallocating zero string */
-        return AcrMalloc(_E, size);
+        return AcrMalloc(env, size);
     }
     else if (size > 0 && size < SIZE_T_MAX) {
         void *rv = realloc(ptr, size);
         if (rv == 0)
-            AcrMemoryAbort(_E, ACR_ENOMEM, size, 0, 0, 0);
+            AcrMemoryAbort(env, ACR_ENOMEM, size, 0, 0, 0);
         return rv;
     }
     else if (size == 0)
         AcrFree(ptr);
     else
-        AcrMemoryAbort(_E, ACR_ERANGE, size, 0, 0, 0);
+        AcrMemoryAbort(env, ACR_ERANGE, size, 0, 0, 0);
     return 0;
 }
 
@@ -196,7 +196,7 @@ AcrMemdup(JNI_STDENV, const void *src, i
         return acr_zero_string_ptr;
     rv = malloc(len);
     if (rv == 0)
-        AcrMemoryAbort(_E, ACR_ENOMEM, len, 0, 0, 0);
+        AcrMemoryAbort(env, ACR_ENOMEM, len, 0, 0, 0);
     else
         memcpy(rv, src, len);
     return rv;
@@ -213,7 +213,7 @@ AcrStrdup(JNI_STDENV, const char *str)
     else
         rv = strdup(str);
     if (rv == 0)
-        AcrMemoryAbort(_E, ACR_ENOMEM, strlen(str), 0, 0, 0);
+        AcrMemoryAbort(env, ACR_ENOMEM, strlen(str), 0, 0, 0);
     return rv;
 }
 
@@ -230,12 +230,12 @@ AcrWcsdup(JNI_STDENV, const wchar_t *str
         rv = wcsdup(str);
 #else
         size_t len = wcslen(str) + 1;
-        rv = (wchar_t *)AcrMalloc(_E, len * sizeof(wchar_t));
+        rv = (wchar_t *)AcrMalloc(env, len * sizeof(wchar_t));
         if (rv != 0)
             memcpy(rv, str, len * sizeof(wchar_t));
 #endif
     }
     if (rv == 0)
-        AcrMemoryAbort(_E, ACR_ENOMEM, wcslen(str) * sizeof(wchar_t), 0, 0, 0);
+        AcrMemoryAbort(env, ACR_ENOMEM, wcslen(str) * sizeof(wchar_t), 0, 0, 0);
     return rv;
 }

Modified: commons/sandbox/runtime/trunk/src/main/native/shared/native.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/shared/native.c?rev=1091194&r1=1091193&r2=1091194&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/shared/native.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/shared/native.c Mon Apr 11 20:20:52 2011
@@ -30,7 +30,7 @@ ACR_JNI_EXPORT(jboolean, Native, init0)(
 {
     if (_loaded)
 	return JNI_TRUE;
-    if (AcrLoadRuntimeClasses(_E) != 0)
+    if (AcrLoadRuntimeClasses(env) != 0)
         return JNI_FALSE;
     _loaded = JNI_TRUE;
     return _loaded;
@@ -40,6 +40,6 @@ ACR_JNI_EXPORT(void, Native, finalize0)(
 {
     if (_loaded) {
         _loaded = JNI_FALSE;
-        AcrUnloadRuntimeClasses(_E);
+        AcrUnloadRuntimeClasses(env);
     }
 }

Modified: commons/sandbox/runtime/trunk/src/main/native/shared/object.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/shared/object.c?rev=1091194&r1=1091193&r2=1091194&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/shared/object.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/shared/object.c Mon Apr 11 20:20:52 2011
@@ -78,7 +78,7 @@ ACR_CLASS_CTOR(Object)
 {
     int rv;
 
-    if ((rv = AcrLoadClass(_E, &_clazzn, 0)) != ACR_SUCCESS)
+    if ((rv = AcrLoadClass(env, &_clazzn, 0)) != ACR_SUCCESS)
         return rv;
     J_LOAD_METHOD(0000);
     J_LOAD_METHOD(0001);
@@ -95,7 +95,7 @@ ACR_CLASS_CTOR(Object)
 
 ACR_CLASS_DTOR(Object)
 {
-    AcrUnloadClass(_E, &_clazzn);
+    AcrUnloadClass(env, &_clazzn);
 }
 
 int
@@ -103,12 +103,12 @@ AcrObjectNotify(JNI_STDARGS)
 {
     int rc = ACR_ENOENT;
 
-    if (IS_JOBJECT_NULL(_E, _O))
+    if (IS_JOBJECT_NULL(env, obj))
         return ACR_EINVAL;
     if (CLAZZ_LOADED) {
-        CALL_VMETHOD0(0001, _O);
-        if ((*_E)->ExceptionCheck(_E)) {
-            (*_E)->ExceptionClear(_E);
+        CALL_VMETHOD0(0001, obj);
+        if ((*env)->ExceptionCheck(env)) {
+            (*env)->ExceptionClear(env);
             rc = ACR_EBUSY;
         }
         else
@@ -122,12 +122,12 @@ AcrObjectNotifyAll(JNI_STDARGS)
 {
     int rc = ACR_ENOENT;
 
-    if (IS_JOBJECT_NULL(_E, _O))
+    if (IS_JOBJECT_NULL(env, obj))
         return ACR_EINVAL;
     if (CLAZZ_LOADED) {
-        CALL_VMETHOD0(0002, _O);
-        if ((*_E)->ExceptionCheck(_E)) {
-            (*_E)->ExceptionClear(_E);
+        CALL_VMETHOD0(0002, obj);
+        if ((*env)->ExceptionCheck(env)) {
+            (*env)->ExceptionClear(env);
             rc = ACR_EBUSY;
         }
         else
@@ -141,12 +141,12 @@ AcrObjectWait0(JNI_STDARGS)
 {
     int rc = ACR_ENOENT;
 
-    if (IS_JOBJECT_NULL(_E, _O))
+    if (IS_JOBJECT_NULL(env, obj))
         return ACR_EINVAL;
     if (CLAZZ_LOADED) {
-        CALL_VMETHOD0(0005, _O);
-        if ((*_E)->ExceptionCheck(_E)) {
-            (*_E)->ExceptionClear(_E);
+        CALL_VMETHOD0(0005, obj);
+        if ((*env)->ExceptionCheck(env)) {
+            (*env)->ExceptionClear(env);
             rc = ACR_TIMEUP;
         }
         else
@@ -160,12 +160,12 @@ AcrObjectWait1(JNI_STDARGS, jlong ms)
 {
     int rc = ACR_ENOENT;
 
-    if (IS_JOBJECT_NULL(_E, _O))
+    if (IS_JOBJECT_NULL(env, obj))
         return ACR_EINVAL;
     if (CLAZZ_LOADED) {
-        CALL_VMETHOD1(0003, _O, ms);
-        if ((*_E)->ExceptionCheck(_E)) {
-            (*_E)->ExceptionClear(_E);
+        CALL_VMETHOD1(0003, obj, ms);
+        if ((*env)->ExceptionCheck(env)) {
+            (*env)->ExceptionClear(env);
             rc = ACR_TIMEUP;
         }
         else
@@ -179,12 +179,12 @@ AcrObjectWait2(JNI_STDARGS, jlong ms, ji
 {
     int rc = ACR_ENOENT;
 
-    if (IS_JOBJECT_NULL(_E, _O))
+    if (IS_JOBJECT_NULL(env, obj))
         return ACR_EINVAL;
     if (CLAZZ_LOADED) {
-        CALL_VMETHOD2(0004, _O, ms, ns);
-        if ((*_E)->ExceptionCheck(_E)) {
-            (*_E)->ExceptionClear(_E);
+        CALL_VMETHOD2(0004, obj, ms, ns);
+        if ((*env)->ExceptionCheck(env)) {
+            (*env)->ExceptionClear(env);
             rc = ACR_TIMEUP;
         }
         else
@@ -196,10 +196,10 @@ AcrObjectWait2(JNI_STDARGS, jlong ms, ji
 void
 AcrObjectFinalize(JNI_STDARGS)
 {
-    if (IS_JOBJECT_NULL(_E, _O))
+    if (IS_JOBJECT_NULL(env, obj))
         return;
     if (CLAZZ_LOADED) {
-        CALL_VMETHOD0(0006, _O);
+        CALL_VMETHOD0(0006, obj);
     }
 }
 
@@ -209,14 +209,14 @@ AcrGetObjectMethod(JNI_STDARGS, const ch
     jmethodID id;
     jclass clazz;
 
-    if (IS_JOBJECT_NULL(_E, _O))
+    if (IS_JOBJECT_NULL(env, obj))
         return 0;
-    clazz = (*_E)->GetObjectClass(_E, _O);
+    clazz = (*env)->GetObjectClass(env, obj);
     if (!clazz)
         return 0;
 
-    id = (*_E)->GetMethodID(_E, clazz, name, sig);
-    (*_E)->DeleteLocalRef(_E, clazz);
+    id = (*env)->GetMethodID(env, clazz, name, sig);
+    (*env)->DeleteLocalRef(env, clazz);
 
     return id;
 }
@@ -226,10 +226,10 @@ AcrGetObjectClass(JNI_STDARGS)
 {
     jobject c = 0;
 
-    if (IS_JOBJECT_NULL(_E, _O))
+    if (IS_JOBJECT_NULL(env, obj))
         return c;
     if (CLAZZ_LOADED) {
-        c = CALL_METHOD0(Object, 0007, _O);
+        c = CALL_METHOD0(Object, 0007, obj);
     }
 
     return c;

Modified: commons/sandbox/runtime/trunk/src/main/native/shared/observer.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/shared/observer.c?rev=1091194&r1=1091193&r2=1091194&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/shared/observer.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/shared/observer.c Mon Apr 11 20:20:52 2011
@@ -41,7 +41,7 @@ ACR_CLASS_CTOR(Observer)
 {
     int rv;
 
-    if ((rv = AcrLoadClass(_E, &_clazzn, 0)) != 0)
+    if ((rv = AcrLoadClass(env, &_clazzn, 0)) != 0)
         return rv;
     J_LOAD_METHOD(0000);
 
@@ -51,21 +51,21 @@ ACR_CLASS_CTOR(Observer)
 
 ACR_CLASS_DTOR(Observer)
 {
-    AcrUnloadClass(_E, &_clazzn);
+    AcrUnloadClass(env, &_clazzn);
 }
 
 int
 AcrObserverUpdate(JNI_STDARGS, jobject o, jobject arg)
 {
-    if (_O == 0)
+    if (obj == 0)
         return ACR_EINVAL;
-    if (_E == 0)
-        _E = AcrGetJNIEnv();
-    if (IS_INVALID_HANDLE(_E))
+    if (env == 0)
+        env = AcrGetJNIEnv();
+    if (IS_INVALID_HANDLE(env))
         return ACR_ENOJNIENV;
-    CALL_VMETHOD2(0000, _O, o, arg);
-    if ((*_E)->ExceptionCheck(_E) == JNI_TRUE) {
-        (*_E)->ExceptionClear(_E);
+    CALL_VMETHOD2(0000, obj, o, arg);
+    if ((*env)->ExceptionCheck(env) == JNI_TRUE) {
+        (*env)->ExceptionClear(env);
         return ACR_EGENERAL;
     }
     return 0;

Modified: commons/sandbox/runtime/trunk/src/main/native/shared/reflect.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/shared/reflect.c?rev=1091194&r1=1091193&r2=1091194&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/shared/reflect.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/shared/reflect.c Mon Apr 11 20:20:52 2011
@@ -31,7 +31,7 @@ ACR_JNI_EXPORT(jobject, Reflect, findCla
     jobject c = 0;
     WITH_CSTR(name) {
         _jni_classname(J2S(name));
-        c = (jobject)(*_E)->FindClass(_E, J2S(name));
+        c = (jobject)(*env)->FindClass(env, J2S(name));
         /* XXX: Do we need some reference here?
          */
     }
@@ -51,9 +51,9 @@ ACR_JNI_EXPORT(jlong, Reflect, getMethod
     WITH_CSTR(sig) {
         jmethodID mid;
         if (isStatic)
-            mid = (*_E)->GetStaticMethodID(_E, clazz, J2S(name), J2S(sig));
+            mid = (*env)->GetStaticMethodID(env, clazz, J2S(name), J2S(sig));
         else
-            mid = (*_E)->GetMethodID(_E, clazz, J2S(name), J2S(sig));
+            mid = (*env)->GetMethodID(env, clazz, J2S(name), J2S(sig));
         id = P2J(mid);
     } DONE_WITH_STR(sig);
     } DONE_WITH_STR(name);
@@ -72,9 +72,9 @@ ACR_JNI_EXPORT(jlong, Reflect, getField0
     WITH_CSTR(sig) {
         jfieldID fid;
         if (isStatic)
-            fid = (*_E)->GetStaticFieldID(_E, clazz, J2S(name), J2S(sig));
+            fid = (*env)->GetStaticFieldID(env, clazz, J2S(name), J2S(sig));
         else
-            fid = (*_E)->GetFieldID(_E, clazz, J2S(name), J2S(sig));
+            fid = (*env)->GetFieldID(env, clazz, J2S(name), J2S(sig));
         id = P2J(fid);
     } DONE_WITH_STR(sig);
     } DONE_WITH_STR(name);
@@ -86,7 +86,7 @@ ACR_JNI_EXPORT(jobject, Reflect, toMetho
                                             jlong methodId,
                                             jboolean isStatic)
 {
-    return (*_E)->ToReflectedMethod(_E, clazz, J2P(methodId, jmethodID), isStatic);
+    return (*env)->ToReflectedMethod(env, clazz, J2P(methodId, jmethodID), isStatic);
 }
 
 ACR_JNI_EXPORT(jobject, Reflect, toField0)(JNI_STDARGS,
@@ -94,15 +94,15 @@ ACR_JNI_EXPORT(jobject, Reflect, toField
                                            jlong fieldId,
                                            jboolean isStatic)
 {
-    return (*_E)->ToReflectedField(_E, clazz, J2P(fieldId, jfieldID), isStatic);
+    return (*env)->ToReflectedField(env, clazz, J2P(fieldId, jfieldID), isStatic);
 }
 
-ACR_JNI_EXPORT(jint, Reflect, getRefType0)(JNI_STDARGS, jobject obj)
+ACR_JNI_EXPORT(jint, Reflect, getRefType0)(JNI_STDARGS, jobject o)
 {
-    return (jint)(*_E)->GetObjectRefType(_E, obj);
+    return (jint)(*env)->GetObjectRefType(env, o);
 }
 
 ACR_JNI_EXPORT(jobject, Reflect, allocObject0)(JNI_STDARGS, jclass clazz)
 {
-    return (*_E)->AllocObject(_E, clazz);
+    return (*env)->AllocObject(env, clazz);
 }

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=1091194&r1=1091193&r2=1091194&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/shared/string.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/shared/string.c Mon Apr 11 20:20:52 2011
@@ -47,7 +47,7 @@ ACR_CLASS_CTOR(String)
 {
     int rv;
 
-    if ((rv = AcrLoadClass(_E, &_clazzn, 0)) != ACR_SUCCESS)
+    if ((rv = AcrLoadClass(env, &_clazzn, 0)) != ACR_SUCCESS)
         return rv;
     J_LOAD_METHOD(0000);
     J_LOAD_METHOD(0001);
@@ -59,7 +59,7 @@ ACR_CLASS_CTOR(String)
 
 ACR_CLASS_DTOR(String)
 {
-    AcrUnloadClass(_E, &_clazzn);
+    AcrUnloadClass(env, &_clazzn);
 }
 
 static const char *iso_8859_1_aliases[] = {
@@ -144,13 +144,13 @@ AcrGetNativeCodePage(const char *cs)
     return ACR_CP_DEFAULT;
 }
 
-static char *get_string_iso_8859_1(JNIEnv *_E, jstring str, char *b)
+static char *get_string_iso_8859_1(JNIEnv *env, jstring str, char *b)
 {
     jsize sl;
     const jchar *sr;
     char *rv;
 
-    sl = (*_E)->GetStringLength(_E, str);
+    sl = (*env)->GetStringLength(env, str);
     if (b && sl < ACR_PBUFF_LEN)
         rv = b;
     else {
@@ -165,7 +165,7 @@ static char *get_string_iso_8859_1(JNIEn
         *rv = '\0';
         return rv;
     }
-    sr = (*_E)->GetStringCritical(_E, str, 0);
+    sr = (*env)->GetStringCritical(env, str, 0);
     if (!sr) {
         if (rv != b)
             AcrFree(rv);
@@ -177,7 +177,7 @@ static char *get_string_iso_8859_1(JNIEn
             rv[i] = (char)(sr[i] & 0xFF);
     }
     rv[sl] = '\0';
-    (*_E)->ReleaseStringCritical(_E, str, sr);
+    (*env)->ReleaseStringCritical(env, str, sr);
     return rv;
 }
 
@@ -647,7 +647,7 @@ static int java_utf8_to_ucs2(const char 
 }
 
 jchar *
-AcrUtf8ToUcs2(JNIEnv *_E, const char *str)
+AcrUtf8ToUcs2(JNIEnv *env, const char *str)
 {
     int rc;
     jsize len, out;
@@ -667,7 +667,7 @@ AcrUtf8ToUcs2(JNIEnv *_E, const char *st
 }
 
 wchar_t *
-AcrUtf8ToWcs(JNIEnv *_E, const char *str)
+AcrUtf8ToWcs(JNIEnv *env, const char *str)
 {
     int rc;
     size_t len, out;
@@ -687,7 +687,7 @@ AcrUtf8ToWcs(JNIEnv *_E, const char *str
 }
 
 char *
-AcrUsc2ToUtf8(JNIEnv *_E, const jchar *str, jsize len)
+AcrUsc2ToUtf8(JNIEnv *env, const jchar *str, jsize len)
 {
     int rc;
     jsize out;
@@ -706,13 +706,13 @@ AcrUsc2ToUtf8(JNIEnv *_E, const jchar *s
     return dst;
 }
 
-static char *get_string_utf_8(JNIEnv *_E, jstring str, char *b)
+static char *get_string_utf_8(JNIEnv *env, jstring str, char *b)
 {
     jsize sl, nl;
     const jchar *sr;
     char *rv;
 
-    sl = (*_E)->GetStringLength(_E, str);
+    sl = (*env)->GetStringLength(env, str);
     nl = sl * 3;
     if (b && nl < ACR_PBUFF_LEN)
         rv = b;
@@ -728,7 +728,7 @@ static char *get_string_utf_8(JNIEnv *_E
         *rv = '\0';
         return rv;
     }
-    sr = (*_E)->GetStringCritical(_E, str, 0);
+    sr = (*env)->GetStringCritical(env, str, 0);
     if (!sr) {
         if (rv != b)
             AcrFree(rv);
@@ -746,11 +746,11 @@ static char *get_string_utf_8(JNIEnv *_E
             return 0;
         }
     }
-    (*_E)->ReleaseStringCritical(_E, str, sr);
+    (*env)->ReleaseStringCritical(env, str, sr);
     return rv;
 }
 
-static char *get_string_default(JNIEnv *_E, jstring str, char *b)
+static char *get_string_default(JNIEnv *env, jstring str, char *b)
 {
     jbyteArray sb = 0;
     char *rv = 0;
@@ -760,10 +760,10 @@ static char *get_string_default(JNIEnv *
         return 0;
     }
     sb = CALL_METHOD0(Object, 0002, str);
-    if ((*_E)->ExceptionCheck(_E))
+    if ((*env)->ExceptionCheck(env))
         return 0;
     else {
-        jint len = (*_E)->GetArrayLength(_E, sb);
+        jint len = (*env)->GetArrayLength(env, sb);
         if (b && len < ACR_PBUFF_LEN) {
             /* Use provided stack storage */
             rv = b;
@@ -771,30 +771,30 @@ static char *get_string_default(JNIEnv *
         else {
             rv = ACR_MALLOC(char, len + 1);
             if (rv == 0) {
-                (*_E)->DeleteLocalRef(_E, sb);
+                (*env)->DeleteLocalRef(env, sb);
                 return 0;
             }
         }
         if (len > 0) {
             /* Copy bytes to the provided buffer
              */
-            (*_E)->GetByteArrayRegion(_E, sb, 0, len, (jbyte *)rv);
+            (*env)->GetByteArrayRegion(env, sb, 0, len, (jbyte *)rv);
         }
         rv[len] = '\0'; /* NUL-terminate */
     }
-    (*_E)->DeleteLocalRef(_E, sb);
+    (*env)->DeleteLocalRef(env, sb);
     return rv;
 }
 
-static jstring new_string_zerolen(JNIEnv *_E)
+static jstring new_string_zerolen(JNIEnv *env)
 {
     if (!CLAZZ_LOADED) {
         ACR_SET_OS_ERROR(ACR_EINIT);
         return 0;
     }
-    return (*_E)->NewObject(_E, _clazzn.i, J4MID(0000));
+    return (*env)->NewObject(env, _clazzn.i, J4MID(0000));
 }
-static jstring new_string_default(JNIEnv *_E, const char *str)
+static jstring new_string_default(JNIEnv *env, const char *str)
 {
     jstring    rs;
     jbyteArray ba;
@@ -806,25 +806,25 @@ static jstring new_string_default(JNIEnv
     }
     sl = (jsize)strlen(str);
     if (sl == 0) {
-        return new_string_zerolen(_E);
+        return new_string_zerolen(env);
     }
-    ba = (*_E)->NewByteArray(_E, sl);
+    ba = (*env)->NewByteArray(env, sl);
     if (ba != 0) {
-        (*_E)->SetByteArrayRegion(_E, ba, 0, sl, (jbyte *)str);
-        rs = (*_E)->NewObject(_E, _clazzn.i, J4MID(0001), ba);
-        (*_E)->DeleteLocalRef(_E, ba);
+        (*env)->SetByteArrayRegion(env, ba, 0, sl, (jbyte *)str);
+        rs = (*env)->NewObject(env, _clazzn.i, J4MID(0001), ba);
+        (*env)->DeleteLocalRef(env, ba);
         return rs;
     }
     return 0;
 }
 
-static jstring new_string_iso_8859_1(JNIEnv *_E, const char *s)
+static jstring new_string_iso_8859_1(JNIEnv *env, const char *s)
 {
     jstring rs = 0;
     jsize sl = (jsize)strlen(s);
 
     if (sl == 0) {
-        return new_string_zerolen(_E);
+        return new_string_zerolen(env);
     }
     else if (sl < ACR_MBUFF_SIZ) {
         jchar  cc[ACR_MBUFF_SIZ];
@@ -832,7 +832,7 @@ static jstring new_string_iso_8859_1(JNI
         for (i = 0; i < sl; i++) {
             cc[i] = s[i];
         }
-        rs = (*_E)->NewString(_E, cc, sl);
+        rs = (*env)->NewString(env, cc, sl);
     }
     else {
         jchar  *cc;
@@ -841,20 +841,20 @@ static jstring new_string_iso_8859_1(JNI
             for (i = 0; i < sl; i++) {
                 cc[i] = s[i];
             }
-            rs = (*_E)->NewString(_E, cc, sl);
+            rs = (*env)->NewString(env, cc, sl);
             AcrFree(cc);
         }
     }
     return rs;
 }
 
-static jstring new_string_cp_1252(JNIEnv *_E, const char *s)
+static jstring new_string_cp_1252(JNIEnv *env, const char *s)
 {
     jstring rs = 0;
     jsize sl = (jsize)strlen(s);
 
     if (sl == 0) {
-        return new_string_zerolen(_E);
+        return new_string_zerolen(env);
     }
     else if (sl < ACR_MBUFF_SIZ) {
         jchar  cc[ACR_MBUFF_SIZ];
@@ -862,7 +862,7 @@ static jstring new_string_cp_1252(JNIEnv
         for (i = 0; i < sl; i++) {
             cc[i] = _cp_1252[(unsigned char)s[i]];
         }
-        rs = (*_E)->NewString(_E, cc, sl);
+        rs = (*env)->NewString(env, cc, sl);
     }
     else {
         jchar  *cc;
@@ -871,27 +871,27 @@ static jstring new_string_cp_1252(JNIEnv
             for (i = 0; i < sl; i++) {
                 cc[i] = _cp_1252[(unsigned char)s[i]];
             }
-            rs = (*_E)->NewString(_E, cc, sl);
+            rs = (*env)->NewString(env, cc, sl);
             AcrFree(cc);
         }
     }
     return rs;
 }
 
-static jstring new_string_utf_8(JNIEnv *_E, const char *s)
+static jstring new_string_utf_8(JNIEnv *env, const char *s)
 {
     jstring rs = 0;
     int ex;
     jsize sl = (jsize)strlen(s);
 
     if (sl == 0) {
-        return new_string_zerolen(_E);
+        return new_string_zerolen(env);
     }
     else if (sl < ACR_MBUFF_SIZ) {
         jchar  cc[ACR_MBUFF_SIZ];
         jsize  wl = ACR_MBUFF_LEN;
         if ((ex = conv_utf8_to_ucs2(s, sl, cc, &wl)) == ACR_SUCCESS)
-            rs = (*_E)->NewString(_E, cc, sl);
+            rs = (*env)->NewString(env, cc, sl);
         else
             ACR_THROW(ACR_EX_EINVAL, ex);
     }
@@ -900,7 +900,7 @@ static jstring new_string_utf_8(JNIEnv *
         if ((cc = ACR_MALLOC(jchar, sl + 1)) != 0) {
             jsize wl = sl;
             if ((ex = conv_utf8_to_ucs2(s, sl, cc, &wl)) == ACR_SUCCESS)
-                rs = (*_E)->NewString(_E, cc, sl);
+                rs = (*env)->NewString(env, cc, sl);
             else
                 ACR_THROW(ACR_EX_EINVAL, ex);
             AcrFree(cc);
@@ -911,7 +911,7 @@ static jstring new_string_utf_8(JNIEnv *
 
 
 wchar_t *
-AcrGetJavaStringW(JNIEnv *_E, jstring str, wchar_t *b)
+AcrGetJavaStringW(JNIEnv *env, jstring str, wchar_t *b)
 {
     jsize sl;
     const jchar *sr;
@@ -920,7 +920,7 @@ AcrGetJavaStringW(JNIEnv *_E, jstring st
     if (str == 0) {
         return 0;
     }
-    sl = (*_E)->GetStringLength(_E, str);
+    sl = (*env)->GetStringLength(env, str);
     if (b && sl < ACR_MBUFF_LEN)
         rv = b;
     else {
@@ -935,7 +935,7 @@ AcrGetJavaStringW(JNIEnv *_E, jstring st
         *rv = L'\0';
         return rv;
     }
-    sr = (*_E)->GetStringCritical(_E, str, 0);
+    sr = (*env)->GetStringCritical(env, str, 0);
     if (sr == 0) {
         if (rv != b)
             AcrFree(rv);
@@ -951,12 +951,12 @@ AcrGetJavaStringW(JNIEnv *_E, jstring st
 #endif
     }
     rv[sl] = L'\0';
-    (*_E)->ReleaseStringCritical(_E, str, sr);
+    (*env)->ReleaseStringCritical(env, str, sr);
     return rv;
 }
 
 char *
-AcrGetJavaStringA(JNIEnv *_E, jstring str, char *b)
+AcrGetJavaStringA(JNIEnv *env, jstring str, char *b)
 {
     char *rv = 0;
 
@@ -965,36 +965,36 @@ AcrGetJavaStringA(JNIEnv *_E, jstring st
     }
     switch (acr_native_codepage) {
         case ACR_CP_ISO8859_1:
-            rv = get_string_iso_8859_1(_E, str, b);
+            rv = get_string_iso_8859_1(env, str, b);
         break;
         case ACR_CP_UTF_8:
-            rv = get_string_utf_8(_E, str, b);
+            rv = get_string_utf_8(env, str, b);
         break;
         default:
-            rv = get_string_default(_E, str, b);
+            rv = get_string_default(env, str, b);
         break;
     }
     return rv;
 }
 
 char *
-AcrGetJavaStringU(JNIEnv *_E, jstring str, char *b)
+AcrGetJavaStringU(JNIEnv *env, jstring str, char *b)
 {
     if (str == 0)
         return 0;
     else
-        return get_string_utf_8(_E, str, b);
+        return get_string_utf_8(env, str, b);
 }
 
 jstring
-AcrNewJavaStringW(JNIEnv *_E, const wchar_t *s)
+AcrNewJavaStringW(JNIEnv *env, const wchar_t *s)
 {
     jstring r = 0;
 
     if (s != 0) {
         size_t l = wcslen(s);
 #if CC_SIZEOF_WCHAR_T == 2
-        r = (*_E)->NewString(_E, (const jchar *)s, (jsize)l);
+        r = (*env)->NewString(env, (const jchar *)s, (jsize)l);
 #else
         if (l < ACR_MBUFF_SIZ) {
             jchar  cc[ACR_MBUFF_SIZ];
@@ -1003,7 +1003,7 @@ AcrNewJavaStringW(JNIEnv *_E, const wcha
                 /* Simply assign utf32 to utf16 */
                 cc[i] = (jchar)s[i];
             }
-            r = (*_E)->NewString(_E, cc, l);
+            r = (*env)->NewString(env, cc, l);
         }
         else {
             jchar  *cc;
@@ -1013,7 +1013,7 @@ AcrNewJavaStringW(JNIEnv *_E, const wcha
                     /* Simply assign utf32 to utf16 */
                     cc[i] = (jchar)s[i];
                 }
-                r = (*_E)->NewString(_E, cc, l);
+                r = (*env)->NewString(env, cc, l);
                 AcrFree(cc);
             }
         }
@@ -1023,7 +1023,7 @@ AcrNewJavaStringW(JNIEnv *_E, const wcha
 }
 
 jstring
-AcrNewJavaStringA(JNIEnv *_E, const char *str)
+AcrNewJavaStringA(JNIEnv *env, const char *str)
 {
     jstring rv = 0;
 
@@ -1031,28 +1031,28 @@ AcrNewJavaStringA(JNIEnv *_E, const char
         return 0;
     switch (acr_native_codepage) {
         case ACR_CP_ISO8859_1:
-            rv = new_string_iso_8859_1(_E, str);
+            rv = new_string_iso_8859_1(env, str);
         break;
         case ACR_CP_UTF_8:
-            rv = new_string_utf_8(_E, str);
+            rv = new_string_utf_8(env, str);
         break;
         case ACR_CP_1252:
-            rv = new_string_cp_1252(_E, str);
+            rv = new_string_cp_1252(env, str);
         break;
         default:
-            rv = new_string_default(_E, str);
+            rv = new_string_default(env, str);
         break;
     }
     return rv;
 }
 
 jstring
-AcrNewJavaStringU(JNIEnv *_E, const char *str)
+AcrNewJavaStringU(JNIEnv *env, const char *str)
 {
     if (str == 0)
         return 0;
     else
-        return new_string_utf_8(_E, str);
+        return new_string_utf_8(env, str);
 }
 
 #if defined(ENABLE_TEST_PRIVATE)
@@ -1061,7 +1061,7 @@ ACR_JNI_EXPORT(jint, TestString, test0)(
 {
     char *cstr;
     jint  clen;
-    cstr = AcrGetJavaStringU(_E, s, 0);
+    cstr = AcrGetJavaStringU(env, s, 0);
     clen = (jint)strlen(cstr);
     AcrFree(cstr);
     return clen;
@@ -1071,7 +1071,7 @@ ACR_JNI_EXPORT(jint, TestString, test1)(
 {
     wchar_t *wstr;
     jint  wlen;
-    wstr = AcrGetJavaStringW(_E, s, 0);
+    wstr = AcrGetJavaStringW(env, s, 0);
     wlen = (jint)wcslen(wstr);
     AcrFree(wstr);
     return wlen;

Modified: commons/sandbox/runtime/trunk/src/main/native/shared/system.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/shared/system.c?rev=1091194&r1=1091193&r2=1091194&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/shared/system.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/shared/system.c Mon Apr 11 20:20:52 2011
@@ -47,7 +47,7 @@ ACR_CLASS_CTOR(System)
 {
     int rv;
 
-    if ((rv = AcrLoadClass(_E, &_clazzn, 0)) != ACR_SUCCESS)
+    if ((rv = AcrLoadClass(env, &_clazzn, 0)) != ACR_SUCCESS)
         return rv;
     J_LOAD_MLOCAL(0000);
     J_LOAD_MLOCAL(0001);
@@ -58,19 +58,19 @@ ACR_CLASS_CTOR(System)
 
 ACR_CLASS_DTOR(System)
 {
-    AcrUnloadClass(_E, &_clazzn);
+    AcrUnloadClass(env, &_clazzn);
 }
 
 int
 AcrSystemExit(JNI_STDENV, jint status)
 {
-    if (_E == 0)
-        _E = AcrGetJNIEnv();
-    if (IS_INVALID_HANDLE(_E))
+    if (env == 0)
+        env = AcrGetJNIEnv();
+    if (IS_INVALID_HANDLE(env))
         return ACR_ENOJNIENV;
     CALL_VMLOCAL1(0000, status);
-    if ((*_E)->ExceptionCheck(_E) == JNI_TRUE) {
-        (*_E)->ExceptionClear(_E);
+    if ((*env)->ExceptionCheck(env) == JNI_TRUE) {
+        (*env)->ExceptionClear(env);
         /* System.exit() can throw only SecurityException
          */
         return ACR_EACCES;
@@ -85,20 +85,20 @@ AcrGetSystemPropertyA(JNI_STDENV, const 
     jstring skey;
     jstring sval;
 
-    if (_E == 0)
-        _E = AcrGetJNIEnv();
-    if (IS_INVALID_HANDLE(_E)) {
+    if (env == 0)
+        env = AcrGetJNIEnv();
+    if (IS_INVALID_HANDLE(env)) {
         ACR_SET_OS_ERROR(ACR_ENOJNIENV);
         return NULL;
     }
-    skey = AcrNewJavaStringA(_E, key);
+    skey = AcrNewJavaStringA(env, key);
     if (skey == 0)
         return 0;
     sval = (jstring)CALL_MLOCAL1(Object, 0001, skey);
-    (*_E)->DeleteLocalRef(_E, skey);
+    (*env)->DeleteLocalRef(env, skey);
     if (sval) {
-        val = AcrGetJavaStringA(_E, sval, NULL);
-        (*_E)->DeleteLocalRef(_E, sval);
+        val = AcrGetJavaStringA(env, sval, NULL);
+        (*env)->DeleteLocalRef(env, sval);
     }
     return val;
 }
@@ -110,20 +110,20 @@ AcrGetSystemPropertyW(JNI_STDENV, const 
     jstring skey;
     jstring sval;
 
-    if (_E == 0)
-        _E = AcrGetJNIEnv();
-    if (IS_INVALID_HANDLE(_E)) {
+    if (env == 0)
+        env = AcrGetJNIEnv();
+    if (IS_INVALID_HANDLE(env)) {
         ACR_SET_OS_ERROR(ACR_ENOJNIENV);
         return NULL;
     }
-    skey = AcrNewJavaStringW(_E, key);
+    skey = AcrNewJavaStringW(env, key);
     if (skey == 0)
         return 0;
     sval = (jstring)CALL_MLOCAL1(Object, 0001, skey);
-    (*_E)->DeleteLocalRef(_E, skey);
+    (*env)->DeleteLocalRef(env, skey);
     if (sval) {
-        val = AcrGetJavaStringW(_E, sval, NULL);
-        (*_E)->DeleteLocalRef(_E, sval);
+        val = AcrGetJavaStringW(env, sval, NULL);
+        (*env)->DeleteLocalRef(env, sval);
     }
     return val;
 }

Modified: commons/sandbox/runtime/trunk/src/main/native/shared/unsafe.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/shared/unsafe.c?rev=1091194&r1=1091193&r2=1091194&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/shared/unsafe.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/shared/unsafe.c Mon Apr 11 20:20:52 2011
@@ -69,7 +69,7 @@ ACR_CLASS_CTOR(Unsafe)
 {
     int rv;
 
-    if ((rv = AcrLoadClass(_E, &_clazzn, 0)) != ACR_SUCCESS)
+    if ((rv = AcrLoadClass(env, &_clazzn, 0)) != ACR_SUCCESS)
         return rv;
 
     J_LOAD_SFIELD(0000);
@@ -85,7 +85,7 @@ ACR_CLASS_CTOR(Unsafe)
 
 ACR_CLASS_DTOR(Unsafe)
 {
-    AcrUnloadClass(_E, &_clazzn);
+    AcrUnloadClass(env, &_clazzn);
 }
 
 static jobject _unsafe_instance = 0;
@@ -103,10 +103,10 @@ jint
 AcrUnsafeObjectFieldOffset(JNI_STDARGS)
 {
     jlong fo;
-    if (_get_unsafe(_E) == 0) {
+    if (_get_unsafe(env) == 0) {
         return INVALID_FIELD_OFFSET;
     }
-    fo = CALL_METHOD1(Long, 0002, _unsafe_instance, _O);
+    fo = CALL_METHOD1(Long, 0002, _unsafe_instance, obj);
     if (fo > 0 && fo < INT_MAX)
         return (jint)fo;
     else
@@ -117,10 +117,10 @@ jint
 AcrUnsafeStaticFieldBase(JNI_STDARGS)
 {
     jlong fo;
-    if (_get_unsafe(_E) == 0) {
+    if (_get_unsafe(env) == 0) {
         return INVALID_FIELD_OFFSET;
     }
-    fo = CALL_METHOD1(Long, 0003, _unsafe_instance, _O);
+    fo = CALL_METHOD1(Long, 0003, _unsafe_instance, obj);
     if (fo > 0 && fo < INT_MAX)
         return (jint)fo;
     else
@@ -131,10 +131,10 @@ jint
 AcrUnsafeStaticFieldOffset(JNI_STDARGS)
 {
     jlong fo;
-    if (_get_unsafe(_E) == 0) {
+    if (_get_unsafe(env) == 0) {
         return INVALID_FIELD_OFFSET;
     }
-    fo = CALL_METHOD1(Long, 0004, _unsafe_instance, _O);
+    fo = CALL_METHOD1(Long, 0004, _unsafe_instance, obj);
     if (fo > 0 && fo < INT_MAX)
         return (jint)fo;
     else
@@ -149,10 +149,10 @@ AcrUnsafeObjectFieldIdOffset(JNI_STDENV,
 
     if (!CLAZZ_LOADED)
         return off;
-    fld = (*_E)->ToReflectedField(_E, cls, fid, JNI_FALSE);
+    fld = (*env)->ToReflectedField(env, cls, fid, JNI_FALSE);
     if (fld != 0) {
-        off = AcrUnsafeObjectFieldOffset(_E, fld);
-        (*_E)->DeleteLocalRef(_E, fld);
+        off = AcrUnsafeObjectFieldOffset(env, fld);
+        (*env)->DeleteLocalRef(env, fld);
     }
     return off;
 }
@@ -165,32 +165,32 @@ AcrUnsafeStaticFieldIdOffset(JNI_STDENV,
 
     if (!CLAZZ_LOADED)
         return off;
-    fld = (*_E)->ToReflectedField(_E, cls, fid, JNI_TRUE);
+    fld = (*env)->ToReflectedField(env, cls, fid, JNI_TRUE);
     if (fld != 0) {
-        off = AcrUnsafeStaticFieldOffset(_E, fld);
-        (*_E)->DeleteLocalRef(_E, fld);
+        off = AcrUnsafeStaticFieldOffset(env, fld);
+        (*env)->DeleteLocalRef(env, fld);
     }
     return off;
 }
 
 ACR_JNI_EXPORT(jobject, Unsafe, get0)(JNI_STDARGS)
 {
-    return _get_unsafe(_E);
+    return _get_unsafe(env);
 }
 
 ACR_JNI_EXPORT(jint, Unsafe, get1)(JNI_STDARGS, jobject field)
 {
-    return AcrUnsafeObjectFieldOffset(_E, field);
+    return AcrUnsafeObjectFieldOffset(env, field);
 }
 
 ACR_JNI_EXPORT(jint, Unsafe, get2)(JNI_STDARGS, jobject field)
 {
-    return AcrUnsafeStaticFieldBase(_E, field);
+    return AcrUnsafeStaticFieldBase(env, field);
 }
 
 ACR_JNI_EXPORT(jint, Unsafe, get3)(JNI_STDARGS, jobject field)
 {
-    return AcrUnsafeStaticFieldOffset(_E, field);
+    return AcrUnsafeStaticFieldOffset(env, field);
 }
 
 #if defined(ENABLE_TEST_PRIVATE)

Modified: commons/sandbox/runtime/trunk/src/main/native/shared/uuid.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/shared/uuid.c?rev=1091194&r1=1091193&r2=1091194&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/shared/uuid.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/shared/uuid.c Mon Apr 11 20:20:52 2011
@@ -22,13 +22,13 @@ ACR_UTIL_EXPORT(jbyteArray, UUID, init0)
     unsigned int bb[4];
     jbyteArray rv;
 
-    rv = (*_E)->NewByteArray(_E, 16);
+    rv = (*env)->NewByteArray(env, 16);
     if (rv != 0) {
         bb[0] = arc4random();
         bb[1] = arc4random();
         bb[2] = arc4random();
         bb[3] = arc4random();
-        (*_E)->SetByteArrayRegion(_E, rv, 0, 16, (jbyte *)bb);
+        (*env)->SetByteArrayRegion(env, rv, 0, 16, (jbyte *)bb);
     }
     return rv;
 }



Mime
View raw message