diff options
author | Tom Tromey <tromey@cygnus.com> | 1999-09-02 23:44:04 +0000 |
---|---|---|
committer | Tom Tromey <tromey@gcc.gnu.org> | 1999-09-02 23:44:04 +0000 |
commit | 3a5395a311b5fff0b87edf3eeef99cff9f0d4354 (patch) | |
tree | 06b3fd05ead2741160cf19f4556e115de5541464 /gcc/java/gjavah.c | |
parent | ad7342be69761f32de99198fd8461cbcc4ff884e (diff) | |
download | gcc-3a5395a311b5fff0b87edf3eeef99cff9f0d4354.zip gcc-3a5395a311b5fff0b87edf3eeef99cff9f0d4354.tar.gz gcc-3a5395a311b5fff0b87edf3eeef99cff9f0d4354.tar.bz2 |
gjavah.c (decode_signature_piece): Emit "::" in JArray<>.
* gjavah.c (decode_signature_piece): Emit "::" in JArray<>.
Handle nested arrays, like `[[I'.
From-SVN: r29067
Diffstat (limited to 'gcc/java/gjavah.c')
-rw-r--r-- | gcc/java/gjavah.c | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/gcc/java/gjavah.c b/gcc/java/gjavah.c index 0859e3d..1fd8493 100644 --- a/gcc/java/gjavah.c +++ b/gcc/java/gjavah.c @@ -695,10 +695,13 @@ decode_signature_piece (stream, signature, limit, need_space) int *need_space; { const char *ctype; + int array_depth = 0; switch (signature[0]) { case '[': + /* More spaghetti. */ + array_loop: for (signature++; (signature < limit && *signature >= '0' && *signature <= '9'); signature++) @@ -713,13 +716,17 @@ decode_signature_piece (stream, signature, limit, need_space) case 'S': ctype = "jshortArray"; goto printit; case 'J': ctype = "jlongArray"; goto printit; case 'Z': ctype = "jbooleanArray"; goto printit; - case '[': ctype = "jobjectArray"; goto printit; + case '[': + /* We have a nested array. */ + ++array_depth; + fputs ("JArray<", stream); + goto array_loop; + case 'L': - /* We have to generate a reference to JArray here, - so that our output matches what the compiler - does. */ + /* We have to generate a reference to JArray here, so that + our output matches what the compiler does. */ ++signature; - fputs ("JArray<", stream); + fputs ("JArray<::", stream); while (signature < limit && *signature != ';') { int ch = UTF8_GET (signature, limit); @@ -781,6 +788,9 @@ decode_signature_piece (stream, signature, limit, need_space) break; } + while (array_depth-- > 0) + fputs ("> *", stream); + return signature; } |