Commit 5152512c by Tom Tromey Committed by Tom Tromey

jni.cc (add_char): Correctly encode non-ascii characters.

	* jni.cc (add_char): Correctly encode non-ascii characters.
	(add_char): Define even when INTERPRETER not defined.
	(mangled_name): Likewise.
	(_Jv_GetJNIEnvNewFrame): Likewise.
	(_Jv_LookupJNIMethod): Likewise.

From-SVN: r41010
parent 23ab86e4
2001-03-30 Tom Tromey <tromey@redhat.com>
* jni.cc (add_char): Correctly encode non-ascii characters.
(add_char): Define even when INTERPRETER not defined.
(mangled_name): Likewise.
(_Jv_GetJNIEnvNewFrame): Likewise.
(_Jv_LookupJNIMethod): Likewise.
2001-03-23 Kevin B Hendricks <khendricks@ivey.uwo.ca> 2001-03-23 Kevin B Hendricks <khendricks@ivey.uwo.ca>
* configure.host: Enable interpreter for PPC. * configure.host: Enable interpreter for PPC.
......
...@@ -1595,8 +1595,6 @@ _Jv_JNI_UnregisterNatives (JNIEnv *, jclass) ...@@ -1595,8 +1595,6 @@ _Jv_JNI_UnregisterNatives (JNIEnv *, jclass)
#ifdef INTERPRETER
// Add a character to the buffer, encoding properly. // Add a character to the buffer, encoding properly.
static void static void
add_char (char *buf, jchar c, int *here) add_char (char *buf, jchar c, int *here)
...@@ -1633,7 +1631,7 @@ add_char (char *buf, jchar c, int *here) ...@@ -1633,7 +1631,7 @@ add_char (char *buf, jchar c, int *here)
for (int i = 0; i < 4; ++i) for (int i = 0; i < 4; ++i)
{ {
int val = c & 0x0f; int val = c & 0x0f;
buf[(*here) + 4 - i] = (val > 10) ? ('a' + val - 10) : ('0' + val); buf[(*here) + 3 - i] = (val > 10) ? ('a' + val - 10) : ('0' + val);
c >>= 4; c >>= 4;
} }
*here += 4; *here += 4;
...@@ -1753,6 +1751,8 @@ _Jv_LookupJNIMethod (jclass klass, _Jv_Utf8Const *name, ...@@ -1753,6 +1751,8 @@ _Jv_LookupJNIMethod (jclass klass, _Jv_Utf8Const *name,
return function; return function;
} }
#ifdef INTERPRETER
// This function is the stub which is used to turn an ordinary (CNI) // This function is the stub which is used to turn an ordinary (CNI)
// method call into a JNI call. // method call into a JNI call.
void void
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment