From: <lin...@us...> - 2010-03-25 17:26:50
|
Revision: 7120 http://octave.svn.sourceforge.net/octave/?rev=7120&view=rev Author: lindnerb Date: 2010-03-25 17:26:44 +0000 (Thu, 25 Mar 2010) Log Message: ----------- mingw32: add a patch to java-1.2.7 for transferring boolean values http://sourceforge.net/mailarchive/forum.php?thread_name=4B59A333.5060302%40net.in.tum.de&forum_name=octave-dev Modified Paths: -------------- trunk/octave-forge/admin/Windows/mingw32/forge/java-1.2.7.patch Modified: trunk/octave-forge/admin/Windows/mingw32/forge/java-1.2.7.patch =================================================================== --- trunk/octave-forge/admin/Windows/mingw32/forge/java-1.2.7.patch 2010-03-25 17:23:23 UTC (rev 7119) +++ trunk/octave-forge/admin/Windows/mingw32/forge/java-1.2.7.patch 2010-03-25 17:26:44 UTC (rev 7120) @@ -1,8 +1,8 @@ -Index: java-1.2.7/PKG_ADD -=================================================================== ---- java-1.2.7/PKG_ADD (revision 7108) -+++ java-1.2.7/PKG_ADD (working copy) -@@ -9,3 +9,31 @@ +Index: java-1.2.7/PKG_ADD +=================================================================== +--- java-1.2.7/PKG_ADD (revision 7108) ++++ java-1.2.7/PKG_ADD (working copy) +@@ -9,3 +9,31 @@ autoload ("java_unsigned_conversion", fullfile (fileparts (mfilename ("fullpath")), "__java__.oct")); autoload ("java_debug", fullfile (fileparts (mfilename ("fullpath")), "__java__.oct")); atexit ("java_exit"); @@ -34,3 +34,32 @@ +if (file_in_path (EXEC_PATH, "xercesImpl.jar")) + javaaddpath (file_in_path (EXEC_PATH, "xercesImpl.jar")); +endif +Index: java-1.2.7/src/__java__.cc +=================================================================== +--- java-1.2.7/src/__java__.cc (revision 7108) ++++ java-1.2.7/src/__java__.cc (working copy) +@@ -765,7 +765,7 @@ + if (jni_env->IsInstanceOf (jobj, cls)) + { + jmethodID m = jni_env->GetMethodID (cls, "booleanValue", "()Z"); +- retval = jni_env->CallBooleanMethod (jobj, m); ++ retval = (jni_env->CallBooleanMethod (jobj, m) ? true : false); + } + } + +@@ -958,6 +958,15 @@ + std::string s = val.string_value (); + jobj = jni_env->NewStringUTF (s.c_str ()); + jcls = jni_env->GetObjectClass (jobj); ++ } ++ else if (val.is_bool_scalar ()) ++ { ++ bool bval = val.bool_value (); ++ jclass_ref bcls (jni_env, jni_env->FindClass ("java/lang/Boolean")); ++ jfieldID fid = jni_env->GetStaticFieldID (bcls, "TYPE", "Ljava/lang/Class;"); ++ jmethodID mid = jni_env->GetMethodID (bcls, "<init>", "(Z)V"); ++ jcls = reinterpret_cast<jclass> (jni_env->GetStaticObjectField(bcls, fid)); ++ jobj = jni_env->NewObject (bcls, mid, bval); + } + else if (val.is_real_scalar ()) + { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |