JIMS: forgot jchar unwrappers 73/12773/2
Calixte DENIZET [Tue, 1 Oct 2013 12:44:43 +0000 (14:44 +0200)]
Change-Id: If4d23f475ac51a787e14a5fdd4484b29a632dc48

scilab/modules/external_objects_java/src/cpp/ScilabJavaEnvironmentWrapper.cpp
scilab/modules/external_objects_java/src/cpp/ScilabJavaEnvironmentWrapper.hxx

index abbfea3..7ddf685 100644 (file)
@@ -498,17 +498,20 @@ void ScilabJavaEnvironmentWrapper::unwrapmatshort(int id, const ScilabShortStack
 
 void ScilabJavaEnvironmentWrapper::unwrapushort(int id, const ScilabUShortStackAllocator & allocator) const
 {
-    // Not called
+    JavaVM * vm = getScilabJavaVM();
+    unwrapSingle<jchar, unsigned short>(vm, id, allocator);
 }
 
 void ScilabJavaEnvironmentWrapper::unwraprowushort(int id, const ScilabUShortStackAllocator & allocator) const
 {
-    // Not called
+    JavaVM * vm = getScilabJavaVM();
+    unwrapRow<jchar, unsigned short>(vm, id, allocator);
 }
 
 void ScilabJavaEnvironmentWrapper::unwrapmatushort(int id, const ScilabUShortStackAllocator & allocator) const
 {
-    // Not called
+    JavaVM * vm = getScilabJavaVM();
+    unwrapMat<jchar, unsigned short>(vm, id, allocator);
 }
 
 void ScilabJavaEnvironmentWrapper::unwrapint(int id, const ScilabIntStackAllocator & allocator) const
index e674c4b..03c6d07 100644 (file)
@@ -79,6 +79,10 @@ class ScilabJavaEnvironmentWrapper : public ScilabAbstractEnvironmentWrapper
     jmethodID unwrapRowFloatID_;
     jmethodID unwrapMatFloatID_;
 
+    jmethodID unwrapCharID_;
+    jmethodID unwrapRowCharID_;
+    jmethodID unwrapMatCharID_;
+
     jmethodID wrapAsDirectByteBufferID_;
     jmethodID wrapAsDirectDoubleBufferID_;
     jmethodID wrapAsDirectIntBufferID_;
@@ -129,6 +133,10 @@ public:
         unwrapRowFloatID_ = curEnv->GetStaticMethodID(ScilabJavaObjectClass_, "unwrapRowFloat", "(I)Ljava/lang/Object;");
         unwrapMatFloatID_ = curEnv->GetStaticMethodID(ScilabJavaObjectClass_, "unwrapMatFloat", "(I)[[F");
 
+        unwrapCharID_ = curEnv->GetStaticMethodID(ScilabJavaObjectClass_, "unwrapChar", "(I)C");
+        unwrapRowCharID_ = curEnv->GetStaticMethodID(ScilabJavaObjectClass_, "unwrapRowChar", "(I)Ljava/lang/Object;");
+        unwrapMatCharID_ = curEnv->GetStaticMethodID(ScilabJavaObjectClass_, "unwrapMatChar", "(I)[[C");
+
         wrapAsDirectByteBufferID_ = curEnv->GetStaticMethodID(ScilabJavaObjectClass_, "wrapAsDirectByteBuffer", "(Ljava/nio/ByteBuffer;)I");
         wrapAsDirectDoubleBufferID_ = curEnv->GetStaticMethodID(ScilabJavaObjectClass_, "wrapAsDirectDoubleBuffer", "(Ljava/nio/ByteBuffer;)I");
         wrapAsDirectIntBufferID_ = curEnv->GetStaticMethodID(ScilabJavaObjectClass_, "wrapAsDirectIntBuffer", "(Ljava/nio/ByteBuffer;)I");
@@ -432,7 +440,7 @@ private:
     }
     inline const jmethodID getSingleMethod(const unsigned short * x) const
     {
-        return unwrapShortID_;
+        return unwrapCharID_;
     }
     inline const jmethodID getSingleMethod(const int * x) const
     {
@@ -465,7 +473,7 @@ private:
     }
     inline const jmethodID getRowMethod(const unsigned short * x) const
     {
-        return unwrapRowShortID_;
+        return unwrapRowCharID_;
     }
     inline const jmethodID getRowMethod(const int * x) const
     {
@@ -498,7 +506,7 @@ private:
     }
     inline const jmethodID getMatMethod(const unsigned short * x) const
     {
-        return unwrapMatShortID_;
+        return unwrapMatCharID_;
     }
     inline const jmethodID getMatMethod(const int * x) const
     {