[kaffe] jni & two dimensional arrays
    Daniel Dittmann 
    ddittmann at gmx.de
       
    Mon Sep 22 23:24:02 PDT 2003
    
    
  
Hi all,
i want to call an jni-function with an parameter of two-dimensional 
array of int.
The complete example from:
http://developer.java.sun.com/developer/onlineTraining/Programming/JDCBook/jnistring.html#multi
public class ArrayManipulation {
***snip***
public native void manipulateArray(
		int[][] multiplier, Boolean lock);
***snip***
}
The generation of the c-headerfile failed.
 >/usr/local/kaffe/bin/javac ArrayManipulation.java
 >export CLASSPATH=./:/usr/local/kaffe/jre/lib/rt.jar
 >/usr/local/kaffe/bin/javah ArrayManipulation
bogus array type `['
The attached patch fixed this error.
Thank you
Daniel
diff -Naur kaffe/kaffe/kaffeh/support.c kaffe.patched/kaffe/kaffeh/support.c
--- kaffe/kaffe/kaffeh/support.c	2003-09-19 10:51:56.000000000 +0200
+++ kaffe.orig/kaffe/kaffeh/support.c	2003-08-01 00:46:45.000000000 +0200
@@ -311,6 +311,7 @@
  		case 'D':
  			return "jdoubleArray";
  		case 'L':
+		case '[':
  			return "jobjectArray";
  		default:
  			dprintf("bogus array type `%c'", sig[1]);
    
    
More information about the kaffe
mailing list